Merge branch 'master' of gitlab.com:CIEFWorldwideSdnBhd/exchange-2.0 into development

This commit is contained in:
edmondlang
2023-07-10 21:59:26 +08:00
3 changed files with 27 additions and 11 deletions
@@ -7,13 +7,16 @@ use App\Classes\Exceptions\MalformedRequestException;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Accounting\Services\CreatesBankStatementTransactionOwner;
use App\Classes\Modules\Accounting\Services\FetchesBankStatementTransaction;
use App\Classes\Modules\Accounting\Processors\ListShippingPortalTransactions;
use App\Classes\ValueObjects\Constants\StatementTransactionOwnerType;
use App\Classes\ValueObjects\Constants\SystemType;
use App\Classes\Modules\Accounting\Processors\ChecksBillNumber;
use App\Classes\ValueObjects\Constants\ShippingTransactionType;
use App\Classes\ValueObjects\Constants\TransactionType;
use App\Models\Booking;
use App\Models\Transaction;
use App\Models\Wallet;
use Exception;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
@@ -104,10 +107,18 @@ class UpdateBankStatementDetailLogic extends AbstractControllerLogic
}
if($systemReference === 'izyim') {
$transaction = $transaction[0];
$owner_type = Transaction::class;
$owner_id = $transaction['owner_id'];
$owner_reference = $transaction['owner_reference'];
$transaction = $transaction[0];
$payFor = $request->input('pay_for');
$transactionType = $transaction['type'];
if (($payFor === 'sales' && !in_array($transactionType, [ShippingTransactionType::PAYMENT, ShippingTransactionType::GROUP_PAYMENT]))
|| ($payFor === 'top_up' && !in_array($transactionType, [ShippingTransactionType::TOP_UP]))) {
throw new Exception("Transaction Type does not match");
}
$owner_type = Transaction::class;
$owner_id = $transaction['owner_id'];
$owner_reference = $transaction['owner_reference'];
}
}
@@ -12,8 +12,7 @@ class ListShippingPortalTransactions
public function execute($filters)
{
try {
// $url = 'https://izyim.cief-malaysia.com/public/api/v1/transactions/mappable/query/with-details';
$url = 'http://127.0.0.1:8000/public/api/v1/transactions/mappable/query/with-details';
$url = 'https://izyim.cief-malaysia.com/public/api/v1/transactions/mappable/query/with-details';
$client = new \GuzzleHttp\Client(['verify' => false]);
$response = $client->request('GET', $url . '?api-key=510acd13d8d24375cf038ad626c282565451461a9c2399357e0b65365300787e&filters=' . json_encode($filters));
$body = $response->getBody();
+11 -5
View File
@@ -174,15 +174,21 @@
<td colspan="4"></td>
<td class="right middle">Total</td>
<td class="total right middle">
@php
$service_charge = (float)number_format($transaction->service_charge, 2,'.','');
$tax = (float)number_format($transaction->tax, 2,'.','');
$rounded_voucher = (float)number_format($voucher_discount, 2,'.','');
@endphp
@if($transaction->booking()->first()->fix_currency_id !== 1)
@php
$service_charge = (float)number_format($transaction->service_charge, 2,'.','');
$tax = (float)number_format($transaction->tax, 2,'.','');
$rounded_voucher = (float)number_format($voucher_discount, 2,'.','');
$rounded_subtotal = (float)number_format($subtotal, 2,'.','');
@endphp
{{ number_format($subtotal + $service_charge + $tax + $rounded_voucher, 2) }}
{{ number_format($rounded_subtotal + $service_charge + $tax + $rounded_voucher, 2) }}
@else
{{ number_format($transaction->amount + $transaction->service_charge + $transaction->tax + $voucher_discount, 2) }}
@php
$rounded_transaction_amount = (float)number_format($transaction->amount, 2,'.','');
@endphp
{{ number_format($rounded_transaction_amount + $service_charge + $tax + $rounded_voucher, 2) }}
@endif
</td>
</tr>