diff --git a/CHANGELOG.md b/CHANGELOG.md index f2e1eae73..e60eb9c26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,18 @@ All notable changes to Bigcapital server-side will be in this file. +# [0.9.9] - 28-06-2023 + +* refactor: Customer and vendor select component by @abouolia in https://github.com/bigcapitalhq/bigcapital/pull/171 +* chore: Move auto-increment components in separate files by @abouolia in https://github.com/bigcapitalhq/bigcapital/pull/170 +* fix: Style of quick item drawer by @abouolia in https://github.com/bigcapitalhq/bigcapital/pull/173 +* fix: Should not show the form before loading account by @abouolia in https://github.com/bigcapitalhq/bigcapital/pull/172 +* fix: Payment made form does not handle not unique number an e… by @abouolia in https://github.com/bigcapitalhq/bigcapital/pull/177 +* fix: Internal note of invoice/bill payment does not saving by @abouolia in https://github.com/bigcapitalhq/bigcapital/pull/181 +* fix: Storing cash flow transaction description by @abouolia in https://github.com/bigcapitalhq/bigcapital/pull/180 +* fix: No currency in amount field on money in/out dialogs by @abouolia in https://github.com/bigcapitalhq/bigcapital/pull/179 +* fix: No default branch for customer/vendor opening balance branch by @abouolia in https://github.com/bigcapitalhq/bigcapital/pull/182 + # [0.9.8] - 19-06-2023 `bigcapitalhq/webapp` diff --git a/packages/server/src/interfaces/Ledger.ts b/packages/server/src/interfaces/Ledger.ts index 4e021718a..8af6ac8b8 100644 --- a/packages/server/src/interfaces/Ledger.ts +++ b/packages/server/src/interfaces/Ledger.ts @@ -41,6 +41,8 @@ export interface ILedgerEntry { index: number; indexGroup?: number; + note?: string; + userId?: number; itemId?: number; branchId?: number; diff --git a/packages/server/src/services/Accounting/utils.ts b/packages/server/src/services/Accounting/utils.ts index 081a0d14c..45a3de94e 100644 --- a/packages/server/src/services/Accounting/utils.ts +++ b/packages/server/src/services/Accounting/utils.ts @@ -21,6 +21,8 @@ export const transformLedgerEntryToTransaction = ( transactionNumber: entry.transactionNumber, referenceNumber: entry.referenceNumber, + note: entry.note, + index: entry.index, indexGroup: entry.indexGroup, diff --git a/packages/server/src/services/Cashflow/CashflowTransactionJournalEntries.ts b/packages/server/src/services/Cashflow/CashflowTransactionJournalEntries.ts index 93d23e3b1..21df84f34 100644 --- a/packages/server/src/services/Cashflow/CashflowTransactionJournalEntries.ts +++ b/packages/server/src/services/Cashflow/CashflowTransactionJournalEntries.ts @@ -25,8 +25,8 @@ export default class CashflowTransactionJournalEntries { /** * Retrieves the common entry of cashflow transaction. - * @param {ICashflowTransaction} cashflowTransaction - * @returns {} + * @param {ICashflowTransaction} cashflowTransaction + * @returns {Partial} */ private getCommonEntry = (cashflowTransaction: ICashflowTransaction) => { const { entries, ...transaction } = cashflowTransaction; @@ -41,7 +41,9 @@ export default class CashflowTransactionJournalEntries { ), transactionId: transaction.id, transactionNumber: transaction.transactionNumber, - referenceNo: transaction.referenceNo, + referenceNumber: transaction.referenceNo, + + note: transaction.description, branchId: cashflowTransaction.branchId, userId: cashflowTransaction.userId, @@ -76,9 +78,9 @@ export default class CashflowTransactionJournalEntries { /** * Retrieves the cashflow credit GL entry. - * @param {ICashflowTransaction} cashflowTransaction - * @param {ICashflowTransactionLine} entry - * @param {number} index + * @param {ICashflowTransaction} cashflowTransaction + * @param {ICashflowTransactionLine} entry + * @param {number} index * @returns {ILedgerEntry} */ private getCashflowCreditGLEntry = ( @@ -102,10 +104,10 @@ export default class CashflowTransactionJournalEntries { /** * Retrieves the cashflow transaction GL entry. - * @param {ICashflowTransaction} cashflowTransaction - * @param {ICashflowTransactionLine} entry - * @param {number} index - * @returns + * @param {ICashflowTransaction} cashflowTransaction + * @param {ICashflowTransactionLine} entry + * @param {number} index + * @returns {ILedgerEntry[]} */ private getJournalEntries = ( cashflowTransaction: ICashflowTransaction @@ -118,7 +120,7 @@ export default class CashflowTransactionJournalEntries { /** * Retrieves the cashflow GL ledger. - * @param {ICashflowTransaction} cashflowTransaction + * @param {ICashflowTransaction} cashflowTransaction * @returns {Ledger} */ private getCashflowLedger = (cashflowTransaction: ICashflowTransaction) => { @@ -130,6 +132,7 @@ export default class CashflowTransactionJournalEntries { * Write the journal entries of the given cashflow transaction. * @param {number} tenantId * @param {ICashflowTransaction} cashflowTransaction + * @return {Promise} */ public writeJournalEntries = async ( tenantId: number, @@ -153,6 +156,7 @@ export default class CashflowTransactionJournalEntries { * Delete the journal entries. * @param {number} tenantId - Tenant id. * @param {number} cashflowTransactionId - Cashflow transaction id. + * @return {Promise} */ public revertJournalEntries = async ( tenantId: number, diff --git a/packages/webapp/src/components/Branches/BranchSelect.tsx b/packages/webapp/src/components/Branches/BranchSelect.tsx index 6e463ad9a..2641f2704 100644 --- a/packages/webapp/src/components/Branches/BranchSelect.tsx +++ b/packages/webapp/src/components/Branches/BranchSelect.tsx @@ -5,59 +5,20 @@ import { MenuItem, Button } from '@blueprintjs/core'; import { FSelect } from '../Forms'; /** - * - * @param {*} query - * @param {*} branch - * @param {*} _index - * @param {*} exactMatch - * @returns - */ -const branchItemPredicate = (query, branch, _index, exactMatch) => { - const normalizedTitle = branch.name.toLowerCase(); - const normalizedQuery = query.toLowerCase(); - - if (exactMatch) { - return normalizedTitle === normalizedQuery; - } else { - return `${branch.code}. ${normalizedTitle}`.indexOf(normalizedQuery) >= 0; - } -}; - -/** - * - * @param {*} film - * @param {*} param1 - * @returns - */ -const branchItemRenderer = (branch, { handleClick, modifiers, query }) => { - const text = `${branch.name}`; - - return ( - - ); -}; - -const branchSelectProps = { - itemPredicate: branchItemPredicate, - itemRenderer: branchItemRenderer, - valueAccessor: 'id', - labelAccessor: 'name', -}; - -/** - * + * Branch select field. * @param {*} param0 - * @returns + * @returns {JSX.Element} */ export function BranchSelect({ branches, ...rest }) { - return ; + return ( + + ); } /** diff --git a/packages/webapp/src/components/Forms/Select.tsx b/packages/webapp/src/components/Forms/Select.tsx index 459912b62..6916e115c 100644 --- a/packages/webapp/src/components/Forms/Select.tsx +++ b/packages/webapp/src/components/Forms/Select.tsx @@ -16,7 +16,7 @@ export function FSelect({ ...props }) { /> ); }; - return ; } const SelectButton = styled(Button)` diff --git a/packages/webapp/src/components/PageForm/FormTopbarSelectInputs.tsx b/packages/webapp/src/components/PageForm/FormTopbarSelectInputs.tsx new file mode 100644 index 000000000..f3f2f1f84 --- /dev/null +++ b/packages/webapp/src/components/PageForm/FormTopbarSelectInputs.tsx @@ -0,0 +1,27 @@ +// @ts-nocheck +import React from 'react'; +import intl from 'react-intl-universal'; +import { Button } from '@blueprintjs/core'; +import { Icon } from '@/components'; + +export function FormWarehouseSelectButton({ text }) { + return ( +