mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 20:30:33 +00:00
feat: wip configure resources to be exportable
This commit is contained in:
@@ -85,42 +85,34 @@ export default {
|
|||||||
billNumber: {
|
billNumber: {
|
||||||
name: 'Bill No.',
|
name: 'Bill No.',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
exportable: true,
|
|
||||||
},
|
},
|
||||||
referenceNo: {
|
referenceNo: {
|
||||||
name: 'Reference No.',
|
name: 'Reference No.',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
exportable: true,
|
|
||||||
},
|
},
|
||||||
billDate: {
|
billDate: {
|
||||||
name: 'Date',
|
name: 'Date',
|
||||||
type: 'date',
|
type: 'date',
|
||||||
exportable: true,
|
|
||||||
},
|
},
|
||||||
dueDate: {
|
dueDate: {
|
||||||
name: 'Due Date',
|
name: 'Due Date',
|
||||||
type: 'date',
|
type: 'date',
|
||||||
exportable: true,
|
|
||||||
},
|
},
|
||||||
vendorId: {
|
vendorId: {
|
||||||
name: 'Vendor',
|
name: 'Vendor',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
exportable: true,
|
|
||||||
},
|
},
|
||||||
exchangeRate: {
|
exchangeRate: {
|
||||||
name: 'Exchange Rate',
|
name: 'Exchange Rate',
|
||||||
type: 'number',
|
type: 'number',
|
||||||
exportable: true,
|
|
||||||
},
|
},
|
||||||
note: {
|
note: {
|
||||||
name: 'Note',
|
name: 'Note',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
exportable: true,
|
|
||||||
},
|
},
|
||||||
open: {
|
open: {
|
||||||
name: 'Open',
|
name: 'Open',
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
exportable: true,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
fields2: {
|
fields2: {
|
||||||
|
|||||||
@@ -72,38 +72,31 @@ export default {
|
|||||||
vendor: {
|
vendor: {
|
||||||
name: 'bill_payment.field.vendor',
|
name: 'bill_payment.field.vendor',
|
||||||
type: 'relation',
|
type: 'relation',
|
||||||
exportable: true,
|
accessor: 'vendor.displayName',
|
||||||
},
|
},
|
||||||
paymentDate: {
|
paymentDate: {
|
||||||
name: 'bill_payment.field.payment_date',
|
name: 'bill_payment.field.payment_date',
|
||||||
type: 'date',
|
type: 'date',
|
||||||
required: true,
|
|
||||||
exportable: true,
|
|
||||||
},
|
},
|
||||||
paymentNumber: {
|
paymentNumber: {
|
||||||
name: 'bill_payment.field.payment_number',
|
name: 'bill_payment.field.payment_number',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
exportable: true,
|
|
||||||
},
|
},
|
||||||
paymentAccountId: {
|
paymentAccountId: {
|
||||||
name: 'bill_payment.field.payment_account',
|
name: 'bill_payment.field.payment_account',
|
||||||
type: 'relation',
|
type: 'relation',
|
||||||
exportable: true,
|
|
||||||
},
|
},
|
||||||
exchangeRate: {
|
exchangeRate: {
|
||||||
name: 'bill_payment.field.exchange_rate',
|
name: 'bill_payment.field.exchange_rate',
|
||||||
type: 'number',
|
type: 'number',
|
||||||
exportable: true,
|
|
||||||
},
|
},
|
||||||
statement: {
|
statement: {
|
||||||
name: 'bill_payment.field.statement',
|
name: 'bill_payment.field.statement',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
exportable: true,
|
|
||||||
},
|
},
|
||||||
reference: {
|
reference: {
|
||||||
name: 'bill_payment.field.reference',
|
name: 'bill_payment.field.reference',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
exportable: true,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
fields2: {
|
fields2: {
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ export default {
|
|||||||
sortOrder: 'DESC',
|
sortOrder: 'DESC',
|
||||||
sortField: 'name',
|
sortField: 'name',
|
||||||
},
|
},
|
||||||
|
exportable: true,
|
||||||
importable: true,
|
importable: true,
|
||||||
importAggregator: 'group',
|
importAggregator: 'group',
|
||||||
importAggregateOn: 'entries',
|
importAggregateOn: 'entries',
|
||||||
@@ -81,6 +82,41 @@ export default {
|
|||||||
fieldType: 'date',
|
fieldType: 'date',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
columns: {
|
||||||
|
customer: {
|
||||||
|
name: 'Customer',
|
||||||
|
type: 'relation',
|
||||||
|
accessor: 'customer.displayName',
|
||||||
|
},
|
||||||
|
exchangeRate: {
|
||||||
|
name: 'Exchange Rate',
|
||||||
|
type: 'number',
|
||||||
|
},
|
||||||
|
creditNoteDate: {
|
||||||
|
name: 'Credit Note Date',
|
||||||
|
type: 'date',
|
||||||
|
},
|
||||||
|
referenceNo: {
|
||||||
|
name: 'Reference No.',
|
||||||
|
type: 'text',
|
||||||
|
},
|
||||||
|
note: {
|
||||||
|
name: 'Note',
|
||||||
|
type: 'text',
|
||||||
|
},
|
||||||
|
termsConditions: {
|
||||||
|
name: 'Terms & Conditions',
|
||||||
|
type: 'text',
|
||||||
|
},
|
||||||
|
creditNoteNumber: {
|
||||||
|
name: 'Credit Note Number',
|
||||||
|
type: 'text',
|
||||||
|
},
|
||||||
|
open: {
|
||||||
|
name: 'Open',
|
||||||
|
type: 'boolean',
|
||||||
|
},
|
||||||
|
},
|
||||||
fields2: {
|
fields2: {
|
||||||
customerId: {
|
customerId: {
|
||||||
name: 'Customer',
|
name: 'Customer',
|
||||||
|
|||||||
@@ -95,129 +95,157 @@ export default {
|
|||||||
firstName: {
|
firstName: {
|
||||||
name: 'vendor.field.first_name',
|
name: 'vendor.field.first_name',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
lastName: {
|
lastName: {
|
||||||
name: 'vendor.field.last_name',
|
name: 'vendor.field.last_name',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
displayName: {
|
displayName: {
|
||||||
name: 'vendor.field.display_name',
|
name: 'vendor.field.display_name',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
email: {
|
email: {
|
||||||
name: 'vendor.field.email',
|
name: 'vendor.field.email',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
workPhone: {
|
workPhone: {
|
||||||
name: 'vendor.field.work_phone',
|
name: 'vendor.field.work_phone',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
personalPhone: {
|
personalPhone: {
|
||||||
name: 'vendor.field.personal_pone',
|
name: 'vendor.field.personal_pone',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
companyName: {
|
companyName: {
|
||||||
name: 'vendor.field.company_name',
|
name: 'vendor.field.company_name',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
website: {
|
website: {
|
||||||
name: 'vendor.field.website',
|
name: 'vendor.field.website',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
createdAt: {
|
createdAt: {
|
||||||
name: 'vendor.field.created_at',
|
name: 'vendor.field.created_at',
|
||||||
type: 'date',
|
type: 'date',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
balance: {
|
balance: {
|
||||||
name: 'vendor.field.balance',
|
name: 'vendor.field.balance',
|
||||||
type: 'number',
|
type: 'number',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
openingBalance: {
|
openingBalance: {
|
||||||
name: 'vendor.field.opening_balance',
|
name: 'vendor.field.opening_balance',
|
||||||
type: 'number',
|
type: 'number',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
openingBalanceAt: {
|
openingBalanceAt: {
|
||||||
name: 'vendor.field.opening_balance_at',
|
name: 'vendor.field.opening_balance_at',
|
||||||
type: 'date',
|
type: 'date',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
currencyCode: {
|
currencyCode: {
|
||||||
name: 'vendor.field.currency',
|
name: 'vendor.field.currency',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
status: {
|
status: {
|
||||||
name: 'vendor.field.status',
|
name: 'vendor.field.status',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
// Billing Address
|
// Billing Address
|
||||||
billingAddress1: {
|
billingAddress1: {
|
||||||
name: 'Billing Address 1',
|
name: 'Billing Address 1',
|
||||||
column: 'billing_address1',
|
column: 'billing_address1',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
billingAddress2: {
|
billingAddress2: {
|
||||||
name: 'Billing Address 2',
|
name: 'Billing Address 2',
|
||||||
column: 'billing_address2',
|
column: 'billing_address2',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
billingAddressCity: {
|
billingAddressCity: {
|
||||||
name: 'Billing Address City',
|
name: 'Billing Address City',
|
||||||
column: 'billing_address_city',
|
column: 'billing_address_city',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
billingAddressCountry: {
|
billingAddressCountry: {
|
||||||
name: 'Billing Address Country',
|
name: 'Billing Address Country',
|
||||||
column: 'billing_address_country',
|
column: 'billing_address_country',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
billingAddressPostcode: {
|
billingAddressPostcode: {
|
||||||
name: 'Billing Address Postcode',
|
name: 'Billing Address Postcode',
|
||||||
column: 'billing_address_postcode',
|
column: 'billing_address_postcode',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
billingAddressState: {
|
billingAddressState: {
|
||||||
name: 'Billing Address State',
|
name: 'Billing Address State',
|
||||||
column: 'billing_address_state',
|
column: 'billing_address_state',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
billingAddressPhone: {
|
billingAddressPhone: {
|
||||||
name: 'Billing Address Phone',
|
name: 'Billing Address Phone',
|
||||||
column: 'billing_address_phone',
|
column: 'billing_address_phone',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
// Shipping Address
|
// Shipping Address
|
||||||
shippingAddress1: {
|
shippingAddress1: {
|
||||||
name: 'Shipping Address 1',
|
name: 'Shipping Address 1',
|
||||||
column: 'shipping_address1',
|
column: 'shipping_address1',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
shippingAddress2: {
|
shippingAddress2: {
|
||||||
name: 'Shipping Address 2',
|
name: 'Shipping Address 2',
|
||||||
column: 'shipping_address2',
|
column: 'shipping_address2',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
shippingAddressCity: {
|
shippingAddressCity: {
|
||||||
name: 'Shipping Address City',
|
name: 'Shipping Address City',
|
||||||
column: 'shipping_address_city',
|
column: 'shipping_address_city',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
shippingAddressCountry: {
|
shippingAddressCountry: {
|
||||||
name: 'Shipping Address Country',
|
name: 'Shipping Address Country',
|
||||||
column: 'shipping_address_country',
|
column: 'shipping_address_country',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
shippingAddressPostcode: {
|
shippingAddressPostcode: {
|
||||||
name: 'Shipping Address Postcode',
|
name: 'Shipping Address Postcode',
|
||||||
column: 'shipping_address_postcode',
|
column: 'shipping_address_postcode',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
shippingAddressPhone: {
|
shippingAddressPhone: {
|
||||||
name: 'Shipping Address Phone',
|
name: 'Shipping Address Phone',
|
||||||
column: 'shipping_address_phone',
|
column: 'shipping_address_phone',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
shippingAddressState: {
|
shippingAddressState: {
|
||||||
name: 'Shipping Address State',
|
name: 'Shipping Address State',
|
||||||
column: 'shipping_address_state',
|
column: 'shipping_address_state',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
fields2: {
|
fields2: {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ export default {
|
|||||||
sortField: 'name',
|
sortField: 'name',
|
||||||
},
|
},
|
||||||
importable: true,
|
importable: true,
|
||||||
exportabe: true,
|
exportable: true,
|
||||||
fields: {
|
fields: {
|
||||||
payment_date: {
|
payment_date: {
|
||||||
name: 'expense.field.payment_date',
|
name: 'expense.field.payment_date',
|
||||||
@@ -65,6 +65,7 @@ export default {
|
|||||||
columns: {
|
columns: {
|
||||||
paymentReceive: {
|
paymentReceive: {
|
||||||
name: 'expense.field.payment_account',
|
name: 'expense.field.payment_account',
|
||||||
|
type: 'text',
|
||||||
exportable: true,
|
exportable: true,
|
||||||
},
|
},
|
||||||
referenceNo: {
|
referenceNo: {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ export default {
|
|||||||
sortOrder: 'DESC',
|
sortOrder: 'DESC',
|
||||||
},
|
},
|
||||||
importable: true,
|
importable: true,
|
||||||
|
exportable: true,
|
||||||
fields: {
|
fields: {
|
||||||
name: {
|
name: {
|
||||||
name: 'item_category.field.name',
|
name: 'item_category.field.name',
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ export default {
|
|||||||
sortOrder: 'DESC',
|
sortOrder: 'DESC',
|
||||||
sortField: 'estimate_date',
|
sortField: 'estimate_date',
|
||||||
},
|
},
|
||||||
|
exportable: true,
|
||||||
importable: true,
|
importable: true,
|
||||||
importAggregator: 'group',
|
importAggregator: 'group',
|
||||||
importAggregateOn: 'entries',
|
importAggregateOn: 'entries',
|
||||||
@@ -73,6 +74,59 @@ export default {
|
|||||||
columnType: 'date',
|
columnType: 'date',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
columns: {
|
||||||
|
customer: {
|
||||||
|
name: 'Customer',
|
||||||
|
type: 'text',
|
||||||
|
accessor: 'customer.displayName',
|
||||||
|
exportable: true,
|
||||||
|
},
|
||||||
|
estimateDate: {
|
||||||
|
name: 'Estimate Date',
|
||||||
|
type: 'date',
|
||||||
|
exportable: true,
|
||||||
|
},
|
||||||
|
expirationDate: {
|
||||||
|
name: 'Expiration Date',
|
||||||
|
type: 'date',
|
||||||
|
exportable: true,
|
||||||
|
},
|
||||||
|
estimateNumber: {
|
||||||
|
name: 'Estimate No.',
|
||||||
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
|
},
|
||||||
|
reference: {
|
||||||
|
name: 'Reference No.',
|
||||||
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
|
},
|
||||||
|
exchangeRate: {
|
||||||
|
name: 'Exchange Rate',
|
||||||
|
type: 'number',
|
||||||
|
exportable: true,
|
||||||
|
},
|
||||||
|
currencyCode: {
|
||||||
|
name: 'Currency',
|
||||||
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
|
},
|
||||||
|
note: {
|
||||||
|
name: 'Note',
|
||||||
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
|
},
|
||||||
|
termsConditions: {
|
||||||
|
name: 'Terms & Conditions',
|
||||||
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
|
},
|
||||||
|
delivered: {
|
||||||
|
name: 'Delivered',
|
||||||
|
type: 'boolean',
|
||||||
|
exportable: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
fields2: {
|
fields2: {
|
||||||
customerId: {
|
customerId: {
|
||||||
name: 'Customer',
|
name: 'Customer',
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ export default {
|
|||||||
sortOrder: 'DESC',
|
sortOrder: 'DESC',
|
||||||
sortField: 'created_at',
|
sortField: 'created_at',
|
||||||
},
|
},
|
||||||
|
exportable: true,
|
||||||
importable: true,
|
importable: true,
|
||||||
importAggregator: 'group',
|
importAggregator: 'group',
|
||||||
importAggregateOn: 'entries',
|
importAggregateOn: 'entries',
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ export default {
|
|||||||
sortOrder: 'DESC',
|
sortOrder: 'DESC',
|
||||||
sortField: 'created_at',
|
sortField: 'created_at',
|
||||||
},
|
},
|
||||||
|
exportable: true,
|
||||||
importable: true,
|
importable: true,
|
||||||
importAggregator: 'group',
|
importAggregator: 'group',
|
||||||
importAggregateOn: 'entries',
|
importAggregateOn: 'entries',
|
||||||
|
|||||||
@@ -95,129 +95,157 @@ export default {
|
|||||||
firstName: {
|
firstName: {
|
||||||
name: 'vendor.field.first_name',
|
name: 'vendor.field.first_name',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
lastName: {
|
lastName: {
|
||||||
name: 'vendor.field.last_name',
|
name: 'vendor.field.last_name',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
displayName: {
|
displayName: {
|
||||||
name: 'vendor.field.display_name',
|
name: 'vendor.field.display_name',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
email: {
|
email: {
|
||||||
name: 'vendor.field.email',
|
name: 'vendor.field.email',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
workPhone: {
|
workPhone: {
|
||||||
name: 'vendor.field.work_phone',
|
name: 'vendor.field.work_phone',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
personalPhone: {
|
personalPhone: {
|
||||||
name: 'vendor.field.personal_pone',
|
name: 'vendor.field.personal_pone',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
companyName: {
|
companyName: {
|
||||||
name: 'vendor.field.company_name',
|
name: 'vendor.field.company_name',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
website: {
|
website: {
|
||||||
name: 'vendor.field.website',
|
name: 'vendor.field.website',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
createdAt: {
|
createdAt: {
|
||||||
name: 'vendor.field.created_at',
|
name: 'vendor.field.created_at',
|
||||||
type: 'date',
|
type: 'date',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
balance: {
|
balance: {
|
||||||
name: 'vendor.field.balance',
|
name: 'vendor.field.balance',
|
||||||
type: 'number',
|
type: 'number',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
openingBalance: {
|
openingBalance: {
|
||||||
name: 'vendor.field.opening_balance',
|
name: 'vendor.field.opening_balance',
|
||||||
type: 'number',
|
type: 'number',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
openingBalanceAt: {
|
openingBalanceAt: {
|
||||||
name: 'vendor.field.opening_balance_at',
|
name: 'vendor.field.opening_balance_at',
|
||||||
type: 'date',
|
type: 'date',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
currencyCode: {
|
currencyCode: {
|
||||||
name: 'vendor.field.currency',
|
name: 'vendor.field.currency',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
status: {
|
status: {
|
||||||
name: 'vendor.field.status',
|
name: 'vendor.field.status',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
// Billing Address
|
// Billing Address
|
||||||
billingAddress1: {
|
billingAddress1: {
|
||||||
name: 'Billing Address 1',
|
name: 'Billing Address 1',
|
||||||
column: 'billing_address1',
|
column: 'billing_address1',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
billingAddress2: {
|
billingAddress2: {
|
||||||
name: 'Billing Address 2',
|
name: 'Billing Address 2',
|
||||||
column: 'billing_address2',
|
column: 'billing_address2',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
billingAddressCity: {
|
billingAddressCity: {
|
||||||
name: 'Billing Address City',
|
name: 'Billing Address City',
|
||||||
column: 'billing_address_city',
|
column: 'billing_address_city',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
billingAddressCountry: {
|
billingAddressCountry: {
|
||||||
name: 'Billing Address Country',
|
name: 'Billing Address Country',
|
||||||
column: 'billing_address_country',
|
column: 'billing_address_country',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
billingAddressPostcode: {
|
billingAddressPostcode: {
|
||||||
name: 'Billing Address Postcode',
|
name: 'Billing Address Postcode',
|
||||||
column: 'billing_address_postcode',
|
column: 'billing_address_postcode',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
billingAddressState: {
|
billingAddressState: {
|
||||||
name: 'Billing Address State',
|
name: 'Billing Address State',
|
||||||
column: 'billing_address_state',
|
column: 'billing_address_state',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
billingAddressPhone: {
|
billingAddressPhone: {
|
||||||
name: 'Billing Address Phone',
|
name: 'Billing Address Phone',
|
||||||
column: 'billing_address_phone',
|
column: 'billing_address_phone',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
// Shipping Address
|
// Shipping Address
|
||||||
shippingAddress1: {
|
shippingAddress1: {
|
||||||
name: 'Shipping Address 1',
|
name: 'Shipping Address 1',
|
||||||
column: 'shipping_address1',
|
column: 'shipping_address1',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
shippingAddress2: {
|
shippingAddress2: {
|
||||||
name: 'Shipping Address 2',
|
name: 'Shipping Address 2',
|
||||||
column: 'shipping_address2',
|
column: 'shipping_address2',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
shippingAddressCity: {
|
shippingAddressCity: {
|
||||||
name: 'Shipping Address City',
|
name: 'Shipping Address City',
|
||||||
column: 'shipping_address_city',
|
column: 'shipping_address_city',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
shippingAddressCountry: {
|
shippingAddressCountry: {
|
||||||
name: 'Shipping Address Country',
|
name: 'Shipping Address Country',
|
||||||
column: 'shipping_address_country',
|
column: 'shipping_address_country',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
shippingAddressPostcode: {
|
shippingAddressPostcode: {
|
||||||
name: 'Shipping Address Postcode',
|
name: 'Shipping Address Postcode',
|
||||||
column: 'shipping_address_postcode',
|
column: 'shipping_address_postcode',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
shippingAddressState: {
|
shippingAddressState: {
|
||||||
name: 'Shipping Address State',
|
name: 'Shipping Address State',
|
||||||
column: 'shipping_address_state',
|
column: 'shipping_address_state',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
},
|
},
|
||||||
shippingAddressPhone: {
|
shippingAddressPhone: {
|
||||||
name: 'Shipping Address Phone',
|
name: 'Shipping Address Phone',
|
||||||
column: 'shipping_address_phone',
|
column: 'shipping_address_phone',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
exportable: true,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
fields2: {
|
fields2: {
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ export default {
|
|||||||
sortOrder: 'DESC',
|
sortOrder: 'DESC',
|
||||||
sortField: 'name',
|
sortField: 'name',
|
||||||
},
|
},
|
||||||
|
exportable: true,
|
||||||
importable: true,
|
importable: true,
|
||||||
importAggregator: 'group',
|
importAggregator: 'group',
|
||||||
importAggregateOn: 'entries',
|
importAggregateOn: 'entries',
|
||||||
@@ -76,6 +77,37 @@ export default {
|
|||||||
fieldType: 'date',
|
fieldType: 'date',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
columns: {
|
||||||
|
vendorId: {
|
||||||
|
name: 'Vendor',
|
||||||
|
type: 'relation',
|
||||||
|
accessor: 'vendor.displayName',
|
||||||
|
},
|
||||||
|
exchangeRate: {
|
||||||
|
name: 'Echange Rate',
|
||||||
|
type: 'text',
|
||||||
|
},
|
||||||
|
vendorCreditNumber: {
|
||||||
|
name: 'Vendor Credit No.',
|
||||||
|
type: 'text',
|
||||||
|
},
|
||||||
|
referenceNo: {
|
||||||
|
name: 'Refernece No.',
|
||||||
|
type: 'text',
|
||||||
|
},
|
||||||
|
vendorCreditDate: {
|
||||||
|
name: 'Vendor Credit Date',
|
||||||
|
type: 'date',
|
||||||
|
},
|
||||||
|
note: {
|
||||||
|
name: 'Note',
|
||||||
|
type: 'text',
|
||||||
|
},
|
||||||
|
open: {
|
||||||
|
name: 'Open',
|
||||||
|
type: 'boolean',
|
||||||
|
},
|
||||||
|
},
|
||||||
fields2: {
|
fields2: {
|
||||||
vendorId: {
|
vendorId: {
|
||||||
name: 'Vendor',
|
name: 'Vendor',
|
||||||
@@ -122,7 +154,7 @@ export default {
|
|||||||
relationModel: 'Item',
|
relationModel: 'Item',
|
||||||
relationImportMatch: ['name', 'code'],
|
relationImportMatch: ['name', 'code'],
|
||||||
required: true,
|
required: true,
|
||||||
importHint: "Matches the item name or code."
|
importHint: 'Matches the item name or code.',
|
||||||
},
|
},
|
||||||
rate: {
|
rate: {
|
||||||
name: 'Rate',
|
name: 'Rate',
|
||||||
|
|||||||
@@ -16,7 +16,11 @@ export class CreditNotesExportable extends Exportable {
|
|||||||
*/
|
*/
|
||||||
public exportable(tenantId: number, query: ICreditNotesQueryDTO) {
|
public exportable(tenantId: number, query: ICreditNotesQueryDTO) {
|
||||||
const parsedQuery = {
|
const parsedQuery = {
|
||||||
|
sortOrder: 'desc',
|
||||||
|
columnSortBy: 'created_at',
|
||||||
...query,
|
...query,
|
||||||
|
page: 1,
|
||||||
|
pageSize: 12000,
|
||||||
} as ICreditNotesQueryDTO;
|
} as ICreditNotesQueryDTO;
|
||||||
|
|
||||||
return this.getCreditNotes
|
return this.getCreditNotes
|
||||||
|
|||||||
@@ -15,7 +15,11 @@ export class ExpensesExportable extends Exportable {
|
|||||||
*/
|
*/
|
||||||
public exportable(tenantId: number, query: IExpensesFilter) {
|
public exportable(tenantId: number, query: IExpensesFilter) {
|
||||||
const parsedQuery = {
|
const parsedQuery = {
|
||||||
|
sortOrder: 'desc',
|
||||||
|
columnSortBy: 'created_at',
|
||||||
...query,
|
...query,
|
||||||
|
page: 1,
|
||||||
|
pageSize: 12000,
|
||||||
} as IExpensesFilter;
|
} as IExpensesFilter;
|
||||||
|
|
||||||
return this.expensesApplication
|
return this.expensesApplication
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import { BillPaymentExportable } from '../Purchases/BillPayments/BillPaymentExpo
|
|||||||
import { ManualJournalsExportable } from '../ManualJournals/ManualJournalExportable';
|
import { ManualJournalsExportable } from '../ManualJournals/ManualJournalExportable';
|
||||||
import { CreditNotesExportable } from '../CreditNotes/CreditNotesExportable';
|
import { CreditNotesExportable } from '../CreditNotes/CreditNotesExportable';
|
||||||
import { VendorCreditsExportable } from '../Purchases/VendorCredits/VendorCreditsExportable';
|
import { VendorCreditsExportable } from '../Purchases/VendorCredits/VendorCreditsExportable';
|
||||||
|
import { ItemCategoriesExportable } from '../ItemCategories/ItemCategoriesExportable';
|
||||||
|
|
||||||
@Service()
|
@Service()
|
||||||
export class ExportableResources {
|
export class ExportableResources {
|
||||||
@@ -32,6 +33,7 @@ export class ExportableResources {
|
|||||||
private importables = [
|
private importables = [
|
||||||
{ resource: 'Account', exportable: AccountsExportable },
|
{ resource: 'Account', exportable: AccountsExportable },
|
||||||
{ resource: 'Item', exportable: ItemsExportable },
|
{ resource: 'Item', exportable: ItemsExportable },
|
||||||
|
{ resource: 'ItemCategory', exportable: ItemCategoriesExportable },
|
||||||
{ resource: 'Customer', exportable: CustomersExportable },
|
{ resource: 'Customer', exportable: CustomersExportable },
|
||||||
{ resource: 'Vendor', exportable: VendorsExportable },
|
{ resource: 'Vendor', exportable: VendorsExportable },
|
||||||
{ resource: 'Expense', exportable: ExpensesExportable },
|
{ resource: 'Expense', exportable: ExpensesExportable },
|
||||||
@@ -43,7 +45,7 @@ export class ExportableResources {
|
|||||||
{ resource: 'BillPayment', exportable: BillPaymentExportable },
|
{ resource: 'BillPayment', exportable: BillPaymentExportable },
|
||||||
{ resource: 'ManualJournal', exportable: ManualJournalsExportable },
|
{ resource: 'ManualJournal', exportable: ManualJournalsExportable },
|
||||||
{ resource: 'CreditNote', exportable: CreditNotesExportable },
|
{ resource: 'CreditNote', exportable: CreditNotesExportable },
|
||||||
{ resource: 'VendorCredit', exportable: VendorCreditsExportable }
|
{ resource: 'VendorCredit', exportable: VendorCreditsExportable },
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import ResourceService from '../Resource/ResourceService';
|
|||||||
import { ExportableResources } from './ExportResources';
|
import { ExportableResources } from './ExportResources';
|
||||||
import { ServiceError } from '@/exceptions';
|
import { ServiceError } from '@/exceptions';
|
||||||
import { Errors } from './common';
|
import { Errors } from './common';
|
||||||
|
import { IModelMeta } from '@/interfaces';
|
||||||
|
|
||||||
@Service()
|
@Service()
|
||||||
export class ExportResourceService {
|
export class ExportResourceService {
|
||||||
@@ -22,40 +23,94 @@ export class ExportResourceService {
|
|||||||
*/
|
*/
|
||||||
async export(tenantId: number, resourceName: string, format: string = 'csv') {
|
async export(tenantId: number, resourceName: string, format: string = 'csv') {
|
||||||
const resource = sanitizeResourceName(resourceName);
|
const resource = sanitizeResourceName(resourceName);
|
||||||
const resourceMeta = this.resourceService.getResourceMeta(
|
const resourceMeta = this.getResourceMeta(tenantId, resource);
|
||||||
tenantId,
|
|
||||||
resource
|
|
||||||
);
|
|
||||||
const exportable =
|
|
||||||
this.exportableResources.registry.getExportable(resource);
|
|
||||||
|
|
||||||
if (!resourceMeta.exportable) {
|
this.validateResourceMeta(resourceMeta);
|
||||||
|
|
||||||
|
const data = await this.getExportableData(tenantId, resource);
|
||||||
|
const exportableColumns = this.getExportableColumns(resourceMeta);
|
||||||
|
|
||||||
|
const workbook = this.createWorkbook(data, exportableColumns);
|
||||||
|
|
||||||
|
return this.exportWorkbook(workbook, format);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves metadata for a specific resource.
|
||||||
|
* @param {number} tenantId - The tenant identifier.
|
||||||
|
* @param {string} resource - The name of the resource.
|
||||||
|
* @returns The metadata of the resource.
|
||||||
|
*/
|
||||||
|
private getResourceMeta(tenantId: number, resource: string) {
|
||||||
|
return this.resourceService.getResourceMeta(tenantId, resource);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validates if the resource metadata is exportable.
|
||||||
|
* @param {any} resourceMeta - The metadata of the resource.
|
||||||
|
* @throws {ServiceError} If the resource is not exportable or lacks columns.
|
||||||
|
*/
|
||||||
|
private validateResourceMeta(resourceMeta: any) {
|
||||||
|
if (!resourceMeta.exportable || !resourceMeta.columns) {
|
||||||
throw new ServiceError(Errors.RESOURCE_NOT_EXPORTABLE);
|
throw new ServiceError(Errors.RESOURCE_NOT_EXPORTABLE);
|
||||||
}
|
}
|
||||||
const data = await exportable.exportable(tenantId, {});
|
}
|
||||||
|
|
||||||
const exportableColumns = Object.entries(resourceMeta.columns)
|
/**
|
||||||
.filter(([_, value]) => value.exportable)
|
* Fetches exportable data for a given resource.
|
||||||
|
* @param {number} tenantId - The tenant identifier.
|
||||||
|
* @param {string} resource - The name of the resource.
|
||||||
|
* @returns A promise that resolves to the exportable data.
|
||||||
|
*/
|
||||||
|
private async getExportableData(tenantId: number, resource: string) {
|
||||||
|
const exportable =
|
||||||
|
this.exportableResources.registry.getExportable(resource);
|
||||||
|
return exportable.exportable(tenantId, {});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extracts columns that are marked as exportable from the resource metadata.
|
||||||
|
* @param {IModelMeta} resourceMeta - The metadata of the resource.
|
||||||
|
* @returns An array of exportable columns.
|
||||||
|
*/
|
||||||
|
private getExportableColumns(resourceMeta: IModelMeta) {
|
||||||
|
return Object.entries(resourceMeta.columns)
|
||||||
|
.filter(([_, value]) => value.exportable !== false)
|
||||||
.map(([key, value]) => ({
|
.map(([key, value]) => ({
|
||||||
name: value.name,
|
name: value.name,
|
||||||
type: value.type,
|
type: value.type,
|
||||||
accessor: value.accessor || key,
|
accessor: value.accessor || key,
|
||||||
}));
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a workbook from the provided data and columns.
|
||||||
|
* @param {any[]} data - The data to be included in the workbook.
|
||||||
|
* @param {any[]} exportableColumns - The columns to be included in the workbook.
|
||||||
|
* @returns The created workbook.
|
||||||
|
*/
|
||||||
|
private createWorkbook(data: any[], exportableColumns: any[]) {
|
||||||
const workbook = xlsx.utils.book_new();
|
const workbook = xlsx.utils.book_new();
|
||||||
const worksheetData = data.map((item) =>
|
const worksheetData = data.map((item) =>
|
||||||
exportableColumns.map((col) => item[col.accessor])
|
exportableColumns.map((col) => item[col.accessor])
|
||||||
);
|
);
|
||||||
worksheetData.unshift(exportableColumns.map((col) => col.name)); // Add header row
|
worksheetData.unshift(exportableColumns.map((col) => col.name));
|
||||||
|
|
||||||
const worksheet = xlsx.utils.aoa_to_sheet(worksheetData);
|
const worksheet = xlsx.utils.aoa_to_sheet(worksheetData);
|
||||||
xlsx.utils.book_append_sheet(workbook, worksheet, 'Exported Data');
|
xlsx.utils.book_append_sheet(workbook, worksheet, 'Exported Data');
|
||||||
|
return workbook;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Exports the workbook in the specified format.
|
||||||
|
* @param {any} workbook - The workbook to be exported.
|
||||||
|
* @param {string} format - The format to export the workbook in.
|
||||||
|
* @returns The exported workbook data.
|
||||||
|
*/
|
||||||
|
private exportWorkbook(workbook: any, format: string) {
|
||||||
if (format.toLowerCase() === 'csv') {
|
if (format.toLowerCase() === 'csv') {
|
||||||
// Convert to CSV using the xlsx package
|
|
||||||
return xlsx.write(workbook, { type: 'buffer', bookType: 'csv' });
|
return xlsx.write(workbook, { type: 'buffer', bookType: 'csv' });
|
||||||
} else if (format.toLowerCase() === 'xlsx') {
|
} else if (format.toLowerCase() === 'xlsx') {
|
||||||
// Write to XLSX format
|
|
||||||
return xlsx.write(workbook, { type: 'buffer', bookType: 'xlsx' });
|
return xlsx.write(workbook, { type: 'buffer', bookType: 'xlsx' });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ export class GetManualJournals {
|
|||||||
tenantId: number,
|
tenantId: number,
|
||||||
filterDTO: IManualJournalsFilter
|
filterDTO: IManualJournalsFilter
|
||||||
): Promise<{
|
): Promise<{
|
||||||
manualJournals: IManualJournal;
|
manualJournals: IManualJournal[];
|
||||||
pagination: IPaginationMeta;
|
pagination: IPaginationMeta;
|
||||||
filterMeta: IFilterMeta;
|
filterMeta: IFilterMeta;
|
||||||
}> => {
|
}> => {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ export class ManualJournalsExportable extends Exportable {
|
|||||||
private manualJournalsApplication: ManualJournalsApplication;
|
private manualJournalsApplication: ManualJournalsApplication;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the accounts data to exportable sheet.
|
* Retrieves the manual journals data to exportable sheet.
|
||||||
* @param {number} tenantId
|
* @param {number} tenantId
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -14,7 +14,11 @@ export class BillPaymentExportable extends Exportable {
|
|||||||
*/
|
*/
|
||||||
public exportable(tenantId: number, query: any) {
|
public exportable(tenantId: number, query: any) {
|
||||||
const parsedQuery = {
|
const parsedQuery = {
|
||||||
|
page: 1,
|
||||||
|
pageSize: 12,
|
||||||
...query,
|
...query,
|
||||||
|
sortOrder: 'desc',
|
||||||
|
columnSortBy: 'created_at',
|
||||||
} as any;
|
} as any;
|
||||||
|
|
||||||
return this.billPaymentsApplication
|
return this.billPaymentsApplication
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ export class GetBillPayments {
|
|||||||
tenantId: number,
|
tenantId: number,
|
||||||
filterDTO: IBillPaymentsFilter
|
filterDTO: IBillPaymentsFilter
|
||||||
): Promise<{
|
): Promise<{
|
||||||
billPayments: IBillPayment;
|
billPayments: IBillPayment[];
|
||||||
pagination: IPaginationMeta;
|
pagination: IPaginationMeta;
|
||||||
filterMeta: IFilterMeta;
|
filterMeta: IFilterMeta;
|
||||||
}> {
|
}> {
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ export class BillsApplication {
|
|||||||
tenantId: number,
|
tenantId: number,
|
||||||
filterDTO: IBillsFilter
|
filterDTO: IBillsFilter
|
||||||
): Promise<{
|
): Promise<{
|
||||||
bills: IBill;
|
bills: IBill[];
|
||||||
pagination: IPaginationMeta;
|
pagination: IPaginationMeta;
|
||||||
filterMeta: IFilterMeta;
|
filterMeta: IFilterMeta;
|
||||||
}> {
|
}> {
|
||||||
|
|||||||
@@ -15,7 +15,11 @@ export class BillsExportable extends Exportable {
|
|||||||
*/
|
*/
|
||||||
public exportable(tenantId: number, query: IBillsFilter) {
|
public exportable(tenantId: number, query: IBillsFilter) {
|
||||||
const parsedQuery = {
|
const parsedQuery = {
|
||||||
|
sortOrder: 'desc',
|
||||||
|
columnSortBy: 'created_at',
|
||||||
...query,
|
...query,
|
||||||
|
page: 1,
|
||||||
|
pageSize: 12000,
|
||||||
} as IBillsFilter;
|
} as IBillsFilter;
|
||||||
|
|
||||||
return this.billsApplication
|
return this.billsApplication
|
||||||
|
|||||||
@@ -9,14 +9,18 @@ export class VendorCreditsExportable extends Exportable {
|
|||||||
private getVendorCredits: ListVendorCredits;
|
private getVendorCredits: ListVendorCredits;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the accounts data to exportable sheet.
|
* Retrieves the vendor credits data to exportable sheet.
|
||||||
* @param {number} tenantId -
|
* @param {number} tenantId -
|
||||||
* @param {IVendorCreditsQueryDTO} query -
|
* @param {IVendorCreditsQueryDTO} query -
|
||||||
* @returns {}
|
* @returns {}
|
||||||
*/
|
*/
|
||||||
public exportable(tenantId: number, query: IVendorCreditsQueryDTO) {
|
public exportable(tenantId: number, query: IVendorCreditsQueryDTO) {
|
||||||
const parsedQuery = {
|
const parsedQuery = {
|
||||||
|
sortOrder: 'desc',
|
||||||
|
columnSortBy: 'created_at',
|
||||||
...query,
|
...query,
|
||||||
|
page: 1,
|
||||||
|
pageSize: 12000,
|
||||||
} as IVendorCreditsQueryDTO;
|
} as IVendorCreditsQueryDTO;
|
||||||
|
|
||||||
return this.getVendorCredits
|
return this.getVendorCredits
|
||||||
|
|||||||
@@ -15,7 +15,11 @@ export class SaleEstimatesExportable extends Exportable {
|
|||||||
*/
|
*/
|
||||||
public exportable(tenantId: number, query: ISalesInvoicesFilter) {
|
public exportable(tenantId: number, query: ISalesInvoicesFilter) {
|
||||||
const parsedQuery = {
|
const parsedQuery = {
|
||||||
|
sortOrder: 'desc',
|
||||||
|
columnSortBy: 'created_at',
|
||||||
...query,
|
...query,
|
||||||
|
page: 1,
|
||||||
|
pageSize: 12000,
|
||||||
} as ISalesInvoicesFilter;
|
} as ISalesInvoicesFilter;
|
||||||
|
|
||||||
return this.saleEstimatesApplication
|
return this.saleEstimatesApplication
|
||||||
|
|||||||
@@ -15,7 +15,11 @@ export class SaleInvoicesExportable extends Exportable {
|
|||||||
*/
|
*/
|
||||||
public exportable(tenantId: number, query: ISalesInvoicesFilter) {
|
public exportable(tenantId: number, query: ISalesInvoicesFilter) {
|
||||||
const parsedQuery = {
|
const parsedQuery = {
|
||||||
|
sortOrder: 'desc',
|
||||||
|
columnSortBy: 'created_at',
|
||||||
...query,
|
...query,
|
||||||
|
page: 1,
|
||||||
|
pageSize: 120000,
|
||||||
} as ISalesInvoicesFilter;
|
} as ISalesInvoicesFilter;
|
||||||
|
|
||||||
return this.saleInvoicesApplication
|
return this.saleInvoicesApplication
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Inject, Service } from 'typedi';
|
import { Inject, Service } from 'typedi';
|
||||||
import { ISalesInvoicesFilter, ISalesReceiptsFilter } from '@/interfaces';
|
import { ISalesReceiptsFilter } from '@/interfaces';
|
||||||
import { Exportable } from '@/services/Export/Exportable';
|
import { Exportable } from '@/services/Export/Exportable';
|
||||||
import { SaleReceiptApplication } from './SaleReceiptApplication';
|
import { SaleReceiptApplication } from './SaleReceiptApplication';
|
||||||
|
|
||||||
@@ -15,8 +15,12 @@ export class SaleReceiptsExportable extends Exportable {
|
|||||||
*/
|
*/
|
||||||
public exportable(tenantId: number, query: ISalesReceiptsFilter) {
|
public exportable(tenantId: number, query: ISalesReceiptsFilter) {
|
||||||
const parsedQuery = {
|
const parsedQuery = {
|
||||||
|
sortOrder: 'desc',
|
||||||
|
columnSortBy: 'created_at',
|
||||||
...query,
|
...query,
|
||||||
} as ISalesInvoicesFilter;
|
page: 1,
|
||||||
|
pageSize: 12,
|
||||||
|
} as ISalesReceiptsFilter;
|
||||||
|
|
||||||
return this.saleReceiptsApp
|
return this.saleReceiptsApp
|
||||||
.getSaleReceipts(tenantId, parsedQuery)
|
.getSaleReceipts(tenantId, parsedQuery)
|
||||||
|
|||||||
Reference in New Issue
Block a user