@salesgenterp/ui-components 0.4.468 → 0.4.470

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/dist/index.js CHANGED
@@ -2707,6 +2707,7 @@ var PaymentModal = function PaymentModal(_ref) {
2707
2707
  name: "amount",
2708
2708
  type: "number",
2709
2709
  required: true,
2710
+ disabled: true,
2710
2711
  control: control,
2711
2712
  fontColor: styles === null || styles === void 0 ? void 0 : styles.fontColor,
2712
2713
  max: orderData === null || orderData === void 0 ? void 0 : (_orderData$orderDto10 = orderData.orderDto) === null || _orderData$orderDto10 === void 0 ? void 0 : _orderData$orderDto10.dueAmount
@@ -2858,9 +2859,19 @@ var Dashboard = function Dashboard(_ref) {
2858
2859
  });
2859
2860
  };
2860
2861
  var onDateChange = function onDateChange(data) {
2862
+ var startDate = moment(data === null || data === void 0 ? void 0 : data.startDate).startOf('day');
2863
+ var endDate = moment(data === null || data === void 0 ? void 0 : data.endDate).endOf('day');
2864
+ var newDates = {
2865
+ startDate: getUTCTime({
2866
+ time: startDate
2867
+ }),
2868
+ endDate: getUTCTime({
2869
+ time: endDate
2870
+ })
2871
+ };
2861
2872
  setSelectDates(function (prev) {
2862
2873
  var _extends2;
2863
- return _extends({}, prev, (_extends2 = {}, _extends2[value === 0 ? 'recentInvoices' : 'salesOrders'] = data, _extends2));
2874
+ return _extends({}, prev, (_extends2 = {}, _extends2[value === 0 ? 'recentInvoices' : 'salesOrders'] = newDates, _extends2));
2864
2875
  });
2865
2876
  setTriggerTableData(getRandomString());
2866
2877
  };
@@ -7330,9 +7341,10 @@ var CardRow = function CardRow(_ref) {
7330
7341
  setQuantity(row === null || row === void 0 ? void 0 : row.quantity);
7331
7342
  }, [row]);
7332
7343
  var onChangeQuantity = function onChangeQuantity(product) {
7333
- handleIncrementDecrement(product, product);
7334
7344
  if ((product === null || product === void 0 ? void 0 : product.quantity) <= 0 || (product === null || product === void 0 ? void 0 : product.availableQuantity) <= 0) {
7335
7345
  return handleRemoveProduct(product);
7346
+ } else {
7347
+ handleIncrementDecrement(product, product);
7336
7348
  }
7337
7349
  };
7338
7350
  var onChangeInput = function onChangeInput(e) {
@@ -13151,6 +13163,14 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
13151
13163
  React.useEffect(function () {
13152
13164
  (function () {
13153
13165
  try {
13166
+ var _cartData$cartLineIte;
13167
+ var isQuantityZero = cartData === null || cartData === void 0 ? void 0 : (_cartData$cartLineIte = cartData.cartLineItemDtoList) === null || _cartData$cartLineIte === void 0 ? void 0 : _cartData$cartLineIte.some(function (data) {
13168
+ return (data === null || data === void 0 ? void 0 : data.quantity) <= 0;
13169
+ });
13170
+ if (isQuantityZero) {
13171
+ alert('Product quantity must be greater than 0');
13172
+ window.location.replace("/cart");
13173
+ }
13154
13174
  var _temp9 = function () {
13155
13175
  if (customer) {
13156
13176
  return Promise.resolve(taxFunction()).then(function (taxAmount) {
@@ -13172,8 +13192,8 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
13172
13192
  var taxFunction = function taxFunction() {
13173
13193
  try {
13174
13194
  var taxAmount = totalTaxAmount || 0;
13175
- var _temp11 = function (_cartData$cartLineIte) {
13176
- if (shippingAddressId && (cartData === null || cartData === void 0 ? void 0 : (_cartData$cartLineIte = cartData.cartLineItemDtoList) === null || _cartData$cartLineIte === void 0 ? void 0 : _cartData$cartLineIte.length) > 0 && shippingAddressId && (shippingAddressId !== previousShippingAddressIdRef.current || (cartData === null || cartData === void 0 ? void 0 : cartData.cartSubTotal) !== previousSubTotalRef.current)) {
13195
+ var _temp11 = function (_cartData$cartLineIte2) {
13196
+ if (shippingAddressId && (cartData === null || cartData === void 0 ? void 0 : (_cartData$cartLineIte2 = cartData.cartLineItemDtoList) === null || _cartData$cartLineIte2 === void 0 ? void 0 : _cartData$cartLineIte2.length) > 0 && shippingAddressId && (shippingAddressId !== previousShippingAddressIdRef.current || (cartData === null || cartData === void 0 ? void 0 : cartData.cartSubTotal) !== previousSubTotalRef.current)) {
13177
13197
  previousShippingAddressIdRef.current = shippingAddressId;
13178
13198
  var _temp10 = _catch(function () {
13179
13199
  return Promise.resolve(getTaxData({