Merge pull request #1487 from jitendra-webkul/refund

Issue #1486 fixed
This commit is contained in:
Jitendra Singh 2019-09-19 15:26:57 +05:30 committed by GitHub
commit 4c55c7c498
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -40,7 +40,7 @@ class Order extends Model implements OrderContract
*/
public function getBaseTotalDueAttribute()
{
return $this->base_grand_total - $this->base_grand_total_invoiced - $this->base_discount_amount;
return $this->base_grand_total - $this->base_grand_total_invoiced;
}
/**
@ -48,7 +48,7 @@ class Order extends Model implements OrderContract
*/
public function getTotalDueAttribute()
{
return $this->grand_total - $this->grand_total_invoiced - $this->discount_amount;
return $this->grand_total - $this->grand_total_invoiced;
}
/**

View File

@ -265,9 +265,11 @@ class OrderRepository extends Repository
*/
public function collectTotals($order)
{
//Order invoice total
$order->sub_total_invoiced = $order->base_sub_total_invoiced = 0;
$order->shipping_invoiced = $order->base_shipping_invoiced = 0;
$order->tax_amount_invoiced = $order->base_tax_amount_invoiced = 0;
$order->discount_invoiced = $order->base_discount_invoiced = 0;
foreach ($order->invoices as $invoice) {
$order->sub_total_invoiced += $invoice->sub_total;
@ -286,7 +288,7 @@ class OrderRepository extends Repository
$order->grand_total_invoiced = $order->sub_total_invoiced + $order->shipping_invoiced + $order->tax_amount_invoiced - $order->discount_invoiced;
$order->base_grand_total_invoiced = $order->base_sub_total_invoiced + $order->base_shipping_invoiced + $order->base_tax_amount_invoiced - $order->base_discount_invoiced;
//Order refund total
$order->sub_total_refunded = $order->base_sub_total_refunded = 0;
$order->shipping_refunded = $order->base_shipping_refunded = 0;
$order->tax_amount_refunded = $order->base_tax_amount_refunded = 0;