feat: add marketplace fee and net amount display in OrderGroupedTable for enhanced order details

This commit is contained in:
Yoga Pangestu 2026-06-20 20:11:21 +07:00
parent 37a3537136
commit 7a9bb00711
2 changed files with 24 additions and 0 deletions

View File

@ -2,6 +2,7 @@
import { Link } from '@inertiajs/vue3';
import { computed } from '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 { Badge } from '@/components/ui/badge';
import { Button } from '@/components/ui/button';
@ -128,6 +129,12 @@ function statusVariant(status: string): 'default' | 'secondary' | 'destructive'
order.shipping_cost_formatted }}</strong></span>
<span>Total <strong class="text-primary">{{ order.total_amount_formatted
}}</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>
<p v-if="order.notes" class="text-muted-foreground text-sm">
{{ order.notes }}

View File

@ -54,6 +54,7 @@ export type OrderListItem = {
discount_formatted: string;
shipping_cost: number;
shipping_cost_formatted: string;
total_amount: number;
total_amount_formatted: string;
notes: string | null;
created_at_formatted: string;
@ -68,6 +69,22 @@ export type OrderListItem = {
} | null;
};
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 = {