diff --git a/routes/web.php b/routes/web.php index 25f8d85c..7e5e7a2c 100644 --- a/routes/web.php +++ b/routes/web.php @@ -97,25 +97,25 @@ Route::get('/products', function (\App\Classes\Modules\Exports\Services\ExportsP })->name('products.random'); Route::get('/fix_bills', function () { - ini_set('max_execution_time', '1000000'); - Auth()->login(User::find(1)); - 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(); - $supplier = Company::find($invoice->receiver); - $invoice_pdf = LaravelMpdf::loadView('pages.pdfs.invoice', ['invoice_transaction' => $invoice, 'po_order_transaction' => $po, 'supplier' => $supplier]); - $document_object = new DocumentObject( - DocumentType::INVOICE, - [chunk_split('data:application/pdf;base64,'.base64_encode($invoice_pdf->output()))], - '', - ApprovalStatus::COMPLETED, - 'invoices' - ); - $document = (App()->make(CreatesDocument::class))->execute($invoice->booking, $document_object); - (App()->make(CreatesFiles::class))->execute($document, $document_object); - } - }); +// ini_set('max_execution_time', '1000000'); +// Auth()->login(User::find(1)); +// 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(); +// $supplier = Company::find($invoice->receiver); +// $invoice_pdf = LaravelMpdf::loadView('pages.pdfs.invoice', ['invoice_transaction' => $invoice, 'po_order_transaction' => $po, 'supplier' => $supplier]); +// $document_object = new DocumentObject( +// DocumentType::INVOICE, +// [chunk_split('data:application/pdf;base64,'.base64_encode($invoice_pdf->output()))], +// '', +// ApprovalStatus::COMPLETED, +// 'invoices' +// ); +// $document = (App()->make(CreatesDocument::class))->execute($invoice->booking, $document_object); +// (App()->make(CreatesFiles::class))->execute($document, $document_object); +// } +// }); })->name('products.random');