mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 14:20:31 +00:00
fix : correct rename variable in sale & purchase floating Actions.
This commit is contained in:
@@ -23,9 +23,7 @@ export default function BillFloatingActions({
|
|||||||
isSubmitting,
|
isSubmitting,
|
||||||
onSubmitClick,
|
onSubmitClick,
|
||||||
onCancelClick,
|
onCancelClick,
|
||||||
onClearClick,
|
bill,
|
||||||
billId,
|
|
||||||
isOpen,
|
|
||||||
}) {
|
}) {
|
||||||
const { resetForm, submitForm } = useFormikContext();
|
const { resetForm, submitForm } = useFormikContext();
|
||||||
const handleSubmitOpenBtnClick = (event) => {
|
const handleSubmitOpenBtnClick = (event) => {
|
||||||
@@ -81,14 +79,13 @@ export default function BillFloatingActions({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleClearBtnClick = (event) => {
|
const handleClearBtnClick = (event) => {
|
||||||
// saveInvoke(onClearClick, event);
|
|
||||||
resetForm();
|
resetForm();
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classNames(CLASSES.PAGE_FORM_FLOATING_ACTIONS)}>
|
<div className={classNames(CLASSES.PAGE_FORM_FLOATING_ACTIONS)}>
|
||||||
{/* ----------- Save And Open ----------- */}
|
{/* ----------- Save And Open ----------- */}
|
||||||
<If condition={!billId || !isOpen}>
|
<If condition={!bill || !bill?.is_open}>
|
||||||
<ButtonGroup>
|
<ButtonGroup>
|
||||||
<Button
|
<Button
|
||||||
disabled={isSubmitting}
|
disabled={isSubmitting}
|
||||||
@@ -155,7 +152,7 @@ export default function BillFloatingActions({
|
|||||||
</ButtonGroup>
|
</ButtonGroup>
|
||||||
</If>
|
</If>
|
||||||
{/* ----------- Save and New ----------- */}
|
{/* ----------- Save and New ----------- */}
|
||||||
<If condition={billId && isOpen}>
|
<If condition={bill && bill?.is_open}>
|
||||||
<ButtonGroup>
|
<ButtonGroup>
|
||||||
<Button
|
<Button
|
||||||
disabled={isSubmitting}
|
disabled={isSubmitting}
|
||||||
@@ -191,7 +188,7 @@ export default function BillFloatingActions({
|
|||||||
className={'ml1'}
|
className={'ml1'}
|
||||||
disabled={isSubmitting}
|
disabled={isSubmitting}
|
||||||
onClick={handleClearBtnClick}
|
onClick={handleClearBtnClick}
|
||||||
text={billId ? <T id={'reset'} /> : <T id={'clear'} />}
|
text={bill ? <T id={'reset'} /> : <T id={'clear'} />}
|
||||||
/>
|
/>
|
||||||
{/* ----------- Cancel ----------- */}
|
{/* ----------- Cancel ----------- */}
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
@@ -219,7 +219,7 @@ function BillForm({
|
|||||||
initialValues={initialValues}
|
initialValues={initialValues}
|
||||||
onSubmit={handleFormSubmit}
|
onSubmit={handleFormSubmit}
|
||||||
>
|
>
|
||||||
{({ isSubmitting ,values }) => (
|
{({ isSubmitting}) => (
|
||||||
<Form>
|
<Form>
|
||||||
<BillFormHeader onBillNumberChanged={handleBillNumberChanged} />
|
<BillFormHeader onBillNumberChanged={handleBillNumberChanged} />
|
||||||
<BillFormBody defaultBill={defaultBill} />
|
<BillFormBody defaultBill={defaultBill} />
|
||||||
@@ -229,8 +229,7 @@ function BillForm({
|
|||||||
/>
|
/>
|
||||||
<BillFloatingActions
|
<BillFloatingActions
|
||||||
isSubmitting={isSubmitting}
|
isSubmitting={isSubmitting}
|
||||||
billId={billId}
|
bill={bill}
|
||||||
isOpen={values.open}
|
|
||||||
onSubmitClick={handleSubmitClick}
|
onSubmitClick={handleSubmitClick}
|
||||||
onCancelClick={handleCancelClick}
|
onCancelClick={handleCancelClick}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -23,9 +23,7 @@ export default function EstimateFloatingActions({
|
|||||||
isSubmitting,
|
isSubmitting,
|
||||||
onSubmitClick,
|
onSubmitClick,
|
||||||
onCancelClick,
|
onCancelClick,
|
||||||
onClearClick,
|
estimate,
|
||||||
estimateId,
|
|
||||||
isDelivered,
|
|
||||||
}) {
|
}) {
|
||||||
const { resetForm, submitForm } = useFormikContext();
|
const { resetForm, submitForm } = useFormikContext();
|
||||||
|
|
||||||
@@ -82,14 +80,13 @@ export default function EstimateFloatingActions({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleClearBtnClick = (event) => {
|
const handleClearBtnClick = (event) => {
|
||||||
// saveInvoke(onClearClick, event);
|
|
||||||
resetForm();
|
resetForm();
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classNames(CLASSES.PAGE_FORM_FLOATING_ACTIONS)}>
|
<div className={classNames(CLASSES.PAGE_FORM_FLOATING_ACTIONS)}>
|
||||||
{/* ----------- Save And Deliver ----------- */}
|
{/* ----------- Save And Deliver ----------- */}
|
||||||
<If condition={!estimateId || !isDelivered}>
|
<If condition={!estimate || !estimate?.is_delivered}>
|
||||||
<ButtonGroup>
|
<ButtonGroup>
|
||||||
<Button
|
<Button
|
||||||
disabled={isSubmitting}
|
disabled={isSubmitting}
|
||||||
@@ -156,7 +153,7 @@ export default function EstimateFloatingActions({
|
|||||||
</ButtonGroup>
|
</ButtonGroup>
|
||||||
</If>
|
</If>
|
||||||
{/* ----------- Save and New ----------- */}
|
{/* ----------- Save and New ----------- */}
|
||||||
<If condition={estimateId && isDelivered}>
|
<If condition={estimate && estimate?.is_delivered}>
|
||||||
<ButtonGroup>
|
<ButtonGroup>
|
||||||
<Button
|
<Button
|
||||||
disabled={isSubmitting}
|
disabled={isSubmitting}
|
||||||
@@ -192,7 +189,7 @@ export default function EstimateFloatingActions({
|
|||||||
className={'ml1'}
|
className={'ml1'}
|
||||||
disabled={isSubmitting}
|
disabled={isSubmitting}
|
||||||
onClick={handleClearBtnClick}
|
onClick={handleClearBtnClick}
|
||||||
text={estimateId ? <T id={'reset'} /> : <T id={'clear'} />}
|
text={estimate ? <T id={'reset'} /> : <T id={'clear'} />}
|
||||||
/>
|
/>
|
||||||
{/* ----------- Cancel ----------- */}
|
{/* ----------- Cancel ----------- */}
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
@@ -264,7 +264,7 @@ const EstimateForm = ({
|
|||||||
initialValues={initialValues}
|
initialValues={initialValues}
|
||||||
onSubmit={handleFormSubmit}
|
onSubmit={handleFormSubmit}
|
||||||
>
|
>
|
||||||
{({ isSubmitting, values }) => (
|
{({ isSubmitting}) => (
|
||||||
<Form>
|
<Form>
|
||||||
<EstimateFormHeader
|
<EstimateFormHeader
|
||||||
onEstimateNumberChanged={handleEstimateNumberChange}
|
onEstimateNumberChanged={handleEstimateNumberChange}
|
||||||
@@ -274,10 +274,9 @@ const EstimateForm = ({
|
|||||||
<EstimateFormFooter />
|
<EstimateFormFooter />
|
||||||
<EstimateFloatingActions
|
<EstimateFloatingActions
|
||||||
isSubmitting={isSubmitting}
|
isSubmitting={isSubmitting}
|
||||||
estimateId={estimateId}
|
estimate={estimate}
|
||||||
onSubmitClick={handleSubmitClick}
|
onSubmitClick={handleSubmitClick}
|
||||||
onCancelClick={handleCancelClick}
|
onCancelClick={handleCancelClick}
|
||||||
isDelivered={values.delivered}
|
|
||||||
/>
|
/>
|
||||||
</Form>
|
</Form>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -23,9 +23,7 @@ export default function InvoiceFloatingActions({
|
|||||||
isSubmitting,
|
isSubmitting,
|
||||||
onSubmitClick,
|
onSubmitClick,
|
||||||
onCancelClick,
|
onCancelClick,
|
||||||
onClearClick,
|
|
||||||
invoice,
|
invoice,
|
||||||
isDelivered,
|
|
||||||
}) {
|
}) {
|
||||||
const { resetForm, submitForm } = useFormikContext();
|
const { resetForm, submitForm } = useFormikContext();
|
||||||
|
|
||||||
@@ -82,14 +80,13 @@ export default function InvoiceFloatingActions({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleClearBtnClick = (event) => {
|
const handleClearBtnClick = (event) => {
|
||||||
// saveInvoke(onClearClick, event);
|
|
||||||
resetForm();
|
resetForm();
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classNames(CLASSES.PAGE_FORM_FLOATING_ACTIONS)}>
|
<div className={classNames(CLASSES.PAGE_FORM_FLOATING_ACTIONS)}>
|
||||||
{/* ----------- Save And Deliver ----------- */}
|
{/* ----------- Save And Deliver ----------- */}
|
||||||
<If condition={!invoice || !isDelivered}>
|
<If condition={!invoice || !invoice?.is_delivered}>
|
||||||
<ButtonGroup>
|
<ButtonGroup>
|
||||||
<Button
|
<Button
|
||||||
disabled={isSubmitting}
|
disabled={isSubmitting}
|
||||||
@@ -156,7 +153,7 @@ export default function InvoiceFloatingActions({
|
|||||||
</ButtonGroup>
|
</ButtonGroup>
|
||||||
</If>
|
</If>
|
||||||
{/* ----------- Save and New ----------- */}
|
{/* ----------- Save and New ----------- */}
|
||||||
<If condition={invoice && isDelivered}>
|
<If condition={invoice && invoice?.is_delivered}>
|
||||||
<ButtonGroup>
|
<ButtonGroup>
|
||||||
<Button
|
<Button
|
||||||
disabled={isSubmitting}
|
disabled={isSubmitting}
|
||||||
|
|||||||
@@ -246,7 +246,7 @@ function InvoiceForm({
|
|||||||
initialValues={initialValues}
|
initialValues={initialValues}
|
||||||
onSubmit={handleSubmit}
|
onSubmit={handleSubmit}
|
||||||
>
|
>
|
||||||
{({ isSubmitting, values }) => (
|
{({ isSubmitting}) => (
|
||||||
<Form>
|
<Form>
|
||||||
<InvoiceFormHeader
|
<InvoiceFormHeader
|
||||||
onInvoiceNumberChanged={handleInvoiceNumberChanged}
|
onInvoiceNumberChanged={handleInvoiceNumberChanged}
|
||||||
@@ -262,10 +262,9 @@ function InvoiceForm({
|
|||||||
<InvoiceFormFooter />
|
<InvoiceFormFooter />
|
||||||
<InvoiceFloatingActions
|
<InvoiceFloatingActions
|
||||||
isSubmitting={isSubmitting}
|
isSubmitting={isSubmitting}
|
||||||
invoice={invoiceId}
|
invoice={invoice}
|
||||||
onCancelClick={handleCancelClick}
|
onCancelClick={handleCancelClick}
|
||||||
onSubmitClick={handleSubmitClick}
|
onSubmitClick={handleSubmitClick}
|
||||||
isDelivered={values.delivered}
|
|
||||||
/>
|
/>
|
||||||
</Form>
|
</Form>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ const defaultInitialValues = {
|
|||||||
reference_no: '',
|
reference_no: '',
|
||||||
receipt_message: '',
|
receipt_message: '',
|
||||||
statement: '',
|
statement: '',
|
||||||
closed:'',
|
closed: '',
|
||||||
entries: [...repeatValue(defaultReceipt, MIN_LINES_NUMBER)],
|
entries: [...repeatValue(defaultReceipt, MIN_LINES_NUMBER)],
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -247,13 +247,15 @@ function ReceiptForm({
|
|||||||
},
|
},
|
||||||
[history],
|
[history],
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classNames(
|
<div
|
||||||
CLASSES.PAGE_FORM,
|
className={classNames(
|
||||||
CLASSES.PAGE_FORM_STRIP_STYLE,
|
CLASSES.PAGE_FORM,
|
||||||
CLASSES.PAGE_FORM_RECEIPT,
|
CLASSES.PAGE_FORM_STRIP_STYLE,
|
||||||
)}>
|
CLASSES.PAGE_FORM_RECEIPT,
|
||||||
|
)}
|
||||||
|
>
|
||||||
<Formik
|
<Formik
|
||||||
validationSchema={
|
validationSchema={
|
||||||
isNewMode ? CreateReceiptFormSchema : EditReceiptFormSchema
|
isNewMode ? CreateReceiptFormSchema : EditReceiptFormSchema
|
||||||
@@ -261,18 +263,17 @@ function ReceiptForm({
|
|||||||
initialValues={initialValues}
|
initialValues={initialValues}
|
||||||
onSubmit={handleFormSubmit}
|
onSubmit={handleFormSubmit}
|
||||||
>
|
>
|
||||||
{({ isSubmitting ,values }) => (
|
{({ isSubmitting}) => (
|
||||||
<Form>
|
<Form>
|
||||||
<ReceiptFromHeader
|
<ReceiptFromHeader
|
||||||
onReceiptNumberChanged={handleReceiptNumberChanged}
|
onReceiptNumberChanged={handleReceiptNumberChanged}
|
||||||
/>
|
/>
|
||||||
<ReceiptNumberWatcher receiptNumber={receiptNumber} />
|
<ReceiptNumberWatcher receiptNumber={receiptNumber} />
|
||||||
<ReceiptFormBody defaultReceipt ={defaultReceipt} />
|
<ReceiptFormBody defaultReceipt={defaultReceipt} />
|
||||||
<ReceiptFormFooter />
|
<ReceiptFormFooter />
|
||||||
<ReceiptFormFloatingActions
|
<ReceiptFormFloatingActions
|
||||||
isSubmitting={isSubmitting}
|
isSubmitting={isSubmitting}
|
||||||
receiptId={receiptId}
|
receipt={receipt}
|
||||||
isClosed={values.closed}
|
|
||||||
onSubmitClick={handleSubmitClick}
|
onSubmitClick={handleSubmitClick}
|
||||||
onCancelClick={handleCancelClick}
|
onCancelClick={handleCancelClick}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -21,11 +21,9 @@ import { If, Icon } from 'components';
|
|||||||
*/
|
*/
|
||||||
export default function ReceiptFormFloatingActions({
|
export default function ReceiptFormFloatingActions({
|
||||||
isSubmitting,
|
isSubmitting,
|
||||||
receiptId,
|
receipt,
|
||||||
isClosed,
|
|
||||||
onSubmitClick,
|
onSubmitClick,
|
||||||
onCancelClick,
|
onCancelClick,
|
||||||
onClearClick,
|
|
||||||
}) {
|
}) {
|
||||||
const { resetForm, submitForm } = useFormikContext();
|
const { resetForm, submitForm } = useFormikContext();
|
||||||
|
|
||||||
@@ -82,14 +80,13 @@ export default function ReceiptFormFloatingActions({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleClearBtnClick = (event) => {
|
const handleClearBtnClick = (event) => {
|
||||||
// saveInvoke(onClearClick, event);
|
|
||||||
resetForm();
|
resetForm();
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classNames(CLASSES.PAGE_FORM_FLOATING_ACTIONS)}>
|
<div className={classNames(CLASSES.PAGE_FORM_FLOATING_ACTIONS)}>
|
||||||
{/* ----------- Save And Close ----------- */}
|
{/* ----------- Save And Close ----------- */}
|
||||||
<If condition={!receiptId || !isClosed}>
|
<If condition={!receipt || !receipt?.is_closed}>
|
||||||
<ButtonGroup>
|
<ButtonGroup>
|
||||||
<Button
|
<Button
|
||||||
disabled={isSubmitting}
|
disabled={isSubmitting}
|
||||||
@@ -156,7 +153,7 @@ export default function ReceiptFormFloatingActions({
|
|||||||
</ButtonGroup>
|
</ButtonGroup>
|
||||||
</If>
|
</If>
|
||||||
{/* ----------- Save and New ----------- */}
|
{/* ----------- Save and New ----------- */}
|
||||||
<If condition={receiptId && isClosed}>
|
<If condition={receipt && receipt?.is_closed}>
|
||||||
<ButtonGroup>
|
<ButtonGroup>
|
||||||
<Button
|
<Button
|
||||||
disabled={isSubmitting}
|
disabled={isSubmitting}
|
||||||
@@ -191,7 +188,7 @@ export default function ReceiptFormFloatingActions({
|
|||||||
className={'ml1'}
|
className={'ml1'}
|
||||||
disabled={isSubmitting}
|
disabled={isSubmitting}
|
||||||
onClick={handleClearBtnClick}
|
onClick={handleClearBtnClick}
|
||||||
text={receiptId ? <T id={'reset'} /> : <T id={'clear'} />}
|
text={receipt ? <T id={'reset'} /> : <T id={'clear'} />}
|
||||||
/>
|
/>
|
||||||
{/* ----------- Cancel ----------- */}
|
{/* ----------- Cancel ----------- */}
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
Reference in New Issue
Block a user