-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
close #252 Fixed: Invoice partial payments are unpredictable
- Loading branch information
1 parent
8573232
commit 83ad45c
Showing
11 changed files
with
152 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
|
||
namespace App\Listeners\Updates; | ||
|
||
use App\Events\UpdateFinished; | ||
use App\Models\Company\Company; | ||
use App\Models\Income\InvoiceStatus; | ||
use App\Models\Expense\BillStatus; | ||
use Artisan; | ||
|
||
class Version1115 extends Listener | ||
{ | ||
const ALIAS = 'core'; | ||
|
||
const VERSION = '1.1.15'; | ||
|
||
/** | ||
* Handle the event. | ||
* | ||
* @param $event | ||
* @return void | ||
*/ | ||
public function handle(UpdateFinished $event) | ||
{ | ||
// Check if should listen | ||
if (!$this->check($event)) { | ||
return; | ||
} | ||
|
||
// Create new bill statuses | ||
$companies = Company::all(); | ||
|
||
foreach ($companies as $company) { | ||
$invoice = [ | ||
'company_id' => $company->id, | ||
'name' => trans('invoices.status.delete'), | ||
'code' => 'delete', | ||
]; | ||
|
||
InvoiceStatus::create($invoice); | ||
|
||
$bill = [ | ||
'company_id' => $company->id, | ||
'name' => trans('bills.status.delete'), | ||
'code' => 'delete', | ||
]; | ||
|
||
BillStatus::create($bill); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters