@appcorp/stellar-solutions-invoice-module 0.1.65 → 0.1.67

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.
@@ -239,7 +239,11 @@ var usePaymentState = function () {
239
239
  updateCallback: updateCallback,
240
240
  updateDeps: [state],
241
241
  updateParams: updateParams,
242
- }), byIdError = _b.byIdError, byIdFetchNow = _b.byIdFetchNow, byIdLoading = _b.byIdLoading, deleteError = _b.deleteError, deleteFetchNow = _b.deleteFetchNow, deleteLoading = _b.deleteLoading, listError = _b.listError, listFetchNow = _b.listFetchNow, listLoading = _b.listLoading, updateError = _b.updateError, updateFetchNow = _b.updateFetchNow, updateLoading = _b.updateLoading;
242
+ }), byIdError = _b.byIdError,
243
+ // byIdFetchNow,
244
+ byIdLoading = _b.byIdLoading, deleteError = _b.deleteError,
245
+ // deleteFetchNow,
246
+ deleteLoading = _b.deleteLoading, listError = _b.listError, listFetchNow = _b.listFetchNow, listLoading = _b.listLoading, updateError = _b.updateError, updateFetchNow = _b.updateFetchNow, updateLoading = _b.updateLoading;
243
247
  // ---------------------------------------------------------------------------
244
248
  // EFFECTS
245
249
  // ---------------------------------------------------------------------------
@@ -280,6 +284,7 @@ var usePaymentState = function () {
280
284
  payload: { drawer: types_1.PAYMENT_DRAWER.PAYMENT_FORM_DRAWER },
281
285
  });
282
286
  }
287
+ (0, util_functions_1.removeStorageValue)("paymentInvoiceId");
283
288
  }
284
289
  }, [invoices]);
285
290
  // ---------------------------------------------------------------------------
@@ -300,16 +305,22 @@ var usePaymentState = function () {
300
305
  // ---------------------------------------------------------------------------
301
306
  // CRUD OPERATION HANDLERS
302
307
  // ---------------------------------------------------------------------------
303
- var handleEdit = (0, react_1.useCallback)(function (id) {
304
- byIdFetchNow(undefined, {
305
- body: JSON.stringify({ id: id }),
306
- });
307
- }, [byIdFetchNow]);
308
- var handleDelete = (0, react_1.useCallback)(function (id) {
309
- deleteFetchNow === null || deleteFetchNow === void 0 ? void 0 : deleteFetchNow(undefined, {
310
- body: JSON.stringify({ id: id }),
311
- });
312
- }, [deleteFetchNow]);
308
+ // const handleEdit = useCallback(
309
+ // (id: string) => {
310
+ // byIdFetchNow(undefined, {
311
+ // body: JSON.stringify({ id }),
312
+ // });
313
+ // },
314
+ // [byIdFetchNow]
315
+ // );
316
+ // const handleDelete = useCallback(
317
+ // (id: string) => {
318
+ // deleteFetchNow?.(undefined, {
319
+ // body: JSON.stringify({ id }),
320
+ // });
321
+ // },
322
+ // [deleteFetchNow]
323
+ // );
313
324
  var handleSubmit = (0, react_1.useCallback)(function () {
314
325
  dispatch({
315
326
  payload: { disableSaveButton: true },
@@ -335,8 +346,7 @@ var usePaymentState = function () {
335
346
  // FORM HANDLERS
336
347
  // ---------------------------------------------------------------------------
337
348
  var handleChange = (0, react_1.useCallback)(function (key, value) {
338
- var _a, _b, _c, _d;
339
- console.log("_>>>", state.invoice);
349
+ var _a, _b, _c;
340
350
  if (key === "amount" && typeof value === "string") {
341
351
  if (Number((_a = state === null || state === void 0 ? void 0 : state.invoice) === null || _a === void 0 ? void 0 : _a.total) > Number(value)) {
342
352
  dispatch({
@@ -350,12 +360,11 @@ var usePaymentState = function () {
350
360
  payload: { key: "paymentType", value: types_1.PAYMENT_TYPE.FULL_AMOUNT },
351
361
  });
352
362
  }
353
- console.log(Number(Number((_c = state === null || state === void 0 ? void 0 : state.invoice) === null || _c === void 0 ? void 0 : _c.total) - Number(value)).toFixed(2));
354
363
  dispatch({
355
364
  type: actions_1.PAYMENT_ACTION_TYPES.SET_INPUT_FIELD,
356
365
  payload: {
357
366
  key: "balance",
358
- value: Number(Number((_d = state === null || state === void 0 ? void 0 : state.invoice) === null || _d === void 0 ? void 0 : _d.total) - Number(value)).toFixed(2),
367
+ value: Number(Number((_c = state === null || state === void 0 ? void 0 : state.invoice) === null || _c === void 0 ? void 0 : _c.total) - Number(value)).toFixed(2),
359
368
  },
360
369
  });
361
370
  }
@@ -412,20 +421,7 @@ var usePaymentState = function () {
412
421
  // TABLE ACTIONS
413
422
  // ---------------------------------------------------------------------------
414
423
  var headerActions = (0, react_1.useMemo)(function () { return []; }, []);
415
- var rowActions = (0, react_1.useMemo)(function () { return [
416
- {
417
- enabled: true,
418
- handleAction: function (id) { return handleEdit(id); },
419
- label: t("actionsButtonEdit"),
420
- order: 1,
421
- },
422
- {
423
- enabled: true,
424
- handleAction: function (id) { return handleDelete(id); },
425
- label: t("actionsButtonDelete"),
426
- order: 2,
427
- },
428
- ]; }, [handleEdit, handleDelete, t]);
424
+ var rowActions = (0, react_1.useMemo)(function () { return []; }, []);
429
425
  // ---------------------------------------------------------------------------
430
426
  // RETURN STATE
431
427
  // ---------------------------------------------------------------------------
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appcorp/stellar-solutions-invoice-module",
3
- "version": "0.1.65",
3
+ "version": "0.1.67",
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",