mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-23 20:00:33 -04:00
Fixes for applying invoice numbers to subscriptions where invoice number is set to When Sent
This commit is contained in:
parent
c989aaad87
commit
cb47c9d40e
@ -36,6 +36,7 @@ class ApplyNumber extends AbstractService
|
||||
|
||||
public function run()
|
||||
{
|
||||
|
||||
if ($this->invoice->number != '') {
|
||||
return $this->invoice;
|
||||
}
|
||||
@ -45,7 +46,7 @@ class ApplyNumber extends AbstractService
|
||||
$this->trySaving();
|
||||
break;
|
||||
case 'when_sent':
|
||||
if ($this->invoice->status_id == Invoice::STATUS_SENT) {
|
||||
if ($this->invoice->status_id >= Invoice::STATUS_SENT) {
|
||||
$this->trySaving();
|
||||
}
|
||||
break;
|
||||
|
@ -85,7 +85,11 @@ class UpdateInvoicePayment
|
||||
|
||||
if($invoice->is_proforma)
|
||||
{
|
||||
$invoice->number = '';
|
||||
|
||||
if(strlen($invoice->number) > 1 && str_starts_with($invoice->number,"####"))
|
||||
$invoice->number = '';
|
||||
|
||||
|
||||
$invoice->is_proforma = false;
|
||||
|
||||
$invoice->service()
|
||||
|
@ -958,7 +958,7 @@ class SubscriptionService
|
||||
$invoice->subscription_id = $this->subscription->id;
|
||||
$invoice->client_id = $client_id;
|
||||
$invoice->is_proforma = true;
|
||||
$invoice->number = ctrans('texts.subscription') . "_" . now()->format('Y-m-d') . "_" . rand(0,100000);
|
||||
$invoice->number = "####" . ctrans('texts.subscription') . "_" . now()->format('Y-m-d') . "_" . rand(0,100000);
|
||||
$line_items = $bundle->map(function ($item){
|
||||
|
||||
$line_item = new InvoiceItem;
|
||||
|
Loading…
x
Reference in New Issue
Block a user