diff --git a/app/Classes/Modules/Exports/Services/ExportsCustomersWalletTransactionHistory.php b/app/Classes/Modules/Exports/Services/ExportsCustomersWalletTransactionHistory.php
index e38ce8ac..745539f5 100644
--- a/app/Classes/Modules/Exports/Services/ExportsCustomersWalletTransactionHistory.php
+++ b/app/Classes/Modules/Exports/Services/ExportsCustomersWalletTransactionHistory.php
@@ -58,6 +58,8 @@ class ExportsCustomersWalletTransactionHistory implements FromQuery, WithHeading
{
// dd($transaction);
+ $decimals = $this->request->route('is_precise') == 'true' ? 5 : 2;
+
$description = '';
switch ((int) $transaction->type) {
case 5:
@@ -85,12 +87,12 @@ class ExportsCustomersWalletTransactionHistory implements FromQuery, WithHeading
$incoming = $outgoing = '';
if (in_array($transaction->type, [TransactionType::TOP_UP, TransactionType::CREDIT_NOTE])) {
- $incoming = number_format($transaction->amount, 2, '.', ',');
+ $incoming = number_format($transaction->amount, $decimals, '.', ',');
$this->runningBalance += $transaction->amount;
}
if (in_array($transaction->type, [TransactionType::PAYMENT, TransactionType::DEBIT_NOTE])) {
- $outgoing = number_format($transaction->amount, 2, '.', ',');
+ $outgoing = number_format($transaction->amount, $decimals, '.', ',');
$this->runningBalance -= $transaction->amount;
}
@@ -99,7 +101,7 @@ class ExportsCustomersWalletTransactionHistory implements FromQuery, WithHeading
$description,
$incoming,
$outgoing,
- number_format($this->runningBalance, 2, '.', ',')
+ number_format($this->runningBalance, $decimals, '.', ',')
];
}
}
diff --git a/app/Http/Controllers/Exports/ExportCustomersWalletTransactionToExcelController.php b/app/Http/Controllers/Exports/ExportCustomersWalletTransactionToExcelController.php
index fd49d5b0..c4457565 100644
--- a/app/Http/Controllers/Exports/ExportCustomersWalletTransactionToExcelController.php
+++ b/app/Http/Controllers/Exports/ExportCustomersWalletTransactionToExcelController.php
@@ -2,8 +2,6 @@
namespace App\Http\Controllers\Exports;
-
-use App\Classes\Modules\Exports\Services\ExportsCustomers;
use App\Classes\Modules\Exports\Services\ExportsCustomersWalletTransactionHistory;
use App\Models\User;
use Illuminate\Http\Request;
@@ -20,13 +18,15 @@ class ExportCustomersWalletTransactionToExcelController
public function __construct(Request $request)
{
$token = Auth::fromUser(User::find(1));
- $request->headers->set('Authorization', 'Bearer '.$token);
+ $request->headers->set('Authorization', 'Bearer ' . $token);
}
- public function export(Request $request){
+ public function export(Request $request)
+ {
$exportsTransactions = new ExportsCustomersWalletTransactionHistory($request);
- $response = $exportsTransactions->download('wallet-transaction-history.xls', Excel::XLS, ['Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']);
+ $filename = $request->route('marking') . '-wallet-' . ($request->route('is_precise') == 'true' ? 'precise-' : '') . 'transaction-history.xls';
+ $response = $exportsTransactions->download($filename, Excel::XLS, ['Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']);
ob_end_clean();
return $response;
}
-}
\ No newline at end of file
+}
diff --git a/resources/assets/vue/components/wallets/elements/CustomerTransactionComponent.vue b/resources/assets/vue/components/wallets/elements/CustomerTransactionComponent.vue
new file mode 100644
index 00000000..4d25f91b
--- /dev/null
+++ b/resources/assets/vue/components/wallets/elements/CustomerTransactionComponent.vue
@@ -0,0 +1,83 @@
+
+ Nothing To Show Here Nothing To Show
- Here Nothing
- To Show Here
Precise Wallet Transaction History
- 


Nothing To Show Here
-