@@ -341,6 +370,18 @@ const DailyMarketingReportContent = () => {
+
+
`${props.row.original.aging_days} hari`,
},
{
- accessorKey: 'warehouse.name',
+ accessorKey: 'warehouse',
header: 'Gudang',
+ cell: ({ row }) => row.original.warehouse.name,
},
{
- accessorKey: 'customer.name',
+ accessorKey: 'customer',
header: 'Pelanggan',
+ cell: ({ row }) => row.original.customer.name,
},
{
accessorKey: 'do_number',
header: 'No. DO',
+ enableSorting: false,
},
{
- accessorKey: 'sales',
+ accessorKey: 'sales_person',
header: 'Sales/Marketing',
cell: (props) => props.row.original.sales.name,
},
@@ -97,10 +100,12 @@ const DailyMarketingsTable = ({
{
accessorKey: 'marketing_type',
header: 'Marketing Type',
+ enableSorting: false,
},
{
- accessorKey: 'product.name',
+ accessorKey: 'product',
header: 'Produk',
+ cell: ({ row }) => row.original.product.name,
},
{
accessorKey: 'qty',
@@ -115,12 +120,12 @@ const DailyMarketingsTable = ({
},
},
{
- accessorKey: 'average_weight_kg',
+ accessorKey: 'average_weight',
header: 'Bobot Rata-Rata (Kg)',
cell: (props) => formatNumber(props.row.original.average_weight_kg),
},
{
- accessorKey: 'total_weight_kg',
+ accessorKey: 'total_weight',
header: 'Bobot Total (Kg)',
cell: (props) => formatNumber(props.row.original.total_weight_kg),
footer: () => {
@@ -132,12 +137,12 @@ const DailyMarketingsTable = ({
},
},
{
- accessorKey: 'sales_price_per_kg',
+ accessorKey: 'sales_price',
header: 'Harga Jual (Rp)',
cell: (props) => formatCurrency(props.row.original.sales_price_per_kg),
},
{
- accessorKey: 'hpp_price_per_kg',
+ accessorKey: 'hpp_price',
header: 'HPP (Rp)',
cell: (props) => formatCurrency(props.row.original.hpp_price_per_kg),
footer: () => {
@@ -163,6 +168,8 @@ const DailyMarketingsTable = ({
];
useEffect(() => {
+ console.log({ sorting });
+
if (sorting.length === 1) {
onFilterByChange(sorting[0].id);
onSortByChange(sorting[0].desc ? 'desc' : 'asc');
diff --git a/src/config/constant.ts b/src/config/constant.ts
index 364f1824..d3832613 100644
--- a/src/config/constant.ts
+++ b/src/config/constant.ts
@@ -457,3 +457,14 @@ export const MARKETING_TYPE_OPTIONS = [
value: 'trading',
},
];
+
+export const MARKETING_DATE_FILTER_TYPE_OPTIONS = [
+ {
+ label: 'Tanggal Realisasi',
+ value: 'realization_date',
+ },
+ {
+ label: 'Tanggal SO',
+ value: 'so_date',
+ },
+];