|
|
#7 |
|
Участник
|
Цитата:
Код: SalesInvoiceHeader.SETCURRENTKEY("Order No.");
SalesInvoiceHeader.SETRANGE("Order No.","Sales Invoice Header"."Order No.");
SalesInvoiceHeader.SETFILTER("No.",'..%1',"Sales Invoice Header"."No.");
IF SalesInvoiceHeader.FIND('-') THEN
REPEAT
SalesInvoiceLine2.SETRANGE("Document No.",SalesInvoiceHeader."No.");
SalesInvoiceLine2.SETRANGE("Line No.",SalesInvoiceLine."Line No.");
SalesInvoiceLine2.SETRANGE(Type,SalesInvoiceLine.Type);
SalesInvoiceLine2.SETRANGE("No.",SalesInvoiceLine."No.");
SalesInvoiceLine2.SETRANGE("Unit of Measure Code",SalesInvoiceLine."Unit of Measure Code");
IF SalesInvoiceLine2.FIND('-') THEN
REPEAT
TotalQuantity := TotalQuantity + SalesInvoiceLine2.Quantity;
UNTIL SalesInvoiceLine2.NEXT = 0;
UNTIL SalesInvoiceHeader.NEXT = 0;
SalesShipmentLine.SETCURRENTKEY("Order No.","Order Line No.");
SalesShipmentLine.SETRANGE("Order No.","Sales Invoice Header"."Order No.");
SalesShipmentLine.SETRANGE("Order Line No.",SalesInvoiceLine."Line No.");
SalesShipmentLine.SETRANGE("Line No.",SalesInvoiceLine."Line No.");
SalesShipmentLine.SETRANGE(Type,SalesInvoiceLine.Type);
SalesShipmentLine.SETRANGE("No.",SalesInvoiceLine."No.");
SalesShipmentLine.SETRANGE("Unit of Measure Code",SalesInvoiceLine."Unit of Measure Code");
SalesShipmentLine.SETFILTER(Quantity,'<>%1',0);
IF SalesShipmentLine.FIND('-') THEN
REPEAT
и т.д.Что здесь можно бы ло бы оптимизировать? |
|
|