Posts

Showing posts from October, 2019

How to calculate On Hand Inventory Per Day

How to calculate On Hand Inventory Per Day class KK_OnHandPerDay {            /// <summary>     /// Runs the class with the specified arguments.     /// </summary>     /// <param name = "_args">The specified arguments.</param>     public static void main(Args _args)     {                ItemId itemId;         InventTrans inventTrans;         InventDim inventDimCriteria, inventDimLoc;         InventDimParm inventDimParm;         InventSumDateDim inventSumDateDim;         TransDate start, finish;         int c;         int onHandTotal;         InventLocationId inventLocationIdLoc;         start = str2date("6/24/2019", 213);//3/12/2019    ...

How to Calculate Planned Purchase Order

How to Calculate Planned Purchase Order class SMCPlannedPOCalc {            /// <summary>     /// Runs the class with the specified arguments.     /// </summary>     /// <param name = "_args">The specified arguments.</param>     public static void main(Args _args)     {         ReqTrans reqTrans;//reftype,refdate,itemid         ItemId   _itemId = "Test-SMK1010";         TransDate _date = str2Date("10/1/2019",213);         real qty;         select sum(qty),count(RecId) from reqTrans             where reqTrans.ItemId == _itemId             && reqTrans.RefType == ReqRefType::ItemPlannedOrder             && reqTrans.ReqDate == _date;       ...

How to Calculate Purch Totals in purchase order's Totals Form

How to Calculate Purch Totals in purchase order's Totals Form class KK_PurchTotals {          /// <summary>     /// Runs the class with the specified arguments.     /// </summary>     /// <param name = "_args">The specified arguments.</param>     public static void main(Args _args)     {         PurchTotals purchTotals;         PurchTable  purchTable  = PurchTable::find('00000225');         DiscAmount  discAmount;         purchTotals = PurchTotals::newPurchTable(purchTable);         purchTotals.calc();         discAmount = purchTotals.purchTotalAmount();         setPrefix('Purchase Order');         info(strFmt('%1 - Total Value: %2', purchTable.PurchId, discAmount));     } }