feat: add marketplace fee and net amount display in OrderGroupedTable for enhanced order details
This commit is contained in:
parent
37a3537136
commit
7a9bb00711
@ -2,6 +2,7 @@
|
|||||||
import { Link } from '@inertiajs/vue3';
|
import { Link } from '@inertiajs/vue3';
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
import DataTableActions from '@/components/admin/manage/orders/data-table-actions.vue';
|
import DataTableActions from '@/components/admin/manage/orders/data-table-actions.vue';
|
||||||
|
import { formatRupiah } from '@/lib/rupiah';
|
||||||
import DataTableToolbar from '@/components/data-table/DataTableToolbar.vue';
|
import DataTableToolbar from '@/components/data-table/DataTableToolbar.vue';
|
||||||
import { Badge } from '@/components/ui/badge';
|
import { Badge } from '@/components/ui/badge';
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
@ -128,6 +129,12 @@ function statusVariant(status: string): 'default' | 'secondary' | 'destructive'
|
|||||||
order.shipping_cost_formatted }}</strong></span>
|
order.shipping_cost_formatted }}</strong></span>
|
||||||
<span>Total <strong class="text-primary">{{ order.total_amount_formatted
|
<span>Total <strong class="text-primary">{{ order.total_amount_formatted
|
||||||
}}</strong></span>
|
}}</strong></span>
|
||||||
|
<span v-if="order.marketplace_settings_snapshot?.total_fee_amount" class="text-destructive">
|
||||||
|
Potongan Marketplace <strong class="text-destructive">-{{ formatRupiah(order.marketplace_settings_snapshot.total_fee_amount) }}</strong>
|
||||||
|
</span>
|
||||||
|
<span v-if="order.marketplace_settings_snapshot?.net_amount">
|
||||||
|
Total Bersih <strong class="text-green-600">{{ formatRupiah(order.marketplace_settings_snapshot.net_amount) }}</strong>
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<p v-if="order.notes" class="text-muted-foreground text-sm">
|
<p v-if="order.notes" class="text-muted-foreground text-sm">
|
||||||
{{ order.notes }}
|
{{ order.notes }}
|
||||||
|
|||||||
@ -54,6 +54,7 @@ export type OrderListItem = {
|
|||||||
discount_formatted: string;
|
discount_formatted: string;
|
||||||
shipping_cost: number;
|
shipping_cost: number;
|
||||||
shipping_cost_formatted: string;
|
shipping_cost_formatted: string;
|
||||||
|
total_amount: number;
|
||||||
total_amount_formatted: string;
|
total_amount_formatted: string;
|
||||||
notes: string | null;
|
notes: string | null;
|
||||||
created_at_formatted: string;
|
created_at_formatted: string;
|
||||||
@ -68,6 +69,22 @@ export type OrderListItem = {
|
|||||||
} | null;
|
} | null;
|
||||||
};
|
};
|
||||||
items: OrderItemListItem[];
|
items: OrderItemListItem[];
|
||||||
|
marketplace_settings_snapshot?: {
|
||||||
|
platform: string;
|
||||||
|
is_affiliate: boolean;
|
||||||
|
base_amount: number;
|
||||||
|
total_fee_amount: number;
|
||||||
|
net_amount: number;
|
||||||
|
fees: Record<string, {
|
||||||
|
scope: string;
|
||||||
|
value_type: string;
|
||||||
|
value: number;
|
||||||
|
}>;
|
||||||
|
results: Record<string, {
|
||||||
|
amount: number;
|
||||||
|
balance_after: number;
|
||||||
|
}>;
|
||||||
|
} | null;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type OrderCartItem = {
|
export type OrderCartItem = {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user