mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Merge pull request #4169 from turbo124/v5-develop
Recurring Invoice Invitations
This commit is contained in:
commit
3d83be9d08
4
.github/workflows/phpunit.yml
vendored
4
.github/workflows/phpunit.yml
vendored
@ -1,10 +1,10 @@
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- v2
|
||||
- v5-develop
|
||||
pull_request:
|
||||
branches:
|
||||
- v2
|
||||
- v5-develop
|
||||
|
||||
name: phpunit
|
||||
jobs:
|
||||
|
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@ -12,7 +12,7 @@ jobs:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v1
|
||||
with:
|
||||
ref: v2
|
||||
ref: v5-stable
|
||||
|
||||
- name: Copy .env file
|
||||
run: |
|
||||
|
@ -1 +1 @@
|
||||
5.0.17
|
||||
5.0.18
|
@ -94,15 +94,15 @@ class InvoiceItemFactory
|
||||
$item->cost = $faker->randomFloat(2, -1, -1000);
|
||||
$item->line_total = $item->quantity * $item->cost;
|
||||
$item->is_amount_discount = true;
|
||||
$item->discount = $faker->numberBetween(1, 10);
|
||||
$item->discount = 0;
|
||||
$item->notes = $faker->realText(20);
|
||||
$item->product_key = $faker->word();
|
||||
$item->custom_value1 = $faker->realText(10);
|
||||
$item->custom_value2 = $faker->realText(10);
|
||||
$item->custom_value3 = $faker->realText(10);
|
||||
$item->custom_value4 = $faker->realText(10);
|
||||
$item->tax_name1 = 'GST';
|
||||
$item->tax_rate1 = 10.00;
|
||||
$item->tax_name1 = '';
|
||||
$item->tax_rate1 = 0;
|
||||
$item->type_id = "1";
|
||||
|
||||
$data[] = $item;
|
||||
|
@ -288,5 +288,39 @@ class InvoiceSum
|
||||
return $this->getTotalTaxes();
|
||||
}
|
||||
|
||||
public function purgeTaxes()
|
||||
{
|
||||
|
||||
$this->tax_rate1 = 0;
|
||||
$this->tax_name1 = '';
|
||||
|
||||
$this->tax_rate2 = 0;
|
||||
$this->tax_name2 = '';
|
||||
|
||||
$this->tax_rate3 = 0;
|
||||
$this->tax_name3 = '';
|
||||
|
||||
$this->discount = 0;
|
||||
|
||||
$line_items = collect($this->invoice->line_items);
|
||||
|
||||
$items = $line_items->map(function ($item){
|
||||
$item->tax_rate1 = 0;
|
||||
$item->tax_rate2 = 0;
|
||||
$item->tax_rate3 = 0;
|
||||
$item->tax_name1 = '';
|
||||
$item->tax_name2 = '';
|
||||
$item->tax_name3 = '';
|
||||
$item->discount = 0;
|
||||
|
||||
return $item;
|
||||
});
|
||||
|
||||
$this->invoice->line_items = $items->toArray();
|
||||
|
||||
$this->build();
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -302,4 +302,9 @@ class InvoiceSumInclusive
|
||||
return $this->getTotalTaxes();
|
||||
}
|
||||
|
||||
public function purgeTaxes()
|
||||
{
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
@ -318,7 +318,7 @@ class Company extends BaseModel
|
||||
return isset($this->settings->language_id) && $this->language() ? $this->language()->locale : config('ninja.i18n.locale');
|
||||
}
|
||||
|
||||
public function getLogo()
|
||||
public function getLogo() :?string
|
||||
{
|
||||
return $this->settings->company_logo ?: null;
|
||||
}
|
||||
@ -394,7 +394,6 @@ class Company extends BaseModel
|
||||
|
||||
public function company_users()
|
||||
{
|
||||
//return $this->hasMany(CompanyUser::class)->withTimestamps();
|
||||
return $this->hasMany(CompanyUser::class);
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,10 @@ class RecurringInvoiceRepository extends BaseRepository
|
||||
|
||||
$invoice_calc = new InvoiceSum($invoice, $invoice->settings);
|
||||
|
||||
$invoice->service()->applyNumber()->save();
|
||||
$invoice->service()
|
||||
->applyNumber()
|
||||
->createInvitations()
|
||||
->save();
|
||||
|
||||
$invoice = $invoice_calc->build()->getInvoice();
|
||||
|
||||
|
@ -91,7 +91,7 @@ class HandleReversal extends AbstractService
|
||||
$credit_calc = new InvoiceSum($credit);
|
||||
$credit_calc->build();
|
||||
|
||||
$credit = $credit_calc->getCredit();
|
||||
$credit = $credit_calc->purgeTaxes()->getCredit();
|
||||
|
||||
$credit->service()->markSent()->save();
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ return [
|
||||
'require_https' => env('REQUIRE_HTTPS', true),
|
||||
'app_url' => rtrim(env('APP_URL', ''), '/').'/',
|
||||
'app_domain' => env('APP_DOMAIN', ''),
|
||||
'app_version' => '5.0.17',
|
||||
'app_version' => '5.0.18',
|
||||
'minimum_client_version' => '5.0.16',
|
||||
'terms_version' => '1.0.1',
|
||||
'api_secret' => env('API_SECRET', ''),
|
||||
|
@ -333,6 +333,14 @@ trait MockAccountData
|
||||
$this->credit->amount = 10;
|
||||
$this->credit->balance = 10;
|
||||
|
||||
$this->credit->tax_name1 = '';
|
||||
$this->credit->tax_name2 = '';
|
||||
$this->credit->tax_name3 = '';
|
||||
|
||||
$this->credit->tax_rate1 = 0;
|
||||
$this->credit->tax_rate2 = 0;
|
||||
$this->credit->tax_rate3 = 0;
|
||||
|
||||
$this->credit->uses_inclusive_taxes = false;
|
||||
|
||||
$this->credit->save();
|
||||
|
Loading…
x
Reference in New Issue
Block a user