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