1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| if (MD.LFACTMODIF.Value= '0') and
( (FAPP.TypeP='BL')or(FAPP.TypeP='RF')or (FAPP.TypeP='CS') // sortie
or (FAPP.TypeP='BR')or(FAPP.TypeP='RC') ) // entree
then begin //PIECE
MD.DFACT.DisableControls;
MD.LFACTMODIF.Value:= '1';
MD.DFACT.First;
while not MD.DFACT.Eof do begin
MD.TART.
if MD.TART.Locate('CODE_ART',VarArrayOf([MD.DFACTCODE_ART.Value]),[])then begin
MD.TART.Edit;
//MD.DFACT.Edit;
if (FAPP.TypeP='BL')or(FAPP.TypeP='RF')or(FAPP.TypeP='CS') then begin //TP
MD.TARTQTTEC.Value:=MD.TARTQTTEC.Value-MD.DFACTQTE.Value;
end
else
begin
if (FAPP.TypeP='BR') then
begin
if MD.TARTPMP.Value= 0 then MD.TARTPMP.Value:=MD.DFACTPRXAR.Value
else MD.TARTPMP.Value:=((MD.TARTPMP.Value*MD.TARTQTTEC.Value)+
(MD.DFACTPRXAR.Value*MD.DFACTQTE.Value))
/(MD.TARTQTTEC.Value+MD.DFACTQTE.Value);
MD.TARTPXACH.Value:=MD.DFACTPRXAR.Value;
end;
MD.TARTQTTEC.Value:=MD.TARTQTTEC.Value+MD.DFACTQTE.Value;
:= Q;
end;//TP
MD.TART .Post;
end;//Locate
MD.DFACT.Next;
end;//While
MD.DFACT.EnableControls;
end;//PIECE |
Partager