@appcorp/stellar-solutions-invoice-module 0.1.30 → 0.1.32
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.
|
@@ -228,7 +228,7 @@ exports.staticCustomerSection = (_b = {},
|
|
|
228
228
|
exports.staticPricingSection = (_c = {},
|
|
229
229
|
_c[form_schema_1.VISTA_FORM_ELEMENTS.TEXT_INPUT_V1] = [
|
|
230
230
|
{
|
|
231
|
-
disabled:
|
|
231
|
+
disabled: false,
|
|
232
232
|
enabled: true,
|
|
233
233
|
error: '',
|
|
234
234
|
handleOnChange: function () { return void 0; },
|
|
@@ -236,6 +236,7 @@ exports.staticPricingSection = (_c = {},
|
|
|
236
236
|
label: 'Sub Total',
|
|
237
237
|
order: 1,
|
|
238
238
|
placeholder: '0.00',
|
|
239
|
+
readOnly: true,
|
|
239
240
|
required: false,
|
|
240
241
|
type: 'text',
|
|
241
242
|
value: '',
|
|
@@ -148,6 +148,7 @@ var useInvoiceState = function () {
|
|
|
148
148
|
expiryDate: state.expiryDate,
|
|
149
149
|
id: state.id,
|
|
150
150
|
invoiceStatus: state.invoiceStatus,
|
|
151
|
+
mode: state.mode,
|
|
151
152
|
note: state.note,
|
|
152
153
|
products: state.products,
|
|
153
154
|
quoteStatus: state.quoteStatus,
|
|
@@ -156,7 +157,6 @@ var useInvoiceState = function () {
|
|
|
156
157
|
subTotal: state.subTotal,
|
|
157
158
|
taxRate: state.taxRate,
|
|
158
159
|
total: state.total,
|
|
159
|
-
mode: state.mode,
|
|
160
160
|
}); }, [state]);
|
|
161
161
|
var updateCallback = function (_a) {
|
|
162
162
|
var data = _a.data, error = _a.error;
|
|
@@ -185,6 +185,7 @@ var useInvoiceState = function () {
|
|
|
185
185
|
id: state.id,
|
|
186
186
|
};
|
|
187
187
|
var byIdCallback = function (_a) {
|
|
188
|
+
var _b, _c;
|
|
188
189
|
var data = _a.data, error = _a.error;
|
|
189
190
|
if (error) {
|
|
190
191
|
(0, generate_toast_1.generateToast)({
|
|
@@ -193,8 +194,25 @@ var useInvoiceState = function () {
|
|
|
193
194
|
});
|
|
194
195
|
}
|
|
195
196
|
if (data) {
|
|
196
|
-
var updatedServices = __spreadArray([], data.services, true).map(function (item) {
|
|
197
|
-
|
|
197
|
+
var updatedServices = __spreadArray([], data.services, true).map(function (item) {
|
|
198
|
+
delete item.quoteInvoiceId;
|
|
199
|
+
return (__assign(__assign({}, item), { rowTotal: Number(item.quantity) * Number(item.price) }));
|
|
200
|
+
});
|
|
201
|
+
var updatedProducts = __spreadArray([], data.products, true).map(function (item) { return (__assign({}, item)); });
|
|
202
|
+
var updatedData = __assign(__assign({}, data), { mode: 'Edit', companyId: data.company.id, services: __spreadArray([], updatedServices, true), products: __spreadArray([], updatedProducts, true) });
|
|
203
|
+
console.log('_>>', updatedData);
|
|
204
|
+
if ((_b = updatedData === null || updatedData === void 0 ? void 0 : updatedData.company) === null || _b === void 0 ? void 0 : _b.name) {
|
|
205
|
+
dispatch({
|
|
206
|
+
type: actions_1.INVOICE_ACTION_TYPES.SET_FORM_TO_RENDER,
|
|
207
|
+
payload: { formToRender: 'company' },
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
if ((_c = updatedData === null || updatedData === void 0 ? void 0 : updatedData.customer) === null || _c === void 0 ? void 0 : _c.name) {
|
|
211
|
+
dispatch({
|
|
212
|
+
type: actions_1.INVOICE_ACTION_TYPES.SET_FORM_TO_RENDER,
|
|
213
|
+
payload: { formToRender: 'customer' },
|
|
214
|
+
});
|
|
215
|
+
}
|
|
198
216
|
dispatch({
|
|
199
217
|
type: actions_1.INVOICE_ACTION_TYPES.SET_FORM,
|
|
200
218
|
payload: { form: updatedData },
|
|
@@ -291,7 +309,7 @@ var useInvoiceState = function () {
|
|
|
291
309
|
var newItem = {
|
|
292
310
|
mode: 'Create',
|
|
293
311
|
productId: '',
|
|
294
|
-
quantity: 1,
|
|
312
|
+
quantity: '1',
|
|
295
313
|
price: '',
|
|
296
314
|
rowTotal: '',
|
|
297
315
|
};
|
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.32",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "yarn clean && yarn build:ts && cp package.json lib && cp README.md lib",
|
|
6
6
|
"build:next": "next build",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@eslint/eslintrc": "^3",
|
|
27
27
|
"@headlessui/react": "^2.2.0",
|
|
28
28
|
"@heroicons/react": "^2.2.0",
|
|
29
|
-
"@react-pakistan/util-functions": "^1.24.
|
|
29
|
+
"@react-pakistan/util-functions": "^1.24.23",
|
|
30
30
|
"@supabase/supabase-js": "^2.50.0",
|
|
31
31
|
"@tailwindcss/forms": "^0.5.10",
|
|
32
32
|
"@tailwindcss/postcss": "^4",
|