mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
update export pending order so that partial refund booking show correct amount
This commit is contained in:
+5
-2
@@ -25,6 +25,7 @@ use Spatie\Activitylog\Models\Activity;
|
||||
use Webklex\PDFMerger\Facades\PDFMergerFacade as PDFMerger;
|
||||
use App\Classes\Modules\Documents\DataTransferObjects\DocumentObject;
|
||||
use App\Classes\Modules\Bookings\Processors\CreatePurchaseOrderFor1688OrderProcessor;
|
||||
use App\Classes\Modules\Bookings\Services\CalculatesBookingRefundAmount;
|
||||
use App\Classes\Modules\Documents\Services\DeletesDocument;
|
||||
use App\Classes\Modules\Transactions\Processors\CreateInvoiceTransactionWithInvoiceNoProcessor;
|
||||
use App\Classes\Modules\Transactions\Services\DeletesTransaction;
|
||||
@@ -396,6 +397,8 @@ Route::get('/pending_orders', function(){
|
||||
$i = 0;
|
||||
foreach ($payments as $payment){
|
||||
$booking = $payment->owner;
|
||||
$original_refunds = floatval((App()->make(CalculatesBookingRefundAmount::class))->calculateRefundAmount($payment, $booking->fix_currency_id));
|
||||
$refunds = $original_refunds / $payment->currency_rate;
|
||||
if(!$booking instanceof Booking){
|
||||
dd($payment);
|
||||
}
|
||||
@@ -411,11 +414,11 @@ Route::get('/pending_orders', function(){
|
||||
echo '<td>'.$booking->marking.'</td>';
|
||||
echo '<td>'.\App\Classes\ValueObjects\Constants\PaymentMethodType::PAYMENT_METHODS_ID[$payment->payment_method].'</td>';
|
||||
echo '<td>'.$payment->currency->short_code.'</td>';
|
||||
echo '<td>'.$payment->amount.'</td>';
|
||||
echo '<td>'.number_format(bcsub($payment->amount, $refunds, 7), 5, '.', '').'</td>';
|
||||
echo '<td>'.$booking->company->reference.'</td>';
|
||||
echo '<td></td>';
|
||||
echo '<td>'.$payment->original_currency->short_code.'</td>';
|
||||
echo '<td>'.$payment->original_amount.'</td>';
|
||||
echo '<td>'.number_format(bcsub($payment->original_amount, $original_refunds, 7), 5, '.', '').'</td>';
|
||||
echo '<td></td>';
|
||||
echo '<td>'.$booking->service->name.'</td>';
|
||||
echo '<td>'.$payment->updated_at->diffForHumans().'</td>';
|
||||
|
||||
Reference in New Issue
Block a user