18. Mai 2006 22:22
WITH LastItemChargeAssgntPurch DO BEGIN
FromPurchLine.SETRANGE("Document Type","Document Type");
FromPurchLine.SETRANGE("Document No.","Document No.");
FromPurchLine.SETRANGE(Type,FromPurchLine.Type::Item);
IF FromPurchLine.FIND('-') THEN BEGIN
IF NOT ItemChargeAssgntPurch.RECORDLEVELLOCKING THEN
ItemChargeAssgntPurch.LOCKTABLE(TRUE,TRUE);
NextLineNo := "Line No.";
ItemChargeAssgntPurch.RESET;
ItemChargeAssgntPurch.SETRANGE("Document Type","Document Type");
ItemChargeAssgntPurch.SETRANGE("Document No.","Document No.");
ItemChargeAssgntPurch.SETRANGE("Document Line No.","Document Line No.");
ItemChargeAssgntPurch.SETRANGE("Applies-to Doc. No.","Document No.");
REPEAT
IF (FromPurchLine.Quantity <> 0) AND
(FromPurchLine.Quantity <> FromPurchLine."Quantity Invoiced") AND
//MSm STart
// (FromPurchLine."Job No." = '') AND
//MSm Stop
(FromPurchLine."Work Center No." = '') AND
((ReceiptNo = '') OR (FromPurchLine."Receipt No." = ReceiptNo)) AND
FromPurchLine."Allow Item Charge Assignment"
THEN BEGIN
ItemChargeAssgntPurch.SETRANGE("Applies-to Doc. Line No.",FromPurchLine."Line No.");
IF NOT ItemChargeAssgntPurch.FIND('-') THEN
InsertItemChargeAssgnt(
LastItemChargeAssgntPurch,FromPurchLine."Document Type",
"Document No.",FromPurchLine."Line No.",
FromPurchLine."No.",FromPurchLine.Description,NextLineNo);
END;
UNTIL FromPurchLine.NEXT = 0;
END;
END;
18. Mai 2006 23:16
19. Mai 2006 09:54
19. Mai 2006 09:57