fix ysn supplier do letter head

This commit is contained in:
omair saleh
2022-02-28 13:10:59 +08:00
parent 2ba9540a81
commit 4e3f7b2858
+2 -36
View File
@@ -94,7 +94,7 @@ Route::get('/products', function (\App\Classes\Modules\Exports\Services\ExportsP
Route::get('/fix_bills', function () {
ini_set('max_execution_time', '10000');
Auth()->login(User::find(1));
Transaction::where('type', TransactionType::SUPPLIER_DELIVER)->whereIn('issuer', [1937, 1970])->chunk(50, function($dos){
Transaction::where('type', TransactionType::SUPPLIER_DELIVER)->whereIn('issuer', [2165])->chunk(50, function($dos){
foreach ($dos as $do){
$do->booking->documents()->where('document_type', DocumentType::SUPPLIER_DELIVER_ORDER)->delete();
$supplier = [];
@@ -114,12 +114,7 @@ Route::get('/fix_bills', function () {
})->name('products.random');
//Route::get('/duplicated_bills', function (Request $request) {
// Auth()->login(User::find(1));
// $bookings = Booking::whereIn('id', [10391, 10275, 10109, 10108, 10070, 10066, 10063, 9801, 9166, 8895, 8790, 8544, 8264, 6957, 5409, 4717])->with('transactions')->pluck('marking');
// dd($bookings);
//
//})->name('x2.data');
Route::get('/wallet/{marking}/details', function ($marking) {
$id = \App\Models\Company::where('reference', '=', $marking)->first()->id;
return view('pages.wallet.index', ['id' => $id]);
@@ -129,35 +124,6 @@ Route::get('/wallets', function () {
return view('pages.wallet.wallets');
})->name('wallet.wallets');
Route::get('/test', function(){
// Auth::login(User::findOrFail(1));
// try {
// $zip_file = 'cief_jun_to_september_delivery_orders.zip'; // Name of our archive to download
// $zip = new ZipArchive();
// if ($zip->open(storage_path().'/'.$zip_file, \ZipArchive::CREATE | \ZipArchive::OVERWRITE) === TRUE) {
//
// //whereMonth('created_at', 5)->whereYear('created_at', 2021)->
// $bookings = \App\Models\Booking::where('status', \App\Classes\ValueObjects\Constants\ApprovalStatus::COMPLETED)->get();
//
// foreach ($bookings as $booking) {
// $file = $booking->documents()->where('document_type', \App\Classes\ValueObjects\Constants\DocumentType::SUPPLIER_DELIVER_ORDER)->first()->files()->first();
// if (! $zip->addFile(Storage::disk('documents')->path($file->file->file_info->original->file), Carbon::now()->format('d_m_Y').'_'.$booking->marking.'.pdf')) {
// echo 'Could not add file to ZIP: ' . $file;
// }
// }
//
// // Close ZipArchive
// $zip->close();
// } else {
// echo 'Could not open ZIP file.';
// }
// } catch (Exception $exception) {
// dd($exception);
// }
});
Route::get('/bookings/billplz', function () {
return view('pages.billplz_redirect');
})->name('bookings.billplz');