feat: payment receive paper.

This commit is contained in:
elforjani3
2021-02-06 21:02:57 +02:00
parent 855134312e
commit 8d185f834e
7 changed files with 154 additions and 47 deletions

View File

@@ -2,6 +2,7 @@ import React from 'react';
import EstimateDrawer from 'containers/Sales/Estimate/EstimateDrawer';
import InvoiceDrawer from 'containers/Sales/Invoice/InvoiceDrawer';
import ReceiptDrawer from 'containers/Sales/Receipt/ReceiptDrawer';
import PaymentReceive from 'containers/Sales/PaymentReceive/PaymentReceiveDrawer';
export default function DrawersContainer() {
return (
@@ -9,6 +10,7 @@ export default function DrawersContainer() {
<EstimateDrawer name={'estimate-drawer'} />
<InvoiceDrawer name={'invoice-drawer'} />
<ReceiptDrawer name={'receipt-drawer'} />
<PaymentReceive name={'payment-receive-drawer'} />
</div>
);
}

View File

@@ -0,0 +1,102 @@
import React from 'react';
import { Icon } from 'components';
import 'style/components/Drawer/DrawerTemplate.scss';
export default function PaymentPaperTemplate({ labels: propLabels }) {
const labels = {
title: 'Payment receive',
billedTo: 'Billed to',
paymentDate: 'Payment date',
paymentNo: 'Payment No.',
billedFrom: 'Billed from',
referenceNo: 'Reference No',
amountReceived: 'Amount received',
...propLabels,
};
return (
<div id={'page-size'}>
<div className={'template'}>
<div className={'template__header'}>
<div className={'template__header--title'}>
<h1>{labels.title}</h1>
<p>info@bigcapital.ly </p>
</div>
<Icon icon="bigcapital" height={30} width={200} />
</div>
<div className="template__content">
<div className="template__content__info">
<span> {labels.billedTo} </span>
<p className={'info-paragraph'}>Step Currency</p>
</div>
<div className="template__content__info">
<span> {labels.paymentDate} </span>
<p className={'info-paragraph'}>1/1/2022</p>
</div>
<div className="template__content__info">
<span> {labels.paymentNo} </span>
<p className={'info-paragraph'}>IN-2022</p>
</div>
<div className="template__content__info">
<span> {labels.amountReceived} </span>
<p className={'info-paragraph-amount'}>60,000 USD</p>
</div>
<div className="template__content__info">
<span> {labels.billedFrom} </span>
<p className={'info-paragraph'}> Klay Thompson</p>
</div>
<div className="template__content__info">
<span> {labels.referenceNo} </span>
<p className={'info-paragraph'}></p>
</div>
</div>
<div className="template__table">
<div className="template__table__rows">
<span className="template__table__rows--cell-payment-receive ">
Invoice number
</span>
<span className="template__table__rows--cell-payment-receive ">
Invoice date
</span>
<span className="template__table__rows--cell-payment-receive ">
Invoice amount
</span>
<span className="template__table__rows--cell-payment-receive ">
Payment amount
</span>
</div>
<div className="template__table__rows">
<span className="template__table__rows--cell-payment-receive">
INV-1
</span>
<span className="template__table__rows--cell-payment-receive">
12 Jan 2021
</span>
<span className="template__table__rows--cell-payment-receive">
50,000 USD
</span>
<span className="template__table__rows--cell-payment-receive">
1000 USD
</span>
</div>
<div className="template__table__rows">
<span className="template__table__rows--cell-payment-receive">
INV-2{' '}
</span>
<span className="template__table__rows--cell-payment-receive">
12 Jan 2021
</span>
<span className="template__table__rows--cell-payment-receive">
50,000 USD
</span>
<span className="template__table__rows--cell-payment-receive">
1000 USD
</span>
</div>
</div>
</div>
</div>
);
}

View File

@@ -0,0 +1,29 @@
import React from 'react';
import DrawerTemplate from 'containers/Drawers/DrawerTemplate';
import PaymentPaperTemplate from 'containers/Drawers/PaymentPaperTemplate';
import withDrawers from 'containers/Drawer/withDrawers';
import withDrawerActions from 'containers/Drawer/withDrawerActions';
import { compose } from 'utils';
function PaymentReceiveDrawer({
name,
//#withDrawer
isOpen,
payload,
closeDrawer,
}) {
// handle close Drawer
const handleDrawerClose = () => {
closeDrawer(name);
};
return (
<DrawerTemplate isOpen={isOpen} isClose={handleDrawerClose}>
<PaymentPaperTemplate />
</DrawerTemplate>
);
}
export default compose(withDrawers(), withDrawerActions)(PaymentReceiveDrawer);

View File

@@ -43,10 +43,11 @@ function PaymentReceivesDataTable({
// #withSettings
baseCurrency,
// #OwnProps
onEditPaymentReceive,
onDeletePaymentReceive,
onDrawerPaymentReceive,
onSelectedRowsChange,
}) {
const isLoaded = useIsValuePassed(paymentReceivesLoading, false);
@@ -105,6 +106,10 @@ function PaymentReceivesDataTable({
text={formatMessage({ id: 'edit_payment_receive' })}
onClick={handleEditPaymentReceive(paymentReceive)}
/>
<MenuItem
text={formatMessage({ id: 'payment_receive_paper' })}
onClick={() => onDrawerPaymentReceive()}
/>
<MenuItem
text={formatMessage({ id: 'delete_payment_receive' })}
intent={Intent.DANGER}

View File

@@ -15,6 +15,7 @@ import withResourceActions from 'containers/Resources/withResourcesActions';
import withPaymentReceives from './withPaymentReceives';
import withPaymentReceivesActions from './withPaymentReceivesActions';
import withAlertsActions from 'containers/Alert/withAlertActions';
import withDrawerActions from 'containers/Drawer/withDrawerActions';
import { compose } from 'utils';
@@ -28,6 +29,9 @@ function PaymentReceiveList({
// #withAlertsActions.
openAlert,
// #withDrawerActions
openDrawer,
//#withPaymentReceivesActions
requestFetchPaymentReceiveTable,
}) {
@@ -56,6 +60,10 @@ function PaymentReceiveList({
history.push(`/payment-receives/${payment.id}/edit`);
});
const handlePaymentReceiveDrawer = useCallback(() => {
openDrawer('payment-receive-drawer', {});
}, [openDrawer]);
// Handle filter change to re-fetch data-table.
const handleFilterChanged = useCallback(() => {}, [fetchPaymentReceives]);
@@ -86,6 +94,7 @@ function PaymentReceiveList({
<PaymentReceivesDataTable
onDeletePaymentReceive={handleDeletePaymentReceive}
onEditPaymentReceive={handleEditPaymentReceive}
onDrawerPaymentReceive={handlePaymentReceiveDrawer}
onSelectedRowsChange={handleSelectedRowsChange}
/>
</Route>
@@ -104,4 +113,5 @@ export default compose(
paymentReceivesTableQuery,
})),
withAlertsActions,
withDrawerActions,
)(PaymentReceiveList);

View File

@@ -973,4 +973,5 @@ export default {
invoice_paper: 'Invoice Paper',
receipt_paper: 'Receipt Paper',
payable_aging_summary: 'Payable Aging Summary',
payment_receive_paper: 'Payment Receive Paper',
};

View File

@@ -18,6 +18,7 @@
justify-content: space-between;
margin: 0px 40px 16px 0px;
&--title h1 {
font-weight: 600;
color: #1c4587;
margin: 0;
}
@@ -54,52 +55,6 @@
color: #000;
}
}
// &__content {
// display: flex;
// flex-wrap: wrap;
// border-bottom: 2px solid #1155cc;
// padding-bottom: 45px;
// &--info {
// flex: 0 1 25%;
// padding-left: 5px;
// margin-bottom: 10px;
// }
// &--info > span {
// color: #999999;
// font-size: 16px;
// }
// &--info > p:not(.-info--amount) {
// color: #000;
// font-size: 14px;
// }
// // span {
// // color: #999999;
// // font-size: 16px;
// // }
// // p {
// // color: #000;
// // }
// .info--amount {
// color: #123163;
// }
// p {
// // font-size: 16px;
// // font-weight: 500;
// // margin: 5px 0px;
// color: #000;
// }
// &--amount {
// color: #123163;
// color: red;
// // margin-top: 8px;
// // font-size: 25px;
// // font-weight: 700;
// }
}
&__table {
@@ -117,6 +72,9 @@
&--cell {
flex: 0 20%;
}
&--cell-payment-receive {
flex: 1;
}
&--cell:first-child {
flex: 1 0 20%;