@salesgenterp/ui-components 0.4.297 → 0.4.299

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
@@ -9734,6 +9734,7 @@ var Step3 = function Step3(_ref) {
9734
9734
  var _templateObject$L, _templateObject2$x;
9735
9735
  var ConsentForm = function ConsentForm(_ref) {
9736
9736
  var apiEndPoint = _ref.apiEndPoint,
9737
+ token = _ref.token,
9737
9738
  loading = _ref.loading,
9738
9739
  customer = _ref.customer,
9739
9740
  shippingInformation = _ref.shippingInformation,
@@ -9748,6 +9749,12 @@ var ConsentForm = function ConsentForm(_ref) {
9748
9749
  var _useState2 = React.useState([]),
9749
9750
  staticPageData = _useState2[0],
9750
9751
  setStaticPageData = _useState2[1];
9752
+ var _useState3 = React.useState([]),
9753
+ taxData = _useState3[0],
9754
+ setTaxData = _useState3[1];
9755
+ var _useState4 = React.useState([]),
9756
+ storeData = _useState4[0],
9757
+ setStoreData = _useState4[1];
9751
9758
  React.useEffect(function () {
9752
9759
  if (apiEndPoint) {
9753
9760
  (function () {
@@ -9765,8 +9772,26 @@ var ConsentForm = function ConsentForm(_ref) {
9765
9772
  size: 20,
9766
9773
  stateId: shippingInformation === null || shippingInformation === void 0 ? void 0 : shippingInformation.stateId
9767
9774
  }
9768
- })).then(function (response) {
9769
- setStaticPageData(response === null || response === void 0 ? void 0 : response.content);
9775
+ })).then(function (staticPageDataResponse) {
9776
+ setStaticPageData(staticPageDataResponse === null || staticPageDataResponse === void 0 ? void 0 : staticPageDataResponse.content);
9777
+ return Promise.resolve(API$1({
9778
+ apiEndPoint: apiEndPoint,
9779
+ token: token,
9780
+ url: "/cartLineItem/totalTax",
9781
+ queryParams: {
9782
+ storeId: 2,
9783
+ customerShippingAddressId: shippingInformation === null || shippingInformation === void 0 ? void 0 : shippingInformation.id
9784
+ }
9785
+ })).then(function (taxDataResponse) {
9786
+ setTaxData(taxDataResponse);
9787
+ return Promise.resolve(API$1({
9788
+ apiEndPoint: apiEndPoint,
9789
+ token: token,
9790
+ url: "/store"
9791
+ })).then(function (storeResponse) {
9792
+ setStoreData(storeResponse);
9793
+ });
9794
+ });
9770
9795
  });
9771
9796
  }, function () {});
9772
9797
  return _temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp);
@@ -9813,7 +9838,9 @@ var ConsentForm = function ConsentForm(_ref) {
9813
9838
  }, loadingData ? /*#__PURE__*/React__default.createElement(Loader, null) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(InfoComponent, {
9814
9839
  orderTotal: orderTotal,
9815
9840
  shippingInformation: shippingInformation,
9816
- customer: customer
9841
+ customer: customer,
9842
+ taxData: taxData,
9843
+ storeData: storeData
9817
9844
  }), /*#__PURE__*/React__default.createElement("h2", {
9818
9845
  style: {
9819
9846
  margin: '1rem 0'
@@ -9827,21 +9854,30 @@ var InfoComponent = function InfoComponent(_ref2) {
9827
9854
  var _customer$customerDto, _customer$customerDto2, _customer$customerDto3;
9828
9855
  var orderTotal = _ref2.orderTotal,
9829
9856
  shippingInformation = _ref2.shippingInformation,
9830
- customer = _ref2.customer;
9857
+ customer = _ref2.customer,
9858
+ taxData = _ref2.taxData,
9859
+ storeData = _ref2.storeData;
9860
+ var taxWaiverAmount = lodash.sumBy(taxData, 'taxAmount') || 0;
9861
+ var store = storeData === null || storeData === void 0 ? void 0 : storeData.find(function (store) {
9862
+ return (store === null || store === void 0 ? void 0 : store.id) === 2;
9863
+ });
9831
9864
  var totalData = [{
9832
9865
  name: 'Date',
9833
9866
  value: getLocalTime({
9834
9867
  time: new Date()
9835
9868
  })
9869
+ }, {
9870
+ name: 'Purchase From',
9871
+ value: store === null || store === void 0 ? void 0 : store.description
9836
9872
  }, {
9837
9873
  name: 'Order Total',
9838
- value: renderMoney(orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.totalAmount)
9874
+ value: renderMoney((orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.totalAmount) + taxWaiverAmount)
9839
9875
  }, {
9840
- name: 'Tax Exempt AMount',
9841
- value: renderMoney(0)
9876
+ name: 'Tax Exempt Amount',
9877
+ value: renderMoney(taxWaiverAmount)
9842
9878
  }, {
9843
9879
  name: 'Order Total After Tax Waiver',
9844
- value: renderMoney((orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.totalAmount) - 0)
9880
+ value: renderMoney(orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.totalAmount)
9845
9881
  }];
9846
9882
  return /*#__PURE__*/React__default.createElement(InfoContainer, null, /*#__PURE__*/React__default.createElement(material.Grid, {
9847
9883
  container: true,