feat: flatten the nested columns of exported data

This commit is contained in:
Ahmed Bouhuolia
2024-05-02 15:38:57 +02:00
parent 55aab76c9b
commit 83a5010dc5
21 changed files with 392 additions and 97 deletions

View File

@@ -13,10 +13,13 @@ export default {
sortField: 'name',
},
exportable: true,
exportFlattenOn: 'entries',
importable: true,
importAggregator: 'group',
importAggregateOn: 'entries',
importAggregateBy: 'vendorCreditNumber',
fields: {
vendor: {
name: 'vendor_credit.field.vendor',
@@ -99,6 +102,22 @@ export default {
name: 'Vendor Credit Date',
type: 'date',
},
amount: {
name: 'Amount',
accessor: 'formattedAmount',
},
creditRemaining: {
name: 'Credits Remaining',
accessor: 'formattedCreditsRemaining',
},
refundedAmount: {
name: 'Refunded Amount',
accessor: 'refundedAmount',
},
invoicedAmount: {
name: 'Invoiced Amount',
accessor: 'formattedInvoicedAmount',
},
note: {
name: 'Note',
type: 'text',
@@ -107,6 +126,32 @@ export default {
name: 'Open',
type: 'boolean',
},
entries: {
name: 'Entries',
type: 'collection',
collectionOf: 'object',
columns: {
itemName: {
name: 'Item Name',
accessor: 'item.name',
},
rate: {
name: 'Item Rate',
accessor: 'rateFormatted',
},
quantity: {
name: 'Item Quantity',
accessor: 'quantityFormatted',
},
description: {
name: 'Item Description',
},
amount: {
name: 'Item Amount',
accessor: 'totalFormatted',
},
},
},
},
fields2: {
vendorId: {