If the Invoice is already paid or Partially paid For the Purchase order,again same PO should not allow to post to receive.for this requirement I wrote below code
IF PurchaseHeader.Receive THEN BEGIN
PurInvHdrRec.SETRANGE("Order No.", PurchaseHeader."No.");
IF PurInvHdrRec.FINDSET THEN BEGIN
LineAmt := 0;
RemAmt := 0;
REPEAT
;
LineAmt += PurInvHdrRec.Amount;
RemAmt += PurInvHdrRec."Remaining Amount";
UNTIL (PurInvHdrRec.NEXT = 0);
PurInvHdrRec."Buy-from Vendor Name", PurInvHdrRec."Posting Description");
IF LineAmt <> RemAmt THEN
ERROR('You cannot receive more Items in this Purchase Order');
END;
END;
now my issue is the amount and remaining amount showing 0 for brief clarification pls find the attachment .and kindly help me out
0
Answers
Another way to calculate your sum amount is to use CALCSUM.