Prepayment sales side

snehasneha Member Posts: 191
Hi,

“Check. Prepmt. When posting” is not checked on Sales & Receivable setup.

I have created a new order, posted a prepayment Invoice. We haven’t received the amount for prepayment invoice, but still, wanted to ship the order. Is that possible? I am getting the below error when trying to ship.

“There are Unpaid prepayment Amounts on Order…….”

Comments

  • chengalasettyvsraochengalasettyvsrao Member Posts: 711
    yes.
  • snehasneha Member Posts: 191
    yes.

    Thanks for the reply. Could you please describe how it can be possible?
  • snehasneha Member Posts: 191
    Any thoughts?
  • chengalasettyvsraochengalasettyvsrao Member Posts: 711
    Even system throws the message( it is not a error message) , press Ok and do the ship/ Receipt.
  • snehasneha Member Posts: 191
    Below is the code from codeunit 439 and it is a error message.

    SalesInvHeader.SETCURRENTKEY("Prepayment Order No.","Prepayment Invoice");
    SalesInvHeader.SETRANGE("Prepayment Order No.",SalesHeader."No.");
    SalesInvHeader.SETRANGE("Prepayment Invoice",TRUE);
    IF SalesInvHeader.FINDSET THEN BEGIN
    REPEAT
    CustLedgerEntry.SETCURRENTKEY("Document No.");
    CustLedgerEntry.SETRANGE("Document Type",CustLedgerEntry."Document Type"::Invoice);
    CustLedgerEntry.SETRANGE("Document No.",SalesInvHeader."No.");
    CustLedgerEntry.SETRANGE(Open,TRUE);
    IF CustLedgerEntry.FIND('-') THEN
    ERROR(STRSUBSTNO(Text001,SalesHeader."Document Type",SalesHeader."No."));
    UNTIL (SalesInvHeader.NEXT = 0);
    END;
  • snehasneha Member Posts: 191
    Any suggestion? Can I comment out the error message and can proceed for the shipment. If I do this, Any possible issues in future?
  • chengalasettyvsraochengalasettyvsrao Member Posts: 711
    sneha wrote:
    Below is the code from codeunit 439 and it is a error message.

    SalesInvHeader.SETCURRENTKEY("Prepayment Order No.","Prepayment Invoice");
    SalesInvHeader.SETRANGE("Prepayment Order No.",SalesHeader."No.");
    SalesInvHeader.SETRANGE("Prepayment Invoice",TRUE);
    IF SalesInvHeader.FINDSET THEN BEGIN
    REPEAT
    CustLedgerEntry.SETCURRENTKEY("Document No.");
    CustLedgerEntry.SETRANGE("Document Type",CustLedgerEntry."Document Type"::Invoice);
    CustLedgerEntry.SETRANGE("Document No.",SalesInvHeader."No.");
    CustLedgerEntry.SETRANGE(Open,TRUE);
    IF CustLedgerEntry.FIND('-') THEN
    ERROR(STRSUBSTNO(Text001,SalesHeader."Document Type",SalesHeader."No."));
    UNTIL (SalesInvHeader.NEXT = 0);
    END;

    I could not find above code in that codeunit ?
  • ssinglassingla Member Posts: 2,973
    I could not find above code in that codeunit ?

    You should check again. The code exist in NAV 2009 SP1 version that is where I have checked
    sneha wrote:
    Any suggestion? Can I comment out the error message and can proceed for the shipment. If I do this, Any possible issues in future?

    Instead of commenting you should uncheck the field "Check Prepmt. when Posting" in sales setup. The purpose of the the functionality is that you can block the posting of Order if payment against prepayment invoice is not received.
    CA Sandeep Singla
    http://ssdynamics.co.in
  • snehasneha Member Posts: 191
    Hi Sandeep,

    Thanks! Yes, I verified the field “Check Prepmt. When Posting” in Sales & Receivables Setup and it is unchecked.
    And, we are using Nav 5.0Sp1 Native. Here is what I am trying to achieve.

    1. Created a order
    2. Posted a prepayment Invoice
    3. Changed the status of the order to open from Pending Prepayment, because prepayment has been delayed and user don’t want to stop the shipment.
    4. Now trying to ship the order. Below is the code from the Post Button,

    IF ApprovalMgt.PrePostApprovalCheck(Rec,PurchaseHeader) THEN BEGIN
    IF ApprovalMgt.TestSalesPrepayment(Rec) THEN
    ERROR(STRSUBSTNO(Text001,"Document Type","No."))
    ELSE BEGIN
    IF ApprovalMgt.TestSalesPayment(Rec) THEN
    ERROR(STRSUBSTNO(Text002,"Document Type","No."))
    ELSE
    CODEUNIT.RUN(CODEUNIT::"Sales-Post (Yes/No)",Rec);
    END;
    END;

    TestSalesPrepayment is a function in codeunit 439, and below is the code in that function.

    SalesLines.SETRANGE("Document Type",SalesHeader."Document Type");
    SalesLines.SETRANGE("Document No.",SalesHeader."No.");
    SalesLines.SETFILTER("Prepmt. Line Amount",'<>%1',0);
    IF SalesLines.FIND('-') THEN BEGIN
    REPEAT
    IF SalesLines."Prepmt. Amt. Inv." <> SalesLines."Prepmt. Line Amount" THEN
    EXIT(TRUE);
    UNTIL SalesLines.NEXT = 0;
    END;

    SalesInvHeader.SETCURRENTKEY("Prepayment Order No.","Prepayment Invoice");
    SalesInvHeader.SETRANGE("Prepayment Order No.",SalesHeader."No.");
    SalesInvHeader.SETRANGE("Prepayment Invoice",TRUE);
    IF SalesInvHeader.FINDSET THEN BEGIN
    REPEAT
    CustLedgerEntry.SETCURRENTKEY("Document No.");
    CustLedgerEntry.SETRANGE("Document Type",CustLedgerEntry."Document Type"::Invoice);
    CustLedgerEntry.SETRANGE("Document No.",SalesInvHeader."No.");
    CustLedgerEntry.SETRANGE(Open,TRUE);
    IF CustLedgerEntry.FIND('-') THEN
    ERROR(STRSUBSTNO(Text001,SalesHeader."Document Type",SalesHeader."No."));
    UNTIL (SalesInvHeader.NEXT = 0);
    END;

    What could be wrong?
  • chengalasettyvsraochengalasettyvsrao Member Posts: 711
    if you remove the check mark in that field it will work.
  • chengalasettyvsraochengalasettyvsrao Member Posts: 711
    Dont remove the Check mark in that field, if your client required the Paymnets against the prepayment invoices for every sales order.

    So in some cases your client ready to dispatch material without payment also. so In that case do some customization.

    Add field called Allow ship to sales Order .

    If it is Yes then allow the dispath without payment also.if it is no system will not allow to dispatch the material without payment.
Sign In or Register to comment.