Fix error when processing statement cycle with setting age based on: due date

Order To Cash: Customer Ledger Version 10.00

The bug when setting age based on: due date, in statement cycle, and credit note without due date, you got an error message when prepare statements. This is now fixed.