@appcorp/stellar-solutions-invoice-module 0.1.74 → 0.1.75
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/base-modules/invoice/add-service-product-section.d.ts +1 -5
- package/base-modules/invoice/add-service-product-section.js +3 -3
- package/base-modules/invoice/cache.d.ts +15 -0
- package/base-modules/invoice/cache.js +50 -0
- package/base-modules/invoice/calculate-subtotal.d.ts +6 -1
- package/base-modules/invoice/calculate-subtotal.js +2 -2
- package/base-modules/invoice/calculate-total.d.ts +1 -1
- package/base-modules/invoice/calculate-total.js +8 -8
- package/base-modules/invoice/company-form-section.d.ts +1 -5
- package/base-modules/invoice/company-form-section.js +25 -22
- package/base-modules/invoice/constants.d.ts +2 -3
- package/base-modules/invoice/constants.js +2 -3
- package/base-modules/invoice/context.d.ts +556 -20
- package/base-modules/invoice/context.js +530 -342
- package/base-modules/invoice/customer-form-section.d.ts +1 -5
- package/base-modules/invoice/customer-form-section.js +25 -9
- package/base-modules/invoice/form.d.ts +1 -5
- package/base-modules/invoice/form.js +9 -9
- package/base-modules/invoice/page.d.ts +8 -0
- package/base-modules/invoice/page.js +171 -0
- package/base-modules/invoice/pricing-form-section.d.ts +1 -5
- package/base-modules/invoice/pricing-form-section.js +16 -11
- package/base-modules/invoice/products-form-section.d.ts +1 -5
- package/base-modules/invoice/products-form-section.js +49 -40
- package/base-modules/invoice/services-form-section.d.ts +1 -5
- package/base-modules/invoice/services-form-section.js +10 -9
- package/base-modules/invoice/validate.d.ts +83 -25
- package/base-modules/invoice/validate.js +4 -4
- package/base-modules/payment/cache.d.ts +15 -0
- package/base-modules/payment/cache.js +52 -0
- package/base-modules/payment/constants.d.ts +1 -14
- package/base-modules/payment/constants.js +2 -15
- package/base-modules/payment/context.d.ts +214 -48
- package/base-modules/payment/context.js +266 -237
- package/base-modules/payment/drawer.d.ts +0 -6
- package/base-modules/payment/drawer.js +89 -44
- package/base-modules/payment/form.js +3 -2
- package/base-modules/payment/{payment.js → page.js} +2 -5
- package/base-modules/payment/types.d.ts +0 -85
- package/base-modules/payment/types.js +74 -21
- package/base-modules/payment/validate.d.ts +12 -0
- package/base-modules/payment/validate.js +19 -8
- package/base-modules/payment/view.d.ts +1 -5
- package/base-modules/payment/view.js +4 -3
- package/base-modules/quote/add-service-product-section.js +1 -1
- package/base-modules/quote/cache.d.ts +15 -0
- package/base-modules/quote/cache.js +50 -0
- package/base-modules/quote/company-form-section.d.ts +1 -1
- package/base-modules/quote/company-form-section.js +14 -12
- package/base-modules/quote/constants.js +1 -0
- package/base-modules/quote/context.d.ts +656 -46
- package/base-modules/quote/context.js +413 -289
- package/base-modules/quote/customer-form-section.d.ts +1 -1
- package/base-modules/quote/customer-form-section.js +24 -9
- package/base-modules/quote/form.d.ts +1 -5
- package/base-modules/quote/form.js +8 -9
- package/base-modules/quote/page.d.ts +8 -0
- package/base-modules/quote/page.js +163 -0
- package/base-modules/quote/pricing-form-section.js +9 -8
- package/base-modules/quote/products-form-section.js +2 -2
- package/base-modules/quote/services-form-section.js +1 -1
- package/base-modules/quote/types.d.ts +0 -127
- package/base-modules/quote/types.js +92 -35
- package/base-modules/quote/validate.d.ts +82 -25
- package/base-modules/quote/validate.js +3 -4
- package/package.json +8 -8
- package/base-modules/invoice/actions.d.ts +0 -215
- package/base-modules/invoice/actions.js +0 -38
- package/base-modules/invoice/drawer.d.ts +0 -13
- package/base-modules/invoice/drawer.js +0 -46
- package/base-modules/invoice/invoice.d.ts +0 -8
- package/base-modules/invoice/invoice.js +0 -69
- package/base-modules/invoice/reducer.d.ts +0 -4
- package/base-modules/invoice/reducer.js +0 -180
- package/base-modules/invoice/types.d.ts +0 -211
- package/base-modules/invoice/types.js +0 -43
- package/base-modules/payment/actions.d.ts +0 -203
- package/base-modules/payment/actions.js +0 -50
- package/base-modules/payment/reducer.d.ts +0 -29
- package/base-modules/payment/reducer.js +0 -215
- package/base-modules/quote/actions.d.ts +0 -215
- package/base-modules/quote/actions.js +0 -38
- package/base-modules/quote/drawer.d.ts +0 -13
- package/base-modules/quote/drawer.js +0 -46
- package/base-modules/quote/quote.d.ts +0 -8
- package/base-modules/quote/quote.js +0 -69
- package/base-modules/quote/reducer.d.ts +0 -4
- package/base-modules/quote/reducer.js +0 -181
- /package/base-modules/payment/{payment.d.ts → page.d.ts} +0 -0
|
@@ -1,50 +1,660 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Quote State Context - Using Generic Module Factory
|
|
3
3
|
*
|
|
4
|
-
* This module provides comprehensive state management for the
|
|
5
|
-
*
|
|
6
|
-
* - Form validation and error handling
|
|
7
|
-
* - Multi-section forms (company, customer, pricing, products, services)
|
|
8
|
-
* - Complex calculations (subtotal, tax, discount, total)
|
|
9
|
-
* - Dynamic product and service row management
|
|
10
|
-
* - Search and filtering functionality
|
|
11
|
-
* - Pagination controls
|
|
12
|
-
* - Company and customer integration
|
|
13
|
-
* - Currency and tax management
|
|
14
|
-
* - Internationalization support
|
|
15
|
-
* - Theme-aware toast notifications
|
|
16
|
-
*
|
|
17
|
-
* Organization:
|
|
18
|
-
* - Types & Interfaces
|
|
19
|
-
* - Main Hook (useInvoiceState)
|
|
20
|
-
* - State & Core Hooks
|
|
21
|
-
* - Theme Support
|
|
22
|
-
* - Toast Helpers
|
|
23
|
-
* - Debounced Values
|
|
24
|
-
* - Tax & Currency Defaults
|
|
25
|
-
* - API Parameters (memoized)
|
|
26
|
-
* - API Callbacks (with error handling)
|
|
27
|
-
* - Module Entity Hook
|
|
28
|
-
* - Effects (list refresh, defaults, calculations)
|
|
29
|
-
* - Drawer & Modal Handlers
|
|
30
|
-
* - CRUD Operation Handlers
|
|
31
|
-
* - Form Handlers (products, services, pricing)
|
|
32
|
-
* - Calculation Handlers
|
|
33
|
-
* - Pagination Handlers
|
|
34
|
-
* - Search Handlers
|
|
35
|
-
* - Table Actions (memoized)
|
|
36
|
-
* - Return State
|
|
37
|
-
* - Context Setup
|
|
38
|
-
* - Provider Component
|
|
39
|
-
* - Custom Hook
|
|
4
|
+
* This module provides comprehensive state management for the Quote feature using
|
|
5
|
+
* the createGenericModule factory pattern.
|
|
40
6
|
*/
|
|
41
|
-
import
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
7
|
+
import { QUOTE_INVOICE_CATEGORY, DISCOUNT_UNIT, INVOICE_STATUS, QUOTE_STATUS } from "@react-pakistan/util-functions";
|
|
8
|
+
export declare const quoteReducer: (state: {
|
|
9
|
+
items: never[];
|
|
10
|
+
count: number;
|
|
11
|
+
currentPage: number;
|
|
12
|
+
pageLimit: number;
|
|
13
|
+
searchQuery: string;
|
|
14
|
+
disableSaveButton: boolean;
|
|
15
|
+
drawer: null;
|
|
16
|
+
quoteMode: null;
|
|
17
|
+
modal: null;
|
|
18
|
+
loading: boolean;
|
|
19
|
+
afterDiscount: string;
|
|
20
|
+
category: QUOTE_INVOICE_CATEGORY;
|
|
21
|
+
companiesList: never[];
|
|
22
|
+
companyId: string;
|
|
23
|
+
companyQuery: string;
|
|
24
|
+
contactsList: never[];
|
|
25
|
+
countryQuery: string;
|
|
26
|
+
currency: string;
|
|
27
|
+
customerId: string;
|
|
28
|
+
date: string;
|
|
29
|
+
discount: string;
|
|
30
|
+
discountUnit: DISCOUNT_UNIT;
|
|
31
|
+
errors: Record<string, string>;
|
|
32
|
+
expiryDate: string;
|
|
33
|
+
getProducts: never[];
|
|
34
|
+
id: string;
|
|
35
|
+
invoiceStatus: INVOICE_STATUS;
|
|
36
|
+
mode: "Create" | "Edit";
|
|
37
|
+
netTotal: string;
|
|
38
|
+
note: string;
|
|
39
|
+
payments: never[];
|
|
40
|
+
products: never[];
|
|
41
|
+
productQuery: string;
|
|
42
|
+
productsList: {
|
|
43
|
+
id: string;
|
|
44
|
+
mode: "Create" | "Edit" | "";
|
|
45
|
+
price: string;
|
|
46
|
+
quantity: string;
|
|
47
|
+
rowTotal: string;
|
|
48
|
+
}[];
|
|
49
|
+
quoteStatus: QUOTE_STATUS;
|
|
50
|
+
ref: string;
|
|
51
|
+
servicesList: {
|
|
52
|
+
description: string;
|
|
53
|
+
mode: "Create" | "Edit" | "";
|
|
54
|
+
name: string;
|
|
55
|
+
price: string;
|
|
56
|
+
quantity: string;
|
|
57
|
+
rowTotal: string;
|
|
58
|
+
}[];
|
|
59
|
+
services: never[];
|
|
60
|
+
subTotal: string;
|
|
61
|
+
tax: string;
|
|
62
|
+
taxQuery: string;
|
|
63
|
+
taxRate: string;
|
|
64
|
+
taxes: never[];
|
|
65
|
+
total: string;
|
|
66
|
+
customer: {
|
|
67
|
+
address: string;
|
|
68
|
+
city: string;
|
|
69
|
+
country: string;
|
|
70
|
+
createdAt: string;
|
|
71
|
+
email: string;
|
|
72
|
+
firstName: string;
|
|
73
|
+
id: string;
|
|
74
|
+
lastName: string;
|
|
75
|
+
phone: string;
|
|
76
|
+
quotesInvoices: never[];
|
|
77
|
+
updatedAt: string;
|
|
78
|
+
};
|
|
79
|
+
company: {
|
|
80
|
+
contacts: never[];
|
|
81
|
+
country: string;
|
|
82
|
+
createdAt: string;
|
|
83
|
+
email: string;
|
|
84
|
+
id: string;
|
|
85
|
+
name: string;
|
|
86
|
+
phone: string;
|
|
87
|
+
quotesInvoices: never[];
|
|
88
|
+
updatedAt: string;
|
|
89
|
+
website: string;
|
|
90
|
+
};
|
|
91
|
+
}, action: any) => {
|
|
92
|
+
items: never[];
|
|
93
|
+
count: number;
|
|
94
|
+
currentPage: number;
|
|
95
|
+
pageLimit: number;
|
|
96
|
+
searchQuery: string;
|
|
97
|
+
disableSaveButton: boolean;
|
|
98
|
+
drawer: null;
|
|
99
|
+
quoteMode: null;
|
|
100
|
+
modal: null;
|
|
101
|
+
loading: boolean;
|
|
102
|
+
afterDiscount: string;
|
|
103
|
+
category: QUOTE_INVOICE_CATEGORY;
|
|
104
|
+
companiesList: never[];
|
|
105
|
+
companyId: string;
|
|
106
|
+
companyQuery: string;
|
|
107
|
+
contactsList: never[];
|
|
108
|
+
countryQuery: string;
|
|
109
|
+
currency: string;
|
|
110
|
+
customerId: string;
|
|
111
|
+
date: string;
|
|
112
|
+
discount: string;
|
|
113
|
+
discountUnit: DISCOUNT_UNIT;
|
|
114
|
+
errors: Record<string, string>;
|
|
115
|
+
expiryDate: string;
|
|
116
|
+
getProducts: never[];
|
|
117
|
+
id: string;
|
|
118
|
+
invoiceStatus: INVOICE_STATUS;
|
|
119
|
+
mode: "Create" | "Edit";
|
|
120
|
+
netTotal: string;
|
|
121
|
+
note: string;
|
|
122
|
+
payments: never[];
|
|
123
|
+
products: never[];
|
|
124
|
+
productQuery: string;
|
|
125
|
+
productsList: {
|
|
126
|
+
id: string;
|
|
127
|
+
mode: "Create" | "Edit" | "";
|
|
128
|
+
price: string;
|
|
129
|
+
quantity: string;
|
|
130
|
+
rowTotal: string;
|
|
131
|
+
}[];
|
|
132
|
+
quoteStatus: QUOTE_STATUS;
|
|
133
|
+
ref: string;
|
|
134
|
+
servicesList: {
|
|
135
|
+
description: string;
|
|
136
|
+
mode: "Create" | "Edit" | "";
|
|
137
|
+
name: string;
|
|
138
|
+
price: string;
|
|
139
|
+
quantity: string;
|
|
140
|
+
rowTotal: string;
|
|
141
|
+
}[];
|
|
142
|
+
services: never[];
|
|
143
|
+
subTotal: string;
|
|
144
|
+
tax: string;
|
|
145
|
+
taxQuery: string;
|
|
146
|
+
taxRate: string;
|
|
147
|
+
taxes: never[];
|
|
148
|
+
total: string;
|
|
149
|
+
customer: {
|
|
150
|
+
address: string;
|
|
151
|
+
city: string;
|
|
152
|
+
country: string;
|
|
153
|
+
createdAt: string;
|
|
154
|
+
email: string;
|
|
155
|
+
firstName: string;
|
|
156
|
+
id: string;
|
|
157
|
+
lastName: string;
|
|
158
|
+
phone: string;
|
|
159
|
+
quotesInvoices: never[];
|
|
160
|
+
updatedAt: string;
|
|
161
|
+
};
|
|
162
|
+
company: {
|
|
163
|
+
contacts: never[];
|
|
164
|
+
country: string;
|
|
165
|
+
createdAt: string;
|
|
166
|
+
email: string;
|
|
167
|
+
id: string;
|
|
168
|
+
name: string;
|
|
169
|
+
phone: string;
|
|
170
|
+
quotesInvoices: never[];
|
|
171
|
+
updatedAt: string;
|
|
172
|
+
website: string;
|
|
173
|
+
};
|
|
174
|
+
}, QuoteProvider: import("react").FC<{
|
|
175
|
+
children: React.ReactNode;
|
|
176
|
+
}>, useQuoteContext: () => import("@react-pakistan/util-functions/factory/generic-module-factory").GenericModuleContext<{
|
|
177
|
+
items: never[];
|
|
178
|
+
count: number;
|
|
179
|
+
currentPage: number;
|
|
180
|
+
pageLimit: number;
|
|
181
|
+
searchQuery: string;
|
|
182
|
+
disableSaveButton: boolean;
|
|
183
|
+
drawer: null;
|
|
184
|
+
quoteMode: null;
|
|
185
|
+
modal: null;
|
|
186
|
+
loading: boolean;
|
|
187
|
+
afterDiscount: string;
|
|
188
|
+
category: QUOTE_INVOICE_CATEGORY;
|
|
189
|
+
companiesList: never[];
|
|
190
|
+
companyId: string;
|
|
191
|
+
companyQuery: string;
|
|
192
|
+
contactsList: never[];
|
|
193
|
+
countryQuery: string;
|
|
194
|
+
currency: string;
|
|
195
|
+
customerId: string;
|
|
196
|
+
date: string;
|
|
197
|
+
discount: string;
|
|
198
|
+
discountUnit: DISCOUNT_UNIT;
|
|
199
|
+
errors: Record<string, string>;
|
|
200
|
+
expiryDate: string;
|
|
201
|
+
getProducts: never[];
|
|
202
|
+
id: string;
|
|
203
|
+
invoiceStatus: INVOICE_STATUS;
|
|
204
|
+
mode: "Create" | "Edit";
|
|
205
|
+
netTotal: string;
|
|
206
|
+
note: string;
|
|
207
|
+
payments: never[];
|
|
208
|
+
products: never[];
|
|
209
|
+
productQuery: string;
|
|
210
|
+
productsList: {
|
|
211
|
+
id: string;
|
|
212
|
+
mode: "Create" | "Edit" | "";
|
|
213
|
+
price: string;
|
|
214
|
+
quantity: string;
|
|
215
|
+
rowTotal: string;
|
|
216
|
+
}[];
|
|
217
|
+
quoteStatus: QUOTE_STATUS;
|
|
218
|
+
ref: string;
|
|
219
|
+
servicesList: {
|
|
220
|
+
description: string;
|
|
221
|
+
mode: "Create" | "Edit" | "";
|
|
222
|
+
name: string;
|
|
223
|
+
price: string;
|
|
224
|
+
quantity: string;
|
|
225
|
+
rowTotal: string;
|
|
226
|
+
}[];
|
|
227
|
+
services: never[];
|
|
228
|
+
subTotal: string;
|
|
229
|
+
tax: string;
|
|
230
|
+
taxQuery: string;
|
|
231
|
+
taxRate: string;
|
|
232
|
+
taxes: never[];
|
|
233
|
+
total: string;
|
|
234
|
+
customer: {
|
|
235
|
+
address: string;
|
|
236
|
+
city: string;
|
|
237
|
+
country: string;
|
|
238
|
+
createdAt: string;
|
|
239
|
+
email: string;
|
|
240
|
+
firstName: string;
|
|
241
|
+
id: string;
|
|
242
|
+
lastName: string;
|
|
243
|
+
phone: string;
|
|
244
|
+
quotesInvoices: never[];
|
|
245
|
+
updatedAt: string;
|
|
246
|
+
};
|
|
247
|
+
company: {
|
|
248
|
+
contacts: never[];
|
|
249
|
+
country: string;
|
|
250
|
+
createdAt: string;
|
|
251
|
+
email: string;
|
|
252
|
+
id: string;
|
|
253
|
+
name: string;
|
|
254
|
+
phone: string;
|
|
255
|
+
quotesInvoices: never[];
|
|
256
|
+
updatedAt: string;
|
|
257
|
+
website: string;
|
|
258
|
+
};
|
|
259
|
+
}>, quoteModuleConfig: import("@react-pakistan/util-functions/factory/generic-module-factory").ModuleConfig<{
|
|
260
|
+
items: never[];
|
|
261
|
+
count: number;
|
|
262
|
+
currentPage: number;
|
|
263
|
+
pageLimit: number;
|
|
264
|
+
searchQuery: string;
|
|
265
|
+
disableSaveButton: boolean;
|
|
266
|
+
drawer: null;
|
|
267
|
+
quoteMode: null;
|
|
268
|
+
modal: null;
|
|
269
|
+
loading: boolean;
|
|
270
|
+
afterDiscount: string;
|
|
271
|
+
category: QUOTE_INVOICE_CATEGORY;
|
|
272
|
+
companiesList: never[];
|
|
273
|
+
companyId: string;
|
|
274
|
+
companyQuery: string;
|
|
275
|
+
contactsList: never[];
|
|
276
|
+
countryQuery: string;
|
|
277
|
+
currency: string;
|
|
278
|
+
customerId: string;
|
|
279
|
+
date: string;
|
|
280
|
+
discount: string;
|
|
281
|
+
discountUnit: DISCOUNT_UNIT;
|
|
282
|
+
errors: Record<string, string>;
|
|
283
|
+
expiryDate: string;
|
|
284
|
+
getProducts: never[];
|
|
285
|
+
id: string;
|
|
286
|
+
invoiceStatus: INVOICE_STATUS;
|
|
287
|
+
mode: "Create" | "Edit";
|
|
288
|
+
netTotal: string;
|
|
289
|
+
note: string;
|
|
290
|
+
payments: never[];
|
|
291
|
+
products: never[];
|
|
292
|
+
productQuery: string;
|
|
293
|
+
productsList: {
|
|
294
|
+
id: string;
|
|
295
|
+
mode: "Create" | "Edit" | "";
|
|
296
|
+
price: string;
|
|
297
|
+
quantity: string;
|
|
298
|
+
rowTotal: string;
|
|
299
|
+
}[];
|
|
300
|
+
quoteStatus: QUOTE_STATUS;
|
|
301
|
+
ref: string;
|
|
302
|
+
servicesList: {
|
|
303
|
+
description: string;
|
|
304
|
+
mode: "Create" | "Edit" | "";
|
|
305
|
+
name: string;
|
|
306
|
+
price: string;
|
|
307
|
+
quantity: string;
|
|
308
|
+
rowTotal: string;
|
|
309
|
+
}[];
|
|
310
|
+
services: never[];
|
|
311
|
+
subTotal: string;
|
|
312
|
+
tax: string;
|
|
313
|
+
taxQuery: string;
|
|
314
|
+
taxRate: string;
|
|
315
|
+
taxes: never[];
|
|
316
|
+
total: string;
|
|
317
|
+
customer: {
|
|
318
|
+
address: string;
|
|
319
|
+
city: string;
|
|
320
|
+
country: string;
|
|
321
|
+
createdAt: string;
|
|
322
|
+
email: string;
|
|
323
|
+
firstName: string;
|
|
324
|
+
id: string;
|
|
325
|
+
lastName: string;
|
|
326
|
+
phone: string;
|
|
327
|
+
quotesInvoices: never[];
|
|
328
|
+
updatedAt: string;
|
|
329
|
+
};
|
|
330
|
+
company: {
|
|
331
|
+
contacts: never[];
|
|
332
|
+
country: string;
|
|
333
|
+
createdAt: string;
|
|
334
|
+
email: string;
|
|
335
|
+
id: string;
|
|
336
|
+
name: string;
|
|
337
|
+
phone: string;
|
|
338
|
+
quotesInvoices: never[];
|
|
339
|
+
updatedAt: string;
|
|
340
|
+
website: string;
|
|
341
|
+
};
|
|
342
|
+
}>, QUOTE_ACTION_TYPES: {
|
|
343
|
+
readonly RESET_FORM: "RESET_FORM";
|
|
344
|
+
readonly SET_CURRENT_PAGE: "SET_CURRENT_PAGE";
|
|
345
|
+
readonly SET_PAGE_LIMIT: "SET_PAGE_LIMIT";
|
|
346
|
+
readonly SET_SEARCH_QUERY: "SET_SEARCH_QUERY";
|
|
347
|
+
readonly SET_DRAWER: "SET_DRAWER";
|
|
348
|
+
readonly SET_ITEMS: "SET_ITEMS";
|
|
349
|
+
readonly SET_FORM_DATA: "SET_FORM_DATA";
|
|
350
|
+
readonly SET_DISABLE_SAVE_BUTTON: "SET_DISABLE_SAVE_BUTTON";
|
|
351
|
+
readonly SET_INPUT_FIELD: "SET_INPUT_FIELD";
|
|
352
|
+
readonly SET_ERRORS: "SET_ERRORS";
|
|
353
|
+
}, initialQuoteState: {
|
|
354
|
+
items: never[];
|
|
355
|
+
count: number;
|
|
356
|
+
currentPage: number;
|
|
357
|
+
pageLimit: number;
|
|
358
|
+
searchQuery: string;
|
|
359
|
+
disableSaveButton: boolean;
|
|
360
|
+
drawer: null;
|
|
361
|
+
quoteMode: null;
|
|
362
|
+
modal: null;
|
|
363
|
+
loading: boolean;
|
|
364
|
+
afterDiscount: string;
|
|
365
|
+
category: QUOTE_INVOICE_CATEGORY;
|
|
366
|
+
companiesList: never[];
|
|
367
|
+
companyId: string;
|
|
368
|
+
companyQuery: string;
|
|
369
|
+
contactsList: never[];
|
|
370
|
+
countryQuery: string;
|
|
371
|
+
currency: string;
|
|
372
|
+
customerId: string;
|
|
373
|
+
date: string;
|
|
374
|
+
discount: string;
|
|
375
|
+
discountUnit: DISCOUNT_UNIT;
|
|
376
|
+
errors: Record<string, string>;
|
|
377
|
+
expiryDate: string;
|
|
378
|
+
getProducts: never[];
|
|
379
|
+
id: string;
|
|
380
|
+
invoiceStatus: INVOICE_STATUS;
|
|
381
|
+
mode: "Create" | "Edit";
|
|
382
|
+
netTotal: string;
|
|
383
|
+
note: string;
|
|
384
|
+
payments: never[];
|
|
385
|
+
products: never[];
|
|
386
|
+
productQuery: string;
|
|
387
|
+
productsList: {
|
|
388
|
+
id: string;
|
|
389
|
+
mode: "Create" | "Edit" | "";
|
|
390
|
+
price: string;
|
|
391
|
+
quantity: string;
|
|
392
|
+
rowTotal: string;
|
|
393
|
+
}[];
|
|
394
|
+
quoteStatus: QUOTE_STATUS;
|
|
395
|
+
ref: string;
|
|
396
|
+
servicesList: {
|
|
397
|
+
description: string;
|
|
398
|
+
mode: "Create" | "Edit" | "";
|
|
399
|
+
name: string;
|
|
400
|
+
price: string;
|
|
401
|
+
quantity: string;
|
|
402
|
+
rowTotal: string;
|
|
403
|
+
}[];
|
|
404
|
+
services: never[];
|
|
405
|
+
subTotal: string;
|
|
406
|
+
tax: string;
|
|
407
|
+
taxQuery: string;
|
|
408
|
+
taxRate: string;
|
|
409
|
+
taxes: never[];
|
|
410
|
+
total: string;
|
|
411
|
+
customer: {
|
|
412
|
+
address: string;
|
|
413
|
+
city: string;
|
|
414
|
+
country: string;
|
|
415
|
+
createdAt: string;
|
|
416
|
+
email: string;
|
|
417
|
+
firstName: string;
|
|
418
|
+
id: string;
|
|
419
|
+
lastName: string;
|
|
420
|
+
phone: string;
|
|
421
|
+
quotesInvoices: never[];
|
|
422
|
+
updatedAt: string;
|
|
423
|
+
};
|
|
424
|
+
company: {
|
|
425
|
+
contacts: never[];
|
|
426
|
+
country: string;
|
|
427
|
+
createdAt: string;
|
|
428
|
+
email: string;
|
|
429
|
+
id: string;
|
|
430
|
+
name: string;
|
|
431
|
+
phone: string;
|
|
432
|
+
quotesInvoices: never[];
|
|
433
|
+
updatedAt: string;
|
|
434
|
+
website: string;
|
|
435
|
+
};
|
|
436
|
+
};
|
|
437
|
+
export interface ServiceParams {
|
|
438
|
+
index: number;
|
|
439
|
+
key: string;
|
|
440
|
+
value: string | number;
|
|
441
|
+
}
|
|
442
|
+
export interface ProductParams {
|
|
443
|
+
index: number;
|
|
444
|
+
key: string;
|
|
445
|
+
value: string | number;
|
|
46
446
|
}
|
|
47
|
-
export declare const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
447
|
+
export declare const useQuoteModule: () => {
|
|
448
|
+
quotes: never[];
|
|
449
|
+
byIdError: Error | undefined;
|
|
450
|
+
byIdLoading: boolean;
|
|
451
|
+
clearSearch: () => void;
|
|
452
|
+
closeDrawer: () => void;
|
|
453
|
+
deleteError: Error | undefined;
|
|
454
|
+
deleteLoading: boolean;
|
|
455
|
+
dispatch: import("react").Dispatch<any>;
|
|
456
|
+
handleAddItemProduct: () => void;
|
|
457
|
+
handleAddItemService: () => void;
|
|
458
|
+
handleChange: (key: string, value: string) => void;
|
|
459
|
+
handleCloseDrawer: () => void;
|
|
460
|
+
handleCreate: (text: "customer" | "company") => void;
|
|
461
|
+
handleDelete: (row: unknown) => void;
|
|
462
|
+
handleDeleteProductRow: (i: number) => void;
|
|
463
|
+
handleDeleteServiceRow: (i: number) => void;
|
|
464
|
+
handleEdit: (row: unknown) => void;
|
|
465
|
+
handleItemChangeProducts: ({ index, key, value }: ProductParams) => void;
|
|
466
|
+
handleItemChangeServices: ({ index, key, value }: ServiceParams) => void;
|
|
467
|
+
handleNextClick: () => void;
|
|
468
|
+
handlePageChange: (page: number) => void;
|
|
469
|
+
handlePageLimit: (k: string, value: object) => void;
|
|
470
|
+
handlePageLimitChange: (limit: number) => void;
|
|
471
|
+
handlePreviousClick: () => void;
|
|
472
|
+
handleSearch: (query: string) => void;
|
|
473
|
+
handleSubmit: () => void;
|
|
474
|
+
handleTaxSearch: (searchQuery: string) => void;
|
|
475
|
+
handleView: (row: unknown) => void;
|
|
476
|
+
headerActions: {
|
|
477
|
+
enabled: boolean;
|
|
478
|
+
handleOnClick: () => void;
|
|
479
|
+
label: string;
|
|
480
|
+
order: number;
|
|
481
|
+
}[];
|
|
482
|
+
listError: Error | undefined;
|
|
483
|
+
listFetchNow: (url?: string, config?: import("@react-pakistan/util-functions").FetchConfig) => void;
|
|
484
|
+
listLoading: boolean;
|
|
485
|
+
rowActions: {
|
|
486
|
+
enabled: boolean;
|
|
487
|
+
handleAction: (id: string) => void;
|
|
488
|
+
label: string;
|
|
489
|
+
order: number;
|
|
490
|
+
}[];
|
|
491
|
+
searchOnChange: (k: string, v: string) => void;
|
|
492
|
+
updateError: Error | undefined;
|
|
493
|
+
updateLoading: boolean;
|
|
494
|
+
items: never[];
|
|
495
|
+
count: number;
|
|
496
|
+
currentPage: number;
|
|
497
|
+
pageLimit: number;
|
|
498
|
+
searchQuery: string;
|
|
499
|
+
disableSaveButton: boolean;
|
|
500
|
+
drawer: null;
|
|
501
|
+
quoteMode: null;
|
|
502
|
+
modal: null;
|
|
503
|
+
loading: boolean;
|
|
504
|
+
afterDiscount: string;
|
|
505
|
+
category: QUOTE_INVOICE_CATEGORY;
|
|
506
|
+
companiesList: never[];
|
|
507
|
+
companyId: string;
|
|
508
|
+
companyQuery: string;
|
|
509
|
+
contactsList: never[];
|
|
510
|
+
countryQuery: string;
|
|
511
|
+
currency: string;
|
|
512
|
+
customerId: string;
|
|
513
|
+
date: string;
|
|
514
|
+
discount: string;
|
|
515
|
+
discountUnit: DISCOUNT_UNIT;
|
|
516
|
+
errors: Record<string, string>;
|
|
517
|
+
expiryDate: string;
|
|
518
|
+
getProducts: never[];
|
|
519
|
+
id: string;
|
|
520
|
+
invoiceStatus: INVOICE_STATUS;
|
|
521
|
+
mode: "Create" | "Edit";
|
|
522
|
+
netTotal: string;
|
|
523
|
+
note: string;
|
|
524
|
+
payments: never[];
|
|
525
|
+
products: never[];
|
|
526
|
+
productQuery: string;
|
|
527
|
+
productsList: {
|
|
528
|
+
id: string;
|
|
529
|
+
mode: "Create" | "Edit" | "";
|
|
530
|
+
price: string;
|
|
531
|
+
quantity: string;
|
|
532
|
+
rowTotal: string;
|
|
533
|
+
}[];
|
|
534
|
+
quoteStatus: QUOTE_STATUS;
|
|
535
|
+
ref: string;
|
|
536
|
+
servicesList: {
|
|
537
|
+
description: string;
|
|
538
|
+
mode: "Create" | "Edit" | "";
|
|
539
|
+
name: string;
|
|
540
|
+
price: string;
|
|
541
|
+
quantity: string;
|
|
542
|
+
rowTotal: string;
|
|
543
|
+
}[];
|
|
544
|
+
services: never[];
|
|
545
|
+
subTotal: string;
|
|
546
|
+
tax: string;
|
|
547
|
+
taxQuery: string;
|
|
548
|
+
taxRate: string;
|
|
549
|
+
taxes: never[];
|
|
550
|
+
total: string;
|
|
551
|
+
customer: {
|
|
552
|
+
address: string;
|
|
553
|
+
city: string;
|
|
554
|
+
country: string;
|
|
555
|
+
createdAt: string;
|
|
556
|
+
email: string;
|
|
557
|
+
firstName: string;
|
|
558
|
+
id: string;
|
|
559
|
+
lastName: string;
|
|
560
|
+
phone: string;
|
|
561
|
+
quotesInvoices: never[];
|
|
562
|
+
updatedAt: string;
|
|
563
|
+
};
|
|
564
|
+
company: {
|
|
565
|
+
contacts: never[];
|
|
566
|
+
country: string;
|
|
567
|
+
createdAt: string;
|
|
568
|
+
email: string;
|
|
569
|
+
id: string;
|
|
570
|
+
name: string;
|
|
571
|
+
phone: string;
|
|
572
|
+
quotesInvoices: never[];
|
|
573
|
+
updatedAt: string;
|
|
574
|
+
website: string;
|
|
575
|
+
};
|
|
576
|
+
state: {
|
|
577
|
+
items: never[];
|
|
578
|
+
count: number;
|
|
579
|
+
currentPage: number;
|
|
580
|
+
pageLimit: number;
|
|
581
|
+
searchQuery: string;
|
|
582
|
+
disableSaveButton: boolean;
|
|
583
|
+
drawer: null;
|
|
584
|
+
quoteMode: null;
|
|
585
|
+
modal: null;
|
|
586
|
+
loading: boolean;
|
|
587
|
+
afterDiscount: string;
|
|
588
|
+
category: QUOTE_INVOICE_CATEGORY;
|
|
589
|
+
companiesList: never[];
|
|
590
|
+
companyId: string;
|
|
591
|
+
companyQuery: string;
|
|
592
|
+
contactsList: never[];
|
|
593
|
+
countryQuery: string;
|
|
594
|
+
currency: string;
|
|
595
|
+
customerId: string;
|
|
596
|
+
date: string;
|
|
597
|
+
discount: string;
|
|
598
|
+
discountUnit: DISCOUNT_UNIT;
|
|
599
|
+
errors: Record<string, string>;
|
|
600
|
+
expiryDate: string;
|
|
601
|
+
getProducts: never[];
|
|
602
|
+
id: string;
|
|
603
|
+
invoiceStatus: INVOICE_STATUS;
|
|
604
|
+
mode: "Create" | "Edit";
|
|
605
|
+
netTotal: string;
|
|
606
|
+
note: string;
|
|
607
|
+
payments: never[];
|
|
608
|
+
products: never[];
|
|
609
|
+
productQuery: string;
|
|
610
|
+
productsList: {
|
|
611
|
+
id: string;
|
|
612
|
+
mode: "Create" | "Edit" | "";
|
|
613
|
+
price: string;
|
|
614
|
+
quantity: string;
|
|
615
|
+
rowTotal: string;
|
|
616
|
+
}[];
|
|
617
|
+
quoteStatus: QUOTE_STATUS;
|
|
618
|
+
ref: string;
|
|
619
|
+
servicesList: {
|
|
620
|
+
description: string;
|
|
621
|
+
mode: "Create" | "Edit" | "";
|
|
622
|
+
name: string;
|
|
623
|
+
price: string;
|
|
624
|
+
quantity: string;
|
|
625
|
+
rowTotal: string;
|
|
626
|
+
}[];
|
|
627
|
+
services: never[];
|
|
628
|
+
subTotal: string;
|
|
629
|
+
tax: string;
|
|
630
|
+
taxQuery: string;
|
|
631
|
+
taxRate: string;
|
|
632
|
+
taxes: never[];
|
|
633
|
+
total: string;
|
|
634
|
+
customer: {
|
|
635
|
+
address: string;
|
|
636
|
+
city: string;
|
|
637
|
+
country: string;
|
|
638
|
+
createdAt: string;
|
|
639
|
+
email: string;
|
|
640
|
+
firstName: string;
|
|
641
|
+
id: string;
|
|
642
|
+
lastName: string;
|
|
643
|
+
phone: string;
|
|
644
|
+
quotesInvoices: never[];
|
|
645
|
+
updatedAt: string;
|
|
646
|
+
};
|
|
647
|
+
company: {
|
|
648
|
+
contacts: never[];
|
|
649
|
+
country: string;
|
|
650
|
+
createdAt: string;
|
|
651
|
+
email: string;
|
|
652
|
+
id: string;
|
|
653
|
+
name: string;
|
|
654
|
+
phone: string;
|
|
655
|
+
quotesInvoices: never[];
|
|
656
|
+
updatedAt: string;
|
|
657
|
+
website: string;
|
|
658
|
+
};
|
|
659
|
+
};
|
|
660
|
+
};
|