Skip to main content

Posts

Showing posts with the label Delete

Force delete inventtrans

Below is sample job to force delete inventtrans, which will take care of invent on hand update. static void DeleteInventTrans(Args _args) { Dialog dlg = new Dialog("Delete inventtrans ?"); DialogField dlgFld; InventMovement inventMovement; PurchLine purchLine; PurchLineRefRecId recId; ; dlgFld = dlg.addField(typeid(PurchLineRefRecId)); if(dlg.run()) { recId = dlgFld.value(); purchLine = PurchLine::findRecId(recId); if(purchLine) { InventMovement = InventMovement::construct(purchLine); InventUpd_DeleteMovement::newMovement( inventMovement,true).updateNow(); info("done"); } } }

Delete Invoice double posted

Table affected: 1. InventTrans Key: Voucher 2. VendInvoiceJour Key: internalInvoiceId = Voucher 3. VendInvoiceTrans Key: internalInvoiceId = Voucher 4. VendInvoicePurchLink Key: internalInvoiceId = Voucher 5. VendTrans Key: Voucher 6. VendTransOpen Key: RefRecId = vendtrans.recid 7. LedgerTrans Key: Voucher delete all those record stored in the above table and 1. Create a job static void updateInventSum(Args _args) { InventSumReCalcItem inventSumRecalcItem = new InventSumreCalcItem("0100000000117-AV",true,CheckFix::Fix); ; inventSumrecalcItem.updateNow(); } Pass in the itemid affected or InventSumReCalcItem InventSumReCalcItem; ; InventSumReCalcItem = new InventSumReCalcItem("YourItemId" ); InventSumReCalcItem.updateNow(); 2. Run General Ledger->Periodic->Recalculate Ledger Balance