Example #1
0
//---------------------------------------------------------------------------
__fastcall TPrihodForm::TPrihodForm(TComponent* Owner, TDocPrihod * doc)
   : TDocumentForm(Owner)
{
   Report = new TFReport();
   Document = doc;
   DocToForm();
   FrameList1->Query = CreateQuery(this, 
         "select p.id_prihod, p.id_tovar,t.kod, t.nametovar,p.kilxkist, p.cina "
         " from Tovar t, Prihod p "
         " where p.nomer = "+IntToStr(Document->Nomer)+
         " and p.id_tovar = t.id_tovar"
         ,true);
   FrameList1->Query->Name = "PrihodDS";
   Refresh();
}
Example #2
0
//---------------------------------------------------------------------------
__fastcall TNakladnaForm::TNakladnaForm(TComponent* Owner, TDocRashod * doc)
   : TDocumentForm(Owner)
{
   Report = new TFReport();
   Document = doc;
   DocToForm();
   FrameList1->Query = CreateQuery(this, 
         "select r.id_rashod, r.id_tovar,t.kod, t.nametovar,r.kilxkist, t.cinaprodazh, r.cina "
         " from Tovar t, Rashod r "
         " where r.nomer = "+IntToStr(Document->Nomer)+
         " and r.id_tovar = t.id_tovar order by r.id_rashod"
         ,true);
   FrameList1->Query->Name = "NakDS";
   TRashod * r = new TRashod(FrameList1->Query->FieldByName("id_rashod")->AsInteger);
   TTovar * t = new TTovar(r->ID_Tovar,Document->Partner->ID_Partner);
   if(t->CinaProdazh != 0)
        cxSpinEditProcent->Value = Round(((t->CinaProdazh - r->Cina)/t->CinaProdazh)*100,0);
   delete r;
   delete t;
   Refresh();

}