refactoring: sales tables.

refacoring: purchases tables.
This commit is contained in:
a.bouhuolia
2021-02-11 20:45:06 +02:00
parent 3901c336df
commit d48532a7e6
210 changed files with 2799 additions and 5392 deletions

View File

@@ -6,7 +6,6 @@ import ReferenceNumberForm from 'containers/JournalNumber/ReferenceNumberForm';
import withDialogActions from 'containers/Dialog/withDialogActions';
import withSettings from 'containers/Settings/withSettings';
import withSettingsActions from 'containers/Settings/withSettingsActions';
import withEstimateActions from 'containers/Sales/Estimate/withEstimateActions';
import { compose, optionsMapToArray } from 'utils';
@@ -18,15 +17,13 @@ function EstimateNumberDialogContent({
// #withSettings
nextNumber,
numberPrefix,
// #withSettingsActions
requestFetchOptions,
requestSubmitOptions,
// #withDialogActions
closeDialog,
// #withEstimateActions
setEstimateNumberChanged,
}) {
const fetchSettings = useQuery(['settings'], () => requestFetchOptions({}));
@@ -41,7 +38,7 @@ function EstimateNumberDialogContent({
setTimeout(() => {
queryCache.invalidateQueries('settings');
setEstimateNumberChanged(true);
// setEstimateNumberChanged(true);
}, 250);
})
.catch(() => {
@@ -72,5 +69,4 @@ export default compose(
nextNumber: estimatesSettings?.nextNumber,
numberPrefix: estimatesSettings?.numberPrefix,
})),
withEstimateActions,
)(EstimateNumberDialogContent);

View File

@@ -7,7 +7,7 @@ import ReferenceNumberForm from 'containers/JournalNumber/ReferenceNumberForm';
import withDialogActions from 'containers/Dialog/withDialogActions';
import withSettings from 'containers/Settings/withSettings';
import withSettingsActions from 'containers/Settings/withSettingsActions';
import withInvoicesActions from 'containers/Sales/Invoice/withInvoiceActions';
// import withInvoicesActions from 'containers/Sales/Invoice/withInvoiceActions';
import { compose, optionsMapToArray } from 'utils';
@@ -28,7 +28,7 @@ function InvoiceNumberDialogContent({
closeDialog,
// #withInvoicesActions
setInvoiceNumberChanged,
// setInvoiceNumberChanged,
}) {
const fetchSettings = useQuery(['settings'], () => requestFetchOptions({}));
@@ -44,7 +44,7 @@ function InvoiceNumberDialogContent({
setTimeout(() => {
queryCache.invalidateQueries('settings');
setInvoiceNumberChanged(true);
// setInvoiceNumberChanged(true);
}, 250);
})
.catch(() => {
@@ -75,5 +75,5 @@ export default compose(
nextNumber: invoiceSettings?.nextNumber,
numberPrefix: invoiceSettings?.numberPrefix,
})),
withInvoicesActions,
// withInvoicesActions,
)(InvoiceNumberDialogContent);

View File

@@ -1,13 +1,13 @@
import React, { useCallback } from 'react';
import { DialogContent } from 'components';
import { useQuery, queryCache } from 'react-query';
import { useQuery } from 'react-query';
import ReferenceNumberForm from 'containers/JournalNumber/ReferenceNumberForm';
import withDialogActions from 'containers/Dialog/withDialogActions';
import withSettingsActions from 'containers/Settings/withSettingsActions';
import withSettings from 'containers/Settings/withSettings';
import withPaymentReceivesActions from 'containers/Sales/PaymentReceive/withPaymentReceivesActions';
// import withPaymentReceivesActions from 'containers/Sales/PaymentReceive/withPaymentReceivesActions';
import { compose, optionsMapToArray } from 'utils';
@@ -28,7 +28,7 @@ function PaymentNumberDialogContent({
closeDialog,
// #withPaymentReceivesActions
setPaymentReceiveNumberChanged,
// setPaymentReceiveNumberChanged,
}) {
const fetchSettings = useQuery(['settings'], () => requestFetchOptions({}));
@@ -43,8 +43,7 @@ function PaymentNumberDialogContent({
closeDialog('payment-receive-number-form');
setTimeout(() => {
queryCache.invalidateQueries('settings');
setPaymentReceiveNumberChanged(true);
// setPaymentReceiveNumberChanged(true);
}, 250);
})
.catch(() => {
@@ -76,5 +75,5 @@ export default compose(
nextNumber: paymentReceiveSettings?.nextNumber,
numberPrefix: paymentReceiveSettings?.numberPrefix,
})),
withPaymentReceivesActions,
// withPaymentReceivesActions,
)(PaymentNumberDialogContent);

View File

@@ -1,13 +1,12 @@
import React, { useCallback } from 'react';
import { DialogContent } from 'components';
import { useQuery, queryCache } from 'react-query';
import { useQuery } from 'react-query';
import ReferenceNumberForm from 'containers/JournalNumber/ReferenceNumberForm';
import withDialogActions from 'containers/Dialog/withDialogActions';
import withSettings from 'containers/Settings/withSettings';
import withSettingsActions from 'containers/Settings/withSettingsActions';
import withReceiptActions from 'containers/Sales/Receipt/withReceiptActions';
import { compose, optionsMapToArray } from 'utils';
@@ -43,7 +42,6 @@ function ReceiptNumberDialogContent({
closeDialog('receipt-number-form');
setTimeout(() => {
queryCache.invalidateQueries('settings');
setReceiptNumberChanged(true);
}, 250);
})
@@ -75,5 +73,4 @@ export default compose(
nextNumber: receiptSettings?.nextNumber,
numberPrefix: receiptSettings?.numberPrefix,
})),
withReceiptActions,
)(ReceiptNumberDialogContent);