@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,215 +0,0 @@
|
|
|
1
|
-
import { ProductTypeBE } from "@appcorp/stellar-solutions-product-module/base-modules/product/types";
|
|
2
|
-
import { DISCOUNT_UNIT, QUOTE_DRAWER, QuoteState, QuoteInvoiceTypeBE, Product, Service, QUOTE_MODAL } from "./types";
|
|
3
|
-
import { TaxTypeBE } from "@appcorp/stellar-solutions-modules/global-modules/preferences/types";
|
|
4
|
-
import { CompanyTypeBE } from "@appcorp/stellar-solutions-company-module/base-modules/company/types";
|
|
5
|
-
import { CustomerTypeBE } from "@appcorp/stellar-solutions-company-module/base-modules/customer/types";
|
|
6
|
-
export declare enum QUOTE_ACTION_TYPES {
|
|
7
|
-
ADD_ITEM_PRODUCT = "ADD_ITEM_PRODUCT",
|
|
8
|
-
ADD_ITEM_SERVICE = "ADD_ITEM_SERVICE",
|
|
9
|
-
DELETE_ITEM_PRODUCT = "DELETE_ITEM_PRODUCT",
|
|
10
|
-
DELETE_ITEM_SERVICE = "DELETE_ITEM_SERVICE",
|
|
11
|
-
RESET_ERRORS = "RESET_ERRORS",
|
|
12
|
-
RESET_FORM = "RESET_FORM",
|
|
13
|
-
SET_AFTER_DISCOUNT = "SET_AFTER_DISCOUNT",
|
|
14
|
-
SET_BUTTON_DISABLE = "SET_BUTTON_DISABLE",
|
|
15
|
-
SET_COMPANIES_LIST = "SET_COMPANIES_LIST",
|
|
16
|
-
SET_COUNT = "SET_COUNT",
|
|
17
|
-
SET_CURRENT_PAGE = "SET_CURRENT_PAGE",
|
|
18
|
-
SET_CUSTOMER = "SET_CUSTOMER",
|
|
19
|
-
SET_CUSTOMER_DATA = "SET_CUSTOMER_DATA",
|
|
20
|
-
SET_CUSTOMER_FORM = "SET_CUSTOMER_FORM",
|
|
21
|
-
SET_DISABLE_SAVE_BUTTON = "SET_DISABLE_SAVE_BUTTON",
|
|
22
|
-
SET_DISCOUNT_UNIT = "SET_DISCOUNT_UNIT",
|
|
23
|
-
SET_DRAWER = "SET_DRAWER",
|
|
24
|
-
SET_ERRORS = "SET_ERRORS",
|
|
25
|
-
SET_FORM = "SET_FORM",
|
|
26
|
-
SET_FORM_LOADING = "SET_FORM_LOADING",
|
|
27
|
-
SET_FORM_TO_RENDER = "SET_FORM_TO_RENDER",
|
|
28
|
-
SET_INPUT_FIELD = "SET_INPUT_FIELD",
|
|
29
|
-
SET_QUOTES = "SET_QUOTES",
|
|
30
|
-
SET_QUOTE_FORM = "SET_QUOTE_FORM",
|
|
31
|
-
SET_IS_QUOTE_API_SUCCESS = "SET_IS_QUOTE_API_SUCCESS",
|
|
32
|
-
SET_MODAL = "SET_MODAL",
|
|
33
|
-
SET_PAGE_LIMIT = "SET_PAGE_LIMIT",
|
|
34
|
-
SET_PRODUCTS_LIST = "SET_PRODUCTS_LIST",
|
|
35
|
-
SET_SEARCH_QUERY = "SET_SEARCH_QUERY",
|
|
36
|
-
SET_SKELTON_LOADING = "SET_SKELTON_LOADING",
|
|
37
|
-
SET_TAX = "SET_TAX",
|
|
38
|
-
SET_TAXES = "SET_TAXES"
|
|
39
|
-
}
|
|
40
|
-
export type QuoteUpdateFieldAction = {
|
|
41
|
-
type: QUOTE_ACTION_TYPES.SET_INPUT_FIELD;
|
|
42
|
-
payload: {
|
|
43
|
-
key: keyof QuoteInvoiceTypeBE | "servicesList" | "productsList" | "taxQuery" | "productQuery" | "companyQuery";
|
|
44
|
-
value: string | string[] | boolean | number | number[] | Service[] | Product[];
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
export type QuoteResetErrorAction = {
|
|
48
|
-
type: QUOTE_ACTION_TYPES.RESET_ERRORS;
|
|
49
|
-
};
|
|
50
|
-
export type QuoteResetFormAction = {
|
|
51
|
-
type: QUOTE_ACTION_TYPES.RESET_FORM;
|
|
52
|
-
};
|
|
53
|
-
export type QuoteSetErrorsAction = {
|
|
54
|
-
type: QUOTE_ACTION_TYPES.SET_ERRORS;
|
|
55
|
-
payload: {
|
|
56
|
-
errors: {
|
|
57
|
-
[key: string]: string;
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
export type QuoteSetCurrentPageAction = {
|
|
62
|
-
type: QUOTE_ACTION_TYPES.SET_CURRENT_PAGE;
|
|
63
|
-
payload: {
|
|
64
|
-
currentPage: number;
|
|
65
|
-
};
|
|
66
|
-
};
|
|
67
|
-
export type QuoteSetButtonDisableAction = {
|
|
68
|
-
type: QUOTE_ACTION_TYPES.SET_DISABLE_SAVE_BUTTON;
|
|
69
|
-
payload: {
|
|
70
|
-
disableSaveButton: boolean;
|
|
71
|
-
};
|
|
72
|
-
};
|
|
73
|
-
export type QuoteSetFormLoadingAction = {
|
|
74
|
-
type: QUOTE_ACTION_TYPES.SET_FORM_LOADING;
|
|
75
|
-
payload: boolean;
|
|
76
|
-
};
|
|
77
|
-
export type QuoteSetMaxPageLimitAction = {
|
|
78
|
-
type: QUOTE_ACTION_TYPES.SET_PAGE_LIMIT;
|
|
79
|
-
payload: {
|
|
80
|
-
pageLimit: number;
|
|
81
|
-
};
|
|
82
|
-
};
|
|
83
|
-
export type QuoteSetSearchQueryAction = {
|
|
84
|
-
type: QUOTE_ACTION_TYPES.SET_SEARCH_QUERY;
|
|
85
|
-
payload: {
|
|
86
|
-
searchQuery: string;
|
|
87
|
-
};
|
|
88
|
-
};
|
|
89
|
-
export type QuoteSetQuotesAction = {
|
|
90
|
-
type: QUOTE_ACTION_TYPES.SET_QUOTES;
|
|
91
|
-
payload: {
|
|
92
|
-
quotes: QuoteInvoiceTypeBE[];
|
|
93
|
-
};
|
|
94
|
-
};
|
|
95
|
-
export type QuoteSetCountAction = {
|
|
96
|
-
type: QUOTE_ACTION_TYPES.SET_COUNT;
|
|
97
|
-
payload: {
|
|
98
|
-
count: number;
|
|
99
|
-
};
|
|
100
|
-
};
|
|
101
|
-
export type QuoteSetQuoteFormAction = {
|
|
102
|
-
type: QUOTE_ACTION_TYPES.SET_QUOTE_FORM;
|
|
103
|
-
payload: QuoteInvoiceTypeBE;
|
|
104
|
-
};
|
|
105
|
-
export type QuoteToggleLoadingAction = {
|
|
106
|
-
type: QUOTE_ACTION_TYPES.SET_SKELTON_LOADING;
|
|
107
|
-
payload: boolean;
|
|
108
|
-
};
|
|
109
|
-
export type QuoteAddItemServiceAction = {
|
|
110
|
-
type: QUOTE_ACTION_TYPES.ADD_ITEM_SERVICE;
|
|
111
|
-
payload: {
|
|
112
|
-
servicesList: Service[];
|
|
113
|
-
};
|
|
114
|
-
};
|
|
115
|
-
export type QuoteAddItemProductAction = {
|
|
116
|
-
type: QUOTE_ACTION_TYPES.ADD_ITEM_PRODUCT;
|
|
117
|
-
payload: {
|
|
118
|
-
productsList: Product[];
|
|
119
|
-
};
|
|
120
|
-
};
|
|
121
|
-
export type QuoteDeleteItemProductAction = {
|
|
122
|
-
type: QUOTE_ACTION_TYPES.DELETE_ITEM_PRODUCT;
|
|
123
|
-
payload: {
|
|
124
|
-
productsList: Product[];
|
|
125
|
-
};
|
|
126
|
-
};
|
|
127
|
-
export type QuoteDeleteItemServiceAction = {
|
|
128
|
-
type: QUOTE_ACTION_TYPES.DELETE_ITEM_SERVICE;
|
|
129
|
-
payload: {
|
|
130
|
-
servicesList: Service[];
|
|
131
|
-
};
|
|
132
|
-
};
|
|
133
|
-
export type QuoteSetDiscountUnitAction = {
|
|
134
|
-
type: QUOTE_ACTION_TYPES.SET_DISCOUNT_UNIT;
|
|
135
|
-
payload: {
|
|
136
|
-
discountUnit: DISCOUNT_UNIT;
|
|
137
|
-
};
|
|
138
|
-
};
|
|
139
|
-
export type QuoteSetCustomerDataAction = {
|
|
140
|
-
type: QUOTE_ACTION_TYPES.SET_CUSTOMER_DATA;
|
|
141
|
-
payload: QuoteState;
|
|
142
|
-
};
|
|
143
|
-
export type QuoteSetIsQuoteApiSuccessAction = {
|
|
144
|
-
type: QUOTE_ACTION_TYPES.SET_IS_QUOTE_API_SUCCESS;
|
|
145
|
-
payload: boolean;
|
|
146
|
-
};
|
|
147
|
-
export type QuoteSetDrawerAction = {
|
|
148
|
-
type: QUOTE_ACTION_TYPES.SET_DRAWER;
|
|
149
|
-
payload: {
|
|
150
|
-
drawer: QUOTE_DRAWER | null;
|
|
151
|
-
};
|
|
152
|
-
};
|
|
153
|
-
export type QuoteSetFormAction = {
|
|
154
|
-
type: QUOTE_ACTION_TYPES.SET_FORM;
|
|
155
|
-
payload: {
|
|
156
|
-
form: QuoteInvoiceTypeBE;
|
|
157
|
-
};
|
|
158
|
-
};
|
|
159
|
-
export type QuoteSetAfterDiscountAction = {
|
|
160
|
-
type: QUOTE_ACTION_TYPES.SET_AFTER_DISCOUNT;
|
|
161
|
-
payload: {
|
|
162
|
-
afterDiscount: string;
|
|
163
|
-
};
|
|
164
|
-
};
|
|
165
|
-
export type QuoteSetTaxAction = {
|
|
166
|
-
type: QUOTE_ACTION_TYPES.SET_TAX;
|
|
167
|
-
payload: {
|
|
168
|
-
tax: string;
|
|
169
|
-
};
|
|
170
|
-
};
|
|
171
|
-
export type QuoteSetFormToRenderAction = {
|
|
172
|
-
type: QUOTE_ACTION_TYPES.SET_FORM_TO_RENDER;
|
|
173
|
-
payload: {
|
|
174
|
-
formToRender: string;
|
|
175
|
-
};
|
|
176
|
-
};
|
|
177
|
-
export type QuoteSetProductsListAction = {
|
|
178
|
-
type: QUOTE_ACTION_TYPES.SET_PRODUCTS_LIST;
|
|
179
|
-
payload: {
|
|
180
|
-
list: ProductTypeBE[];
|
|
181
|
-
};
|
|
182
|
-
};
|
|
183
|
-
export type QuoteSetCompaniesListAction = {
|
|
184
|
-
type: QUOTE_ACTION_TYPES.SET_COMPANIES_LIST;
|
|
185
|
-
payload: {
|
|
186
|
-
companiesList: CompanyTypeBE[];
|
|
187
|
-
};
|
|
188
|
-
};
|
|
189
|
-
export type QuoteSetCustomerAction = {
|
|
190
|
-
type: QUOTE_ACTION_TYPES.SET_CUSTOMER;
|
|
191
|
-
payload: {
|
|
192
|
-
customer: CustomerTypeBE;
|
|
193
|
-
customerId: string;
|
|
194
|
-
};
|
|
195
|
-
};
|
|
196
|
-
export type QuoteSetCustomerFormAction = {
|
|
197
|
-
type: QUOTE_ACTION_TYPES.SET_CUSTOMER_FORM;
|
|
198
|
-
payload: {
|
|
199
|
-
key: keyof CustomerTypeBE;
|
|
200
|
-
value: string;
|
|
201
|
-
};
|
|
202
|
-
};
|
|
203
|
-
export type QuoteSetTaxesAction = {
|
|
204
|
-
type: QUOTE_ACTION_TYPES.SET_TAXES;
|
|
205
|
-
payload: {
|
|
206
|
-
taxes: TaxTypeBE[];
|
|
207
|
-
};
|
|
208
|
-
};
|
|
209
|
-
export type QuoteSetModalAction = {
|
|
210
|
-
type: QUOTE_ACTION_TYPES.SET_MODAL;
|
|
211
|
-
payload: {
|
|
212
|
-
modal: QUOTE_MODAL;
|
|
213
|
-
};
|
|
214
|
-
};
|
|
215
|
-
export type QuoteActions = QuoteAddItemProductAction | QuoteAddItemServiceAction | QuoteResetErrorAction | QuoteDeleteItemProductAction | QuoteDeleteItemServiceAction | QuoteResetFormAction | QuoteSetButtonDisableAction | QuoteSetCurrentPageAction | QuoteSetCustomerDataAction | QuoteSetDiscountUnitAction | QuoteSetErrorsAction | QuoteSetFormLoadingAction | QuoteSetQuotesAction | QuoteSetQuoteFormAction | QuoteSetIsQuoteApiSuccessAction | QuoteSetMaxPageLimitAction | QuoteSetSearchQueryAction | QuoteUpdateFieldAction | QuoteToggleLoadingAction | QuoteSetDrawerAction | QuoteSetCountAction | QuoteSetFormAction | QuoteSetAfterDiscountAction | QuoteSetTaxAction | QuoteSetFormToRenderAction | QuoteSetProductsListAction | QuoteSetCustomerAction | QuoteSetTaxesAction | QuoteSetCustomerFormAction | QuoteSetCompaniesListAction | QuoteSetModalAction;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.QUOTE_ACTION_TYPES = void 0;
|
|
4
|
-
var QUOTE_ACTION_TYPES;
|
|
5
|
-
(function (QUOTE_ACTION_TYPES) {
|
|
6
|
-
QUOTE_ACTION_TYPES["ADD_ITEM_PRODUCT"] = "ADD_ITEM_PRODUCT";
|
|
7
|
-
QUOTE_ACTION_TYPES["ADD_ITEM_SERVICE"] = "ADD_ITEM_SERVICE";
|
|
8
|
-
QUOTE_ACTION_TYPES["DELETE_ITEM_PRODUCT"] = "DELETE_ITEM_PRODUCT";
|
|
9
|
-
QUOTE_ACTION_TYPES["DELETE_ITEM_SERVICE"] = "DELETE_ITEM_SERVICE";
|
|
10
|
-
QUOTE_ACTION_TYPES["RESET_ERRORS"] = "RESET_ERRORS";
|
|
11
|
-
QUOTE_ACTION_TYPES["RESET_FORM"] = "RESET_FORM";
|
|
12
|
-
QUOTE_ACTION_TYPES["SET_AFTER_DISCOUNT"] = "SET_AFTER_DISCOUNT";
|
|
13
|
-
QUOTE_ACTION_TYPES["SET_BUTTON_DISABLE"] = "SET_BUTTON_DISABLE";
|
|
14
|
-
QUOTE_ACTION_TYPES["SET_COMPANIES_LIST"] = "SET_COMPANIES_LIST";
|
|
15
|
-
QUOTE_ACTION_TYPES["SET_COUNT"] = "SET_COUNT";
|
|
16
|
-
QUOTE_ACTION_TYPES["SET_CURRENT_PAGE"] = "SET_CURRENT_PAGE";
|
|
17
|
-
QUOTE_ACTION_TYPES["SET_CUSTOMER"] = "SET_CUSTOMER";
|
|
18
|
-
QUOTE_ACTION_TYPES["SET_CUSTOMER_DATA"] = "SET_CUSTOMER_DATA";
|
|
19
|
-
QUOTE_ACTION_TYPES["SET_CUSTOMER_FORM"] = "SET_CUSTOMER_FORM";
|
|
20
|
-
QUOTE_ACTION_TYPES["SET_DISABLE_SAVE_BUTTON"] = "SET_DISABLE_SAVE_BUTTON";
|
|
21
|
-
QUOTE_ACTION_TYPES["SET_DISCOUNT_UNIT"] = "SET_DISCOUNT_UNIT";
|
|
22
|
-
QUOTE_ACTION_TYPES["SET_DRAWER"] = "SET_DRAWER";
|
|
23
|
-
QUOTE_ACTION_TYPES["SET_ERRORS"] = "SET_ERRORS";
|
|
24
|
-
QUOTE_ACTION_TYPES["SET_FORM"] = "SET_FORM";
|
|
25
|
-
QUOTE_ACTION_TYPES["SET_FORM_LOADING"] = "SET_FORM_LOADING";
|
|
26
|
-
QUOTE_ACTION_TYPES["SET_FORM_TO_RENDER"] = "SET_FORM_TO_RENDER";
|
|
27
|
-
QUOTE_ACTION_TYPES["SET_INPUT_FIELD"] = "SET_INPUT_FIELD";
|
|
28
|
-
QUOTE_ACTION_TYPES["SET_QUOTES"] = "SET_QUOTES";
|
|
29
|
-
QUOTE_ACTION_TYPES["SET_QUOTE_FORM"] = "SET_QUOTE_FORM";
|
|
30
|
-
QUOTE_ACTION_TYPES["SET_IS_QUOTE_API_SUCCESS"] = "SET_IS_QUOTE_API_SUCCESS";
|
|
31
|
-
QUOTE_ACTION_TYPES["SET_MODAL"] = "SET_MODAL";
|
|
32
|
-
QUOTE_ACTION_TYPES["SET_PAGE_LIMIT"] = "SET_PAGE_LIMIT";
|
|
33
|
-
QUOTE_ACTION_TYPES["SET_PRODUCTS_LIST"] = "SET_PRODUCTS_LIST";
|
|
34
|
-
QUOTE_ACTION_TYPES["SET_SEARCH_QUERY"] = "SET_SEARCH_QUERY";
|
|
35
|
-
QUOTE_ACTION_TYPES["SET_SKELTON_LOADING"] = "SET_SKELTON_LOADING";
|
|
36
|
-
QUOTE_ACTION_TYPES["SET_TAX"] = "SET_TAX";
|
|
37
|
-
QUOTE_ACTION_TYPES["SET_TAXES"] = "SET_TAXES";
|
|
38
|
-
})(QUOTE_ACTION_TYPES || (exports.QUOTE_ACTION_TYPES = QUOTE_ACTION_TYPES = {}));
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Invoice Drawer Component
|
|
3
|
-
*
|
|
4
|
-
* A full-screen drawer component for creating/editing invoices with multi-section forms.
|
|
5
|
-
* Supports both company and customer invoices with dynamic form sections.
|
|
6
|
-
* Features RTL support and internationalization.
|
|
7
|
-
*/
|
|
8
|
-
import { FC } from "react";
|
|
9
|
-
interface Props {
|
|
10
|
-
isRTL: boolean;
|
|
11
|
-
}
|
|
12
|
-
export declare const Drawer: FC<Props>;
|
|
13
|
-
export {};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Invoice Drawer Component
|
|
4
|
-
*
|
|
5
|
-
* A full-screen drawer component for creating/editing invoices with multi-section forms.
|
|
6
|
-
* Supports both company and customer invoices with dynamic form sections.
|
|
7
|
-
* Features RTL support and internationalization.
|
|
8
|
-
*/
|
|
9
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.Drawer = void 0;
|
|
14
|
-
var react_1 = __importDefault(require("react"));
|
|
15
|
-
var lucide_react_1 = require("lucide-react");
|
|
16
|
-
var next_intl_1 = require("next-intl");
|
|
17
|
-
var button_1 = require("@appcorp/shadcn/components/ui/button");
|
|
18
|
-
var drawer_1 = require("@appcorp/shadcn/components/ui/drawer");
|
|
19
|
-
var context_1 = require("./context");
|
|
20
|
-
var form_1 = require("./form");
|
|
21
|
-
var types_1 = require("./types");
|
|
22
|
-
var Drawer = function (_a) {
|
|
23
|
-
var isRTL = _a.isRTL;
|
|
24
|
-
var t = (0, next_intl_1.useTranslations)("quote");
|
|
25
|
-
var _b = (0, context_1.useQuoteStateContext)(), closeDrawer = _b.closeDrawer, disableSaveButton = _b.disableSaveButton, drawer = _b.drawer, handleSubmit = _b.handleSubmit;
|
|
26
|
-
var isFormDrawer = drawer === types_1.QUOTE_DRAWER.QUOTE_COMPANY_FORM_DRAWER ||
|
|
27
|
-
drawer === types_1.QUOTE_DRAWER.QUOTE_CUSTOMER_FORM_DRAWER;
|
|
28
|
-
var drawerTitle = t("drawerTitleQuote");
|
|
29
|
-
// Ensure responsive variant is applied before the data- attribute so Tailwind parses it
|
|
30
|
-
var drawerWidth = "sm:data-[vaul-drawer-direction=right]:min-w-5xl";
|
|
31
|
-
var drawerDirection = isRTL ? "left" : "right";
|
|
32
|
-
return (react_1.default.createElement(drawer_1.Drawer, { open: !!drawer, onOpenChange: function (open) { return !open && closeDrawer(); }, direction: drawerDirection },
|
|
33
|
-
react_1.default.createElement(drawer_1.DrawerContent, { className: "h-full ".concat(drawerWidth, " ").concat(isRTL ? "rtl" : "ltr"), dir: isRTL ? "rtl" : "ltr" },
|
|
34
|
-
react_1.default.createElement(drawer_1.DrawerHeader, { className: "flex flex-row items-center justify-between border-b pb-4 ".concat(isRTL ? "flex-row-reverse" : "") },
|
|
35
|
-
react_1.default.createElement(drawer_1.DrawerTitle, { className: "text-xl font-semibold flex items-center ".concat(isRTL ? "flex-row-reverse gap-2" : "gap-2") }, drawerTitle),
|
|
36
|
-
react_1.default.createElement(drawer_1.DrawerClose, { asChild: true },
|
|
37
|
-
react_1.default.createElement(button_1.Button, { variant: "ghost", size: "icon", className: "h-8 w-8" },
|
|
38
|
-
react_1.default.createElement(lucide_react_1.X, { className: "h-4 w-4" }),
|
|
39
|
-
react_1.default.createElement("span", { className: "sr-only" }, t("drawerButtonClose"))))),
|
|
40
|
-
react_1.default.createElement("div", { className: "flex-1 overflow-y-auto px-4 py-6 ".concat(isRTL ? "text-right" : "text-left") }, isFormDrawer && react_1.default.createElement(form_1.QuoteForm, { isRTL: isRTL })),
|
|
41
|
-
react_1.default.createElement(drawer_1.DrawerFooter, { className: "border-t pt-4" },
|
|
42
|
-
react_1.default.createElement("div", { className: "flex gap-2 ".concat(isRTL ? "flex-row-reverse" : "") },
|
|
43
|
-
react_1.default.createElement(button_1.Button, { variant: "outline", onClick: closeDrawer, className: "flex-1" }, t("drawerButtonCancel")),
|
|
44
|
-
isFormDrawer && (react_1.default.createElement(button_1.Button, { onClick: handleSubmit, disabled: disableSaveButton, className: "flex-1" }, t("drawerButtonSave"))))))));
|
|
45
|
-
};
|
|
46
|
-
exports.Drawer = Drawer;
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
-
};
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.QuotePage = void 0;
|
|
8
|
-
var react_1 = __importDefault(require("react"));
|
|
9
|
-
var next_intl_1 = require("next-intl");
|
|
10
|
-
var util_functions_1 = require("@react-pakistan/util-functions");
|
|
11
|
-
var use_rtl_1 = require("@appcorp/stellar-solutions-modules/hooks/use-rtl");
|
|
12
|
-
var enhanced_table_1 = require("@appcorp/shadcn/components/enhanced-table");
|
|
13
|
-
var sonner_1 = require("@appcorp/shadcn/components/ui/sonner");
|
|
14
|
-
var constants_1 = require("./constants");
|
|
15
|
-
var context_1 = require("./context");
|
|
16
|
-
var drawer_1 = require("./drawer");
|
|
17
|
-
var QuotePage = function () {
|
|
18
|
-
var _a = (0, context_1.useQuoteStateContext)(), count = _a.count, currentPage = _a.currentPage, handleNextClick = _a.handleNextClick, handlePageLimit = _a.handlePageLimit, handlePreviousClick = _a.handlePreviousClick, headerActions = _a.headerActions, quotes = _a.quotes, listLoading = _a.listLoading, pageLimit = _a.pageLimit, rowActions = _a.rowActions, searchOnChange = _a.searchOnChange, searchQuery = _a.searchQuery;
|
|
19
|
-
var isRTL = (0, use_rtl_1.useRTL)();
|
|
20
|
-
var t = (0, next_intl_1.useTranslations)("quote");
|
|
21
|
-
var tableHeadItems = [
|
|
22
|
-
{
|
|
23
|
-
label: t("tableColumnHeaderId"),
|
|
24
|
-
width: "5%",
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
label: t("tableColumnHeaderName"),
|
|
28
|
-
width: "10%",
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
label: t("tableColumnHeaderIssueExpiryDate"),
|
|
32
|
-
width: "10%",
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
label: t("tableColumnHeaderRef"),
|
|
36
|
-
width: "5%",
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
label: t("tableColumnHeaderSubTotal"),
|
|
40
|
-
width: "5%",
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
label: t("tableColumnHeaderTaxValue"),
|
|
44
|
-
width: "5%",
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
label: t("tableColumnHeaderDiscountPrice"),
|
|
48
|
-
width: "5%",
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
label: t("tableColumnHeaderTotalPrice"),
|
|
52
|
-
width: "5%",
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
label: t("tableColumnHeaderCategory"),
|
|
56
|
-
width: "5%",
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
label: t("tableColumnHeaderActions"),
|
|
60
|
-
width: "5%",
|
|
61
|
-
},
|
|
62
|
-
];
|
|
63
|
-
var totalPages = (0, util_functions_1.calculatePages)(count, pageLimit);
|
|
64
|
-
return (react_1.default.createElement("div", { className: "space-y-4 ".concat(isRTL ? "rtl" : "ltr"), dir: isRTL ? "rtl" : "ltr" },
|
|
65
|
-
react_1.default.createElement(enhanced_table_1.EnhancedTable, { currentPage: Number(currentPage), handleNextOnClick: handleNextClick, handleOnSelect: handlePageLimit, handlePreviousOnClick: handlePreviousClick, handleSearchInput: searchOnChange, headerActions: headerActions, isNextDisabled: (0, util_functions_1.isNextButtonDisabled)(currentPage, totalPages), isPreviousDisabled: (0, util_functions_1.isPreviousButtonDisabled)(currentPage), listOptions: (0, util_functions_1.getAvailablePageLimits)(count), loading: listLoading, nodeSelectKey: "pageLimit", pageLimit: pageLimit, rowActions: rowActions, searchDisabled: false, searchEnabled: true, searchId: "quote-search", searchPlaceholder: t("tableSearchPlaceholder"), searchValue: searchQuery, tableBodyCols: constants_1.tableBodyCols, tableBodyRows: quotes, tableDescription: t("tableDescription"), tableHeadItems: tableHeadItems, tableHeading: t("tableTitle"), totalPages: totalPages }),
|
|
66
|
-
react_1.default.createElement(drawer_1.Drawer, { isRTL: isRTL }),
|
|
67
|
-
react_1.default.createElement(sonner_1.Toaster, null)));
|
|
68
|
-
};
|
|
69
|
-
exports.QuotePage = QuotePage;
|
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
14
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
15
|
-
if (ar || !(i in from)) {
|
|
16
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
17
|
-
ar[i] = from[i];
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
21
|
-
};
|
|
22
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
-
exports.quoteReducer = exports.initialQuoteState = void 0;
|
|
24
|
-
var actions_1 = require("./actions");
|
|
25
|
-
var types_1 = require("./types");
|
|
26
|
-
var types_2 = require("./types");
|
|
27
|
-
var date_fns_1 = require("date-fns");
|
|
28
|
-
var pageLimit = Number(process.env.NEXT_PUBLIC_PAGE_LIMIT) || 10;
|
|
29
|
-
exports.initialQuoteState = {
|
|
30
|
-
afterDiscount: "0",
|
|
31
|
-
category: types_2.QUOTE_INVOICE_CATEGORY.QUOTE,
|
|
32
|
-
companyId: "",
|
|
33
|
-
companyQuery: "",
|
|
34
|
-
count: 0,
|
|
35
|
-
countryQuery: "",
|
|
36
|
-
currency: "",
|
|
37
|
-
services: [],
|
|
38
|
-
customer: {
|
|
39
|
-
address: "",
|
|
40
|
-
city: "",
|
|
41
|
-
country: "",
|
|
42
|
-
createdAt: "",
|
|
43
|
-
email: "",
|
|
44
|
-
firstName: "",
|
|
45
|
-
id: "",
|
|
46
|
-
lastName: "",
|
|
47
|
-
phone: "",
|
|
48
|
-
updatedAt: "",
|
|
49
|
-
quotesInvoices: [],
|
|
50
|
-
},
|
|
51
|
-
contactsList: [],
|
|
52
|
-
currentPage: 1,
|
|
53
|
-
customerId: "",
|
|
54
|
-
date: new Date().toISOString(),
|
|
55
|
-
disableSaveButton: false,
|
|
56
|
-
discount: "0",
|
|
57
|
-
discountUnit: types_1.DISCOUNT_UNIT.FIXED_VALUE,
|
|
58
|
-
drawer: null,
|
|
59
|
-
errors: {},
|
|
60
|
-
expiryDate: (0, date_fns_1.addDays)(new Date(), 7).toISOString(),
|
|
61
|
-
id: "",
|
|
62
|
-
invoiceStatus: types_2.INVOICE_STATUS.UNPAID,
|
|
63
|
-
quotes: [],
|
|
64
|
-
loading: true,
|
|
65
|
-
getProducts: [],
|
|
66
|
-
modal: null,
|
|
67
|
-
mode: "Create",
|
|
68
|
-
netTotal: "",
|
|
69
|
-
note: "",
|
|
70
|
-
pageLimit: pageLimit,
|
|
71
|
-
payments: [],
|
|
72
|
-
companiesList: [],
|
|
73
|
-
productQuery: "",
|
|
74
|
-
quoteStatus: types_2.QUOTE_STATUS.DRAFT,
|
|
75
|
-
ref: "",
|
|
76
|
-
searchQuery: "",
|
|
77
|
-
subTotal: "",
|
|
78
|
-
tax: "",
|
|
79
|
-
taxRate: "",
|
|
80
|
-
taxQuery: "",
|
|
81
|
-
taxes: [],
|
|
82
|
-
total: "",
|
|
83
|
-
products: [],
|
|
84
|
-
company: {
|
|
85
|
-
name: "",
|
|
86
|
-
country: "",
|
|
87
|
-
createdAt: "",
|
|
88
|
-
updatedAt: "",
|
|
89
|
-
id: "",
|
|
90
|
-
phone: "",
|
|
91
|
-
email: "",
|
|
92
|
-
website: "",
|
|
93
|
-
contacts: [],
|
|
94
|
-
quotesInvoices: [],
|
|
95
|
-
},
|
|
96
|
-
servicesList: [
|
|
97
|
-
{
|
|
98
|
-
description: "",
|
|
99
|
-
mode: "Create",
|
|
100
|
-
name: "",
|
|
101
|
-
price: "",
|
|
102
|
-
quantity: "1",
|
|
103
|
-
rowTotal: "",
|
|
104
|
-
},
|
|
105
|
-
],
|
|
106
|
-
productsList: [
|
|
107
|
-
{
|
|
108
|
-
id: "",
|
|
109
|
-
mode: "Create",
|
|
110
|
-
price: "",
|
|
111
|
-
quantity: "1",
|
|
112
|
-
rowTotal: "",
|
|
113
|
-
},
|
|
114
|
-
],
|
|
115
|
-
};
|
|
116
|
-
var quoteReducer = function (state, action) {
|
|
117
|
-
var _a, _b;
|
|
118
|
-
switch (action.type) {
|
|
119
|
-
case actions_1.QUOTE_ACTION_TYPES.SET_DRAWER:
|
|
120
|
-
return __assign(__assign({}, state), { drawer: action.payload.drawer });
|
|
121
|
-
case actions_1.QUOTE_ACTION_TYPES.RESET_ERRORS:
|
|
122
|
-
return __assign(__assign({}, state), { errors: {} });
|
|
123
|
-
case actions_1.QUOTE_ACTION_TYPES.RESET_FORM:
|
|
124
|
-
return __assign(__assign(__assign(__assign({}, state), (state.customer && {
|
|
125
|
-
customer: __assign({}, exports.initialQuoteState.customer),
|
|
126
|
-
})), (state.company && {
|
|
127
|
-
company: __assign({}, exports.initialQuoteState.company),
|
|
128
|
-
})), { productsList: __spreadArray([], exports.initialQuoteState.productsList, true), servicesList: __spreadArray([], exports.initialQuoteState.servicesList, true), subTotal: exports.initialQuoteState.subTotal, discount: exports.initialQuoteState.discount, discountUnit: exports.initialQuoteState.discountUnit, afterDiscount: exports.initialQuoteState.afterDiscount, tax: exports.initialQuoteState.tax, total: exports.initialQuoteState.total, category: exports.initialQuoteState.category, companyId: exports.initialQuoteState.companyId, companyQuery: exports.initialQuoteState.companyQuery, countryQuery: exports.initialQuoteState.countryQuery, currency: exports.initialQuoteState.currency, contactsList: exports.initialQuoteState.contactsList, customerId: exports.initialQuoteState.customerId, date: exports.initialQuoteState.date, disableSaveButton: exports.initialQuoteState.disableSaveButton, expiryDate: exports.initialQuoteState.expiryDate, id: exports.initialQuoteState.id, invoiceStatus: exports.initialQuoteState.invoiceStatus, loading: exports.initialQuoteState.loading, getProducts: exports.initialQuoteState.getProducts, mode: exports.initialQuoteState.mode, netTotal: exports.initialQuoteState.netTotal, note: exports.initialQuoteState.note, payments: exports.initialQuoteState.payments, companiesList: exports.initialQuoteState.companiesList, productQuery: exports.initialQuoteState.productQuery, taxRate: exports.initialQuoteState.taxRate, taxQuery: exports.initialQuoteState.taxQuery, taxes: exports.initialQuoteState.taxes });
|
|
129
|
-
case actions_1.QUOTE_ACTION_TYPES.SET_DISABLE_SAVE_BUTTON:
|
|
130
|
-
return __assign(__assign({}, state), { disableSaveButton: action.payload.disableSaveButton });
|
|
131
|
-
case actions_1.QUOTE_ACTION_TYPES.SET_CURRENT_PAGE:
|
|
132
|
-
return __assign(__assign({}, state), { currentPage: action.payload.currentPage });
|
|
133
|
-
case actions_1.QUOTE_ACTION_TYPES.SET_COUNT:
|
|
134
|
-
return __assign(__assign({}, state), { count: action.payload.count });
|
|
135
|
-
case actions_1.QUOTE_ACTION_TYPES.SET_ERRORS:
|
|
136
|
-
return __assign(__assign({}, state), { disableSaveButton: false, errors: __assign({}, action.payload.errors) });
|
|
137
|
-
case actions_1.QUOTE_ACTION_TYPES.SET_INPUT_FIELD:
|
|
138
|
-
return __assign(__assign({}, state), (_a = {}, _a[action.payload.key] = action.payload.value, _a));
|
|
139
|
-
case actions_1.QUOTE_ACTION_TYPES.SET_PAGE_LIMIT:
|
|
140
|
-
return __assign(__assign({}, state), { pageLimit: action.payload.pageLimit });
|
|
141
|
-
case actions_1.QUOTE_ACTION_TYPES.SET_QUOTES:
|
|
142
|
-
return __assign(__assign({}, state), { quotes: __spreadArray([], action.payload.quotes, true) });
|
|
143
|
-
case actions_1.QUOTE_ACTION_TYPES.SET_SEARCH_QUERY:
|
|
144
|
-
return __assign(__assign({}, state), { searchQuery: action.payload.searchQuery });
|
|
145
|
-
case actions_1.QUOTE_ACTION_TYPES.SET_FORM:
|
|
146
|
-
return __assign(__assign({}, state), action.payload.form);
|
|
147
|
-
case actions_1.QUOTE_ACTION_TYPES.SET_DRAWER:
|
|
148
|
-
return __assign(__assign({}, state), { drawer: action.payload.drawer });
|
|
149
|
-
case actions_1.QUOTE_ACTION_TYPES.SET_MODAL:
|
|
150
|
-
return __assign(__assign({}, state), { modal: action.payload.modal });
|
|
151
|
-
case actions_1.QUOTE_ACTION_TYPES.SET_DISCOUNT_UNIT:
|
|
152
|
-
return __assign(__assign({}, state), { discountUnit: action.payload.discountUnit });
|
|
153
|
-
case actions_1.QUOTE_ACTION_TYPES.SET_AFTER_DISCOUNT:
|
|
154
|
-
return __assign(__assign({}, state), { afterDiscount: action.payload.afterDiscount });
|
|
155
|
-
case actions_1.QUOTE_ACTION_TYPES.SET_TAX:
|
|
156
|
-
return __assign(__assign({}, state), { tax: action.payload.tax });
|
|
157
|
-
case actions_1.QUOTE_ACTION_TYPES.ADD_ITEM_SERVICE:
|
|
158
|
-
return __assign(__assign({}, state), { servicesList: __spreadArray([], action.payload.servicesList, true) });
|
|
159
|
-
case actions_1.QUOTE_ACTION_TYPES.ADD_ITEM_PRODUCT:
|
|
160
|
-
return __assign(__assign({}, state), { productsList: __spreadArray([], action.payload.productsList, true) });
|
|
161
|
-
case actions_1.QUOTE_ACTION_TYPES.DELETE_ITEM_SERVICE:
|
|
162
|
-
return __assign(__assign({}, state), { servicesList: __spreadArray([], action.payload.servicesList, true) });
|
|
163
|
-
case actions_1.QUOTE_ACTION_TYPES.DELETE_ITEM_PRODUCT:
|
|
164
|
-
return __assign(__assign({}, state), { productsList: __spreadArray([], action.payload.productsList, true) });
|
|
165
|
-
case actions_1.QUOTE_ACTION_TYPES.SET_PRODUCTS_LIST:
|
|
166
|
-
return __assign(__assign({}, state), { getProducts: __spreadArray([], action.payload.list, true) });
|
|
167
|
-
case actions_1.QUOTE_ACTION_TYPES.SET_CUSTOMER:
|
|
168
|
-
return __assign(__assign({}, state), { customerId: action.payload.customerId, customer: __assign(__assign({}, state.customer), action.payload.customer) });
|
|
169
|
-
case actions_1.QUOTE_ACTION_TYPES.SET_CUSTOMER_FORM:
|
|
170
|
-
return __assign(__assign({}, state), (state.customer && {
|
|
171
|
-
customer: __assign(__assign({}, state.customer), (_b = {}, _b[action.payload.key] = action.payload.value, _b)),
|
|
172
|
-
}));
|
|
173
|
-
case actions_1.QUOTE_ACTION_TYPES.SET_TAXES:
|
|
174
|
-
return __assign(__assign({}, state), { taxes: __spreadArray([], action.payload.taxes, true) });
|
|
175
|
-
case actions_1.QUOTE_ACTION_TYPES.SET_COMPANIES_LIST:
|
|
176
|
-
return __assign(__assign({}, state), { companiesList: __spreadArray([], action.payload.companiesList, true) });
|
|
177
|
-
default:
|
|
178
|
-
return state;
|
|
179
|
-
}
|
|
180
|
-
};
|
|
181
|
-
exports.quoteReducer = quoteReducer;
|
|
File without changes
|