Compare commits

...

14 Commits

Author SHA1 Message Date
Ahmed Bouhuolia
0868eeaa0e Merge pull request #353 from ANasouf/BIG-112-Customer-emails-addresses-gets-the-.-removed-when-a-new-one-is-added
fix: gmail email addresses dots gets removed
2024-02-10 23:39:18 +02:00
a.nasouf
17dbe9713b fix: remove normalizeEmail function 2024-02-10 19:59:12 +02:00
Ahmed Bouhuolia
ecaf8c99bb Merge pull request #354 from ANasouf/BIG-109-some-keywords-are-not-localized
fix: some keywords are not localized
2024-02-08 20:12:27 +02:00
Ahmed Bouhuolia
90bde20674 Merge pull request #358 from bigcapitalhq/big-127-amount-decimals-are-set-to-zero-when-creating-an-new-payment
fix: payment receive subtotal shouldn't be rounded
2024-02-06 20:39:27 +02:00
Ahmed Bouhuolia
0c61f85707 chore: remove format number from estimate quantity 2024-02-06 20:38:25 +02:00
Ahmed Bouhuolia
0f678e61c5 fix: Decimal amounts are rounded when create a new transaction on some transactions types 2024-02-06 20:31:48 +02:00
Ahmed Bouhuolia
374f1acf8a fix: payment receive subtotal shouldn't be rounded 2024-02-06 10:54:41 +02:00
Ahmed Bouhuolia
ada1428193 Merge pull request #357 from bigcapitalhq/big-139-trial-balance-total-row-shouldnt-show-if-accounts-have-no
fix(server): Trial balance total row shouldn't show if accounts have no balances
2024-02-05 23:05:02 +02:00
Ahmed Bouhuolia
528d447443 fix(server): Trial balance total row shouldn't show if accounts have no balances 2024-02-05 23:04:02 +02:00
Ahmed Bouhuolia
d6d67b9a51 Merge pull request #355 from bigcapitalhq/big-126-invalid-bill-payment-amount-on-editing-bill-payment
fix: Invalid bill payment amount on editing bill payment
2024-02-05 22:39:52 +02:00
a.nasouf
f7f77b12c9 fix: file formatting 2024-02-05 20:05:10 +02:00
a.nasouf
a6db4fb6df fix: some keywords are not localized 2024-02-05 19:52:48 +02:00
a.nasouf
b38020d397 fix: gmail email addresses dots gets removed 2024-02-05 18:58:02 +02:00
Ahmed Bouhuolia
d090d5a026 Merge pull request #352 from bigcapitalhq/big-138-revert-the-paid-amount-to-bill-transaction-after-editing
fix(server): Revert the paid amount to bill transaction after editing bill payment amount
2024-02-05 18:52:09 +02:00
26 changed files with 113 additions and 57 deletions

View File

