feat: add sample import sheet to invoices

This commit is contained in:
Ahmed Bouhuolia
2024-04-07 15:26:23 +02:00
parent bbafdcd8bd
commit 086b060351
8 changed files with 81 additions and 21 deletions

View File

@@ -309,14 +309,18 @@
"estimate.field.status.approved": "Approved",
"estimate.field.status.draft": "Draft",
"estimate.field.created_at": "Created at",
"payment_receive.field.customer": "Customer",
"payment_receive.field.payment_date": "Payment date",
"payment_receive.field.amount": "Amount",
"payment_receive.field.reference_no": "Reference No.",
"payment_receive.field.deposit_account": "Deposit account",
"payment_receive.field.payment_receive_no": "Payment receive No.",
"payment_receive.field.statement": "Statement",
"payment_receive.field.created_at": "Created at",
"payment_receive.field.customer": "Customer",
"payment_receive.field.exchange_rate": "Exchange Rate",
"payment_receive.field.payment_date": "Payment Date",
"payment_receive.field.reference_no": "Reference No.",
"payment_receive.field.deposit_account": "Deposit Account",
"payment_receive.field.entries": "Entries",
"payment_receive.field.invoice": "Invoice",
"payment_receive.field.entries.payment_amount": "Payment Amount",
"bill_payment.field.vendor": "Vendor",
"bill_payment.field.amount": "Amount",
"bill_payment.field.due_amount": "Due Amount",

View File

