mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-26 07:53:58 +00:00
initial commit
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Exports\Services;
|
||||
|
||||
use App\Classes\ValueObjects\Constants\BusinessType;
|
||||
use App\Classes\ValueObjects\Constants\CompanyType;
|
||||
use App\Models\Company;
|
||||
use App\Models\User;
|
||||
use Maatwebsite\Excel\Concerns\Exportable;
|
||||
use Maatwebsite\Excel\Concerns\FromQuery;
|
||||
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadingRow;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadings;
|
||||
use Maatwebsite\Excel\Concerns\WithMapping;
|
||||
|
||||
class ExportsUsers implements FromQuery, WithHeadings, WithHeadingRow, WithMapping, ShouldAutoSize
|
||||
{
|
||||
use Exportable;
|
||||
|
||||
public function headings(): array
|
||||
{
|
||||
return [
|
||||
'User',
|
||||
'Email'
|
||||
];
|
||||
}
|
||||
|
||||
public function query()
|
||||
{
|
||||
return User::query();
|
||||
}
|
||||
public function map($users): array
|
||||
{
|
||||
|
||||
return [
|
||||
$users->name,
|
||||
$users->email
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@ use App\Classes\Modules\Exports\Services\ExportsBookingTransactions;
|
||||
use App\Classes\Modules\Exports\Services\ExportsLeadsTransactions;
|
||||
use App\Classes\Modules\Exports\Services\ExportsNullDebtors;
|
||||
use App\Classes\Modules\Exports\Services\ExportsPaymentTransactions;
|
||||
use App\Classes\Modules\Exports\Services\ExportsUsers;
|
||||
use App\Classes\Modules\Exports\Services\ExportsWalletTransactions;
|
||||
use App\Classes\Modules\Exports\Services\ExportsInvoiceTransactions;
|
||||
use App\Models\User;
|
||||
@@ -37,6 +38,11 @@ class ExportCustomersToExcelController
|
||||
return $exportsCustomers->download('customers.csv', Excel::CSV, ['Content-Type' => 'text/csv']);
|
||||
}
|
||||
|
||||
public function exportUsers(ExportsUsers $exportsUsers, Request $request){
|
||||
dd(1);
|
||||
return $exportsUsers->download('users.csv', Excel::CSV, ['Content-Type' => 'text/csv']);
|
||||
}
|
||||
|
||||
public function transactions(ExportsTransactions $exportsTransactions, Request $request){
|
||||
return $exportsTransactions->download('transactions.csv', Excel::CSV, ['Content-Type' => 'text/csv']);
|
||||
}
|
||||
|
||||
+27
-7
@@ -2,6 +2,7 @@
|
||||
|
||||
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;
|
||||
@@ -68,7 +69,6 @@ Route::get('/banks', function () {
|
||||
return view('pages.banks.index');
|
||||
})->name('banks');
|
||||
|
||||
|
||||
Route::get('/settings', function () {
|
||||
return view('pages.settings');
|
||||
})->name('settings');
|
||||
@@ -221,6 +221,7 @@ Route::post('/support', function (Request $request) {
|
||||
Route::get('/online_payment/redirect', 'Billplz\CallbackBillplzController@callback')->name('online_payment.redirect');
|
||||
|
||||
Route::get('/export/customers/f614e339d7058904a831aad742e24d55', 'Exports\ExportCustomersToExcelController@export');
|
||||
Route::get('/export/users', 'Exports\ExportCustomersToExcelController@exportUsers');
|
||||
Route::get('/export/transactions/f614e339d7058904a831aad742e24d55', 'Exports\ExportCustomersToExcelController@transactions');
|
||||
Route::get('/export/analytic/booking', 'Exports\ExportAnalyticToExcelController@bookingData');
|
||||
Route::get('/export/analytic/bills', 'Exports\ExportAnalyticToExcelController@billingData');
|
||||
@@ -539,12 +540,27 @@ Route::get('/group/text/{id}', function($id){
|
||||
}
|
||||
})->name('group.text');
|
||||
|
||||
route:: get('/group/excel/{id}',function () {
|
||||
|
||||
$group = Group::find(1);
|
||||
|
||||
$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]);
|
||||
});
|
||||
|
||||
/*
|
||||
Route::get('/group/excel/{id}', function($id){
|
||||
|
||||
$group = \App\Models\Group::where('id', $id)->first();
|
||||
$totalSum = 0;
|
||||
|
||||
echo '<title>Transaction Details</title>';
|
||||
echo '<title>Excel Form Mockup</title>';
|
||||
echo '<style>';
|
||||
echo 'table {';
|
||||
echo ' border-collapse: collapse;';
|
||||
@@ -600,6 +616,8 @@ Route::get('/group/excel/{id}', function($id){
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
dd($transaction);
|
||||
|
||||
echo '</tbody>';
|
||||
echo '<tr>';
|
||||
echo '<td colspan="5" style="text-align: right;">Sub total booking amount:</td>';
|
||||
@@ -607,28 +625,30 @@ Route::get('/group/excel/{id}', function($id){
|
||||
echo '</tr>';
|
||||
echo '<tr>';
|
||||
echo '<td colspan="5" style="text-align: right;">Transfer Fee:</td>';
|
||||
echo '<td>' . $transaction->original_currency->short_code . '</td>';
|
||||
echo '<td>' . $transaction->original_currency->short_code . ' ' . number_format($transaction->service_charge, 2) . '</td>';
|
||||
echo '</tr>';
|
||||
echo '<tr>';
|
||||
echo '<td colspan="5" style="text-align: right;">Total booking amount:</td>';
|
||||
echo '<td>' . $totalSum . '</td>';
|
||||
echo '<td>' . $transaction->original_currency->short_code . ' ' . $totalSum . '</td>';
|
||||
echo '</tr>';
|
||||
echo '<tr>';
|
||||
echo '<td colspan="5" style="text-align: right;">Sub total amount:</td>';
|
||||
echo '<td>' . $transaction->currency->short_code . '</td>';
|
||||
echo '<td>' . $transaction->currency->short_code . ' ' . $totalSum + $transaction->service_charge . '</td>';
|
||||
echo '</tr>';
|
||||
echo '<tr>';
|
||||
echo '<td colspan="5" style="text-align: right;">Service Charge:</td>';
|
||||
echo '<td>' . $transaction->currency->short_code . '</td>';
|
||||
echo '<td>' . $transaction->currency->short_code . ' ' . number_format($transaction->service_charge, 2) . '</td>';
|
||||
echo '</tr>';
|
||||
echo '<tr>';
|
||||
echo '<td colspan="5" style="text-align: right;">Total Amount:</td>';
|
||||
echo '<td>' . $transaction->currency->short_code . '</td>';
|
||||
echo '</tr>';
|
||||
echo '</table>';
|
||||
echo '</table>';
|
||||
|
||||
echo '</body>';
|
||||
|
||||
})->name('group.excel');
|
||||
*/
|
||||
|
||||
Route::get('/wallet/audit', function (Request $request) {
|
||||
$wallets = \App\Models\Wallet::all();
|
||||
|
||||
Reference in New Issue
Block a user