mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 22:30:31 +00:00
feat(webapp): add mark as delivered to action bar of invoice details drawer
This commit is contained in:
@@ -57,6 +57,11 @@ function InvoiceDetailActionsBar({
|
|||||||
closeDrawer(DRAWERS.INVOICE_DETAILS);
|
closeDrawer(DRAWERS.INVOICE_DETAILS);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Hanlde deliver sale invoice.
|
||||||
|
const handleDeliverInvoice = ({ id }) => {
|
||||||
|
openAlert('invoice-deliver', { invoiceId });
|
||||||
|
};
|
||||||
|
|
||||||
// Handle convert to invoice.
|
// Handle convert to invoice.
|
||||||
const handleConvertToCreitNote = () => {
|
const handleConvertToCreitNote = () => {
|
||||||
history.push(`/credit-notes/new?from_invoice_id=${invoiceId}`, {
|
history.push(`/credit-notes/new?from_invoice_id=${invoiceId}`, {
|
||||||
@@ -153,6 +158,7 @@ function InvoiceDetailActionsBar({
|
|||||||
onCancelBadDebt: handleCancelBadDebtInvoice,
|
onCancelBadDebt: handleCancelBadDebtInvoice,
|
||||||
onNotifyViaSMS: handleNotifyViaSMS,
|
onNotifyViaSMS: handleNotifyViaSMS,
|
||||||
onConvert: handleConvertToCreitNote,
|
onConvert: handleConvertToCreitNote,
|
||||||
|
onDeliver: handleDeliverInvoice,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Can>
|
</Can>
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import {
|
|||||||
FormattedMessage as T,
|
FormattedMessage as T,
|
||||||
Choose,
|
Choose,
|
||||||
Can,
|
Can,
|
||||||
|
If,
|
||||||
TextOverviewTooltipCell,
|
TextOverviewTooltipCell,
|
||||||
} from '@/components';
|
} from '@/components';
|
||||||
import { SaleInvoiceAction, AbilitySubject } from '@/constants/abilityOption';
|
import { SaleInvoiceAction, AbilitySubject } from '@/constants/abilityOption';
|
||||||
@@ -94,7 +95,7 @@ export const useInvoiceReadonlyEntriesColumns = () => {
|
|||||||
* @returns {React.JSX}
|
* @returns {React.JSX}
|
||||||
*/
|
*/
|
||||||
export const BadDebtMenuItem = ({
|
export const BadDebtMenuItem = ({
|
||||||
payload: { onCancelBadDebt, onBadDebt, onNotifyViaSMS, onConvert },
|
payload: { onCancelBadDebt, onBadDebt, onNotifyViaSMS, onConvert, onDeliver },
|
||||||
}) => {
|
}) => {
|
||||||
const { invoice } = useInvoiceDetailDrawerContext();
|
const { invoice } = useInvoiceDetailDrawerContext();
|
||||||
|
|
||||||
@@ -108,6 +109,12 @@ export const BadDebtMenuItem = ({
|
|||||||
}}
|
}}
|
||||||
content={
|
content={
|
||||||
<Menu>
|
<Menu>
|
||||||
|
<If condition={!invoice.is_delivered}>
|
||||||
|
<MenuItem
|
||||||
|
onClick={onDeliver}
|
||||||
|
text={<T id={'mark_as_delivered'} />}
|
||||||
|
/>
|
||||||
|
</If>
|
||||||
<Choose>
|
<Choose>
|
||||||
<Choose.When condition={!invoice.is_writtenoff}>
|
<Choose.When condition={!invoice.is_writtenoff}>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
|
|||||||
Reference in New Issue
Block a user