1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-05 18:52:44 +01:00

recurring

This commit is contained in:
David Bomba 2020-10-06 15:11:48 +11:00
parent 07701779ff
commit 4a4c61f1cf
2 changed files with 18 additions and 10 deletions

View File

@ -78,6 +78,9 @@ class CompanySettings extends BaseSettings
public $invoice_number_pattern = '';
public $invoice_number_counter = 1;
public $recurring_invoice_number_pattern = '';
public $recurring_invoice_number_counter = 1;
public $quote_number_pattern = '';
public $quote_number_counter = 1;

View File

@ -30,23 +30,28 @@ class ApplyNumber extends AbstractService
$this->recurring_entity = $recurring_entity;
}
/* Recurring numbers are set when saved */
public function run()
{
if ($this->recurring_entity->number != '') {
return $this->recurring_entity;
}
switch ($this->client->getSetting('counter_number_applied')) {
case 'when_saved':
$this->recurring_entity->number = $this->getNextRecurringInvoiceNumber($this->client);
break;
case 'when_sent':
break;
default:
$this->recurring_entity->number = $this->getNextRecurringInvoiceNumber($this->client);
break;
}
$this->recurring_entity->number = $this->getNextRecurringInvoiceNumber($this->client);
// switch ($this->client->getSetting('counter_number_applied')) {
// case 'when_saved':
// $this->recurring_entity->number = $this->getNextRecurringInvoiceNumber($this->client);
// break;
// case 'when_sent':
// break;
// default:
// $this->recurring_entity->number = $this->getNextRecurringInvoiceNumber($this->client);
// break;
// }
return $this->recurring_entity;
}