mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Version bump, fixes for queue:work on setup. (#3603)
* Fixes for scheduler and queues * Version Bump
This commit is contained in:
parent
2fd3229efd
commit
7d41759468
@ -43,6 +43,7 @@ class Kernel extends ConsoleKernel
|
||||
/* Run queue's in shared hosting with this*/
|
||||
if (Ninja::isSelfHost()) {
|
||||
$schedule->command('queue:work')->everyMinute()->withoutOverlapping();
|
||||
$schedule->command('queue:restart')->everyFiveMinutes(); //we need to add this as we are seeing cached queues mess up the system on first load.
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -64,29 +64,33 @@ class HandleReversal extends AbstractService
|
||||
});
|
||||
|
||||
/* Generate a credit for the $total_paid amount */
|
||||
$credit = CreditFactory::create($this->invoice->company_id, $this->invoice->user_id);
|
||||
$credit->client_id = $this->invoice->client_id;
|
||||
$notes = "Credit for reversal of ".$this->invoice->number;
|
||||
|
||||
$item = InvoiceItemFactory::create();
|
||||
$item->quantity = 1;
|
||||
$item->cost = (float)$total_paid;
|
||||
$item->notes = "Credit for reversal of ".$this->invoice->number;
|
||||
if($total_paid > 0)
|
||||
{
|
||||
$credit = CreditFactory::create($this->invoice->company_id, $this->invoice->user_id);
|
||||
$credit->client_id = $this->invoice->client_id;
|
||||
|
||||
$line_items[] = $item;
|
||||
$item = InvoiceItemFactory::create();
|
||||
$item->quantity = 1;
|
||||
$item->cost = (float)$total_paid;
|
||||
$item->notes = $notes;
|
||||
|
||||
$credit->line_items = $line_items;
|
||||
$line_items[] = $item;
|
||||
|
||||
$credit->save();
|
||||
$credit->line_items = $line_items;
|
||||
|
||||
$credit_calc = new InvoiceSum($credit);
|
||||
$credit_calc->build();
|
||||
$credit->save();
|
||||
|
||||
$credit = $credit_calc->getCredit();
|
||||
$credit_calc = new InvoiceSum($credit);
|
||||
$credit_calc->build();
|
||||
|
||||
$credit->service()->markSent()->save();
|
||||
$credit = $credit_calc->getCredit();
|
||||
|
||||
$credit->service()->markSent()->save();
|
||||
}
|
||||
/* Set invoice balance to 0 */
|
||||
$this->invoice->ledger()->updateInvoiceBalance($balance_remaining, $item->notes)->save();
|
||||
$this->invoice->ledger()->updateInvoiceBalance($balance_remaining, $notes)->save();
|
||||
|
||||
$this->invoice->balance= 0;
|
||||
|
||||
|
@ -11,8 +11,8 @@ return [
|
||||
'app_env' => env('APP_ENV', 'local'),
|
||||
'app_url' => env('APP_URL', ''),
|
||||
'app_domain' => env('APP_DOMAIN', ''),
|
||||
'app_version' => '0.0.2',
|
||||
'api_version' => '0.0.1',
|
||||
'app_version' => '0.0.3',
|
||||
'api_version' => '0.0.3',
|
||||
'terms_version' => '1.0.1',
|
||||
'api_secret' => env('API_SECRET', ''),
|
||||
'google_maps_api_key' => env('GOOGLE_MAPS_API_KEY'),
|
||||
|
@ -28,7 +28,7 @@ class InvoiceActionsTest extends TestCase
|
||||
public function testInvoiceIsDeletable()
|
||||
{
|
||||
$this->assertTrue($this->invoiceDeletable($this->invoice));
|
||||
$this->assertFalse($this->invoiceReversable($this->invoice));
|
||||
$this->assertTrue($this->invoiceReversable($this->invoice));
|
||||
$this->assertFalse($this->invoiceCancellable($this->invoice));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user