mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 04:40:32 +00:00
Merge branch 'master' of https://github.com/abouolia/Ratteb
This commit is contained in:
@@ -10,7 +10,7 @@ export default function ({ children, isOpen, isClose, drawerProps }) {
|
||||
position={Position.RIGHT}
|
||||
canOutsideClickClose={true}
|
||||
canEscapeKeyClose={true}
|
||||
size={'65%'}
|
||||
size={'700px'}
|
||||
onClose={isClose}
|
||||
{...drawerProps}
|
||||
>
|
||||
|
||||
@@ -158,6 +158,7 @@ export function useExpensesTableColumns() {
|
||||
accessor: ExpenseAccountAccessor,
|
||||
width: 160,
|
||||
className: 'expense_account',
|
||||
disableSortBy: true,
|
||||
},
|
||||
{
|
||||
id: 'published',
|
||||
@@ -170,9 +171,9 @@ export function useExpensesTableColumns() {
|
||||
id: 'description',
|
||||
Header: formatMessage({ id: 'description' }),
|
||||
accessor: DescriptionAccessor,
|
||||
disableSorting: true,
|
||||
width: 150,
|
||||
className: 'description',
|
||||
disableSortBy: true,
|
||||
},
|
||||
{
|
||||
id: 'actions',
|
||||
|
||||
@@ -52,7 +52,6 @@ function ItemsCategoryTable({
|
||||
loading={isCategoriesLoading}
|
||||
headerLoading={isCategoriesLoading}
|
||||
progressBarLoading={isCategoriesFetching}
|
||||
manualSortBy={true}
|
||||
expandable={true}
|
||||
sticky={true}
|
||||
selectionColumn={true}
|
||||
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
MenuItem,
|
||||
} from '@blueprintjs/core';
|
||||
import { FormattedMessage as T } from 'react-intl';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import classNames from 'classnames';
|
||||
import { useFormikContext } from 'formik';
|
||||
import { usePaymentMadeFormContext } from './PaymentMadeFormProvider';
|
||||
@@ -21,8 +22,11 @@ import { Icon } from 'components';
|
||||
* Payment made floating actions bar.
|
||||
*/
|
||||
export default function PaymentMadeFloatingActions() {
|
||||
// History context.
|
||||
const history = useHistory();
|
||||
|
||||
// Formik context.
|
||||
const { isSubmitting } = useFormikContext();
|
||||
const { isSubmitting, resetForm } = useFormikContext();
|
||||
|
||||
// Payment made form context.
|
||||
const { setSubmitPayload, paymentMadeId } = usePaymentMadeFormContext();
|
||||
@@ -33,10 +37,14 @@ export default function PaymentMadeFloatingActions() {
|
||||
};
|
||||
|
||||
// Handle clear button click.
|
||||
const handleClearBtnClick = (event) => {};
|
||||
const handleClearBtnClick = (event) => {
|
||||
resetForm();
|
||||
};
|
||||
|
||||
// Handle cancel button click.
|
||||
const handleCancelBtnClick = (event) => {};
|
||||
const handleCancelBtnClick = (event) => {
|
||||
history.goBack();
|
||||
};
|
||||
|
||||
// Handle submit & new button click.
|
||||
const handleSubmitAndNewClick = (event) => {
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
Position,
|
||||
Classes,
|
||||
ControlGroup,
|
||||
Button
|
||||
Button,
|
||||
} from '@blueprintjs/core';
|
||||
import { DateInput } from '@blueprintjs/datetime';
|
||||
import { FastField, Field, useFormikContext, ErrorMessage } from 'formik';
|
||||
@@ -21,13 +21,14 @@ import {
|
||||
Money,
|
||||
Hint,
|
||||
Icon,
|
||||
MoneyInputGroup
|
||||
MoneyInputGroup,
|
||||
} from 'components';
|
||||
import withSettings from 'containers/Settings/withSettings';
|
||||
import { usePaymentMadeFormContext } from './PaymentMadeFormProvider';
|
||||
import {
|
||||
momentFormatter,
|
||||
tansformDateValue,
|
||||
handleDateChange,
|
||||
inputIntent,
|
||||
compose,
|
||||
safeSumBy,
|
||||
@@ -40,7 +41,10 @@ import {
|
||||
*/
|
||||
function PaymentMadeFormHeaderFields({ baseCurrency }) {
|
||||
// Formik form context.
|
||||
const { values: { entries }, setFieldValue } = useFormikContext();
|
||||
const {
|
||||
values: { entries },
|
||||
setFieldValue,
|
||||
} = useFormikContext();
|
||||
|
||||
// Payment made form context.
|
||||
const {
|
||||
@@ -49,10 +53,12 @@ function PaymentMadeFormHeaderFields({ baseCurrency }) {
|
||||
isNewMode,
|
||||
setPaymentVendorId,
|
||||
} = usePaymentMadeFormContext();
|
||||
|
||||
|
||||
// Sumation of payable full-amount.
|
||||
const payableFullAmount = useMemo(() => safeSumBy(entries, 'due_amount'), [entries]);
|
||||
|
||||
const payableFullAmount = useMemo(() => safeSumBy(entries, 'due_amount'), [
|
||||
entries,
|
||||
]);
|
||||
|
||||
// Handle receive full-amount click.
|
||||
const handleReceiveFullAmountClick = () => {
|
||||
const newEntries = fullAmountPaymentEntries(entries);
|
||||
@@ -97,7 +103,7 @@ function PaymentMadeFormHeaderFields({ baseCurrency }) {
|
||||
</FastField>
|
||||
|
||||
{/* ------------ Payment date ------------ */}
|
||||
<FastField name={'customer_id'}>
|
||||
<FastField name={'payment_date'}>
|
||||
{({ form, field: { value }, meta: { error, touched } }) => (
|
||||
<FormGroup
|
||||
label={<T id={'payment_date'} />}
|
||||
@@ -110,7 +116,9 @@ function PaymentMadeFormHeaderFields({ baseCurrency }) {
|
||||
<DateInput
|
||||
{...momentFormatter('YYYY/MM/DD')}
|
||||
value={tansformDateValue(value)}
|
||||
// onChange={handleDateChange('payment_date')}
|
||||
onChange={handleDateChange((formattedDate) => {
|
||||
form.setFieldValue('payment_date', formattedDate);
|
||||
})}
|
||||
popoverProps={{ position: Position.BOTTOM, minimal: true }}
|
||||
inputProps={{
|
||||
leftIcon: <Icon icon={'date-range'} />,
|
||||
|
||||
@@ -200,9 +200,9 @@ export function useEstiamtesTableColumns() {
|
||||
{
|
||||
id: 'reference_no',
|
||||
Header: formatMessage({ id: 'reference_no' }),
|
||||
accessor: 'reference_no',
|
||||
accessor: 'reference',
|
||||
width: 90,
|
||||
className: 'reference_no',
|
||||
className: 'reference',
|
||||
},
|
||||
{
|
||||
id: 'actions',
|
||||
|
||||
@@ -26,7 +26,7 @@ export default function PaymentReceiveFormFloatingActions() {
|
||||
const { setSubmitPayload, isNewMode } = usePaymentReceiveFormContext();
|
||||
|
||||
// Formik form context.
|
||||
const { isSubmitting, submitForm } = useFormikContext();
|
||||
const { isSubmitting, submitForm, resetForm } = useFormikContext();
|
||||
|
||||
// History context.
|
||||
const history = useHistory();
|
||||
@@ -38,7 +38,9 @@ export default function PaymentReceiveFormFloatingActions() {
|
||||
};
|
||||
|
||||
// Handle clear button click.
|
||||
const handleClearBtnClick = (event) => {};
|
||||
const handleClearBtnClick = (event) => {
|
||||
resetForm();
|
||||
};
|
||||
|
||||
// Handle cancel button click.
|
||||
const handleCancelBtnClick = (event) => {
|
||||
|
||||
@@ -1,22 +1,21 @@
|
||||
#page-size {
|
||||
margin: 0 auto;
|
||||
background-color: transparent;
|
||||
width: 21cm;
|
||||
// width: 680px;
|
||||
width: 680px;
|
||||
// width: 21cm;
|
||||
// height: 29.7cm;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
.template {
|
||||
background-color: transparent;
|
||||
margin: 20px;
|
||||
margin: 25px 20px;
|
||||
|
||||
&__header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
// margin: 0px 40px 16px 0px;
|
||||
margin: 0px 5px 15px 5px;
|
||||
margin: 0px 35px 20px 5px;
|
||||
&--title h1 {
|
||||
font-weight: 600;
|
||||
color: #1c4587;
|
||||
@@ -31,11 +30,9 @@
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
border-bottom: 2px solid #1155cc;
|
||||
padding-bottom: 35px;
|
||||
|
||||
padding: 2px 2px 30px;
|
||||
&__info {
|
||||
flex: 0 1 24%;
|
||||
// flex: 0 1 25%;
|
||||
padding-left: 5px;
|
||||
color: #999999;
|
||||
font-size: 16px;
|
||||
|
||||
@@ -209,7 +209,7 @@ export default class SaleEstimate extends TenantModel {
|
||||
},
|
||||
reference_no: {
|
||||
label: "Reference No.",
|
||||
column: "reference_no",
|
||||
column: "reference",
|
||||
columnType: "number",
|
||||
fieldType: "number",
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user