mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 05:10:31 +00:00
fix: notes.
This commit is contained in:
@@ -27,9 +27,6 @@ function ReconcileCreditNoteFormFloatingActions({
|
||||
return (
|
||||
<div className={Classes.DIALOG_FOOTER}>
|
||||
<div className={Classes.DIALOG_FOOTER_ACTIONS}>
|
||||
<Button onClick={handleCancelBtnClick} style={{ minWidth: '85px' }}>
|
||||
<T id={'cancel'} />
|
||||
</Button>
|
||||
<Button
|
||||
intent={Intent.PRIMARY}
|
||||
style={{ minWidth: '95px' }}
|
||||
@@ -38,6 +35,9 @@ function ReconcileCreditNoteFormFloatingActions({
|
||||
>
|
||||
{<T id={'save'} />}
|
||||
</Button>
|
||||
<Button onClick={handleCancelBtnClick} style={{ minWidth: '85px' }}>
|
||||
<T id={'cancel'} />
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -20,12 +20,10 @@ function ReconcileVendorCreditFloatingActions({
|
||||
const handleCancelBtnClick = (event) => {
|
||||
closeDialog(dialogName);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className={Classes.DIALOG_FOOTER}>
|
||||
<div className={Classes.DIALOG_FOOTER_ACTIONS}>
|
||||
<Button onClick={handleCancelBtnClick} style={{ minWidth: '85px' }}>
|
||||
<T id={'cancel'} />
|
||||
</Button>
|
||||
<Button
|
||||
intent={Intent.PRIMARY}
|
||||
style={{ minWidth: '95px' }}
|
||||
@@ -34,6 +32,9 @@ function ReconcileVendorCreditFloatingActions({
|
||||
>
|
||||
{<T id={'save'} />}
|
||||
</Button>
|
||||
<Button onClick={handleCancelBtnClick} style={{ minWidth: '85px' }}>
|
||||
<T id={'cancel'} />
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -28,7 +28,7 @@ export default function CreditNoteDetail() {
|
||||
panel={<RefundCreditNoteTransactionsTable />}
|
||||
/>
|
||||
<Tab
|
||||
title={intl.get('credit_note.drawer.label_reconcile_transactions')}
|
||||
title={intl.get('credit_note.drawer.label_invoices_reconciled')}
|
||||
id={'reconcile_transactions'}
|
||||
panel={<ReconcileCreditNoteTransactionsTable />}
|
||||
/>
|
||||
|
||||
@@ -13,7 +13,7 @@ import CreditNoteDetailCls from '../../../style/components/Drawers/CreditNoteDet
|
||||
*/
|
||||
export default function CreditNoteDetailHeader() {
|
||||
const { creditNote } = useCreditNoteDetailDrawerContext();
|
||||
|
||||
|
||||
return (
|
||||
<div className={clsx(CreditNoteDetailCls.detail_panel_header)}>
|
||||
<DetailsMenu>
|
||||
@@ -37,13 +37,17 @@ export default function CreditNoteDetailHeader() {
|
||||
</DetailsMenu>
|
||||
|
||||
<DetailsMenu direction={'horizantal'} minLabelSize={'140px'}>
|
||||
<DetailItem
|
||||
label={intl.get('credit_note.drawer.label_credits_remaining')}
|
||||
children={creditNote.formatted_credits_remaining}
|
||||
/>
|
||||
<DetailItem
|
||||
label={intl.get('note')}
|
||||
children={defaultTo(creditNote.note, '-')}
|
||||
/>
|
||||
|
||||
<DetailItem
|
||||
label={<T id={'credit_note.drawer.label_create_at'} />}
|
||||
label={<T id={'credit_note.drawer.label_created_at'} />}
|
||||
children={<FormatDate value={creditNote.created_at} />}
|
||||
/>
|
||||
</DetailsMenu>
|
||||
|
||||
@@ -5,6 +5,7 @@ import { DrawerMainTabs } from 'components';
|
||||
|
||||
import VendorCreditDetailPanel from './VendorCreditDetailPanel';
|
||||
import RefundVendorCreditTransactionsTable from './RefundVendorCreditTransactions/RefundVendorCreditTransactionsTable';
|
||||
import ReconcileVendorCreditTransactionsTable from './ReconcileVendorCreditTransactions/ReconcileVendorCreditTransactionsTable';
|
||||
import clsx from 'classnames';
|
||||
|
||||
import VendorCreditDetailCls from '../../../style/components/Drawers/VendorCreditDetail.module.scss';
|
||||
@@ -22,10 +23,15 @@ export default function VendorCreditDetail() {
|
||||
panel={<VendorCreditDetailPanel />}
|
||||
/>
|
||||
<Tab
|
||||
title={intl.get('credit_note.drawer.label_refund_transactions')}
|
||||
title={intl.get('vendor_credit.drawer.label_refund_transactions')}
|
||||
id={'refund_transactions'}
|
||||
panel={<RefundVendorCreditTransactionsTable />}
|
||||
/>
|
||||
<Tab
|
||||
title={intl.get('vendor_credit.drawer.label_bills_reconciled')}
|
||||
id={'reconcile_transactions'}
|
||||
panel={<ReconcileVendorCreditTransactionsTable />}
|
||||
/>
|
||||
</DrawerMainTabs>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
import React from 'react';
|
||||
import intl from 'react-intl-universal';
|
||||
import { useVendorCredit, useRefundVendorCredit } from 'hooks/query';
|
||||
import {
|
||||
useVendorCredit,
|
||||
useRefundVendorCredit,
|
||||
useReconcileVendorCredits,
|
||||
} from 'hooks/query';
|
||||
import { DrawerHeaderContent, DrawerLoading } from 'components';
|
||||
|
||||
const VendorCreditDetailDrawerContext = React.createContext();
|
||||
@@ -24,9 +28,19 @@ function VendorCreditDetailDrawerProvider({ vendorCreditId, ...props }) {
|
||||
enabled: !!vendorCreditId,
|
||||
});
|
||||
|
||||
// Handle fetch refund credit note.
|
||||
const {
|
||||
data: reconcileVendorCredits,
|
||||
isFetching: isReconcileVendorCreditFetching,
|
||||
isLoading: isReconcileVendorCreditLoading,
|
||||
} = useReconcileVendorCredits(vendorCreditId, {
|
||||
enabled: !!vendorCreditId,
|
||||
});
|
||||
|
||||
const provider = {
|
||||
vendorCredit,
|
||||
refundVendorCredit,
|
||||
reconcileVendorCredits,
|
||||
isRefundVendorCreditLoading,
|
||||
isRefundVendorCreditFetching,
|
||||
vendorCreditId,
|
||||
@@ -34,7 +48,11 @@ function VendorCreditDetailDrawerProvider({ vendorCreditId, ...props }) {
|
||||
|
||||
return (
|
||||
<DrawerLoading
|
||||
loading={isVendorCreditLoading || isRefundVendorCreditLoading}
|
||||
loading={
|
||||
isVendorCreditLoading ||
|
||||
isRefundVendorCreditLoading ||
|
||||
isReconcileVendorCreditLoading
|
||||
}
|
||||
>
|
||||
<DrawerHeaderContent
|
||||
name="vendor-credit-detail-drawer"
|
||||
|
||||
@@ -36,13 +36,19 @@ export default function VendorCreditDetailHeader() {
|
||||
</DetailsMenu>
|
||||
|
||||
<DetailsMenu direction={'horizantal'} minLabelSize={'140px'}>
|
||||
<DetailItem
|
||||
label={intl.get('vendor_credit.drawer.label_credits_remaining')}
|
||||
children={vendorCredit.credits_remaining}
|
||||
// children={vendorCredit.formatted_credits_remaining}
|
||||
/>
|
||||
|
||||
<DetailItem
|
||||
label={intl.get('note')}
|
||||
children={defaultTo(vendorCredit.note, '-')}
|
||||
/>
|
||||
|
||||
<DetailItem
|
||||
label={<T id={'vendor_credit.drawer.label_create_at'} />}
|
||||
label={<T id={'vendor_credit.drawer.label_created_at'} />}
|
||||
children={<FormatDate value={vendorCredit.created_at} />}
|
||||
/>
|
||||
</DetailsMenu>
|
||||
|
||||
@@ -31,7 +31,7 @@ function VendorCreditNoteFormHeader({
|
||||
<div className={classNames(CLASSES.PAGE_FORM_HEADER)}>
|
||||
<VendorCreditNoteFormHeaderFields />
|
||||
<PageFormBigNumber
|
||||
label={intl.get('due_amount')}
|
||||
label={intl.get('vendor_credits.label.amount_to_credit')}
|
||||
amount={totalAmount}
|
||||
currencyCode={base_currency}
|
||||
/>
|
||||
@@ -39,6 +39,4 @@ function VendorCreditNoteFormHeader({
|
||||
);
|
||||
}
|
||||
|
||||
export default compose(withCurrentOrganization())(
|
||||
VendorCreditNoteFormHeader,
|
||||
);
|
||||
export default compose(withCurrentOrganization())(VendorCreditNoteFormHeader);
|
||||
|
||||
@@ -33,7 +33,7 @@ export function ActionsMenu({
|
||||
text={intl.get('vendor_credits.action.edit_vendor_credit')}
|
||||
onClick={safeCallback(onEdit, original)}
|
||||
/>
|
||||
<If condition={!original.is_closed && !original.is_draft}>
|
||||
<If condition={!original.is_closed && original.is_published}>
|
||||
<MenuItem
|
||||
icon={<Icon icon="quick-payment-16" />}
|
||||
text={intl.get('vendor_credits.action.refund_vendor_credit')}
|
||||
@@ -43,16 +43,17 @@ export function ActionsMenu({
|
||||
<If condition={original.is_draft}>
|
||||
<MenuItem
|
||||
icon={<Icon icon={'check'} iconSize={18} />}
|
||||
text={intl.get('mark_as_opened')}
|
||||
text={intl.get('vendor_credits.action.mark_as_open')}
|
||||
onClick={safeCallback(onOpen, original)}
|
||||
/>
|
||||
</If>
|
||||
<MenuItem
|
||||
text={'Reconcile Credit Note With bills'}
|
||||
// icon={<Icon icon="quick-payment-16" />}
|
||||
// text={intl.get('credit_note.action.refund_credit_note')}
|
||||
onClick={safeCallback(onReconcile, original)}
|
||||
/>
|
||||
<If condition={!original.is_draft && original.is_published}>
|
||||
<MenuItem
|
||||
// icon={<Icon icon="quick-payment-16" />}
|
||||
text={intl.get('vendor_credits.action.reconcile_with_bills')}
|
||||
onClick={safeCallback(onReconcile, original)}
|
||||
/>
|
||||
</If>
|
||||
<MenuItem
|
||||
text={intl.get('vendor_credits.action.delete_vendor_credit')}
|
||||
intent={Intent.DANGER}
|
||||
@@ -136,6 +137,16 @@ export function useVendorsCreditNoteTableColumns() {
|
||||
textOverview: true,
|
||||
className: clsx(CLASSES.FONT_BOLD),
|
||||
},
|
||||
{
|
||||
id: 'balance',
|
||||
Header: intl.get('balance'),
|
||||
accessor: 'credits_remaining',
|
||||
width: 120,
|
||||
align: 'right',
|
||||
clickable: true,
|
||||
textOverview: true,
|
||||
className: clsx(CLASSES.FONT_BOLD),
|
||||
},
|
||||
{
|
||||
id: 'status',
|
||||
Header: intl.get('status'),
|
||||
|
||||
@@ -12,6 +12,10 @@ const OpenVendorCreditAlert = React.lazy(() =>
|
||||
import('../../Alerts/VendorCeditNotes/VendorCreditOpenedAlert'),
|
||||
);
|
||||
|
||||
const ReconcileVendorCreditDeleteAlert = React.lazy(() =>
|
||||
import('../../Alerts/VendorCeditNotes/ReconcileVendorCreditDeleteAlert'),
|
||||
);
|
||||
|
||||
/**
|
||||
* Vendor Credit notes alerts.
|
||||
*/
|
||||
@@ -28,4 +32,8 @@ export default [
|
||||
name: 'refund-vendor-delete',
|
||||
component: RefundVendorCreditDeleteAlert,
|
||||
},
|
||||
{
|
||||
name: 'reconcile-vendor-delete',
|
||||
component: ReconcileVendorCreditDeleteAlert,
|
||||
},
|
||||
];
|
||||
|
||||
@@ -31,7 +31,7 @@ function CreditNoteFormHeader({
|
||||
<div className={classNames(CLASSES.PAGE_FORM_HEADER)}>
|
||||
<CreditNoteFormHeaderFields />
|
||||
<PageFormBigNumber
|
||||
label={intl.get('due_amount')}
|
||||
label={intl.get('credit_note.label_amount_to_credit')}
|
||||
amount={totalAmount}
|
||||
currencyCode={base_currency}
|
||||
/>
|
||||
|
||||
@@ -30,7 +30,7 @@ export function ActionsMenu({
|
||||
text={intl.get('credit_note.action.edit_credit_note')}
|
||||
onClick={safeCallback(onEdit, original)}
|
||||
/>
|
||||
<If condition={!original.is_closed && !original.is_draft}>
|
||||
<If condition={!original.is_closed && original.is_published}>
|
||||
<MenuItem
|
||||
icon={<Icon icon="quick-payment-16" />}
|
||||
text={intl.get('credit_note.action.refund_credit_note')}
|
||||
@@ -40,16 +40,17 @@ export function ActionsMenu({
|
||||
<If condition={original.is_draft}>
|
||||
<MenuItem
|
||||
icon={<Icon icon={'check'} iconSize={18} />}
|
||||
text={intl.get('mark_as_opened')}
|
||||
text={intl.get('credit_note.action.make_as_open')}
|
||||
onClick={safeCallback(onOpen, original)}
|
||||
/>
|
||||
</If>
|
||||
<MenuItem
|
||||
text={'Reconcile Credit Note With Invoice'}
|
||||
// icon={<Icon icon="quick-payment-16" />}
|
||||
// text={intl.get('credit_note.action.refund_credit_note')}
|
||||
onClick={safeCallback(onReconcile, original)}
|
||||
/>
|
||||
<If condition={!original.is_draft && original.is_published}>
|
||||
<MenuItem
|
||||
text={intl.get('credit_note.action.reconcile_with_invoices')}
|
||||
// icon={<Icon icon="quick-payment-16" />}
|
||||
onClick={safeCallback(onReconcile, original)}
|
||||
/>
|
||||
</If>
|
||||
<MenuItem
|
||||
text={intl.get('credit_note.action.delete_credit_note')}
|
||||
intent={Intent.DANGER}
|
||||
@@ -133,6 +134,16 @@ export function useCreditNoteTableColumns() {
|
||||
textOverview: true,
|
||||
className: clsx(CLASSES.FONT_BOLD),
|
||||
},
|
||||
{
|
||||
id: 'balance',
|
||||
Header: intl.get('balance'),
|
||||
accessor: 'formatted_credits_remaining',
|
||||
width: 120,
|
||||
align: 'right',
|
||||
clickable: true,
|
||||
textOverview: true,
|
||||
className: clsx(CLASSES.FONT_BOLD),
|
||||
},
|
||||
{
|
||||
id: 'status',
|
||||
Header: intl.get('status'),
|
||||
@@ -144,7 +155,7 @@ export function useCreditNoteTableColumns() {
|
||||
{
|
||||
id: 'reference_no',
|
||||
Header: intl.get('reference_no'),
|
||||
accessor: 'reference_no',
|
||||
accessor: 'reference_no', // or note
|
||||
width: 90,
|
||||
className: 'reference_no',
|
||||
clickable: true,
|
||||
|
||||
Reference in New Issue
Block a user