diff --git a/src/containers/Drawers/BillDrawer/BillDetailActionsBar.js b/src/containers/Drawers/BillDrawer/BillDetailActionsBar.js
index 3a5aecb96..0db244234 100644
--- a/src/containers/Drawers/BillDrawer/BillDetailActionsBar.js
+++ b/src/containers/Drawers/BillDrawer/BillDetailActionsBar.js
@@ -27,6 +27,7 @@ import {
PaymentMadeAction,
AbilitySubject,
} from '../../../common/abilityOption';
+import { BillMenuItem } from './utils';
import { safeCallback, compose } from 'utils';
@@ -50,6 +51,14 @@ function BillDetailActionsBar({
closeDrawer('bill-drawer');
};
+ // Handle convert to vendor credit.
+ const handleConvertToVendorCredit = () => {
+ history.push(`/vendor-credits/new?from_bill_id=${billId}`, {
+ billId: billId,
+ });
+ closeDrawer('bill-drawer');
+ };
+
// Handle delete bill.
const onDeleteBill = () => {
openAlert('bill-delete', { billId });
@@ -92,6 +101,14 @@ function BillDetailActionsBar({
onClick={safeCallback(onDeleteBill)}
/>
+
+
+
+
);
diff --git a/src/containers/Drawers/BillDrawer/BillDetailFooter.js b/src/containers/Drawers/BillDrawer/BillDetailFooter.js
index 43b7bebde..c5d411cb1 100644
--- a/src/containers/Drawers/BillDrawer/BillDetailFooter.js
+++ b/src/containers/Drawers/BillDrawer/BillDetailFooter.js
@@ -1,51 +1,27 @@
import React from 'react';
-import styled from 'styled-components';
-
import {
- TotalLineBorderStyle,
- TotalLineTextStyle,
- FormatNumber,
+ CommercialDocFooter,
T,
- TotalLines,
- TotalLine,
-} from '../../../components';
+ If,
+ DetailsMenu,
+ DetailItem,
+} from 'components';
+
import { useBillDrawerContext } from './BillDrawerProvider';
/**
- * Bill read-only details footer.
+ * Bill detail footer.
+ * @returns {React.JSX}
*/
-export function BillDetailFooter() {
+export default function BillDetailFooter() {
const { bill } = useBillDrawerContext();
-
return (
-
-
- }
- value={}
- borderStyle={TotalLineBorderStyle.SingleDark}
- />
- }
- value={bill.formatted_amount}
- borderStyle={TotalLineBorderStyle.DoubleDark}
- textStyle={TotalLineTextStyle.Bold}
- />
- }
- value={bill.formatted_payment_amount}
- />
- }
- value={bill.formatted_due_amount}
- />
-
-
+
+
+
+ }>{bill.note}
+
+
+
);
}
-
-export const BillDetailsFooterRoot = styled.div``;
-
-export const BillTotalLines = styled(TotalLines)`
- margin-left: auto;
-`;
diff --git a/src/containers/Drawers/BillDrawer/BillDetailTab.js b/src/containers/Drawers/BillDrawer/BillDetailTab.js
index 86fcd6571..fd238d216 100644
--- a/src/containers/Drawers/BillDrawer/BillDetailTab.js
+++ b/src/containers/Drawers/BillDrawer/BillDetailTab.js
@@ -4,8 +4,8 @@ import { CommercialDocBox } from 'components';
import BillDetailHeader from './BillDetailHeader';
import BillDetailTable from './BillDetailTable';
-import { BillDetailFooter } from './BillDetailFooter';
-
+import { BillDetailTableFooter } from './BillDetailTableFooter';
+import BillDetailFooter from './BillDetailFooter';
/**
* Bill detail panel tab.
@@ -15,6 +15,7 @@ export default function BillDetailTab() {
+
);
diff --git a/src/containers/Drawers/BillDrawer/BillDetailTableFooter.js b/src/containers/Drawers/BillDrawer/BillDetailTableFooter.js
new file mode 100644
index 000000000..d55edc514
--- /dev/null
+++ b/src/containers/Drawers/BillDrawer/BillDetailTableFooter.js
@@ -0,0 +1,51 @@
+import React from 'react';
+import styled from 'styled-components';
+
+import {
+ TotalLineBorderStyle,
+ TotalLineTextStyle,
+ FormatNumber,
+ T,
+ TotalLines,
+ TotalLine,
+} from '../../../components';
+import { useBillDrawerContext } from './BillDrawerProvider';
+
+/**
+ * Bill read-only details table footer.
+ */
+export function BillDetailTableFooter() {
+ const { bill } = useBillDrawerContext();
+
+ return (
+
+
+ }
+ value={}
+ borderStyle={TotalLineBorderStyle.SingleDark}
+ />
+ }
+ value={bill.formatted_amount}
+ borderStyle={TotalLineBorderStyle.DoubleDark}
+ textStyle={TotalLineTextStyle.Bold}
+ />
+ }
+ value={bill.formatted_payment_amount}
+ />
+ }
+ value={bill.formatted_due_amount}
+ />
+
+
+ );
+}
+
+export const BillDetailsFooterRoot = styled.div``;
+
+export const BillTotalLines = styled(TotalLines)`
+ margin-left: auto;
+`;
diff --git a/src/containers/Drawers/BillDrawer/utils.js b/src/containers/Drawers/BillDrawer/utils.js
index 5f0febb19..1c3be7018 100644
--- a/src/containers/Drawers/BillDrawer/utils.js
+++ b/src/containers/Drawers/BillDrawer/utils.js
@@ -1,12 +1,21 @@
import React from 'react';
import intl from 'react-intl-universal';
import styled from 'styled-components';
-import { Intent, Tag } from '@blueprintjs/core';
-
+import {
+ Button,
+ Popover,
+ PopoverInteractionKind,
+ Position,
+ MenuItem,
+ Menu,
+ Intent,
+ Tag,
+} from '@blueprintjs/core';
import {
FormatNumberCell,
FormattedMessage as T,
Choose,
+ Icon,
} from '../../../components';
/**
@@ -73,7 +82,7 @@ export function BillDetailsStatus({ bill }) {
- Overdue
+
@@ -92,6 +101,29 @@ export function BillDetailsStatus({ bill }) {
);
}
+export const BillMenuItem = ({ payload: { onConvert } }) => {
+ return (
+
+ }
+ />
+
+ }
+ >
+ } minimal={true} />
+
+ );
+};
+
const StatusTag = styled(Tag)`
min-width: 65px;
text-align: center;
diff --git a/src/containers/Drawers/CreditNoteDetailDrawer/CreditNoteDetailFooter.js b/src/containers/Drawers/CreditNoteDetailDrawer/CreditNoteDetailFooter.js
new file mode 100644
index 000000000..1bcea07e5
--- /dev/null
+++ b/src/containers/Drawers/CreditNoteDetailDrawer/CreditNoteDetailFooter.js
@@ -0,0 +1,29 @@
+import React from 'react';
+import {
+ CommercialDocFooter,
+ T,
+ If,
+ DetailsMenu,
+ DetailItem,
+} from 'components';
+
+import { useCreditNoteDetailDrawerContext } from './CreditNoteDetailDrawerProvider';
+
+/**
+ * Credit note detail footer
+ * @returns {React.JSX}
+ */
+export default function CreditNoteDetailFooter() {
+ const { creditNote } = useCreditNoteDetailDrawerContext();
+ return (
+
+
+
+ }>
+ {creditNote.terms_conditions}
+
+
+
+
+ );
+}
diff --git a/src/containers/Drawers/CreditNoteDetailDrawer/CreditNoteDetailPanel.js b/src/containers/Drawers/CreditNoteDetailDrawer/CreditNoteDetailPanel.js
index e29f36c41..00be70f26 100644
--- a/src/containers/Drawers/CreditNoteDetailDrawer/CreditNoteDetailPanel.js
+++ b/src/containers/Drawers/CreditNoteDetailDrawer/CreditNoteDetailPanel.js
@@ -4,7 +4,8 @@ import { CommercialDocBox } from 'components';
import CreditNoteDetailHeader from './CreditNoteDetailHeader';
import CreditNoteDetailTable from './CreditNoteDetailTable';
-import CreditNoteDetailDrawerFooter from './CreditNoteDetailDrawerFooter';
+import CreditNoteDetailTableFooter from './CreditNoteDetailTableFooter';
+import CreditNoteDetailFooter from './CreditNoteDetailFooter';
/**
* Credit note details panel.
@@ -14,7 +15,8 @@ export default function CreditNoteDetailPanel() {
-
+
+
);
}
diff --git a/src/containers/Drawers/CreditNoteDetailDrawer/CreditNoteDetailDrawerFooter.js b/src/containers/Drawers/CreditNoteDetailDrawer/CreditNoteDetailTableFooter.js
similarity index 95%
rename from src/containers/Drawers/CreditNoteDetailDrawer/CreditNoteDetailDrawerFooter.js
rename to src/containers/Drawers/CreditNoteDetailDrawer/CreditNoteDetailTableFooter.js
index bb12bccc3..ee39586ef 100644
--- a/src/containers/Drawers/CreditNoteDetailDrawer/CreditNoteDetailDrawerFooter.js
+++ b/src/containers/Drawers/CreditNoteDetailDrawer/CreditNoteDetailTableFooter.js
@@ -14,7 +14,7 @@ import { useCreditNoteDetailDrawerContext } from './CreditNoteDetailDrawerProvid
/**
* Credit note details panel footer.
*/
-export default function CreditNoteDetailDrawerFooter() {
+export default function CreditNoteDetailTableFooter() {
const { creditNote } = useCreditNoteDetailDrawerContext();
return (
diff --git a/src/containers/Drawers/EstimateDetailDrawer/EstimateDetailFooter.js b/src/containers/Drawers/EstimateDetailDrawer/EstimateDetailFooter.js
index cc5b2f01a..c97691e78 100644
--- a/src/containers/Drawers/EstimateDetailDrawer/EstimateDetailFooter.js
+++ b/src/containers/Drawers/EstimateDetailDrawer/EstimateDetailFooter.js
@@ -1,43 +1,35 @@
import React from 'react';
-import styled from 'styled-components';
import {
+ CommercialDocFooter,
T,
- TotalLines,
- TotalLine,
- TotalLineBorderStyle,
- TotalLineTextStyle,
- FormatNumber,
+ If,
+ DetailsMenu,
+ DetailItem,
} from 'components';
import { useEstimateDetailDrawerContext } from './EstimateDetailDrawerProvider';
/**
- * Estimate details panel footer content.
+ * Estimate details footer.
+ * @returns {React.JSX}
*/
export default function EstimateDetailFooter() {
const { estimate } = useEstimateDetailDrawerContext();
-
+
return (
-
-
- }
- value={}
- borderStyle={TotalLineBorderStyle.SingleDark}
- />
- }
- value={estimate.formatted_amount}
- borderStyle={TotalLineBorderStyle.DoubleDark}
- textStyle={TotalLineTextStyle.Bold}
- />
-
-
+
+
+
+ }>
+ {estimate.terms_conditions}
+
+
+
+ }>
+ {estimate.note}
+
+
+
+
);
}
-
-export const EstimateDetailsFooterRoot = styled.div``;
-
-export const EstimateTotalLines = styled(TotalLines)`
- margin-left: auto;
-`;
diff --git a/src/containers/Drawers/EstimateDetailDrawer/EstimateDetailPanel.js b/src/containers/Drawers/EstimateDetailDrawer/EstimateDetailPanel.js
index a2ed72a4d..def91b3d6 100644
--- a/src/containers/Drawers/EstimateDetailDrawer/EstimateDetailPanel.js
+++ b/src/containers/Drawers/EstimateDetailDrawer/EstimateDetailPanel.js
@@ -4,13 +4,16 @@ import { CommercialDocBox } from 'components';
import EstimateDetailHeader from './EstimateDetailHeader';
import EstimateDetailTable from './EstimateDetailTable';
+import EstimateDetailTableFooter from './EstimateDetailTableFooter';
import EstimateDetailFooter from './EstimateDetailFooter';
+
export default function EstimateDetailTab() {
return (
+
);
diff --git a/src/containers/Drawers/EstimateDetailDrawer/EstimateDetailTableFooter.js b/src/containers/Drawers/EstimateDetailDrawer/EstimateDetailTableFooter.js
new file mode 100644
index 000000000..38c877917
--- /dev/null
+++ b/src/containers/Drawers/EstimateDetailDrawer/EstimateDetailTableFooter.js
@@ -0,0 +1,43 @@
+import React from 'react';
+import styled from 'styled-components';
+
+import {
+ T,
+ TotalLines,
+ TotalLine,
+ TotalLineBorderStyle,
+ TotalLineTextStyle,
+ FormatNumber,
+} from 'components';
+import { useEstimateDetailDrawerContext } from './EstimateDetailDrawerProvider';
+
+/**
+ * Estimate details panel footer content.
+ */
+export default function EstimateDetailTableFooter() {
+ const { estimate } = useEstimateDetailDrawerContext();
+
+ return (
+
+
+ }
+ value={}
+ borderStyle={TotalLineBorderStyle.SingleDark}
+ />
+ }
+ value={estimate.formatted_amount}
+ borderStyle={TotalLineBorderStyle.DoubleDark}
+ textStyle={TotalLineTextStyle.Bold}
+ />
+
+
+ );
+}
+
+export const EstimateDetailsFooterRoot = styled.div``;
+
+export const EstimateTotalLines = styled(TotalLines)`
+ margin-left: auto;
+`;
diff --git a/src/containers/Drawers/InventoryAdjustmentDetailDrawer/utils.js b/src/containers/Drawers/InventoryAdjustmentDetailDrawer/utils.js
index e30135d69..56bd7501a 100644
--- a/src/containers/Drawers/InventoryAdjustmentDetailDrawer/utils.js
+++ b/src/containers/Drawers/InventoryAdjustmentDetailDrawer/utils.js
@@ -5,7 +5,7 @@ export const useInventoryAdjustmentEntriesColumns = () =>
React.useMemo(
() => [
{
- Header: intl.get('product_and_service'),
+ Header: intl.get('inventory_adjustment.column.product'),
accessor: 'item.name',
width: 150,
className: 'name',
diff --git a/src/containers/Drawers/InvoiceDetailDrawer/InvoiceDetailActionsBar.js b/src/containers/Drawers/InvoiceDetailDrawer/InvoiceDetailActionsBar.js
index 3a0a354cc..3042ae0db 100644
--- a/src/containers/Drawers/InvoiceDetailDrawer/InvoiceDetailActionsBar.js
+++ b/src/containers/Drawers/InvoiceDetailDrawer/InvoiceDetailActionsBar.js
@@ -14,7 +14,13 @@ import withDialogActions from 'containers/Dialog/withDialogActions';
import withAlertsActions from 'containers/Alert/withAlertActions';
import withDrawerActions from 'containers/Drawer/withDrawerActions';
-import { If, Can, Icon, DrawerActionsBar, FormattedMessage as T } from 'components';
+import {
+ If,
+ Can,
+ Icon,
+ DrawerActionsBar,
+ FormattedMessage as T,
+} from 'components';
import {
SaleInvoiceAction,
PaymentReceiveAction,
@@ -48,6 +54,14 @@ function InvoiceDetailActionsBar({
closeDrawer('invoice-detail-drawer');
};
+ // Handle convert to invoice.
+ const handleConvertToCreitNote = () => {
+ history.push(`/credit-notes/new?from_invoice_id=${invoiceId}`, {
+ invoiceId: invoiceId,
+ });
+ closeDrawer('invoice-detail-drawer');
+ };
+
// Handle delete sale invoice.
const handleDeleteInvoice = () => {
openAlert('invoice-delete', { invoiceId });
@@ -124,6 +138,7 @@ function InvoiceDetailActionsBar({
onBadDebt: handleBadDebtInvoice,
onCancelBadDebt: handleCancelBadDebtInvoice,
onNotifyViaSMS: handleNotifyViaSMS,
+ onConvert: handleConvertToCreitNote,
}}
/>
diff --git a/src/containers/Drawers/InvoiceDetailDrawer/utils.js b/src/containers/Drawers/InvoiceDetailDrawer/utils.js
index 3a8bdb695..0497cf1dc 100644
--- a/src/containers/Drawers/InvoiceDetailDrawer/utils.js
+++ b/src/containers/Drawers/InvoiceDetailDrawer/utils.js
@@ -76,7 +76,7 @@ export const useInvoiceReadonlyEntriesColumns = () =>
* @returns {React.JSX}
*/
export const BadDebtMenuItem = ({
- payload: { onCancelBadDebt, onBadDebt, onNotifyViaSMS },
+ payload: { onCancelBadDebt, onBadDebt, onNotifyViaSMS, onConvert },
}) => {
const { invoice } = useInvoiceDetailDrawerContext();
@@ -104,6 +104,12 @@ export const BadDebtMenuItem = ({
/>
+
+ }
+ />
+