mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-14 11:50: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.
|
||||
|
||||
# [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
|
||||
|
||||
* 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
|
||||
- ./docker/certbot/certs/:/var/certs
|
||||
ports:
|
||||
- "${PUBLIC_PROXY_PORT:-80}:80"
|
||||
- "${PUBLIC_PROXY_SSL_PORT:-443}:443"
|
||||
- '${PUBLIC_PROXY_PORT:-80}:80'
|
||||
- '${PUBLIC_PROXY_SSL_PORT:-443}:443'
|
||||
tty: true
|
||||
depends_on:
|
||||
- server
|
||||
@@ -71,7 +71,7 @@ services:
|
||||
# Authentication
|
||||
- JWT_SECRET=${JWT_SECRET}
|
||||
|
||||
# MongoDB
|
||||
# MongoDB
|
||||
- MONGODB_DATABASE_URL=mongodb://mongo/bigcapital
|
||||
|
||||
# Application
|
||||
@@ -92,11 +92,14 @@ services:
|
||||
context: ./
|
||||
dockerfile: docker/migration/Dockerfile
|
||||
environment:
|
||||
# Database
|
||||
- DB_HOST=mysql
|
||||
- DB_USER=${DB_USER}
|
||||
- DB_PASSWORD=${DB_PASSWORD}
|
||||
- DB_CHARSET=${DB_CHARSET}
|
||||
- SYSTEM_DB_NAME=${SYSTEM_DB_NAME}
|
||||
# Tenants databases
|
||||
- TENANT_DB_NAME_PERFIX=${TENANT_DB_NAME_PERFIX}
|
||||
depends_on:
|
||||
- mysql
|
||||
|
||||
@@ -136,7 +139,7 @@ services:
|
||||
build:
|
||||
context: ./docker/redis
|
||||
expose:
|
||||
- "6379"
|
||||
- '6379'
|
||||
volumes:
|
||||
- redis:/data
|
||||
|
||||
|
||||
@@ -34,5 +34,7 @@ WORKDIR /app/packages/server
|
||||
|
||||
RUN git clone https://github.com/vishnubob/wait-for-it.git
|
||||
|
||||
# Once we listen the mysql port run the migration task.
|
||||
CMD ["./wait-for-it/wait-for-it.sh", "mysql:3306", "--", "node", "./build/commands.js", "system:migrate:latest"]
|
||||
ADD docker/migration/start.sh /
|
||||
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",
|
||||
"version": "0.9.5",
|
||||
"version": "0.10.2",
|
||||
"description": "",
|
||||
"main": "src/server.ts",
|
||||
"scripts": {
|
||||
|
||||
@@ -99,6 +99,13 @@ export default class ItemEntry extends TenantModel {
|
||||
: 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.
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@bigcapital/webapp",
|
||||
"version": "0.9.6",
|
||||
"version": "0.10.2",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@blueprintjs-formik/core": "^0.3.4",
|
||||
|
||||
@@ -17,11 +17,21 @@ import {
|
||||
useItemEntriesTableContext,
|
||||
} from './ItemEntriesTableProvider';
|
||||
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.
|
||||
*/
|
||||
function ItemsEntriesTable(props) {
|
||||
function ItemsEntriesTable(props: ItemsEntriesTableProps) {
|
||||
const { value, initialValue, onChange } = props;
|
||||
|
||||
const [localValue, handleChange] = useUncontrolled({
|
||||
@@ -119,8 +129,11 @@ ItemsEntriesTable.defaultProps = {
|
||||
discount: '',
|
||||
},
|
||||
initialEntries: [],
|
||||
taxRates: [],
|
||||
items: [],
|
||||
linesNumber: 1,
|
||||
minLinesNumber: 1,
|
||||
enableTaxRates: true,
|
||||
};
|
||||
|
||||
export default ItemsEntriesTable;
|
||||
|
||||
@@ -92,7 +92,7 @@ const LandedCostHeaderCell = () => {
|
||||
*/
|
||||
export function useEditableItemsEntriesColumns() {
|
||||
const { featureCan } = useFeatureCan();
|
||||
const { landedCost } = useItemEntriesTableContext();
|
||||
const { landedCost, enableTaxRates } = useItemEntriesTableContext();
|
||||
|
||||
const isProjectsFeatureEnabled = featureCan(Features.Projects);
|
||||
|
||||
@@ -132,13 +132,17 @@ export function useEditableItemsEntriesColumns() {
|
||||
width: 70,
|
||||
align: Align.Right,
|
||||
},
|
||||
{
|
||||
Header: 'Tax rate',
|
||||
accessor: 'tax_rate_id',
|
||||
Cell: TaxRatesSuggestInputCell,
|
||||
disableSortBy: true,
|
||||
width: 110,
|
||||
},
|
||||
...(enableTaxRates
|
||||
? [
|
||||
{
|
||||
Header: 'Tax rate',
|
||||
accessor: 'tax_rate_id',
|
||||
Cell: TaxRatesSuggestInputCell,
|
||||
disableSortBy: true,
|
||||
width: 110,
|
||||
},
|
||||
]
|
||||
: []),
|
||||
{
|
||||
Header: intl.get('discount'),
|
||||
accessor: 'discount',
|
||||
|
||||
@@ -27,8 +27,8 @@ export default function BillFormBody({ defaultBill }) {
|
||||
meta: { error, touched },
|
||||
}) => (
|
||||
<ItemsEntriesTable
|
||||
entries={value}
|
||||
onUpdateData={(entries) => {
|
||||
value={value}
|
||||
onChange={(entries) => {
|
||||
setFieldValue('entries', entries);
|
||||
}}
|
||||
items={items}
|
||||
@@ -37,6 +37,7 @@ export default function BillFormBody({ defaultBill }) {
|
||||
currencyCode={values.currency_code}
|
||||
itemType={ITEM_TYPE.PURCHASABLE}
|
||||
landedCost={true}
|
||||
enableTaxRates={false}
|
||||
/>
|
||||
)}
|
||||
</FastField>
|
||||
|
||||
@@ -22,14 +22,15 @@ export default function VendorCreditNoteItemsEntriesEditor() {
|
||||
meta: { error, touched },
|
||||
}) => (
|
||||
<ItemsEntriesTable
|
||||
entries={value}
|
||||
onUpdateData={(entries) => {
|
||||
value={value}
|
||||
onChange={(entries) => {
|
||||
setFieldValue('entries', entries);
|
||||
}}
|
||||
items={items}
|
||||
errors={error}
|
||||
linesNumber={4}
|
||||
currencyCode={values.currency_code}
|
||||
enableTaxRates={false}
|
||||
/>
|
||||
)}
|
||||
</FastField>
|
||||
|
||||
@@ -26,14 +26,15 @@ export default function CreditNoteItemsEntriesEditorField() {
|
||||
meta: { error, touched },
|
||||
}) => (
|
||||
<ItemsEntriesTable
|
||||
entries={value}
|
||||
onUpdateData={(entries) => {
|
||||
value={value}
|
||||
onChange={(entries) => {
|
||||
setFieldValue('entries', entries);
|
||||
}}
|
||||
items={items}
|
||||
errors={error}
|
||||
linesNumber={4}
|
||||
currencyCode={values.currency_code}
|
||||
enableTaxRates={false}
|
||||
/>
|
||||
)}
|
||||
</FastField>
|
||||
|
||||
@@ -26,14 +26,15 @@ export default function EstimateFormItemsEntriesField() {
|
||||
meta: { error, touched },
|
||||
}) => (
|
||||
<ItemsEntriesTable
|
||||
entries={value}
|
||||
onUpdateData={(entries) => {
|
||||
value={value}
|
||||
onChange={(entries) => {
|
||||
setFieldValue('entries', entries);
|
||||
}}
|
||||
items={items}
|
||||
errors={error}
|
||||
linesNumber={4}
|
||||
currencyCode={values.currency_code}
|
||||
enableTaxRates={false}
|
||||
/>
|
||||
)}
|
||||
</FastField>
|
||||
|
||||
@@ -31,6 +31,15 @@ export const defaultEstimateEntry = {
|
||||
amount: '',
|
||||
};
|
||||
|
||||
const defaultEstimateEntryReq = {
|
||||
index: 0,
|
||||
item_id: '',
|
||||
rate: '',
|
||||
discount: '',
|
||||
quantity: '',
|
||||
description: '',
|
||||
};
|
||||
|
||||
export const defaultEstimate = {
|
||||
customer_id: '',
|
||||
estimate_date: moment(new Date()).format('YYYY-MM-DD'),
|
||||
@@ -148,7 +157,9 @@ export const transfromsFormValuesToRequest = (values) => {
|
||||
...(values.estimate_number_manually && {
|
||||
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 },
|
||||
}) => (
|
||||
<ItemsEntriesTable
|
||||
entries={value}
|
||||
onUpdateData={(entries) => {
|
||||
value={value}
|
||||
onChange={(entries) => {
|
||||
setFieldValue('entries', entries);
|
||||
}}
|
||||
items={items}
|
||||
errors={error}
|
||||
linesNumber={4}
|
||||
currencyCode={values.currency_code}
|
||||
enableTaxRates={false}
|
||||
/>
|
||||
)}
|
||||
</FastField>
|
||||
|
||||
@@ -32,6 +32,15 @@ export const defaultReceiptEntry = {
|
||||
amount: '',
|
||||
};
|
||||
|
||||
const defaultReceiptEntryReq = {
|
||||
index: 0,
|
||||
item_id: '',
|
||||
rate: '',
|
||||
discount: '',
|
||||
quantity: '',
|
||||
description: '',
|
||||
};
|
||||
|
||||
export const defaultReceipt = {
|
||||
customer_id: '',
|
||||
deposit_account_id: '',
|
||||
@@ -140,7 +149,9 @@ export const transformFormValuesToRequest = (values) => {
|
||||
...(values.receipt_number_manually && {
|
||||
receipt_number: values.receipt_number,
|
||||
}),
|
||||
entries: entries.map((entry) => ({ ...omit(entry, ['amount']) })),
|
||||
entries: entries.map((entry) => ({
|
||||
...transformToForm(entry, defaultReceiptEntryReq),
|
||||
})),
|
||||
closed: false,
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user