on 09-13-2018 1:28 AM
Dear All,
We add the extension field indicator in Supplier Invoice XBO and we set the fixed value true .
We create Supplier Invoice from Invoice Entry(All Returns to be invoiced) ⇒ Create CreditMemo .
Although we set the initial value of indicator field as true, the initial value of indicator field was false .
In other case , As Invoice Entry(All Deliveries to be invoiced) ⇒ Create CreditMemo or Invoice.
Invoice Entry(All Orders to be invoiced) ⇒ Create CreditMemo or Invoice.
the initial value of indicator field is true.
※If we create the bundle credit memo by using 2 Invoice Entry(All Returns to be Invoiced) , the initial value of indicator was true. If we create one credit memo by using one Invoice Entry(All Returns to be Invoiced) , the initial value of indicator was false.
Actually we want to set the initial value of indicator as true.
We try to debug the logic , the initial value of flag is already set false in only Invoice Entry(All Returns to be invoiced) to supplier invoice.
Why was the initial value of indicator field changed in this case (All Returns to be Invoiced)?
Here is our logic , we write in aftermodify.absl of SupplierInvoice.xbo.
*******************************************************************************
We declare the flag in xbo and set the initialized value true.
element flag:Indicator=true;
*******************************************************************************
import ABSL;
import AP.Purchasing.Global;
var refID;
var refName;
var purchaseOrderReference;
if (this.IsSet()) {
purchaseOrderReference = this.PurchaseOrderReference;
if (this.Status.SupplierInvoiceLifeCycleStatusCode == "4" || this.Status.SupplierInvoiceLifeCycleStatusCode == "8" || this.Status.SupplierInvoiceLifeCycleStatusCode == "9" || this.Status.SupplierInvoiceLifeCycleStatusCode == "12")
{ //Read-Only mode }
else {
if (purchaseOrderReference.Count() > 0) {
if (this.flag) { t
his.flag = false;
refID = purchaseOrderReference.GetFirst().BusinessTransactionDocumentReference.ID.content; refName = purchaseOrderReference.GetFirst().BusinessTransactionDocumentReference.TypeCode.GetDescription();
if (refName == "Purchase Order") {
this.isFromPOFlag = true;
}
if (this.isFromPOFlag) {
var porderQry = PurchaseOrder.QueryByElements;
var porderParams = porderQry.CreateSelectionParams(); porderParams.Add(porderQry.ID.content, "I", "EQ", refID);
var porderResult = porderQry.Execute(porderParams);
foreach (var item in porderResult) {
this.N_EXTValue = item.N_EXTValue; }
}
}
}
}
}
*******************************************************************************
Best Regards,
Charm M
Hi charm,
Below is my observation
1) usually when you trigger invoice or credit memo creation from invoice entry ,it would Trigger after modify script
2) when you bundle two or more invoice entries to create credit memo, the purchase order reference will be in the item level of credit memo which is created. Hence in your case your after modify script do not go into the loop to change the flag value to false.
3) however when you create credit memo from single invoice entry then purchase order reference will be at the root level which would Trigger your script to change the value of the flag to false (as i believe this is the only place where you are setting the flag to false)
The above is based on my analysis, however let me know if this is not solving your problem
Regards
G. Venkatesh
WhatsApp +91 74027 35345
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.