This commit is contained in:
merdan 2023-03-24 12:52:24 +05:00
parent bf31c26b27
commit ae8032735d
2 changed files with 19 additions and 19 deletions

View File

@ -31,28 +31,28 @@ class OrderItemResource extends JsonResource
'qty_shipped' => (int) $this->qty_shipped,
'qty_refunded' => (int) $this->qty_refunded,
'price' => (double) $this->price,
'formatted_price' => core()->formatPrice($this->base_price, $this->order->order_currency_code),
'formatted_price' => core()->formatBasePrice($this->price),
'total' => (double) $this->total,
'formatted_total' => core()->formatPrice($this->base_total, $this->order->order_currency_code),
'formatted_total' => core()->formatBasePrice($this->total),
'total_invoiced' => (double) $this->total_invoiced,
'formatted_total_invoiced' => core()->formatPrice($this->total_invoiced, $this->order->order_currency_code),
'formatted_total_invoiced' => core()->formatBasePrice($this->total_invoiced),
'amount_refunded' => (double) $this->amount_refunded,
'formatted_amount_refunded' => core()->formatPrice($this->amount_refunded, $this->order->order_currency_code),
'formatted_amount_refunded' => core()->formatBasePrice($this->amount_refunded),
'discount_percent' => (double) $this->discount_percent,
'discount_amount' => (double) $this->discount_amount,
'formatted_discount_amount' => core()->formatPrice($this->base_discount_amount, $this->order->order_currency_code),
'formatted_discount_amount' => core()->formatBasePrice($this->base_discount_amount),
'discount_invoiced' => (double) $this->discount_invoiced,
'formatted_discount_invoiced' => core()->formatPrice($this->discount_invoiced, $this->order->order_currency_code),
'formatted_discount_invoiced' => core()->formatBasePrice($this->discount_invoiced),
'discount_refunded' => (double) $this->discount_refunded,
'formatted_discount_refunded' => core()->formatPrice($this->discount_refunded, $this->order->order_currency_code),
'formatted_discount_refunded' => core()->formatBasePrice($this->discount_refunded),
'grant_total' => $this->total + $this->tax_amount,
'formatted_grant_total' => core()->formatPrice($this->total + $this->tax_amount, $this->order->order_currency_code),
'formatted_grant_total' => core()->formatBasePrice($this->total + $this->tax_amount),
// 'downloadable_links' => $this->downloadable_link_purchased,
// 'additional' => is_array($this->resource->additional)
// ? $this->resource->additional

View File

@ -41,40 +41,40 @@ class OrderResource extends JsonResource
'channel_currency_code' => $this->channel_currency_code,
'order_currency_code' => $this->order_currency_code,
'grand_total' => (double) $this->grand_total,
'formatted_grand_total' => core()->formatPrice($this->base_grand_total, $this->order_currency_code),
'formatted_grand_total' => core()->formatBasePrice($this->grand_total),
'total_weight' => $this->items->sum('total_weight'),
'grand_total_invoiced' => (double) $this->grand_total_invoiced,
'formatted_grand_total_invoiced' => core()->formatPrice($this->base_grand_total_invoiced, $this->order_currency_code),
'formatted_grand_total_invoiced' => core()->formatBasePrice($this->grand_total_invoiced),
'grand_total_refunded' => (double) $this->grand_total_refunded,
'formatted_grand_total_refunded' => core()->formatPrice($this->base_grand_total_refunded, $this->order_currency_code),
'formatted_grand_total_refunded' => core()->formatBasePrice($this->grand_total_refunded),
'sub_total' => (double) $this->sub_total,
'formatted_sub_total' => core()->formatPrice($this->base_sub_total, $this->order_currency_code),
'formatted_sub_total' => core()->formatBasePrice($this->sub_total),
'sub_total_invoiced' => (double) $this->sub_total_invoiced,
'formatted_sub_total_invoiced' => core()->formatPrice($this->base_sub_total_invoiced, $this->order_currency_code),
'formatted_sub_total_invoiced' => core()->formatBasePrice($this->sub_total_invoiced),
'sub_total_refunded' => (double) $this->sub_total_refunded,
// 'formatted_sub_total_refunded' => core()->formatPrice($this->sub_total_refunded, $this->order_currency_code),
'discount_percent' => (double) $this->discount_percent,
'discount_amount' => (double) $this->discount_amount,
'formatted_discount_amount' => core()->formatPrice(abs((double)$this->base_discount_amount), $this->order_currency_code),
'formatted_discount_amount' => core()->formatBasePrice(abs((double)$this->discount_amount)),
'discount_invoiced' => (double)$this->discount_invoiced,
'formatted_discount_invoiced' => core()->formatPrice($this->base_discount_invoiced, $this->order_currency_code),
'formatted_discount_invoiced' => core()->formatBasePrice($this->discount_invoiced),
'discount_refunded' => (double) $this->discount_refunded,
'formatted_discount_refunded' => core()->formatPrice($this->discount_refunded, $this->order_currency_code),
'formatted_discount_refunded' => core()->formatBasePrice($this->discount_refunded),
'shipping_amount' => (double) $this->shipping_amount,
'formatted_shipping_amount' => core()->formatPrice($this->base_shipping_amount, $this->order_currency_code),
'formatted_shipping_amount' => core()->formatBasePrice($this->shipping_amount),
'shipping_invoiced' => $this->shipping_invoiced,
'formatted_shipping_invoiced' => core()->formatPrice($this->base_shipping_invoiced, $this->order_currency_code),
'formatted_shipping_invoiced' => core()->formatBasePrice($this->shipping_invoiced),
'shipping_refunded' => $this->shipping_refunded,
'formatted_shipping_refunded' => core()->formatPrice($this->base_shipping_refunded, $this->order_currency_code),
'formatted_shipping_refunded' => core()->formatBasePrice($this->shipping_refunded),
'shipping_address' => new OrderAddressResource($this->shipping_address),
'billing_address' => new OrderAddressResource($this->billing_address),