Skip to content

Commit

Permalink
added: paid status in posted service invoice api
Browse files Browse the repository at this point in the history
  • Loading branch information
plakna committed Nov 6, 2024
1 parent 8f18274 commit 89f160e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ using Microsoft.Foundation.Shipping;
using Microsoft.Integration.Graph;
using Microsoft.Service.Document;
using Microsoft.API.V2;
using Microsoft.Integration.Entity;
using Microsoft.Sales.Receivables;

page 6618 "FS Posted Service Invoice API"
{
Expand Down Expand Up @@ -249,6 +251,11 @@ page 6618 "FS Posted Service Invoice API"
Caption = 'Total Amount Including Tax';
Editable = false;
}
field(status; Status)
{
Caption = 'Status';
Editable = false;
}
field(lastModifiedDateTime; Rec.SystemModifiedAt)
{
Caption = 'Last Modified Date';
Expand Down Expand Up @@ -297,6 +304,7 @@ page 6618 "FS Posted Service Invoice API"
Clear(PaymentTerms);
if not ShipmentMethod.Get(Rec."Shipment Method Code") then
Clear(ShipmentMethod);
CalculateStatus();
end;

var
Expand All @@ -308,4 +316,21 @@ page 6618 "FS Posted Service Invoice API"
ShipmentMethod: Record "Shipment Method";
CurrencyCode: Code[10];
CachedCurrencyCode: Code[10];
Status: Enum "Invoice Entity Aggregate Status";

local procedure CalculateStatus()
var
CustLedgerEntry: Record "Cust. Ledger Entry";
begin
CustLedgerEntry.SetCurrentKey("Document No.");
CustLedgerEntry.SetRange("Document No.", Rec."No.");
CustLedgerEntry.SetRange("Document Type", CustLedgerEntry."Document Type"::Invoice);
CustLedgerEntry.SetRange(Open, true);

if CustLedgerEntry.IsEmpty() then
Status := Status::Paid
else
Status := Status::Open;
end;

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ permissionset 6612 "FS - Objects"
codeunit "FS Upgrade" = X,
codeunit "FS Integration Mgt." = X,
codeunit "FS Int. Table Subscriber" = X,
codeunit "FS Integration Mgt." = X,
codeunit "FS Lookup FS Tables" = X,
codeunit "FS Setup Defaults" = X,
page "FS Bookable Resource List" = X,
Expand Down

0 comments on commit 89f160e

Please sign in to comment.