Skip to Content
0
Jun 14, 2022 at 10:26 AM

How to generate automatically supplier invoice schedule items ?

108 Views Last edit Jun 15, 2022 at 12:40 AM 2 rev

We try to generate automatically on some conditions some invoice schedule items.

All concerned objects seems to be released for development. Nevertheless, only PaymentSchedule works on the create method.

Can you please give us the sequence to create object ?

We've made many tries on different sequences of objects (from root to leaf or the opposite), but we always have an error on the PaymentSchedule.Item creation.

Herre is a exemple / Extract of code on modify event on the root supplier invoice with some comments on where it dumps:

...

var Payment_NodeData : elementsof this.PaymentSchedule;

var Item_NodeData : elementsof this.PaymentSchedule.Item;

var line_NodeData : elementsof this.PaymentSchedule.Item.GetFirst().ItemScheduleLine;

//SupplierInvoice_NodeData.AccountsPayableDueItemTypeCode.content = "AP020";

line_NodeData.Amount.content = 120000;

line_NodeData.Percent = 100 ;

var date = Library::Date.ParseFromString("20300215");

line_NodeData.ProposedPaymentDate = date;

line_NodeData.TypeCode = "1";

//this creation works :

this.PaymentSchedule.Create(Payment_NodeData);

//this one does not work :

this.PaymentScheduleItem.Create();

//this one does not work :

this.PaymentScheduleItem.ItemScheduleLine.Create(line_NodeData);