mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
feat: invoice export
This commit is contained in:
@@ -40,12 +40,12 @@
|
||||
</button>
|
||||
</a>
|
||||
|
||||
<!-- invoice format output button
|
||||
|
||||
<!-- invoice format output button-->
|
||||
<a :href="route('group.invoice', item.id)" target="_blank">
|
||||
<button class="btn btn-xs b-rad-none">
|
||||
<i class="fa fa-list-alt" aria-hidden="true"></i>
|
||||
</button>
|
||||
-->
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
use App\Classes\Modules\Transactions\ControllersLogic\DownloadMockUpWhiteFormPdfLogic;
|
||||
use App\Classes\Modules\Transactions\Processors\CreateInvoiceTransactionProcessor;
|
||||
use App\Http\Controllers\Accounting\BankStatementController;
|
||||
use App\Models\Group;
|
||||
use App\Models\Remark;
|
||||
use Carbon\Carbon;
|
||||
use App\Models\User;
|
||||
@@ -564,6 +565,35 @@ route::get('/group/pdf/{id}', function ($id) {
|
||||
return $dompdf->stream("group_pdf_{$id}.pdf");
|
||||
})->name('group.pdf');
|
||||
|
||||
Route::get('/group/invoice/{id}', function ($id) {
|
||||
|
||||
$group = Group::findOrFail($id);
|
||||
|
||||
$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.supplier_deliver_order_groupInvoice', [
|
||||
'group'=> $group,
|
||||
'transactions' => $group->transactions,
|
||||
'transferFeeTransactions' => $transferFeeTransactions,
|
||||
'supplier' => $supplier
|
||||
])->render();
|
||||
|
||||
$dompdf = new Dompdf();
|
||||
$dompdf->loadHtml($html);
|
||||
$dompdf->setPaper('A4', 'portrait');
|
||||
$dompdf->render();
|
||||
|
||||
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) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user