@@ -57,9 +57,9 @@ export default {
fieldDate: 'date',
},
},
field2: {
fields2: {
customerId: {
name: 'payment_receive.field.customer_id',
name: 'payment_receive.field.customer',
fieldType: 'relation',
relationModel: 'Contact',
relationImportMatch: ['displayName'],
@@ -79,7 +79,7 @@ export default {
fieldType: 'text',
},
depositAccountId: {
name: 'payment_receive.field.deposit_account_id',
name: 'payment_receive.field.deposit_account',
fieldType: 'relation',
relationModel: 'Account',
relationImportMatch: ['name', 'code'],

View File

@@ -3,6 +3,7 @@ import { Knex } from 'knex';
import { ISaleInvoiceCreateDTO } from '@/interfaces';
import { CreateSaleInvoice } from './CreateSaleInvoice';
import { Importable } from '@/services/Import/Importable';
import { SaleInvoicesSampleData } from './constants';
@Service()
export class SaleInvoicesImportable extends Importable {
@@ -40,6 +41,6 @@ export class SaleInvoicesImportable extends Importable {
* Retrieves the sample data that used to download accounts sample sheet.
*/
public sampleData(): any[] {
return [];
return SaleInvoicesSampleData;
}
}

View File

@@ -109,3 +109,52 @@ export const DEFAULT_VIEWS = [
columns: DEFAULT_VIEW_COLUMNS,
},
];
export const SaleInvoicesSampleData = [
{
'Invoice No.': 'B-101',
'Reference No.': 'REF0',
'Invoice Date': '2024-01-01',
'Due Date': '2024-03-01',
Customer: 'Harley Veum',
'Exchange Rate': 1,
'Invoice Message': 'Aspernatur doloremque amet quia aut.',
'Terms & Conditions': 'Quia illum aut dolores.',
Delivered: 'T',
Item: 'VonRueden, Ruecker and Hettinger',
Quantity: 100,
Rate: 100,
Description: 'Description',
},
{
'Invoice No.': 'B-102',
'Reference No.': 'REF0',
'Invoice Date': '2024-01-01',
'Due Date': '2024-03-01',
Customer: 'Harley Veum',
'Exchange Rate': 1,
'Invoice Message': 'Est omnis enim vel.',
'Terms & Conditions': 'Iusto et sint nobis sit.',
Delivered: 'T',
Item: 'Thompson - Reichert',
Quantity: 200,
Rate: 50,
Description: 'Description',
},
{
'Invoice No.': 'B-103',
'Reference No.': 'REF0',
'Invoice Date': '2024-01-01',
'Due Date': '2024-03-01',
Customer: 'Harley Veum',
'Exchange Rate': 1,
'Invoice Message':
'Repudiandae voluptatibus repellat minima voluptatem rerum veniam.',
'Terms & Conditions': 'Id quod inventore ex rerum velit sed.',
Delivered: 'T',
Item: 'VonRueden, Ruecker and Hettinger',
Quantity: 100,
Rate: 100,
Description: 'Description',
},
];

View File

@@ -3,6 +3,7 @@ import { Knex } from 'knex';
import { IPaymentReceiveCreateDTO } from '@/interfaces';
import { Importable } from '@/services/Import/Importable';
import { CreatePaymentReceive } from './CreatePaymentReceive';
import { PaymentsReceiveSampleData } from './constants';
@Service()
export class PaymentReceivesImportable extends Importable {
@@ -40,6 +41,6 @@ export class PaymentReceivesImportable extends Importable {
* Retrieves the sample data that used to download accounts sample sheet.
*/
public sampleData(): any[] {
return [];
return PaymentsReceiveSampleData;
}
}

View File

@@ -31,3 +31,17 @@ export const ERRORS = {
};
export const DEFAULT_VIEWS = [];
export const PaymentsReceiveSampleData = [
{
Customer: 'Randall Kohler',
'Payment Date': '2024-10-10',
'Payment Receive No.': 'PAY-0001',
'Reference No.': 'REF-0001',
'Deposit Account': 'Petty Cash',
'Exchange Rate': '',
Statement: 'Totam optio quisquam qui.',
Invoice: 'INV-00001',
'Payment Amount': 850,
},
];

View File

@@ -7,10 +7,10 @@ export default function PaymentsReceiveImport() {
const history = useHistory();
const handleCancelBtnClick = () => {
history.push('/');
history.push('/payment-receives');
};
const handleImportSuccess = () => {
history.push('/accounts');
history.push('/payment-receives');
};
return (

View File

@@ -58,7 +58,6 @@ export const getDashboardRoutes = () => [
),
breadcrumb: intl.get('edit'),
pageTitle: 'Manual Journals Import',
sidebarExpand: false,
backLink: true,
defaultSearchResource: RESOURCES_TYPES.MANUAL_JOURNAL,
subscriptionActive: [SUBSCRIPTION_TYPE.MAIN],
@@ -676,7 +675,6 @@ export const getDashboardRoutes = () => [
breadcrumb: 'Estimates Import',
pageTitle: 'Estimates Import',
backLink: true,
sidebarExpand: false,
defaultSearchResource: RESOURCES_TYPES.ESTIMATE,
subscriptionActive: [SUBSCRIPTION_TYPE.MAIN],
},
@@ -744,7 +742,6 @@ export const getDashboardRoutes = () => [
name: 'invoice-edit',
breadcrumb: 'Invoices Import',
pageTitle: 'Invoices Import',
sidebarExpand: false,
backLink: true,
defaultSearchResource: RESOURCES_TYPES.INVOICE,
subscriptionActive: [SUBSCRIPTION_TYPE.MAIN],
@@ -787,7 +784,6 @@ export const getDashboardRoutes = () => [
defaultSearchResource: RESOURCES_TYPES.INVOICE,
subscriptionActive: [SUBSCRIPTION_TYPE.MAIN],
},
// Sales Receipts.
{
path: `/receipts/import`,
@@ -798,7 +794,6 @@ export const getDashboardRoutes = () => [
breadcrumb: 'Receipts Import',
pageTitle: 'Receipts Import',
backLink: true,
sidebarExpand: false,
defaultSearchResource: RESOURCES_TYPES.RECEIPT,
subscriptionActive: [SUBSCRIPTION_TYPE.MAIN],
},
@@ -851,7 +846,6 @@ export const getDashboardRoutes = () => [
breadcrumb: 'Credit Notes Import',
pageTitle: 'Credit Notes Import',
backLink: true,
sidebarExpand: false,
defaultSearchResource: RESOURCES_TYPES.CREDIT_NOTE,
subscriptionActive: [SUBSCRIPTION_TYPE.MAIN],
},
@@ -926,7 +920,6 @@ export const getDashboardRoutes = () => [
breadcrumb: 'Payments Receive Import',
pageTitle: 'Payments Receive Import',
backLink: true,
sidebarExpand: false,
defaultSearchResource: RESOURCES_TYPES.PAYMENT_RECEIVE,
subscriptionActive: [SUBSCRIPTION_TYPE.MAIN],
},
@@ -983,7 +976,6 @@ export const getDashboardRoutes = () => [
name: 'bill-edit',
// breadcrumb: intl.get('edit'),
pageTitle: 'Bills Import',
sidebarExpand: false,
backLink: true,
defaultSearchResource: RESOURCES_TYPES.BILL,
subscriptionActive: [SUBSCRIPTION_TYPE.MAIN],
@@ -1036,7 +1028,6 @@ export const getDashboardRoutes = () => [
breadcrumb: 'Vendor Credits Import',
pageTitle: 'Vendor Credits Import',
backLink: true,
sidebarExpand: false,
defaultSearchResource: RESOURCES_TYPES.VENDOR_CREDIT,
subscriptionActive: [SUBSCRIPTION_TYPE.MAIN],
},
@@ -1118,7 +1109,6 @@ export const getDashboardRoutes = () => [
name: 'payment-made-edit',
breadcrumb: intl.get('edit'),
pageTitle: 'Bills Payments Import',
sidebarExpand: false,
backLink: true,
defaultSearchResource: RESOURCES_TYPES.PAYMENT_MADE,
subscriptionActive: [SUBSCRIPTION_TYPE.MAIN],
@@ -1192,6 +1182,7 @@ export const getDashboardRoutes = () => [
),
),
backLink: true,
sidebarExpand: false,
pageTitle: 'Bank Transactions Import',
subscriptionActive: [SUBSCRIPTION_TYPE.MAIN],
defaultSearchResource: RESOURCES_TYPES.ACCOUNT,