on 03-23-2016 7:56 AM
Hi,
We are currently looking for a way to create an invoice of type Down Payment, but did not find success so far.
There are two options that I've investigated :
None of them allowed me to create an actual down payment. I was able to create a standard invoice though.
When using the webservice, I tried setting the PricingProcedure to PPGDP1 or PPNDP1, but got the error "could not copy tax details and price components". There was obvisouly a discrepancy somewhere, even when setting the price component type code to 7GDP or 7NDP. (gross down payment or net down payment). Using the standard PPSTD1 with a price component of type 7PR1 was working as expected.
When using standard ABSL coding, I tried setting the InvoiceProcessingType to "CDP" instead of the recommended "CI". This resulted in an error of type "invoice processing type missing".
Please note that in both cases I only use one item without a product reference (I added General Ledger and Taxation characteristics as instructed), and only one price component with the amount of the down payment.
Does anyone here have experience making this work? There is a painful lack of documentation on this particular type of invoice. I tried reproducing the values that I read in an existing, hand-created down payment (processing type, price and tax settings, etc.) but it got me nowhere.
Thanks !
Hi,
If you want to try the inbound web service,
Do not use "ManageCustomerInvoiceRequestIn".
You should use "ManageDownPaymentCustomerInvoiceRequestIn".
Please try it.
Best regards,
Nyein.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
We eventually managed to make this work using the web service you mentioned. Thanks for sharing this valuable piece of information, although the absolute lack of documentation on this web service as well as the apparent impossibility to create such an object by script is, to say the least, surprising.
Hi again,
I eventually managed to create an Invoice Request of Type Down Payment. The catch is the invoice item price is empty: every time I attempt to add a price component, it fails.
Here is my logic of execution so far:
1. Create an Invoice Request
2. Assign it the business process variant types 3 (manual invoice) and 272 (down payment)
3. Assign it the customer invoice processing type "CDP"
4. Set Pricing Terms currency
5. Set Buyer and Sales Unit parties
6. Set Cash Discount Terms
7. Create an Item on the invoice with an empty description and a quantity of 1 EA
8. Create a Main Price component on the item: this does not work, regardless of what I tried (setting parameters before or after creation, etc.); I invariably receive the error "Price component is not valid"
9. Set General Ledger Account
10. Set Taxation Characteristics Code
I had some minor success but an empty invoice is no use to me! Anyone, help?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The easiest way to figure what to put into the price component would be to have some code like below in the beforesave event:
var test = this.Item.PriceComponent.somefield;
var test2 = this.Item.PriceComponent.anotherfield;
Then debug any lines you have like that when creating a down payment in ByD UI. This should give you a rough idea of what you're missing or is wrong
Hi,
I've tried comparing a working Down Payment Request object with the one I'm attempting to create, and there is still something that I don't understand. I'm building my object exactly the way the working object is built, with the same values in the same fields, well, the ones I have access to anyway. But there is no way to make this price component work.
I simply could not find a way to make this work. The ManageCustomerInvoiceRequestIn web service was of not much help either: it too keeps creating empty down payment requests.
There must be a way or a field to use in order to create a Down Payment Request. But ByD keeps sending me back the "Gross Down Payment required" error whatever I try, as if it expects me to do something that I don't know of.
Please, does anyone have any idea about this?
Hi Will,
Here is the code I'm using:
// define CustomerInvoiceRequest root node
var elCustomerInvoiceRequest_Root: elementsof BusinessObject::CustomerInvoiceRequest;
var instCustomerInvoiceRequest;
// define CustomerInvoiceRequest BusinessProcessVariantType node
var elCustomerInvoiceRequest_BPVT: elementsof BusinessObject::CustomerInvoiceRequest.BusinessProcessVariantType;
var instCustomerInvoiceRequest_BPVT;
// define CustomerInvoiceRequest buyer party node
var elCustomerInvoiceRequest_BuyerParty: elementsof BusinessObject::CustomerInvoiceRequest.Party;
var instCustomerInvoiceRequest_BuyerParty;
// define CustomerInvoiceRequest sales unit party node
var elCustomerInvoiceRequest_SalesUnitParty: elementsof BusinessObject::CustomerInvoiceRequest.Party;
var instCustomerInvoiceRequest_SalesUnitParty;
// define CustomerInvoiceRequest item node
var elCustomerInvoiceRequest_Item: elementsof BusinessObject::CustomerInvoiceRequest.Item;
var instCustomerInvoiceRequest_Item;
// define CustomerInvoiceRequest item accounting coding block node
var elCustomerInvoiceRequest_ItemACBD: elementsof BusinessObject::CustomerInvoiceRequest.Item.ItemAccountingCodingBlockDistribution;
var instCustomerInvoiceRequest_ItemACBD;
// define CustomerInvoiceRequest item price component
//var elCustomerInvoiceRequest_Item_MainPrice: elementsof BusinessObject::CustomerInvoiceRequest.PriceAndTaxCalculation.Item.ItemPriceComponent;
var instCustomerInvoiceRequest_Item_MainPrice;
// CustomerInvoiceRequest: create new instance
//elCustomerInvoiceRequest_Root.CustomerInvoiceProcessingTypeCode = "CDP";
instCustomerInvoiceRequest = BusinessObject::CustomerInvoiceRequest.Create();
// CustomerInvoiceRequest: maintain BPVT node
// BusinessProcessVariantTypeCode = 3 describes type 'Manual Invoice'
// BPVT TYPE 3 MUST BE FIRST
elCustomerInvoiceRequest_BPVT.BusinessProcessVariantTypeCode = "3";
elCustomerInvoiceRequest_BPVT.MainIndicator = true;
instCustomerInvoiceRequest_BPVT = instCustomerInvoiceRequest.BusinessProcessVariantType.Create(elCustomerInvoiceRequest_BPVT);
elCustomerInvoiceRequest_BPVT.BusinessProcessVariantTypeCode = "272";
elCustomerInvoiceRequest_BPVT.MainIndicator = false;
instCustomerInvoiceRequest_BPVT = instCustomerInvoiceRequest.BusinessProcessVariantType.Create(elCustomerInvoiceRequest_BPVT);
// CustomerInvoiceRequest: maintain customer invoice processing type - mandatory
// CustomerInvoiceProcessingTypeCode = "CI" describes type 'Customer Invoice'
// MUST BE DONE AFTER BPVT
instCustomerInvoiceRequest.CustomerInvoiceProcessingTypeCode = "CDP";
// pricing terms
var instPricingTerms = instCustomerInvoiceRequest.PricingTerms;
if(!instPricingTerms.IsSet()) { instPricingTerms = instCustomerInvoiceRequest.PricingTerms.Create(); }
instPricingTerms.CurrencyCode = "EUR";
// CustomerInvoiceRequest:: maintain buyer party - mandatory
elCustomerInvoiceRequest_BuyerParty.PartyKey.PartyID.content = sales_order.BuyerParty.PartyKey.PartyID.content;
// CustomerInvoiceRequest: create new party instance
instCustomerInvoiceRequest_BuyerParty = instCustomerInvoiceRequest.BuyerParty.Create(elCustomerInvoiceRequest_BuyerParty);
// CustomerInvoiceRequest:: maintain sales unit party - mandatory
elCustomerInvoiceRequest_SalesUnitParty.PartyKey.PartyID.content = sales_order.SalesUnitParty.PartyKey.PartyID.content;
// CustomerInvoiceRequest: create new party instance
instCustomerInvoiceRequest_SalesUnitParty = instCustomerInvoiceRequest.SalesUnitParty.Create(elCustomerInvoiceRequest_SalesUnitParty);
// cash terms
/*
var elCashTerms : elementsof BusinessObject::CustomerInvoiceRequest.CashDiscountTerms;
elCashTerms.Code.content = "001";
var instCashTerms = instCustomerInvoiceRequest.CashDiscountTerms.Create(elCashTerms);
*/
// CustomerInvoiceRequest.Item: maintain description - mandatory
elCustomerInvoiceRequest_Item.Description.content = "Down Payment for Sales Order " + this.InternalID.content.RemoveLeadingZeros();
elCustomerInvoiceRequest_Item.Quantity.content = 1;
elCustomerInvoiceRequest_Item.Quantity.unitCode = "EA";
elCustomerInvoiceRequest_Item.QuantityTypeCode.content = "EA";
elCustomerInvoiceRequest_Item.ProcessingTypeCode = "CII";
instCustomerInvoiceRequest_Item = instCustomerInvoiceRequest.Item.Create(elCustomerInvoiceRequest_Item);
var elCustomerInvoiceRequest_Item_MainPrice : elementsof BusinessObject::CustomerInvoiceRequest.PriceAndTaxCalculation.Item.ItemPriceComponent;
var elCustomerInvoiceRequest_Price : elementsof BusinessObject::CustomerInvoiceRequest.PriceAndTaxCalculation.PriceComponent;
elCustomerInvoiceRequest_Item_MainPrice.Description.content = "Gross Down Payment";
elCustomerInvoiceRequest_Item_MainPrice.TypeCode.content = "7GDP";
elCustomerInvoiceRequest_Item_MainPrice.Rate.DecimalValue = 100;
elCustomerInvoiceRequest_Item_MainPrice.Rate.CurrencyCode = "EUR";
instCustomerInvoiceRequest_Item.PriceAndTaxCalculationItem.ItemMainPrice.Create(elCustomerInvoiceRequest_Item_MainPrice);
// GENERAL LEDGER AND TAX CODE MUST BE AFTER THE PRICE COMPONENT CREATION
// CustomerInvoiceRequest.Item.ItemAccountingCodingBlockDistribution: maintain GL-account - mandatory
elCustomerInvoiceRequest_ItemACBD.GeneralLedgerAccountAliasCode.content = "A-1500";
// CustomerInvoiceRequest.Item: create new ItemAccountingCodingBlockDistribution instance
instCustomerInvoiceRequest_ItemACBD = instCustomerInvoiceRequest_Item.ItemAccountingCodingBlockDistribution.Create(elCustomerInvoiceRequest_ItemACBD);
// CustomerInvoiceRequest.Item.PATCItem: maintain tax code - mandatory (code 501 = Sales Tax - Standard Rate)
instCustomerInvoiceRequest_Item.PriceAndTaxCalculationItem.TaxationCharacteristicsCode.content = "501";
// external ref
instCustomerInvoiceRequest.ReferenceBusinessTransactionDocumentID.content = sales_order.BuyerID.content;
// CustomerInvoiceRequest: maintain description - optional
instCustomerInvoiceRequest.Name = "Down Payment for Sales Order " + this.InternalID.content.RemoveLeadingZeros();
Thanks again, hope you will find something interesting!
Hi,
You need to set the ProcessingTypeCode to DPI as CDP is a down payment request.
Regards,
Will
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi and thank your for your response.
Using "DPI" as the processing type code gives me back errors about the pricing procedure which can't be determined. More precisely, this is what I read in the log:
16:14:18 [2:E] Message (APCI_CUST_INV_REQUEST, PRICING_TERMS) Determination of pricing procedure not possible with APCI_02, , and
16:14:18 [2:E] Message (APCI_CUST_INV_REQUEST, PRICING_TERMS) Determination of pricing procedure not possible with APCI_02, , and
16:14:18 [2:E] Message (APCI_CUST_INV_REQUEST, PRICING_TERMS) Pricing procedure not determined
All subsequent operations fail as a result.
This is the order in which I do things:
1. Create Customer Invoice Request instance
2. Set Business Process Variant Type Code to 3 (manual invoice)
3. Set Customer Invoice Processing Type Code to DPI
4. Set Pricing Terms currency
5. Set Buyer and Sales Unit parties
6. Set Cash Discount Terms
7. Create an Item on the invoice
8. Set General Ledger Account
9. Set Taxation Characteristics Code
10. Create a Main Price component on the item (setting the type code to "7NDP")
Help!
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.