mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 22:00:31 +00:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5df454dd30 | ||
|
|
07628ddc37 | ||
|
|
69afa07e3b | ||
|
|
b1a043f699 | ||
|
|
9eaff0785b | ||
|
|
b3a97ed5d5 | ||
|
|
1aaa65edd2 | ||
|
|
efebf424d1 |
14
CHANGELOG.md
14
CHANGELOG.md
@@ -2,6 +2,20 @@
|
|||||||
|
|
||||||
All notable changes to Bigcapital server-side will be in this file.
|
All notable changes to Bigcapital server-side will be in this file.
|
||||||
|
|
||||||
|
# [0.10.1] - 25-09-2023
|
||||||
|
|
||||||
|
* Fix: Running tenants migration on Docker migration container by @abouolia in https://github.com/bigcapitalhq/bigcapital/pull/242
|
||||||
|
|
||||||
|
# [0.10.0] - 24-09-2023
|
||||||
|
|
||||||
|
* Added: Tax rates service by @abouolia @elforjani13 in https://github.com/bigcapitalhq/bigcapital/pull/204
|
||||||
|
* Added: Sales Tax Liability Summary report by @abouolia in https://github.com/bigcapitalhq/bigcapital/pull/204
|
||||||
|
* Added: Tax rates tracking with sale invoices by @abouolia in https://github.com/bigcapitalhq/bigcapital/pull/204
|
||||||
|
* fix(webapp): Table headers sticky for all reports. by @elforjani13 in https://github.com/bigcapitalhq/bigcapital/pull/240
|
||||||
|
* chore(deps): bump word-wrap from 1.2.3 to 1.2.4 by @dependabot in https://github.com/bigcapitalhq/bigcapital/pull/200
|
||||||
|
* chore(deps): bump word-wrap from 1.2.3 to 1.2.4 in /packages/webapp by @dependabot in https://github.com/bigcapitalhq/bigcapital/pull/199
|
||||||
|
* chore(deps): bump mongoose from 5.13.15 to 5.13.20 by @dependabot in https://github.com/bigcapitalhq/bigcapital/pull/197
|
||||||
|
|
||||||
# [0.9.12] - 29-08-2023
|
# [0.9.12] - 29-08-2023
|
||||||
|
|
||||||
* Refactor: split the services to multiple service classes. (by @abouolia in https://github.com/bigcapitalhq/bigcapital/pull/202)
|
* Refactor: split the services to multiple service classes. (by @abouolia in https://github.com/bigcapitalhq/bigcapital/pull/202)
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ services:
|
|||||||
- ./data/logs/nginx/:/var/log/nginx
|
- ./data/logs/nginx/:/var/log/nginx
|
||||||
- ./docker/certbot/certs/:/var/certs
|
- ./docker/certbot/certs/:/var/certs
|
||||||
ports:
|
ports:
|
||||||
- "${PUBLIC_PROXY_PORT:-80}:80"
|
- '${PUBLIC_PROXY_PORT:-80}:80'
|
||||||
- "${PUBLIC_PROXY_SSL_PORT:-443}:443"
|
- '${PUBLIC_PROXY_SSL_PORT:-443}:443'
|
||||||
tty: true
|
tty: true
|
||||||
depends_on:
|
depends_on:
|
||||||
- server
|
- server
|
||||||
@@ -71,7 +71,7 @@ services:
|
|||||||
# Authentication
|
# Authentication
|
||||||
- JWT_SECRET=${JWT_SECRET}
|
- JWT_SECRET=${JWT_SECRET}
|
||||||
|
|
||||||
# MongoDB
|
# MongoDB
|
||||||
- MONGODB_DATABASE_URL=mongodb://mongo/bigcapital
|
- MONGODB_DATABASE_URL=mongodb://mongo/bigcapital
|
||||||
|
|
||||||
# Application
|
# Application
|
||||||
@@ -92,11 +92,14 @@ services:
|
|||||||
context: ./
|
context: ./
|
||||||
dockerfile: docker/migration/Dockerfile
|
dockerfile: docker/migration/Dockerfile
|
||||||
environment:
|
environment:
|
||||||
|
# Database
|
||||||
- DB_HOST=mysql
|
- DB_HOST=mysql
|
||||||
- DB_USER=${DB_USER}
|
- DB_USER=${DB_USER}
|
||||||
- DB_PASSWORD=${DB_PASSWORD}
|
- DB_PASSWORD=${DB_PASSWORD}
|
||||||
- DB_CHARSET=${DB_CHARSET}
|
- DB_CHARSET=${DB_CHARSET}
|
||||||
- SYSTEM_DB_NAME=${SYSTEM_DB_NAME}
|
- SYSTEM_DB_NAME=${SYSTEM_DB_NAME}
|
||||||
|
# Tenants databases
|
||||||
|
- TENANT_DB_NAME_PERFIX=${TENANT_DB_NAME_PERFIX}
|
||||||
depends_on:
|
depends_on:
|
||||||
- mysql
|
- mysql
|
||||||
|
|
||||||
@@ -136,7 +139,7 @@ services:
|
|||||||
build:
|
build:
|
||||||
context: ./docker/redis
|
context: ./docker/redis
|
||||||
expose:
|
expose:
|
||||||
- "6379"
|
- '6379'
|
||||||
volumes:
|
volumes:
|
||||||
- redis:/data
|
- redis:/data
|
||||||
|
|
||||||
|
|||||||
@@ -34,5 +34,7 @@ WORKDIR /app/packages/server
|
|||||||
|
|
||||||
RUN git clone https://github.com/vishnubob/wait-for-it.git
|
RUN git clone https://github.com/vishnubob/wait-for-it.git
|
||||||
|
|
||||||
# Once we listen the mysql port run the migration task.
|
ADD docker/migration/start.sh /
|
||||||
CMD ["./wait-for-it/wait-for-it.sh", "mysql:3306", "--", "node", "./build/commands.js", "system:migrate:latest"]
|
RUN chmod +x /start.sh
|
||||||
|
|
||||||
|
CMD ["/start.sh"]
|
||||||
5
docker/migration/start.sh
Normal file
5
docker/migration/start.sh
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
# Migrate the master system database.
|
||||||
|
./wait-for-it/wait-for-it.sh mysql:3306 -- node ./build/commands.js system:migrate:latest
|
||||||
|
|
||||||
|
# Migrate all tenants.
|
||||||
|
./wait-for-it/wait-for-it.sh mysql:3306 -- node ./build/commands.js tenants:migrate:latest
|
||||||
13663
packages/server/package-lock.json
generated
Normal file
13663
packages/server/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@bigcapital/server",
|
"name": "@bigcapital/server",
|
||||||
"version": "0.9.5",
|
"version": "0.10.2",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "src/server.ts",
|
"main": "src/server.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -99,6 +99,13 @@ export default class ItemEntry extends TenantModel {
|
|||||||
: getExlusiveTaxAmount(this.amount, this.taxRate);
|
: getExlusiveTaxAmount(this.amount, this.taxRate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static calcAmount(itemEntry) {
|
||||||
|
const { discount, quantity, rate } = itemEntry;
|
||||||
|
const total = quantity * rate;
|
||||||
|
|
||||||
|
return discount ? total - total * discount * 0.01 : total;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Item entry relations.
|
* Item entry relations.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@bigcapital/webapp",
|
"name": "@bigcapital/webapp",
|
||||||
"version": "0.9.6",
|
"version": "0.10.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@blueprintjs-formik/core": "^0.3.4",
|
"@blueprintjs-formik/core": "^0.3.4",
|
||||||
|
|||||||
@@ -17,11 +17,21 @@ import {
|
|||||||
useItemEntriesTableContext,
|
useItemEntriesTableContext,
|
||||||
} from './ItemEntriesTableProvider';
|
} from './ItemEntriesTableProvider';
|
||||||
import { useUncontrolled } from '@/hooks/useUncontrolled';
|
import { useUncontrolled } from '@/hooks/useUncontrolled';
|
||||||
|
import { ItemEntry } from '@/interfaces/ItemEntries';
|
||||||
|
|
||||||
|
interface ItemsEntriesTableProps {
|
||||||
|
initialValue?: ItemEntry;
|
||||||
|
value?: ItemEntry[];
|
||||||
|
onChange?: (entries: ItemEntry[]) => void;
|
||||||
|
taxRates?: any[];
|
||||||
|
minLinesNumber?: number;
|
||||||
|
enableTaxRates?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Items entries table.
|
* Items entries table.
|
||||||
*/
|
*/
|
||||||
function ItemsEntriesTable(props) {
|
function ItemsEntriesTable(props: ItemsEntriesTableProps) {
|
||||||
const { value, initialValue, onChange } = props;
|
const { value, initialValue, onChange } = props;
|
||||||
|
|
||||||
const [localValue, handleChange] = useUncontrolled({
|
const [localValue, handleChange] = useUncontrolled({
|
||||||
@@ -119,8 +129,11 @@ ItemsEntriesTable.defaultProps = {
|
|||||||
discount: '',
|
discount: '',
|
||||||
},
|
},
|
||||||
initialEntries: [],
|
initialEntries: [],
|
||||||
|
taxRates: [],
|
||||||
|
items: [],
|
||||||
linesNumber: 1,
|
linesNumber: 1,
|
||||||
minLinesNumber: 1,
|
minLinesNumber: 1,
|
||||||
|
enableTaxRates: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default ItemsEntriesTable;
|
export default ItemsEntriesTable;
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ const LandedCostHeaderCell = () => {
|
|||||||
*/
|
*/
|
||||||
export function useEditableItemsEntriesColumns() {
|
export function useEditableItemsEntriesColumns() {
|
||||||
const { featureCan } = useFeatureCan();
|
const { featureCan } = useFeatureCan();
|
||||||
const { landedCost } = useItemEntriesTableContext();
|
const { landedCost, enableTaxRates } = useItemEntriesTableContext();
|
||||||
|
|
||||||
const isProjectsFeatureEnabled = featureCan(Features.Projects);
|
const isProjectsFeatureEnabled = featureCan(Features.Projects);
|
||||||
|
|
||||||
@@ -132,13 +132,17 @@ export function useEditableItemsEntriesColumns() {
|
|||||||
width: 70,
|
width: 70,
|
||||||
align: Align.Right,
|
align: Align.Right,
|
||||||
},
|
},
|
||||||
{
|
...(enableTaxRates
|
||||||
Header: 'Tax rate',
|
? [
|
||||||
accessor: 'tax_rate_id',
|
{
|
||||||
Cell: TaxRatesSuggestInputCell,
|
Header: 'Tax rate',
|
||||||
disableSortBy: true,
|
accessor: 'tax_rate_id',
|
||||||
width: 110,
|
Cell: TaxRatesSuggestInputCell,
|
||||||
},
|
disableSortBy: true,
|
||||||
|
width: 110,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
: []),
|
||||||
{
|
{
|
||||||
Header: intl.get('discount'),
|
Header: intl.get('discount'),
|
||||||
accessor: 'discount',
|
accessor: 'discount',
|
||||||
|
|||||||
@@ -27,8 +27,8 @@ export default function BillFormBody({ defaultBill }) {
|
|||||||
meta: { error, touched },
|
meta: { error, touched },
|
||||||
}) => (
|
}) => (
|
||||||
<ItemsEntriesTable
|
<ItemsEntriesTable
|
||||||
entries={value}
|
value={value}
|
||||||
onUpdateData={(entries) => {
|
onChange={(entries) => {
|
||||||
setFieldValue('entries', entries);
|
setFieldValue('entries', entries);
|
||||||
}}
|
}}
|
||||||
items={items}
|
items={items}
|
||||||
@@ -37,6 +37,7 @@ export default function BillFormBody({ defaultBill }) {
|
|||||||
currencyCode={values.currency_code}
|
currencyCode={values.currency_code}
|
||||||
itemType={ITEM_TYPE.PURCHASABLE}
|
itemType={ITEM_TYPE.PURCHASABLE}
|
||||||
landedCost={true}
|
landedCost={true}
|
||||||
|
enableTaxRates={false}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</FastField>
|
</FastField>
|
||||||
|
|||||||
@@ -22,14 +22,15 @@ export default function VendorCreditNoteItemsEntriesEditor() {
|
|||||||
meta: { error, touched },
|
meta: { error, touched },
|
||||||
}) => (
|
}) => (
|
||||||
<ItemsEntriesTable
|
<ItemsEntriesTable
|
||||||
entries={value}
|
value={value}
|
||||||
onUpdateData={(entries) => {
|
onChange={(entries) => {
|
||||||
setFieldValue('entries', entries);
|
setFieldValue('entries', entries);
|
||||||
}}
|
}}
|
||||||
items={items}
|
items={items}
|
||||||
errors={error}
|
errors={error}
|
||||||
linesNumber={4}
|
linesNumber={4}
|
||||||
currencyCode={values.currency_code}
|
currencyCode={values.currency_code}
|
||||||
|
enableTaxRates={false}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</FastField>
|
</FastField>
|
||||||
|
|||||||
@@ -26,14 +26,15 @@ export default function CreditNoteItemsEntriesEditorField() {
|
|||||||
meta: { error, touched },
|
meta: { error, touched },
|
||||||
}) => (
|
}) => (
|
||||||
<ItemsEntriesTable
|
<ItemsEntriesTable
|
||||||
entries={value}
|
value={value}
|
||||||
onUpdateData={(entries) => {
|
onChange={(entries) => {
|
||||||
setFieldValue('entries', entries);
|
setFieldValue('entries', entries);
|
||||||
}}
|
}}
|
||||||
items={items}
|
items={items}
|
||||||
errors={error}
|
errors={error}
|
||||||
linesNumber={4}
|
linesNumber={4}
|
||||||
currencyCode={values.currency_code}
|
currencyCode={values.currency_code}
|
||||||
|
enableTaxRates={false}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</FastField>
|
</FastField>
|
||||||
|
|||||||
@@ -26,14 +26,15 @@ export default function EstimateFormItemsEntriesField() {
|
|||||||
meta: { error, touched },
|
meta: { error, touched },
|
||||||
}) => (
|
}) => (
|
||||||
<ItemsEntriesTable
|
<ItemsEntriesTable
|
||||||
entries={value}
|
value={value}
|
||||||
onUpdateData={(entries) => {
|
onChange={(entries) => {
|
||||||
setFieldValue('entries', entries);
|
setFieldValue('entries', entries);
|
||||||
}}
|
}}
|
||||||
items={items}
|
items={items}
|
||||||
errors={error}
|
errors={error}
|
||||||
linesNumber={4}
|
linesNumber={4}
|
||||||
currencyCode={values.currency_code}
|
currencyCode={values.currency_code}
|
||||||
|
enableTaxRates={false}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</FastField>
|
</FastField>
|
||||||
|
|||||||
@@ -31,6 +31,15 @@ export const defaultEstimateEntry = {
|
|||||||
amount: '',
|
amount: '',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const defaultEstimateEntryReq = {
|
||||||
|
index: 0,
|
||||||
|
item_id: '',
|
||||||
|
rate: '',
|
||||||
|
discount: '',
|
||||||
|
quantity: '',
|
||||||
|
description: '',
|
||||||
|
};
|
||||||
|
|
||||||
export const defaultEstimate = {
|
export const defaultEstimate = {
|
||||||
customer_id: '',
|
customer_id: '',
|
||||||
estimate_date: moment(new Date()).format('YYYY-MM-DD'),
|
estimate_date: moment(new Date()).format('YYYY-MM-DD'),
|
||||||
@@ -148,7 +157,9 @@ export const transfromsFormValuesToRequest = (values) => {
|
|||||||
...(values.estimate_number_manually && {
|
...(values.estimate_number_manually && {
|
||||||
estimate_number: values.estimate_number,
|
estimate_number: values.estimate_number,
|
||||||
}),
|
}),
|
||||||
entries: entries.map((entry) => ({ ...omit(entry, ['amount']) })),
|
entries: entries.map((entry) => ({
|
||||||
|
...transformToForm(entry, defaultEstimateEntryReq),
|
||||||
|
})),
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -19,14 +19,15 @@ export default function ReceiptItemsEntriesEditor({ defaultReceipt }) {
|
|||||||
meta: { error, touched },
|
meta: { error, touched },
|
||||||
}) => (
|
}) => (
|
||||||
<ItemsEntriesTable
|
<ItemsEntriesTable
|
||||||
entries={value}
|
value={value}
|
||||||
onUpdateData={(entries) => {
|
onChange={(entries) => {
|
||||||
setFieldValue('entries', entries);
|
setFieldValue('entries', entries);
|
||||||
}}
|
}}
|
||||||
items={items}
|
items={items}
|
||||||
errors={error}
|
errors={error}
|
||||||
linesNumber={4}
|
linesNumber={4}
|
||||||
currencyCode={values.currency_code}
|
currencyCode={values.currency_code}
|
||||||
|
enableTaxRates={false}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</FastField>
|
</FastField>
|
||||||
|
|||||||
@@ -32,6 +32,15 @@ export const defaultReceiptEntry = {
|
|||||||
amount: '',
|
amount: '',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const defaultReceiptEntryReq = {
|
||||||
|
index: 0,
|
||||||
|
item_id: '',
|
||||||
|
rate: '',
|
||||||
|
discount: '',
|
||||||
|
quantity: '',
|
||||||
|
description: '',
|
||||||
|
};
|
||||||
|
|
||||||
export const defaultReceipt = {
|
export const defaultReceipt = {
|
||||||
customer_id: '',
|
customer_id: '',
|
||||||
deposit_account_id: '',
|
deposit_account_id: '',
|
||||||
@@ -140,7 +149,9 @@ export const transformFormValuesToRequest = (values) => {
|
|||||||
...(values.receipt_number_manually && {
|
...(values.receipt_number_manually && {
|
||||||
receipt_number: values.receipt_number,
|
receipt_number: values.receipt_number,
|
||||||
}),
|
}),
|
||||||
entries: entries.map((entry) => ({ ...omit(entry, ['amount']) })),
|
entries: entries.map((entry) => ({
|
||||||
|
...transformToForm(entry, defaultReceiptEntryReq),
|
||||||
|
})),
|
||||||
closed: false,
|
closed: false,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user