Posted on 25/03/2024 12:55:08
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