mirror of
https://gitlab.com/uldvstar/exchange-2.0.git
synced 2026-08-19 04:24:16 +00:00
99a3a11267
# Conflicts: # resources/assets/vue/components/companies/sections/customerDashboardSectionComponent.vue # routes/web.php
177 lines
7.2 KiB
PHP
177 lines
7.2 KiB
PHP
<?php
|
|
|
|
use App\Classes\Modules\Documents\DataTransferObjects\DocumentObject;
|
|
use App\Classes\Modules\Documents\Services\CreatesDocument;
|
|
use App\Classes\Modules\Documents\Services\CreatesFiles;
|
|
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
|
use App\Classes\ValueObjects\Constants\DocumentType;
|
|
use App\Classes\ValueObjects\Constants\TransactionType;
|
|
use App\Models\Transaction;
|
|
use App\Models\User;
|
|
use Illuminate\Support\Facades\Route;
|
|
use Maatwebsite\Excel\Excel;
|
|
use Meneses\LaravelMpdf\Facades\LaravelMpdf;
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Web Routes
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Here is where you can register web routes for your application. These
|
|
| routes are loaded by the RouteServiceProvider within a group which
|
|
| contains the "web" middleware group. Now create something great!
|
|
|
|
|
*/
|
|
|
|
Route::get('', function () {
|
|
return view('pages.accounts.login');
|
|
})->name('login');
|
|
|
|
Route::get('/account/email/verification/{token}', function ($token) {
|
|
return view('pages.accounts.email_verified', ['token' => $token]);
|
|
})->name('account.email.verification');
|
|
|
|
Route::get('/account/password/reset/{token}', function ($token) {
|
|
return view('pages.accounts.reset_password', ['token' => $token]);
|
|
})->name('account.password.reset');
|
|
|
|
Route::get('/dashboard', function () {
|
|
return view('pages.dashboards.index');
|
|
})->name('dashboard');
|
|
|
|
Route::get('/banks', function () {
|
|
return view('pages.banks.index');
|
|
})->name('banks');
|
|
|
|
|
|
Route::get('/settings', function () {
|
|
return view('pages.settings');
|
|
})->name('settings');
|
|
|
|
Route::get('/customers', function () {
|
|
return view('pages.customers.index');
|
|
})->name('customers');
|
|
|
|
Route::get('/customer/{marking}', function ($marking) {
|
|
$id = \App\Models\Company::where('reference', '=', $marking)->first()->id;
|
|
return view('pages.customers.profile', ['id' => $id]);
|
|
})->name('customer.profile');
|
|
|
|
Route::get('/payments', function () {
|
|
return view('pages.payments');
|
|
})->name('payments');
|
|
|
|
Route::get('/currency_orders', function () {
|
|
return view('pages.currency_orders');
|
|
})->name('currency_orders');
|
|
|
|
Route::get('/transfers', function () {
|
|
return view('pages.bookings.index');
|
|
})->name('bookings');
|
|
|
|
Route::get('/bookings/urgent', function () {
|
|
return view('pages.urgent_list');
|
|
})->name('bookings.urgent');
|
|
|
|
Route::get('/transfer/{marking}', function ($marking) {
|
|
return view('pages.bookings.profile', ['marking' => $marking]);
|
|
})->name('booking.details');
|
|
|
|
Route::get('/transfer/merge/{marking}', function ($marking) {
|
|
return view('pages.bookings.merge', ['marking' => $marking]);
|
|
})->name('booking.merge');
|
|
|
|
Route::get('/online_payment/redirect', 'Billplz\CallbackBillplzController@callback')->name('online_payment.redirect');
|
|
|
|
Route::get('/export/customers/f614e339d7058904a831aad742e24d55', 'Exports\ExportCustomersToExcelController@export');
|
|
Route::get('/export/transactions/f614e339d7058904a831aad742e24d55', 'Exports\ExportCustomersToExcelController@transactions');
|
|
|
|
Route::get('/products', function (\App\Classes\Modules\Exports\Services\ExportsProducts $exportsProducts) {
|
|
return $exportsProducts->download('products.csv', Excel::CSV, ['Content-Type' => 'text/csv']);
|
|
})->name('products.random');
|
|
|
|
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){
|
|
foreach ($dos as $do){
|
|
$do->booking->documents()->where('document_type', DocumentType::SUPPLIER_DELIVER_ORDER)->delete();
|
|
$supplier = [];
|
|
$po = $do->booking->transactions()->where('type', TransactionType::PURCHASE_ORDER)->first();
|
|
$supplier_order_pdf = LaravelMpdf::loadView('pages.pdfs.supplier_deliver_order', ['supplier_deliver_order_transaction' => $do, 'po_order_transaction' => $po, 'supplier' => $supplier]);
|
|
$document_object = new DocumentObject(
|
|
DocumentType::SUPPLIER_DELIVER_ORDER,
|
|
[chunk_split('data:application/pdf;base64,'.base64_encode($supplier_order_pdf->output()))],
|
|
'',
|
|
ApprovalStatus::COMPLETED,
|
|
'supplier_delivery_orders'
|
|
);
|
|
$document = (App()->make(CreatesDocument::class))->execute($do->booking, $document_object);
|
|
(App()->make(CreatesFiles::class))->execute($document, $document_object);
|
|
}
|
|
});
|
|
|
|
|
|
})->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]);
|
|
})->name('wallet.details');
|
|
|
|
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');
|
|
|
|
Route::get('billplz/bills/{bill_no}', function($bill_no){
|
|
return redirect(env('BILLPLZ_BASE_URL').'/bills/'.$bill_no);
|
|
})->name('billplz.bill');
|
|
|
|
|
|
Route::get('/export/customers/f614e339d7058904a831aad742e24d55', 'Exports\ExportCustomersToExcelController@export');
|
|
Route::get('/export/transactions/f614e339d7058904a831aad742e24d55', 'Exports\ExportCustomersToExcelController@transactions');
|
|
|
|
Route::get('/products', function (\App\Classes\Modules\Exports\Services\ExportsProducts $exportsProducts) {
|
|
return $exportsProducts->download('products.csv', Excel::CSV, ['Content-Type' => 'text/csv']);
|
|
})->name('products.random');
|
|
|
|
Route::get('/auto-purchase-order-fill', 'Bookings\AutoPurchaseOrderFillController@auto')->name('assign');
|