Move schedule date calculation out of the nonstandard constructor and into a separate function to allow overridding it

Description

Both OrderPaySchedule and InvoicePaySchedule perform due date calculations in a nonstandard constructor that takes an MOrder|MInvoice and a MPaySchedule for arguments. This makes it problematic to override it in a plugin, for, for example, make schedules have fixed pay days. Miving these calculations into a separate function will allow the use of a ModelFactory to override them.

Environment

Ubuntu 14.04

Activity

Show:

Diego Ruiz August 22, 2020 at 8:15 PM

Triaged by Diego Ruiz,

Closing it as a potential idea due to lack of activity in 5 years.

If you are still interested in this ticket, please feel free to reopen it with additional information.

Antoni Ten Monrós April 22, 2015 at 1:48 PM

The way to do it without this change requires using an eventHandler and intercepting the PO_AFTER_SAVE event. It's problematic because if the user manually creates the pay schedule for the order/invoice, his input gets overridden by the system on the first save.

Won't Fix

Details

Assignee

Reporter

Priority

Created April 22, 2015 at 1:41 PM
Updated October 2, 2020 at 4:14 PM
Resolved August 22, 2020 at 8:15 PM