mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 14:50:32 +00:00
Merge branch 'develop' of https://github.com/bigcapitalhq/client into develop
This commit is contained in:
@@ -21,5 +21,5 @@ export const CommercialDocEntriesTable = styled(DataTable)`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
export const CommercialDocFooter = styled.div`
|
export const CommercialDocFooter = styled.div`
|
||||||
margin-top: 25px;
|
margin-top: 28px;
|
||||||
`;
|
`;
|
||||||
|
|||||||
67
src/containers/Alerts/Customers/CustomerActivateAlert.js
Normal file
67
src/containers/Alerts/Customers/CustomerActivateAlert.js
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { FormattedMessage as T } from 'components';
|
||||||
|
import intl from 'react-intl-universal';
|
||||||
|
import { Intent, Alert } from '@blueprintjs/core';
|
||||||
|
import { AppToaster } from 'components';
|
||||||
|
|
||||||
|
import { useActivateContact } from 'hooks/query';
|
||||||
|
|
||||||
|
import withAlertStoreConnect from 'containers/Alert/withAlertStoreConnect';
|
||||||
|
import withAlertActions from 'containers/Alert/withAlertActions';
|
||||||
|
|
||||||
|
import { compose } from 'utils';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customer activate alert.
|
||||||
|
*/
|
||||||
|
function CustomerActivateAlert({
|
||||||
|
name,
|
||||||
|
|
||||||
|
// #withAlertStoreConnect
|
||||||
|
isOpen,
|
||||||
|
payload: { customerId, service },
|
||||||
|
|
||||||
|
// #withAlertActions
|
||||||
|
closeAlert,
|
||||||
|
}) {
|
||||||
|
const { mutateAsync: activateContact, isLoading } = useActivateContact();
|
||||||
|
|
||||||
|
// Handle activate constomer alert cancel.
|
||||||
|
const handleCancelActivateCustomer = () => {
|
||||||
|
closeAlert(name);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Handle confirm customer activated.
|
||||||
|
const handleConfirmCustomerActivate = () => {
|
||||||
|
activateContact(customerId)
|
||||||
|
.then(() => {
|
||||||
|
AppToaster.show({
|
||||||
|
message: intl.get('customer.alert.activated_message'),
|
||||||
|
intent: Intent.SUCCESS,
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch((error) => {})
|
||||||
|
.finally(() => {
|
||||||
|
closeAlert(name);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Alert
|
||||||
|
cancelButtonText={<T id={'cancel'} />}
|
||||||
|
confirmButtonText={<T id={'activate'} />}
|
||||||
|
intent={Intent.WARNING}
|
||||||
|
isOpen={isOpen}
|
||||||
|
onCancel={handleCancelActivateCustomer}
|
||||||
|
loading={isLoading}
|
||||||
|
onConfirm={handleConfirmCustomerActivate}
|
||||||
|
>
|
||||||
|
<p>{intl.get('customer.alert.are_you_sure_want_to_activate_this_customer')}</p>
|
||||||
|
</Alert>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default compose(
|
||||||
|
withAlertStoreConnect(),
|
||||||
|
withAlertActions,
|
||||||
|
)(CustomerActivateAlert);
|
||||||
69
src/containers/Alerts/Customers/CustomerInactivateAlert.js
Normal file
69
src/containers/Alerts/Customers/CustomerInactivateAlert.js
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { FormattedMessage as T } from 'components';
|
||||||
|
import intl from 'react-intl-universal';
|
||||||
|
import { Intent, Alert } from '@blueprintjs/core';
|
||||||
|
import { AppToaster } from 'components';
|
||||||
|
|
||||||
|
import { useInactivateContact } from 'hooks/query';
|
||||||
|
|
||||||
|
import withAlertStoreConnect from 'containers/Alert/withAlertStoreConnect';
|
||||||
|
import withAlertActions from 'containers/Alert/withAlertActions';
|
||||||
|
|
||||||
|
import { compose } from 'utils';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* customer inactivate alert.
|
||||||
|
*/
|
||||||
|
function CustomerInactivateAlert({
|
||||||
|
name,
|
||||||
|
// #withAlertStoreConnect
|
||||||
|
isOpen,
|
||||||
|
payload: { customerId, service },
|
||||||
|
|
||||||
|
// #withAlertActions
|
||||||
|
closeAlert,
|
||||||
|
}) {
|
||||||
|
const { mutateAsync: inactivateContact, isLoading } = useInactivateContact();
|
||||||
|
|
||||||
|
// Handle cancel inactivate alert.
|
||||||
|
const handleCancelInactivateCustomer = () => {
|
||||||
|
closeAlert(name);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Handle confirm contact Inactive.
|
||||||
|
const handleConfirmCustomerInactive = () => {
|
||||||
|
inactivateContact(customerId)
|
||||||
|
.then(() => {
|
||||||
|
AppToaster.show({
|
||||||
|
message: intl.get('the_contact_has_been_inactivated_successfully'),
|
||||||
|
intent: Intent.SUCCESS,
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch((error) => {})
|
||||||
|
.finally(() => {
|
||||||
|
closeAlert(name);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Alert
|
||||||
|
cancelButtonText={<T id={'cancel'} />}
|
||||||
|
confirmButtonText={<T id={'inactivate'} />}
|
||||||
|
intent={Intent.WARNING}
|
||||||
|
isOpen={isOpen}
|
||||||
|
onCancel={handleCancelInactivateCustomer}
|
||||||
|
onConfirm={handleConfirmCustomerInactive}
|
||||||
|
loading={isLoading}
|
||||||
|
>
|
||||||
|
<p>
|
||||||
|
{intl.get(
|
||||||
|
'customer.alert.are_you_sure_want_to_inactivate_this_customer',
|
||||||
|
)}
|
||||||
|
</p>
|
||||||
|
</Alert>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
export default compose(
|
||||||
|
withAlertStoreConnect(),
|
||||||
|
withAlertActions,
|
||||||
|
)(CustomerInactivateAlert);
|
||||||
69
src/containers/Alerts/Vendors/VendorActivateAlert.js
Normal file
69
src/containers/Alerts/Vendors/VendorActivateAlert.js
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { FormattedMessage as T } from 'components';
|
||||||
|
import intl from 'react-intl-universal';
|
||||||
|
import { Intent, Alert } from '@blueprintjs/core';
|
||||||
|
import { AppToaster } from 'components';
|
||||||
|
|
||||||
|
import { useActivateContact } from 'hooks/query';
|
||||||
|
|
||||||
|
import withAlertStoreConnect from 'containers/Alert/withAlertStoreConnect';
|
||||||
|
import withAlertActions from 'containers/Alert/withAlertActions';
|
||||||
|
|
||||||
|
import { compose } from 'utils';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Vendor activate alert.
|
||||||
|
*/
|
||||||
|
function VendorActivateAlert({
|
||||||
|
name,
|
||||||
|
|
||||||
|
// #withAlertStoreConnect
|
||||||
|
isOpen,
|
||||||
|
payload: { vendorId },
|
||||||
|
|
||||||
|
// #withAlertActions
|
||||||
|
closeAlert,
|
||||||
|
}) {
|
||||||
|
const { mutateAsync: activateContact, isLoading } = useActivateContact();
|
||||||
|
|
||||||
|
// Handle activate vendor alert cancel.
|
||||||
|
const handleCancelActivateVendor = () => {
|
||||||
|
closeAlert(name);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Handle confirm vendor activated.
|
||||||
|
const handleConfirmVendorActivate = () => {
|
||||||
|
activateContact(vendorId)
|
||||||
|
.then(() => {
|
||||||
|
AppToaster.show({
|
||||||
|
message: intl.get('vendor.alert.activated_message'),
|
||||||
|
intent: Intent.SUCCESS,
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch((error) => {})
|
||||||
|
.finally(() => {
|
||||||
|
closeAlert(name);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Alert
|
||||||
|
cancelButtonText={<T id={'cancel'} />}
|
||||||
|
confirmButtonText={<T id={'activate'} />}
|
||||||
|
intent={Intent.WARNING}
|
||||||
|
isOpen={isOpen}
|
||||||
|
onCancel={handleCancelActivateVendor}
|
||||||
|
loading={isLoading}
|
||||||
|
onConfirm={handleConfirmVendorActivate}
|
||||||
|
>
|
||||||
|
<p>
|
||||||
|
{intl.get('vendor.alert.are_you_sure_want_to_activate_this_vendor')}
|
||||||
|
</p>
|
||||||
|
</Alert>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default compose(
|
||||||
|
withAlertStoreConnect(),
|
||||||
|
withAlertActions,
|
||||||
|
)(VendorActivateAlert);
|
||||||
68
src/containers/Alerts/Vendors/VendorInactivateAlert.js
Normal file
68
src/containers/Alerts/Vendors/VendorInactivateAlert.js
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { FormattedMessage as T } from 'components';
|
||||||
|
import intl from 'react-intl-universal';
|
||||||
|
import { Intent, Alert } from '@blueprintjs/core';
|
||||||
|
import { AppToaster } from 'components';
|
||||||
|
|
||||||
|
import { useInactivateContact } from 'hooks/query';
|
||||||
|
|
||||||
|
import withAlertStoreConnect from 'containers/Alert/withAlertStoreConnect';
|
||||||
|
import withAlertActions from 'containers/Alert/withAlertActions';
|
||||||
|
|
||||||
|
import { compose } from 'utils';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Vendor inactivate alert.
|
||||||
|
*/
|
||||||
|
function VendorInactivateAlert({
|
||||||
|
name,
|
||||||
|
// #withAlertStoreConnect
|
||||||
|
isOpen,
|
||||||
|
payload: { vendorId },
|
||||||
|
|
||||||
|
// #withAlertActions
|
||||||
|
closeAlert,
|
||||||
|
}) {
|
||||||
|
const { mutateAsync: inactivateContact, isLoading } = useInactivateContact();
|
||||||
|
|
||||||
|
// Handle cancel inactivate alert.
|
||||||
|
const handleCancelInactivateVendor = () => {
|
||||||
|
closeAlert(name);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Handle confirm contact Inactive.
|
||||||
|
const handleConfirmVendorInactive = () => {
|
||||||
|
inactivateContact(vendorId)
|
||||||
|
.then(() => {
|
||||||
|
AppToaster.show({
|
||||||
|
message: intl.get('vendor.alert.inactivated_message'),
|
||||||
|
intent: Intent.SUCCESS,
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch((error) => {})
|
||||||
|
.finally(() => {
|
||||||
|
closeAlert(name);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Alert
|
||||||
|
cancelButtonText={<T id={'cancel'} />}
|
||||||
|
confirmButtonText={<T id={'inactivate'} />}
|
||||||
|
intent={Intent.WARNING}
|
||||||
|
isOpen={isOpen}
|
||||||
|
onCancel={handleCancelInactivateVendor}
|
||||||
|
onConfirm={handleConfirmVendorInactive}
|
||||||
|
loading={isLoading}
|
||||||
|
>
|
||||||
|
<p>
|
||||||
|
{intl.get('vendor.alert.are_you_sure_want_to_inactivate_this_vendor')}
|
||||||
|
</p>
|
||||||
|
</Alert>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default compose(
|
||||||
|
withAlertStoreConnect(),
|
||||||
|
withAlertActions,
|
||||||
|
)(VendorInactivateAlert);
|
||||||
@@ -3,11 +3,11 @@ import React from 'react';
|
|||||||
const CustomerDeleteAlert = React.lazy(() =>
|
const CustomerDeleteAlert = React.lazy(() =>
|
||||||
import('../Alerts/Customers/CustomerDeleteAlert'),
|
import('../Alerts/Customers/CustomerDeleteAlert'),
|
||||||
);
|
);
|
||||||
const ContactActivateAlert = React.lazy(() =>
|
const CustomerActivateAlert = React.lazy(() =>
|
||||||
import('../Alerts/Contacts/ContactActivateAlert'),
|
import('../Alerts/Customers/CustomerActivateAlert'),
|
||||||
);
|
);
|
||||||
const ContactInactivateAlert = React.lazy(() =>
|
const CustomerInactivateAlert = React.lazy(() =>
|
||||||
import('../Alerts/Contacts/ContactInactivateAlert'),
|
import('../Alerts/Customers/CustomerInactivateAlert'),
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -15,6 +15,6 @@ const ContactInactivateAlert = React.lazy(() =>
|
|||||||
*/
|
*/
|
||||||
export default [
|
export default [
|
||||||
{ name: 'customer-delete', component: CustomerDeleteAlert },
|
{ name: 'customer-delete', component: CustomerDeleteAlert },
|
||||||
{ name: 'contact-activate', component: ContactActivateAlert },
|
{ name: 'customer-activate', component: CustomerActivateAlert },
|
||||||
{ name: 'contact-inactivate', component: ContactInactivateAlert },
|
{ name: 'customer-inactivate', component: CustomerInactivateAlert },
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -89,15 +89,17 @@ function CustomersTable({
|
|||||||
|
|
||||||
// Handle cancel/confirm inactive.
|
// Handle cancel/confirm inactive.
|
||||||
const handleInactiveCustomer = ({ id, contact_service }) => {
|
const handleInactiveCustomer = ({ id, contact_service }) => {
|
||||||
openAlert('contact-inactivate', {
|
openAlert('customer-inactivate', {
|
||||||
contactId: id,
|
customerId: id,
|
||||||
service: contact_service,
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// Handle cancel/confirm activate.
|
// Handle cancel/confirm activate.
|
||||||
const handleActivateCustomer = ({ id, contact_service }) => {
|
const handleActivateCustomer = ({ id, contact_service }) => {
|
||||||
openAlert('contact-activate', { contactId: id, service: contact_service });
|
openAlert('customer-activate', {
|
||||||
|
customerId: id,
|
||||||
|
service: contact_service,
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// Handle view detail contact.
|
// Handle view detail contact.
|
||||||
|
|||||||
@@ -15,9 +15,14 @@ import { useCreditNoteDetailDrawerContext } from './CreditNoteDetailDrawerProvid
|
|||||||
*/
|
*/
|
||||||
export default function CreditNoteDetailFooter() {
|
export default function CreditNoteDetailFooter() {
|
||||||
const { creditNote } = useCreditNoteDetailDrawerContext();
|
const { creditNote } = useCreditNoteDetailDrawerContext();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<CommercialDocFooter>
|
<CommercialDocFooter>
|
||||||
<DetailsMenu direction={'horizantal'} minLabelSize={'180px'}>
|
<DetailsMenu direction={'horizantal'} minLabelSize={'180px'}>
|
||||||
|
<If condition={creditNote.terms_conditions}>
|
||||||
|
<DetailItem label={<T id={'note'} />} children={creditNote.note} />
|
||||||
|
</If>
|
||||||
|
|
||||||
<If condition={creditNote.terms_conditions}>
|
<If condition={creditNote.terms_conditions}>
|
||||||
<DetailItem label={<T id={'terms_conditions'} />}>
|
<DetailItem label={<T id={'terms_conditions'} />}>
|
||||||
{creditNote.terms_conditions}
|
{creditNote.terms_conditions}
|
||||||
|
|||||||
@@ -42,6 +42,12 @@ export default function CreditNoteDetailHeader() {
|
|||||||
<Row>
|
<Row>
|
||||||
<Col xs={6}>
|
<Col xs={6}>
|
||||||
<DetailsMenu direction={'horizantal'} minLabelSize={'180px'}>
|
<DetailsMenu direction={'horizantal'} minLabelSize={'180px'}>
|
||||||
|
<DetailItem
|
||||||
|
label={intl.get('credit_note.drawer.label_credit_note_date')}
|
||||||
|
>
|
||||||
|
<FormatDate value={creditNote.formatted_credit_note_date} />
|
||||||
|
</DetailItem>
|
||||||
|
|
||||||
<DetailItem
|
<DetailItem
|
||||||
label={intl.get('credit_note.drawer.label_credit_note_no')}
|
label={intl.get('credit_note.drawer.label_credit_note_no')}
|
||||||
>
|
>
|
||||||
@@ -53,12 +59,6 @@ export default function CreditNoteDetailHeader() {
|
|||||||
{creditNote.customer?.display_name}
|
{creditNote.customer?.display_name}
|
||||||
</CustomerDrawerLink>
|
</CustomerDrawerLink>
|
||||||
</DetailItem>
|
</DetailItem>
|
||||||
|
|
||||||
<DetailItem
|
|
||||||
label={intl.get('credit_note.drawer.label_credit_note_date')}
|
|
||||||
>
|
|
||||||
<FormatDate value={creditNote.formatted_credit_note_date} />
|
|
||||||
</DetailItem>
|
|
||||||
</DetailsMenu>
|
</DetailsMenu>
|
||||||
</Col>
|
</Col>
|
||||||
|
|
||||||
@@ -77,11 +77,6 @@ export default function CreditNoteDetailHeader() {
|
|||||||
label={intl.get('reference')}
|
label={intl.get('reference')}
|
||||||
children={defaultTo(creditNote.reference_no, '-')}
|
children={defaultTo(creditNote.reference_no, '-')}
|
||||||
/>
|
/>
|
||||||
<DetailItem
|
|
||||||
label={intl.get('note')}
|
|
||||||
children={defaultTo(creditNote.note, '-')}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<DetailItem
|
<DetailItem
|
||||||
label={<T id={'credit_note.drawer.label_created_at'} />}
|
label={<T id={'credit_note.drawer.label_created_at'} />}
|
||||||
children={<FormatDate value={creditNote.created_at} />}
|
children={<FormatDate value={creditNote.created_at} />}
|
||||||
|
|||||||
@@ -1,42 +1,29 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import styled from 'styled-components';
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
T,
|
T,
|
||||||
TotalLines,
|
CommercialDocFooter,
|
||||||
TotalLine,
|
DetailsMenu,
|
||||||
TotalLineBorderStyle,
|
If,
|
||||||
TotalLineTextStyle,
|
DetailItem,
|
||||||
} from 'components';
|
} from 'components';
|
||||||
import { usePaymentMadeDetailContext } from './PaymentMadeDetailProvider';
|
import { usePaymentMadeDetailContext } from './PaymentMadeDetailProvider';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Payment made - Details panel - Footer.
|
* Payment made - Details panel - Footer.
|
||||||
*/
|
*/
|
||||||
export default function PaymentMadeDetailFooter() {
|
export function PaymentMadeDetailFooter() {
|
||||||
const { paymentMade } = usePaymentMadeDetailContext();
|
const { paymentMade } = usePaymentMadeDetailContext();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PaymentMadeFooterRoot>
|
<CommercialDocFooter>
|
||||||
<PaymentMadeTotalLines labelColWidth={'180px'} amountColWidth={'180px'}>
|
<DetailsMenu direction={'horizantal'} minLabelSize={'180px'}>
|
||||||
<TotalLine
|
<If condition={paymentMade.statement}>
|
||||||
title={<T id={'payment_made.details.subtotal'} />}
|
<DetailItem label={<T id={'payment_made.details.statement'} />}>
|
||||||
value={paymentMade.amount}
|
{paymentMade.statement}
|
||||||
borderStyle={TotalLineBorderStyle.SingleDark}
|
</DetailItem>
|
||||||
/>
|
</If>
|
||||||
<TotalLine
|
</DetailsMenu>
|
||||||
title={<T id={'payment_made.details.total'} />}
|
</CommercialDocFooter>
|
||||||
value={paymentMade.formatted_amount}
|
|
||||||
borderStyle={TotalLineBorderStyle.DoubleDark}
|
|
||||||
textStyle={TotalLineTextStyle.Bold}
|
|
||||||
/>
|
|
||||||
</PaymentMadeTotalLines>
|
|
||||||
</PaymentMadeFooterRoot>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export const PaymentMadeFooterRoot = styled.div``;
|
|
||||||
|
|
||||||
export const PaymentMadeTotalLines = styled(TotalLines)`
|
|
||||||
margin-left: auto;
|
|
||||||
`;
|
|
||||||
|
|||||||
@@ -34,6 +34,10 @@ export default function PaymentMadeDetailHeader() {
|
|||||||
<Row>
|
<Row>
|
||||||
<Col xs={6}>
|
<Col xs={6}>
|
||||||
<DetailsMenu direction={'horizantal'} minLabelSize={'180px'}>
|
<DetailsMenu direction={'horizantal'} minLabelSize={'180px'}>
|
||||||
|
<DetailItem
|
||||||
|
label={intl.get('payment_date')}
|
||||||
|
children={<FormatDate value={paymentMade.payment_date} />}
|
||||||
|
/>
|
||||||
<DetailItem
|
<DetailItem
|
||||||
label={intl.get('payment_made.details.payment_number')}
|
label={intl.get('payment_made.details.payment_number')}
|
||||||
children={defaultTo(paymentMade.payment_number, '-')}
|
children={defaultTo(paymentMade.payment_number, '-')}
|
||||||
@@ -47,11 +51,6 @@ export default function PaymentMadeDetailHeader() {
|
|||||||
label={intl.get('payment_account')}
|
label={intl.get('payment_account')}
|
||||||
children={paymentMade.payment_account?.name}
|
children={paymentMade.payment_account?.name}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<DetailItem
|
|
||||||
label={intl.get('payment_date')}
|
|
||||||
children={<FormatDate value={paymentMade.payment_date} />}
|
|
||||||
/>
|
|
||||||
</DetailsMenu>
|
</DetailsMenu>
|
||||||
</Col>
|
</Col>
|
||||||
<Col xs={6}>
|
<Col xs={6}>
|
||||||
@@ -61,8 +60,8 @@ export default function PaymentMadeDetailHeader() {
|
|||||||
minLabelSize={'180px'}
|
minLabelSize={'180px'}
|
||||||
>
|
>
|
||||||
<DetailItem
|
<DetailItem
|
||||||
label={intl.get('description')}
|
label={intl.get('reference')}
|
||||||
children={defaultTo(paymentMade.statement, '-')}
|
children={defaultTo(paymentMade.reference, '-')}
|
||||||
/>
|
/>
|
||||||
<DetailItem
|
<DetailItem
|
||||||
label={intl.get('created_at')}
|
label={intl.get('created_at')}
|
||||||
|
|||||||
@@ -20,8 +20,7 @@ function PaymentMadeDetailProvider({ paymentMadeId, ...props }) {
|
|||||||
enabled: !!paymentMadeId,
|
enabled: !!paymentMadeId,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
// Provider state.
|
||||||
//provider.
|
|
||||||
const provider = {
|
const provider = {
|
||||||
paymentMadeId,
|
paymentMadeId,
|
||||||
paymentMade,
|
paymentMade,
|
||||||
|
|||||||
@@ -4,7 +4,8 @@ import { CommercialDocBox } from 'components';
|
|||||||
|
|
||||||
import PaymentMadeDetailHeader from './PaymentMadeDetailHeader';
|
import PaymentMadeDetailHeader from './PaymentMadeDetailHeader';
|
||||||
import PaymentMadeDetailTable from './PaymentMadeDetailTable';
|
import PaymentMadeDetailTable from './PaymentMadeDetailTable';
|
||||||
import PaymentMadeDetailFooter from './PaymentMadeDetailFooter';
|
import PaymentMadeDetailTableFooter from './PaymentMadeDetailTableFooter';
|
||||||
|
import { PaymentMadeDetailFooter } from './PaymentMadeDetailFooter';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Payment made detail tab.
|
* Payment made detail tab.
|
||||||
@@ -15,6 +16,7 @@ export default function PaymentMadeDetailTab() {
|
|||||||
<CommercialDocBox>
|
<CommercialDocBox>
|
||||||
<PaymentMadeDetailHeader />
|
<PaymentMadeDetailHeader />
|
||||||
<PaymentMadeDetailTable />
|
<PaymentMadeDetailTable />
|
||||||
|
<PaymentMadeDetailTableFooter />
|
||||||
<PaymentMadeDetailFooter />
|
<PaymentMadeDetailFooter />
|
||||||
</CommercialDocBox>
|
</CommercialDocBox>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import styled from 'styled-components';
|
||||||
|
|
||||||
|
import {
|
||||||
|
T,
|
||||||
|
TotalLines,
|
||||||
|
TotalLine,
|
||||||
|
TotalLineBorderStyle,
|
||||||
|
TotalLineTextStyle,
|
||||||
|
} from 'components';
|
||||||
|
import { usePaymentMadeDetailContext } from './PaymentMadeDetailProvider';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Payment made - Details panel - Footer.
|
||||||
|
*/
|
||||||
|
export default function PaymentMadeDetailTableFooter() {
|
||||||
|
const { paymentMade } = usePaymentMadeDetailContext();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<PaymentMadeFooterRoot>
|
||||||
|
<PaymentMadeTotalLines labelColWidth={'180px'} amountColWidth={'180px'}>
|
||||||
|
<TotalLine
|
||||||
|
title={<T id={'payment_made.details.subtotal'} />}
|
||||||
|
value={paymentMade.amount}
|
||||||
|
borderStyle={TotalLineBorderStyle.SingleDark}
|
||||||
|
/>
|
||||||
|
<TotalLine
|
||||||
|
title={<T id={'payment_made.details.total'} />}
|
||||||
|
value={paymentMade.formatted_amount}
|
||||||
|
borderStyle={TotalLineBorderStyle.DoubleDark}
|
||||||
|
textStyle={TotalLineTextStyle.Bold}
|
||||||
|
/>
|
||||||
|
</PaymentMadeTotalLines>
|
||||||
|
</PaymentMadeFooterRoot>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export const PaymentMadeFooterRoot = styled.div``;
|
||||||
|
|
||||||
|
export const PaymentMadeTotalLines = styled(TotalLines)`
|
||||||
|
margin-left: auto;
|
||||||
|
`;
|
||||||
@@ -10,7 +10,6 @@ import {
|
|||||||
DetailItem,
|
DetailItem,
|
||||||
CommercialDocHeader,
|
CommercialDocHeader,
|
||||||
CommercialDocTopHeader,
|
CommercialDocTopHeader,
|
||||||
ButtonLink,
|
|
||||||
CustomerDrawerLink,
|
CustomerDrawerLink,
|
||||||
} from 'components';
|
} from 'components';
|
||||||
import { usePaymentReceiveDetailContext } from './PaymentReceiveDetailProvider';
|
import { usePaymentReceiveDetailContext } from './PaymentReceiveDetailProvider';
|
||||||
@@ -34,6 +33,10 @@ export default function PaymentReceiveDetailHeader() {
|
|||||||
<Row>
|
<Row>
|
||||||
<Col xs={6}>
|
<Col xs={6}>
|
||||||
<DetailsMenu direction={'horizantal'} minLabelSize={'180px'}>
|
<DetailsMenu direction={'horizantal'} minLabelSize={'180px'}>
|
||||||
|
<DetailItem
|
||||||
|
label={intl.get('payment_date')}
|
||||||
|
children={<FormatDate value={paymentReceive.payment_date} />}
|
||||||
|
/>
|
||||||
<DetailItem
|
<DetailItem
|
||||||
label={intl.get('payment_receive.details.payment_number')}
|
label={intl.get('payment_receive.details.payment_number')}
|
||||||
children={defaultTo(paymentReceive.payment_receive_no, '-')}
|
children={defaultTo(paymentReceive.payment_receive_no, '-')}
|
||||||
@@ -48,10 +51,6 @@ export default function PaymentReceiveDetailHeader() {
|
|||||||
label={intl.get('deposit_account')}
|
label={intl.get('deposit_account')}
|
||||||
children={paymentReceive.deposit_account?.name}
|
children={paymentReceive.deposit_account?.name}
|
||||||
/>
|
/>
|
||||||
<DetailItem
|
|
||||||
label={intl.get('payment_date')}
|
|
||||||
children={<FormatDate value={paymentReceive.payment_date} />}
|
|
||||||
/>
|
|
||||||
</DetailsMenu>
|
</DetailsMenu>
|
||||||
</Col>
|
</Col>
|
||||||
|
|
||||||
@@ -62,8 +61,8 @@ export default function PaymentReceiveDetailHeader() {
|
|||||||
minLabelSize={'180px'}
|
minLabelSize={'180px'}
|
||||||
>
|
>
|
||||||
<DetailItem
|
<DetailItem
|
||||||
label={intl.get('description')}
|
label={intl.get('reference')}
|
||||||
children={defaultTo(paymentReceive.statement, '—')}
|
children={defaultTo(paymentReceive.reference_no, '-')}
|
||||||
/>
|
/>
|
||||||
<DetailItem
|
<DetailItem
|
||||||
label={intl.get('created_at')}
|
label={intl.get('created_at')}
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import {
|
||||||
|
CommercialDocFooter,
|
||||||
|
T,
|
||||||
|
If,
|
||||||
|
DetailsMenu,
|
||||||
|
DetailItem,
|
||||||
|
} from '../../../components';
|
||||||
|
import { useVendorCreditDetailDrawerContext } from './VendorCreditDetailDrawerProvider';
|
||||||
|
|
||||||
|
export function VendorCreditDetailFooter() {
|
||||||
|
const { vendorCredit } = useVendorCreditDetailDrawerContext();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<CommercialDocFooter>
|
||||||
|
<DetailsMenu direction={'horizantal'} minLabelSize={'150px'}>
|
||||||
|
<If condition={vendorCredit.note}>
|
||||||
|
<DetailItem label={<T id={'note'} />} children={vendorCredit.note} />
|
||||||
|
</If>
|
||||||
|
</DetailsMenu>
|
||||||
|
</CommercialDocFooter>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -38,6 +38,11 @@ export default function VendorCreditDetailHeader() {
|
|||||||
<Row>
|
<Row>
|
||||||
<Col xs={6}>
|
<Col xs={6}>
|
||||||
<DetailsMenu direction={'horizantal'} minLabelSize={'180px'}>
|
<DetailsMenu direction={'horizantal'} minLabelSize={'180px'}>
|
||||||
|
<DetailItem
|
||||||
|
label={intl.get('vendor_credit.drawer.label_vendor_credit_date')}
|
||||||
|
>
|
||||||
|
<FormatDate value={vendorCredit.formatted_vendor_credit_date} />
|
||||||
|
</DetailItem>
|
||||||
<DetailItem
|
<DetailItem
|
||||||
label={intl.get('vendor_credit.drawer.label_vendor_credit_no')}
|
label={intl.get('vendor_credit.drawer.label_vendor_credit_no')}
|
||||||
>
|
>
|
||||||
@@ -49,12 +54,6 @@ export default function VendorCreditDetailHeader() {
|
|||||||
{vendorCredit.vendor?.display_name}
|
{vendorCredit.vendor?.display_name}
|
||||||
</VendorDrawerLink>
|
</VendorDrawerLink>
|
||||||
</DetailItem>
|
</DetailItem>
|
||||||
|
|
||||||
<DetailItem
|
|
||||||
label={intl.get('vendor_credit.drawer.label_vendor_credit_date')}
|
|
||||||
>
|
|
||||||
<FormatDate value={vendorCredit.formatted_vendor_credit_date} />
|
|
||||||
</DetailItem>
|
|
||||||
</DetailsMenu>
|
</DetailsMenu>
|
||||||
</Col>
|
</Col>
|
||||||
<Col xs={6}>
|
<Col xs={6}>
|
||||||
@@ -72,10 +71,6 @@ export default function VendorCreditDetailHeader() {
|
|||||||
label={intl.get('reference')}
|
label={intl.get('reference')}
|
||||||
children={defaultTo(vendorCredit.reference_no, '-')}
|
children={defaultTo(vendorCredit.reference_no, '-')}
|
||||||
/>
|
/>
|
||||||
<DetailItem
|
|
||||||
label={intl.get('note')}
|
|
||||||
children={defaultTo(vendorCredit.note, '-')}
|
|
||||||
/>
|
|
||||||
<DetailItem
|
<DetailItem
|
||||||
label={<T id={'vendor_credit.drawer.label_created_at'} />}
|
label={<T id={'vendor_credit.drawer.label_created_at'} />}
|
||||||
children={<FormatDate value={vendorCredit.created_at} />}
|
children={<FormatDate value={vendorCredit.created_at} />}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import { CommercialDocBox } from 'components';
|
|||||||
import VendorCreditDetailHeader from './VendorCreditDetailHeader';
|
import VendorCreditDetailHeader from './VendorCreditDetailHeader';
|
||||||
import VendorCreditDetailTable from './VendorCreditDetailTable';
|
import VendorCreditDetailTable from './VendorCreditDetailTable';
|
||||||
import VendorCreditDetailDrawerFooter from './VendorCreditDetailDrawerFooter';
|
import VendorCreditDetailDrawerFooter from './VendorCreditDetailDrawerFooter';
|
||||||
|
import { VendorCreditDetailFooter } from './VendorCreditDetailFooter';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Vendor credit details panel.
|
* Vendor credit details panel.
|
||||||
@@ -16,6 +17,7 @@ export default function VendorCreditDetailPanel() {
|
|||||||
<VendorCreditDetailHeader />
|
<VendorCreditDetailHeader />
|
||||||
<VendorCreditDetailTable />
|
<VendorCreditDetailTable />
|
||||||
<VendorCreditDetailDrawerFooter />
|
<VendorCreditDetailDrawerFooter />
|
||||||
|
<VendorCreditDetailFooter />
|
||||||
</CommercialDocBox>
|
</CommercialDocBox>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,12 +11,11 @@ const InvoicesDrawerContent = lazy(() => import('./InvoiceDrawerContent'));
|
|||||||
*/
|
*/
|
||||||
function InvoiceDrawer({
|
function InvoiceDrawer({
|
||||||
name,
|
name,
|
||||||
|
|
||||||
//#withDrawer
|
//#withDrawer
|
||||||
isOpen,
|
isOpen,
|
||||||
payload: { invoiceId },
|
payload: { invoiceId },
|
||||||
|
|
||||||
}) {
|
}) {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Drawer isOpen={isOpen} name={name}>
|
<Drawer isOpen={isOpen} name={name}>
|
||||||
<DrawerSuspense>
|
<DrawerSuspense>
|
||||||
|
|||||||
@@ -3,15 +3,15 @@ import React from 'react';
|
|||||||
const VendorDeleteAlert = React.lazy(() =>
|
const VendorDeleteAlert = React.lazy(() =>
|
||||||
import('../Alerts/Vendors/VendorDeleteAlert'),
|
import('../Alerts/Vendors/VendorDeleteAlert'),
|
||||||
);
|
);
|
||||||
const ContactActivateAlert = React.lazy(() =>
|
const VendorActivateAlert = React.lazy(() =>
|
||||||
import('../Alerts/Contacts/ContactActivateAlert'),
|
import('../Alerts/Vendors/VendorActivateAlert'),
|
||||||
);
|
);
|
||||||
const ContactInactivateAlert = React.lazy(() =>
|
const VendorInactivateAlert = React.lazy(() =>
|
||||||
import('../Alerts/Contacts/ContactInactivateAlert'),
|
import('../Alerts/Vendors/VendorInactivateAlert'),
|
||||||
);
|
);
|
||||||
|
|
||||||
export default [
|
export default [
|
||||||
{ name: 'vendor-delete', component: VendorDeleteAlert },
|
{ name: 'vendor-delete', component: VendorDeleteAlert },
|
||||||
{ name: 'contact-activate', component: ContactActivateAlert },
|
{ name: 'vendor-activate', component: VendorActivateAlert },
|
||||||
{ name: 'contact-inactivate', component: ContactInactivateAlert },
|
{ name: 'vendor-inactivate', component: VendorInactivateAlert },
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -67,15 +67,15 @@ function VendorsTable({
|
|||||||
|
|
||||||
// Handle cancel/confirm inactive.
|
// Handle cancel/confirm inactive.
|
||||||
const handleInactiveVendor = ({ id, contact_service }) => {
|
const handleInactiveVendor = ({ id, contact_service }) => {
|
||||||
openAlert('contact-inactivate', {
|
openAlert('vendor-inactivate', {
|
||||||
contactId: id,
|
vendorId: id,
|
||||||
service: contact_service,
|
service: contact_service,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// Handle cancel/confirm activate.
|
// Handle cancel/confirm activate.
|
||||||
const handleActivateVendor = ({ id, contact_service }) => {
|
const handleActivateVendor = ({ id, contact_service }) => {
|
||||||
openAlert('contact-activate', { contactId: id, service: contact_service });
|
openAlert('vendor-activate', { vendorId: id, service: contact_service });
|
||||||
};
|
};
|
||||||
|
|
||||||
// Handle click delete vendor.
|
// Handle click delete vendor.
|
||||||
|
|||||||
@@ -1758,6 +1758,17 @@
|
|||||||
"global_error.you_dont_have_permissions": "ليس لديك صلاحية الوصول إلى هذه الصفحة.",
|
"global_error.you_dont_have_permissions": "ليس لديك صلاحية الوصول إلى هذه الصفحة.",
|
||||||
"global_error.transactions_locked": "تم قفل المعاملات التي تمت قبل {lockedToDate}. ومن ثم لا يمكن القيام بأي عمل.",
|
"global_error.transactions_locked": "تم قفل المعاملات التي تمت قبل {lockedToDate}. ومن ثم لا يمكن القيام بأي عمل.",
|
||||||
"global_error.authorized_user_inactive": "المستخدم المصرح له تم تعطيلة.",
|
"global_error.authorized_user_inactive": "المستخدم المصرح له تم تعطيلة.",
|
||||||
|
|
||||||
|
"vendor.alert.activated_message": "تم تفعيل المورد بنجاح.",
|
||||||
|
"vendor.alert.are_you_sure_want_to_activate_this_vendor": "هل أنت متأكد أنك تريد تفعيل هذا المورد؟ ستتمكن من تعطيله لاحقًا",
|
||||||
|
"vendor.alert.inactivated_message": "تم إلغاء تنشيط المورد بنجاح.",
|
||||||
|
"vendor.alert.are_you_sure_want_to_inactivate_this_vendor":"هل أنت متأكد أنك تريد إلغاء تنشيط هذا المورد؟ ستكون قادرًا على تنشيطه لاحقًا",
|
||||||
|
|
||||||
|
"customer.alert.activated_message":"تم تفعيل الزبون بنجاح.",
|
||||||
|
"customer.alert.are_you_sure_want_to_activate_this_customer": "هل أنت متأكد أنك تريد تفعيل هذا الزبون؟ ستتمكن من تعطيله لاحقًا",
|
||||||
|
"customer.alert.inactivated_message": "تم إلغاء تنشيط الزبون بنجاح.",
|
||||||
|
"customer.alert.are_you_sure_want_to_inactivate_this_customer":"هل أنت متأكد أنك تريد إلغاء تنشيط هذا الزبون؟ ستكون قادرًا على تنشيطه لاحقًا",
|
||||||
|
|
||||||
"credit_note_preview.dialog.title":"معاينة إشعار الدائن PDF",
|
"credit_note_preview.dialog.title":"معاينة إشعار الدائن PDF",
|
||||||
"payment_receive_preview.dialog.title":"معاينة سند الزبون PDF"
|
"payment_receive_preview.dialog.title":"معاينة سند الزبون PDF"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1193,6 +1193,7 @@
|
|||||||
"payment_made.details.payment_number": "Payment #",
|
"payment_made.details.payment_number": "Payment #",
|
||||||
"payment_made.details.subtotal": "Subtotal",
|
"payment_made.details.subtotal": "Subtotal",
|
||||||
"payment_made.details.total": "TOTAL",
|
"payment_made.details.total": "TOTAL",
|
||||||
|
"payment_made.details.statement": "Statement",
|
||||||
"payment_receive.details.payment_number": "Payment #",
|
"payment_receive.details.payment_number": "Payment #",
|
||||||
"payment_receive.details.total": "TOTAL",
|
"payment_receive.details.total": "TOTAL",
|
||||||
"payment_receive.details.subtotal": "Subtotal",
|
"payment_receive.details.subtotal": "Subtotal",
|
||||||
@@ -1734,10 +1735,22 @@
|
|||||||
"payment_made.drawer.title": "Payment made details {number}",
|
"payment_made.drawer.title": "Payment made details {number}",
|
||||||
"manual_journal.drawer.title": "Manual journal details ({number})",
|
"manual_journal.drawer.title": "Manual journal details ({number})",
|
||||||
"expense.drawer.title": "Expense details",
|
"expense.drawer.title": "Expense details",
|
||||||
|
|
||||||
"global_error.you_dont_have_permissions": "You do not have permissions to access this page.",
|
"global_error.you_dont_have_permissions": "You do not have permissions to access this page.",
|
||||||
"global_error.transactions_locked": "Transactions before {lockedToDate} has been locked. Hence action cannot be performed.",
|
"global_error.transactions_locked": "Transactions before {lockedToDate} has been locked. Hence action cannot be performed.",
|
||||||
"global_error.authorized_user_inactive": "The authorized user is inactive.",
|
"global_error.authorized_user_inactive": "The authorized user is inactive.",
|
||||||
|
|
||||||
|
"the_vendor_has_been_inactivated_successfully": "The contact has been inactivated successfully.",
|
||||||
|
|
||||||
|
"vendor.alert.activated_message": "The vendor has been activated successfully.",
|
||||||
|
"vendor.alert.are_you_sure_want_to_inactivate_this_vendor":"Are you sure want to inactivate this vendor? You will to able to activate it later.",
|
||||||
|
"vendor.alert.inactivated_message": "The vendor has been inactivated successfully.",
|
||||||
|
"vendor.alert.are_you_sure_want_to_activate_this_vendor": "Are you sure want to activate this vendor? You will to able to inactivate it later.",
|
||||||
|
|
||||||
|
"customer.alert.activated_message":"The customer has been activated successfully.",
|
||||||
|
"customer.alert.are_you_sure_want_to_activate_this_customer": "Are you sure want to activate this customer? You will to able to inactivate it later.",
|
||||||
|
"customer.alert.inactivated_message": "The customer has been inactivated successfully.",
|
||||||
|
"customer.alert.are_you_sure_want_to_inactivate_this_customer":"Are you sure want to inactivate this customer? You will to able to activate it later.",
|
||||||
|
|
||||||
"credit_note_preview.dialog.title":"Credit Note PDF Preview",
|
"credit_note_preview.dialog.title":"Credit Note PDF Preview",
|
||||||
"payment_receive_preview.dialog.title":"Payment Receive PDF Preview"
|
"payment_receive_preview.dialog.title":"Payment Receive PDF Preview"
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user