@@ -26,27 +26,27 @@ export default class ContactsController extends BaseController {
[...this.autocompleteQuerySchema],
this.validationResult,
this.asyncMiddleware(this.autocompleteContacts.bind(this)),
this.dynamicListService.handlerErrorsToResponse
this.dynamicListService.handlerErrorsToResponse,
);
router.get(
'/:id',
[param('id').exists().isNumeric().toInt()],
this.validationResult,
this.asyncMiddleware(this.getContact.bind(this))
this.asyncMiddleware(this.getContact.bind(this)),
);
router.post(
'/:id/inactivate',
[param('id').exists().isNumeric().toInt()],
this.validationResult,
this.asyncMiddleware(this.inactivateContact.bind(this)),
this.handlerServiceErrors
this.handlerServiceErrors,
);
router.post(
'/:id/activate',
[param('id').exists().isNumeric().toInt()],
this.validationResult,
this.asyncMiddleware(this.activateContact.bind(this)),
this.handlerServiceErrors
this.handlerServiceErrors,
);
return router;
}
@@ -77,7 +77,7 @@ export default class ContactsController extends BaseController {
try {
const contact = await this.contactsService.getContact(
tenantId,
contactId
contactId,
);
return res.status(200).send({
customer: this.transfromToResponse(contact),
@@ -105,7 +105,7 @@ export default class ContactsController extends BaseController {
try {
const contacts = await this.contactsService.autocompleteContacts(
tenantId,
filter
filter,
);
return res.status(200).send({ contacts });
} catch (error) {
@@ -153,7 +153,6 @@ export default class ContactsController extends BaseController {
check('email')
.optional({ nullable: true })
.isString()
.normalizeEmail()
.isEmail()
.isLength({ max: DATATYPES_LENGTH.STRING }),
check('website')
@@ -380,7 +379,7 @@ export default class ContactsController extends BaseController {
error: Error,
req: Request,
res: Response,
next: NextFunction
next: NextFunction,
) {
if (error instanceof ServiceError) {
if (error.errorType === 'contact_not_found') {

View File

@@ -14,6 +14,7 @@ export class CreditNoteTransformer extends Transformer {
'formattedCreditNoteDate',
'formattedAmount',
'formattedCreditsUsed',
'formattedSubtotal',
'entries',
];
};
@@ -60,6 +61,15 @@ export class CreditNoteTransformer extends Transformer {
});
};
/**
* Retrieves the formatted subtotal.
* @param {ICreditNote} credit
* @returns {string}
*/
protected formattedSubtotal = (credit): string => {
return formatNumber(credit.amount, { money: false });
};
/**
* Retrieves the entries of the credit note.
* @param {ICreditNote} credit

View File

@@ -252,10 +252,6 @@ export default class TrialBalanceSheet extends FinancialSheet {
* @return {ITrialBalanceSheetData}
*/
public reportData(): ITrialBalanceSheetData {
// Don't return noting if the journal has no transactions.
if (this.repository.totalAccountsLedger.isEmpty()) {
return null;
}
// Retrieve accounts nodes.
const accounts = this.accountsSection(this.repository.accounts);

View File

@@ -46,7 +46,7 @@ export class TrialBalanceSheetTable extends R.compose(
this.query = query;
this.i18n = i18n;
}
/**
* Retrieve the common columns for all report nodes.
* @param {ITableColumnAccessor[]}
@@ -123,7 +123,7 @@ export class TrialBalanceSheetTable extends R.compose(
*/
public tableRows = (): ITableRow[] => {
return R.compose(
R.append(this.totalTableRow()),
R.unless(R.isEmpty, R.append(this.totalTableRow())),
R.concat(this.accountsTableRows())
)([]);
};

View File

@@ -11,6 +11,7 @@ export class VendorCreditTransformer extends Transformer {
public includeAttributes = (): string[] => {
return [
'formattedAmount',
'formattedSubtotal',
'formattedVendorCreditDate',
'formattedCreditsRemaining',
'entries',
@@ -37,6 +38,15 @@ export class VendorCreditTransformer extends Transformer {
});
};
/**
* Retrieves the vendor credit formatted subtotal.
* @param {IVendorCredit} vendorCredit
* @returns {string}
*/
protected formattedSubtotal = (vendorCredit): string => {
return formatNumber(vendorCredit.amount, { money: false });
};
/**
* Retrieve formatted credits remaining.
* @param {IVendorCredit} credit

View File

@@ -10,6 +10,7 @@ export class SaleEstimateTransfromer extends Transformer {
*/
public includeAttributes = (): string[] => {
return [
'formattedSubtotal',
'formattedAmount',
'formattedEstimateDate',
'formattedExpirationDate',
@@ -76,6 +77,15 @@ export class SaleEstimateTransfromer extends Transformer {
});
};
/**
* Retrieves the formatted invoice subtotal.
* @param {ISaleEstimate} estimate
* @returns {string}
*/
protected formattedSubtotal = (estimate: ISaleEstimate): string => {
return formatNumber(estimate.amount, { money: false });
};
/**
* Retrieves the entries of the sale estimate.
* @param {ISaleEstimate} estimate

View File

@@ -8,7 +8,16 @@ export class ItemEntryTransformer extends Transformer {
* @returns {Array}
*/
public includeAttributes = (): string[] => {
return ['rateFormatted', 'totalFormatted'];
return ['quantityFormatted', 'rateFormatted', 'totalFormatted'];
};
/**
* Retrieves the formatted quantitty of item entry.
* @param {IItemEntry} entry
* @returns {string}
*/
protected quantityFormatted = (entry: IItemEntry): string => {
return formatNumber(entry.quantity, { money: false });
};
/**

View File

@@ -10,6 +10,7 @@ export class PaymentReceiveTransfromer extends Transformer {
*/
public includeAttributes = (): string[] => {
return [
'subtotalFormatted',
'formattedPaymentDate',
'formattedAmount',
'formattedExchangeRate',
@@ -26,6 +27,18 @@ export class PaymentReceiveTransfromer extends Transformer {
return this.formatDate(payment.paymentDate);
};
/**
* Retrieve the formatted payment subtotal.
* @param {IPaymentReceive} payment
* @returns {string}
*/
protected subtotalFormatted = (payment: IPaymentReceive): string => {
return formatNumber(payment.amount, {
currencyCode: payment.currencyCode,
money: false,
});
};
/**
* Retrieve formatted payment amount.
* @param {ISaleInvoice} invoice

View File

@@ -12,6 +12,7 @@ export class SaleReceiptTransformer extends Transformer {
*/
public includeAttributes = (): string[] => {
return [
'formattedSubtotal',
'formattedAmount',
'formattedReceiptDate',
'formattedClosedAtDate',
@@ -37,6 +38,15 @@ export class SaleReceiptTransformer extends Transformer {
return this.formatDate(receipt.closedAt);
};
/**
* Retrieves the estimate formatted subtotal.
* @param {ISaleReceipt} receipt
* @returns {string}
*/
protected formattedSubtotal = (receipt: ISaleReceipt): string => {
return formatNumber(receipt.amount, { money: false });
};
/**
* Retrieve formatted invoice amount.
* @param {ISaleReceipt} estimate

View File

@@ -66,7 +66,7 @@ export function DetailItem({ label, children, name, align, className }) {
>
{label}
</div>
<div class="detail-item__content">{children}</div>
<div>{children}</div>
</div>
);
}

View File

@@ -70,7 +70,7 @@ function LoginFooterLinks() {
<AuthFooterLinks>
{!signupDisabled && (
<AuthFooterLink>
Don't have an account? <Link to={'/auth/register'}>Sign up</Link>
<T id={'dont_have_an_account'} /> <Link to={'/auth/register'}><T id={'sign_up'} /></Link>
</AuthFooterLink>
)}
<AuthFooterLink>

View File

@@ -87,7 +87,7 @@ function RegisterFooterLinks() {
return (
<AuthFooterLinks>
<AuthFooterLink>
Return to <Link to={'/auth/login'}>Sign In</Link>
<T id={'return_to'} /> <Link to={'/auth/login'}><T id={'sign_in'} /></Link>
</AuthFooterLink>
<AuthFooterLink>

View File

@@ -5,7 +5,7 @@ import { Formik } from 'formik';
import { Intent, Position } from '@blueprintjs/core';
import { Link, useParams, useHistory } from 'react-router-dom';
import { AppToaster } from '@/components';
import { AppToaster, FormattedMessage as T } from '@/components';
import { useAuthResetPassword } from '@/hooks/query';
import AuthInsider from '@/containers/Authentication/AuthInsider';
@@ -86,11 +86,11 @@ function ResetPasswordFooterLinks() {
<AuthFooterLinks>
{!signupDisabled && (
<AuthFooterLink>
Don't have an account? <Link to={'/auth/register'}>Sign up</Link>
<T id={'dont_have_an_account'} /> <Link to={'/auth/register'}><T id={'sign_up'} /></Link>
</AuthFooterLink>
)}
<AuthFooterLink>
Return to <Link to={'/auth/login'}>Sign In</Link>
<T id={'return_to'} /> <Link to={'/auth/login'}><T id={'sign_in'} /></Link>
</AuthFooterLink>
</AuthFooterLinks>
);

View File

@@ -5,7 +5,7 @@ import { Formik } from 'formik';
import { Link, useHistory } from 'react-router-dom';
import { Intent } from '@blueprintjs/core';
import { AppToaster } from '@/components';
import { AppToaster, FormattedMessage as T } from '@/components';
import { useAuthSendResetPassword } from '@/hooks/query';
import SendResetPasswordForm from './SendResetPasswordForm';
@@ -82,11 +82,11 @@ function SendResetPasswordFooterLinks() {
<AuthFooterLinks>
{!signupDisabled && (
<AuthFooterLink>
Don't have an account? <Link to={'/auth/register'}>Sign up</Link>
<T id={'dont_have_an_account'} /> <Link to={'/auth/register'}><T id={'sign_up'} /></Link>
</AuthFooterLink>
)}
<AuthFooterLink>
Return to <Link to={'/auth/login'}>Sign In</Link>
<T id={'return_to'} /> <Link to={'/auth/login'}><T id={'sign_in'} /></Link>
</AuthFooterLink>
</AuthFooterLinks>
);

View File

@@ -14,8 +14,7 @@ export default function SendResetPasswordForm({ isSubmitting }) {
return (
<Form>
<TopParagraph>
Enter the email address associated with your account and we'll send you
a link to reset your password.
<T id={'enter_the_email_address_associated_with_your_account'} />
</TopParagraph>
<FFormGroup name={'crediential'} label={<T id={'email_address'} />}>
@@ -29,7 +28,7 @@ export default function SendResetPasswordForm({ isSubmitting }) {
large={true}
loading={isSubmitting}
>
Reset Password
<T id={'reset_password'} />
</AuthSubmitButton>
</Form>
);

View File

@@ -1,12 +1,9 @@
// @ts-nocheck
import React from 'react';
import styled from 'styled-components';
import {
T,
TotalLines,
TotalLine,
FormatNumber,
TotalLineBorderStyle,
TotalLineTextStyle,
} from '@/components';
@@ -23,7 +20,7 @@ export default function CreditNoteDetailTableFooter() {
<CreditNoteTotalLines labelColWidth={'180px'} amountColWidth={'180px'}>
<TotalLine
title={<T id={'credit_note.drawer.label_subtotal'} />}
value={<FormatNumber value={creditNote.formatted_amount} />}
value={creditNote.formatted_subtotal}
/>
<TotalLine
title={<T id={'credit_note.drawer.label_total'} />}

View File

@@ -8,7 +8,6 @@ import {
TotalLine,
TotalLineBorderStyle,
TotalLineTextStyle,
FormatNumber,
} from '@/components';
import { useEstimateDetailDrawerContext } from './EstimateDetailDrawerProvider';
@@ -23,7 +22,7 @@ export default function EstimateDetailTableFooter() {
<EstimateTotalLines labelColWidth={'180px'} amountColWidth={'180px'}>
<TotalLine
title={<T id={'estimate.details.subtotal'} />}
value={<FormatNumber value={estimate.amount} />}
value={estimate.formatted_subtotal}
borderStyle={TotalLineBorderStyle.SingleDark}
/>
<TotalLine

View File

@@ -2,7 +2,7 @@
import React from 'react';
import intl from 'react-intl-universal';
import { getColumnWidth } from '@/utils';
import { FormatNumberCell, TextOverviewTooltipCell } from '@/components';
import { TextOverviewTooltipCell } from '@/components';
import { useEstimateDetailDrawerContext } from './EstimateDetailDrawerProvider';
/**
@@ -35,9 +35,8 @@ export const useEstimateReadonlyEntriesColumns = () => {
},
{
Header: intl.get('quantity'),
accessor: 'quantity',
Cell: FormatNumberCell,
width: getColumnWidth(entries, 'quantity', {
accessor: 'quantity_formatted',
width: getColumnWidth(entries, 'quantity_formatted', {
minWidth: 60,
magicSpacing: 5,
}),
@@ -59,7 +58,6 @@ export const useEstimateReadonlyEntriesColumns = () => {
{
Header: intl.get('amount'),
accessor: 'total_formatted',
Cell: FormatNumberCell,
width: getColumnWidth(entries, 'total_formatted', {
minWidth: 60,
magicSpacing: 5,

View File

@@ -3,10 +3,9 @@ import React from 'react';
import styled from 'styled-components';
import {
FormatNumber,
T,
TotalLineTextStyle,
TotalLineBorderStyle,
T,
TotalLine,
TotalLines,
} from '@/components';
@@ -27,7 +26,7 @@ export default function PaymentReceiveDetailTableFooter() {
>
<TotalLine
title={<T id={'payment_receive.details.subtotal'} />}
value={<FormatNumber value={paymentReceive.amount} />}
value={paymentReceive.subtotal_formatted}
/>
<TotalLine
title={<T id={'payment_receive.details.total'} />}

View File

@@ -10,7 +10,7 @@ import {
MenuItem,
Menu,
} from '@blueprintjs/core';
import { Icon, FormatNumberCell } from '@/components';
import { Icon } from '@/components';
import { getColumnWidth } from '@/utils';
import { usePaymentReceiveDetailContext } from './PaymentReceiveDetailProvider';
@@ -40,9 +40,8 @@ export const usePaymentReceiveEntriesColumns = () => {
},
{
Header: intl.get('invoice_amount'),
accessor: 'invoice.balance',
Cell: FormatNumberCell,
width: getColumnWidth(entries, 'invoice.balance', {
accessor: 'invoice.total_formatted',
width: getColumnWidth(entries, 'invoice.total_formatted', {
minWidth: 60,
magicSpacing: 5,
}),
@@ -51,10 +50,9 @@ export const usePaymentReceiveEntriesColumns = () => {
},
{
Header: intl.get('amount_due'),
accessor: 'invoice.due_amount',
Cell: FormatNumberCell,
accessor: 'invoice.due_amount_formatted',
align: 'right',
width: getColumnWidth(entries, 'invoice.due_amount', {
width: getColumnWidth(entries, 'invoice.due_amount_formatted', {
minWidth: 60,
magicSpacing: 5,
}),

View File

@@ -23,7 +23,7 @@ export default function ReceiptDetailTableFooter() {
<ReceiptTotalLines labelColWidth={'180px'} amountColWidth={'180px'}>
<TotalLine
title={<T id={'receipt.details.subtotal'} />}
value={receipt.formatted_amount}
value={receipt.formatted_subtotal}
/>
<TotalLine
title={<T id={'receipt.details.total'} />}

View File

@@ -13,7 +13,6 @@ export const useJournalEntriesTransactionsColumns = () => {
() => [
{
Header: intl.get('date'),
accessor: 'date',
accessor: 'formatted_date',
Cell: FormatDateCell,
width: 140,
@@ -34,15 +33,17 @@ export const useJournalEntriesTransactionsColumns = () => {
},
{
Header: intl.get('credit'),
accessor: ({ credit }) => credit.formatted_amount,
accessor: 'credit.formatted_amount',
width: 100,
className: 'credit',
align: 'right',
},
{
Header: intl.get('debit'),
accessor: ({ debit }) => debit.formatted_amount,
accessor: 'debit.formatted_amount',
width: 100,
className: 'debit',
align: 'right',
},
],
[],

View File

@@ -8,7 +8,6 @@ import {
TotalLine,
TotalLineBorderStyle,
TotalLineTextStyle,
FormatNumber,
} from '@/components';
import { useVendorCreditDetailDrawerContext } from './VendorCreditDetailDrawerProvider';
@@ -23,7 +22,7 @@ export default function VendorCreditDetailDrawerFooter() {
<VendorCreditTotalLines labelColWidth={'180px'} amountColWidth={'180px'}>
<TotalLine
title={<T id={'vendor_credit.drawer.label_subtotal'} />}
value={vendorCredit.formatted_amount}
value={vendorCredit.formatted_subtotal}
borderStyle={TotalLineBorderStyle.SingleDark}
/>
<TotalLine

View File

@@ -49,9 +49,8 @@ export const useVendorCreditReadonlyEntriesTableColumns = () => {
},
{
Header: intl.get('quantity'),
accessor: 'quantity',
Cell: FormatNumberCell,
width: getColumnWidth(entries, 'quantity', {
accessor: 'quantity_formatted',
width: getColumnWidth(entries, 'quantity_formatted', {
minWidth: 60,
magicSpacing: 5,
}),

View File

@@ -20,6 +20,11 @@
"log_in": "تسجيل الدخول",
"forget_my_password": "نسيت كلمة المرور الخاصة بي",
"keep_me_logged_in": "تذكرني",
"dont_have_an_account": "ليس لديك حساب؟",
"sign_up": "تسجيل",
"return_to": "عودة إلى",
"sign_in": "صفحة الدخول",
"enter_the_email_address_associated_with_your_account": "قم بادخال بريدك الإلكتروني المرتبط بالحساب وسوف نرسل لك رابط لاعادة تعيين كلمة المرور.",
"create_an_account": "إنشاء حساب",
"need_bigcapital_account": "تحتاج إلى حساب Bigcapital؟",
"show": "عرض",

View File

@@ -19,6 +19,11 @@
"log_in": "Log in",
"forget_my_password": "Forget my password",
"keep_me_logged_in": "Keep me logged in",
"dont_have_an_account": "Don't have an account?",
"sign_up": "Sign up",
"return_to": "Return to",
"sign_in": "Sign In",
"enter_the_email_address_associated_with_your_account": "Enter the email address associated with your account and we'll send you a link to reset your password.",
"create_an_account": "Create an account",
"need_bigcapital_account": "Need a Bigcapital account ?",
"show": "Show",