mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
update export currency vendor order
This commit is contained in:
@@ -21,24 +21,19 @@
|
||||
<div class="font-heading fs-10 muted all-caps text-right">Export</div>
|
||||
<div class="row parentcontainer">
|
||||
<div class="col d-flex justify-content-end">
|
||||
<a :href="route('group.pdf', item.id)" target="_blank">
|
||||
<button class="btn btn-xs b-rad-none" v-tooltip:top="'Export in PDF'">
|
||||
<i class="fa fa-file-pdf-o bold fs-12"></i>
|
||||
<a :href="route('group.text', item.id)" target="_blank" v-tooltip:top="'Export in Text'" class="m-l-5">
|
||||
<button class="btn btn-xs b-rad-none">
|
||||
<i class="fa fa-font"></i>
|
||||
</button>
|
||||
</a>
|
||||
<a :href="route('group.text', item.id)" target="_blank" v-tooltip:top="'Export in Text'">
|
||||
<a :href="route('group.excel', item.id)" target="_blank" v-tooltip:top="'Export in Excel'" class="m-l-5">
|
||||
<button class="btn btn-xs b-rad-none">
|
||||
<i class="fa fa-font bold fs-12"></i>
|
||||
<i class="fa fa-file-excel-o"></i>
|
||||
</button>
|
||||
</a>
|
||||
<a :href="route('group.excel', item.id)" target="_blank" v-tooltip:top="'Export in Excel'">
|
||||
<a :href="route('group.invoice', item.id)" target="_blank" v-tooltip:top="'Export Invoice PDF'" class="m-l-5">
|
||||
<button class="btn btn-xs b-rad-none">
|
||||
<i class="fa fa-file-excel-o bold fs-12"></i>
|
||||
</button>
|
||||
</a>
|
||||
<a :href="route('group.invoice', item.id)" target="_blank" v-tooltip:top="'Export Invoice PDF'">
|
||||
<button class="btn btn-xs b-rad-none">
|
||||
<i class="fa fa-list-alt bold fs-12"></i>
|
||||
<i class="fa fa-list-alt"></i>
|
||||
</button>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -32,42 +32,42 @@
|
||||
<table style="margin-bottom: 25px; border: none;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td width="70%" style="text-align: right;">Sub total booking amount: </td>
|
||||
<td width="70%" style="text-align: right;" colspan="4">Sub total booking amount: </td>
|
||||
@php
|
||||
$sub_total_booking_amount = number_format((float)$transactions->sum('original_amount'), 2, '.', '');
|
||||
@endphp
|
||||
<td>{{$transaction->original_currency->short_code}} {{$sub_total_booking_amount}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="70%" style="text-align: right;">Transfer fee: </td>
|
||||
<td width="70%" style="text-align: right;" colspan="4">Transfer fee: </td>
|
||||
@php
|
||||
$transfer_fee = number_format((float)$transferFeeTransactions->sum('service_charge'), 2, '.', '');
|
||||
@endphp
|
||||
<td>{{$transaction->original_currency->short_code}} {{$transfer_fee}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="70%" style="text-align: right;">Total booking amount: </td>
|
||||
<td width="70%" style="text-align: right;" colspan="4">Total booking amount: </td>
|
||||
@php
|
||||
$total_booking_amount = number_format((float) ($transactions->sum('original_amount') + $transfer_fee), 2, '.', '');
|
||||
@endphp
|
||||
<td>{{$transaction->original_currency->short_code}} {{$total_booking_amount}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="70%" style="text-align: right;">Sub total amount: </td>
|
||||
<td width="70%" style="text-align: right;" colspan="4">Sub total amount: </td>
|
||||
@php
|
||||
$sub_total_amount = number_format((float)$transactions->sum('amount') + ($transfer_fee * 1/$transactions[0]->currency_rate), 2, '.', '');
|
||||
@endphp
|
||||
<td>MYR {{$sub_total_amount}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="70%" style="text-align: right;">Service charge: </td>
|
||||
<td width="70%" style="text-align: right;" colspan="4">Service charge: </td>
|
||||
@php
|
||||
$service_charge = number_format((float)$transactions->sum('service_charge'), 2, '.', '');
|
||||
@endphp
|
||||
<td>MYR {{$service_charge}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="70%" style="text-align: right;">Total amount: </td>
|
||||
<td width="70%" style="text-align: right;" colspan="4">Total amount: </td>
|
||||
@php
|
||||
$total_amount = number_format((float)$sub_total_amount + $service_charge, 2, '.', '');
|
||||
@endphp
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<table>
|
||||
<tr>
|
||||
<td class="title">
|
||||
<strong>Delivery Order</strong>
|
||||
<strong>Invoice</strong>
|
||||
</td>
|
||||
<td class="document-detail">
|
||||
PO#: {{$group->reference}} <br>
|
||||
@@ -66,7 +66,7 @@
|
||||
<tr style="margin-bottom: 10px;">
|
||||
<td width="5%" class="center top">{{ $key + 1 }}</td>
|
||||
<td class="marking top" width="10%">{{$transaction->owner->owner->marking}}</td>
|
||||
<td class="description">Please refer to the appedix reference no: {{$transaction->owner->owner->company->reference}}</td>
|
||||
<td class="description">Please refer to the appedix reference no: {{$transaction->owner->owner->marking}}</td>
|
||||
<td width="10%" class="center top">{{$transaction->currency_rate}}</td>
|
||||
<td>{{$transaction->currency->short_code}} {{number_format((float)$transaction->amount, 2, '.', '')}}</td>
|
||||
@php
|
||||
|
||||
+1
-44
@@ -294,6 +294,7 @@ Route::get('/export/imported-receipt-mapped', 'Exports\ExportCustomersToExcelCon
|
||||
Route::get('/export/analytic/booking', 'Exports\ExportAnalyticToExcelController@bookingData');
|
||||
Route::get('/export/analytic/bills', 'Exports\ExportAnalyticToExcelController@billingData');
|
||||
Route::get('/export/customers/leads', 'Exports\ExportCustomersToExcelController@leadsData')->name('leads.export');
|
||||
route::get('/export/excel/{id}', 'Exports\ExportCustomersToExcelController@exportCurrencyVendorOrder')->name('group.excel');
|
||||
|
||||
Route::get('/products', function (\App\Classes\Modules\Exports\Services\ExportsProducts $exportsProducts) {
|
||||
$bookings = Booking::where(function($query){
|
||||
@@ -540,32 +541,6 @@ Route::get('/group/text/{id}', function($id){
|
||||
}
|
||||
})->name('group.text');
|
||||
|
||||
route::get('/group/pdf/{id}', function ($id) {
|
||||
$group = \App\Models\Group::where('id', $id)->first();
|
||||
$supplier = $group->issuerCompany;
|
||||
|
||||
$transferFeeTransactions = $group->transactions()
|
||||
->with(['transactions' => function ($transaction) {
|
||||
return $transaction->where('type', TransactionType::TRANSFER_FEE);
|
||||
}])
|
||||
->get()
|
||||
->pluck('transactions')
|
||||
->flatten();
|
||||
|
||||
$html = view('pages.pdfs.currency_vendor_order', [
|
||||
'transactions' => $group->transactions,
|
||||
'transferFeeTransactions' => $transferFeeTransactions,
|
||||
'supplier' => $supplier
|
||||
])->render();
|
||||
|
||||
$dompdf = new Dompdf();
|
||||
$dompdf->loadHtml($html);
|
||||
$dompdf->setPaper('A4', 'portrait');
|
||||
$dompdf->render();
|
||||
|
||||
return $dompdf->stream("group_pdf_{$id}.pdf");
|
||||
})->name('group.pdf');
|
||||
|
||||
Route::get('/group/invoice/{id}', function ($id) {
|
||||
|
||||
$group = Group::findOrFail($id);
|
||||
@@ -595,24 +570,6 @@ Route::get('/group/invoice/{id}', function ($id) {
|
||||
return $dompdf->stream("invoice_pdf_{$supplier->name}.pdf");
|
||||
})->name('group.invoice');
|
||||
|
||||
route::get('/export/excel/{id}', 'Exports\ExportCustomersToExcelController@exportCurrencyVendorOrder');
|
||||
route:: get('/group/excel/{id}',function ($id) {
|
||||
|
||||
echo '<a href="/export/excel/' . $id . '"><p>Download Spreadsheet</p></a>';
|
||||
|
||||
$group = \App\Models\Group::where('id', $id)->first();
|
||||
|
||||
$supplier = $group->issuerCompany;
|
||||
|
||||
$transferFeeTransactions = $group->transactions()->with([
|
||||
'transactions' => function ($transaction) {
|
||||
return $transaction->where('type', TransactionType::TRANSFER_FEE);
|
||||
}])->get()->pluck('transactions')->flatten();
|
||||
|
||||
return view('pages.pdfs.currency_vendor_order', ['transactions' => $group->transactions, 'transferFeeTransactions' => $transferFeeTransactions, 'supplier' => $supplier]);
|
||||
|
||||
})->name('group.excel');
|
||||
|
||||
Route::get('/wallet/audit', function (Request $request) {
|
||||
$wallets = \App\Models\Wallet::all();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user