mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-23 20:00:33 -04:00
Merge branch 'v5-develop' into auto_taxes
This commit is contained in:
commit
0d38ab1cfb
@ -40,6 +40,8 @@ class UpdateRecurring implements ShouldQueue
|
||||
{
|
||||
MultiDB::setDb($this->company->db);
|
||||
|
||||
$this->user->setCompany($this->company);
|
||||
|
||||
RecurringInvoice::where('company_id', $this->company->id)
|
||||
->whereIn('id', $this->ids)
|
||||
->chunk(100, function ($recurring_invoices) {
|
||||
|
@ -120,4 +120,11 @@ class AppServiceProvider extends ServiceProvider
|
||||
Artisan::call('db:seed');
|
||||
});
|
||||
}
|
||||
|
||||
public function register(): void
|
||||
{
|
||||
if (Ninja::isHosted()) {
|
||||
$this->app->register(\App\Providers\BroadcastServiceProvider::class);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -26,17 +26,19 @@ class UpdatePrice extends AbstractService
|
||||
$line_items = $this->recurring_invoice->line_items;
|
||||
|
||||
foreach ($line_items as $key => $line_item) {
|
||||
|
||||
$product = Product::where('company_id', $this->recurring_invoice->company_id)
|
||||
->where('product_key', $line_item->product_key)
|
||||
->where('is_deleted', 0)
|
||||
->first();
|
||||
|
||||
if ($product) {
|
||||
$line_items[$key]->cost = $product->cost;
|
||||
$line_items[$key]->cost = floatval($product->cost);
|
||||
}
|
||||
}
|
||||
|
||||
$this->recurring_invoice->line_items = $line_items;
|
||||
|
||||
$this->recurring_invoice->calc()->getInvoice()->save();
|
||||
}
|
||||
}
|
||||
|
@ -194,7 +194,7 @@ return [
|
||||
*/
|
||||
App\Providers\AppServiceProvider::class,
|
||||
App\Providers\AuthServiceProvider::class,
|
||||
App\Providers\BroadcastServiceProvider::class,
|
||||
// App\Providers\BroadcastServiceProvider::class,
|
||||
App\Providers\EventServiceProvider::class,
|
||||
App\Providers\RouteServiceProvider::class,
|
||||
App\Providers\ComposerServiceProvider::class,
|
||||
|
Loading…
x
Reference in New Issue
Block a user