diff --git a/packages/server/src/i18n/en/account.json b/packages/server/src/i18n/en/account.json index ccd7d0f00..6a20359b5 100644 --- a/packages/server/src/i18n/en/account.json +++ b/packages/server/src/i18n/en/account.json @@ -3,6 +3,7 @@ "field.description": "Description", "field.slug": "Account slug", "field.code": "Account code", + "field.code_hint": "Unique number to identify the account.", "field.root_type": "Root type", "field.normal": "Account normal", "field.normal.credit": "Credit", @@ -13,5 +14,6 @@ "field.balance": "Balance", "field.bank_balance": "Bank Balance", "field.parent_account": "Parent Account", - "field.created_at": "Created at" + "field.created_at": "Created at", + "field.account_hint": "Matches the account name or code." } diff --git a/packages/server/src/i18n/en/bill.json b/packages/server/src/i18n/en/bill.json new file mode 100644 index 000000000..ab3740a07 --- /dev/null +++ b/packages/server/src/i18n/en/bill.json @@ -0,0 +1,27 @@ +{ + "field.vendor": "Vendor", + "field.bill_number": "Bill No.", + "field.bill_date": "Date", + "field.due_date": "Due Date", + "field.reference_no": "Reference No.", + "field.exchange_rate": "Exchange Rate", + "field.note": "Note", + "field.open": "Open", + "field.entries": "Entries", + "field.item": "Item", + "field.item_hint": "Matches the item name or code.", + "field.rate": "Rate", + "field.quantity": "Quantity", + "field.description": "Line Description", + "field.amount": "Amount", + "field.payment_amount": "Payment Amount", + "field.status": "Status", + "field.status.paid": "Paid", + "field.status.partially-paid": "Partially Paid", + "field.status.overdue": "Overdue", + "field.status.unpaid": "Unpaid", + "field.status.opened": "Opened", + "field.status.draft": "Draft", + "field.created_at": "Created At" +} + diff --git a/packages/server/src/i18n/en/bill_payment.json b/packages/server/src/i18n/en/bill_payment.json new file mode 100644 index 000000000..5a45d3b0c --- /dev/null +++ b/packages/server/src/i18n/en/bill_payment.json @@ -0,0 +1,15 @@ +{ + "field.vendor": "Vendor", + "field.payment_date": "Payment Date", + "field.payment_number": "Payment No.", + "field.payment_account": "Payment Account", + "field.exchange_rate": "Exchange Rate", + "field.note": "Note", + "field.reference": "Reference", + "field.entries": "Entries", + "field.entries.bill": "Bill", + "field.entries.payment_amount": "Payment Amount", + "field.payment_number_hint": "The payment number should be unique.", + "field.bill_hint": "Matches the bill number." +} + diff --git a/packages/server/src/i18n/en/credit_note.json b/packages/server/src/i18n/en/credit_note.json new file mode 100644 index 000000000..f424384f8 --- /dev/null +++ b/packages/server/src/i18n/en/credit_note.json @@ -0,0 +1,16 @@ +{ + "field.customer": "Customer", + "field.exchange_rate": "Exchange Rate", + "field.credit_note_date": "Credit Note Date", + "field.reference_no": "Reference No.", + "field.note": "Note", + "field.terms_conditions": "Terms & Conditions", + "field.credit_note_number": "Credit Note Number", + "field.open": "Open", + "field.entries": "Entries", + "field.item": "Item", + "field.rate": "Rate", + "field.quantity": "Quantity", + "field.description": "Description" +} + diff --git a/packages/server/src/i18n/en/estimate.json b/packages/server/src/i18n/en/estimate.json new file mode 100644 index 000000000..bd93c2715 --- /dev/null +++ b/packages/server/src/i18n/en/estimate.json @@ -0,0 +1,21 @@ +{ + "field.customer": "Customer", + "field.estimate_date": "Estimate Date", + "field.expiration_date": "Expiration Date", + "field.estimate_number": "Estimate No.", + "field.reference_no": "Reference No.", + "field.exchange_rate": "Exchange Rate", + "field.currency": "Currency", + "field.note": "Note", + "field.terms_conditions": "Terms & Conditions", + "field.delivered": "Delivered", + "field.entries": "Entries", + "field.amount": "Amount", + "field.status": "Status", + "field.status.draft": "Draft", + "field.status.delivered": "Delivered", + "field.status.rejected": "Rejected", + "field.status.approved": "Approved", + "field.created_at": "Created At" +} + diff --git a/packages/server/src/i18n/en/invoice.json b/packages/server/src/i18n/en/invoice.json index 09b2a0f4a..5dde710a4 100644 --- a/packages/server/src/i18n/en/invoice.json +++ b/packages/server/src/i18n/en/invoice.json @@ -26,6 +26,7 @@ "field.due_amount": "Due amount", "field.delivered": "Delivered", "field.item_name": "Item Name", + "field.item_hint": "Matches the item name or code.", "field.rate": "Rate", "field.quantity": "Quantity", "field.description": "Description", @@ -38,5 +39,7 @@ "field.status.draft": "Draft", "field.created_at": "Created at", "field.currency": "Currency", - "field.entries": "Entries" + "field.entries": "Entries", + "field.branch": "Branch", + "field.warehouse": "Warehouse" } diff --git a/packages/server/src/i18n/en/item.json b/packages/server/src/i18n/en/item.json index d7ee3cba5..9bd0b1af4 100644 --- a/packages/server/src/i18n/en/item.json +++ b/packages/server/src/i18n/en/item.json @@ -17,6 +17,7 @@ "field.quantity_on_hand": "Quantity on Hand", "field.note": "Note", "field.category": "Category", + "field.category_hint": "Matches the category name.", "field.active": "Active", "field.created_at": "Created At" } diff --git a/packages/server/src/i18n/en/payment_receive.json b/packages/server/src/i18n/en/payment_receive.json new file mode 100644 index 000000000..2a77b1641 --- /dev/null +++ b/packages/server/src/i18n/en/payment_receive.json @@ -0,0 +1,17 @@ +{ + "field.customer": "Customer", + "field.payment_date": "Payment Date", + "field.amount": "Amount", + "field.reference_no": "Reference No.", + "field.deposit_account": "Deposit Account", + "field.payment_receive_no": "Payment No.", + "field.statement": "Statement", + "field.entries": "Entries", + "field.exchange_rate": "Exchange Rate", + "field.invoice": "Invoice", + "field.entries.payment_amount": "Payment Amount", + "field.created_at": "Created At", + "field.payment_no_hint": "The payment number should be unique.", + "field.invoice_hint": "Matches the invoice number." +} + diff --git a/packages/server/src/i18n/en/receipt.json b/packages/server/src/i18n/en/receipt.json index 3ad84d0b9..7c8239185 100644 --- a/packages/server/src/i18n/en/receipt.json +++ b/packages/server/src/i18n/en/receipt.json @@ -10,5 +10,21 @@ "paper.receipt_amount": "Receipt amount", "paper.total": "Total", "paper.balance_due": "Balance Due", - "paper.payment_amount": "Payment Amount" + "paper.payment_amount": "Payment Amount", + + "field.receipt_date": "Receipt Date", + "field.customer": "Customer", + "field.deposit_account": "Deposit Account", + "field.exchange_rate": "Exchange Rate", + "field.receipt_number": "Receipt Number", + "field.reference_no": "Reference No.", + "field.closed": "Closed", + "field.entries": "Entries", + "field.statement": "Statement", + "field.receipt_message": "Receipt Message", + "field.amount": "Amount", + "field.status": "Status", + "field.status.draft": "Draft", + "field.status.closed": "Closed", + "field.created_at": "Created At" } \ No newline at end of file diff --git a/packages/server/src/i18n/en/vendor_credit.json b/packages/server/src/i18n/en/vendor_credit.json index f0059f923..ea03c3b4b 100644 --- a/packages/server/src/i18n/en/vendor_credit.json +++ b/packages/server/src/i18n/en/vendor_credit.json @@ -2,5 +2,18 @@ "view.draft": "Draft", "view.published": "Published", "view.open": "Open", - "view.closed": "Closed" + "view.closed": "Closed", + + "field.vendor": "Vendor", + "field.vendor_credit_number": "Vendor Credit No.", + "field.vendor_credit_date": "Vendor Credit Date", + "field.reference_no": "Reference No.", + "field.exchange_rate": "Exchange Rate", + "field.note": "Note", + "field.open": "Open", + "field.entries": "Entries", + "field.item": "Item", + "field.rate": "Rate", + "field.quantity": "Quantity", + "field.description": "Description" } diff --git a/packages/server/src/modules/Accounts/models/Account.meta.ts b/packages/server/src/modules/Accounts/models/Account.meta.ts index 37314928c..5830414ee 100644 --- a/packages/server/src/modules/Accounts/models/Account.meta.ts +++ b/packages/server/src/modules/Accounts/models/Account.meta.ts @@ -156,7 +156,7 @@ export const AccountMeta = { minLength: 3, maxLength: 6, unique: true, - importHint: 'Unique number to identify the account.', + importHint: 'account.field.code_hint', }, accountType: { name: 'account.field.type', diff --git a/packages/server/src/modules/BillPayments/models/BillPayment.meta.ts b/packages/server/src/modules/BillPayments/models/BillPayment.meta.ts index cd218a044..b602c4a9c 100644 --- a/packages/server/src/modules/BillPayments/models/BillPayment.meta.ts +++ b/packages/server/src/modules/BillPayments/models/BillPayment.meta.ts @@ -167,7 +167,7 @@ export const BillPaymentMeta = { name: 'bill_payment.field.payment_number', fieldType: 'text', unique: true, - importHint: 'The payment number should be unique.', + importHint: 'bill_payment.field.payment_number_hint', }, paymentAccountId: { name: 'bill_payment.field.payment_account', @@ -175,7 +175,7 @@ export const BillPaymentMeta = { relationModel: 'Account', relationImportMatch: ['name', 'code'], required: true, - importHint: 'Matches the account name or code.', + importHint: 'account.field.account_hint', }, exchangeRate: { name: 'bill_payment.field.exchange_rate', @@ -203,7 +203,7 @@ export const BillPaymentMeta = { relationModel: 'Bill', relationImportMatch: 'billNumber', required: true, - importHint: 'Matches the bill number.', + importHint: 'bill_payment.field.bill_hint', }, paymentAmount: { name: 'bill_payment.field.entries.payment_amount', @@ -213,7 +213,7 @@ export const BillPaymentMeta = { }, }, branchId: { - name: 'Branch', + name: 'invoice.field.branch', fieldType: 'relation', relationModel: 'Branch', relationImportMatch: ['name', 'code'], diff --git a/packages/server/src/modules/Bills/models/Bill.meta.ts b/packages/server/src/modules/Bills/models/Bill.meta.ts index b5313dbd9..51d9bb613 100644 --- a/packages/server/src/modules/Bills/models/Bill.meta.ts +++ b/packages/server/src/modules/Bills/models/Bill.meta.ts @@ -184,76 +184,76 @@ export const BillMeta = { }, fields2: { billNumber: { - name: 'Bill No.', + name: 'bill.field.bill_number', fieldType: 'text', required: true, }, referenceNo: { - name: 'Reference No.', + name: 'bill.field.reference_no', fieldType: 'text', }, billDate: { - name: 'Date', + name: 'bill.field.bill_date', fieldType: 'date', required: true, }, dueDate: { - name: 'Due Date', + name: 'bill.field.due_date', fieldType: 'date', required: true, }, vendorId: { - name: 'Vendor', + name: 'bill.field.vendor', fieldType: 'relation', relationModel: 'Contact', relationImportMatch: 'displayName', required: true, }, exchangeRate: { - name: 'Exchange Rate', + name: 'bill.field.exchange_rate', fieldType: 'number', }, note: { - name: 'Note', + name: 'bill.field.note', fieldType: 'text', }, open: { - name: 'Open', + name: 'bill.field.open', fieldType: 'boolean', }, entries: { - name: 'Entries', + name: 'bill.field.entries', fieldType: 'collection', collectionOf: 'object', collectionMinLength: 1, required: true, fields: { itemId: { - name: 'Item', + name: 'bill.field.item', fieldType: 'relation', relationModel: 'Item', relationImportMatch: ['name', 'code'], required: true, - importHint: 'Matches the item name or code.', + importHint: 'bill.field.item_hint', }, rate: { - name: 'Rate', + name: 'bill.field.rate', fieldType: 'number', required: true, }, quantity: { - name: 'Quantity', + name: 'bill.field.quantity', fieldType: 'number', required: true, }, description: { - name: 'Line Description', + name: 'bill.field.description', fieldType: 'text', }, }, }, branchId: { - name: 'Branch', + name: 'invoice.field.branch', fieldType: 'relation', relationModel: 'Branch', relationImportMatch: ['name', 'code'], @@ -261,7 +261,7 @@ export const BillMeta = { required: true, }, warehouseId: { - name: 'Warehouse', + name: 'invoice.field.warehouse', fieldType: 'relation', relationModel: 'Warehouse', relationImportMatch: ['name', 'code'], diff --git a/packages/server/src/modules/CreditNotes/models/CreditNote.meta.ts b/packages/server/src/modules/CreditNotes/models/CreditNote.meta.ts index 305252b30..c11473407 100644 --- a/packages/server/src/modules/CreditNotes/models/CreditNote.meta.ts +++ b/packages/server/src/modules/CreditNotes/models/CreditNote.meta.ts @@ -164,73 +164,73 @@ export const CreditNoteMeta = { }, fields2: { customerId: { - name: 'Customer', + name: 'credit_note.field.customer', fieldType: 'relation', relationModel: 'Contact', relationImportMatch: 'displayName', required: true, }, exchangeRate: { - name: 'Exchange Rate', + name: 'credit_note.field.exchange_rate', fieldType: 'number', }, creditNoteDate: { - name: 'Credit Note Date', + name: 'credit_note.field.credit_note_date', fieldType: 'date', required: true, }, referenceNo: { - name: 'Reference No.', + name: 'credit_note.field.reference_no', fieldType: 'text', }, note: { - name: 'Note', + name: 'credit_note.field.note', fieldType: 'text', }, termsConditions: { - name: 'Terms & Conditions', + name: 'credit_note.field.terms_conditions', fieldType: 'text', }, creditNoteNumber: { - name: 'Credit Note Number', + name: 'credit_note.field.credit_note_number', fieldType: 'text', }, open: { - name: 'Open', + name: 'credit_note.field.open', fieldType: 'boolean', }, entries: { - name: 'Entries', + name: 'credit_note.field.entries', fieldType: 'collection', collectionOf: 'object', collectionMinLength: 1, fields: { itemId: { - name: 'Item', + name: 'credit_note.field.item', fieldType: 'relation', relationModel: 'Item', relationImportMatch: ['name', 'code'], required: true, - importHint: 'Matches the item name or code.', + importHint: 'invoice.field.item_hint', }, rate: { - name: 'Rate', + name: 'credit_note.field.rate', fieldType: 'number', required: true, }, quantity: { - name: 'Quantity', + name: 'credit_note.field.quantity', fieldType: 'number', required: true, }, description: { - name: 'Description', + name: 'credit_note.field.description', fieldType: 'text', }, }, }, branchId: { - name: 'Branch', + name: 'invoice.field.branch', fieldType: 'relation', relationModel: 'Branch', relationImportMatch: ['name', 'code'], @@ -238,7 +238,7 @@ export const CreditNoteMeta = { required: true, }, warehouseId: { - name: 'Warehouse', + name: 'invoice.field.warehouse', fieldType: 'relation', relationModel: 'Warehouse', relationImportMatch: ['name', 'code'], diff --git a/packages/server/src/modules/Expenses/models/Expense.meta.ts b/packages/server/src/modules/Expenses/models/Expense.meta.ts index 1c065d008..bb09912a2 100644 --- a/packages/server/src/modules/Expenses/models/Expense.meta.ts +++ b/packages/server/src/modules/Expenses/models/Expense.meta.ts @@ -135,7 +135,7 @@ export const ExpenseMeta = { relationModel: 'Account', relationImportMatch: ['name', 'code'], required: true, - importHint: 'Matches the account name or code.', + importHint: 'account.field.account_hint', }, referenceNo: { name: 'expense.field.reference_no', @@ -169,7 +169,7 @@ export const ExpenseMeta = { relationModel: 'Account', relationImportMatch: ['name', 'code'], required: true, - importHint: 'Matches the account name or code.', + importHint: 'account.field.account_hint', }, amount: { name: 'expense.field.amount', @@ -187,7 +187,7 @@ export const ExpenseMeta = { fieldType: 'boolean', }, branchId: { - name: 'Branch', + name: 'invoice.field.branch', fieldType: 'relation', relationModel: 'Branch', relationImportMatch: ['name', 'code'], diff --git a/packages/server/src/modules/Import/ImportFileDataValidator.ts b/packages/server/src/modules/Import/ImportFileDataValidator.ts index 2df188acc..141398045 100644 --- a/packages/server/src/modules/Import/ImportFileDataValidator.ts +++ b/packages/server/src/modules/Import/ImportFileDataValidator.ts @@ -19,7 +19,8 @@ export class ImportFileDataValidator { /** * Validates the given mapped DTOs and returns errors with their index. - * @param {Record} mappedDTOs + * @param {ResourceMetaFieldsMap} importableFields - Already localized fields from ResourceService + * @param {Record} data * @returns {Promise} */ public async validateData( diff --git a/packages/server/src/modules/Import/ImportFileUpload.ts b/packages/server/src/modules/Import/ImportFileUpload.ts index 2ef5b6afb..6392ffd33 100644 --- a/packages/server/src/modules/Import/ImportFileUpload.ts +++ b/packages/server/src/modules/Import/ImportFileUpload.ts @@ -24,7 +24,7 @@ export class ImportFileUploadService { @Inject(ImportModel.name) private readonly importModel: typeof ImportModel, - ) {} + ) { } /** * Imports the specified file for the given resource. diff --git a/packages/server/src/modules/Items/models/Item.meta.ts b/packages/server/src/modules/Items/models/Item.meta.ts index e4021d8fb..0c2446972 100644 --- a/packages/server/src/modules/Items/models/Item.meta.ts +++ b/packages/server/src/modules/Items/models/Item.meta.ts @@ -267,28 +267,28 @@ export const ItemMeta = { fieldType: 'relation', relationModel: 'Account', relationImportMatch: ['name', 'code'], - importHint: 'Matches the account name or code.', + importHint: 'account.field.account_hint', }, sellAccountId: { name: 'item.field.sell_account', fieldType: 'relation', relationModel: 'Account', relationImportMatch: ['name', 'code'], - importHint: 'Matches the account name or code.', + importHint: 'account.field.account_hint', }, inventoryAccountId: { name: 'item.field.inventory_account', fieldType: 'relation', relationModel: 'Account', relationImportMatch: ['name', 'code'], - importHint: 'Matches the account name or code.', + importHint: 'account.field.account_hint', }, sellDescription: { - name: 'Sell Description', + name: 'item.field.sell_description', fieldType: 'text', }, purchaseDescription: { - name: 'Purchase Description', + name: 'item.field.purchase_description', fieldType: 'text', }, note: { @@ -300,7 +300,7 @@ export const ItemMeta = { fieldType: 'relation', relationModel: 'ItemCategory', relationImportMatch: ['name'], - importHint: 'Matches the category name.', + importHint: 'item.field.category_hint', }, active: { name: 'item.field.active', diff --git a/packages/server/src/modules/PaymentReceived/models/PaymentReceived.meta.ts b/packages/server/src/modules/PaymentReceived/models/PaymentReceived.meta.ts index 95e299121..bfa1d5c26 100644 --- a/packages/server/src/modules/PaymentReceived/models/PaymentReceived.meta.ts +++ b/packages/server/src/modules/PaymentReceived/models/PaymentReceived.meta.ts @@ -165,12 +165,12 @@ export const PaymentReceivedMeta = { relationModel: 'Account', relationImportMatch: ['name', 'code'], required: true, - importHint: 'Matches the account name or code.', + importHint: 'account.field.account_hint', }, paymentReceiveNo: { name: 'payment_receive.field.payment_receive_no', fieldType: 'text', - importHint: 'The payment number should be unique.', + importHint: 'payment_receive.field.payment_no_hint', }, statement: { name: 'payment_receive.field.statement', @@ -189,7 +189,7 @@ export const PaymentReceivedMeta = { relationModel: 'SaleInvoice', relationImportMatch: 'invoiceNo', required: true, - importHint: 'Matches the invoice number.', + importHint: 'payment_receive.field.invoice_hint', }, paymentAmount: { name: 'payment_receive.field.entries.payment_amount', @@ -199,7 +199,7 @@ export const PaymentReceivedMeta = { }, }, branchId: { - name: 'Branch', + name: 'invoice.field.branch', fieldType: 'relation', relationModel: 'Branch', relationImportMatch: ['name', 'code'], diff --git a/packages/server/src/modules/Resource/ResourceService.ts b/packages/server/src/modules/Resource/ResourceService.ts index f45474648..c888e2076 100644 --- a/packages/server/src/modules/Resource/ResourceService.ts +++ b/packages/server/src/modules/Resource/ResourceService.ts @@ -1,5 +1,6 @@ import { ModuleRef } from '@nestjs/core'; -import { pickBy } from 'lodash'; +import { pickBy, mapValues } from 'lodash'; +import { I18nService } from 'nestjs-i18n'; import { WarehousesSettings } from '../Warehouses/WarehousesSettings'; import { Injectable } from '@nestjs/common'; import { BranchesSettingsService } from '../Branches/BranchesSettings'; @@ -20,7 +21,8 @@ export class ResourceService { private readonly branchesSettings: BranchesSettingsService, private readonly warehousesSettings: WarehousesSettings, private readonly moduleRef: ModuleRef, - ) {} + private readonly i18nService: I18nService, + ) { } /** * Retrieve resource model object. @@ -96,7 +98,45 @@ export class ResourceService { }; /** - * Retrieve the resource fields. + * Localizes a single field by translating its name and importHint. + * @param {IModelMetaField2} field - The field to localize. + * @returns {IModelMetaField2} - The localized field. + */ + private localizeField(field: IModelMetaField2): IModelMetaField2 { + const localizedField = { + ...field, + name: this.i18nService.t(field.name, { defaultValue: field.name }), + } as IModelMetaField2; + + if (field.importHint) { + localizedField.importHint = this.i18nService.t(field.importHint, { + defaultValue: field.importHint, + }); + } + + // Recursively localize nested fields (for collection types) + if (field.fields) { + localizedField.fields = this.localizeFields( + field.fields as unknown as Record, + ) as unknown as typeof field.fields; + } + + return localizedField; + } + + /** + * Localizes all fields in a fields map. + * @param {Record} fields - The fields to localize. + * @returns {Record} - The localized fields. + */ + private localizeFields( + fields: Record, + ): Record { + return mapValues(fields, (field) => this.localizeField(field)); + } + + /** + * Retrieve the resource fields with localized names and hints. * @param {string} modelName * @returns {IModelMetaField2} */ @@ -104,8 +144,11 @@ export class ResourceService { [key: string]: IModelMetaField2; } { const meta = this.getResourceMeta(modelName); + const filteredFields = this.filterSupportFeatures(meta.fields2); - return this.filterSupportFeatures(meta.fields2); + return this.localizeFields( + filteredFields as Record, + ); } /** diff --git a/packages/server/src/modules/SaleEstimates/models/SaleEstimate.meta.ts b/packages/server/src/modules/SaleEstimates/models/SaleEstimate.meta.ts index af394f1a8..567a0be27 100644 --- a/packages/server/src/modules/SaleEstimates/models/SaleEstimate.meta.ts +++ b/packages/server/src/modules/SaleEstimates/models/SaleEstimate.meta.ts @@ -191,52 +191,52 @@ export const SaleEstimateMeta = { }, fields2: { customerId: { - name: 'Customer', + name: 'estimate.field.customer', fieldType: 'relation', relationModel: 'Contact', relationImportMatch: ['displayName'], required: true, }, estimateDate: { - name: 'Estimate Date', + name: 'estimate.field.estimate_date', fieldType: 'date', required: true, }, expirationDate: { - name: 'Expiration Date', + name: 'estimate.field.expiration_date', fieldType: 'date', required: true, }, estimateNumber: { - name: 'Estimate No.', + name: 'estimate.field.estimate_number', fieldType: 'text', }, reference: { - name: 'Reference No.', + name: 'estimate.field.reference_no', fieldType: 'text', }, exchangeRate: { - name: 'Exchange Rate', + name: 'estimate.field.exchange_rate', fieldType: 'number', }, currencyCode: { - name: 'Currency', + name: 'estimate.field.currency', fieldType: 'text', }, note: { - name: 'Note', + name: 'estimate.field.note', fieldType: 'text', }, termsConditions: { - name: 'Terms & Conditions', + name: 'estimate.field.terms_conditions', fieldType: 'text', }, delivered: { - name: 'Delivered', + name: 'estimate.field.delivered', type: 'boolean', }, entries: { - name: 'Entries', + name: 'estimate.field.entries', fieldType: 'collection', collectionOf: 'object', collectionMinLength: 1, @@ -248,7 +248,7 @@ export const SaleEstimateMeta = { relationModel: 'Item', relationImportMatch: ['name', 'code'], required: true, - importHint: 'Matches the item name or code.', + importHint: 'invoice.field.item_hint', }, rate: { name: 'invoice.field.rate', @@ -261,13 +261,13 @@ export const SaleEstimateMeta = { required: true, }, description: { - name: 'Line Description', + name: 'invoice.field.description', fieldType: 'text', }, }, }, branchId: { - name: 'Branch', + name: 'invoice.field.branch', fieldType: 'relation', relationModel: 'Branch', relationImportMatch: ['name', 'code'], @@ -275,7 +275,7 @@ export const SaleEstimateMeta = { required: true, }, warehouseId: { - name: 'Warehouse', + name: 'invoice.field.warehouse', fieldType: 'relation', relationModel: 'Warehouse', relationImportMatch: ['name', 'code'], diff --git a/packages/server/src/modules/SaleInvoices/models/SaleInvoice.meta.ts b/packages/server/src/modules/SaleInvoices/models/SaleInvoice.meta.ts index 8d48e5e21..48e6828ef 100644 --- a/packages/server/src/modules/SaleInvoices/models/SaleInvoice.meta.ts +++ b/packages/server/src/modules/SaleInvoices/models/SaleInvoice.meta.ts @@ -259,7 +259,7 @@ export const SaleInvoiceMeta = { relationModel: 'Item', relationImportMatch: ['name', 'code'], required: true, - importHint: 'Matches the item name or code.', + importHint: 'invoice.field.item_hint', }, rate: { name: 'invoice.field.rate', @@ -283,7 +283,7 @@ export const SaleInvoiceMeta = { printable: false, }, branchId: { - name: 'Branch', + name: 'invoice.field.branch', fieldType: 'relation', relationModel: 'Branch', relationImportMatch: ['name', 'code'], @@ -291,7 +291,7 @@ export const SaleInvoiceMeta = { required: true, }, warehouseId: { - name: 'Warehouse', + name: 'invoice.field.warehouse', fieldType: 'relation', relationModel: 'Warehouse', relationImportMatch: ['name', 'code'], diff --git a/packages/server/src/modules/SaleReceipts/models/SaleReceipt.meta.ts b/packages/server/src/modules/SaleReceipts/models/SaleReceipt.meta.ts index afb0798ff..547f52a15 100644 --- a/packages/server/src/modules/SaleReceipts/models/SaleReceipt.meta.ts +++ b/packages/server/src/modules/SaleReceipts/models/SaleReceipt.meta.ts @@ -186,42 +186,42 @@ export const SaleReceiptMeta = { }, fields2: { receiptDate: { - name: 'Receipt Date', + name: 'receipt.field.receipt_date', fieldType: 'date', required: true, }, customerId: { - name: 'Customer', + name: 'receipt.field.customer', fieldType: 'relation', relationModel: 'Contact', relationImportMatch: 'displayName', required: true, }, depositAccountId: { - name: 'Deposit Account', + name: 'receipt.field.deposit_account', fieldType: 'relation', relationModel: 'Account', relationImportMatch: ['name', 'code'], required: true, }, exchangeRate: { - name: 'Exchange Rate', + name: 'receipt.field.exchange_rate', fieldType: 'number', }, receiptNumber: { - name: 'Receipt Number', + name: 'receipt.field.receipt_number', fieldType: 'text', }, referenceNo: { - name: 'Reference No.', + name: 'receipt.field.reference_no', fieldType: 'text', }, closed: { - name: 'Closed', + name: 'receipt.field.closed', fieldType: 'boolean', }, entries: { - name: 'Entries', + name: 'receipt.field.entries', fieldType: 'collection', collectionOf: 'object', collectionMinLength: 1, @@ -233,7 +233,7 @@ export const SaleReceiptMeta = { relationModel: 'Item', relationImportMatch: ['name', 'code'], required: true, - importHint: 'Matches the item name or code.', + importHint: 'invoice.field.item_hint', }, rate: { name: 'invoice.field.rate', @@ -252,15 +252,15 @@ export const SaleReceiptMeta = { }, }, statement: { - name: 'Statement', + name: 'receipt.field.statement', fieldType: 'text', }, receiptMessage: { - name: 'Receipt Message', + name: 'receipt.field.receipt_message', fieldType: 'text', }, branchId: { - name: 'Branch', + name: 'invoice.field.branch', fieldType: 'relation', relationModel: 'Branch', relationImportMatch: ['name', 'code'], @@ -268,7 +268,7 @@ export const SaleReceiptMeta = { required: true, }, warehouseId: { - name: 'Warehouse', + name: 'invoice.field.warehouse', fieldType: 'relation', relationModel: 'Warehouse', relationImportMatch: ['name', 'code'], diff --git a/packages/server/src/modules/VendorCredit/models/VendorCredit.meta.ts b/packages/server/src/modules/VendorCredit/models/VendorCredit.meta.ts index e3321d57a..6410e6f78 100644 --- a/packages/server/src/modules/VendorCredit/models/VendorCredit.meta.ts +++ b/packages/server/src/modules/VendorCredit/models/VendorCredit.meta.ts @@ -177,70 +177,70 @@ export const VendorCreditMeta = { }, fields2: { vendorId: { - name: 'Vendor', + name: 'vendor_credit.field.vendor', fieldType: 'relation', relationModel: 'Contact', relationImportMatch: 'displayName', required: true, }, exchangeRate: { - name: 'Echange Rate', + name: 'vendor_credit.field.exchange_rate', fieldType: 'text', }, vendorCreditNumber: { - name: 'Vendor Credit No.', + name: 'vendor_credit.field.vendor_credit_number', fieldType: 'text', }, referenceNo: { - name: 'Refernece No.', + name: 'vendor_credit.field.reference_no', fieldType: 'text', }, vendorCreditDate: { - name: 'Vendor Credit Date', + name: 'vendor_credit.field.vendor_credit_date', fieldType: 'date', required: true, }, note: { - name: 'Note', + name: 'vendor_credit.field.note', fieldType: 'text', }, open: { - name: 'Open', + name: 'vendor_credit.field.open', fieldType: 'boolean', }, entries: { - name: 'Entries', + name: 'vendor_credit.field.entries', fieldType: 'collection', collectionOf: 'object', collectionMinLength: 1, required: true, fields: { itemId: { - name: 'Item Name', + name: 'vendor_credit.field.item', fieldType: 'relation', relationModel: 'Item', relationImportMatch: ['name', 'code'], required: true, - importHint: 'Matches the item name or code.', + importHint: 'invoice.field.item_hint', }, rate: { - name: 'Rate', + name: 'vendor_credit.field.rate', fieldType: 'number', required: true, }, quantity: { - name: 'Quantity', + name: 'vendor_credit.field.quantity', fieldType: 'number', required: true, }, description: { - name: 'Description', + name: 'vendor_credit.field.description', fieldType: 'text', }, }, }, branchId: { - name: 'Branch', + name: 'invoice.field.branch', fieldType: 'relation', relationModel: 'Branch', relationImportMatch: ['name', 'code'], @@ -248,7 +248,7 @@ export const VendorCreditMeta = { required: true }, warehouseId: { - name: 'Warehouse', + name: 'invoice.field.warehouse', fieldType: 'relation', relationModel: 'Warehouse', relationImportMatch: ['name', 'code'], diff --git a/packages/webapp/src/containers/Import/ImportFileMapping.module.scss b/packages/webapp/src/containers/Import/ImportFileMapping.module.scss index 156da57fb..125fb8e20 100644 --- a/packages/webapp/src/containers/Import/ImportFileMapping.module.scss +++ b/packages/webapp/src/containers/Import/ImportFileMapping.module.scss @@ -7,6 +7,10 @@ color: #738091; font-weight: 700; padding: 0 11px; + + :global(.bp4-dark) &{ + color: var(--color-light-gray1); + } } .table { @@ -24,6 +28,11 @@ padding-bottom: 8px; color: #738091; font-weight: 500; + + :global(.bp4-dark) &{ + color: var(--color-light-gray1); + border-top: 1px solid rgba(255, 255, 255, 0.2); + } } } diff --git a/packages/webapp/src/containers/Import/ImportFilePreview.module.scss b/packages/webapp/src/containers/Import/ImportFilePreview.module.scss index c62e7e738..62c34af4c 100644 --- a/packages/webapp/src/containers/Import/ImportFilePreview.module.scss +++ b/packages/webapp/src/containers/Import/ImportFilePreview.module.scss @@ -7,6 +7,9 @@ border-top: 1px solid #d9d9da; padding: 6px 0; + :global(.bp4-dark) &{ + border-top-color: rgba(255, 255, 255, 0.1); + } &:last-child{ padding-bottom: 0; } @@ -31,6 +34,10 @@ table.skippedTable { tr:hover td{ background: #F6F7F9; + + :global(.bp4-dark) &{ + background: var(--color-dark-gray2); + } } } } \ No newline at end of file