class CalculateTotalsOfPurchaseOrder
{
public static void main(Args _args)
{
//Calculate totals per Purchase order
PurchTotals purchTotals;
PurchTable purchTable = PurchTable::find('PO.001118'); //Change the Purchase Order Id as per your system's data
AmountCur totalAmount;
purchTotals = PurchTotals::newPurchTable(purchTable);
purchTotals.calc();
totalAmount = purchTotals.purchTotalAmount();
info(strFmt("Purchase order: %1 - Total Amount: %2", purchTable.PurchId, totalAmount));
}
}
class CalculateTotalsOfPurchaseRequisitions
{
public static void main(Args _args)
{
//Calculate totals per Purchase Requisition
PurchReqTable purchReqTable = purchReqTable::find('PR.003338'); //Change the Purchase Requisition Id as per your system's data
AmountCur totalAmount;
PurchReqTotals purchreqtotal = PurchReqTotals::construct(purchReqTable);
purchreqtotal.calc();
totalAmount = purchreqtotal.totalAmount();
info(strFmt("Purchase Requisition %1 - Total Amount: %2", purchReqTable.PurchReqId, totalAmount));
}
}
No comments:
Post a Comment