hi all,
PO- Product receipt
I have created a PO. Confirmed and then Product receipt. It is done
Product receipt journal - Voucher -
In the place of ledger account 135101 , I wants to update to ledger account 135018
To do this , I wrote in below class and method
Class - PurchPackingSlipJournalPost
Method - UpdateJournalLine
purchTables = PurchTable::find(purchTable.PurchId);
if(purchTables.MiscPurchaseOrder == NoYes::Yes)
{
markupTables = MarkupTable::find(purchTables.ModuleType, purchTables.MarkupCode);
if (PurchParameters::find().MiscPO== NoYes::Yes)
{
ledgerDimensionMerged = DimensionDefaultingService::serviceCreateLedgerDimension(markupTables.VendorLedgerDimension, purchTables.DefaultDimension);
}
else
{
ledgerDimensionMerged = DimensionDefaultingService::serviceCreateLedgerDimension(markupTables.VendorLedgerDimension);//, this.defaultDimension());
}
}
else
{
ledgerDimensionMerged = DimensionDefaultingService::serviceCreateLedgerDimension(formletterProvider.ledgerDimensionLineAmount());//, this.defaultDimension());
}
It is not showing the ledger account 135018 but in Markup table it is showing the ledger account 135018 and also I passed parameter
ledgerDimensionMerged = DimensionDefaultingService::serviceCreateLedgerDimension(markupTables.VendorLedgerDimension, purchTables.DefaultDimension);
Still it is showing ledger account 135101 after PO product receipt.
Is my above class , method and code is correct ?
Kindly let me know how to achieve this.
Please give me more shed on this.
thanks!
Hi @rp@n ,
I recommend you to talk to your customer, as well as the financial consultant of this project. They should talk to the financial auditor of the customer and get a written approval before messing up with historical transactions. Please show this discussion to the decision makers of your customer - since they are ultimately responsible if something illegal is done.
Where you wrote it is correct. You can look at the postline of the same class or PurchPackingSlipJournalCreate should have a method called createJournalLine. You can check there.
You can go in reverse and debug the insert of the table and see where it changed.
You can do the post process yourself, not using the standard structure.
But I think we should not solve this request with code. No matter how careful you are, garbage records will remain and will confuse accounts.
Personally, I would consider this as falsification of your data and would recommend not changing a posted voucher this way.
Maybe some other community members can help you with your code.
All the best,
Ludwig
What changes are required in my code.
Can anyone reply me on this please.
Ludwig,
I have also done code in
Class - InventoryMovement
Method - UpdateLedgerAdjust
if (this.mustBeBookedOperations()) { purchLine = buffer as PurchLine; purchTable = PurchTable::find(purchLine.PurchId); markupTable = MarkupTable::find(purchTable.ModuleType, purchTable.MarkupCode); if(purchTable.MiscPurchaseOrder == NoYes::Yes) { ledgerVoucherTransObject = LedgerVoucherTransObject::newTransactionAmountDefault( ledgerVoucherObject, this.postingOperations(), DimensionDefaultingService::serviceCreateLedgerDimension( markupTable.VendorLedgerDimension, (PurchParameters::find().MiscPO == NoYes::Yes && !PurchTable.IsLRCChargeCode(purchTable.HCLMarkupCode))? purchTable.DefaultDimension : this.defaultDimension()), CompanyInfo::standardCurrency(), -_costAmount, currencyExchHelper); } else { ledgerVoucherTransObject = LedgerVoucherTransObject::newTransactionAmountDefault( ledgerVoucherObject, this.postingOperations(), DimensionDefaultingService::serviceCreateLedgerDimension(this.accountOperations(),this.defaultDimension()), CompanyInfo::standardCurrency(), -_costAmount, currencyExchHelper); } }
Please give me more shed on this.
Thanks Ludwig for your quick response.
This is new requirement from customer . So, I am working on this.
Anyhow I have to do this.
As technical view, is my code is correct ? And the class and method? Which I mentioned above
Please give me more shed on this
Good morning @rp@n,
With making a code adjustment almost everything is possible.
Yet, I would consider this (a) as illegal from an accounting / auditing perspective and (b) risky, as it might mess up your inventory valuations and result in subsequent issues that require additional corrections.
Your accounting colleagues can make a manual correction in the AX client and I would recommend that you reach out to them and ask them to make this manual adjustment.
Best regards,
Ludwig
Hi Ludwig,
Kindly elaborate me please whether its possible or not through code.
Hi Ludwig,
Is it impossible to do through code , which i am trying to achieve? Is it only possible through manual?
Kindly elaborate me please
Thanks Ludwig,
As you said "You cannot simply adjust and change a purchase price variance transaction this way".
You mean to say is it impossible?
Please give me more shed on this
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156