Developer forum

Forum » Integration » Invoice payment status - customer live center

Invoice payment status - customer live center

Davy Capiau
Reply

Hi,

We're working with the code unit of NAV and the customer live integration. We want to show the payment status (paid/not paid) in the invoice overview. I know it's not possible by default, but is there any way to achieve this? Ideally with a filter that allows the user to view all unpaid invoices.


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply
This post has been marked as an answer

Hi Davy

You can do a couple of things.

You might be able to use the live integration customer center:

You might have an Odata endpoint in your NAV that can be used to expose payment state of orders - either by using an existing endpoint or by creating a page in NAV that is exposed in OData. It depends on your NAV version. Then you can use OData integration in batch to update orders using the orderintegrationid column and poll the status of open orders and update them in DW in a custom field - or one of the existing.

The last option is to extend the code unit to send order payment satus (and maybe other information) in a new request and use that in a batch job to update the orders.

BR Nicolai

Votes for this answer: 1
 
Davy Capiau
Reply

HI Nicolai,

It's with an old NAV version ('13). Can it be done without the Odata-integration?

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Davy,
it looks like with the old NAV2013 version you should probably modify the codeunit itself in the NAV so it returns the "custom" payment field value for the invoice requests.
If you need it in the GetList request (orders list page in the Integration customer center) then this code is related to search and modify:
2: BEGIN
            Add_Attribute(XMLCurrNode,'type','Invoice');
            SalesInvHeader.SETRANGE("Sell-to Customer No.", customer."No.");
            IF SalesInvHeader.FINDSET(FALSE,FALSE) THEN BEGIN
              IF pageSize > 0 THEN BEGIN
                Add_Attribute(XMLCurrNode, 'totalCount', FORMAT(SalesInvHeader.COUNT));
                REPEAT
                  i := i + 1;
                  IF i >= firstItem THEN BEGIN
                    SalesInvHeader.CALCFIELDS(SalesInvHeader.Amount,SalesInvHeader."Amount Including VAT");
                    FillOrderItem(XMLCurrNode, SalesInvHeader."No.", SalesInvHeader."Order Date", SalesInvHeader."Shipment Date",
                      SalesInvHeader."Due Date", FORMAT(SalesInvHeader.Amount,0,'<Precision,2:2><Standard Format,0>'), FORMAT(SalesInvHeader."Amount Including VAT",0,'<Precision,2:2><Standard Format,0>'),
                      SalesInvHeader."Posting Date", SalesInvHeader."Document Date");
                  END;
                UNTIL (SalesInvHeader.NEXT = 0) OR (i >= (firstItem + pageSize - 1));
              END ELSE BEGIN
                REPEAT
                  SalesInvHeader.CALCFIELDS(SalesInvHeader.Amount,SalesInvHeader."Amount Including VAT");
                  FillOrderItem(XMLCurrNode, SalesInvHeader."No.", SalesInvHeader."Order Date", SalesInvHeader."Shipment Date",
                    SalesInvHeader."Due Date", FORMAT(SalesInvHeader.Amount,0,'<Precision,2:2><Standard Format,0>'), FORMAT(SalesInvHeader."Amount Including VAT",0,'<Precision,2:2><Standard Format,0>'),
                    SalesInvHeader."Posting Date", SalesInvHeader."Document Date");
                UNTIL SalesInvHeader.NEXT=0;
              END;
            END;
          END;
You would need a new overload of FillOrderItem method for your specific invoice details needs.

If you need it in the specific invoice order details page (once you click on some order from the Integration customer center order list page):
then you should find and edit the "Add_SalesInvHeader" method to include the custom fileld for payment status.

Then the new added field can be displayed on the frontend once you update the templates in the Integration customer center to show the new tag.

BR, Dmitrij

 
Davy Capiau
Reply

Thanks for the clear response Dmitrij!

 

You must be logged in to post in the forum