Invoice deletion now based on the actual invoice position
authorPaul Mehrer <p.mehrer@metaways.de>
Thu, 12 Mar 2015 13:52:45 +0000 (14:52 +0100)
committerPhilipp Schüle <p.schuele@metaways.de>
Thu, 12 Mar 2015 14:41:13 +0000 (15:41 +0100)
commit8f9fc88d02041a486d3b733c5b0657d3d949ba4e
tree3c1cb5be4e4224b00d43145beb2daef5c36ac079
parentb89bd694cb903b1d4055aaf7d2ccf6c76d15a39f
Invoice deletion now based on the actual invoice position

Sales_Controller_Invoice::_inspectDelete():
The product aggregates last_autobill is set back by the actually existing
(and now to be deleted) invoice positions. That is a real undo.
Before the reset of the last_autobill was based on speculation and thus error prone.

Invoice creation now iterates over the months from the first date that needs to be
billed until the current billing month and creates multiple invoices in one go as needed.

Change-Id: I9481d6ad603e18aef92aec076f3ea73ad471f303
Reviewed-on: http://gerrit.tine20.com/customers/1718
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
Tested-by: Jenkins CI (http://ci.tine20.com/)
tests/tine20/Sales/InvoiceControllerTests.php
tests/tine20/Sales/InvoiceExportTests.php
tests/tine20/Sales/InvoiceJsonTests.php
tine20/Sales/Controller/Invoice.php
tine20/Sales/Model/ProductAggregate.php
tine20/Timetracker/Model/Timeaccount.php