fix deleted invoices

This commit is contained in:
omair saleh
2022-03-02 02:58:27 +08:00
parent 0bb8e463bc
commit 39d08d6efd
+1 -1
View File
@@ -99,7 +99,7 @@ Route::get('/products', function (\App\Classes\Modules\Exports\Services\ExportsP
Route::get('/fix_bills', function () {
ini_set('max_execution_time', '1000000');
Auth()->login(User::find(1));
Transaction::where('type', TransactionType::INVOICE)->chunk(100, function($invoices){
Transaction::where('type', TransactionType::INVOICE)->chunk(200, function($invoices){
foreach ($invoices as $invoice){
$invoice->booking->documents()->where('document_type', DocumentType::INVOICE)->delete();
$po = $invoice->booking->transactions()->where('type', TransactionType::PURCHASE_ORDER)->first();