mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-10 18:01:59 +00:00
Compare commits
57 Commits
docker-com
...
split-comp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1f3adf4879 | ||
|
|
532ad61500 | ||
|
|
a44d779670 | ||
|
|
ab5f9f50d0 | ||
|
|
f3f10db6db | ||
|
|
de5694681b | ||
|
|
b1a997c287 | ||
|
|
3e36146bce | ||
|
|
db833888c8 | ||
|
|
c415e3d693 | ||
|
|
e145eabf02 | ||
|
|
caab21647d | ||
|
|
98528e9e5b | ||
|
|
b993fad37f | ||
|
|
94ea44b58e | ||
|
|
877a57043a | ||
|
|
70415d1d63 | ||
|
|
ef2d1977d6 | ||
|
|
46ea26891d | ||
|
|
f750cede89 | ||
|
|
e5d0f16096 | ||
|
|
706694c768 | ||
|
|
d1a09e3b15 | ||
|
|
01c27b56ef | ||
|
|
0d8fb8cf25 | ||
|
|
6562e3ab8c | ||
|
|
c93650ffd3 | ||
|
|
e6a2825065 | ||
|
|
0c2a0b0010 | ||
|
|
a332c51249 | ||
|
|
0b6d0bc016 | ||
|
|
e6336b1451 | ||
|
|
46290c4d37 | ||
|
|
ff2b7563c8 | ||
|
|
b9572420ed | ||
|
|
35ebb9c2aa | ||
|
|
3ebeb29dc0 | ||
|
|
8e98068538 | ||
|
|
6a72594faf | ||
|
|
728729094a | ||
|
|
93d540fbd2 | ||
|
|
eb9b6ce717 | ||
|
|
f716d42d26 | ||
|
|
1c4c364f06 | ||
|
|
162ad91547 | ||
|
|
2950e5ede4 | ||
|
|
73b041d8d2 | ||
|
|
7bf008a9cb | ||
|
|
4d9e3ccfb4 | ||
|
|
1bfe19f26c | ||
|
|
a371cedb67 | ||
|
|
4ed9c36ebd | ||
|
|
e24b23ce7e | ||
|
|
19fe6e2423 | ||
|
|
aec09f178b | ||
|
|
ffe51bae07 | ||
|
|
68231d5edb |
36
.env.example
36
.env.example
@@ -8,26 +8,32 @@ MAIL_FROM_NAME=
|
|||||||
MAIL_FROM_ADDRESS=
|
MAIL_FROM_ADDRESS=
|
||||||
|
|
||||||
# Database
|
# Database
|
||||||
DB_USER=
|
DB_HOST=mysql
|
||||||
DB_HOST=
|
DB_USER=bigcapital
|
||||||
DB_PASSWORD=
|
DB_PASSWORD=bigcapital
|
||||||
DB_CHARSET=
|
DB_ROOT_PASSWORD=root
|
||||||
|
DB_CHARSET=utf8
|
||||||
|
|
||||||
# System database
|
# System database
|
||||||
SYSTEM_DB_NAME=bigcapital_system
|
SYSTEM_DB_NAME=bigcapital_system
|
||||||
|
# SYSTEM_DB_USER=
|
||||||
|
# SYSTEM_DB_PASSWORD=
|
||||||
|
# SYSTEM_DB_NAME=
|
||||||
|
# SYSTEM_DB_CHARSET=
|
||||||
|
|
||||||
# Tenants databases
|
# Tenant databases
|
||||||
TENANT_DB_NAME_PERFIX=bigcapital_tenant_
|
TENANT_DB_NAME_PERFIX=bigcapital_tenant_
|
||||||
|
# TENANT_DB_HOST=
|
||||||
# MongoDB
|
# TENANT_DB_USER=
|
||||||
MONGODB_DATABASE_URL=mongodb://localhost/bigcapital
|
# TENANT_DB_PASSWORD=
|
||||||
|
# TENANT_DB_CHARSET=
|
||||||
# Authentication
|
|
||||||
JWT_SECRET=b0JDZW56RnV6aEthb0RGPXVEcUI
|
|
||||||
|
|
||||||
# Application
|
# Application
|
||||||
BASE_URL=https://bigcapital.ly
|
BASE_URL=http://example.com
|
||||||
CONTACT_US_MAIL=support@bigcapital.ly
|
JWT_SECRET=b0JDZW56RnV6aEthb0RGPXVEcUI
|
||||||
|
|
||||||
|
# Jobs MongoDB
|
||||||
|
MONGODB_DATABASE_URL=mongodb://localhost/bigcapital
|
||||||
|
|
||||||
# App proxy
|
# App proxy
|
||||||
PUBLIC_PROXY_PORT=80
|
PUBLIC_PROXY_PORT=80
|
||||||
@@ -38,6 +44,6 @@ AGENDASH_AUTH_USER=agendash
|
|||||||
AGENDASH_AUTH_PASSWORD=123123
|
AGENDASH_AUTH_PASSWORD=123123
|
||||||
|
|
||||||
# Sign-up restrictions
|
# Sign-up restrictions
|
||||||
SIGNUP_DISABLED=true
|
SIGNUP_DISABLED=false
|
||||||
SIGNUP_ALLOWED_DOMAINS=
|
SIGNUP_ALLOWED_DOMAINS=
|
||||||
SIGNUP_ALLOWED_EMAILS=
|
SIGNUP_ALLOWED_EMAILS=
|
||||||
|
|||||||
2
.gitattributes
vendored
Normal file
2
.gitattributes
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
docker/nginx/scripts/build-nginx.sh text eol=lf
|
||||||
|
docker/mariadb/docker-entrypoint.sh text eol=lf
|
||||||
64
CHANGELOG.md
64
CHANGELOG.md
@@ -2,6 +2,70 @@
|
|||||||
|
|
||||||
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.9.8] - 19-06-2023
|
||||||
|
|
||||||
|
`bigcapitalhq/webapp`
|
||||||
|
|
||||||
|
* add: Inventory Adjustment option to the item drawer by @abouolia in https://github.com/bigcapitalhq/bigcapital/pull/158
|
||||||
|
* fix: use all drawers names from common enum object by @abouolia in https://github.com/bigcapitalhq/bigcapital/pull/157
|
||||||
|
* fix: adjustment type options do not show up by @abouolia in https://github.com/bigcapitalhq/bigcapital/pull/159
|
||||||
|
* fix: change the remove line text to be red to intent as a danger action by @abouolia in https://github.com/bigcapitalhq/bigcapital/pull/162
|
||||||
|
* fix: rename sidebar localization keys names to be keyword path by @abouolia in https://github.com/bigcapitalhq/bigcapital/pull/161
|
||||||
|
* fix: manual journal placeholder text by @abouolia in https://github.com/bigcapitalhq/bigcapital/pull/160
|
||||||
|
* fix: warehouses select component by @abouolia in https://github.com/bigcapitalhq/bigcapital/pull/168
|
||||||
|
|
||||||
|
`bigcapitalhq/server`
|
||||||
|
|
||||||
|
* fix: sending emails on reset password and registration by @abouolia in https://github.com/bigcapitalhq/bigcapital/pull/167
|
||||||
|
|
||||||
|
## [0.9.7] - 14-06-2023
|
||||||
|
|
||||||
|
`@bigcapital/webapp`
|
||||||
|
* fix: change the footer links of onboarding pages by @abouolia in https://github.com/bigcapitalhq/bigcapital/pull/139
|
||||||
|
|
||||||
|
`@bigcapital/server`
|
||||||
|
* fix: expense transaction journal entries by @abouolia in https://github.com/bigcapitalhq/bigcapital/pull/155
|
||||||
|
|
||||||
|
## [0.9.6] - 12-06-2023
|
||||||
|
|
||||||
|
`@bigcapital/webapp`
|
||||||
|
|
||||||
|
* fix: remove duplicated form submitting by @abouolia in https://github.com/bigcapitalhq/bigcapital/pull/138
|
||||||
|
* feat: add monorepo version on the application sidebar by @abouolia in https://github.com/bigcapitalhq/bigcapital/pull/136
|
||||||
|
|
||||||
|
## [0.9.5] - 11-06-2023
|
||||||
|
|
||||||
|
`@bigcapital/server`
|
||||||
|
|
||||||
|
* fix: filter ledger entries that effect contact balance to AR/AP accounts only by @abouolia in https://github.com/bigcapitalhq/bigcapital/pull/132
|
||||||
|
|
||||||
|
`@bigcapital/webapp`
|
||||||
|
|
||||||
|
* fix: catch journal error when create a journal with accounts have different currency by @abouolia in https://github.com/bigcapitalhq/bigcapital/pull/135
|
||||||
|
* fix: add duplicate icon to context menu of customers and vendors table by @abouolia in https://github.com/bigcapitalhq/bigcapital/pull/133
|
||||||
|
* fix: customer/vendor opening balance with exchange rate by @abouolia in https://github.com/bigcapitalhq/bigcapital/pull/134
|
||||||
|
|
||||||
|
## [0.9.4] - 08-06-2023
|
||||||
|
|
||||||
|
`@bigcapital/monorepo`
|
||||||
|
- fixed: docker-compose line-ending issue on Windows by @abouolia in https://github.com/bigcapitalhq/bigcapital/pull/130
|
||||||
|
|
||||||
|
`@bigcapital/server`
|
||||||
|
- fixed: Disable Webpack minification for JS class name reading.
|
||||||
|
|
||||||
|
## [0.9.3] -04-06-2023
|
||||||
|
|
||||||
|
`@bigcapital/monorepo`
|
||||||
|
* Added: Add env variable to customize the proxy public ports by @abouolia in https://github.com/bigcapitalhq/bigcapital/pull/125
|
||||||
|
* Added: Migrate the server database to MariaDB by @abouolia in https://github.com/bigcapitalhq/bigcapital/pull/128
|
||||||
|
|
||||||
|
## [0.9.2] - 31-05-2023
|
||||||
|
|
||||||
|
`@bigcapital/webapp`
|
||||||
|
|
||||||
|
- fixed: move `packaeg-lock.json` inside docker container.
|
||||||
|
- fixed: remove Sentry from the web client.
|
||||||
|
|
||||||
## [0.9.1] - 28-05-2023
|
## [0.9.1] - 28-05-2023
|
||||||
|
|
||||||
`@bigcapital/server`
|
`@bigcapital/server`
|
||||||
|
|||||||
20
README.md
20
README.md
@@ -7,6 +7,24 @@
|
|||||||
<p align="center">
|
<p align="center">
|
||||||
Simple, smart online accounting software for small and medium businesses.
|
Simple, smart online accounting software for small and medium businesses.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<a href="https://github.com/bigcapitalhq/bigcapital/commits/develop">
|
||||||
|
<img src="https://img.shields.io/github/commit-activity/m/bigcapitalhq/bigcapital/develop" />
|
||||||
|
</a>
|
||||||
|
<a href="https://discord.com/invite/c8nPBJafeb">
|
||||||
|
<img src="https://img.shields.io/discord/1066514716752625725?label=Discord" alt="" />
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/bigcapitalhq/bigcapital/graphs/contributors">
|
||||||
|
<img src="https://img.shields.io/github/contributors/bigcapitalhq/bigcapital" alt="" />
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/bigcapitalhq/bigcapital/blob/develop/LICENSE">
|
||||||
|
<img src="https://img.shields.io/github/license/bigcapitalhq/bigcapital" alt="" />
|
||||||
|
</a>
|
||||||
|
<a href="https://twitter.com/bigcapitalhq">
|
||||||
|
<img src="https://img.shields.io/twitter/follow/bigcapitalhq?style=social" alt="twitter" />
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
# What's Bigcapital?
|
# What's Bigcapital?
|
||||||
@@ -22,9 +40,9 @@ Bigcapital is a smart and open-source accounting and inventory software, Bigcapi
|
|||||||
# Resources
|
# Resources
|
||||||
|
|
||||||
- [Documentation](https://docs.bigcapital.ly/) - Learn how to use.
|
- [Documentation](https://docs.bigcapital.ly/) - Learn how to use.
|
||||||
|
- [Contribution](https://github.com/bigcapitalhq/bigcapital/blob/develop/CONTRIBUTING.md) - Welcome to any contributions.
|
||||||
- [Discord](https://discord.com/invite/c8nPBJafeb) - Ask for help.
|
- [Discord](https://discord.com/invite/c8nPBJafeb) - Ask for help.
|
||||||
- [Bug Tracker](https://github.com/bigcapitalhq/bigcapital/issues) - Notify us new bugs.
|
- [Bug Tracker](https://github.com/bigcapitalhq/bigcapital/issues) - Notify us new bugs.
|
||||||
- [Source Code](https://github.com/bigcapitalhq/bigcapital) - Github repo.
|
|
||||||
|
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
|||||||
@@ -94,12 +94,12 @@ services:
|
|||||||
mysql:
|
mysql:
|
||||||
container_name: bigcapital-mysql
|
container_name: bigcapital-mysql
|
||||||
build:
|
build:
|
||||||
context: ./docker/mysql
|
context: ./docker/mariadb
|
||||||
environment:
|
environment:
|
||||||
- MYSQL_DATABASE=${SYSTEM_DB_NAME}
|
- MYSQL_DATABASE=${SYSTEM_DB_NAME}
|
||||||
- MYSQL_USER=${DB_USER}
|
- MYSQL_USER=${DB_USER}
|
||||||
- MYSQL_PASSWORD=${DB_PASSWORD}
|
- MYSQL_PASSWORD=${DB_PASSWORD}
|
||||||
- MYSQL_ROOT_PASSWORD=${DB_PASSWORD}
|
- MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD}
|
||||||
volumes:
|
volumes:
|
||||||
- mysql:/var/lib/mysql
|
- mysql:/var/lib/mysql
|
||||||
expose:
|
expose:
|
||||||
|
|||||||
@@ -6,14 +6,14 @@
|
|||||||
version: '3.3'
|
version: '3.3'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
mysql:
|
mariadb:
|
||||||
build:
|
build:
|
||||||
context: ./docker/mysql
|
context: ./docker/mariadb
|
||||||
environment:
|
environment:
|
||||||
- MYSQL_DATABASE=${SYSTEM_DB_NAME}
|
- MYSQL_DATABASE=${SYSTEM_DB_NAME}
|
||||||
- MYSQL_USER=${DB_USER}
|
- MYSQL_USER=${DB_USER}
|
||||||
- MYSQL_PASSWORD=${DB_PASSWORD}
|
- MYSQL_PASSWORD=${DB_PASSWORD}
|
||||||
- MYSQL_ROOT_PASSWORD=${DB_PASSWORD}
|
- MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD}
|
||||||
volumes:
|
volumes:
|
||||||
- mysql:/var/lib/mysql
|
- mysql:/var/lib/mysql
|
||||||
expose:
|
expose:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM mysql:5.7
|
FROM mariadb:10.2
|
||||||
|
|
||||||
USER root
|
USER root
|
||||||
ADD my.cnf /etc/mysql/conf.d/my.cnf
|
ADD my.cnf /etc/mysql/conf.d/my.cnf
|
||||||
@@ -17,7 +17,7 @@ ENV MYSQL_ROOT_PASSWORD=$MYSQL_ROOT_PASSWORD
|
|||||||
COPY ./init.sql /scripts/init.template.sql
|
COPY ./init.sql /scripts/init.template.sql
|
||||||
COPY ./docker-entrypoint.sh /docker-entrypoint-initdb.d/docker-initialize.sh
|
COPY ./docker-entrypoint.sh /docker-entrypoint-initdb.d/docker-initialize.sh
|
||||||
|
|
||||||
# The scripts in the docker-entrypoint-initdb.d/ directory are executed as
|
# The scripts in the `docker-entrypoint-initdb.d/` directory are executed as
|
||||||
# the mysql user inside the MySQL Docker container.
|
# the mysql user inside the MySQL Docker container.
|
||||||
RUN chown -R mysql:root /docker-entrypoint-initdb.d
|
RUN chown -R mysql:root /docker-entrypoint-initdb.d
|
||||||
RUN chown -R mysql:root /scripts
|
RUN chown -R mysql:root /scripts
|
||||||
@@ -1,2 +1,3 @@
|
|||||||
GRANT ALL PRIVILEGES ON *.* TO '{MYSQL_USER}'@'%' IDENTIFIED BY '{MYSQL_PASSWORD}' WITH GRANT OPTION;
|
GRANT ALL PRIVILEGES ON *.* TO '{MYSQL_USER}'@'%' IDENTIFIED BY '{MYSQL_PASSWORD}' WITH GRANT OPTION;
|
||||||
|
|
||||||
FLUSH PRIVILEGES;
|
FLUSH PRIVILEGES;
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
|
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
|
||||||
"useWorkspaces": true,
|
"useWorkspaces": true,
|
||||||
"version": "0.0.0",
|
"version": "0.9.6",
|
||||||
"npmClient": "npm"
|
"npmClient": "npm"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@bigcapital/server",
|
"name": "@bigcapital/server",
|
||||||
"version": "1.7.1",
|
"version": "0.9.5",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "src/server.ts",
|
"main": "src/server.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -65,6 +65,9 @@ exports.getCommonWebpackOptions = ({
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
optimization: {
|
||||||
|
minimize: false,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
if (isDev) {
|
if (isDev) {
|
||||||
|
|||||||
@@ -92,6 +92,7 @@ export default class AuthenticationController extends BaseController {
|
|||||||
check('password')
|
check('password')
|
||||||
.exists()
|
.exists()
|
||||||
.isString()
|
.isString()
|
||||||
|
.isLength({ min: 6 })
|
||||||
.trim()
|
.trim()
|
||||||
.escape()
|
.escape()
|
||||||
.isLength({ max: DATATYPES_LENGTH.STRING }),
|
.isLength({ max: DATATYPES_LENGTH.STRING }),
|
||||||
@@ -106,7 +107,7 @@ export default class AuthenticationController extends BaseController {
|
|||||||
return [
|
return [
|
||||||
check('password')
|
check('password')
|
||||||
.exists()
|
.exists()
|
||||||
.isLength({ min: 5 })
|
.isLength({ min: 6 })
|
||||||
.custom((value, { req }) => {
|
.custom((value, { req }) => {
|
||||||
if (value !== req.body.confirm_password) {
|
if (value !== req.body.confirm_password) {
|
||||||
throw new Error("Passwords don't match");
|
throw new Error("Passwords don't match");
|
||||||
|
|||||||
@@ -95,16 +95,15 @@ module.exports = {
|
|||||||
* JWT secret.
|
* JWT secret.
|
||||||
*/
|
*/
|
||||||
jwtSecret: process.env.JWT_SECRET,
|
jwtSecret: process.env.JWT_SECRET,
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
resetPasswordSeconds: 600,
|
resetPasswordSeconds: 600,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Application base URL.
|
||||||
*/
|
*/
|
||||||
customerSuccess: {
|
|
||||||
email: 'success@bigcapital.ly',
|
|
||||||
phoneNumber: '(218) 92 791 8381',
|
|
||||||
},
|
|
||||||
|
|
||||||
baseURL: process.env.BASE_URL,
|
baseURL: process.env.BASE_URL,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -137,16 +136,6 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* Users registeration configuration.
|
|
||||||
*/
|
|
||||||
registration: {
|
|
||||||
countries: {
|
|
||||||
whitelist: ['LY'],
|
|
||||||
blacklist: [],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sign-up restrictions
|
* Sign-up restrictions
|
||||||
*/
|
*/
|
||||||
@@ -167,8 +156,6 @@ module.exports = {
|
|||||||
browserWSEndpoint: process.env.BROWSER_WS_ENDPOINT,
|
browserWSEndpoint: process.env.BROWSER_WS_ENDPOINT,
|
||||||
},
|
},
|
||||||
|
|
||||||
protocol: '',
|
|
||||||
hostname: '',
|
|
||||||
scheduleComputeItemCost: 'in 5 seconds',
|
scheduleComputeItemCost: 'in 5 seconds',
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ export interface ILedger {
|
|||||||
|
|
||||||
getEntries(): ILedgerEntry[];
|
getEntries(): ILedgerEntry[];
|
||||||
|
|
||||||
|
filter(cb: (entry: ILedgerEntry) => boolean): ILedger;
|
||||||
|
|
||||||
whereAccountId(accountId: number): ILedger;
|
whereAccountId(accountId: number): ILedger;
|
||||||
whereContactId(contactId: number): ILedger;
|
whereContactId(contactId: number): ILedger;
|
||||||
whereFromDate(fromDate: Date | string): ILedger;
|
whereFromDate(fromDate: Date | string): ILedger;
|
||||||
|
|||||||
@@ -1,38 +1,34 @@
|
|||||||
import { Container, Inject } from 'typedi';
|
import { Container } from 'typedi';
|
||||||
import AuthenticationService from '@/services/Authentication/AuthApplication';
|
import AuthenticationMailMesssages from '@/services/Authentication/AuthenticationMailMessages';
|
||||||
|
|
||||||
export default class WelcomeEmailJob {
|
export default class ResetPasswordEmailJob {
|
||||||
/**
|
/**
|
||||||
* Constructor method.
|
* Constructor method.
|
||||||
* @param {Agenda} agenda
|
* @param {Agenda} agenda
|
||||||
*/
|
*/
|
||||||
constructor(agenda) {
|
constructor(agenda) {
|
||||||
agenda.define(
|
agenda.define(
|
||||||
'reset-password-mail',
|
'reset-password-mail',
|
||||||
{ priority: 'high' },
|
{ priority: 'high' },
|
||||||
this.handler.bind(this),
|
this.handler.bind(this)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle send welcome mail job.
|
* Handle send welcome mail job.
|
||||||
* @param {Job} job
|
* @param {Job} job
|
||||||
* @param {Function} done
|
* @param {Function} done
|
||||||
*/
|
*/
|
||||||
public async handler(job, done: Function): Promise<void> {
|
public async handler(job, done: Function): Promise<void> {
|
||||||
const { data } = job.attrs;
|
const { data } = job.attrs;
|
||||||
const { user, token } = data;
|
const { user, token } = data;
|
||||||
const Logger = Container.get('logger');
|
const authService = Container.get(AuthenticationMailMesssages);
|
||||||
const authService = Container.get(AuthenticationService);
|
|
||||||
|
|
||||||
Logger.info(`[send_reset_password] started.`, { data });
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await authService.mailMessages.sendResetPasswordMessage(user, token);
|
await authService.sendResetPasswordMessage(user, token);
|
||||||
Logger.info(`[send_reset_password] finished.`, { data });
|
done();
|
||||||
done()
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
Logger.error(`[send_reset_password] error.`, { data, error });
|
console.log(error);
|
||||||
done(error);
|
done(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,22 +0,0 @@
|
|||||||
import { Container } from 'typedi';
|
|
||||||
|
|
||||||
export default class SmsNotification {
|
|
||||||
constructor(agenda) {
|
|
||||||
agenda.define('sms-notification', { priority: 'high' }, this.handler);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {Job}job
|
|
||||||
*/
|
|
||||||
async handler(job) {
|
|
||||||
const { message, to } = job.attrs.data;
|
|
||||||
const smsClient = Container.get('SMSClient');
|
|
||||||
|
|
||||||
try {
|
|
||||||
await smsClient.sendMessage(to, message);
|
|
||||||
} catch (error) {
|
|
||||||
done(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
import { Container, Inject } from 'typedi';
|
|
||||||
import AuthenticationService from '@/services/Authentication/AuthApplication';
|
|
||||||
|
|
||||||
export default class WelcomeSMSJob {
|
|
||||||
/**
|
|
||||||
* Constructor method.
|
|
||||||
* @param {Agenda} agenda
|
|
||||||
*/
|
|
||||||
constructor(agenda) {
|
|
||||||
agenda.define('welcome-sms', { priority: 'high' }, this.handler);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Handle send welcome mail job.
|
|
||||||
* @param {Job} job
|
|
||||||
* @param {Function} done
|
|
||||||
*/
|
|
||||||
public async handler(job, done: Function): Promise<void> {
|
|
||||||
const { tenant, user } = job.attrs.data;
|
|
||||||
|
|
||||||
const Logger = Container.get('logger');
|
|
||||||
const authService = Container.get(AuthenticationService);
|
|
||||||
|
|
||||||
Logger.info(`[welcome_sms] started: ${job.attrs.data}`);
|
|
||||||
|
|
||||||
try {
|
|
||||||
await authService.smsMessages.sendWelcomeMessage(tenant, user);
|
|
||||||
Logger.info(`[welcome_sms] finished`, { tenant, user });
|
|
||||||
done();
|
|
||||||
} catch (error) {
|
|
||||||
Logger.info(`[welcome_sms] error`, { error, tenant, user });
|
|
||||||
done(error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
import { Container } from 'typedi';
|
|
||||||
import AuthenticationService from '@/services/Authentication/AuthApplication';
|
|
||||||
|
|
||||||
export default class WelcomeEmailJob {
|
|
||||||
/**
|
|
||||||
* Constructor method.
|
|
||||||
* @param {Agenda} agenda -
|
|
||||||
*/
|
|
||||||
constructor(agenda) {
|
|
||||||
// Welcome mail and SMS message.
|
|
||||||
agenda.define(
|
|
||||||
'welcome-email',
|
|
||||||
{ priority: 'high' },
|
|
||||||
this.handler.bind(this),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Handle send welcome mail job.
|
|
||||||
* @param {Job} job
|
|
||||||
* @param {Function} done
|
|
||||||
*/
|
|
||||||
public async handler(job, done: Function): Promise<void> {
|
|
||||||
const { organizationId, user } = job.attrs.data;
|
|
||||||
const Logger: any = Container.get('logger');
|
|
||||||
const authService = Container.get(AuthenticationService);
|
|
||||||
|
|
||||||
Logger.info(`[welcome_mail] started: ${job.attrs.data}`);
|
|
||||||
|
|
||||||
try {
|
|
||||||
await authService.mailMessages.sendWelcomeMessage(user, organizationId);
|
|
||||||
Logger.info(`[welcome_mail] finished: ${job.attrs.data}`);
|
|
||||||
done();
|
|
||||||
} catch (error) {
|
|
||||||
Logger.error(`[welcome_mail] error: ${job.attrs.data}, error: ${error}`);
|
|
||||||
done(error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -31,7 +31,6 @@ import OrgBuildSmsNotificationSubscriber from '@/subscribers/Organization/BuildS
|
|||||||
import PurgeUserAbilityCache from '@/services/Users/PurgeUserAbilityCache';
|
import PurgeUserAbilityCache from '@/services/Users/PurgeUserAbilityCache';
|
||||||
import ResetLoginThrottleSubscriber from '@/subscribers/Authentication/ResetLoginThrottle';
|
import ResetLoginThrottleSubscriber from '@/subscribers/Authentication/ResetLoginThrottle';
|
||||||
import AuthenticationSubscriber from '@/subscribers/Authentication/SendResetPasswordMail';
|
import AuthenticationSubscriber from '@/subscribers/Authentication/SendResetPasswordMail';
|
||||||
import AuthSendWelcomeMailSubscriber from '@/subscribers/Authentication/SendWelcomeMail';
|
|
||||||
import PurgeAuthorizedUserOnceRoleMutate from '@/services/Roles/PurgeAuthorizedUser';
|
import PurgeAuthorizedUserOnceRoleMutate from '@/services/Roles/PurgeAuthorizedUser';
|
||||||
import SendSmsNotificationToCustomer from '@/subscribers/SaleInvoices/SendSmsNotificationToCustomer';
|
import SendSmsNotificationToCustomer from '@/subscribers/SaleInvoices/SendSmsNotificationToCustomer';
|
||||||
import SendSmsNotificationSaleReceipt from '@/subscribers/SaleReceipt/SendSmsNotificationToCustomer';
|
import SendSmsNotificationSaleReceipt from '@/subscribers/SaleReceipt/SendSmsNotificationToCustomer';
|
||||||
@@ -120,7 +119,6 @@ export const susbcribers = () => {
|
|||||||
PurgeUserAbilityCache,
|
PurgeUserAbilityCache,
|
||||||
ResetLoginThrottleSubscriber,
|
ResetLoginThrottleSubscriber,
|
||||||
AuthenticationSubscriber,
|
AuthenticationSubscriber,
|
||||||
AuthSendWelcomeMailSubscriber,
|
|
||||||
PurgeAuthorizedUserOnceRoleMutate,
|
PurgeAuthorizedUserOnceRoleMutate,
|
||||||
SendSmsNotificationToCustomer,
|
SendSmsNotificationToCustomer,
|
||||||
SendSmsNotificationSaleReceipt,
|
SendSmsNotificationSaleReceipt,
|
||||||
|
|||||||
@@ -1,24 +1,18 @@
|
|||||||
import Agenda from 'agenda';
|
import Agenda from 'agenda';
|
||||||
import WelcomeEmailJob from 'jobs/welcomeEmail';
|
|
||||||
import WelcomeSMSJob from 'jobs/WelcomeSMS';
|
|
||||||
import ResetPasswordMailJob from 'jobs/ResetPasswordMail';
|
import ResetPasswordMailJob from 'jobs/ResetPasswordMail';
|
||||||
import ComputeItemCost from 'jobs/ComputeItemCost';
|
import ComputeItemCost from 'jobs/ComputeItemCost';
|
||||||
import RewriteInvoicesJournalEntries from 'jobs/writeInvoicesJEntries';
|
import RewriteInvoicesJournalEntries from 'jobs/WriteInvoicesJEntries';
|
||||||
import UserInviteMailJob from 'jobs/UserInviteMail';
|
import UserInviteMailJob from 'jobs/UserInviteMail';
|
||||||
import OrganizationSetupJob from 'jobs/OrganizationSetup';
|
import OrganizationSetupJob from 'jobs/OrganizationSetup';
|
||||||
import OrganizationUpgrade from 'jobs/OrganizationUpgrade';
|
import OrganizationUpgrade from 'jobs/OrganizationUpgrade';
|
||||||
import SmsNotification from 'jobs/SmsNotification';
|
|
||||||
|
|
||||||
export default ({ agenda }: { agenda: Agenda }) => {
|
export default ({ agenda }: { agenda: Agenda }) => {
|
||||||
new WelcomeEmailJob(agenda);
|
|
||||||
new ResetPasswordMailJob(agenda);
|
new ResetPasswordMailJob(agenda);
|
||||||
new WelcomeSMSJob(agenda);
|
|
||||||
new UserInviteMailJob(agenda);
|
new UserInviteMailJob(agenda);
|
||||||
new ComputeItemCost(agenda);
|
new ComputeItemCost(agenda);
|
||||||
new RewriteInvoicesJournalEntries(agenda);
|
new RewriteInvoicesJournalEntries(agenda);
|
||||||
new OrganizationSetupJob(agenda);
|
new OrganizationSetupJob(agenda);
|
||||||
new OrganizationUpgrade(agenda);
|
new OrganizationUpgrade(agenda);
|
||||||
new SmsNotification(agenda);
|
|
||||||
|
|
||||||
agenda.start();
|
agenda.start();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,9 +1,14 @@
|
|||||||
import { Service, Inject } from 'typedi';
|
import { Service, Inject } from 'typedi';
|
||||||
import async from 'async';
|
import async from 'async';
|
||||||
import { Knex } from 'knex';
|
import { Knex } from 'knex';
|
||||||
import { ILedger, ISaleContactsBalanceQueuePayload } from '@/interfaces';
|
import {
|
||||||
|
ILedger,
|
||||||
|
ILedgerEntry,
|
||||||
|
ISaleContactsBalanceQueuePayload,
|
||||||
|
} from '@/interfaces';
|
||||||
import HasTenancyService from '@/services/Tenancy/TenancyService';
|
import HasTenancyService from '@/services/Tenancy/TenancyService';
|
||||||
import { TenantMetadata } from '@/system/models';
|
import { TenantMetadata } from '@/system/models';
|
||||||
|
import { ACCOUNT_TYPE } from '@/data/AccountTypes';
|
||||||
|
|
||||||
@Service()
|
@Service()
|
||||||
export class LedgerContactsBalanceStorage {
|
export class LedgerContactsBalanceStorage {
|
||||||
@@ -49,6 +54,29 @@ export class LedgerContactsBalanceStorage {
|
|||||||
await this.saveContactBalance(tenantId, ledger, contactId, trx);
|
await this.saveContactBalance(tenantId, ledger, contactId, trx);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filters AP/AR ledger entries.
|
||||||
|
* @param {number} tenantId
|
||||||
|
* @param {Knex.Transaction} trx
|
||||||
|
* @returns {Promise<(entry: ILedgerEntry) => boolean>}
|
||||||
|
*/
|
||||||
|
private filterARAPLedgerEntris = async (
|
||||||
|
tenantId: number,
|
||||||
|
trx?: Knex.Transaction
|
||||||
|
): Promise<(entry: ILedgerEntry) => boolean> => {
|
||||||
|
const { Account } = this.tenancy.models(tenantId);
|
||||||
|
|
||||||
|
const ARAPAcounts = await Account.query(trx).whereIn('accountType', [
|
||||||
|
ACCOUNT_TYPE.ACCOUNTS_RECEIVABLE,
|
||||||
|
ACCOUNT_TYPE.ACCOUNTS_PAYABLE,
|
||||||
|
]);
|
||||||
|
const ARAPAcountsIds = ARAPAcounts.map((a) => a.id);
|
||||||
|
|
||||||
|
return (entry: ILedgerEntry) => {
|
||||||
|
return ARAPAcountsIds.indexOf(entry.accountId) !== -1;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {number} tenantId
|
* @param {number} tenantId
|
||||||
@@ -63,16 +91,24 @@ export class LedgerContactsBalanceStorage {
|
|||||||
trx?: Knex.Transaction
|
trx?: Knex.Transaction
|
||||||
): Promise<void> => {
|
): Promise<void> => {
|
||||||
const { Contact } = this.tenancy.models(tenantId);
|
const { Contact } = this.tenancy.models(tenantId);
|
||||||
const contact = await Contact.query().findById(contactId);
|
const contact = await Contact.query(trx).findById(contactId);
|
||||||
|
|
||||||
// Retrieves the given tenant metadata.
|
// Retrieves the given tenant metadata.
|
||||||
const tenantMeta = await TenantMetadata.query().findOne({ tenantId });
|
const tenantMeta = await TenantMetadata.query().findOne({ tenantId });
|
||||||
|
|
||||||
// Detarmines whether the contact has foreign currency.
|
// Detarmines whether the contact has foreign currency.
|
||||||
const isForeignContact = contact.currencyCode !== tenantMeta.baseCurrency;
|
const isForeignContact = contact.currencyCode !== tenantMeta.baseCurrency;
|
||||||
|
|
||||||
// Filters the ledger base on the given contact id.
|
// Filters the ledger base on the given contact id.
|
||||||
const contactLedger = ledger.whereContactId(contactId);
|
const filterARAPLedgerEntris = await this.filterARAPLedgerEntris(
|
||||||
|
tenantId,
|
||||||
|
trx
|
||||||
|
);
|
||||||
|
const contactLedger = ledger
|
||||||
|
// Filter entries only that have contact id.
|
||||||
|
.whereContactId(contactId)
|
||||||
|
// Filter entries on AR/AP accounts.
|
||||||
|
.filter(filterARAPLedgerEntris);
|
||||||
|
|
||||||
const closingBalance = isForeignContact
|
const closingBalance = isForeignContact
|
||||||
? contactLedger
|
? contactLedger
|
||||||
|
|||||||
@@ -5,59 +5,24 @@ import Mail from '@/lib/Mail';
|
|||||||
|
|
||||||
@Service()
|
@Service()
|
||||||
export default class AuthenticationMailMesssages {
|
export default class AuthenticationMailMesssages {
|
||||||
/**
|
|
||||||
* Sends welcome message.
|
|
||||||
* @param {ISystemUser} user - The system user.
|
|
||||||
* @param {string} organizationName -
|
|
||||||
* @return {Promise<void>}
|
|
||||||
*/
|
|
||||||
async sendWelcomeMessage(
|
|
||||||
user: ISystemUser,
|
|
||||||
organizationId: string
|
|
||||||
): Promise<void> {
|
|
||||||
const root = __dirname + '/../../../views/images/bigcapital.png';
|
|
||||||
|
|
||||||
const mail = new Mail()
|
|
||||||
.setView('mail/Welcome.html')
|
|
||||||
.setSubject('Welcome to Bigcapital')
|
|
||||||
.setTo(user.email)
|
|
||||||
.setAttachments([
|
|
||||||
{
|
|
||||||
filename: 'bigcapital.png',
|
|
||||||
path: root,
|
|
||||||
cid: 'bigcapital_logo',
|
|
||||||
},
|
|
||||||
])
|
|
||||||
.setData({
|
|
||||||
firstName: user.firstName,
|
|
||||||
organizationId,
|
|
||||||
successPhoneNumber: config.customerSuccess.phoneNumber,
|
|
||||||
successEmail: config.customerSuccess.email,
|
|
||||||
});
|
|
||||||
|
|
||||||
await mail.send();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends reset password message.
|
* Sends reset password message.
|
||||||
* @param {ISystemUser} user - The system user.
|
* @param {ISystemUser} user - The system user.
|
||||||
* @param {string} token - Reset password token.
|
* @param {string} token - Reset password token.
|
||||||
* @return {Promise<void>}
|
* @return {Promise<void>}
|
||||||
*/
|
*/
|
||||||
async sendResetPasswordMessage(
|
public async sendResetPasswordMessage(
|
||||||
user: ISystemUser,
|
user: ISystemUser,
|
||||||
token: string
|
token: string
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const root = __dirname + '/../../../views/images/bigcapital.png';
|
await new Mail()
|
||||||
|
|
||||||
const mail = new Mail()
|
|
||||||
.setSubject('Bigcapital - Password Reset')
|
.setSubject('Bigcapital - Password Reset')
|
||||||
.setView('mail/ResetPassword.html')
|
.setView('mail/ResetPassword.html')
|
||||||
.setTo(user.email)
|
.setTo(user.email)
|
||||||
.setAttachments([
|
.setAttachments([
|
||||||
{
|
{
|
||||||
filename: 'bigcapital.png',
|
filename: 'bigcapital.png',
|
||||||
path: root,
|
path: `${global.__views_dir}/images/bigcapital.png`,
|
||||||
cid: 'bigcapital_logo',
|
cid: 'bigcapital_logo',
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
@@ -65,9 +30,7 @@ export default class AuthenticationMailMesssages {
|
|||||||
resetPasswordUrl: `${config.baseURL}/auth/reset_password/${token}`,
|
resetPasswordUrl: `${config.baseURL}/auth/reset_password/${token}`,
|
||||||
first_name: user.firstName,
|
first_name: user.firstName,
|
||||||
last_name: user.lastName,
|
last_name: user.lastName,
|
||||||
contact_us_email: config.contactUsMail,
|
})
|
||||||
});
|
.send();
|
||||||
|
|
||||||
await mail.send();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
import { Service, Inject } from 'typedi';
|
|
||||||
import { ISystemUser, ITenant } from '@/interfaces';
|
|
||||||
|
|
||||||
@Service()
|
|
||||||
export default class AuthenticationSMSMessages {
|
|
||||||
@Inject('SMSClient')
|
|
||||||
smsClient: any;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sends welcome sms message.
|
|
||||||
* @param {ITenant} tenant
|
|
||||||
* @param {ISystemUser} user
|
|
||||||
*/
|
|
||||||
sendWelcomeMessage(tenant: ITenant, user: ISystemUser) {
|
|
||||||
const message: string = `Hi ${user.firstName}, Welcome to Bigcapital, You've joined the new workspace, if you need any help please don't hesitate to contact us.`;
|
|
||||||
|
|
||||||
return this.smsClient.sendMessage(user.phoneNumber, message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -55,7 +55,7 @@ export class CreateCustomer {
|
|||||||
} as ICustomerEventCreatingPayload);
|
} as ICustomerEventCreatingPayload);
|
||||||
|
|
||||||
// Creates a new contact as customer.
|
// Creates a new contact as customer.
|
||||||
const customer = await Contact.query().insertAndFetch({
|
const customer = await Contact.query(trx).insertAndFetch({
|
||||||
...customerObj,
|
...customerObj,
|
||||||
});
|
});
|
||||||
// Triggers `onCustomerCreated` event.
|
// Triggers `onCustomerCreated` event.
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import events from '@/subscribers/events';
|
|||||||
import UnitOfWork from '@/services/UnitOfWork';
|
import UnitOfWork from '@/services/UnitOfWork';
|
||||||
import { EventPublisher } from '@/lib/EventPublisher/EventPublisher';
|
import { EventPublisher } from '@/lib/EventPublisher/EventPublisher';
|
||||||
import { CommandExpenseValidator } from './CommandExpenseValidator';
|
import { CommandExpenseValidator } from './CommandExpenseValidator';
|
||||||
import { ExpenseCategory } from 'models';
|
|
||||||
import HasTenancyService from '@/services/Tenancy/TenancyService';
|
import HasTenancyService from '@/services/Tenancy/TenancyService';
|
||||||
|
|
||||||
@Service()
|
@Service()
|
||||||
@@ -37,7 +36,7 @@ export class DeleteExpense {
|
|||||||
expenseId: number,
|
expenseId: number,
|
||||||
authorizedUser: ISystemUser
|
authorizedUser: ISystemUser
|
||||||
): Promise<void> => {
|
): Promise<void> => {
|
||||||
const { Expense } = this.tenancy.models(tenantId);
|
const { Expense, ExpenseCategory } = this.tenancy.models(tenantId);
|
||||||
|
|
||||||
// Retrieves the expense transaction with associated entries or
|
// Retrieves the expense transaction with associated entries or
|
||||||
// throw not found error.
|
// throw not found error.
|
||||||
@@ -60,7 +59,7 @@ export class DeleteExpense {
|
|||||||
} as IExpenseDeletingPayload);
|
} as IExpenseDeletingPayload);
|
||||||
|
|
||||||
// Deletes expense associated entries.
|
// Deletes expense associated entries.
|
||||||
await ExpenseCategory.query(trx).findById(expenseId).delete();
|
await ExpenseCategory.query(trx).where('expenseId', expenseId).delete();
|
||||||
|
|
||||||
// Deletes expense transactions.
|
// Deletes expense transactions.
|
||||||
await Expense.query(trx).findById(expenseId).delete();
|
await Expense.query(trx).findById(expenseId).delete();
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ export class ExpenseGLEntries {
|
|||||||
...commonEntry,
|
...commonEntry,
|
||||||
credit: expense.localAmount,
|
credit: expense.localAmount,
|
||||||
accountId: expense.paymentAccountId,
|
accountId: expense.paymentAccountId,
|
||||||
accountNormal: AccountNormal.CREDIT,
|
accountNormal: AccountNormal.DEBIT,
|
||||||
index: 1,
|
index: 1,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import events from '@/subscribers/events';
|
|||||||
@Service()
|
@Service()
|
||||||
export default class AuthenticationSubscriber {
|
export default class AuthenticationSubscriber {
|
||||||
@Inject('agenda')
|
@Inject('agenda')
|
||||||
agenda: any;
|
private agenda: any;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Attaches events with handlers.
|
* Attaches events with handlers.
|
||||||
|
|||||||
@@ -1,28 +0,0 @@
|
|||||||
import { Service, Inject } from 'typedi';
|
|
||||||
import events from '@/subscribers/events';
|
|
||||||
|
|
||||||
@Service()
|
|
||||||
export default class AuthSendWelcomeMailSubscriber {
|
|
||||||
@Inject('agenda')
|
|
||||||
agenda: any;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Attaches events with handlers.
|
|
||||||
*/
|
|
||||||
public attach(bus) {
|
|
||||||
bus.subscribe(events.auth.signUp, this.sendWelcomeEmailOnceUserRegister);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sends welcome email once the user register.
|
|
||||||
*/
|
|
||||||
private sendWelcomeEmailOnceUserRegister = async (payload) => {
|
|
||||||
const { tenant, user } = payload;
|
|
||||||
|
|
||||||
// Send welcome mail to the user.
|
|
||||||
await this.agenda.now('welcome-email', {
|
|
||||||
organizationId: tenant.organizationId,
|
|
||||||
user,
|
|
||||||
});
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,411 +0,0 @@
|
|||||||
<!doctype html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta name="viewport" content="width=device-width" />
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
|
||||||
<title>Bigcapital | Reset your password</title>
|
|
||||||
<style>
|
|
||||||
/* -------------------------------------
|
|
||||||
GLOBAL RESETS
|
|
||||||
------------------------------------- */
|
|
||||||
|
|
||||||
/*All the styling goes here*/
|
|
||||||
|
|
||||||
img {
|
|
||||||
border: none;
|
|
||||||
-ms-interpolation-mode: bicubic;
|
|
||||||
max-width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
body {
|
|
||||||
background-color: #f6f6f6;
|
|
||||||
font-family: sans-serif;
|
|
||||||
-webkit-font-smoothing: antialiased;
|
|
||||||
font-size: 14px;
|
|
||||||
line-height: 1.4;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
-ms-text-size-adjust: 100%;
|
|
||||||
-webkit-text-size-adjust: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
table {
|
|
||||||
border-collapse: separate;
|
|
||||||
mso-table-lspace: 0pt;
|
|
||||||
mso-table-rspace: 0pt;
|
|
||||||
width: 100%; }
|
|
||||||
table td {
|
|
||||||
font-family: sans-serif;
|
|
||||||
font-size: 14px;
|
|
||||||
vertical-align: top;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -------------------------------------
|
|
||||||
BODY & CONTAINER
|
|
||||||
------------------------------------- */
|
|
||||||
|
|
||||||
.body {
|
|
||||||
background-color: #f6f6f6;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Set a max-width, and make it display as block so it will automatically stretch to that width, but will also shrink down on a phone or something */
|
|
||||||
.container {
|
|
||||||
display: block;
|
|
||||||
margin: 0 auto !important;
|
|
||||||
/* makes it centered */
|
|
||||||
max-width: 580px;
|
|
||||||
padding: 10px;
|
|
||||||
width: 580px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* This should also be a block element, so that it will fill 100% of the .container */
|
|
||||||
.content {
|
|
||||||
box-sizing: border-box;
|
|
||||||
display: block;
|
|
||||||
margin: 0 auto;
|
|
||||||
max-width: 580px;
|
|
||||||
padding: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -------------------------------------
|
|
||||||
HEADER, FOOTER, MAIN
|
|
||||||
------------------------------------- */
|
|
||||||
.main {
|
|
||||||
background: #ffffff;
|
|
||||||
border-radius: 3px;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.wrapper {
|
|
||||||
box-sizing: border-box;
|
|
||||||
padding: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.content-block {
|
|
||||||
padding-bottom: 10px;
|
|
||||||
padding-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.footer {
|
|
||||||
clear: both;
|
|
||||||
margin-top: 10px;
|
|
||||||
text-align: center;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.footer td,
|
|
||||||
.footer p,
|
|
||||||
.footer span,
|
|
||||||
.footer a {
|
|
||||||
color: #999999;
|
|
||||||
font-size: 12px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -------------------------------------
|
|
||||||
TYPOGRAPHY
|
|
||||||
------------------------------------- */
|
|
||||||
h1,
|
|
||||||
h2,
|
|
||||||
h3,
|
|
||||||
h4 {
|
|
||||||
color: #000000;
|
|
||||||
font-family: sans-serif;
|
|
||||||
font-weight: bold;
|
|
||||||
line-height: 1.4;
|
|
||||||
margin: 0;
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
h1 {
|
|
||||||
font-size: 35px;
|
|
||||||
font-weight: 300;
|
|
||||||
text-align: center;
|
|
||||||
text-transform: capitalize;
|
|
||||||
}
|
|
||||||
|
|
||||||
p,
|
|
||||||
ul,
|
|
||||||
ol {
|
|
||||||
font-family: sans-serif;
|
|
||||||
font-size: 14px;
|
|
||||||
font-weight: normal;
|
|
||||||
margin: 0;
|
|
||||||
margin-bottom: 15px;
|
|
||||||
}
|
|
||||||
p li,
|
|
||||||
ul li,
|
|
||||||
ol li {
|
|
||||||
list-style-position: inside;
|
|
||||||
margin-left: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
|
||||||
color: #3498db;
|
|
||||||
text-decoration: underline;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -------------------------------------
|
|
||||||
BUTTONS
|
|
||||||
------------------------------------- */
|
|
||||||
.btn {
|
|
||||||
box-sizing: border-box;
|
|
||||||
width: 100%;
|
|
||||||
|
|
||||||
}
|
|
||||||
.btn > tbody > tr > td {
|
|
||||||
padding-bottom: 15px; }
|
|
||||||
.btn table {
|
|
||||||
width: auto;
|
|
||||||
}
|
|
||||||
.btn table td {
|
|
||||||
background-color: #ffffff;
|
|
||||||
border-radius: 5px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
.btn a {
|
|
||||||
background-color: #ffffff;
|
|
||||||
border: solid 1px #3498db;
|
|
||||||
border-radius: 5px;
|
|
||||||
box-sizing: border-box;
|
|
||||||
color: #3498db;
|
|
||||||
cursor: pointer;
|
|
||||||
display: inline-block;
|
|
||||||
font-size: 14px;
|
|
||||||
font-weight: bold;
|
|
||||||
margin: 0;
|
|
||||||
padding: 12px 25px;
|
|
||||||
text-decoration: none;
|
|
||||||
text-transform: capitalize;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-primary table td {
|
|
||||||
background-color: #2d95fd;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-primary a {
|
|
||||||
background-color: #2d95fd;
|
|
||||||
border-color: #2d95fd;
|
|
||||||
color: #ffffff;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -------------------------------------
|
|
||||||
OTHER STYLES THAT MIGHT BE USEFUL
|
|
||||||
------------------------------------- */
|
|
||||||
.last {
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.first {
|
|
||||||
margin-top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.align-center {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.align-right {
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
.align-left {
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
.clear {
|
|
||||||
clear: both;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mt0 {
|
|
||||||
margin-top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mb0 {
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mb4{
|
|
||||||
margin-bottom: 4rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.preheader {
|
|
||||||
color: transparent;
|
|
||||||
display: none;
|
|
||||||
height: 0;
|
|
||||||
max-height: 0;
|
|
||||||
max-width: 0;
|
|
||||||
opacity: 0;
|
|
||||||
overflow: hidden;
|
|
||||||
mso-hide: all;
|
|
||||||
visibility: hidden;
|
|
||||||
width: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.powered-by a {
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
hr {
|
|
||||||
border: 0;
|
|
||||||
border-bottom: 1px solid #f6f6f6;
|
|
||||||
margin: 20px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -------------------------------------
|
|
||||||
RESPONSIVE AND MOBILE FRIENDLY STYLES
|
|
||||||
------------------------------------- */
|
|
||||||
@media only screen and (max-width: 620px) {
|
|
||||||
table[class=body] h1 {
|
|
||||||
font-size: 28px !important;
|
|
||||||
margin-bottom: 10px !important;
|
|
||||||
}
|
|
||||||
table[class=body] p,
|
|
||||||
table[class=body] ul,
|
|
||||||
table[class=body] ol,
|
|
||||||
table[class=body] td,
|
|
||||||
table[class=body] span,
|
|
||||||
table[class=body] a {
|
|
||||||
font-size: 16px !important;
|
|
||||||
}
|
|
||||||
table[class=body] .wrapper,
|
|
||||||
table[class=body] .article {
|
|
||||||
padding: 10px !important;
|
|
||||||
}
|
|
||||||
table[class=body] .content {
|
|
||||||
padding: 0 !important;
|
|
||||||
}
|
|
||||||
table[class=body] .container {
|
|
||||||
padding: 0 !important;
|
|
||||||
width: 100% !important;
|
|
||||||
}
|
|
||||||
table[class=body] .main {
|
|
||||||
border-left-width: 0 !important;
|
|
||||||
border-radius: 0 !important;
|
|
||||||
border-right-width: 0 !important;
|
|
||||||
}
|
|
||||||
table[class=body] .btn table {
|
|
||||||
width: 100% !important;
|
|
||||||
}
|
|
||||||
table[class=body] .btn a {
|
|
||||||
width: 100% !important;
|
|
||||||
}
|
|
||||||
table[class=body] .img-responsive {
|
|
||||||
height: auto !important;
|
|
||||||
max-width: 100% !important;
|
|
||||||
width: auto !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* -------------------------------------
|
|
||||||
PRESERVE THESE STYLES IN THE HEAD
|
|
||||||
------------------------------------- */
|
|
||||||
@media all {
|
|
||||||
.ExternalClass {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.ExternalClass,
|
|
||||||
.ExternalClass p,
|
|
||||||
.ExternalClass span,
|
|
||||||
.ExternalClass font,
|
|
||||||
.ExternalClass td,
|
|
||||||
.ExternalClass div {
|
|
||||||
line-height: 100%;
|
|
||||||
}
|
|
||||||
.apple-link a {
|
|
||||||
color: inherit !important;
|
|
||||||
font-family: inherit !important;
|
|
||||||
font-size: inherit !important;
|
|
||||||
font-weight: inherit !important;
|
|
||||||
line-height: inherit !important;
|
|
||||||
text-decoration: none !important;
|
|
||||||
}
|
|
||||||
#MessageViewBody a {
|
|
||||||
color: inherit;
|
|
||||||
text-decoration: none;
|
|
||||||
font-size: inherit;
|
|
||||||
font-family: inherit;
|
|
||||||
font-weight: inherit;
|
|
||||||
line-height: inherit;
|
|
||||||
}
|
|
||||||
.btn-primary table td:hover {
|
|
||||||
background-color: #004dd0 !important;
|
|
||||||
}
|
|
||||||
.btn-primary a:hover {
|
|
||||||
background-color: #004dd0 !important;
|
|
||||||
border-color: #004dd0 !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
[data-icon="bigcapital"] path {
|
|
||||||
fill: #004dd0;
|
|
||||||
}
|
|
||||||
|
|
||||||
[data-icon='bigcapital'] .path-1,
|
|
||||||
[data-icon='bigcapital'] .path-13 {
|
|
||||||
fill: #2d95fd;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body class="">
|
|
||||||
<span class="preheader">This is preheader text. Some clients will show this text as a preview.</span>
|
|
||||||
<table role="presentation" border="0" cellpadding="0" cellspacing="0" class="body">
|
|
||||||
<tr>
|
|
||||||
<td> </td>
|
|
||||||
<td class="container">
|
|
||||||
<div class="content">
|
|
||||||
|
|
||||||
<!-- START CENTERED WHITE CONTAINER -->
|
|
||||||
<table role="presentation" class="main">
|
|
||||||
<!-- START MAIN CONTENT AREA -->
|
|
||||||
<tr>
|
|
||||||
<td class="wrapper">
|
|
||||||
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<p class="align-center">
|
|
||||||
<svg data-icon="bigcapital" class="bigcapital" width="190" height="37" viewBox="0 0 309.09 42.89"><desc>bigcapital</desc><path d="M56,3.16,61.33,8.5,31.94,37.9l-5.35-5.35Z" class="path-1" fill-rule="evenodd"></path><path d="M29.53,6.94l5.35,5.34L5.49,41.67.14,36.33l15.8-15.8Z" class="path-2" fill-rule="evenodd"></path><path d="M94.36,38.87H79.62v-31H94c6.33,0,10.22,3.15,10.22,8V16a7.22,7.22,0,0,1-4.07,6.69c3.58,1.37,5.8,3.45,5.8,7.61v.09C106,36,101.35,38.87,94.36,38.87Zm3.1-21.81c0-2-1.59-3.19-4.47-3.19H86.26v6.55h6.29c3,0,4.91-1,4.91-3.28Zm1.72,12.39c0-2.08-1.54-3.37-5-3.37H86.26V32.9h8.1c3,0,4.82-1.06,4.82-3.36Z" class="path-3" fill-rule="evenodd"></path><path d="M110.56,12.54v-6h7.08v6Zm.18,26.33V15.15h6.72V38.87Z" class="path-4" fill-rule="evenodd"></path><path d="M134,46a22.55,22.55,0,0,1-10.49-2.47l2.3-5a15.52,15.52,0,0,0,8,2.17c4.61,0,6.78-2.21,6.78-6.46V33.08c-2,2.39-4.16,3.85-7.75,3.85-5.53,0-10.53-4-10.53-11.07v-.09c0-7.08,5.09-11.06,10.53-11.06a9.63,9.63,0,0,1,7.66,3.54v-3.1h6.72V33.52C147.2,42.46,142.78,46,134,46Zm6.6-20.27a5.79,5.79,0,0,0-11.56,0v.09a5.42,5.42,0,0,0,5.76,5.49,5.49,5.49,0,0,0,5.8-5.49Z" class="path-5" fill-rule="evenodd"></path><path d="M164,39.41a12.11,12.11,0,0,1-12.35-12.26v-.09a12.18,12.18,0,0,1,12.44-12.35c4.47,0,7.25,1.5,9.47,4l-4.12,4.43a6.93,6.93,0,0,0-5.4-2.61c-3.36,0-5.75,3-5.75,6.46v.09c0,3.63,2.34,6.55,6,6.55,2.26,0,3.8-1,5.44-2.53l3.94,4A12,12,0,0,1,164,39.41Z" class="path-6" fill-rule="evenodd"></path><path d="M191.51,38.87V36.31a9.15,9.15,0,0,1-7.17,3c-4.47,0-8.15-2.57-8.15-7.26V32c0-5.18,3.94-7.57,9.56-7.57a16.74,16.74,0,0,1,5.8,1V25c0-2.79-1.72-4.34-5.09-4.34a17.57,17.57,0,0,0-6.55,1.28l-1.68-5.13a21,21,0,0,1,9.21-1.9c7.34,0,10.57,3.8,10.57,10.22V38.87Zm.13-9.55a10.3,10.3,0,0,0-4.29-.89c-2.88,0-4.65,1.15-4.65,3.27v.09c0,1.82,1.5,2.88,3.67,2.88,3.15,0,5.27-1.73,5.27-4.16Z" class="path-7" fill-rule="evenodd"></path><path d="M217.49,39.32a9.1,9.1,0,0,1-7.39-3.54V46h-6.73V15.15h6.73v3.41a8.7,8.7,0,0,1,7.39-3.85c5.53,0,10.8,4.34,10.8,12.26v.09C228.29,35,223.11,39.32,217.49,39.32ZM221.56,27c0-3.94-2.66-6.55-5.8-6.55S210,23,210,27v.09c0,3.94,2.61,6.55,5.75,6.55s5.8-2.57,5.8-6.55Z" class="path-8" fill-rule="evenodd"></path><path d="M232.93,12.54v-6H240v6Zm.18,26.33V15.15h6.73V38.87Z" class="path-9" fill-rule="evenodd"></path><path d="M253.73,39.27c-4.11,0-6.9-1.63-6.9-7.12V20.91H244V15.15h2.83V9.09h6.73v6.06h5.57v5.76h-5.57V31c0,1.55.66,2.3,2.16,2.3A6.84,6.84,0,0,0,259,32.5v5.4A9.9,9.9,0,0,1,253.73,39.27Z" class="path-10" fill-rule="evenodd"></path><path d="M277.55,38.87V36.31a9.15,9.15,0,0,1-7.18,3c-4.46,0-8.14-2.57-8.14-7.26V32c0-5.18,3.94-7.57,9.56-7.57a16.74,16.74,0,0,1,5.8,1V25c0-2.79-1.73-4.34-5.09-4.34A17.57,17.57,0,0,0,266,21.92l-1.68-5.13a20.94,20.94,0,0,1,9.2-1.9c7.35,0,10.58,3.8,10.58,10.22V38.87Zm.13-9.55a10.31,10.31,0,0,0-4.3-.89c-2.87,0-4.64,1.15-4.64,3.27v.09c0,1.82,1.5,2.88,3.67,2.88,3.14,0,5.27-1.73,5.27-4.16Z" class="path-11" fill-rule="evenodd"></path><path d="M289.72,38.87V6.57h6.72v32.3Z" class="path-12" fill-rule="evenodd"></path><path d="M302.06,38.87V31.79h7.17v7.08Z" class="path-13" fill-rule="evenodd"></path></svg>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<hr />
|
|
||||||
|
|
||||||
<p class="align-center">
|
|
||||||
<h3>License Code</h3>
|
|
||||||
</p>
|
|
||||||
<p class="mgb-1x">
|
|
||||||
<h1>{{ licenseCode }}</h1>
|
|
||||||
</p>
|
|
||||||
<p class="email-note">
|
|
||||||
This is an automatically generated email please do not reply to
|
|
||||||
this email. If you face any issues, please contact us at <a href="mailto:{{ successEmail }}">{{ successEmail }}</a> or call <u>{{ successPhoneNumber }}</u></p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<!-- END MAIN CONTENT AREA -->
|
|
||||||
</table>
|
|
||||||
<!-- END CENTERED WHITE CONTAINER -->
|
|
||||||
|
|
||||||
<!-- START FOOTER -->
|
|
||||||
<div class="footer">
|
|
||||||
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
|
||||||
<tr>
|
|
||||||
<td class="content-block powered-by">
|
|
||||||
Powered by <a href="http://htmlemail.io">Bigcapital.com</a>.
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<!-- END FOOTER -->
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
<td> </td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -391,10 +391,8 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<p>If you did not make this request, please contact us or ignore this message.</p>
|
<p>If this was a mistake, just ignore this email and nothing will happen.</p>
|
||||||
<p class="email-note">
|
<p class="email-note">This is an automatically generated email please do not reply to this email.</p>
|
||||||
This is an automatically generated email please do not reply to
|
|
||||||
this email. If you face any issues, please contact us at {{ contact_us_email }}</p>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -1,407 +0,0 @@
|
|||||||
<!doctype html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta name="viewport" content="width=device-width" />
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
|
||||||
<title>Bigcapital | Reset your password</title>
|
|
||||||
<style>
|
|
||||||
/* -------------------------------------
|
|
||||||
GLOBAL RESETS
|
|
||||||
------------------------------------- */
|
|
||||||
|
|
||||||
img {
|
|
||||||
border: none;
|
|
||||||
-ms-interpolation-mode: bicubic;
|
|
||||||
max-width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
body {
|
|
||||||
background-color: #f6f6f6;
|
|
||||||
font-family: sans-serif;
|
|
||||||
-webkit-font-smoothing: antialiased;
|
|
||||||
font-size: 14px;
|
|
||||||
line-height: 1.4;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
-ms-text-size-adjust: 100%;
|
|
||||||
-webkit-text-size-adjust: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
table {
|
|
||||||
border-collapse: separate;
|
|
||||||
mso-table-lspace: 0pt;
|
|
||||||
mso-table-rspace: 0pt;
|
|
||||||
width: 100%; }
|
|
||||||
table td {
|
|
||||||
font-family: sans-serif;
|
|
||||||
font-size: 14px;
|
|
||||||
vertical-align: top;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -------------------------------------
|
|
||||||
BODY & CONTAINER
|
|
||||||
------------------------------------- */
|
|
||||||
|
|
||||||
.body {
|
|
||||||
background-color: #f6f6f6;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Set a max-width, and make it display as block so it will automatically stretch to that width, but will also shrink down on a phone or something */
|
|
||||||
.container {
|
|
||||||
display: block;
|
|
||||||
margin: 0 auto !important;
|
|
||||||
/* makes it centered */
|
|
||||||
max-width: 580px;
|
|
||||||
padding: 10px;
|
|
||||||
width: 580px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* This should also be a block element, so that it will fill 100% of the .container */
|
|
||||||
.content {
|
|
||||||
box-sizing: border-box;
|
|
||||||
display: block;
|
|
||||||
margin: 0 auto;
|
|
||||||
max-width: 580px;
|
|
||||||
padding: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -------------------------------------
|
|
||||||
HEADER, FOOTER, MAIN
|
|
||||||
------------------------------------- */
|
|
||||||
.main {
|
|
||||||
background: #ffffff;
|
|
||||||
border-radius: 3px;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.wrapper {
|
|
||||||
box-sizing: border-box;
|
|
||||||
padding: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.content-block {
|
|
||||||
padding-bottom: 10px;
|
|
||||||
padding-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.footer {
|
|
||||||
clear: both;
|
|
||||||
margin-top: 10px;
|
|
||||||
text-align: center;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.footer td,
|
|
||||||
.footer p,
|
|
||||||
.footer span,
|
|
||||||
.footer a {
|
|
||||||
color: #999999;
|
|
||||||
font-size: 12px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -------------------------------------
|
|
||||||
TYPOGRAPHY
|
|
||||||
------------------------------------- */
|
|
||||||
h1,
|
|
||||||
h2,
|
|
||||||
h3,
|
|
||||||
h4 {
|
|
||||||
color: #000000;
|
|
||||||
font-family: sans-serif;
|
|
||||||
font-weight: bold;
|
|
||||||
line-height: 1.4;
|
|
||||||
margin: 0;
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
h1 {
|
|
||||||
font-size: 35px;
|
|
||||||
font-weight: 300;
|
|
||||||
text-align: center;
|
|
||||||
text-transform: capitalize;
|
|
||||||
}
|
|
||||||
|
|
||||||
p,
|
|
||||||
ul,
|
|
||||||
ol {
|
|
||||||
font-family: sans-serif;
|
|
||||||
font-size: 14px;
|
|
||||||
font-weight: normal;
|
|
||||||
margin: 0;
|
|
||||||
margin-bottom: 15px;
|
|
||||||
}
|
|
||||||
p li,
|
|
||||||
ul li,
|
|
||||||
ol li {
|
|
||||||
list-style-position: inside;
|
|
||||||
margin-left: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
|
||||||
color: #3498db;
|
|
||||||
text-decoration: underline;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -------------------------------------
|
|
||||||
BUTTONS
|
|
||||||
------------------------------------- */
|
|
||||||
.btn {
|
|
||||||
box-sizing: border-box;
|
|
||||||
width: 100%;
|
|
||||||
|
|
||||||
}
|
|
||||||
.btn > tbody > tr > td {
|
|
||||||
padding-bottom: 15px; }
|
|
||||||
.btn table {
|
|
||||||
width: auto;
|
|
||||||
}
|
|
||||||
.btn table td {
|
|
||||||
background-color: #ffffff;
|
|
||||||
border-radius: 5px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
.btn a {
|
|
||||||
background-color: #ffffff;
|
|
||||||
border: solid 1px #3498db;
|
|
||||||
border-radius: 5px;
|
|
||||||
box-sizing: border-box;
|
|
||||||
color: #3498db;
|
|
||||||
cursor: pointer;
|
|
||||||
display: inline-block;
|
|
||||||
font-size: 14px;
|
|
||||||
font-weight: bold;
|
|
||||||
margin: 0;
|
|
||||||
padding: 12px 25px;
|
|
||||||
text-decoration: none;
|
|
||||||
text-transform: capitalize;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-primary table td {
|
|
||||||
background-color: #2d95fd;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-primary a {
|
|
||||||
background-color: #2d95fd;
|
|
||||||
border-color: #2d95fd;
|
|
||||||
color: #ffffff;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -------------------------------------
|
|
||||||
OTHER STYLES THAT MIGHT BE USEFUL
|
|
||||||
------------------------------------- */
|
|
||||||
.last {
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.first {
|
|
||||||
margin-top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.align-center {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.align-right {
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
.align-left {
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
.clear {
|
|
||||||
clear: both;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mt0 {
|
|
||||||
margin-top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mb0 {
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mb4{
|
|
||||||
margin-bottom: 4rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.preheader {
|
|
||||||
color: transparent;
|
|
||||||
display: none;
|
|
||||||
height: 0;
|
|
||||||
max-height: 0;
|
|
||||||
max-width: 0;
|
|
||||||
opacity: 0;
|
|
||||||
overflow: hidden;
|
|
||||||
mso-hide: all;
|
|
||||||
visibility: hidden;
|
|
||||||
width: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.powered-by a {
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
hr {
|
|
||||||
border: 0;
|
|
||||||
border-bottom: 1px solid #f6f6f6;
|
|
||||||
margin: 20px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -------------------------------------
|
|
||||||
RESPONSIVE AND MOBILE FRIENDLY STYLES
|
|
||||||
------------------------------------- */
|
|
||||||
@media only screen and (max-width: 620px) {
|
|
||||||
table[class=body] h1 {
|
|
||||||
font-size: 28px !important;
|
|
||||||
margin-bottom: 10px !important;
|
|
||||||
}
|
|
||||||
table[class=body] p,
|
|
||||||
table[class=body] ul,
|
|
||||||
table[class=body] ol,
|
|
||||||
table[class=body] td,
|
|
||||||
table[class=body] span,
|
|
||||||
table[class=body] a {
|
|
||||||
font-size: 16px !important;
|
|
||||||
}
|
|
||||||
table[class=body] .wrapper,
|
|
||||||
table[class=body] .article {
|
|
||||||
padding: 10px !important;
|
|
||||||
}
|
|
||||||
table[class=body] .content {
|
|
||||||
padding: 0 !important;
|
|
||||||
}
|
|
||||||
table[class=body] .container {
|
|
||||||
padding: 0 !important;
|
|
||||||
width: 100% !important;
|
|
||||||
}
|
|
||||||
table[class=body] .main {
|
|
||||||
border-left-width: 0 !important;
|
|
||||||
border-radius: 0 !important;
|
|
||||||
border-right-width: 0 !important;
|
|
||||||
}
|
|
||||||
table[class=body] .btn table {
|
|
||||||
width: 100% !important;
|
|
||||||
}
|
|
||||||
table[class=body] .btn a {
|
|
||||||
width: 100% !important;
|
|
||||||
}
|
|
||||||
table[class=body] .img-responsive {
|
|
||||||
height: auto !important;
|
|
||||||
max-width: 100% !important;
|
|
||||||
width: auto !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* -------------------------------------
|
|
||||||
PRESERVE THESE STYLES IN THE HEAD
|
|
||||||
------------------------------------- */
|
|
||||||
@media all {
|
|
||||||
.ExternalClass {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.ExternalClass,
|
|
||||||
.ExternalClass p,
|
|
||||||
.ExternalClass span,
|
|
||||||
.ExternalClass font,
|
|
||||||
.ExternalClass td,
|
|
||||||
.ExternalClass div {
|
|
||||||
line-height: 100%;
|
|
||||||
}
|
|
||||||
.apple-link a {
|
|
||||||
color: inherit !important;
|
|
||||||
font-family: inherit !important;
|
|
||||||
font-size: inherit !important;
|
|
||||||
font-weight: inherit !important;
|
|
||||||
line-height: inherit !important;
|
|
||||||
text-decoration: none !important;
|
|
||||||
}
|
|
||||||
#MessageViewBody a {
|
|
||||||
color: inherit;
|
|
||||||
text-decoration: none;
|
|
||||||
font-size: inherit;
|
|
||||||
font-family: inherit;
|
|
||||||
font-weight: inherit;
|
|
||||||
line-height: inherit;
|
|
||||||
}
|
|
||||||
.btn-primary table td:hover {
|
|
||||||
background-color: #004dd0 !important;
|
|
||||||
}
|
|
||||||
.btn-primary a:hover {
|
|
||||||
background-color: #004dd0 !important;
|
|
||||||
border-color: #004dd0 !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
[data-icon="bigcapital"] path {
|
|
||||||
fill: #004dd0;
|
|
||||||
}
|
|
||||||
|
|
||||||
[data-icon='bigcapital'] .path-1,
|
|
||||||
[data-icon='bigcapital'] .path-13 {
|
|
||||||
fill: #2d95fd;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body class="">
|
|
||||||
<span class="preheader">This is preheader text. Some clients will show this text as a preview.</span>
|
|
||||||
<table role="presentation" border="0" cellpadding="0" cellspacing="0" class="body">
|
|
||||||
<tr>
|
|
||||||
<td> </td>
|
|
||||||
<td class="container">
|
|
||||||
<div class="content">
|
|
||||||
|
|
||||||
<!-- START CENTERED WHITE CONTAINER -->
|
|
||||||
<table role="presentation" class="main">
|
|
||||||
<!-- START MAIN CONTENT AREA -->
|
|
||||||
<tr>
|
|
||||||
<td class="wrapper">
|
|
||||||
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<p class="align-center">
|
|
||||||
<img src="cid:bigcapital_logo" />
|
|
||||||
</p>
|
|
||||||
<hr />
|
|
||||||
|
|
||||||
<p class="align-center">
|
|
||||||
<h3>Hi {{ firstName }}, Welcome to Bigcapital, </h3>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p class="mgb-1x">
|
|
||||||
Your organization Id: <strong>{{ organizationId }}</strong>
|
|
||||||
</p>
|
|
||||||
<p class="mgb-1x">We are available to help you get started and answer any questions you may have. You can also email <a href="mailto:{{ successEmail }}">{{ successEmail }}</a> or call <u>{{ successPhoneNumber }}</u> about your set-up questions.</p>
|
|
||||||
|
|
||||||
<p class="mgb-2-5x">Thank you for trusting Bigcapital Software for your business needs. We look forward to serving you!</p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<!-- END MAIN CONTENT AREA -->
|
|
||||||
</table>
|
|
||||||
<!-- END CENTERED WHITE CONTAINER -->
|
|
||||||
|
|
||||||
<!-- START FOOTER -->
|
|
||||||
<div class="footer">
|
|
||||||
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
|
||||||
<tr>
|
|
||||||
<td class="content-block powered-by">
|
|
||||||
Made by Bigcapital Technologies, Inc
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<!-- END FOOTER -->
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
<td> </td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,7 +1,18 @@
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
const webpack = require('webpack');
|
||||||
|
const dotenv = require('dotenv-webpack');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
webpack: {
|
webpack: {
|
||||||
|
plugins: [
|
||||||
|
new dotenv(),
|
||||||
|
new webpack.DefinePlugin({
|
||||||
|
'process.env': {
|
||||||
|
MONOREPO_VERSION: JSON.stringify(require('../../lerna.json').version),
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
|
||||||
alias: {
|
alias: {
|
||||||
'@': path.resolve(__dirname, 'src'),
|
'@': path.resolve(__dirname, 'src'),
|
||||||
},
|
},
|
||||||
|
|||||||
147
packages/webapp/package-lock.json
generated
147
packages/webapp/package-lock.json
generated
@@ -1929,137 +1929,6 @@
|
|||||||
"reselect": "^4.1.7"
|
"reselect": "^4.1.7"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@sentry/browser": {
|
|
||||||
"version": "6.19.7",
|
|
||||||
"resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-6.19.7.tgz",
|
|
||||||
"integrity": "sha512-oDbklp4O3MtAM4mtuwyZLrgO1qDVYIujzNJQzXmi9YzymJCuzMLSRDvhY83NNDCRxf0pds4DShgYeZdbSyKraA==",
|
|
||||||
"requires": {
|
|
||||||
"@sentry/core": "6.19.7",
|
|
||||||
"@sentry/types": "6.19.7",
|
|
||||||
"@sentry/utils": "6.19.7",
|
|
||||||
"tslib": "^1.9.3"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"tslib": {
|
|
||||||
"version": "1.14.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
|
|
||||||
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"@sentry/core": {
|
|
||||||
"version": "6.19.7",
|
|
||||||
"resolved": "https://registry.npmjs.org/@sentry/core/-/core-6.19.7.tgz",
|
|
||||||
"integrity": "sha512-tOfZ/umqB2AcHPGbIrsFLcvApdTm9ggpi/kQZFkej7kMphjT+SGBiQfYtjyg9jcRW+ilAR4JXC9BGKsdEQ+8Vw==",
|
|
||||||
"requires": {
|
|
||||||
"@sentry/hub": "6.19.7",
|
|
||||||
"@sentry/minimal": "6.19.7",
|
|
||||||
"@sentry/types": "6.19.7",
|
|
||||||
"@sentry/utils": "6.19.7",
|
|
||||||
"tslib": "^1.9.3"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"tslib": {
|
|
||||||
"version": "1.14.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
|
|
||||||
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"@sentry/hub": {
|
|
||||||
"version": "6.19.7",
|
|
||||||
"resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-6.19.7.tgz",
|
|
||||||
"integrity": "sha512-y3OtbYFAqKHCWezF0EGGr5lcyI2KbaXW2Ik7Xp8Mu9TxbSTuwTe4rTntwg8ngPjUQU3SUHzgjqVB8qjiGqFXCA==",
|
|
||||||
"requires": {
|
|
||||||
"@sentry/types": "6.19.7",
|
|
||||||
"@sentry/utils": "6.19.7",
|
|
||||||
"tslib": "^1.9.3"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"tslib": {
|
|
||||||
"version": "1.14.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
|
|
||||||
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"@sentry/minimal": {
|
|
||||||
"version": "6.19.7",
|
|
||||||
"resolved": "https://registry.npmjs.org/@sentry/minimal/-/minimal-6.19.7.tgz",
|
|
||||||
"integrity": "sha512-wcYmSJOdvk6VAPx8IcmZgN08XTXRwRtB1aOLZm+MVHjIZIhHoBGZJYTVQS/BWjldsamj2cX3YGbGXNunaCfYJQ==",
|
|
||||||
"requires": {
|
|
||||||
"@sentry/hub": "6.19.7",
|
|
||||||
"@sentry/types": "6.19.7",
|
|
||||||
"tslib": "^1.9.3"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"tslib": {
|
|
||||||
"version": "1.14.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
|
|
||||||
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"@sentry/react": {
|
|
||||||
"version": "6.19.7",
|
|
||||||
"resolved": "https://registry.npmjs.org/@sentry/react/-/react-6.19.7.tgz",
|
|
||||||
"integrity": "sha512-VzJeBg/v41jfxUYPkH2WYrKjWc4YiMLzDX0f4Zf6WkJ4v3IlDDSkX6DfmWekjTKBho6wiMkSNy2hJ1dHfGZ9jA==",
|
|
||||||
"requires": {
|
|
||||||
"@sentry/browser": "6.19.7",
|
|
||||||
"@sentry/minimal": "6.19.7",
|
|
||||||
"@sentry/types": "6.19.7",
|
|
||||||
"@sentry/utils": "6.19.7",
|
|
||||||
"hoist-non-react-statics": "^3.3.2",
|
|
||||||
"tslib": "^1.9.3"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"tslib": {
|
|
||||||
"version": "1.14.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
|
|
||||||
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"@sentry/tracing": {
|
|
||||||
"version": "6.19.7",
|
|
||||||
"resolved": "https://registry.npmjs.org/@sentry/tracing/-/tracing-6.19.7.tgz",
|
|
||||||
"integrity": "sha512-ol4TupNnv9Zd+bZei7B6Ygnr9N3Gp1PUrNI761QSlHtPC25xXC5ssSD3GMhBgyQrcvpuRcCFHVNNM97tN5cZiA==",
|
|
||||||
"requires": {
|
|
||||||
"@sentry/hub": "6.19.7",
|
|
||||||
"@sentry/minimal": "6.19.7",
|
|
||||||
"@sentry/types": "6.19.7",
|
|
||||||
"@sentry/utils": "6.19.7",
|
|
||||||
"tslib": "^1.9.3"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"tslib": {
|
|
||||||
"version": "1.14.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
|
|
||||||
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"@sentry/types": {
|
|
||||||
"version": "6.19.7",
|
|
||||||
"resolved": "https://registry.npmjs.org/@sentry/types/-/types-6.19.7.tgz",
|
|
||||||
"integrity": "sha512-jH84pDYE+hHIbVnab3Hr+ZXr1v8QABfhx39KknxqKWr2l0oEItzepV0URvbEhB446lk/S/59230dlUUIBGsXbg=="
|
|
||||||
},
|
|
||||||
"@sentry/utils": {
|
|
||||||
"version": "6.19.7",
|
|
||||||
"resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-6.19.7.tgz",
|
|
||||||
"integrity": "sha512-z95ECmE3i9pbWoXQrD/7PgkBAzJYR+iXtPuTkpBjDKs86O3mT+PXOT3BAn79w2wkn7/i3vOGD2xVr1uiMl26dA==",
|
|
||||||
"requires": {
|
|
||||||
"@sentry/types": "6.19.7",
|
|
||||||
"tslib": "^1.9.3"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"tslib": {
|
|
||||||
"version": "1.14.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
|
|
||||||
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"@sheerun/mutationobserver-shim": {
|
"@sheerun/mutationobserver-shim": {
|
||||||
"version": "0.3.3",
|
"version": "0.3.3",
|
||||||
"resolved": "https://registry.npmjs.org/@sheerun/mutationobserver-shim/-/mutationobserver-shim-0.3.3.tgz",
|
"resolved": "https://registry.npmjs.org/@sheerun/mutationobserver-shim/-/mutationobserver-shim-0.3.3.tgz",
|
||||||
@@ -5985,11 +5854,27 @@
|
|||||||
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.2.0.tgz",
|
||||||
"integrity": "sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw=="
|
"integrity": "sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw=="
|
||||||
},
|
},
|
||||||
|
"dotenv-defaults": {
|
||||||
|
"version": "2.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/dotenv-defaults/-/dotenv-defaults-2.0.2.tgz",
|
||||||
|
"integrity": "sha512-iOIzovWfsUHU91L5i8bJce3NYK5JXeAwH50Jh6+ARUdLiiGlYWfGw6UkzsYqaXZH/hjE/eCd/PlfM/qqyK0AMg==",
|
||||||
|
"requires": {
|
||||||
|
"dotenv": "^8.2.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"dotenv-expand": {
|
"dotenv-expand": {
|
||||||
"version": "5.1.0",
|
"version": "5.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/dotenv-expand/-/dotenv-expand-5.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/dotenv-expand/-/dotenv-expand-5.1.0.tgz",
|
||||||
"integrity": "sha512-YXQl1DSa4/PQyRfgrv6aoNjhasp/p4qs9FjJ4q4cQk+8m4r6k4ZSiEyytKG8f8W9gi8WsQtIObNmKd+tMzNTmA=="
|
"integrity": "sha512-YXQl1DSa4/PQyRfgrv6aoNjhasp/p4qs9FjJ4q4cQk+8m4r6k4ZSiEyytKG8f8W9gi8WsQtIObNmKd+tMzNTmA=="
|
||||||
},
|
},
|
||||||
|
"dotenv-webpack": {
|
||||||
|
"version": "8.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/dotenv-webpack/-/dotenv-webpack-8.0.1.tgz",
|
||||||
|
"integrity": "sha512-CdrgfhZOnx4uB18SgaoP9XHRN2v48BbjuXQsZY5ixs5A8579NxQkmMxRtI7aTwSiSQcM2ao12Fdu+L3ZS3bG4w==",
|
||||||
|
"requires": {
|
||||||
|
"dotenv-defaults": "^2.0.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
"duplexer": {
|
"duplexer": {
|
||||||
"version": "0.1.2",
|
"version": "0.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@bigcapital/webapp",
|
"name": "@bigcapital/webapp",
|
||||||
"version": "1.7.1",
|
"version": "0.9.6",
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@blueprintjs-formik/core": "^0.3.3",
|
"@blueprintjs-formik/core": "^0.3.3",
|
||||||
@@ -42,6 +42,7 @@
|
|||||||
"deep-map-keys": "^2.0.1",
|
"deep-map-keys": "^2.0.1",
|
||||||
"deepdash": "^5.3.9",
|
"deepdash": "^5.3.9",
|
||||||
"dependency-graph": "^0.11.0",
|
"dependency-graph": "^0.11.0",
|
||||||
|
"dotenv-webpack": "^8.0.1",
|
||||||
"fast-deep-equal": "^3.1.3",
|
"fast-deep-equal": "^3.1.3",
|
||||||
"flat": "^5.0.2",
|
"flat": "^5.0.2",
|
||||||
"formik": "^2.2.5",
|
"formik": "^2.2.5",
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import * as R from 'ramda';
|
|||||||
|
|
||||||
import { ButtonLink } from '../Button';
|
import { ButtonLink } from '../Button';
|
||||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||||
|
import { DRAWERS } from '@/constants/drawers';
|
||||||
|
|
||||||
function CustomerDrawerLinkComponent({
|
function CustomerDrawerLinkComponent({
|
||||||
// #ownProps
|
// #ownProps
|
||||||
@@ -16,7 +17,7 @@ function CustomerDrawerLinkComponent({
|
|||||||
}) {
|
}) {
|
||||||
// Handle view customer drawer.
|
// Handle view customer drawer.
|
||||||
const handleCustomerDrawer = (event) => {
|
const handleCustomerDrawer = (event) => {
|
||||||
openDrawer('customer-detail-drawer', { customerId });
|
openDrawer(DRAWERS.CUSTOMER_DETAILS, { customerId });
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -31,28 +31,28 @@ import { DRAWERS } from '@/constants/drawers';
|
|||||||
export default function DrawersContainer() {
|
export default function DrawersContainer() {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<AccountDrawer name={DRAWERS.ACCOUNT} />
|
<AccountDrawer name={DRAWERS.ACCOUNT_DETAILS} />
|
||||||
<ManualJournalDrawer name={DRAWERS.JOURNAL} />
|
<ManualJournalDrawer name={DRAWERS.JOURNAL_DETAILS} />
|
||||||
<ExpenseDrawer name={DRAWERS.EXPENSE} />
|
<ExpenseDrawer name={DRAWERS.EXPENSE_DETAILS} />
|
||||||
<BillDrawer name={DRAWERS.BILL} />
|
<BillDrawer name={DRAWERS.BILL_DETAILS} />
|
||||||
<InvoiceDetailDrawer name={DRAWERS.INVOICE} />
|
<InvoiceDetailDrawer name={DRAWERS.INVOICE_DETAILS} />
|
||||||
<EstimateDetailDrawer name={DRAWERS.ESTIMATE} />
|
<EstimateDetailDrawer name={DRAWERS.ESTIMATE_DETAILS} />
|
||||||
<ReceiptDetailDrawer name={DRAWERS.RECEIPT} />
|
<ReceiptDetailDrawer name={DRAWERS.RECEIPT_DETAILS} />
|
||||||
<PaymentReceiveDetailDrawer name={DRAWERS.PAYMENT_RECEIVE} />
|
<PaymentReceiveDetailDrawer name={DRAWERS.PAYMENT_RECEIVE_DETAILS} />
|
||||||
<PaymentMadeDetailDrawer name={DRAWERS.PAYMENT_MADE} />
|
<PaymentMadeDetailDrawer name={DRAWERS.PAYMENT_MADE_DETAILS} />
|
||||||
<ItemDetailDrawer name={DRAWERS.ITEM} />
|
<ItemDetailDrawer name={DRAWERS.ITEM_DETAILS} />
|
||||||
<CustomerDetailsDrawer name={DRAWERS.CUSTOMER} />
|
<CustomerDetailsDrawer name={DRAWERS.CUSTOMER_DETAILS} />
|
||||||
<VendorDetailsDrawer name={DRAWERS.VENDOR} />
|
<VendorDetailsDrawer name={DRAWERS.VENDOR_DETAILS} />
|
||||||
<InventoryAdjustmentDetailDrawer name={DRAWERS.INVENTORY_ADJUSTMENT} />
|
<InventoryAdjustmentDetailDrawer name={DRAWERS.INVENTORY_ADJUSTMENT_DETAILS} />
|
||||||
<CashflowTransactionDetailDrawer name={DRAWERS.CASHFLOW_TRNASACTION} />
|
<CashflowTransactionDetailDrawer name={DRAWERS.CASHFLOW_TRNASACTION_DETAILS} />
|
||||||
<QuickCreateCustomerDrawer name={DRAWERS.QUICK_CREATE_CUSTOMER} />
|
<QuickCreateCustomerDrawer name={DRAWERS.QUICK_CREATE_CUSTOMER} />
|
||||||
<QuickCreateItemDrawer name={DRAWERS.QUICK_CREATE_ITEM} />
|
<QuickCreateItemDrawer name={DRAWERS.QUICK_CREATE_ITEM} />
|
||||||
<QuickWriteVendorDrawer name={DRAWERS.QUICK_WRITE_VENDOR} />
|
<QuickWriteVendorDrawer name={DRAWERS.QUICK_WRITE_VENDOR} />
|
||||||
<CreditNoteDetailDrawer name={DRAWERS.CREDIT_NOTE} />
|
<CreditNoteDetailDrawer name={DRAWERS.CREDIT_NOTE_DETAILS} />
|
||||||
<VendorCreditDetailDrawer name={DRAWERS.VENDOR_CREDIT} />
|
<VendorCreditDetailDrawer name={DRAWERS.VENDOR_CREDIT_DETAILS} />
|
||||||
<RefundCreditNoteDetailDrawer name={DRAWERS.REFUND_CREDIT_NOTE} />
|
<RefundCreditNoteDetailDrawer name={DRAWERS.REFUND_CREDIT_NOTE_DETAILS} />
|
||||||
<RefundVendorCreditDetailDrawer name={DRAWERS.REFUND_VENDOR_CREDIT} />
|
<RefundVendorCreditDetailDrawer name={DRAWERS.REFUND_VENDOR_CREDIT_DETAILS} />
|
||||||
<WarehouseTransferDetailDrawer name={DRAWERS.WAREHOUSE_TRANSFER} />
|
<WarehouseTransferDetailDrawer name={DRAWERS.WAREHOUSE_TRANSFER_DETAILS} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import * as R from 'ramda';
|
|||||||
|
|
||||||
import { ButtonLink } from '../Button';
|
import { ButtonLink } from '../Button';
|
||||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||||
|
import { DRAWERS } from '@/constants/drawers';
|
||||||
|
|
||||||
function VendorDrawerLinkComponent({
|
function VendorDrawerLinkComponent({
|
||||||
// #ownProps
|
// #ownProps
|
||||||
@@ -16,7 +17,7 @@ function VendorDrawerLinkComponent({
|
|||||||
}) {
|
}) {
|
||||||
// Handle view customer drawer.
|
// Handle view customer drawer.
|
||||||
const handleVendorDrawer = (event) => {
|
const handleVendorDrawer = (event) => {
|
||||||
openDrawer('vendor-detail-drawer', { vendorId });
|
openDrawer(DRAWERS.VENDOR_DETAILS, { vendorId });
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,75 +1,21 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { MenuItem, Button } from '@blueprintjs/core';
|
|
||||||
import { FSelect } from '../Forms';
|
import { FSelect } from '../Forms';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Warehouse select field.
|
||||||
* @param {*} query
|
|
||||||
* @param {*} warehouse
|
|
||||||
* @param {*} _index
|
|
||||||
* @param {*} exactMatch
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
const warehouseItemPredicate = (query, warehouse, _index, exactMatch) => {
|
|
||||||
const normalizedTitle = warehouse.name.toLowerCase();
|
|
||||||
const normalizedQuery = query.toLowerCase();
|
|
||||||
|
|
||||||
if (exactMatch) {
|
|
||||||
return normalizedTitle === normalizedQuery;
|
|
||||||
} else {
|
|
||||||
return (
|
|
||||||
`${warehouse.code}. ${normalizedTitle}`.indexOf(normalizedQuery) >= 0
|
|
||||||
);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {*} film
|
|
||||||
* @param {*} param1
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
const warehouseItemRenderer = (
|
|
||||||
warehouse,
|
|
||||||
{ handleClick, modifiers, query },
|
|
||||||
) => {
|
|
||||||
const text = `${warehouse.name}`;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<MenuItem
|
|
||||||
active={modifiers.active}
|
|
||||||
disabled={modifiers.disabled}
|
|
||||||
label={warehouse.code}
|
|
||||||
key={warehouse.id}
|
|
||||||
onClick={handleClick}
|
|
||||||
text={text}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
const warehouseSelectProps = {
|
|
||||||
itemPredicate: warehouseItemPredicate,
|
|
||||||
itemRenderer: warehouseItemRenderer,
|
|
||||||
valueAccessor: 'id',
|
|
||||||
labelAccessor: 'name',
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {*} param0
|
* @param {*} param0
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
export function WarehouseSelect({ warehouses, ...rest }) {
|
export function WarehouseSelect({ warehouses, ...rest }) {
|
||||||
return <FSelect {...warehouseSelectProps} {...rest} items={warehouses} />;
|
return (
|
||||||
}
|
<FSelect
|
||||||
|
valueAccessor={'id'}
|
||||||
/**
|
labelAccessor={'code'}
|
||||||
*
|
textAccessor={'name'}
|
||||||
* @param {*} param0
|
popoverProps={{ minimal: true, usePortal: true, inline: false }}
|
||||||
* @returns
|
{...rest}
|
||||||
*/
|
items={warehouses}
|
||||||
export function WarehouseSelectButton({ label, ...rest }) {
|
/>
|
||||||
return <Button text={label} />;
|
);
|
||||||
}
|
}
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
// @ts-nocheck
|
|
||||||
import intl from 'react-intl-universal';
|
|
||||||
|
|
||||||
export default [
|
|
||||||
{ name: intl.get('decrement'), value: 'decrement' },
|
|
||||||
{ name: intl.get('increment'), value: 'increment' },
|
|
||||||
]
|
|
||||||
@@ -1,25 +1,25 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
export enum DRAWERS {
|
export enum DRAWERS {
|
||||||
ACCOUNT = 'account-drawer',
|
ACCOUNT_DETAILS = 'account-drawer',
|
||||||
JOURNAL = 'journal-drawer',
|
JOURNAL_DETAILS = 'journal-drawer',
|
||||||
EXPENSE = 'expense-drawer',
|
EXPENSE_DETAILS = 'expense-drawer',
|
||||||
BILL = 'bill-drawer',
|
BILL_DETAILS = 'bill-drawer',
|
||||||
INVOICE = 'invoice-detail-drawer',
|
INVOICE_DETAILS = 'invoice-detail-drawer',
|
||||||
RECEIPT = 'receipt-detail-drawer',
|
RECEIPT_DETAILS = 'receipt-detail-drawer',
|
||||||
PAYMENT_RECEIVE = 'payment-receive-detail-drawer',
|
PAYMENT_RECEIVE_DETAILS = 'payment-receive-detail-drawer',
|
||||||
PAYMENT_MADE = 'payment-made-drawer',
|
PAYMENT_MADE_DETAILS = 'payment-made-drawer',
|
||||||
ESTIMATE = 'estimate-detail-drawer',
|
ESTIMATE_DETAILS = 'estimate-detail-drawer',
|
||||||
ITEM = 'item-detail-drawer',
|
ITEM_DETAILS = 'item-detail-drawer',
|
||||||
CUSTOMER = 'customer-detail-drawer',
|
CUSTOMER_DETAILS = 'customer-detail-drawer',
|
||||||
VENDOR = 'vendor-detail-drawer',
|
VENDOR_DETAILS = 'vendor-detail-drawer',
|
||||||
INVENTORY_ADJUSTMENT = 'inventory-adjustment-drawer',
|
INVENTORY_ADJUSTMENT_DETAILS = 'inventory-adjustment-drawer',
|
||||||
CASHFLOW_TRNASACTION = 'cashflow-transaction-drawer',
|
CASHFLOW_TRNASACTION_DETAILS = 'cashflow-transaction-drawer',
|
||||||
QUICK_CREATE_CUSTOMER = 'quick-create-customer',
|
QUICK_CREATE_CUSTOMER = 'quick-create-customer',
|
||||||
QUICK_CREATE_ITEM = 'quick-create-item',
|
QUICK_CREATE_ITEM = 'quick-create-item',
|
||||||
QUICK_WRITE_VENDOR = 'quick-write-vendor',
|
QUICK_WRITE_VENDOR = 'quick-write-vendor',
|
||||||
CREDIT_NOTE = 'credit-note-detail-drawer',
|
CREDIT_NOTE_DETAILS = 'credit-note-detail-drawer',
|
||||||
VENDOR_CREDIT = 'vendor-credit-detail-drawer',
|
VENDOR_CREDIT_DETAILS = 'vendor-credit-detail-drawer',
|
||||||
REFUND_CREDIT_NOTE = 'refund-credit-detail-drawer',
|
REFUND_CREDIT_NOTE_DETAILS = 'refund-credit-detail-drawer',
|
||||||
REFUND_VENDOR_CREDIT = 'refund-vendor-detail-drawer',
|
REFUND_VENDOR_CREDIT_DETAILS = 'refund-vendor-detail-drawer',
|
||||||
WAREHOUSE_TRANSFER = 'warehouse-transfer-detail-drawer',
|
WAREHOUSE_TRANSFER_DETAILS = 'warehouse-transfer-detail-drawer',
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,30 +4,22 @@ import intl from 'react-intl-universal';
|
|||||||
export const getFooterLinks = () => [
|
export const getFooterLinks = () => [
|
||||||
{
|
{
|
||||||
title: intl.get('blog'),
|
title: intl.get('blog'),
|
||||||
link: '#',
|
link: 'https://docs.bigcapital.ly/blog',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: intl.get('community'),
|
||||||
|
link: 'https://discord.com/invite/c8nPBJafeb',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: intl.get('support'),
|
title: intl.get('support'),
|
||||||
link: '#',
|
link: 'https://discord.com/invite/c8nPBJafeb',
|
||||||
},
|
|
||||||
{
|
|
||||||
title: intl.get('service_status'),
|
|
||||||
link: '#',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: intl.get('pricing'),
|
|
||||||
link: '#',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: intl.get('reseller_partner'),
|
|
||||||
link: '#',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: intl.get('docs'),
|
title: intl.get('docs'),
|
||||||
link: '#',
|
link: 'https://docs.bigcapital.ly',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Bigcapital',
|
title: 'Bigcapital',
|
||||||
link: 'http://bigcapital.ly',
|
link: 'http://bigcapital.ly',
|
||||||
}
|
},
|
||||||
]
|
];
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ export * from './tableStyle';
|
|||||||
export * from './features';
|
export * from './features';
|
||||||
export * from './cellTypes';
|
export * from './cellTypes';
|
||||||
export * from './classes';
|
export * from './classes';
|
||||||
export * from './adjustmentType';
|
|
||||||
export * from './cashflowOptions';
|
export * from './cashflowOptions';
|
||||||
|
|
||||||
export const Align = { Left: 'left', Right: 'right', Center: 'center' };
|
export const Align = { Left: 'left', Right: 'right', Center: 'center' };
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ export const SidebarMenu = [
|
|||||||
// # Homepage
|
// # Homepage
|
||||||
// ---------------
|
// ---------------
|
||||||
{
|
{
|
||||||
text: <T id={'homepage'} />,
|
text: <T id={'sidebar.homepage'} />,
|
||||||
type: ISidebarMenuItemType.Link,
|
type: ISidebarMenuItemType.Link,
|
||||||
disabled: false,
|
disabled: false,
|
||||||
href: '/',
|
href: '/',
|
||||||
@@ -41,20 +41,20 @@ export const SidebarMenu = [
|
|||||||
// # Sales & Inventory
|
// # Sales & Inventory
|
||||||
// ---------------
|
// ---------------
|
||||||
{
|
{
|
||||||
text: <T id={'sales_inventory'} />,
|
text: <T id={'sidebar.sales_inventory'} />,
|
||||||
type: ISidebarMenuItemType.Group,
|
type: ISidebarMenuItemType.Group,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
text: <T id={'items'} />,
|
text: <T id={'sidebar.items'} />,
|
||||||
type: ISidebarMenuItemType.Overlay,
|
type: ISidebarMenuItemType.Overlay,
|
||||||
overlayId: ISidebarMenuOverlayIds.Items,
|
overlayId: ISidebarMenuOverlayIds.Items,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
text: <T id={'items'} />,
|
text: <T id={'sidebar.items'} />,
|
||||||
type: ISidebarMenuItemType.Group,
|
type: ISidebarMenuItemType.Group,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
text: <T id={'items'} />,
|
text: <T id={'sidebar.items'} />,
|
||||||
href: '/items',
|
href: '/items',
|
||||||
type: ISidebarMenuItemType.Link,
|
type: ISidebarMenuItemType.Link,
|
||||||
permission: {
|
permission: {
|
||||||
@@ -63,7 +63,7 @@ export const SidebarMenu = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: <T id={'inventory_adjustments'} />,
|
text: <T id={'sidebar.inventory_adjustments'} />,
|
||||||
href: '/inventory-adjustments',
|
href: '/inventory-adjustments',
|
||||||
type: ISidebarMenuItemType.Link,
|
type: ISidebarMenuItemType.Link,
|
||||||
permission: {
|
permission: {
|
||||||
@@ -71,12 +71,6 @@ export const SidebarMenu = [
|
|||||||
ability: InventoryAdjustmentAction.View,
|
ability: InventoryAdjustmentAction.View,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
text: <T id={'sidebar_warehouse_transfer'} />,
|
|
||||||
href: '/warehouses-transfers',
|
|
||||||
type: ISidebarMenuItemType.Link,
|
|
||||||
feature: Features.Warehouses,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
text: <T id={'category_list'} />,
|
text: <T id={'category_list'} />,
|
||||||
href: '/items/categories',
|
href: '/items/categories',
|
||||||
@@ -86,31 +80,20 @@ export const SidebarMenu = [
|
|||||||
ability: ItemAction.View,
|
ability: ItemAction.View,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: <T id={'New tasks'} />,
|
|
||||||
type: ISidebarMenuItemType.Group,
|
|
||||||
children: [
|
|
||||||
{
|
{
|
||||||
text: <T id={'New inventory item'} />,
|
text: <T id={'sidebar.warehouse_transfer'} />,
|
||||||
href: '/items/new',
|
href: '/warehouses-transfers',
|
||||||
type: ISidebarMenuItemType.Link,
|
|
||||||
permission: {
|
|
||||||
subject: AbilitySubject.Item,
|
|
||||||
ability: ItemAction.Create,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: (
|
|
||||||
<T id={'warehouse_transfer.label.new_warehouse_transfer'} />
|
|
||||||
),
|
|
||||||
href: '/warehouses-transfers/new',
|
|
||||||
type: ISidebarMenuItemType.Link,
|
type: ISidebarMenuItemType.Link,
|
||||||
feature: Features.Warehouses,
|
feature: Features.Warehouses,
|
||||||
},
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: <T id={'sidebar.new_tasks'} />,
|
||||||
|
type: ISidebarMenuItemType.Group,
|
||||||
|
children: [
|
||||||
{
|
{
|
||||||
text: <T id={'New service'} />,
|
text: <T id={'sidebar.new_inventory_item'} />,
|
||||||
href: '/items/new',
|
href: '/items/new',
|
||||||
type: ISidebarMenuItemType.Link,
|
type: ISidebarMenuItemType.Link,
|
||||||
permission: {
|
permission: {
|
||||||
@@ -119,7 +102,16 @@ export const SidebarMenu = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: <T id={'New item category'} />,
|
text: <T id={'sidebar.new_service'} />,
|
||||||
|
href: '/items/new',
|
||||||
|
type: ISidebarMenuItemType.Link,
|
||||||
|
permission: {
|
||||||
|
subject: AbilitySubject.Item,
|
||||||
|
ability: ItemAction.Create,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: <T id={'sidebar.new_item_category'} />,
|
||||||
href: '/items/categories/new',
|
href: '/items/categories/new',
|
||||||
type: ISidebarMenuItemType.Dialog,
|
type: ISidebarMenuItemType.Dialog,
|
||||||
dialogName: 'item-category-form',
|
dialogName: 'item-category-form',
|
||||||
@@ -128,6 +120,12 @@ export const SidebarMenu = [
|
|||||||
ability: ItemAction.Create,
|
ability: ItemAction.Create,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
text: <T id={'sidebar.new_warehouse_transfer'} />,
|
||||||
|
href: '/warehouses-transfers/new',
|
||||||
|
type: ISidebarMenuItemType.Link,
|
||||||
|
feature: Features.Warehouses,
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@@ -138,16 +136,16 @@ export const SidebarMenu = [
|
|||||||
// # Sales
|
// # Sales
|
||||||
// ---------------
|
// ---------------
|
||||||
{
|
{
|
||||||
text: <T id={'sales'} />,
|
text: <T id={'sidebar.sales'} />,
|
||||||
type: ISidebarMenuItemType.Overlay,
|
type: ISidebarMenuItemType.Overlay,
|
||||||
overlayId: ISidebarMenuOverlayIds.Sales,
|
overlayId: ISidebarMenuOverlayIds.Sales,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
text: <T id={'sales'} />,
|
text: <T id={'sidebar.sales'} />,
|
||||||
type: ISidebarMenuItemType.Group,
|
type: ISidebarMenuItemType.Group,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
text: <T id={'estimates'} />,
|
text: <T id={'sidebar.estimates'} />,
|
||||||
href: '/estimates',
|
href: '/estimates',
|
||||||
type: ISidebarMenuItemType.Link,
|
type: ISidebarMenuItemType.Link,
|
||||||
permission: {
|
permission: {
|
||||||
@@ -156,7 +154,7 @@ export const SidebarMenu = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: <T id={'invoices'} />,
|
text: <T id={'sidebar.invoices'} />,
|
||||||
href: '/invoices',
|
href: '/invoices',
|
||||||
type: ISidebarMenuItemType.Link,
|
type: ISidebarMenuItemType.Link,
|
||||||
permission: {
|
permission: {
|
||||||
@@ -165,7 +163,7 @@ export const SidebarMenu = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: <T id={'receipts'} />,
|
text: <T id={'sidebar.receipts'} />,
|
||||||
href: '/receipts',
|
href: '/receipts',
|
||||||
type: ISidebarMenuItemType.Link,
|
type: ISidebarMenuItemType.Link,
|
||||||
permission: {
|
permission: {
|
||||||
@@ -174,12 +172,12 @@ export const SidebarMenu = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: <T id={'sidebar_credit_note'} />,
|
text: <T id={'sidebar.credit_notes'} />,
|
||||||
href: '/credit-notes',
|
href: '/credit-notes',
|
||||||
type: ISidebarMenuItemType.Link,
|
type: ISidebarMenuItemType.Link,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: <T id={'payment_receives'} />,
|
text: <T id={'sidebar.payment_receives'} />,
|
||||||
href: '/payment-receives',
|
href: '/payment-receives',
|
||||||
type: ISidebarMenuItemType.Link,
|
type: ISidebarMenuItemType.Link,
|
||||||
permission: {
|
permission: {
|
||||||
@@ -190,11 +188,11 @@ export const SidebarMenu = [
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: <T id={'New tasks'} />,
|
text: <T id={'sidebar.new_tasks'} />,
|
||||||
type: ISidebarMenuItemType.Group,
|
type: ISidebarMenuItemType.Group,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
text: <T id={'new_estimate'} />,
|
text: <T id={'sidebar.new_estimate'} />,
|
||||||
href: '/estimates/new',
|
href: '/estimates/new',
|
||||||
type: ISidebarMenuItemType.Link,
|
type: ISidebarMenuItemType.Link,
|
||||||
permission: {
|
permission: {
|
||||||
@@ -203,7 +201,7 @@ export const SidebarMenu = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: <T id={'new_invoice'} />,
|
text: <T id={'sidebar.new_invoice'} />,
|
||||||
href: '/invoices/new',
|
href: '/invoices/new',
|
||||||
type: ISidebarMenuItemType.Link,
|
type: ISidebarMenuItemType.Link,
|
||||||
permission: {
|
permission: {
|
||||||
@@ -212,7 +210,7 @@ export const SidebarMenu = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: <T id={'new_receipt'} />,
|
text: <T id={'sidebar.new_receipt'} />,
|
||||||
href: '/receipts/new',
|
href: '/receipts/new',
|
||||||
type: ISidebarMenuItemType.Link,
|
type: ISidebarMenuItemType.Link,
|
||||||
permission: {
|
permission: {
|
||||||
@@ -221,12 +219,12 @@ export const SidebarMenu = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: <T id={'credit_note.label.new_credit_note'} />,
|
text: <T id={'sidebar.new_credit_note'} />,
|
||||||
href: '/credit-notes/new',
|
href: '/credit-notes/new',
|
||||||
type: ISidebarMenuItemType.Link,
|
type: ISidebarMenuItemType.Link,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: <T id={'new_payment_receive'} />,
|
text: <T id={'sidebar.new_payment_receive'} />,
|
||||||
href: '/payment-receives/new',
|
href: '/payment-receives/new',
|
||||||
type: ISidebarMenuItemType.Link,
|
type: ISidebarMenuItemType.Link,
|
||||||
permission: {
|
permission: {
|
||||||
@@ -242,12 +240,12 @@ export const SidebarMenu = [
|
|||||||
// # Purchases
|
// # Purchases
|
||||||
// ---------------
|
// ---------------
|
||||||
{
|
{
|
||||||
text: <T id={'purchases'} />,
|
text: <T id={'sidebar.purchases'} />,
|
||||||
type: ISidebarMenuItemType.Overlay,
|
type: ISidebarMenuItemType.Overlay,
|
||||||
overlayId: ISidebarMenuOverlayIds.Purchases,
|
overlayId: ISidebarMenuOverlayIds.Purchases,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
text: <T id={'purchases'} />,
|
text: <T id={'sidebar.purchases'} />,
|
||||||
type: ISidebarMenuItemType.Group,
|
type: ISidebarMenuItemType.Group,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
@@ -276,11 +274,11 @@ export const SidebarMenu = [
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: <T id={'New tasks'} />,
|
text: <T id={'sidebar.new_tasks'} />,
|
||||||
type: ISidebarMenuItemType.Group,
|
type: ISidebarMenuItemType.Group,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
text: <T id={'New purchase invoice'} />,
|
text: <T id={'sidebar.new_purchase_invoice'} />,
|
||||||
href: '/bills/new',
|
href: '/bills/new',
|
||||||
type: ISidebarMenuItemType.Link,
|
type: ISidebarMenuItemType.Link,
|
||||||
permission: {
|
permission: {
|
||||||
@@ -289,7 +287,7 @@ export const SidebarMenu = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: <T id={'vendor_credits.label.new_vendor_credit'} />,
|
text: <T id={'sidebar.new_vendor_credit'} />,
|
||||||
href: '/vendor-credits/new',
|
href: '/vendor-credits/new',
|
||||||
type: ISidebarMenuItemType.Link,
|
type: ISidebarMenuItemType.Link,
|
||||||
permission: {
|
permission: {
|
||||||
@@ -298,7 +296,7 @@ export const SidebarMenu = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: <T id={'new_payment_made'} />,
|
text: <T id={'sidebar.new_payment_made'} />,
|
||||||
href: '/payment-mades/new',
|
href: '/payment-mades/new',
|
||||||
type: ISidebarMenuItemType.Link,
|
type: ISidebarMenuItemType.Link,
|
||||||
permission: {
|
permission: {
|
||||||
@@ -314,16 +312,16 @@ export const SidebarMenu = [
|
|||||||
// # Contacts
|
// # Contacts
|
||||||
// ---------------
|
// ---------------
|
||||||
{
|
{
|
||||||
text: <T id={'contacts'} />,
|
text: <T id={'sidebar.contacts'} />,
|
||||||
type: ISidebarMenuItemType.Overlay,
|
type: ISidebarMenuItemType.Overlay,
|
||||||
overlayId: ISidebarMenuOverlayIds.Contacts,
|
overlayId: ISidebarMenuOverlayIds.Contacts,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
text: <T id={'contacts'} />,
|
text: <T id={'sidebar.contacts'} />,
|
||||||
type: ISidebarMenuItemType.Group,
|
type: ISidebarMenuItemType.Group,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
text: <T id={'customers'} />,
|
text: <T id={'sidebar.customers'} />,
|
||||||
href: '/customers',
|
href: '/customers',
|
||||||
type: ISidebarMenuItemType.Link,
|
type: ISidebarMenuItemType.Link,
|
||||||
permission: {
|
permission: {
|
||||||
@@ -332,7 +330,7 @@ export const SidebarMenu = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: <T id={'vendors'} />,
|
text: <T id={'sidebar.vendors'} />,
|
||||||
href: '/vendors',
|
href: '/vendors',
|
||||||
type: ISidebarMenuItemType.Link,
|
type: ISidebarMenuItemType.Link,
|
||||||
permission: {
|
permission: {
|
||||||
@@ -343,11 +341,11 @@ export const SidebarMenu = [
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: <T id={'New tasks'} />,
|
text: <T id={'sidebar.new_tasks'} />,
|
||||||
type: ISidebarMenuItemType.Group,
|
type: ISidebarMenuItemType.Group,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
text: <T id={'new_customer'} />,
|
text: <T id={'sidebar.new_customer'} />,
|
||||||
href: '/customers/new',
|
href: '/customers/new',
|
||||||
type: ISidebarMenuItemType.Link,
|
type: ISidebarMenuItemType.Link,
|
||||||
permission: {
|
permission: {
|
||||||
@@ -356,7 +354,7 @@ export const SidebarMenu = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: <T id={'new_vendor'} />,
|
text: <T id={'sidebar.new_vendor'} />,
|
||||||
href: '/vendors/new',
|
href: '/vendors/new',
|
||||||
type: ISidebarMenuItemType.Link,
|
type: ISidebarMenuItemType.Link,
|
||||||
permission: {
|
permission: {
|
||||||
@@ -372,20 +370,20 @@ export const SidebarMenu = [
|
|||||||
// # Accounting
|
// # Accounting
|
||||||
// ---------------
|
// ---------------
|
||||||
{
|
{
|
||||||
text: <T id={'accounting'} />,
|
text: <T id={'sidebar.accounting'} />,
|
||||||
type: ISidebarMenuItemType.Group,
|
type: ISidebarMenuItemType.Group,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
text: <T id={'financial'} />,
|
text: <T id={'sidebar.financial'} />,
|
||||||
type: ISidebarMenuItemType.Overlay,
|
type: ISidebarMenuItemType.Overlay,
|
||||||
overlayId: ISidebarMenuOverlayIds.Financial,
|
overlayId: ISidebarMenuOverlayIds.Financial,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
text: <T id={'financial'} />,
|
text: <T id={'sidebar.financial'} />,
|
||||||
type: ISidebarMenuItemType.Group,
|
type: ISidebarMenuItemType.Group,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
text: <T id={'accounts_chart'} />,
|
text: <T id={'sidebar.accounts_chart'} />,
|
||||||
href: '/accounts',
|
href: '/accounts',
|
||||||
type: ISidebarMenuItemType.Link,
|
type: ISidebarMenuItemType.Link,
|
||||||
permission: {
|
permission: {
|
||||||
@@ -394,7 +392,7 @@ export const SidebarMenu = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: <T id={'manual_journals'} />,
|
text: <T id={'sidebar.manual_journals'} />,
|
||||||
href: '/manual-journals',
|
href: '/manual-journals',
|
||||||
type: ISidebarMenuItemType.Link,
|
type: ISidebarMenuItemType.Link,
|
||||||
permission: {
|
permission: {
|
||||||
@@ -410,11 +408,11 @@ export const SidebarMenu = [
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: <T id={'New tasks'} />,
|
text: <T id={'sidebar.new_tasks'} />,
|
||||||
type: ISidebarMenuItemType.Group,
|
type: ISidebarMenuItemType.Group,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
text: <T id={'make_journal_entry'} />,
|
text: <T id={'sidebar.make_journal_entry'} />,
|
||||||
href: '/make-journal-entry',
|
href: '/make-journal-entry',
|
||||||
type: ISidebarMenuItemType.Link,
|
type: ISidebarMenuItemType.Link,
|
||||||
permission: {
|
permission: {
|
||||||
@@ -441,7 +439,7 @@ export const SidebarMenu = [
|
|||||||
type: ISidebarMenuItemType.Group,
|
type: ISidebarMenuItemType.Group,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
text: <T id={'siebar.cashflow.label_cash_and_bank_accounts'} />,
|
text: <T id={'sidebar.cash_bank_accounts'} />,
|
||||||
href: '/cashflow-accounts',
|
href: '/cashflow-accounts',
|
||||||
type: ISidebarMenuItemType.Link,
|
type: ISidebarMenuItemType.Link,
|
||||||
permission: {
|
permission: {
|
||||||
@@ -452,12 +450,12 @@ export const SidebarMenu = [
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: <T id={'New tasks'} />,
|
text: <T id={'sidebar.new_tasks'} />,
|
||||||
type: ISidebarMenuItemType.Group,
|
type: ISidebarMenuItemType.Group,
|
||||||
divider: true,
|
divider: true,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
text: <T id={'cash_flow.label.add_money_in'} />,
|
text: <T id={'sidebar.add_money_in'} />,
|
||||||
href: '/cashflow-accounts',
|
href: '/cashflow-accounts',
|
||||||
type: ISidebarMenuItemType.Dialog,
|
type: ISidebarMenuItemType.Dialog,
|
||||||
dialogName: 'money-in',
|
dialogName: 'money-in',
|
||||||
@@ -467,7 +465,7 @@ export const SidebarMenu = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: <T id={'cash_flow.label.add_money_out'} />,
|
text: <T id={'sidebar.add_money_out'} />,
|
||||||
href: '/cashflow-accounts',
|
href: '/cashflow-accounts',
|
||||||
type: ISidebarMenuItemType.Dialog,
|
type: ISidebarMenuItemType.Dialog,
|
||||||
permission: {
|
permission: {
|
||||||
@@ -476,7 +474,7 @@ export const SidebarMenu = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: <T id={'cash_flow.label.add_cash_account'} />,
|
text: <T id={'sidebar.add_cash_account'} />,
|
||||||
href: '/cashflow-accounts',
|
href: '/cashflow-accounts',
|
||||||
type: ISidebarMenuItemType.Dialog,
|
type: ISidebarMenuItemType.Dialog,
|
||||||
permission: {
|
permission: {
|
||||||
@@ -485,7 +483,7 @@ export const SidebarMenu = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: <T id={'cash_flow.label.add_bank_account'} />,
|
text: <T id={'sidebar.add_bank_account'} />,
|
||||||
href: '/cashflow-accounts',
|
href: '/cashflow-accounts',
|
||||||
type: ISidebarMenuItemType.Dialog,
|
type: ISidebarMenuItemType.Dialog,
|
||||||
permission: {
|
permission: {
|
||||||
@@ -501,16 +499,16 @@ export const SidebarMenu = [
|
|||||||
// # Expenses
|
// # Expenses
|
||||||
// ---------------
|
// ---------------
|
||||||
{
|
{
|
||||||
text: <T id={'expenses'} />,
|
text: <T id={'sidebar.expenses'} />,
|
||||||
type: ISidebarMenuItemType.Overlay,
|
type: ISidebarMenuItemType.Overlay,
|
||||||
overlayId: ISidebarMenuOverlayIds.Expenses,
|
overlayId: ISidebarMenuOverlayIds.Expenses,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
text: <T id={'expenses'} />,
|
text: <T id={'sidebar.expenses'} />,
|
||||||
type: ISidebarMenuItemType.Group,
|
type: ISidebarMenuItemType.Group,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
text: <T id={'expenses'} />,
|
text: <T id={'sidebar.expenses'} />,
|
||||||
href: '/expenses',
|
href: '/expenses',
|
||||||
type: ISidebarMenuItemType.Link,
|
type: ISidebarMenuItemType.Link,
|
||||||
permission: {
|
permission: {
|
||||||
@@ -521,11 +519,11 @@ export const SidebarMenu = [
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: <T id={'New tasks'} />,
|
text: <T id={'sidebar.new_tasks'} />,
|
||||||
type: ISidebarMenuItemType.Group,
|
type: ISidebarMenuItemType.Group,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
text: <T id={'new_expense'} />,
|
text: <T id={'sidebar.new_expense'} />,
|
||||||
href: '/expenses/new',
|
href: '/expenses/new',
|
||||||
type: ISidebarMenuItemType.Link,
|
type: ISidebarMenuItemType.Link,
|
||||||
permission: {
|
permission: {
|
||||||
@@ -541,16 +539,16 @@ export const SidebarMenu = [
|
|||||||
// # Projects Management
|
// # Projects Management
|
||||||
// ---------------------
|
// ---------------------
|
||||||
// {
|
// {
|
||||||
// text: 'Projects',
|
// text: <T id={'sidebar.projects'} />,
|
||||||
// type: ISidebarMenuItemType.Overlay,
|
// type: ISidebarMenuItemType.Overlay,
|
||||||
// overlayId: ISidebarMenuOverlayIds.Projects,
|
// overlayId: ISidebarMenuOverlayIds.Projects,
|
||||||
// children: [
|
// children: [
|
||||||
// {
|
// {
|
||||||
// text: 'Projects',
|
// text: <T id={'sidebar.projects'} />,
|
||||||
// type: ISidebarMenuItemType.Group,
|
// type: ISidebarMenuItemType.Group,
|
||||||
// children: [
|
// children: [
|
||||||
// {
|
// {
|
||||||
// text: 'Projects',
|
// text: <T id={'sidebar.projects'} />,
|
||||||
// href: '/projects',
|
// href: '/projects',
|
||||||
// type: ISidebarMenuItemType.Link,
|
// type: ISidebarMenuItemType.Link,
|
||||||
// permission: {
|
// permission: {
|
||||||
@@ -561,11 +559,11 @@ export const SidebarMenu = [
|
|||||||
// ],
|
// ],
|
||||||
// },
|
// },
|
||||||
// {
|
// {
|
||||||
// text: <T id={'New tasks'} />,
|
// text: <T id={'sidebar.new_tasks'} />,
|
||||||
// type: ISidebarMenuItemType.Group,
|
// type: ISidebarMenuItemType.Group,
|
||||||
// children: [
|
// children: [
|
||||||
// {
|
// {
|
||||||
// text: <T id={'projects.label.new_project'} />,
|
// text: <T id={'sidebar.new_project'} />,
|
||||||
// type: ISidebarMenuItemType.Dialog,
|
// type: ISidebarMenuItemType.Dialog,
|
||||||
// dialogName: 'project-form',
|
// dialogName: 'project-form',
|
||||||
// permission: {
|
// permission: {
|
||||||
@@ -574,18 +572,18 @@ export const SidebarMenu = [
|
|||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
// {
|
// {
|
||||||
// text: <T id={'projects.label.new_time_entry'} />,
|
// text: <T id={'sidebar.new_time_entry'} />,
|
||||||
// type: ISidebarMenuItemType.Dialog,
|
// type: ISidebarMenuItemType.Dialog,
|
||||||
// dialogName: 'project-time-entry-form',
|
// dialogName: 'project-time-entry-form',
|
||||||
// },
|
// },
|
||||||
// ],
|
// ],
|
||||||
// },
|
// },
|
||||||
// {
|
// {
|
||||||
// text: <T id={'Reports'} />,
|
// text: <T id={'sidebar.reports'} />,
|
||||||
// type: ISidebarMenuItemType.Group,
|
// type: ISidebarMenuItemType.Group,
|
||||||
// children: [
|
// children: [
|
||||||
// {
|
// {
|
||||||
// text: <T id={'project_profitability_summary'} />,
|
// text: <T id={'sidebar.project_profitability_summary'} />,
|
||||||
// href: '/financial-reports/project-profitability-summary',
|
// href: '/financial-reports/project-profitability-summary',
|
||||||
// type: ISidebarMenuItemType.Link,
|
// type: ISidebarMenuItemType.Link,
|
||||||
// },
|
// },
|
||||||
@@ -597,16 +595,16 @@ export const SidebarMenu = [
|
|||||||
// # Reports
|
// # Reports
|
||||||
// ---------------
|
// ---------------
|
||||||
{
|
{
|
||||||
text: <T id={'Reports'} />,
|
text: <T id={'sidebar.reports'} />,
|
||||||
type: ISidebarMenuItemType.Overlay,
|
type: ISidebarMenuItemType.Overlay,
|
||||||
overlayId: ISidebarMenuOverlayIds.Reports,
|
overlayId: ISidebarMenuOverlayIds.Reports,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
text: <T id={'Reports'} />,
|
text: <T id={'sidebar.reports'} />,
|
||||||
type: ISidebarMenuItemType.Group,
|
type: ISidebarMenuItemType.Group,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
text: <T id={'balance_sheet'} />,
|
text: <T id={'sidebar.balance_sheet'} />,
|
||||||
href: '/financial-reports/balance-sheet',
|
href: '/financial-reports/balance-sheet',
|
||||||
type: ISidebarMenuItemType.Link,
|
type: ISidebarMenuItemType.Link,
|
||||||
permission: {
|
permission: {
|
||||||
@@ -615,7 +613,7 @@ export const SidebarMenu = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: <T id={'trial_balance_sheet'} />,
|
text: <T id={'sidebar.trial_balance_sheet'} />,
|
||||||
href: '/financial-reports/trial-balance-sheet',
|
href: '/financial-reports/trial-balance-sheet',
|
||||||
type: ISidebarMenuItemType.Link,
|
type: ISidebarMenuItemType.Link,
|
||||||
permission: {
|
permission: {
|
||||||
@@ -624,7 +622,7 @@ export const SidebarMenu = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: <T id={'journal'} />,
|
text: <T id={'sidebar.journal'} />,
|
||||||
href: '/financial-reports/journal-sheet',
|
href: '/financial-reports/journal-sheet',
|
||||||
type: ISidebarMenuItemType.Link,
|
type: ISidebarMenuItemType.Link,
|
||||||
permission: {
|
permission: {
|
||||||
@@ -633,7 +631,7 @@ export const SidebarMenu = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: <T id={'general_ledger'} />,
|
text: <T id={'sidebar.general_ledger'} />,
|
||||||
href: '/financial-reports/general-ledger',
|
href: '/financial-reports/general-ledger',
|
||||||
type: ISidebarMenuItemType.Link,
|
type: ISidebarMenuItemType.Link,
|
||||||
permission: {
|
permission: {
|
||||||
@@ -642,7 +640,7 @@ export const SidebarMenu = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: <T id={'profit_loss_sheet'} />,
|
text: <T id={'sidebar.profit_loss_sheet'} />,
|
||||||
href: '/financial-reports/profit-loss-sheet',
|
href: '/financial-reports/profit-loss-sheet',
|
||||||
type: ISidebarMenuItemType.Link,
|
type: ISidebarMenuItemType.Link,
|
||||||
permission: {
|
permission: {
|
||||||
@@ -651,7 +649,7 @@ export const SidebarMenu = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: <T id={'cash_flow_statement'} />,
|
text: <T id={'sidebar.cash_flow_statement'} />,
|
||||||
href: '/financial-reports/cash-flow',
|
href: '/financial-reports/cash-flow',
|
||||||
type: ISidebarMenuItemType.Link,
|
type: ISidebarMenuItemType.Link,
|
||||||
permission: {
|
permission: {
|
||||||
@@ -660,7 +658,7 @@ export const SidebarMenu = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: <T id={'AR_Aging_Summary'} />,
|
text: <T id={'sidebar.ar_aging_Summary'} />,
|
||||||
href: '/financial-reports/receivable-aging-summary',
|
href: '/financial-reports/receivable-aging-summary',
|
||||||
type: ISidebarMenuItemType.Link,
|
type: ISidebarMenuItemType.Link,
|
||||||
permission: {
|
permission: {
|
||||||
@@ -669,7 +667,7 @@ export const SidebarMenu = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: <T id={'AP_Aging_Summary'} />,
|
text: <T id={'sidebar.ap_aging_summary'} />,
|
||||||
href: '/financial-reports/payable-aging-summary',
|
href: '/financial-reports/payable-aging-summary',
|
||||||
type: ISidebarMenuItemType.Link,
|
type: ISidebarMenuItemType.Link,
|
||||||
permission: {
|
permission: {
|
||||||
@@ -680,11 +678,11 @@ export const SidebarMenu = [
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: <T id={'Sales/Purchases'} />,
|
text: <T id={'sidebar.sales_purchases'} />,
|
||||||
type: ISidebarMenuItemType.Group,
|
type: ISidebarMenuItemType.Group,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
text: <T id={'purchases_by_items'} />,
|
text: <T id={'sidebar.purchases_by_items'} />,
|
||||||
type: ISidebarMenuItemType.Link,
|
type: ISidebarMenuItemType.Link,
|
||||||
href: '/financial-reports/purchases-by-items',
|
href: '/financial-reports/purchases-by-items',
|
||||||
permission: {
|
permission: {
|
||||||
@@ -693,7 +691,7 @@ export const SidebarMenu = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: <T id={'sales_by_items'} />,
|
text: <T id={'sidebar.sales_by_items'} />,
|
||||||
href: '/financial-reports/sales-by-items',
|
href: '/financial-reports/sales-by-items',
|
||||||
type: ISidebarMenuItemType.Link,
|
type: ISidebarMenuItemType.Link,
|
||||||
permission: {
|
permission: {
|
||||||
@@ -702,7 +700,7 @@ export const SidebarMenu = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: <T id={'customers_transactions'} />,
|
text: <T id={'sidebar.customers_transactions'} />,
|
||||||
href: '/financial-reports/transactions-by-customers',
|
href: '/financial-reports/transactions-by-customers',
|
||||||
type: ISidebarMenuItemType.Link,
|
type: ISidebarMenuItemType.Link,
|
||||||
permission: {
|
permission: {
|
||||||
@@ -711,7 +709,7 @@ export const SidebarMenu = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: <T id={'vendors_transactions'} />,
|
text: <T id={'sidebar.vendors_transactions'} />,
|
||||||
href: '/financial-reports/transactions-by-vendors',
|
href: '/financial-reports/transactions-by-vendors',
|
||||||
type: ISidebarMenuItemType.Link,
|
type: ISidebarMenuItemType.Link,
|
||||||
permission: {
|
permission: {
|
||||||
@@ -720,7 +718,7 @@ export const SidebarMenu = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: <T id={'customers_balance_summary'} />,
|
text: <T id={'sidebar.customers_balance_summary'} />,
|
||||||
href: '/financial-reports/customers-balance-summary',
|
href: '/financial-reports/customers-balance-summary',
|
||||||
type: ISidebarMenuItemType.Link,
|
type: ISidebarMenuItemType.Link,
|
||||||
permission: {
|
permission: {
|
||||||
@@ -729,7 +727,7 @@ export const SidebarMenu = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: <T id={'vendors_balance_summary'} />,
|
text: <T id={'sidebar.vendors_balance_summary'} />,
|
||||||
href: '/financial-reports/vendors-balance-summary',
|
href: '/financial-reports/vendors-balance-summary',
|
||||||
type: ISidebarMenuItemType.Link,
|
type: ISidebarMenuItemType.Link,
|
||||||
permission: {
|
permission: {
|
||||||
@@ -740,11 +738,11 @@ export const SidebarMenu = [
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: <T id={'inventory'} />,
|
text: <T id={'sidebar.inventory'} />,
|
||||||
type: ISidebarMenuItemType.Group,
|
type: ISidebarMenuItemType.Group,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
text: <T id={'inventory_item_details'} />,
|
text: <T id={'sidebar.inventory_item_details'} />,
|
||||||
href: '/financial-reports/inventory-item-details',
|
href: '/financial-reports/inventory-item-details',
|
||||||
type: ISidebarMenuItemType.Link,
|
type: ISidebarMenuItemType.Link,
|
||||||
permission: {
|
permission: {
|
||||||
@@ -753,7 +751,7 @@ export const SidebarMenu = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: <T id={'inventory_valuation'} />,
|
text: <T id={'sidebar.inventory_valuation'} />,
|
||||||
href: '/financial-reports/inventory-valuation',
|
href: '/financial-reports/inventory-valuation',
|
||||||
type: ISidebarMenuItemType.Link,
|
type: ISidebarMenuItemType.Link,
|
||||||
permission: {
|
permission: {
|
||||||
@@ -766,11 +764,11 @@ export const SidebarMenu = [
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: <T id={'system'} />,
|
text: <T id={'sidebar.system'} />,
|
||||||
type: ISidebarMenuItemType.Group,
|
type: ISidebarMenuItemType.Group,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
text: <T id={'preferences'} />,
|
text: <T id={'sidebar.preferences'} />,
|
||||||
href: '/preferences',
|
href: '/preferences',
|
||||||
type: ISidebarMenuItemType.Link,
|
type: ISidebarMenuItemType.Link,
|
||||||
permission: {
|
permission: {
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import { useMemorizedColumnsWidths } from '@/hooks';
|
|||||||
import { useManualJournalsColumns } from './utils';
|
import { useManualJournalsColumns } from './utils';
|
||||||
|
|
||||||
import { compose } from '@/utils';
|
import { compose } from '@/utils';
|
||||||
|
import { DRAWERS } from '@/constants/drawers';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Manual journals data-table.
|
* Manual journals data-table.
|
||||||
@@ -79,14 +80,16 @@ function ManualJournalsDataTable({
|
|||||||
|
|
||||||
// Handle view detail journal.
|
// Handle view detail journal.
|
||||||
const handleViewDetailJournal = ({ id }) => {
|
const handleViewDetailJournal = ({ id }) => {
|
||||||
openDrawer('journal-drawer', {
|
openDrawer(DRAWERS.JOURNAL_DETAILS, {
|
||||||
manualJournalId: id,
|
manualJournalId: id,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// Handle cell click.
|
// Handle cell click.
|
||||||
const handleCellClick = (cell, event) => {
|
const handleCellClick = (cell, event) => {
|
||||||
openDrawer('journal-drawer', { manualJournalId: cell.row.original.id });
|
openDrawer(DRAWERS.JOURNAL_DETAILS, {
|
||||||
|
manualJournalId: cell.row.original.id,
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// Local storage memorizing columns widths.
|
// Local storage memorizing columns widths.
|
||||||
|
|||||||
@@ -1,193 +0,0 @@
|
|||||||
// @ts-nocheck
|
|
||||||
import React from 'react';
|
|
||||||
import {
|
|
||||||
Intent,
|
|
||||||
Button,
|
|
||||||
ButtonGroup,
|
|
||||||
Popover,
|
|
||||||
PopoverInteractionKind,
|
|
||||||
Position,
|
|
||||||
Menu,
|
|
||||||
MenuItem,
|
|
||||||
} from '@blueprintjs/core';
|
|
||||||
import classNames from 'classnames';
|
|
||||||
import { useFormikContext } from 'formik';
|
|
||||||
import { FormattedMessage as T, If, Icon } from '@/components';
|
|
||||||
import { CLASSES } from '@/constants/classes';
|
|
||||||
import { useMakeJournalFormContext } from './MakeJournalProvider';
|
|
||||||
import { useHistory } from 'react-router-dom';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Make Journal floating actions bar.
|
|
||||||
*/
|
|
||||||
export default function MakeJournalEntriesFooter() {
|
|
||||||
const history = useHistory();
|
|
||||||
|
|
||||||
// Formik context.
|
|
||||||
const { isSubmitting, submitForm } = useFormikContext();
|
|
||||||
|
|
||||||
// Make journal form context.
|
|
||||||
const {
|
|
||||||
manualJournalId,
|
|
||||||
setSubmitPayload,
|
|
||||||
manualJournalPublished = false,
|
|
||||||
} = useMakeJournalFormContext();
|
|
||||||
|
|
||||||
// Handle `submit & publish` button click.
|
|
||||||
const handleSubmitPublishBtnClick = (event) => {
|
|
||||||
setSubmitPayload({ redirect: true, publish: true });
|
|
||||||
submitForm();
|
|
||||||
};
|
|
||||||
|
|
||||||
// Handle `submit, publish & new` button click.
|
|
||||||
const handleSubmitPublishAndNewBtnClick = (event) => {
|
|
||||||
setSubmitPayload({ redirect: false, publish: true, resetForm: true });
|
|
||||||
submitForm();
|
|
||||||
};
|
|
||||||
|
|
||||||
// Handle `submit, publish & continue editing` button click.
|
|
||||||
const handleSubmitPublishContinueEditingBtnClick = (event) => {
|
|
||||||
setSubmitPayload({ redirect: false, publish: true });
|
|
||||||
submitForm();
|
|
||||||
};
|
|
||||||
|
|
||||||
// Handle `submit as draft` button click.
|
|
||||||
const handleSubmitDraftBtnClick = (event) => {
|
|
||||||
setSubmitPayload({ redirect: true, publish: false });
|
|
||||||
};
|
|
||||||
|
|
||||||
// Handle `submit as draft & new` button click.
|
|
||||||
const handleSubmitDraftAndNewBtnClick = (event) => {
|
|
||||||
setSubmitPayload({ redirect: false, publish: false, resetForm: true });
|
|
||||||
submitForm();
|
|
||||||
};
|
|
||||||
|
|
||||||
// Handles submit as draft & continue editing button click.
|
|
||||||
const handleSubmitDraftContinueEditingBtnClick = (event) => {
|
|
||||||
setSubmitPayload({ redirect: false, publish: false });
|
|
||||||
submitForm();
|
|
||||||
};
|
|
||||||
|
|
||||||
// Handle cancel button action click.
|
|
||||||
const handleCancelBtnClick = (event) => {
|
|
||||||
history.goBack();
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleClearBtnClick = (event) => {};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className={classNames(CLASSES.PAGE_FORM_FLOATING_ACTIONS)}>
|
|
||||||
{/* ----------- Save And Publish ----------- */}
|
|
||||||
<If condition={!manualJournalId || !manualJournalPublished}>
|
|
||||||
<ButtonGroup>
|
|
||||||
<Button
|
|
||||||
disabled={isSubmitting}
|
|
||||||
intent={Intent.PRIMARY}
|
|
||||||
type="submit"
|
|
||||||
onClick={handleSubmitPublishBtnClick}
|
|
||||||
text={<T id={'save_publish'} />}
|
|
||||||
/>
|
|
||||||
<Popover
|
|
||||||
content={
|
|
||||||
<Menu>
|
|
||||||
<MenuItem
|
|
||||||
text={<T id={'publish_and_new'} />}
|
|
||||||
onClick={handleSubmitPublishAndNewBtnClick}
|
|
||||||
/>
|
|
||||||
<MenuItem
|
|
||||||
text={<T id={'publish_continue_editing'} />}
|
|
||||||
onClick={handleSubmitPublishContinueEditingBtnClick}
|
|
||||||
/>
|
|
||||||
</Menu>
|
|
||||||
}
|
|
||||||
minimal={true}
|
|
||||||
interactionKind={PopoverInteractionKind.CLICK}
|
|
||||||
position={Position.BOTTOM_LEFT}
|
|
||||||
>
|
|
||||||
<Button
|
|
||||||
disabled={isSubmitting}
|
|
||||||
intent={Intent.PRIMARY}
|
|
||||||
rightIcon={<Icon icon="arrow-drop-up-16" iconSize={20} />}
|
|
||||||
/>
|
|
||||||
</Popover>
|
|
||||||
</ButtonGroup>
|
|
||||||
{/* ----------- Save As Draft ----------- */}
|
|
||||||
<ButtonGroup>
|
|
||||||
<Button
|
|
||||||
disabled={isSubmitting}
|
|
||||||
className={'ml1'}
|
|
||||||
type="submit"
|
|
||||||
onClick={handleSubmitDraftBtnClick}
|
|
||||||
text={<T id={'save_as_draft'} />}
|
|
||||||
/>
|
|
||||||
<Popover
|
|
||||||
content={
|
|
||||||
<Menu>
|
|
||||||
<MenuItem
|
|
||||||
text={<T id={'save_and_new'} />}
|
|
||||||
onClick={handleSubmitDraftAndNewBtnClick}
|
|
||||||
/>
|
|
||||||
<MenuItem
|
|
||||||
text={<T id={'save_continue_editing'} />}
|
|
||||||
onClick={handleSubmitDraftContinueEditingBtnClick}
|
|
||||||
/>
|
|
||||||
</Menu>
|
|
||||||
}
|
|
||||||
minimal={true}
|
|
||||||
interactionKind={PopoverInteractionKind.CLICK}
|
|
||||||
position={Position.BOTTOM_LEFT}
|
|
||||||
>
|
|
||||||
<Button
|
|
||||||
disabled={isSubmitting}
|
|
||||||
rightIcon={<Icon icon="arrow-drop-up-16" iconSize={20} />}
|
|
||||||
/>
|
|
||||||
</Popover>
|
|
||||||
</ButtonGroup>
|
|
||||||
</If>
|
|
||||||
{/* ----------- Save and New ----------- */}
|
|
||||||
<If condition={manualJournalId && manualJournalPublished}>
|
|
||||||
<ButtonGroup>
|
|
||||||
<Button
|
|
||||||
disabled={isSubmitting}
|
|
||||||
intent={Intent.PRIMARY}
|
|
||||||
type="submit"
|
|
||||||
onClick={handleSubmitPublishBtnClick}
|
|
||||||
text={<T id={'save'} />}
|
|
||||||
/>
|
|
||||||
<Popover
|
|
||||||
content={
|
|
||||||
<Menu>
|
|
||||||
<MenuItem
|
|
||||||
text={<T id={'save_and_new'} />}
|
|
||||||
onClick={handleSubmitPublishAndNewBtnClick}
|
|
||||||
/>
|
|
||||||
</Menu>
|
|
||||||
}
|
|
||||||
minimal={true}
|
|
||||||
interactionKind={PopoverInteractionKind.CLICK}
|
|
||||||
position={Position.BOTTOM_LEFT}
|
|
||||||
>
|
|
||||||
<Button
|
|
||||||
disabled={isSubmitting}
|
|
||||||
intent={Intent.PRIMARY}
|
|
||||||
rightIcon={<Icon icon="arrow-drop-up-16" iconSize={20} />}
|
|
||||||
/>
|
|
||||||
</Popover>
|
|
||||||
</ButtonGroup>
|
|
||||||
</If>
|
|
||||||
{/* ----------- Clear & Reset----------- */}
|
|
||||||
<Button
|
|
||||||
className={'ml1'}
|
|
||||||
disabled={isSubmitting}
|
|
||||||
onClick={handleClearBtnClick}
|
|
||||||
text={manualJournalId ? <T id={'reset'} /> : <T id={'clear'} />}
|
|
||||||
/>
|
|
||||||
{/* ----------- Cancel ----------- */}
|
|
||||||
<Button
|
|
||||||
className={'ml1'}
|
|
||||||
onClick={handleCancelBtnClick}
|
|
||||||
text={<T id={'cancel'} />}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,14 +1,8 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import {
|
import { InputGroup, FormGroup, Position } from '@blueprintjs/core';
|
||||||
InputGroup,
|
import { FastField, ErrorMessage } from 'formik';
|
||||||
FormGroup,
|
|
||||||
Position,
|
|
||||||
ControlGroup,
|
|
||||||
} from '@blueprintjs/core';
|
|
||||||
import { FastField, ErrorMessage, useFormikContext } from 'formik';
|
|
||||||
import { DateInput } from '@blueprintjs/datetime';
|
import { DateInput } from '@blueprintjs/datetime';
|
||||||
import * as R from 'ramda';
|
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
|
||||||
import { CLASSES } from '@/constants/classes';
|
import { CLASSES } from '@/constants/classes';
|
||||||
@@ -20,99 +14,15 @@ import {
|
|||||||
} from '@/utils';
|
} from '@/utils';
|
||||||
import {
|
import {
|
||||||
Hint,
|
Hint,
|
||||||
FieldHint,
|
|
||||||
FieldRequiredHint,
|
FieldRequiredHint,
|
||||||
Icon,
|
Icon,
|
||||||
InputPrependButton,
|
|
||||||
CurrencySelectList,
|
CurrencySelectList,
|
||||||
FormattedMessage as T,
|
FormattedMessage as T,
|
||||||
FInputGroup,
|
|
||||||
FFormGroup,
|
|
||||||
} from '@/components';
|
} from '@/components';
|
||||||
import { useMakeJournalFormContext } from './MakeJournalProvider';
|
import { useMakeJournalFormContext } from './MakeJournalProvider';
|
||||||
import { JournalExchangeRateInputField } from './components';
|
import { JournalExchangeRateInputField } from './components';
|
||||||
import { currenciesFieldShouldUpdate } from './utils';
|
import { currenciesFieldShouldUpdate } from './utils';
|
||||||
|
import { MakeJournalTransactionNoField } from './MakeJournalTransactionNoField';
|
||||||
import withSettings from '@/containers/Settings/withSettings';
|
|
||||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Journal number field of make journal form.
|
|
||||||
*/
|
|
||||||
const MakeJournalTransactionNoField = R.compose(
|
|
||||||
withDialogActions,
|
|
||||||
withSettings(({ manualJournalsSettings }) => ({
|
|
||||||
journalAutoIncrement: manualJournalsSettings?.autoIncrement,
|
|
||||||
})),
|
|
||||||
)(
|
|
||||||
({
|
|
||||||
// #withDialog
|
|
||||||
openDialog,
|
|
||||||
|
|
||||||
// #withSettings
|
|
||||||
journalAutoIncrement,
|
|
||||||
}) => {
|
|
||||||
const { setFieldValue, values } = useFormikContext();
|
|
||||||
|
|
||||||
const handleJournalNumberChange = () => {
|
|
||||||
openDialog('journal-number-form');
|
|
||||||
};
|
|
||||||
const handleJournalNoBlur = (event) => {
|
|
||||||
const newValue = event.target.value;
|
|
||||||
|
|
||||||
if (values.journal_number !== newValue && journalAutoIncrement) {
|
|
||||||
openDialog('journal-number-form', {
|
|
||||||
initialFormValues: {
|
|
||||||
onceManualNumber: newValue,
|
|
||||||
incrementMode: 'manual-transaction',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (!journalAutoIncrement) {
|
|
||||||
setFieldValue('journal_number', newValue);
|
|
||||||
setFieldValue('journal_number_manually', newValue);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<FFormGroup
|
|
||||||
name={'journal_number'}
|
|
||||||
label={<T id={'journal_no'} />}
|
|
||||||
labelInfo={
|
|
||||||
<>
|
|
||||||
<FieldRequiredHint />
|
|
||||||
<FieldHint />
|
|
||||||
</>
|
|
||||||
}
|
|
||||||
fill={true}
|
|
||||||
inline={true}
|
|
||||||
fastField={true}
|
|
||||||
>
|
|
||||||
<ControlGroup fill={true}>
|
|
||||||
<FInputGroup
|
|
||||||
name={'journal_number'}
|
|
||||||
fill={true}
|
|
||||||
asyncControl={true}
|
|
||||||
onBlur={handleJournalNoBlur}
|
|
||||||
fastField={true}
|
|
||||||
onChange={() => {}}
|
|
||||||
/>
|
|
||||||
<InputPrependButton
|
|
||||||
buttonProps={{
|
|
||||||
onClick: handleJournalNumberChange,
|
|
||||||
icon: <Icon icon={'settings-18'} />,
|
|
||||||
}}
|
|
||||||
tooltip={true}
|
|
||||||
tooltipProps={{
|
|
||||||
content: <T id={'setting_your_auto_generated_journal_number'} />,
|
|
||||||
position: Position.BOTTOM_LEFT,
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</ControlGroup>
|
|
||||||
</FFormGroup>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Make journal entries header.
|
* Make journal entries header.
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
|
import intl from 'react-intl-universal';
|
||||||
import { FFormGroup, FEditableText, FormattedMessage as T } from '@/components';
|
import { FFormGroup, FEditableText, FormattedMessage as T } from '@/components';
|
||||||
|
|
||||||
export function MakeJournalFormFooterLeft() {
|
export function MakeJournalFormFooterLeft() {
|
||||||
@@ -13,7 +14,7 @@ export function MakeJournalFormFooterLeft() {
|
|||||||
>
|
>
|
||||||
<FEditableText
|
<FEditableText
|
||||||
name={'description'}
|
name={'description'}
|
||||||
placeholder={<T id={'make_jorunal.decscrption.placeholder'} />}
|
placeholder={intl.get('make_jorunal.decscrption.placeholder')}
|
||||||
/>
|
/>
|
||||||
</DescriptionFormGroup>
|
</DescriptionFormGroup>
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
|
|||||||
@@ -0,0 +1,97 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
import React from 'react';
|
||||||
|
import { Position, ControlGroup } from '@blueprintjs/core';
|
||||||
|
import { useFormikContext } from 'formik';
|
||||||
|
import * as R from 'ramda';
|
||||||
|
import {
|
||||||
|
FieldHint,
|
||||||
|
FieldRequiredHint,
|
||||||
|
Icon,
|
||||||
|
InputPrependButton,
|
||||||
|
FormattedMessage as T,
|
||||||
|
FInputGroup,
|
||||||
|
FFormGroup,
|
||||||
|
} from '@/components';
|
||||||
|
|
||||||
|
import withSettings from '@/containers/Settings/withSettings';
|
||||||
|
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Journal number field of make journal form.
|
||||||
|
*/
|
||||||
|
export const MakeJournalTransactionNoField = R.compose(
|
||||||
|
withDialogActions,
|
||||||
|
withSettings(({ manualJournalsSettings }) => ({
|
||||||
|
journalAutoIncrement: manualJournalsSettings?.autoIncrement,
|
||||||
|
})),
|
||||||
|
)(
|
||||||
|
({
|
||||||
|
// #withDialog
|
||||||
|
openDialog,
|
||||||
|
|
||||||
|
// #withSettings
|
||||||
|
journalAutoIncrement,
|
||||||
|
}) => {
|
||||||
|
const { setFieldValue, values } = useFormikContext();
|
||||||
|
|
||||||
|
const handleJournalNumberChange = () => {
|
||||||
|
openDialog('journal-number-form');
|
||||||
|
};
|
||||||
|
const handleJournalNoBlur = (event) => {
|
||||||
|
const newValue = event.target.value;
|
||||||
|
|
||||||
|
if (values.journal_number !== newValue && journalAutoIncrement) {
|
||||||
|
openDialog('journal-number-form', {
|
||||||
|
initialFormValues: {
|
||||||
|
onceManualNumber: newValue,
|
||||||
|
incrementMode: 'manual-transaction',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (!journalAutoIncrement) {
|
||||||
|
setFieldValue('journal_number', newValue);
|
||||||
|
setFieldValue('journal_number_manually', newValue);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<FFormGroup
|
||||||
|
name={'journal_number'}
|
||||||
|
label={<T id={'journal_no'} />}
|
||||||
|
labelInfo={
|
||||||
|
<>
|
||||||
|
<FieldRequiredHint />
|
||||||
|
<FieldHint />
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
fill={true}
|
||||||
|
inline={true}
|
||||||
|
fastField={true}
|
||||||
|
>
|
||||||
|
<ControlGroup fill={true}>
|
||||||
|
<FInputGroup
|
||||||
|
name={'journal_number'}
|
||||||
|
fill={true}
|
||||||
|
asyncControl={true}
|
||||||
|
onBlur={handleJournalNoBlur}
|
||||||
|
fastField={true}
|
||||||
|
onChange={() => {}}
|
||||||
|
/>
|
||||||
|
<InputPrependButton
|
||||||
|
buttonProps={{
|
||||||
|
onClick: handleJournalNumberChange,
|
||||||
|
icon: <Icon icon={'settings-18'} />,
|
||||||
|
}}
|
||||||
|
tooltip={true}
|
||||||
|
tooltipProps={{
|
||||||
|
content: <T id={'setting_your_auto_generated_journal_number'} />,
|
||||||
|
position: Position.BOTTOM_LEFT,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</ControlGroup>
|
||||||
|
</FFormGroup>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
MakeJournalTransactionNoField.displayName = 'MakeJournalTransactionNoField';
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
import React, { useEffect } from 'react';
|
import React, { useEffect } from 'react';
|
||||||
import intl from 'react-intl-universal';
|
import intl from 'react-intl-universal';
|
||||||
import { Menu, MenuItem, Position, Button } from '@blueprintjs/core';
|
import { Menu, MenuItem, Position, Button, Intent } from '@blueprintjs/core';
|
||||||
import { Popover2 } from '@blueprintjs/popover2';
|
import { Popover2 } from '@blueprintjs/popover2';
|
||||||
import { useFormikContext } from 'formik';
|
import { useFormikContext } from 'formik';
|
||||||
import * as R from 'ramda';
|
import * as R from 'ramda';
|
||||||
@@ -74,6 +74,7 @@ export const ActionsCellRenderer = ({
|
|||||||
const exampleMenu = (
|
const exampleMenu = (
|
||||||
<Menu>
|
<Menu>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
|
intent={Intent.DANGER}
|
||||||
onClick={handleClickRemoveRole}
|
onClick={handleClickRemoveRole}
|
||||||
text={intl.get('make_journal.entries.remove_row')}
|
text={intl.get('make_journal.entries.remove_row')}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -28,6 +28,8 @@ const ERROR = {
|
|||||||
CREDIT_DEBIT_SUMATION_SHOULD_NOT_EQUAL_ZERO:
|
CREDIT_DEBIT_SUMATION_SHOULD_NOT_EQUAL_ZERO:
|
||||||
'CREDIT.DEBIT.SUMATION.SHOULD.NOT.EQUAL.ZERO',
|
'CREDIT.DEBIT.SUMATION.SHOULD.NOT.EQUAL.ZERO',
|
||||||
ENTRIES_SHOULD_ASSIGN_WITH_CONTACT: 'ENTRIES_SHOULD_ASSIGN_WITH_CONTACT',
|
ENTRIES_SHOULD_ASSIGN_WITH_CONTACT: 'ENTRIES_SHOULD_ASSIGN_WITH_CONTACT',
|
||||||
|
COULD_NOT_ASSIGN_DIFFERENT_CURRENCY_TO_ACCOUNTS:
|
||||||
|
'COULD_NOT_ASSIGN_DIFFERENT_CURRENCY_TO_ACCOUNTS',
|
||||||
};
|
};
|
||||||
|
|
||||||
export const MIN_LINES_NUMBER = 1;
|
export const MIN_LINES_NUMBER = 1;
|
||||||
@@ -161,6 +163,15 @@ export const transformErrors = (resErrors, { setErrors, errors }) => {
|
|||||||
intl.get('journal_number_is_already_used'),
|
intl.get('journal_number_is_already_used'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
if (
|
||||||
|
(error = getError(ERROR.COULD_NOT_ASSIGN_DIFFERENT_CURRENCY_TO_ACCOUNTS))
|
||||||
|
) {
|
||||||
|
toastMessages.push(
|
||||||
|
intl.get(
|
||||||
|
'make_journal.errors.should_add_accounts_in_same_currency_or_base_currency',
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
setErrors({ ...newErrors });
|
setErrors({ ...newErrors });
|
||||||
|
|
||||||
if (toastMessages.length > 0) {
|
if (toastMessages.length > 0) {
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import intl from 'react-intl-universal';
|
|||||||
import { RESOURCES_TYPES } from '@/constants/resourcesTypes';
|
import { RESOURCES_TYPES } from '@/constants/resourcesTypes';
|
||||||
import { AbilitySubject, ManualJournalAction } from '@/constants/abilityOption';
|
import { AbilitySubject, ManualJournalAction } from '@/constants/abilityOption';
|
||||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||||
|
import { DRAWERS } from '@/constants/drawers';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Universal search manual journal item select action.
|
* Universal search manual journal item select action.
|
||||||
@@ -17,7 +18,7 @@ function JournalUniversalSearchSelectComponent({
|
|||||||
openDrawer,
|
openDrawer,
|
||||||
}) {
|
}) {
|
||||||
if (resourceType === RESOURCES_TYPES.MANUAL_JOURNAL) {
|
if (resourceType === RESOURCES_TYPES.MANUAL_JOURNAL) {
|
||||||
openDrawer('journal-drawer', { manualJournalId: resourceId });
|
openDrawer(DRAWERS.JOURNAL_DETAILS, { manualJournalId: resourceId });
|
||||||
onAction && onAction();
|
onAction && onAction();
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
|||||||
|
|
||||||
import { AbilitySubject, AccountAction } from '@/constants/abilityOption';
|
import { AbilitySubject, AccountAction } from '@/constants/abilityOption';
|
||||||
import { RESOURCES_TYPES } from '@/constants/resourcesTypes';
|
import { RESOURCES_TYPES } from '@/constants/resourcesTypes';
|
||||||
|
import { DRAWERS } from '@/constants/drawers';
|
||||||
|
|
||||||
function AccountUniversalSearchItemSelectComponent({
|
function AccountUniversalSearchItemSelectComponent({
|
||||||
// #ownProps
|
// #ownProps
|
||||||
@@ -16,7 +17,7 @@ function AccountUniversalSearchItemSelectComponent({
|
|||||||
openDrawer,
|
openDrawer,
|
||||||
}) {
|
}) {
|
||||||
if (resourceType === RESOURCES_TYPES.ACCOUNT) {
|
if (resourceType === RESOURCES_TYPES.ACCOUNT) {
|
||||||
openDrawer('account-drawer', { accountId: resourceId });
|
openDrawer(DRAWERS.ACCOUNT_DETAILS, { accountId: resourceId });
|
||||||
onAction && onAction();
|
onAction && onAction();
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
@@ -28,8 +29,8 @@ export const AccountUniversalSearchItemSelect = withDrawerActions(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Transformes account item to search item.
|
* Transformes account item to search item.
|
||||||
* @param {*} account
|
* @param {*} account
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
const accountToSearch = (account) => ({
|
const accountToSearch = (account) => ({
|
||||||
id: account.id,
|
id: account.id,
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import withAlertsActions from '@/containers/Alert/withAlertActions';
|
|||||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||||
import { compose } from '@/utils';
|
import { compose } from '@/utils';
|
||||||
|
import { DRAWERS } from '@/constants/drawers';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Accounts data-table.
|
* Accounts data-table.
|
||||||
@@ -71,7 +72,7 @@ function AccountsDataTable({
|
|||||||
|
|
||||||
// Handle view detail account.
|
// Handle view detail account.
|
||||||
const handleViewDetailAccount = ({ id }) => {
|
const handleViewDetailAccount = ({ id }) => {
|
||||||
openDrawer('account-drawer', { accountId: id });
|
openDrawer(DRAWERS.ACCOUNT_DETAILS, { accountId: id });
|
||||||
};
|
};
|
||||||
|
|
||||||
// Handle new child button click.
|
// Handle new child button click.
|
||||||
@@ -84,7 +85,7 @@ function AccountsDataTable({
|
|||||||
};
|
};
|
||||||
// Handle cell click.
|
// Handle cell click.
|
||||||
const handleCellClick = (cell, event) => {
|
const handleCellClick = (cell, event) => {
|
||||||
openDrawer('account-drawer', { accountId: cell.row.original.id });
|
openDrawer(DRAWERS.ACCOUNT_DETAILS, { accountId: cell.row.original.id });
|
||||||
};
|
};
|
||||||
// Local storage memorizing columns widths.
|
// Local storage memorizing columns widths.
|
||||||
const [initialColumnsWidths, , handleColumnResizing] =
|
const [initialColumnsWidths, , handleColumnResizing] =
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
|||||||
|
|
||||||
import { useDeleteAccount } from '@/hooks/query';
|
import { useDeleteAccount } from '@/hooks/query';
|
||||||
import { compose } from '@/utils';
|
import { compose } from '@/utils';
|
||||||
|
import { DRAWERS } from '@/constants/drawers';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Account delete alerts.
|
* Account delete alerts.
|
||||||
@@ -48,7 +49,7 @@ function AccountDeleteAlert({
|
|||||||
intent: Intent.SUCCESS,
|
intent: Intent.SUCCESS,
|
||||||
});
|
});
|
||||||
closeAlert(name);
|
closeAlert(name);
|
||||||
closeDrawer('account-drawer');
|
closeDrawer(DRAWERS.ACCOUNT_DETAILS);
|
||||||
})
|
})
|
||||||
.catch(
|
.catch(
|
||||||
({
|
({
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
|||||||
import { handleDeleteErrors } from '@/containers/Purchases/Bills/BillForm/utils';
|
import { handleDeleteErrors } from '@/containers/Purchases/Bills/BillForm/utils';
|
||||||
import { useDeleteBill } from '@/hooks/query';
|
import { useDeleteBill } from '@/hooks/query';
|
||||||
import { compose } from '@/utils';
|
import { compose } from '@/utils';
|
||||||
|
import { DRAWERS } from '@/constants/drawers';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bill delete alert.
|
* Bill delete alert.
|
||||||
@@ -43,8 +44,7 @@ function BillDeleteAlert({
|
|||||||
message: intl.get('the_bill_has_been_deleted_successfully'),
|
message: intl.get('the_bill_has_been_deleted_successfully'),
|
||||||
intent: Intent.SUCCESS,
|
intent: Intent.SUCCESS,
|
||||||
});
|
});
|
||||||
|
closeDrawer(DRAWERS.BILL_DETAILS);
|
||||||
closeDrawer('bill-drawer');
|
|
||||||
})
|
})
|
||||||
.catch(
|
.catch(
|
||||||
({
|
({
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import withAlertActions from '@/containers/Alert/withAlertActions';
|
|||||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||||
|
|
||||||
import { compose } from '@/utils';
|
import { compose } from '@/utils';
|
||||||
|
import { DRAWERS } from '@/constants/drawers';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Account delete transaction alert.
|
* Account delete transaction alert.
|
||||||
@@ -48,7 +49,7 @@ function AccountDeleteTransactionAlert({
|
|||||||
message: intl.get('cash_flow_transaction.delete.alert_message'),
|
message: intl.get('cash_flow_transaction.delete.alert_message'),
|
||||||
intent: Intent.SUCCESS,
|
intent: Intent.SUCCESS,
|
||||||
});
|
});
|
||||||
closeDrawer('cashflow-transaction-drawer');
|
closeDrawer(DRAWERS.CASHFLOW_TRNASACTION_DETAILS);
|
||||||
})
|
})
|
||||||
.catch(
|
.catch(
|
||||||
({
|
({
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
|||||||
import { useDeleteCreditNote } from '@/hooks/query';
|
import { useDeleteCreditNote } from '@/hooks/query';
|
||||||
import { handleDeleteErrors } from '@/containers/Sales/CreditNotes/CreditNotesLanding/utils';
|
import { handleDeleteErrors } from '@/containers/Sales/CreditNotes/CreditNotesLanding/utils';
|
||||||
import { compose } from '@/utils';
|
import { compose } from '@/utils';
|
||||||
|
import { DRAWERS } from '@/constants/drawers';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Credit note delete alert.
|
* Credit note delete alert.
|
||||||
@@ -46,7 +47,7 @@ function CreditNoteDeleteAlert({
|
|||||||
message: intl.get('credit_note.alert.delete_message'),
|
message: intl.get('credit_note.alert.delete_message'),
|
||||||
intent: Intent.SUCCESS,
|
intent: Intent.SUCCESS,
|
||||||
});
|
});
|
||||||
closeDrawer('credit-note-detail-drawer');
|
closeDrawer(DRAWERS.CREDIT_NOTE_DETAILS);
|
||||||
})
|
})
|
||||||
.catch(
|
.catch(
|
||||||
({
|
({
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import withAlertStoreConnect from '@/containers/Alert/withAlertStoreConnect';
|
|||||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||||
|
|
||||||
import { compose } from '@/utils';
|
import { compose } from '@/utils';
|
||||||
|
import { DRAWERS } from '@/constants/drawers';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Refund credit transactions delete alert
|
* Refund credit transactions delete alert
|
||||||
@@ -42,7 +43,7 @@ function RefundCreditNoteDeleteAlert({
|
|||||||
message: intl.get('refund_credit_transactions.alert.delete_message'),
|
message: intl.get('refund_credit_transactions.alert.delete_message'),
|
||||||
intent: Intent.SUCCESS,
|
intent: Intent.SUCCESS,
|
||||||
});
|
});
|
||||||
closeDrawer('refund-credit-detail-drawer');
|
closeDrawer(DRAWERS.REFUND_CREDIT_NOTE_DETAILS);
|
||||||
})
|
})
|
||||||
.catch(() => {})
|
.catch(() => {})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
|||||||
|
|
||||||
import { useDeleteCustomer } from '@/hooks/query';
|
import { useDeleteCustomer } from '@/hooks/query';
|
||||||
import { compose } from '@/utils';
|
import { compose } from '@/utils';
|
||||||
|
import { DRAWERS } from '@/constants/drawers';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Customer delete alert.
|
* Customer delete alert.
|
||||||
@@ -47,7 +48,7 @@ function CustomerDeleteAlert({
|
|||||||
message: intl.get('the_customer_has_been_deleted_successfully'),
|
message: intl.get('the_customer_has_been_deleted_successfully'),
|
||||||
intent: Intent.SUCCESS,
|
intent: Intent.SUCCESS,
|
||||||
});
|
});
|
||||||
closeDrawer('customer-detail-drawer');
|
closeDrawer(DRAWERS.CUSTOMER_DETAILS);
|
||||||
})
|
})
|
||||||
.catch(
|
.catch(
|
||||||
({
|
({
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import withAlertActions from '@/containers/Alert/withAlertActions';
|
|||||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||||
|
|
||||||
import { compose } from '@/utils';
|
import { compose } from '@/utils';
|
||||||
|
import { DRAWERS } from '@/constants/drawers';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Estimate delete alert.
|
* Estimate delete alert.
|
||||||
@@ -47,7 +48,7 @@ function EstimateDeleteAlert({
|
|||||||
message: intl.get('the_estimate_has_been_deleted_successfully'),
|
message: intl.get('the_estimate_has_been_deleted_successfully'),
|
||||||
intent: Intent.SUCCESS,
|
intent: Intent.SUCCESS,
|
||||||
});
|
});
|
||||||
closeDrawer('estimate-detail-drawer');
|
closeDrawer(DRAWERS.ESTIMATE_DETAILS);
|
||||||
})
|
})
|
||||||
.catch(
|
.catch(
|
||||||
({
|
({
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
|||||||
|
|
||||||
import { useDeleteExpense } from '@/hooks/query';
|
import { useDeleteExpense } from '@/hooks/query';
|
||||||
import { compose } from '@/utils';
|
import { compose } from '@/utils';
|
||||||
|
import { DRAWERS } from '@/constants/drawers';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Expense delete alert.
|
* Expense delete alert.
|
||||||
@@ -42,7 +43,7 @@ function ExpenseDeleteAlert({
|
|||||||
}),
|
}),
|
||||||
intent: Intent.SUCCESS,
|
intent: Intent.SUCCESS,
|
||||||
});
|
});
|
||||||
closeDrawer('expense-drawer');
|
closeDrawer(DRAWERS.EXPENSE_DETAILS);
|
||||||
})
|
})
|
||||||
.catch(
|
.catch(
|
||||||
({
|
({
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import withAlertActions from '@/containers/Alert/withAlertActions';
|
|||||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||||
|
|
||||||
import { compose } from '@/utils';
|
import { compose } from '@/utils';
|
||||||
|
import { DRAWERS } from '@/constants/drawers';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invoice delete alert.
|
* Invoice delete alert.
|
||||||
@@ -48,7 +49,7 @@ function InvoiceDeleteAlert({
|
|||||||
message: intl.get('the_invoice_has_been_deleted_successfully'),
|
message: intl.get('the_invoice_has_been_deleted_successfully'),
|
||||||
intent: Intent.SUCCESS,
|
intent: Intent.SUCCESS,
|
||||||
});
|
});
|
||||||
closeDrawer('invoice-detail-drawer');
|
closeDrawer(DRAWERS.INVOICE_DETAILS);
|
||||||
})
|
})
|
||||||
.catch(
|
.catch(
|
||||||
({
|
({
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
|||||||
import { useDeleteInventoryAdjustment } from '@/hooks/query';
|
import { useDeleteInventoryAdjustment } from '@/hooks/query';
|
||||||
|
|
||||||
import { compose } from '@/utils';
|
import { compose } from '@/utils';
|
||||||
|
import { DRAWERS } from '@/constants/drawers';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Inventory Adjustment delete alerts.
|
* Inventory Adjustment delete alerts.
|
||||||
@@ -49,7 +50,7 @@ function InventoryAdjustmentDeleteAlert({
|
|||||||
),
|
),
|
||||||
intent: Intent.SUCCESS,
|
intent: Intent.SUCCESS,
|
||||||
});
|
});
|
||||||
closeDrawer('inventory-adjustment-drawer');
|
closeDrawer(DRAWERS.INVENTORY_ADJUSTMENT_DETAILS);
|
||||||
})
|
})
|
||||||
.catch((errors) => {})
|
.catch((errors) => {})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import withItemsActions from '@/containers/Items/withItemsActions';
|
|||||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||||
|
|
||||||
import { compose } from '@/utils';
|
import { compose } from '@/utils';
|
||||||
|
import { DRAWERS } from '@/constants/drawers';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Item delete alerts.
|
* Item delete alerts.
|
||||||
@@ -54,7 +55,7 @@ function ItemDeleteAlert({
|
|||||||
});
|
});
|
||||||
// Reset to page number one.
|
// Reset to page number one.
|
||||||
setItemsTableState({ page: 1 });
|
setItemsTableState({ page: 1 });
|
||||||
closeDrawer('item-detail-drawer');
|
closeDrawer(DRAWERS.ITEM_DETAILS);
|
||||||
})
|
})
|
||||||
.catch(
|
.catch(
|
||||||
({
|
({
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import withAlertStoreConnect from '@/containers/Alert/withAlertStoreConnect';
|
|||||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||||
|
|
||||||
import { compose } from '@/utils';
|
import { compose } from '@/utils';
|
||||||
|
import { DRAWERS } from '@/constants/drawers';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Journal delete alert.
|
* Journal delete alert.
|
||||||
@@ -45,7 +46,7 @@ function JournalDeleteAlert({
|
|||||||
intent: Intent.SUCCESS,
|
intent: Intent.SUCCESS,
|
||||||
});
|
});
|
||||||
closeAlert(name);
|
closeAlert(name);
|
||||||
closeDrawer('journal-drawer');
|
closeDrawer(DRAWERS.JOURNAL_DETAILS);
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
closeAlert(name);
|
closeAlert(name);
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
|||||||
import { useDeletePaymentMade } from '@/hooks/query';
|
import { useDeletePaymentMade } from '@/hooks/query';
|
||||||
|
|
||||||
import { compose } from '@/utils';
|
import { compose } from '@/utils';
|
||||||
|
import { DRAWERS } from '@/constants/drawers';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Payment made delete alert.
|
* Payment made delete alert.
|
||||||
@@ -44,7 +45,7 @@ function PaymentMadeDeleteAlert({
|
|||||||
message: intl.get('the_payment_made_has_been_deleted_successfully'),
|
message: intl.get('the_payment_made_has_been_deleted_successfully'),
|
||||||
intent: Intent.SUCCESS,
|
intent: Intent.SUCCESS,
|
||||||
});
|
});
|
||||||
closeDrawer('payment-made-detail-drawer');
|
closeDrawer(DRAWERS.PAYMENT_MADE_DETAILS);
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
closeAlert(name);
|
closeAlert(name);
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import withAlertActions from '@/containers/Alert/withAlertActions';
|
|||||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||||
|
|
||||||
import { compose } from '@/utils';
|
import { compose } from '@/utils';
|
||||||
|
import { DRAWERS } from '@/constants/drawers';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Payment receive delete alert.
|
* Payment receive delete alert.
|
||||||
@@ -50,7 +51,7 @@ function PaymentReceiveDeleteAlert({
|
|||||||
),
|
),
|
||||||
intent: Intent.SUCCESS,
|
intent: Intent.SUCCESS,
|
||||||
});
|
});
|
||||||
closeDrawer('payment-receive-detail-drawer');
|
closeDrawer(DRAWERS.PAYMENT_RECEIVE_DETAILS);
|
||||||
})
|
})
|
||||||
.catch(() => {})
|
.catch(() => {})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import withAlertActions from '@/containers/Alert/withAlertActions';
|
|||||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||||
|
|
||||||
import { compose } from '@/utils';
|
import { compose } from '@/utils';
|
||||||
|
import { DRAWERS } from '@/constants/drawers';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invoice alert.
|
* Invoice alert.
|
||||||
@@ -47,7 +48,7 @@ function NameDeleteAlert({
|
|||||||
message: intl.get('the_receipt_has_been_deleted_successfully'),
|
message: intl.get('the_receipt_has_been_deleted_successfully'),
|
||||||
intent: Intent.SUCCESS,
|
intent: Intent.SUCCESS,
|
||||||
});
|
});
|
||||||
closeDrawer('receipt-detail-drawer');
|
closeDrawer(DRAWERS.RECEIPT_DETAILS);
|
||||||
})
|
})
|
||||||
.catch(() => {})
|
.catch(() => {})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import withAlertStoreConnect from '@/containers/Alert/withAlertStoreConnect';
|
|||||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||||
|
|
||||||
import { compose } from '@/utils';
|
import { compose } from '@/utils';
|
||||||
|
import { DRAWERS } from '@/constants/drawers';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Refund Vendor transactions delete alert.
|
* Refund Vendor transactions delete alert.
|
||||||
@@ -43,7 +44,7 @@ function RefundVendorCreditDeleteAlert({
|
|||||||
),
|
),
|
||||||
intent: Intent.SUCCESS,
|
intent: Intent.SUCCESS,
|
||||||
});
|
});
|
||||||
closeDrawer('refund-vendor-detail-drawer');
|
closeDrawer(DRAWERS.REFUND_VENDOR_CREDIT_DETAILS);
|
||||||
})
|
})
|
||||||
.catch(() => {})
|
.catch(() => {})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
|||||||
import { handleDeleteErrors } from '@/containers/Purchases/CreditNotes/CreditNotesLanding/utils';
|
import { handleDeleteErrors } from '@/containers/Purchases/CreditNotes/CreditNotesLanding/utils';
|
||||||
import { useDeleteVendorCredit } from '@/hooks/query';
|
import { useDeleteVendorCredit } from '@/hooks/query';
|
||||||
import { compose } from '@/utils';
|
import { compose } from '@/utils';
|
||||||
|
import { DRAWERS } from '@/constants/drawers';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Vendor Credit delete alert.
|
* Vendor Credit delete alert.
|
||||||
@@ -45,7 +46,7 @@ function VendorCreditDeleteAlert({
|
|||||||
message: intl.get('vendor_credits.alert.delete_message'),
|
message: intl.get('vendor_credits.alert.delete_message'),
|
||||||
intent: Intent.SUCCESS,
|
intent: Intent.SUCCESS,
|
||||||
});
|
});
|
||||||
closeDrawer('vendor-credit-detail-drawer');
|
closeDrawer(DRAWERS.VENDOR_CREDIT_DETAILS);
|
||||||
})
|
})
|
||||||
.catch(
|
.catch(
|
||||||
({
|
({
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import withAlertActions from '@/containers/Alert/withAlertActions';
|
|||||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||||
|
|
||||||
import { compose } from '@/utils';
|
import { compose } from '@/utils';
|
||||||
|
import { DRAWERS } from '@/constants/drawers';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Vendor delete alert.
|
* Vendor delete alert.
|
||||||
@@ -48,7 +49,7 @@ function VendorDeleteAlert({
|
|||||||
message: intl.get('the_vendor_has_been_deleted_successfully'),
|
message: intl.get('the_vendor_has_been_deleted_successfully'),
|
||||||
intent: Intent.SUCCESS,
|
intent: Intent.SUCCESS,
|
||||||
});
|
});
|
||||||
closeDrawer('vendor-detail-drawer');
|
closeDrawer(DRAWERS.VENDOR_DETAILS);
|
||||||
})
|
})
|
||||||
.catch(
|
.catch(
|
||||||
({
|
({
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import withAlertActions from '@/containers/Alert/withAlertActions';
|
|||||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||||
|
|
||||||
import { compose } from '@/utils';
|
import { compose } from '@/utils';
|
||||||
|
import { DRAWERS } from '@/constants/drawers';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Warehouse transfer delete alert
|
* Warehouse transfer delete alert
|
||||||
@@ -48,7 +49,7 @@ function WarehouseTransferDeleteAlert({
|
|||||||
message: intl.get('warehouse_transfer.alert.delete_message'),
|
message: intl.get('warehouse_transfer.alert.delete_message'),
|
||||||
intent: Intent.SUCCESS,
|
intent: Intent.SUCCESS,
|
||||||
});
|
});
|
||||||
closeDrawer('warehouse-transfer-detail-drawer');
|
closeDrawer(DRAWERS.WAREHOUSE_TRANSFER_DETAILS);
|
||||||
})
|
})
|
||||||
.catch(
|
.catch(
|
||||||
({
|
({
|
||||||
|
|||||||
@@ -23,11 +23,11 @@ export const RegisterSchema = Yup.object().shape({
|
|||||||
first_name: Yup.string().required().label(intl.get('first_name_')),
|
first_name: Yup.string().required().label(intl.get('first_name_')),
|
||||||
last_name: Yup.string().required().label(intl.get('last_name_')),
|
last_name: Yup.string().required().label(intl.get('last_name_')),
|
||||||
email: Yup.string().email().required().label(intl.get('email')),
|
email: Yup.string().email().required().label(intl.get('email')),
|
||||||
password: Yup.string().min(4).required().label(intl.get('password')),
|
password: Yup.string().min(6).required().label(intl.get('password')),
|
||||||
});
|
});
|
||||||
|
|
||||||
export const ResetPasswordSchema = Yup.object().shape({
|
export const ResetPasswordSchema = Yup.object().shape({
|
||||||
password: Yup.string().min(4).required().label(intl.get('password')),
|
password: Yup.string().min(6).required().label(intl.get('password')),
|
||||||
confirm_password: Yup.string()
|
confirm_password: Yup.string()
|
||||||
.oneOf([Yup.ref('password'), null])
|
.oneOf([Yup.ref('password'), null])
|
||||||
.required()
|
.required()
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import {
|
|||||||
|
|
||||||
import { Select } from '@blueprintjs/select';
|
import { Select } from '@blueprintjs/select';
|
||||||
import { Icon } from '@/components';
|
import { Icon } from '@/components';
|
||||||
|
import { DRAWERS } from '@/constants/drawers';
|
||||||
|
|
||||||
export const CashFlowMenuItems = ({
|
export const CashFlowMenuItems = ({
|
||||||
text,
|
text,
|
||||||
@@ -53,40 +54,40 @@ export const CashFlowMenuItems = ({
|
|||||||
export const handleCashFlowTransactionType = (reference, openDrawer) => {
|
export const handleCashFlowTransactionType = (reference, openDrawer) => {
|
||||||
switch (reference.reference_type) {
|
switch (reference.reference_type) {
|
||||||
case 'SaleReceipt':
|
case 'SaleReceipt':
|
||||||
return openDrawer('receipt-detail-drawer', {
|
return openDrawer(DRAWERS.RECEIPT_DETAILS, {
|
||||||
receiptId: reference.reference_id,
|
receiptId: reference.reference_id,
|
||||||
});
|
});
|
||||||
case 'Journal':
|
case 'Journal':
|
||||||
return openDrawer('journal-drawer', {
|
return openDrawer(DRAWERS.JOURNAL_DETAILS, {
|
||||||
manualJournalId: reference.reference_id,
|
manualJournalId: reference.reference_id,
|
||||||
});
|
});
|
||||||
case 'Expense':
|
case 'Expense':
|
||||||
return openDrawer('expense-drawer', {
|
return openDrawer(DRAWERS.EXPENSE_DETAILS, {
|
||||||
expenseId: reference.reference_id,
|
expenseId: reference.reference_id,
|
||||||
});
|
});
|
||||||
case 'PaymentReceive':
|
case 'PaymentReceive':
|
||||||
return openDrawer('payment-receive-detail-drawer', {
|
return openDrawer(DRAWERS.PAYMENT_RECEIVE_DETAILS, {
|
||||||
paymentReceiveId: reference.reference_id,
|
paymentReceiveId: reference.reference_id,
|
||||||
});
|
});
|
||||||
case 'BillPayment':
|
case 'BillPayment':
|
||||||
return openDrawer('payment-made-detail-drawer', {
|
return openDrawer(DRAWERS.PAYMENT_MADE_DETAILS, {
|
||||||
paymentMadeId: reference.reference_id,
|
paymentMadeId: reference.reference_id,
|
||||||
});
|
});
|
||||||
case 'RefundCreditNote':
|
case 'RefundCreditNote':
|
||||||
return openDrawer('refund-credit-detail-drawer', {
|
return openDrawer(DRAWERS.REFUND_CREDIT_NOTE_DETAILS, {
|
||||||
refundTransactionId: reference.reference_id,
|
refundTransactionId: reference.reference_id,
|
||||||
});
|
});
|
||||||
case 'RefundVendorCredit':
|
case 'RefundVendorCredit':
|
||||||
return openDrawer('refund-vendor-detail-drawer', {
|
return openDrawer(DRAWERS.REFUND_VENDOR_CREDIT_DETAILS, {
|
||||||
refundTransactionId: reference.reference_id,
|
refundTransactionId: reference.reference_id,
|
||||||
});
|
});
|
||||||
case 'InventoryAdjustment':
|
case 'InventoryAdjustment':
|
||||||
return openDrawer('inventory-adjustment-drawer', {
|
return openDrawer(DRAWERS.INVENTORY_ADJUSTMENT_DETAILS, {
|
||||||
inventoryId: reference.reference_id,
|
inventoryId: reference.reference_id,
|
||||||
});
|
});
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return openDrawer('cashflow-transaction-drawer', {
|
return openDrawer(DRAWERS.CASHFLOW_TRNASACTION_DETAILS, {
|
||||||
referenceId: reference.reference_id,
|
referenceId: reference.reference_id,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import withDialogActions from '@/containers/Dialog/withDialogActions';
|
|||||||
|
|
||||||
import { AccountDialogAction } from '@/containers/Dialogs/AccountDialog/utils';
|
import { AccountDialogAction } from '@/containers/Dialogs/AccountDialog/utils';
|
||||||
import { safeCallback } from '@/utils';
|
import { safeCallback } from '@/utils';
|
||||||
|
import { DRAWERS } from '@/constants/drawers';
|
||||||
|
|
||||||
const CASHFLOW_SKELETON_N = 4;
|
const CASHFLOW_SKELETON_N = 4;
|
||||||
|
|
||||||
@@ -63,7 +64,7 @@ function CashflowBankAccount({
|
|||||||
}) {
|
}) {
|
||||||
// Handle view detail account.
|
// Handle view detail account.
|
||||||
const handleViewClick = () => {
|
const handleViewClick = () => {
|
||||||
openDrawer('account-drawer', { accountId: account.id });
|
openDrawer(DRAWERS.ACCOUNT_DETAILS, { accountId: account.id });
|
||||||
};
|
};
|
||||||
// Handle delete action account.
|
// Handle delete action account.
|
||||||
const handleDeleteClick = () => {
|
const handleDeleteClick = () => {
|
||||||
|
|||||||
@@ -27,13 +27,10 @@ function MoneyInFloatingActions({
|
|||||||
setSubmitPayload({ publish: false });
|
setSubmitPayload({ publish: false });
|
||||||
submitForm();
|
submitForm();
|
||||||
};
|
};
|
||||||
|
|
||||||
// Handle submit button click.
|
// Handle submit button click.
|
||||||
const handleSubmittBtnClick = (event) => {
|
const handleSubmittBtnClick = (event) => {
|
||||||
setSubmitPayload({ publish: true });
|
setSubmitPayload({ publish: true });
|
||||||
submitForm();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Handle close button click.
|
// Handle close button click.
|
||||||
const handleCloseBtnClick = (event) => {
|
const handleCloseBtnClick = (event) => {
|
||||||
closeDialog(dialogName);
|
closeDialog(dialogName);
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ function MoneyOutFloatingActions({
|
|||||||
// Handle submit button click.
|
// Handle submit button click.
|
||||||
const handleSubmittBtnClick = (event) => {
|
const handleSubmittBtnClick = (event) => {
|
||||||
setSubmitPayload({ publish: true });
|
setSubmitPayload({ publish: true });
|
||||||
submitForm();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Handle close button click.
|
// Handle close button click.
|
||||||
|
|||||||
@@ -1,15 +1,12 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import moment from 'moment';
|
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { FormGroup, Position, Classes, ControlGroup } from '@blueprintjs/core';
|
import { FormGroup, Position, Classes, ControlGroup } from '@blueprintjs/core';
|
||||||
import { DateInput } from '@blueprintjs/datetime';
|
import { FastField, ErrorMessage, useFormikContext } from 'formik';
|
||||||
import { FastField, ErrorMessage } from 'formik';
|
|
||||||
import { Features } from '@/constants';
|
import { Features } from '@/constants';
|
||||||
import {
|
import {
|
||||||
FFormGroup,
|
FFormGroup,
|
||||||
FormattedMessage as T,
|
FormattedMessage as T,
|
||||||
MoneyInputGroup,
|
|
||||||
InputPrependText,
|
InputPrependText,
|
||||||
CurrencySelectList,
|
CurrencySelectList,
|
||||||
BranchSelect,
|
BranchSelect,
|
||||||
@@ -17,10 +14,17 @@ import {
|
|||||||
FeatureCan,
|
FeatureCan,
|
||||||
Row,
|
Row,
|
||||||
Col,
|
Col,
|
||||||
|
FMoneyInputGroup,
|
||||||
|
ExchangeRateInputGroup,
|
||||||
|
FDateInput,
|
||||||
} from '@/components';
|
} from '@/components';
|
||||||
import { useCustomerFormContext } from './CustomerFormProvider';
|
import { useCustomerFormContext } from './CustomerFormProvider';
|
||||||
import { useSetPrimaryBranchToForm } from './utils';
|
import {
|
||||||
import { momentFormatter, tansformDateValue, inputIntent } from '@/utils';
|
openingBalanceFieldShouldUpdate,
|
||||||
|
useIsCustomerForeignCurrency,
|
||||||
|
useSetPrimaryBranchToForm,
|
||||||
|
} from './utils';
|
||||||
|
import { useCurrentOrganization } from '@/hooks/state';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Customer financial panel.
|
* Customer financial panel.
|
||||||
@@ -35,76 +39,6 @@ export default function CustomerFinancialPanel() {
|
|||||||
<div className={'tab-panel--financial'}>
|
<div className={'tab-panel--financial'}>
|
||||||
<Row>
|
<Row>
|
||||||
<Col xs={6}>
|
<Col xs={6}>
|
||||||
{/*------------ Opening balance at -----------*/}
|
|
||||||
<FastField name={'opening_balance_at'}>
|
|
||||||
{({ form, field: { value }, meta: { error, touched } }) => (
|
|
||||||
<FormGroup
|
|
||||||
label={<T id={'opening_balance_at'} />}
|
|
||||||
className={classNames('form-group--select-list', Classes.FILL)}
|
|
||||||
intent={inputIntent({ error, touched })}
|
|
||||||
inline={true}
|
|
||||||
helperText={<ErrorMessage name="opening_balance_at" />}
|
|
||||||
>
|
|
||||||
<DateInput
|
|
||||||
{...momentFormatter('YYYY/MM/DD')}
|
|
||||||
onChange={(date) => {
|
|
||||||
form.setFieldValue(
|
|
||||||
'opening_balance_at',
|
|
||||||
moment(date).format('YYYY-MM-DD'),
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
value={tansformDateValue(value)}
|
|
||||||
popoverProps={{ position: Position.BOTTOM, minimal: true }}
|
|
||||||
disabled={customerId}
|
|
||||||
/>
|
|
||||||
</FormGroup>
|
|
||||||
)}
|
|
||||||
</FastField>
|
|
||||||
|
|
||||||
{/*------------ Opening balance -----------*/}
|
|
||||||
<FastField name={'opening_balance'}>
|
|
||||||
{({ form, field, field: { value }, meta: { error, touched } }) => (
|
|
||||||
<FormGroup
|
|
||||||
label={<T id={'opening_balance'} />}
|
|
||||||
className={classNames(
|
|
||||||
'form-group--opening-balance',
|
|
||||||
Classes.FILL,
|
|
||||||
)}
|
|
||||||
intent={inputIntent({ error, touched })}
|
|
||||||
inline={true}
|
|
||||||
>
|
|
||||||
<ControlGroup>
|
|
||||||
<InputPrependText text={form.values.currency_code} />
|
|
||||||
<MoneyInputGroup
|
|
||||||
value={value}
|
|
||||||
inputGroupProps={{ fill: true }}
|
|
||||||
disabled={customerId}
|
|
||||||
onChange={(balance) => {
|
|
||||||
form.setFieldValue('opening_balance', balance);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</ControlGroup>
|
|
||||||
</FormGroup>
|
|
||||||
)}
|
|
||||||
</FastField>
|
|
||||||
|
|
||||||
{/*------------ Opening branch -----------*/}
|
|
||||||
<FeatureCan feature={Features.Branches}>
|
|
||||||
<FFormGroup
|
|
||||||
label={<T id={'customer.label.opening_branch'} />}
|
|
||||||
name={'opening_balance_branch_id'}
|
|
||||||
inline={true}
|
|
||||||
className={classNames('form-group--select-list', Classes.FILL)}
|
|
||||||
>
|
|
||||||
<BranchSelect
|
|
||||||
name={'opening_balance_branch_id'}
|
|
||||||
branches={branches}
|
|
||||||
input={BranchSelectButton}
|
|
||||||
popoverProps={{ minimal: true }}
|
|
||||||
/>
|
|
||||||
</FFormGroup>
|
|
||||||
</FeatureCan>
|
|
||||||
|
|
||||||
{/*------------ Currency -----------*/}
|
{/*------------ Currency -----------*/}
|
||||||
<FastField name={'currency_code'}>
|
<FastField name={'currency_code'}>
|
||||||
{({ form, field: { value }, meta: { error, touched } }) => (
|
{({ form, field: { value }, meta: { error, touched } }) => (
|
||||||
@@ -123,12 +57,130 @@ export default function CustomerFinancialPanel() {
|
|||||||
onCurrencySelected={(currency) => {
|
onCurrencySelected={(currency) => {
|
||||||
form.setFieldValue('currency_code', currency.currency_code);
|
form.setFieldValue('currency_code', currency.currency_code);
|
||||||
}}
|
}}
|
||||||
|
disabled={customerId}
|
||||||
/>
|
/>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
)}
|
)}
|
||||||
</FastField>
|
</FastField>
|
||||||
|
|
||||||
|
{/*------------ Opening balance -----------*/}
|
||||||
|
<CustomerOpeningBalanceField />
|
||||||
|
|
||||||
|
{/*------ Opening Balance Exchange Rate -----*/}
|
||||||
|
<CustomerOpeningBalanceExchangeRateField />
|
||||||
|
|
||||||
|
{/*------------ Opening balance at -----------*/}
|
||||||
|
<CustomerOpeningBalanceAtField />
|
||||||
|
|
||||||
|
{/*------------ Opening branch -----------*/}
|
||||||
|
<FeatureCan feature={Features.Branches}>
|
||||||
|
<FFormGroup
|
||||||
|
label={<T id={'customer.label.opening_branch'} />}
|
||||||
|
name={'opening_balance_branch_id'}
|
||||||
|
inline={true}
|
||||||
|
className={classNames('form-group--select-list', Classes.FILL)}
|
||||||
|
>
|
||||||
|
<BranchSelect
|
||||||
|
name={'opening_balance_branch_id'}
|
||||||
|
branches={branches}
|
||||||
|
input={BranchSelectButton}
|
||||||
|
popoverProps={{ minimal: true }}
|
||||||
|
/>
|
||||||
|
</FFormGroup>
|
||||||
|
</FeatureCan>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customer opening balance at date field.
|
||||||
|
* @returns {JSX.Element}
|
||||||
|
*/
|
||||||
|
function CustomerOpeningBalanceAtField() {
|
||||||
|
const { customerId } = useCustomerFormContext();
|
||||||
|
|
||||||
|
// Cannot continue if the customer id is defined.
|
||||||
|
if (customerId) return null;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<FormGroup
|
||||||
|
name={'opening_balance_at'}
|
||||||
|
label={<T id={'opening_balance_at'} />}
|
||||||
|
inline={true}
|
||||||
|
helperText={<ErrorMessage name="opening_balance_at" />}
|
||||||
|
>
|
||||||
|
<FDateInput
|
||||||
|
name={'opening_balance_at'}
|
||||||
|
popoverProps={{ position: Position.BOTTOM, minimal: true }}
|
||||||
|
disabled={customerId}
|
||||||
|
formatDate={(date) => date.toLocaleDateString()}
|
||||||
|
parseDate={(str) => new Date(str)}
|
||||||
|
fill={true}
|
||||||
|
/>
|
||||||
|
</FormGroup>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customer opening balance field.
|
||||||
|
* @returns {JSX.Element}
|
||||||
|
*/
|
||||||
|
function CustomerOpeningBalanceField() {
|
||||||
|
const { customerId } = useCustomerFormContext();
|
||||||
|
const { values } = useFormikContext();
|
||||||
|
|
||||||
|
// Cannot continue if the customer id is defined.
|
||||||
|
if (customerId) return null;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<FFormGroup
|
||||||
|
label={<T id={'opening_balance'} />}
|
||||||
|
name={'opening_balance'}
|
||||||
|
inline={true}
|
||||||
|
shouldUpdate={openingBalanceFieldShouldUpdate}
|
||||||
|
shouldUpdateDeps={{ currencyCode: values.currency_code }}
|
||||||
|
fastField={true}
|
||||||
|
>
|
||||||
|
<ControlGroup>
|
||||||
|
<InputPrependText text={values.currency_code} />
|
||||||
|
<FMoneyInputGroup
|
||||||
|
name={'opening_balance'}
|
||||||
|
inputGroupProps={{ fill: true }}
|
||||||
|
/>
|
||||||
|
</ControlGroup>
|
||||||
|
</FFormGroup>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customer opening balance exchange rate field if the customer has foreign
|
||||||
|
* currency.
|
||||||
|
* @returns {JSX.Element}
|
||||||
|
*/
|
||||||
|
function CustomerOpeningBalanceExchangeRateField() {
|
||||||
|
const { values } = useFormikContext();
|
||||||
|
const { customerId } = useCustomerFormContext();
|
||||||
|
const currentOrganization = useCurrentOrganization();
|
||||||
|
|
||||||
|
const isForeignJouranl = useIsCustomerForeignCurrency();
|
||||||
|
|
||||||
|
// Can't continue if the customer is not foreign.
|
||||||
|
if (!isForeignJouranl || customerId) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<FFormGroup
|
||||||
|
label={' '}
|
||||||
|
name={'opening_balance_exchange_rate'}
|
||||||
|
inline={true}
|
||||||
|
>
|
||||||
|
<ExchangeRateInputGroup
|
||||||
|
fromCurrency={values.currency_code}
|
||||||
|
toCurrency={currentOrganization.base_currency}
|
||||||
|
name={'opening_balance_exchange_rate'}
|
||||||
|
/>
|
||||||
|
</FFormGroup>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
@@ -32,11 +32,6 @@ export default function CustomersTabs() {
|
|||||||
title={intl.get('notes')}
|
title={intl.get('notes')}
|
||||||
panel={<CustomerNotePanel />}
|
panel={<CustomerNotePanel />}
|
||||||
/>
|
/>
|
||||||
<Tab
|
|
||||||
id={'attachement'}
|
|
||||||
title={intl.get('attachement')}
|
|
||||||
panel={<CustomerAttachmentTabs />}
|
|
||||||
/>
|
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import { useFormikContext } from 'formik';
|
|||||||
import { first } from 'lodash';
|
import { first } from 'lodash';
|
||||||
|
|
||||||
import { useCustomerFormContext } from './CustomerFormProvider';
|
import { useCustomerFormContext } from './CustomerFormProvider';
|
||||||
|
import { useCurrentOrganization } from '@/hooks/state';
|
||||||
|
|
||||||
export const defaultInitialValues = {
|
export const defaultInitialValues = {
|
||||||
customer_type: 'business',
|
customer_type: 'business',
|
||||||
@@ -37,9 +38,11 @@ export const defaultInitialValues = {
|
|||||||
shipping_address_postcode: '',
|
shipping_address_postcode: '',
|
||||||
shipping_address_phone: '',
|
shipping_address_phone: '',
|
||||||
|
|
||||||
opening_balance: '',
|
|
||||||
currency_code: '',
|
currency_code: '',
|
||||||
|
|
||||||
|
opening_balance: '',
|
||||||
opening_balance_at: moment(new Date()).format('YYYY-MM-DD'),
|
opening_balance_at: moment(new Date()).format('YYYY-MM-DD'),
|
||||||
|
opening_balance_exchange_rate: '',
|
||||||
opening_balance_branch_id: '',
|
opening_balance_branch_id: '',
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -57,3 +60,25 @@ export const useSetPrimaryBranchToForm = () => {
|
|||||||
}
|
}
|
||||||
}, [isBranchesSuccess, setFieldValue, branches]);
|
}, [isBranchesSuccess, setFieldValue, branches]);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Detarmines whether the current customer has foreign currency.
|
||||||
|
* @returns {boolean}
|
||||||
|
*/
|
||||||
|
export const useIsCustomerForeignCurrency = () => {
|
||||||
|
const currentOrganization = useCurrentOrganization();
|
||||||
|
const { values } = useFormikContext();
|
||||||
|
|
||||||
|
return currentOrganization.base_currency !== values.currency_code;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Detarmines the exchange opening balance field when should update.
|
||||||
|
*/
|
||||||
|
export const openingBalanceFieldShouldUpdate = (newProps, oldProps) => {
|
||||||
|
return (
|
||||||
|
newProps.shouldUpdateDeps.currencyCode !==
|
||||||
|
oldProps.shouldUpdateDeps.currencyCode ||
|
||||||
|
defaultFastFieldShouldUpdate(newProps, oldProps)
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import { useCustomersListContext } from './CustomersListProvider';
|
|||||||
import { useMemorizedColumnsWidths } from '@/hooks';
|
import { useMemorizedColumnsWidths } from '@/hooks';
|
||||||
|
|
||||||
import { compose } from '@/utils';
|
import { compose } from '@/utils';
|
||||||
|
import { DRAWERS } from '@/constants/drawers';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Customers table.
|
* Customers table.
|
||||||
@@ -108,12 +109,12 @@ function CustomersTable({
|
|||||||
|
|
||||||
// Handle view detail contact.
|
// Handle view detail contact.
|
||||||
const handleViewDetailCustomer = ({ id }) => {
|
const handleViewDetailCustomer = ({ id }) => {
|
||||||
openDrawer('customer-detail-drawer', { customerId: id });
|
openDrawer(DRAWERS.CUSTOMER_DETAILS, { customerId: id });
|
||||||
};
|
};
|
||||||
|
|
||||||
// Handle cell click.
|
// Handle cell click.
|
||||||
const handleCellClick = (cell, event) => {
|
const handleCellClick = (cell, event) => {
|
||||||
openDrawer('customer-detail-drawer', { customerId: cell.row.original.id });
|
openDrawer(DRAWERS.CUSTOMER_DETAILS, { customerId: cell.row.original.id });
|
||||||
};
|
};
|
||||||
|
|
||||||
if (isEmptyStatus) {
|
if (isEmptyStatus) {
|
||||||
|
|||||||
@@ -38,7 +38,6 @@ export function ActionsMenu({
|
|||||||
/>
|
/>
|
||||||
<Can I={CustomerAction.Edit} a={AbilitySubject.Customer}>
|
<Can I={CustomerAction.Edit} a={AbilitySubject.Customer}>
|
||||||
<MenuDivider />
|
<MenuDivider />
|
||||||
|
|
||||||
<MenuItem
|
<MenuItem
|
||||||
icon={<Icon icon="pen-18" />}
|
icon={<Icon icon="pen-18" />}
|
||||||
text={intl.get('edit_customer')}
|
text={intl.get('edit_customer')}
|
||||||
@@ -47,7 +46,7 @@ export function ActionsMenu({
|
|||||||
</Can>
|
</Can>
|
||||||
<Can I={CustomerAction.Create} a={AbilitySubject.Customer}>
|
<Can I={CustomerAction.Create} a={AbilitySubject.Customer}>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
icon={<Icon icon="duplicate-16" />}
|
icon={<Icon icon="content-copy" iconSize={16} />}
|
||||||
text={intl.get('duplicate')}
|
text={intl.get('duplicate')}
|
||||||
onClick={safeCallback(onDuplicate, original)}
|
onClick={safeCallback(onDuplicate, original)}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -2,9 +2,11 @@
|
|||||||
import intl from 'react-intl-universal';
|
import intl from 'react-intl-universal';
|
||||||
import { AbilitySubject, CustomerAction } from '@/constants/abilityOption';
|
import { AbilitySubject, CustomerAction } from '@/constants/abilityOption';
|
||||||
|
|
||||||
import { RESOURCES_TYPES } from '@/constants/resourcesTypes';
|
|
||||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||||
|
|
||||||
|
import { RESOURCES_TYPES } from '@/constants/resourcesTypes';
|
||||||
|
import { DRAWERS } from '@/constants/drawers';
|
||||||
|
|
||||||
function CustomerUniversalSearchSelectComponent({
|
function CustomerUniversalSearchSelectComponent({
|
||||||
resourceType,
|
resourceType,
|
||||||
resourceId,
|
resourceId,
|
||||||
@@ -14,7 +16,7 @@ function CustomerUniversalSearchSelectComponent({
|
|||||||
openDrawer,
|
openDrawer,
|
||||||
}) {
|
}) {
|
||||||
if (resourceType === RESOURCES_TYPES.CUSTOMER) {
|
if (resourceType === RESOURCES_TYPES.CUSTOMER) {
|
||||||
openDrawer('customer-detail-drawer', { customerId: resourceId });
|
openDrawer(DRAWERS.CUSTOMER_DETAILS, { customerId: resourceId });
|
||||||
onAction && onAction();
|
onAction && onAction();
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -34,10 +34,10 @@ export function Sidebar() {
|
|||||||
* @returns {React.JSX}
|
* @returns {React.JSX}
|
||||||
*/
|
*/
|
||||||
function SidebarFooterVersion() {
|
function SidebarFooterVersion() {
|
||||||
const { VERSION } = process.env;
|
const { MONOREPO_VERSION } = process.env;
|
||||||
|
|
||||||
if (!VERSION) {
|
if (!MONOREPO_VERSION) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return <div class="sidebar__version">v{VERSION}</div>;
|
return <div class="sidebar__version">v{MONOREPO_VERSION}</div>;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import { useCustomerOpeningBalanceContext } from './CustomerOpeningBalanceFormPr
|
|||||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||||
import { compose } from '@/utils';
|
import { compose } from '@/utils';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Customer Opening balance floating actions.
|
* Customer Opening balance floating actions.
|
||||||
* @returns
|
* @returns
|
||||||
@@ -31,6 +30,9 @@ function CustomerOpeningBalanceFormFloatingActions({
|
|||||||
return (
|
return (
|
||||||
<div className={Classes.DIALOG_FOOTER}>
|
<div className={Classes.DIALOG_FOOTER}>
|
||||||
<div className={Classes.DIALOG_FOOTER_ACTIONS}>
|
<div className={Classes.DIALOG_FOOTER_ACTIONS}>
|
||||||
|
<Button onClick={handleCancelBtnClick} style={{ minWidth: '75px' }}>
|
||||||
|
<T id={'cancel'} />
|
||||||
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
intent={Intent.PRIMARY}
|
intent={Intent.PRIMARY}
|
||||||
loading={isSubmitting}
|
loading={isSubmitting}
|
||||||
@@ -39,9 +41,6 @@ function CustomerOpeningBalanceFormFloatingActions({
|
|||||||
>
|
>
|
||||||
{<T id={'edit'} />}
|
{<T id={'edit'} />}
|
||||||
</Button>
|
</Button>
|
||||||
<Button onClick={handleCancelBtnClick} style={{ minWidth: '75px' }}>
|
|
||||||
<T id={'cancel'} />
|
|
||||||
</Button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ function InventoryAdjustmentFloatingActions({
|
|||||||
// Handle submit make adjustment button click.
|
// Handle submit make adjustment button click.
|
||||||
const handleSubmitMakeAdjustmentBtnClick = (event) => {
|
const handleSubmitMakeAdjustmentBtnClick = (event) => {
|
||||||
setSubmitPayload({ publish: true });
|
setSubmitPayload({ publish: true });
|
||||||
submitForm();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Handle close button click.
|
// Handle close button click.
|
||||||
@@ -53,7 +52,6 @@ function InventoryAdjustmentFloatingActions({
|
|||||||
<Button
|
<Button
|
||||||
loading={isSubmitting && !submitPayload.publish}
|
loading={isSubmitting && !submitPayload.publish}
|
||||||
style={{ minWidth: '75px' }}
|
style={{ minWidth: '75px' }}
|
||||||
type="submit"
|
|
||||||
onClick={handleSubmitDraftBtnClick}
|
onClick={handleSubmitDraftBtnClick}
|
||||||
>
|
>
|
||||||
{<T id={'save_as_draft'} />}
|
{<T id={'save_as_draft'} />}
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ import {
|
|||||||
BranchSelect,
|
BranchSelect,
|
||||||
WarehouseSelect,
|
WarehouseSelect,
|
||||||
BranchSelectButton,
|
BranchSelectButton,
|
||||||
WarehouseSelectButton,
|
|
||||||
AccountsSuggestField,
|
AccountsSuggestField,
|
||||||
} from '@/components';
|
} from '@/components';
|
||||||
import {
|
import {
|
||||||
@@ -34,16 +33,17 @@ import {
|
|||||||
toSafeNumber,
|
toSafeNumber,
|
||||||
} from '@/utils';
|
} from '@/utils';
|
||||||
import { Features, CLASSES } from '@/constants';
|
import { Features, CLASSES } from '@/constants';
|
||||||
import adjustmentType from '@/constants/adjustmentType';
|
|
||||||
|
|
||||||
import { useInventoryAdjContext } from './InventoryAdjustmentFormProvider';
|
import { useInventoryAdjContext } from './InventoryAdjustmentFormProvider';
|
||||||
|
import { useFeatureCan } from '@/hooks/state';
|
||||||
|
|
||||||
|
import InventoryAdjustmentQuantityFields from './InventoryAdjustmentQuantityFields';
|
||||||
import {
|
import {
|
||||||
diffQuantity,
|
diffQuantity,
|
||||||
useSetPrimaryBranchToForm,
|
useSetPrimaryBranchToForm,
|
||||||
useSetPrimaryWarehouseToForm,
|
useSetPrimaryWarehouseToForm,
|
||||||
|
useGetAdjustmentTypeOptions,
|
||||||
} from './utils';
|
} from './utils';
|
||||||
import { useFeatureCan } from '@/hooks/state';
|
|
||||||
import InventoryAdjustmentQuantityFields from './InventoryAdjustmentQuantityFields';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Inventory adjustment form dialogs fields.
|
* Inventory adjustment form dialogs fields.
|
||||||
@@ -52,6 +52,9 @@ export default function InventoryAdjustmentFormDialogFields() {
|
|||||||
// Features guard.
|
// Features guard.
|
||||||
const { featureCan } = useFeatureCan();
|
const { featureCan } = useFeatureCan();
|
||||||
|
|
||||||
|
// Retrieves memorized adjustment types options.
|
||||||
|
const adjustmentTypes = useGetAdjustmentTypeOptions();
|
||||||
|
|
||||||
const dateFieldRef = useAutofocus();
|
const dateFieldRef = useAutofocus();
|
||||||
|
|
||||||
// Inventory adjustment dialog context.
|
// Inventory adjustment dialog context.
|
||||||
@@ -90,7 +93,6 @@ export default function InventoryAdjustmentFormDialogFields() {
|
|||||||
<WarehouseSelect
|
<WarehouseSelect
|
||||||
name={'warehouse_id'}
|
name={'warehouse_id'}
|
||||||
warehouses={warehouses}
|
warehouses={warehouses}
|
||||||
input={WarehouseSelectButton}
|
|
||||||
popoverProps={{ minimal: true }}
|
popoverProps={{ minimal: true }}
|
||||||
/>
|
/>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
@@ -149,7 +151,7 @@ export default function InventoryAdjustmentFormDialogFields() {
|
|||||||
className={classNames(CLASSES.FILL, 'form-group--type')}
|
className={classNames(CLASSES.FILL, 'form-group--type')}
|
||||||
>
|
>
|
||||||
<ListSelect
|
<ListSelect
|
||||||
items={adjustmentType}
|
items={adjustmentTypes}
|
||||||
onItemSelect={(type) => {
|
onItemSelect={(type) => {
|
||||||
const result = diffQuantity(
|
const result = diffQuantity(
|
||||||
toSafeNumber(values.quantity),
|
toSafeNumber(values.quantity),
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
import React from 'react';
|
import React, { useMemo } from 'react';
|
||||||
|
import intl from 'react-intl-universal';
|
||||||
import { useFormikContext } from 'formik';
|
import { useFormikContext } from 'formik';
|
||||||
import { useInventoryAdjContext } from './InventoryAdjustmentFormProvider';
|
import { useInventoryAdjContext } from './InventoryAdjustmentFormProvider';
|
||||||
import { first } from 'lodash';
|
import { first } from 'lodash';
|
||||||
@@ -48,3 +49,12 @@ export const useSetPrimaryBranchToForm = () => {
|
|||||||
}
|
}
|
||||||
}, [isBranchesSuccess, setFieldValue, branches]);
|
}, [isBranchesSuccess, setFieldValue, branches]);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getAdjustmentTypeOptions = () => [
|
||||||
|
{ name: intl.get('decrement'), value: 'decrement' },
|
||||||
|
{ name: intl.get('increment'), value: 'increment' },
|
||||||
|
];
|
||||||
|
|
||||||
|
export const useGetAdjustmentTypeOptions = () => {
|
||||||
|
return useMemo(() => getAdjustmentTypeOptions(), []);
|
||||||
|
};
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { useAccount, useAccountTransactions } from '@/hooks/query';
|
import { useAccount, useAccountTransactions } from '@/hooks/query';
|
||||||
import { DrawerHeaderContent, DrawerLoading } from '@/components';
|
import { DrawerHeaderContent, DrawerLoading } from '@/components';
|
||||||
|
import { DRAWERS } from '@/constants/drawers';
|
||||||
|
|
||||||
const AccountDrawerContext = React.createContext();
|
const AccountDrawerContext = React.createContext();
|
||||||
|
|
||||||
@@ -33,7 +34,7 @@ function AccountDrawerProvider({ accountId, name, ...props }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<DrawerLoading loading={isAccountLoading || isAccountsLoading}>
|
<DrawerLoading loading={isAccountLoading || isAccountsLoading}>
|
||||||
<DrawerHeaderContent name={'account-drawer'} title={drawerTitle} />
|
<DrawerHeaderContent name={DRAWERS.ACCOUNT_DETAILS} title={drawerTitle} />
|
||||||
<AccountDrawerContext.Provider value={provider} {...props} />
|
<AccountDrawerContext.Provider value={provider} {...props} />
|
||||||
</DrawerLoading>
|
</DrawerLoading>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ import {
|
|||||||
import { BillMenuItem } from './utils';
|
import { BillMenuItem } from './utils';
|
||||||
|
|
||||||
import { safeCallback, compose } from '@/utils';
|
import { safeCallback, compose } from '@/utils';
|
||||||
|
import { DRAWERS } from '@/constants/drawers';
|
||||||
|
|
||||||
function BillDetailActionsBar({
|
function BillDetailActionsBar({
|
||||||
// #withDialogActions
|
// #withDialogActions
|
||||||
@@ -49,7 +50,7 @@ function BillDetailActionsBar({
|
|||||||
// Handle edit bill.
|
// Handle edit bill.
|
||||||
const onEditBill = () => {
|
const onEditBill = () => {
|
||||||
history.push(`/bills/${billId}/edit`);
|
history.push(`/bills/${billId}/edit`);
|
||||||
closeDrawer('bill-drawer');
|
closeDrawer(DRAWERS.BILL_DETAILS);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Handle convert to vendor credit.
|
// Handle convert to vendor credit.
|
||||||
@@ -57,7 +58,7 @@ function BillDetailActionsBar({
|
|||||||
history.push(`/vendor-credits/new?from_bill_id=${billId}`, {
|
history.push(`/vendor-credits/new?from_bill_id=${billId}`, {
|
||||||
billId: billId,
|
billId: billId,
|
||||||
});
|
});
|
||||||
closeDrawer('bill-drawer');
|
closeDrawer(DRAWERS.BILL_DETAILS);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Handle delete bill.
|
// Handle delete bill.
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import { DrawerHeaderContent, DrawerLoading } from '@/components';
|
|||||||
import { useBill, useBillLocatedLandedCost } from '@/hooks/query';
|
import { useBill, useBillLocatedLandedCost } from '@/hooks/query';
|
||||||
import { useFeatureCan } from '@/hooks/state';
|
import { useFeatureCan } from '@/hooks/state';
|
||||||
import { Features } from '@/constants';
|
import { Features } from '@/constants';
|
||||||
|
import { DRAWERS } from '@/constants/drawers';
|
||||||
|
|
||||||
const BillDrawerContext = React.createContext();
|
const BillDrawerContext = React.createContext();
|
||||||
|
|
||||||
@@ -38,7 +39,7 @@ function BillDrawerProvider({ billId, ...props }) {
|
|||||||
return (
|
return (
|
||||||
<DrawerLoading loading={loading}>
|
<DrawerLoading loading={loading}>
|
||||||
<DrawerHeaderContent
|
<DrawerHeaderContent
|
||||||
name="bill-drawer"
|
name={DRAWERS.BILL_DETAILS}
|
||||||
title={intl.get('bill.drawer.title', {
|
title={intl.get('bill.drawer.title', {
|
||||||
number: bill.bill_number ? `(${bill.bill_number})` : null,
|
number: bill.bill_number ? `(${bill.bill_number})` : null,
|
||||||
})}
|
})}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import withAlertsActions from '@/containers/Alert/withAlertActions';
|
|||||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||||
|
|
||||||
import { compose } from '@/utils';
|
import { compose } from '@/utils';
|
||||||
|
import { DRAWERS } from '@/constants/drawers';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bill payment transactions datatable.
|
* Bill payment transactions datatable.
|
||||||
@@ -48,7 +49,7 @@ function BillPaymentTransactionTable({
|
|||||||
// Handles edit bill payment transactions.
|
// Handles edit bill payment transactions.
|
||||||
const handleEditBillPaymentTransactions = ({ bill_payment_id }) => {
|
const handleEditBillPaymentTransactions = ({ bill_payment_id }) => {
|
||||||
history.push(`/payment-mades/${bill_payment_id}/edit`);
|
history.push(`/payment-mades/${bill_payment_id}/edit`);
|
||||||
closeDrawer('bill-drawer');
|
closeDrawer(DRAWERS.BILL_DETAILS);
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -11,12 +11,12 @@ import { useLocatedLandedCostColumns, ActionsMenu } from './components';
|
|||||||
import { useBillDrawerContext } from './BillDrawerProvider';
|
import { useBillDrawerContext } from './BillDrawerProvider';
|
||||||
|
|
||||||
import withAlertsActions from '@/containers/Alert/withAlertActions';
|
import withAlertsActions from '@/containers/Alert/withAlertActions';
|
||||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
|
||||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||||
|
|
||||||
import { TableStyle } from '@/constants';
|
import { TableStyle } from '@/constants';
|
||||||
|
|
||||||
import { compose } from '@/utils';
|
import { compose } from '@/utils';
|
||||||
|
import { DRAWERS } from '@/constants/drawers';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Located landed cost table.
|
* Located landed cost table.
|
||||||
@@ -25,9 +25,6 @@ function LocatedLandedCostTable({
|
|||||||
// #withAlertsActions
|
// #withAlertsActions
|
||||||
openAlert,
|
openAlert,
|
||||||
|
|
||||||
// #withDialogActions
|
|
||||||
openDialog,
|
|
||||||
|
|
||||||
// #withDrawerActions
|
// #withDrawerActions
|
||||||
openDrawer,
|
openDrawer,
|
||||||
}) {
|
}) {
|
||||||
@@ -48,12 +45,12 @@ function LocatedLandedCostTable({
|
|||||||
|
|
||||||
switch (from_transaction_type) {
|
switch (from_transaction_type) {
|
||||||
case 'Expense':
|
case 'Expense':
|
||||||
openDrawer('expense-drawer', { expenseId: from_transaction_id });
|
openDrawer(DRAWERS.EXPENSE_DETAILS, { expenseId: from_transaction_id });
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'Bill':
|
case 'Bill':
|
||||||
default:
|
default:
|
||||||
openDrawer('bill-drawer', { billId: from_transaction_id });
|
openDrawer(DRAWERS.BILL_DETAILS, { billId: from_transaction_id });
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -79,6 +76,5 @@ function LocatedLandedCostTable({
|
|||||||
|
|
||||||
export default compose(
|
export default compose(
|
||||||
withAlertsActions,
|
withAlertsActions,
|
||||||
withDialogActions,
|
|
||||||
withDrawerActions,
|
withDrawerActions,
|
||||||
)(LocatedLandedCostTable);
|
)(LocatedLandedCostTable);
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import intl from 'react-intl-universal';
|
|||||||
import { useCashflowTransaction } from '@/hooks/query';
|
import { useCashflowTransaction } from '@/hooks/query';
|
||||||
|
|
||||||
import { DrawerLoading, DrawerHeaderContent } from '@/components';
|
import { DrawerLoading, DrawerHeaderContent } from '@/components';
|
||||||
|
import { DRAWERS } from '@/constants/drawers';
|
||||||
|
|
||||||
const CashflowTransactionDrawerContext = React.createContext();
|
const CashflowTransactionDrawerContext = React.createContext();
|
||||||
|
|
||||||
@@ -32,7 +33,7 @@ function CashflowTransactionDrawerProvider({ referenceId, ...props }) {
|
|||||||
return (
|
return (
|
||||||
<DrawerLoading loading={isCashflowTransactionLoading}>
|
<DrawerLoading loading={isCashflowTransactionLoading}>
|
||||||
<DrawerHeaderContent
|
<DrawerHeaderContent
|
||||||
name={'cashflow-transaction-drawer'}
|
name={DRAWERS.CASHFLOW_TRNASACTION_DETAILS}
|
||||||
title={intl.get('cash_flow.drawer.label_transaction', {
|
title={intl.get('cash_flow.drawer.label_transaction', {
|
||||||
number: cashflowTransaction?.transaction_number,
|
number: cashflowTransaction?.transaction_number,
|
||||||
})}
|
})}
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import { CreditNoteAction, AbilitySubject } from '@/constants/abilityOption';
|
|||||||
|
|
||||||
import { compose } from '@/utils';
|
import { compose } from '@/utils';
|
||||||
import { CreditNoteMenuItem } from './utils';
|
import { CreditNoteMenuItem } from './utils';
|
||||||
|
import { DRAWERS } from '@/constants/drawers';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Credit note detail actions bar.
|
* Credit note detail actions bar.
|
||||||
@@ -47,7 +48,7 @@ function CreditNoteDetailActionsBar({
|
|||||||
// Handle edit credit note.
|
// Handle edit credit note.
|
||||||
const handleEditCreditNote = () => {
|
const handleEditCreditNote = () => {
|
||||||
history.push(`/credit-notes/${creditNoteId}/edit`);
|
history.push(`/credit-notes/${creditNoteId}/edit`);
|
||||||
closeDrawer('credit-note-detail-drawer');
|
closeDrawer(DRAWERS.CREDIT_NOTE_DETAILS);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleRefundCreditNote = () => {
|
const handleRefundCreditNote = () => {
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import {
|
|||||||
import { Features } from '@/constants';
|
import { Features } from '@/constants';
|
||||||
import { useFeatureCan } from '@/hooks/state';
|
import { useFeatureCan } from '@/hooks/state';
|
||||||
import { DrawerHeaderContent, DrawerLoading } from '@/components';
|
import { DrawerHeaderContent, DrawerLoading } from '@/components';
|
||||||
|
import { DRAWERS } from '@/constants/drawers';
|
||||||
|
|
||||||
const CreditNoteDetailDrawerContext = React.createContext();
|
const CreditNoteDetailDrawerContext = React.createContext();
|
||||||
|
|
||||||
@@ -72,7 +73,7 @@ function CreditNoteDetailDrawerProvider({ creditNoteId, ...props }) {
|
|||||||
}
|
}
|
||||||
>
|
>
|
||||||
<DrawerHeaderContent
|
<DrawerHeaderContent
|
||||||
name="credit-note-detail-drawer"
|
name={DRAWERS.CREDIT_NOTE_DETAILS}
|
||||||
title={intl.get('credit_note.drawer.title', {
|
title={intl.get('credit_note.drawer.title', {
|
||||||
number: creditNote.credit_note_number,
|
number: creditNote.credit_note_number,
|
||||||
})}
|
})}
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ import {
|
|||||||
CustomerAction,
|
CustomerAction,
|
||||||
} from '@/constants/abilityOption';
|
} from '@/constants/abilityOption';
|
||||||
import { compose } from '@/utils';
|
import { compose } from '@/utils';
|
||||||
|
import { DRAWERS } from '@/constants/drawers';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Customer details actions bar.
|
* Customer details actions bar.
|
||||||
@@ -58,22 +59,22 @@ function CustomerDetailsActionsBar({
|
|||||||
// Handle new invoice button click.
|
// Handle new invoice button click.
|
||||||
const handleNewInvoiceClick = () => {
|
const handleNewInvoiceClick = () => {
|
||||||
history.push('/invoices/new');
|
history.push('/invoices/new');
|
||||||
closeDrawer('customer-detail-drawer');
|
closeDrawer(DRAWERS.CUSTOMER_DETAILS);
|
||||||
};
|
};
|
||||||
// Handle new receipt button click.
|
// Handle new receipt button click.
|
||||||
const handleNewReceiptClick = () => {
|
const handleNewReceiptClick = () => {
|
||||||
history.push('/receipts/new');
|
history.push('/receipts/new');
|
||||||
closeDrawer('customer-detail-drawer');
|
closeDrawer(DRAWERS.CUSTOMER_DETAILS);
|
||||||
};
|
};
|
||||||
// Handle new payment receive button click.
|
// Handle new payment receive button click.
|
||||||
const handleNewPaymentClick = () => {
|
const handleNewPaymentClick = () => {
|
||||||
history.push('/payment-receives/new');
|
history.push('/payment-receives/new');
|
||||||
closeDrawer('customer-detail-drawer');
|
closeDrawer(DRAWERS.CUSTOMER_DETAILS);
|
||||||
};
|
};
|
||||||
// Handle new estimate button click.
|
// Handle new estimate button click.
|
||||||
const handleNewEstimateClick = () => {
|
const handleNewEstimateClick = () => {
|
||||||
history.push('/estimates/new');
|
history.push('/estimates/new');
|
||||||
closeDrawer('customer-detail-drawer');
|
closeDrawer(DRAWERS.CUSTOMER_DETAILS);
|
||||||
};
|
};
|
||||||
// Handles delete customer click.
|
// Handles delete customer click.
|
||||||
const handleDeleteCustomer = () => {
|
const handleDeleteCustomer = () => {
|
||||||
@@ -82,7 +83,7 @@ function CustomerDetailsActionsBar({
|
|||||||
// Handles edit customer click.
|
// Handles edit customer click.
|
||||||
const handleEditContact = () => {
|
const handleEditContact = () => {
|
||||||
history.push(`/customers/${customerId}/edit`);
|
history.push(`/customers/${customerId}/edit`);
|
||||||
closeDrawer('customer-details-drawer');
|
closeDrawer(DRAWERS.CUSTOMER_DETAILS);
|
||||||
};
|
};
|
||||||
// Handle edit opening balance click.
|
// Handle edit opening balance click.
|
||||||
const handleEditOpeningBalance = () => {
|
const handleEditOpeningBalance = () => {
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user