@appcorp/stellar-solutions-invoice-module 0.1.60 → 0.1.61
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.js +4 -4
- package/base-modules/invoice/company-form-section.js +8 -8
- package/base-modules/invoice/context.js +77 -59
- package/base-modules/invoice/customer-form-section.js +9 -9
- package/base-modules/invoice/drawer.js +1 -1
- package/base-modules/invoice/invoice.js +2 -2
- package/base-modules/invoice/pricing-form-section.js +13 -13
- package/base-modules/invoice/products-form-section.js +11 -11
- package/base-modules/invoice/services-form-section.js +13 -13
- package/base-modules/payment/context.js +0 -1
- package/base-modules/quote/add-service-product-section.js +4 -4
- package/base-modules/quote/company-form-section.js +8 -8
- package/base-modules/quote/context.js +81 -61
- package/base-modules/quote/customer-form-section.js +9 -9
- package/base-modules/quote/drawer.js +2 -2
- package/base-modules/quote/pricing-form-section.js +13 -13
- package/base-modules/quote/products-form-section.js +12 -12
- package/base-modules/quote/quote.js +3 -2
- package/base-modules/quote/services-form-section.js +14 -14
- package/package.json +4 -4
|
@@ -18,7 +18,7 @@ var combobox_1 = require("@appcorp/shadcn/components/combobox");
|
|
|
18
18
|
var input_1 = require("@appcorp/shadcn/components/input");
|
|
19
19
|
var context_1 = require("./context");
|
|
20
20
|
var ProductsSection = function () {
|
|
21
|
-
var t = (0, next_intl_1.useTranslations)("
|
|
21
|
+
var t = (0, next_intl_1.useTranslations)("quote");
|
|
22
22
|
var _a = (0, context_1.useQuoteStateContext)(), errors = _a.errors, getProducts = _a.getProducts, handleDeleteProductRow = _a.handleDeleteProductRow, handleItemChangeProducts = _a.handleItemChangeProducts, productsList = _a.productsList;
|
|
23
23
|
if (!productsList || productsList.length === 0) {
|
|
24
24
|
return null;
|
|
@@ -29,43 +29,43 @@ var ProductsSection = function () {
|
|
|
29
29
|
// This is a placeholder to satisfy CompanyCombobox props
|
|
30
30
|
};
|
|
31
31
|
return (react_1.default.createElement("div", { className: "flex flex-col gap-4" },
|
|
32
|
-
react_1.default.createElement("h3", { className: "text-lg font-semibold border-b pb-2" }, t("
|
|
32
|
+
react_1.default.createElement("h3", { className: "text-lg font-semibold border-b pb-2" }, t("productFormSectionTitle")),
|
|
33
33
|
react_1.default.createElement("div", { className: "flex flex-col gap-4" }, productsList.map(function (row, index) { return (react_1.default.createElement("div", { key: index, className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-[2fr_0.75fr_0.75fr_0.75fr_auto] gap-4 items-start p-4 border rounded-lg" },
|
|
34
34
|
react_1.default.createElement("div", { className: "space-y-2" },
|
|
35
|
-
react_1.default.createElement(combobox_1.CompanyCombobox, { companies: getProducts || [], error: errors["productsList-".concat(index, "-id")], id: "product-id-".concat(index), label: t("
|
|
35
|
+
react_1.default.createElement(combobox_1.CompanyCombobox, { companies: getProducts || [], error: errors["productsList-".concat(index, "-id")], id: "product-id-".concat(index), label: t("productFormLabelProductName"), onSearchChange: handleProductSearch, onValueChange: function (selectedProductId) {
|
|
36
36
|
return handleItemChangeProducts({
|
|
37
37
|
index: index,
|
|
38
38
|
key: "id",
|
|
39
39
|
value: selectedProductId,
|
|
40
40
|
});
|
|
41
|
-
}, placeholder: t("
|
|
41
|
+
}, placeholder: t("productFormPlaceholderProductName"), required: true, value: productsList[index].id || "", info: t("productFormInfoProductName") })),
|
|
42
42
|
react_1.default.createElement("div", { className: "space-y-2" },
|
|
43
|
-
react_1.default.createElement(input_1.Input, { error: errors["productsList-".concat(index, "-quantity")], id: "product-quantity-".concat(index), label: t("
|
|
43
|
+
react_1.default.createElement(input_1.Input, { error: errors["productsList-".concat(index, "-quantity")], id: "product-quantity-".concat(index), label: t("productFormLabelQuantity"), onChange: function (e) {
|
|
44
44
|
return handleItemChangeProducts({
|
|
45
45
|
index: index,
|
|
46
46
|
key: "quantity",
|
|
47
47
|
value: e.target.value,
|
|
48
48
|
});
|
|
49
|
-
}, placeholder: "
|
|
49
|
+
}, placeholder: t("productFormPlaceholderQuantity"), required: true, type: "number", value: String(productsList[index].quantity || ""), info: t("productFormInfoQuantity") })),
|
|
50
50
|
react_1.default.createElement("div", { className: "space-y-2" },
|
|
51
|
-
react_1.default.createElement(input_1.Input, { error: errors["productsList-".concat(index, "-price")], id: "product-price-".concat(index), label: t("
|
|
51
|
+
react_1.default.createElement(input_1.Input, { error: errors["productsList-".concat(index, "-price")], id: "product-price-".concat(index), label: t("productFormLabelPrice"), onChange: function (e) {
|
|
52
52
|
return handleItemChangeProducts({
|
|
53
53
|
index: index,
|
|
54
54
|
key: "price",
|
|
55
55
|
value: e.target.value,
|
|
56
56
|
});
|
|
57
|
-
}, placeholder: "
|
|
57
|
+
}, placeholder: t("productFormPlaceholderPrice"), required: true, type: "number", value: productsList[index].price || "", info: t("productFormInfoPrice") })),
|
|
58
58
|
react_1.default.createElement("div", { className: "space-y-2" },
|
|
59
|
-
react_1.default.createElement(input_1.Input, { error: errors["productsList-".concat(index, "-rowTotal")], id: "product-rowTotal-".concat(index), label: t("
|
|
59
|
+
react_1.default.createElement(input_1.Input, { error: errors["productsList-".concat(index, "-rowTotal")], id: "product-rowTotal-".concat(index), label: t("productFormLabelServiceRowTotal"), onChange: function (e) {
|
|
60
60
|
return handleItemChangeProducts({
|
|
61
61
|
index: index,
|
|
62
62
|
key: "rowTotal",
|
|
63
63
|
value: e.target.value,
|
|
64
64
|
});
|
|
65
|
-
}, placeholder: "
|
|
66
|
-
react_1.default.createElement("div", { className: "flex items-
|
|
65
|
+
}, placeholder: t("productFormPlaceholderServiceRowTotal"), readOnly: true, required: true, type: "number", value: productsList[index].rowTotal || "", info: t("productFormInfoServiceRowTotal") })),
|
|
66
|
+
react_1.default.createElement("div", { className: "flex items-center h-full" },
|
|
67
67
|
react_1.default.createElement(button_1.Button, { onClick: function () { return handleDeleteProductRow(index); }, size: "icon", type: "button", variant: "ghost" },
|
|
68
68
|
react_1.default.createElement(lucide_react_1.Trash2, { className: "h-4 w-4" }),
|
|
69
|
-
react_1.default.createElement("span", { className: "sr-only" }, t("
|
|
69
|
+
react_1.default.createElement("span", { className: "sr-only" }, t("productFormButtonDeleteService")))))); }))));
|
|
70
70
|
};
|
|
71
71
|
exports.ProductsSection = ProductsSection;
|
|
@@ -17,7 +17,7 @@ var drawer_1 = require("./drawer");
|
|
|
17
17
|
var QuotePage = function () {
|
|
18
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
19
|
var isRTL = (0, use_rtl_1.useRTL)();
|
|
20
|
-
var t = (0, next_intl_1.useTranslations)("
|
|
20
|
+
var t = (0, next_intl_1.useTranslations)("quote");
|
|
21
21
|
var tableHeadItems = [
|
|
22
22
|
{
|
|
23
23
|
label: t("tableColumnHeaderId"),
|
|
@@ -61,8 +61,9 @@ var QuotePage = function () {
|
|
|
61
61
|
},
|
|
62
62
|
];
|
|
63
63
|
var totalPages = (0, util_functions_1.calculatePages)(count, pageLimit);
|
|
64
|
+
console.log("-0>>>", (0, util_functions_1.getAvailablePageLimits)(count));
|
|
64
65
|
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: "
|
|
66
|
+
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
67
|
react_1.default.createElement(drawer_1.Drawer, { isRTL: isRTL }),
|
|
67
68
|
react_1.default.createElement(sonner_1.Toaster, null)));
|
|
68
69
|
};
|
|
@@ -17,57 +17,57 @@ var button_1 = require("@appcorp/shadcn/components/button");
|
|
|
17
17
|
var input_1 = require("@appcorp/shadcn/components/input");
|
|
18
18
|
var context_1 = require("./context");
|
|
19
19
|
var ServicesSection = function () {
|
|
20
|
-
var t = (0, next_intl_1.useTranslations)("
|
|
20
|
+
var t = (0, next_intl_1.useTranslations)("quote");
|
|
21
21
|
var _a = (0, context_1.useQuoteStateContext)(), errors = _a.errors, handleDeleteServiceRow = _a.handleDeleteServiceRow, handleItemChangeServices = _a.handleItemChangeServices, servicesList = _a.servicesList;
|
|
22
22
|
if (!servicesList || servicesList.length === 0) {
|
|
23
23
|
return null;
|
|
24
24
|
}
|
|
25
25
|
return (react_1.default.createElement("div", { className: "flex flex-col gap-4" },
|
|
26
|
-
react_1.default.createElement("h3", { className: "text-lg font-semibold border-b pb-2" }, t("
|
|
26
|
+
react_1.default.createElement("h3", { className: "text-lg font-semibold border-b pb-2" }, t("serviceFormSectionTitle")),
|
|
27
27
|
react_1.default.createElement("div", { className: "flex flex-col gap-4" }, servicesList.map(function (row, index) { return (react_1.default.createElement("div", { key: index, className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-[1fr_1fr_0.75fr_0.75fr_0.75fr_auto] gap-4 items-end p-4 border rounded-lg" },
|
|
28
28
|
react_1.default.createElement("div", { className: "space-y-2" },
|
|
29
|
-
react_1.default.createElement(input_1.Input, { error: errors["servicesList-".concat(index, "-name")], id: "service-name-".concat(index), label: t("
|
|
29
|
+
react_1.default.createElement(input_1.Input, { error: errors["servicesList-".concat(index, "-name")], id: "service-name-".concat(index), label: t("serviceFormLabelServiceName"), onChange: function (e) {
|
|
30
30
|
return handleItemChangeServices({
|
|
31
31
|
index: index,
|
|
32
32
|
key: "name",
|
|
33
33
|
value: e.target.value,
|
|
34
34
|
});
|
|
35
|
-
}, placeholder: t("
|
|
35
|
+
}, placeholder: t("serviceFormPlaceholderServiceName"), required: true, type: "text", value: servicesList[index].name || "", info: t("serviceFormInfoServiceName") })),
|
|
36
36
|
react_1.default.createElement("div", { className: "space-y-2" },
|
|
37
|
-
react_1.default.createElement(input_1.Input, { error: errors["servicesList-".concat(index, "-description")], id: "service-description-".concat(index), label: t("
|
|
37
|
+
react_1.default.createElement(input_1.Input, { error: errors["servicesList-".concat(index, "-description")], id: "service-description-".concat(index), label: t("serviceFormLabelServiceDescription"), onChange: function (e) {
|
|
38
38
|
return handleItemChangeServices({
|
|
39
39
|
index: index,
|
|
40
40
|
key: "description",
|
|
41
41
|
value: e.target.value,
|
|
42
42
|
});
|
|
43
|
-
}, placeholder: t("
|
|
43
|
+
}, placeholder: t("serviceFormPlaceholderServiceDescription"), type: "text", value: servicesList[index].description || "", info: t("serviceFormInfoServiceDescription") })),
|
|
44
44
|
react_1.default.createElement("div", { className: "space-y-2" },
|
|
45
|
-
react_1.default.createElement(input_1.Input, { error: errors["servicesList-".concat(index, "-quantity")], id: "service-quantity-".concat(index), label: t("
|
|
45
|
+
react_1.default.createElement(input_1.Input, { error: errors["servicesList-".concat(index, "-quantity")], id: "service-quantity-".concat(index), label: t("serviceFormLabelServiceQuantity"), onChange: function (e) {
|
|
46
46
|
return handleItemChangeServices({
|
|
47
47
|
index: index,
|
|
48
48
|
key: "quantity",
|
|
49
49
|
value: e.target.value,
|
|
50
50
|
});
|
|
51
|
-
}, placeholder: "
|
|
51
|
+
}, placeholder: t("serviceFormPlaceholderServiceQuantity"), required: true, type: "number", value: servicesList[index].quantity || "", info: t("serviceFormInfoServiceQuantity") })),
|
|
52
52
|
react_1.default.createElement("div", { className: "space-y-2" },
|
|
53
|
-
react_1.default.createElement(input_1.Input, { error: errors["servicesList-".concat(index, "-price")], id: "service-price-".concat(index), label: t("
|
|
53
|
+
react_1.default.createElement(input_1.Input, { error: errors["servicesList-".concat(index, "-price")], id: "service-price-".concat(index), label: t("serviceFormLabelServicePrice"), onChange: function (e) {
|
|
54
54
|
return handleItemChangeServices({
|
|
55
55
|
index: index,
|
|
56
56
|
key: "price",
|
|
57
57
|
value: e.target.value,
|
|
58
58
|
});
|
|
59
|
-
}, placeholder: "
|
|
59
|
+
}, placeholder: t("serviceFormPlaceholderServicePrice"), required: true, type: "number", value: servicesList[index].price || "", info: t("serviceFormInfoServicePrice") })),
|
|
60
60
|
react_1.default.createElement("div", { className: "space-y-2" },
|
|
61
|
-
react_1.default.createElement(input_1.Input, { error: errors["servicesList-".concat(index, "-rowTotal")], id: "service-rowTotal-".concat(index), label: t("
|
|
61
|
+
react_1.default.createElement(input_1.Input, { error: errors["servicesList-".concat(index, "-rowTotal")], id: "service-rowTotal-".concat(index), label: t("serviceFormLabelServiceRowTotal"), onChange: function (e) {
|
|
62
62
|
return handleItemChangeServices({
|
|
63
63
|
index: index,
|
|
64
64
|
key: "rowTotal",
|
|
65
65
|
value: e.target.value,
|
|
66
66
|
});
|
|
67
|
-
}, placeholder: "
|
|
68
|
-
react_1.default.createElement("div", { className: "flex items-
|
|
67
|
+
}, placeholder: t("serviceFormPlaceholderServiceRowTotal"), readOnly: true, required: true, type: "number", value: servicesList[index].rowTotal || "", info: t("serviceFormInfoServiceRowTotal") })),
|
|
68
|
+
react_1.default.createElement("div", { className: "flex items-center h-full" },
|
|
69
69
|
react_1.default.createElement(button_1.Button, { onClick: function () { return handleDeleteServiceRow(index); }, size: "icon", type: "button", variant: "ghost" },
|
|
70
70
|
react_1.default.createElement(lucide_react_1.Trash2, { className: "h-4 w-4" }),
|
|
71
|
-
react_1.default.createElement("span", { className: "sr-only" }, t("
|
|
71
|
+
react_1.default.createElement("span", { className: "sr-only" }, t("serviceFormButtonDeleteService")))))); }))));
|
|
72
72
|
};
|
|
73
73
|
exports.ServicesSection = ServicesSection;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appcorp/stellar-solutions-invoice-module",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.61",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"automate": "./automate.sh",
|
|
6
6
|
"build": "yarn clean && yarn build:ts && cp package.json lib && cp README.md lib && cp yarn.lock lib",
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@appcorp/app-corp-vista": "^0.3.48",
|
|
23
|
-
"@appcorp/shadcn": "^1.0.
|
|
23
|
+
"@appcorp/shadcn": "^1.0.36",
|
|
24
24
|
"@appcorp/stellar-solutions-company-module": "^0.1.40",
|
|
25
|
-
"@appcorp/stellar-solutions-modules": "^0.1.
|
|
25
|
+
"@appcorp/stellar-solutions-modules": "^0.1.63",
|
|
26
26
|
"@appcorp/stellar-solutions-product-module": "^0.2.18",
|
|
27
27
|
"@eslint/eslintrc": "^3",
|
|
28
28
|
"@headlessui/react": "^2",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@radix-ui/react-separator": "^1",
|
|
36
36
|
"@radix-ui/react-slot": "^1",
|
|
37
37
|
"@radix-ui/react-switch": "^1",
|
|
38
|
-
"@react-pakistan/util-functions": "^1.24.
|
|
38
|
+
"@react-pakistan/util-functions": "^1.24.81",
|
|
39
39
|
"@supabase/supabase-js": "^2",
|
|
40
40
|
"@tailwindcss/forms": "^0",
|
|
41
41
|
"@tailwindcss/postcss": "^4",
|