diff --git a/.env.development b/.env.development
index 8f5856db..de583d09 100644
--- a/.env.development
+++ b/.env.development
@@ -3,12 +3,3 @@ ENV = 'development'
# base api
VUE_APP_BASE_API = '/dev-api'
-
-# vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
-# to control whether the babel-plugin-dynamic-import-node plugin is enabled.
-# It only does one thing by converting all import() to require().
-# This configuration can significantly increase the speed of hot updates,
-# when you have a large number of pages.
-# Detail: https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/babel-preset-app/index.js
-
-VUE_CLI_BABEL_TRANSPILE_MODULES = true
diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md
index 0f4f8d28..f31e4c8f 100755
--- a/.github/ISSUE_TEMPLATE/question.md
+++ b/.github/ISSUE_TEMPLATE/question.md
@@ -19,8 +19,10 @@ Asking questions about use
#### Steps to reproduce
1. [xxx]
+
#### Screenshot or Gif
@@ -33,6 +35,7 @@ Please only use Codepen, JSFiddle, CodeSandbox or a github repo
#### Other relevant information
- Your OS:
+- Web Browser:
- Node.js version:
- vue-element-admin version:
diff --git a/README.es.md b/README.es.md
index f3fb1190..413d5d44 100644
--- a/README.es.md
+++ b/README.es.md
@@ -74,7 +74,7 @@ Sea un patrocinante y coloque su logo en nuestro LEEME en GitHub con un enlace d
```
- Iniciar / Cerrar Sesión
-- Permisos de Authentication
+- Permisos de Autenticación
- Permisos basado en ADempiere
- Página de Permisos
- Directivas de permisos
@@ -82,18 +82,21 @@ Sea un patrocinante y coloque su logo en nuestro LEEME en GitHub con un enlace d
- Autenticación por dos pasos
- Construcción Multi-entorno
- - dev sit stage producción
+ - Desarrollo (dev)
+ - sit
+ - Escenario de pruebas (stage),
+ - Producción (prod)
- Características Globales
- I18n
- Temas dinámicos
- - Dynamic sidebar (soporte a rutas multi-nivel)
+ - Menu lateral dinámico (soporte a rutas multi-nivel)
- Barra de rutas dinámica
- - Tags-view (Tab page Support right-click operation)
+ - Tags-view (Pestañas de página, Soporta operación de clic derecho)
- Svg Sprite
- Datos de simulación con Mock
- Pantalla completa
- - Responsive Sidebar
+ - Menu lateral responsivo
- Editor
- Editor de Texto Enriquecido
@@ -104,7 +107,7 @@ Sea un patrocinante y coloque su logo en nuestro LEEME en GitHub con un enlace d
- Exportación a Excel
- Carga de Excel
- Visualización de Excel
- - Exportación como zip
+ - Exportación como ZIP
- Tabla
- Tabla Dinámica
@@ -139,7 +142,7 @@ Sea un patrocinante y coloque su logo en nuestro LEEME en GitHub con un enlace d
- Página de Guías
- ECharts (Gráficos)
- Portapapeles
-- Convertidor de Markdown a html
+- Convertidor de Markdown a HTML
```
## Iniciando
@@ -210,7 +213,7 @@ Navegadores modernos e Internet Explorer 10+.
| [
](https://godban.github.io/browsers-support-badges/)IE / Edge | [
](https://godban.github.io/browsers-support-badges/)Firefox | [
](https://godban.github.io/browsers-support-badges/)Chrome | [
](https://godban.github.io/browsers-support-badges/)Safari |
| --------- | --------- | --------- | --------- |
-| IE10, IE11, Edge| últimas 2 versiones| últimas 2 versiones| últimas 2 versiones
+| IE10, IE11, Edge | últimas 2 versiones | últimas 2 versiones | últimas 2 versiones |
## Licencia
diff --git a/README.md b/README.md
index 4d4d4bf6..bc865155 100644
--- a/README.md
+++ b/README.md
@@ -56,7 +56,7 @@ Understanding and learning this knowledge in advance will greatly help the use o
[](https://codesandbox.io/s/github/PanJiaChen/vue-element-admin/tree/CodeSandbox)
-
+
@@ -83,7 +83,10 @@ Become a sponsor and get your logo on our README on GitHub with a link to your s
- Permission configuration page
- Multi-environment build
- - dev sit stage prod
+ - Develop (dev)
+ - sit
+ - Stage Test (stage)
+ - Production (prod)
- Global Features
- I18n
@@ -209,7 +212,7 @@ Modern browsers and Internet Explorer 10+.
| [
](https://godban.github.io/browsers-support-badges/)IE / Edge | [
](https://godban.github.io/browsers-support-badges/)Firefox | [
](https://godban.github.io/browsers-support-badges/)Chrome | [
](https://godban.github.io/browsers-support-badges/)Safari |
| --------- | --------- | --------- | --------- |
-| IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions
+| IE10, IE11, Edge | last 2 versions | last 2 versions | last 2 versions |
## License
diff --git a/babel.config.js b/babel.config.js
index ba179669..fb82b271 100644
--- a/babel.config.js
+++ b/babel.config.js
@@ -1,5 +1,14 @@
module.exports = {
presets: [
- '@vue/app'
- ]
+ // https://github.com/vuejs/vue-cli/tree/master/packages/@vue/babel-preset-app
+ '@vue/cli-plugin-babel/preset'
+ ],
+ 'env': {
+ 'development': {
+ // babel-plugin-dynamic-import-node plugin only does one thing by converting all import() to require().
+ // This plugin can significantly increase the speed of hot updates, when you have a large number of pages.
+ // https://panjiachen.github.io/vue-element-admin-site/guide/advanced/lazy-loading.html
+ 'plugins': ['dynamic-import-node']
+ }
+ }
}
diff --git a/mock/article.js b/mock/article.js
index 50218ae4..23d8ba51 100644
--- a/mock/article.js
+++ b/mock/article.js
@@ -1,4 +1,4 @@
-import Mock from 'mockjs'
+const Mock = require('mockjs')
const List = []
const count = 100
@@ -27,7 +27,7 @@ for (let i = 0; i < count; i++) {
}))
}
-export default [
+module.exports = [
{
url: '/vue-element-admin/article/list',
type: 'get',
diff --git a/mock/index.js b/mock/index.js
index 196e2927..2eed65db 100644
--- a/mock/index.js
+++ b/mock/index.js
@@ -1,10 +1,10 @@
-import Mock from 'mockjs'
-import { param2Obj } from '../src/utils'
+const Mock = require('mockjs')
+const { param2Obj } = require('./utils')
-import user from './user'
-import role from './role'
-import article from './article'
-import search from './remote-search'
+const user = require('./user')
+const role = require('./role')
+const article = require('./article')
+const search = require('./remote-search')
const mocks = [
...user,
@@ -16,7 +16,7 @@ const mocks = [
// for front mock
// please use it cautiously, it will redefine XMLHttpRequest,
// which will cause many of your third-party libraries to be invalidated(like progress event).
-export function mockXHR() {
+function mockXHR() {
// mock patch
// https://github.com/nuysoft/Mock/issues/300
Mock.XHR.prototype.proxy_send = Mock.XHR.prototype.send
@@ -54,4 +54,7 @@ export function mockXHR() {
}
}
-export default mocks
+module.exports = {
+ mocks,
+ mockXHR
+}
diff --git a/mock/mock-server.js b/mock/mock-server.js
index 806fdacc..8941ec0f 100644
--- a/mock/mock-server.js
+++ b/mock/mock-server.js
@@ -8,7 +8,7 @@ const mockDir = path.join(process.cwd(), 'mock')
function registerRoutes(app) {
let mockLastIndex
- const { default: mocks } = require('./index.js')
+ const { mocks } = require('./index.js')
const mocksForServer = mocks.map(route => {
return responseFake(route.url, route.type, route.response)
})
@@ -44,9 +44,6 @@ const responseFake = (url, type, respond) => {
}
module.exports = app => {
- // es6 polyfill
- require('@babel/register')
-
// parse app.body
// https://expressjs.com/en/4x/api.html#req.body
app.use(bodyParser.json())
diff --git a/mock/remote-search.js b/mock/remote-search.js
index 60809cb8..8fc49267 100644
--- a/mock/remote-search.js
+++ b/mock/remote-search.js
@@ -1,4 +1,4 @@
-import Mock from 'mockjs'
+const Mock = require('mockjs')
const NameList = []
const count = 100
@@ -10,7 +10,7 @@ for (let i = 0; i < count; i++) {
}
NameList.push({ name: 'mock-Pan' })
-export default [
+module.exports = [
// username search
{
url: '/vue-element-admin/search/user',
diff --git a/mock/role/index.js b/mock/role/index.js
index d957493b..4643f006 100644
--- a/mock/role/index.js
+++ b/mock/role/index.js
@@ -1,6 +1,6 @@
-import Mock from 'mockjs'
-import { deepClone } from '../../src/utils/index.js'
-import { asyncRoutes, constantRoutes } from './routes.js'
+const Mock = require('mockjs')
+const { deepClone } = require('../utils')
+const { asyncRoutes, constantRoutes } = require('./routes.js')
const routes = deepClone([...constantRoutes, ...asyncRoutes])
@@ -35,7 +35,7 @@ const roles = [
}
]
-export default [
+module.exports = [
// mock get all routes form server
{
url: '/vue-element-admin/routes',
diff --git a/mock/role/routes.js b/mock/role/routes.js
index d718919c..d33f1624 100644
--- a/mock/role/routes.js
+++ b/mock/role/routes.js
@@ -1,6 +1,6 @@
// Just a mock data
-export const constantRoutes = [
+const constantRoutes = [
{
path: '/redirect',
component: 'layout/Layout',
@@ -72,7 +72,7 @@ export const constantRoutes = [
}
]
-export const asyncRoutes = [
+const asyncRoutes = [
{
path: '/permission',
component: 'layout/Layout',
@@ -523,3 +523,8 @@ export const asyncRoutes = [
{ path: '*', redirect: '/404', hidden: true }
]
+
+module.exports = {
+ constantRoutes,
+ asyncRoutes
+}
diff --git a/mock/user.js b/mock/user.js
index 859bd6f3..d82e079d 100644
--- a/mock/user.js
+++ b/mock/user.js
@@ -23,7 +23,7 @@ const users = {
}
}
-export default [
+module.exports = [
// user login
{
url: '/vue-element-admin/user/login',
diff --git a/mock/utils.js b/mock/utils.js
new file mode 100644
index 00000000..f909a293
--- /dev/null
+++ b/mock/utils.js
@@ -0,0 +1,48 @@
+/**
+ * @param {string} url
+ * @returns {Object}
+ */
+function param2Obj(url) {
+ const search = decodeURIComponent(url.split('?')[1]).replace(/\+/g, ' ')
+ if (!search) {
+ return {}
+ }
+ const obj = {}
+ const searchArr = search.split('&')
+ searchArr.forEach(v => {
+ const index = v.indexOf('=')
+ if (index !== -1) {
+ const name = v.substring(0, index)
+ const val = v.substring(index + 1, v.length)
+ obj[name] = val
+ }
+ })
+ return obj
+}
+
+/**
+ * This is just a simple version of deep copy
+ * Has a lot of edge cases bug
+ * If you want to use a perfect deep copy, use lodash's _.cloneDeep
+ * @param {Object} source
+ * @returns {Object}
+ */
+function deepClone(source) {
+ if (!source && typeof source !== 'object') {
+ throw new Error('error arguments', 'deepClone')
+ }
+ const targetObj = source.constructor === Array ? [] : {}
+ Object.keys(source).forEach(keys => {
+ if (source[keys] && typeof source[keys] === 'object') {
+ targetObj[keys] = deepClone(source[keys])
+ } else {
+ targetObj[keys] = source[keys]
+ }
+ })
+ return targetObj
+}
+
+module.exports = {
+ param2Obj,
+ deepClone
+}
diff --git a/package.json b/package.json
index 7d656e8d..e76028fd 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "adempiere-vue",
- "version": "4.2.1",
+ "version": "4.3.1",
"description": "A magical vue admin. An out-of-box UI solution for enterprise applications. Newest development stack of vue. Lots of awesome features",
"author": "Pan ",
"contributors": [
@@ -9,29 +9,101 @@
"url": "https://github.com/EdwinBetanc0urt/"
}
],
- "license": "GPL-3.0-or-later",
"scripts": {
"start": "vue-cli-service serve",
"dev": "vue-cli-service serve",
+ "lint": "eslint --ext .js,.vue src",
"build:prod": "vue-cli-service build",
"build:stage": "vue-cli-service build --mode staging",
"preview": "node build/index.js --preview",
- "lint": "eslint --ext .js,.vue src",
- "test:unit": "jest --clearCache && vue-cli-service test:unit",
- "test:ci": "npm run lint && npm run test:unit",
+ "new": "plop",
"svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml",
- "new": "plop"
+ "test:unit": "jest --clearCache && vue-cli-service test:unit",
+ "test:ci": "npm run lint && npm run test:unit"
},
- "husky": {
- "hooks": {
- "pre-commit": "lint-staged"
- }
+ "dependencies": {
+ "@adempiere/grpc-access-client": "^1.2.3",
+ "@adempiere/grpc-core-client": "^1.2.3",
+ "@adempiere/grpc-data-client": "^2.4.9",
+ "@adempiere/grpc-dictionary-client": "^1.4.5",
+ "@adempiere/grpc-enrollment-client": "^1.1.2",
+ "@adempiere/grpc-pos-client": "^1.4.1",
+ "axios": "0.19.2",
+ "clipboard": "2.0.6",
+ "codemirror": "5.56.0",
+ "core-js": "3.6.5",
+ "driver.js": "0.9.8",
+ "dropzone": "5.7.2",
+ "echarts": "4.8.0",
+ "element-ui": "2.13.2",
+ "file-saver": "2.0.2",
+ "fuse.js": "3.4.4",
+ "js-cookie": "2.2.1",
+ "jsonlint": "1.6.3",
+ "jszip": "3.5.0",
+ "moment": "^2.27.0",
+ "normalize.css": "8.0.1",
+ "nprogress": "0.2.0",
+ "path-to-regexp": "2.4.0",
+ "pinyin": "2.9.1",
+ "screenfull": "5.0.2",
+ "script-loader": "0.7.2",
+ "sortablejs": "1.10.2",
+ "tui-editor": "1.4.10",
+ "v-markdown": "^1.0.2",
+ "vue": "2.6.11",
+ "vue-content-loading": "^1.6.0",
+ "vue-count-to": "1.0.13",
+ "vue-i18n": "8.19.0",
+ "vue-multipane": "^0.9.5",
+ "vue-resize": "^0.5.0",
+ "vue-router": "3.3.4",
+ "vue-shortkey": "^3.1.7",
+ "vue-split-panel": "^1.0.4",
+ "vue-splitpane": "1.0.6",
+ "vuedraggable": "^2.24.0",
+ "vuex": "3.5.1",
+ "xlsx": "0.16.4"
},
- "lint-staged": {
- "src/**/*.{js,vue}": [
- "eslint --fix",
- "git add"
- ]
+ "devDependencies": {
+ "@vue/cli-plugin-babel": "4.4.6",
+ "@vue/cli-plugin-eslint": "4.4.6",
+ "@vue/cli-plugin-unit-jest": "4.4.6",
+ "@vue/cli-service": "4.4.6",
+ "@vue/test-utils": "1.0.3",
+ "autoprefixer": "9.8.5",
+ "babel-eslint": "10.1.0",
+ "babel-jest": "26.1.0",
+ "babel-plugin-dynamic-import-node": "2.3.3",
+ "chalk": "4.1.0",
+ "chokidar": "3.4.1",
+ "connect": "3.7.0",
+ "eslint": "7.5.0",
+ "eslint-plugin-vue": "6.2.2",
+ "html-webpack-plugin": "4.3.0",
+ "husky": "4.2.5",
+ "lint-staged": "10.2.11",
+ "mockjs": "1.1.0",
+ "plop": "2.7.3",
+ "runjs": "4.4.2",
+ "sass": "1.26.10",
+ "sass-loader": "8.0.2",
+ "script-ext-html-webpack-plugin": "2.1.4",
+ "serve-static": "1.14.1",
+ "svg-sprite-loader": "5.0.0",
+ "svgo": "1.3.2",
+ "vue-template-compiler": "2.6.11"
+ },
+ "browserslist": [
+ "> 1%",
+ "last 2 versions"
+ ],
+ "bugs": {
+ "url": "https://github.com/PanJiaChen/vue-element-admin/issues"
+ },
+ "engines": {
+ "node": ">=8.9",
+ "npm": ">= 3.0.0"
},
"keywords": [
"vue",
@@ -42,95 +114,20 @@
"admin-template",
"management-system"
],
+ "license": "GPL-3.0-or-later",
+ "lint-staged": {
+ "src/**/*.{js,vue}": [
+ "eslint --fix",
+ "git add"
+ ]
+ },
+ "husky": {
+ "hooks": {
+ "pre-commit": "lint-staged"
+ }
+ },
"repository": {
"type": "git",
"url": "git+https://github.com/PanJiaChen/vue-element-admin.git"
- },
- "bugs": {
- "url": "https://github.com/PanJiaChen/vue-element-admin/issues"
- },
- "dependencies": {
- "@adempiere/grpc-access-client": "^1.2.2",
- "@adempiere/grpc-core-client": "^1.1.8",
- "@adempiere/grpc-data-client": "^2.4.6",
- "@adempiere/grpc-dictionary-client": "^1.4.4",
- "@adempiere/grpc-enrollment-client": "^1.1.1",
- "@adempiere/grpc-pos-client": "^1.3.4",
- "axios": "0.19.2",
- "clipboard": "2.0.6",
- "codemirror": "5.53.2",
- "core-js": "^3.6.5",
- "driver.js": "0.9.8",
- "dropzone": "5.7.0",
- "echarts": "4.7.0",
- "element-ui": "2.13.2",
- "file-saver": "2.0.2",
- "fuse.js": "3.4.4",
- "js-cookie": "2.2.1",
- "jsonlint": "1.6.3",
- "jszip": "3.4.0",
- "mime-type": "^3.0.7",
- "moment": "^2.24.0",
- "normalize.css": "8.0.1",
- "nprogress": "0.2.0",
- "path-to-regexp": "2.4.0",
- "pinyin": "2.9.0",
- "screenfull": "5.0.2",
- "script-loader": "0.7.2",
- "showdown": "1.9.1",
- "sortablejs": "1.10.2",
- "tui-editor": "1.4.10",
- "v-markdown": "^1.0.2",
- "vue": "2.6.11",
- "vue-count-to": "1.0.13",
- "vue-i18n": "8.17.4",
- "vue-multipane": "^0.9.5",
- "vue-resize": "^0.5.0",
- "vue-router": "3.3.2",
- "vue-shortkey": "^3.1.7",
- "vue-split-panel": "^1.0.4",
- "vue-splitpane": "1.0.6",
- "vuedraggable": "^2.23.2",
- "vuex": "3.4.0",
- "xlsx": "0.15.6"
- },
- "devDependencies": {
- "@babel/core": "7.9.0",
- "@babel/register": "7.9.0",
- "@vue/cli-plugin-babel": "4.3.1",
- "@vue/cli-plugin-eslint": "4.3.1",
- "@vue/cli-plugin-unit-jest": "^4.3.1",
- "@vue/cli-service": "4.3.1",
- "@vue/test-utils": "1.0.0-beta.33",
- "autoprefixer": "^9.7.6",
- "babel-core": "7.0.0-bridge.0",
- "babel-eslint": "^10.1.0",
- "babel-jest": "^25.5.1",
- "chalk": "4.0.0",
- "chokidar": "3.4.0",
- "connect": "3.7.0",
- "eslint": "^6.8.0",
- "eslint-plugin-vue": "6.2.2",
- "html-webpack-plugin": "4.2.1",
- "husky": "^4.2.5",
- "lint-staged": "10.2.0",
- "mockjs": "1.1.0",
- "node-sass": "^4.14.0",
- "plop": "2.6.0",
- "runjs": "^4.4.2",
- "sass-loader": "^8.0.2",
- "script-ext-html-webpack-plugin": "2.1.4",
- "serve-static": "^1.14.1",
- "svg-sprite-loader": "4.2.7",
- "svgo": "1.3.2",
- "vue-template-compiler": "2.6.11"
- },
- "engines": {
- "node": ">=8.9",
- "npm": ">= 3.0.0"
- },
- "browserslist": [
- "> 1%",
- "last 2 versions"
- ]
+ }
}
diff --git a/plop-templates/utils.js b/plop-templates/utils.js
index 0310ca02..04987539 100644
--- a/plop-templates/utils.js
+++ b/plop-templates/utils.js
@@ -1,9 +1,2 @@
-exports.notEmpty = name => {
- return v => {
- if (!v || v.trim === '') {
- return `${name} is required`
- } else {
- return true
- }
- }
-}
+exports.notEmpty = name => v =>
+ !v || v.trim() === '' ? `${name} is required` : true
diff --git a/src/api/ADempiere/field/location.js b/src/api/ADempiere/field/location.js
new file mode 100644
index 00000000..82291df9
--- /dev/null
+++ b/src/api/ADempiere/field/location.js
@@ -0,0 +1,57 @@
+const tableName = 'C_Location'
+
+/**
+ * Create a location and return the created entity
+ * @param {array} attributes
+ */
+export function requestCreateLocationAddress({
+ attributes
+}) {
+ const { createEntity } = require('@/api/ADempiere/persistence.js')
+
+ return createEntity({
+ tableName,
+ attributes,
+ formatReturn: 'object'
+ })
+}
+
+/**
+ * Get location entity by identifier
+ * @param {number} id as C_Location_ID
+ * @param {string} uuid
+ */
+export function requestGetLocationAddress({
+ id,
+ uuid
+}) {
+ const { getEntity } = require('@/api/ADempiere/persistence.js')
+
+ return getEntity({
+ tableName,
+ recordId: id,
+ recordUuid: uuid
+ })
+}
+
+/**
+ * Update an existing location by id or uuid
+ * @param {number} id as C_Location_ID
+ * @param {string} uuid
+ * @param {array} attributes, all attributes (including empty values)
+ */
+export function requestUpdateLocationAddress({
+ id,
+ uuid,
+ attributes
+}) {
+ const { updateEntity } = require('@/api/ADempiere/persistence.js')
+
+ return updateEntity({
+ tableName,
+ recordId: id,
+ recordUuid: uuid,
+ attributes,
+ formatReturn: 'object'
+ })
+}
diff --git a/src/api/ADempiere/form/point-of-sales.js b/src/api/ADempiere/form/point-of-sales.js
new file mode 100644
index 00000000..13282a22
--- /dev/null
+++ b/src/api/ADempiere/form/point-of-sales.js
@@ -0,0 +1,261 @@
+import { POSInstance as Instance } from '@/api/ADempiere/instances.js'
+import Criteria from '@/utils/ADempiere/criteria.js'
+
+/**
+ * method in price-checking.js as getProductPrice
+ */
+export { getProductPrice as findProduct } from '@/api/ADempiere/form/price-checking.js'
+
+// List Point of sales
+export function requestlistPointOfSales({
+ userUuid,
+ pageSize,
+ pageToken
+}) {
+ return Instance.call(this).listPointOfSales({
+ userUuid,
+ pageSize,
+ pageToken
+ })
+}
+
+// Create order from POS
+export function createOrder({
+ posUuid,
+ customerUuid,
+ documentTypeUuid
+}) {
+ return Instance.call(this).createOrder({
+ posUuid,
+ customerUuid,
+ documentTypeUuid
+ })
+}
+
+// Update order from POS
+export function updateOrder({
+ orderUuid,
+ posUuid,
+ customerUuid,
+ description
+}) {
+ return Instance.call(this).updateOrder({
+ orderUuid,
+ posUuid,
+ customerUuid,
+ description
+ })
+}
+
+// Create order line from order uuid and product
+export function createOrderLine({
+ orderUuid,
+ warehouseUuid,
+ productUuid,
+ chargeUuid,
+ description,
+ quantity,
+ price,
+ discountRate
+}) {
+ return Instance.call(this).createOrderLine({
+ orderUuid,
+ warehouseUuid,
+ productUuid,
+ chargeUuid,
+ description,
+ quantity,
+ price,
+ discountRate
+ })
+}
+
+// Create order line from order uuid and product
+export function getOrder(orderUuid) {
+ return Instance.call(this).getOrder({ orderUuid })
+}
+
+// List orders from pos uuid
+export function requestListOrders({
+ posUuid,
+ documentNo,
+ businessPartnerUuid,
+ grandTotal,
+ openAmount,
+ isPaid,
+ isProcessed,
+ isAisleSeller,
+ isInvoiced,
+ dateOrderedFrom,
+ dateOrderedTo,
+ salesRepresentativeUuid,
+ pageSize,
+ pageToken
+}) {
+ const criteria = new Criteria({ tableName: 'C_Order' })
+
+ /*
+ criteria.addCondition({
+ columnName: 'DocumentNo',
+ value: documentNo
+ }).addCondition({
+ columnName: 'C_BPartner_ID_UUID',
+ value: businessPartnerUuid
+ }).addCondition({
+ columnName: 'GrandTotal',
+ value: grandTotal
+ }).addCondition({
+ columnName: 'OpenAmt',
+ value: openAmount
+ }).addCondition({
+ columnName: 'IsPaid',
+ value: isPaid
+ }).addCondition({
+ columnName: 'Processed',
+ value: isProcessed
+ }).addCondition({
+ columnName: 'IsAisleSeller',
+ value: isAisleSeller
+ }).addCondition({
+ columnName: 'IsInvoiced',
+ value: isInvoiced
+ }).addCondition({
+ columnName: 'DateOrderedFrom',
+ value: dateOrderedFrom
+ }).addCondition({
+ columnName: 'DateOrderedTo',
+ value: dateOrderedTo
+ }).addCondition({
+ columnName: 'SalesRep_ID_UUID',
+ value: salesRepresentativeId
+ })
+ */
+
+ return Instance.call(this).listOrders({
+ posUuid,
+ documentNo,
+ businessPartnerUuid,
+ grandTotal,
+ openAmount,
+ isPaid,
+ isProcessed,
+ isAisleSeller,
+ isInvoiced,
+ dateOrderedFrom,
+ dateOrderedTo,
+ salesRepresentativeUuid,
+ criteria: criteria.getCriteria(),
+ pageSize,
+ pageToken
+ })
+}
+
+// updateOrderLine orders from pos uuid
+export function updateOrderLine({
+ orderLineUuid,
+ description,
+ quantity,
+ price,
+ discountRate
+}) {
+ return Instance.call(this).updateOrderLine({
+ orderLineUuid,
+ description,
+ quantity,
+ price,
+ discountRate
+ })
+}
+
+// delete Order Line
+export function deleteOrderLine({
+ orderLineUuid
+}) {
+ return Instance.call(this).deleteOrderLine({
+ orderLineUuid
+ })
+}
+
+export function listOrderLines({
+ orderUuid
+}) {
+ return Instance.call(this).listOrderLines({
+ orderUuid
+ })
+}
+
+export function getKeyLayout({ keyLayoutUuid }) {
+ return Instance.call(this).getKeyLayout({
+ keyLayoutUuid
+ })
+}
+
+// ListProductPrice
+export function requestListProductPrice({
+ searchValue,
+ priceListUuid,
+ businessPartnerUuid,
+ warehouseUuid,
+ validFrom,
+ // Query
+ criteria,
+ pageSize,
+ pageToken
+}) {
+ return Instance.call(this).requestListProductPrice({
+ searchValue,
+ priceListUuid,
+ businessPartnerUuid,
+ warehouseUuid,
+ validFrom,
+ // Query
+ criteria,
+ pageSize,
+ pageToken
+ })
+}
+
+export function requestPrintOrder({
+ orderUuid
+}) {
+ console.info(`Print order ${orderUuid}`)
+}
+
+export function requestGenerateImmediateInvoice({
+ posId,
+ posUuid
+}) {
+ console.info(`Generate imediate invoice with POS id ${posId}, and uuid ${posUuid}`)
+}
+
+export function requestCompletePreparedOrder({
+ orderUuid
+}) {
+ console.info(`Complete prepared order ${orderUuid}`)
+}
+
+export function requestReverseSalesTransaction({
+ orderUuid
+}) {
+ console.info(`Reverse sales transaction ${orderUuid}`)
+}
+
+export function requestCreateWithdrawal({
+ posId,
+ posUuid
+}) {
+ console.info(`Withdrall cash with POS id ${posId}, and uuid ${posUuid}`)
+}
+
+export function requestCreateNewCustomerReturnOrder({
+ orderUuid
+}) {
+ console.info(`New Customer Return Order ${orderUuid}`)
+}
+
+export function requestCashClosing({
+ posId,
+ posUuid
+}) {
+ console.info(`Cash closing with POS id ${posId}, and uuid ${posUuid}`)
+}
diff --git a/src/api/ADempiere/persistence.js b/src/api/ADempiere/persistence.js
index 9bb0e890..b0ba7752 100644
--- a/src/api/ADempiere/persistence.js
+++ b/src/api/ADempiere/persistence.js
@@ -6,10 +6,15 @@ import { BusinessDataInstance as Instance } from '@/api/ADempiere/instances.js'
* @param {string} tableName
* @param {array} attributesList
*/
-export function createEntity({ tableName, attributes }) {
+export function createEntity({
+ tableName,
+ attributes,
+ formatReturn = 'array'
+}) {
return Instance.call(this).requestCreateEntity({
tableName,
- attributesList: attributes
+ attributesList: attributes,
+ formatToConvert: formatReturn
})
}
@@ -20,12 +25,19 @@ export function createEntity({ tableName, attributes }) {
* @param {string} recordUuid
* @param {array} attributesList
*/
-export function updateEntity({ tableName, recordId, recordUuid, attributes }) {
+export function updateEntity({
+ tableName,
+ recordId,
+ recordUuid,
+ attributes,
+ formatReturn = 'array'
+}) {
return Instance.call(this).requestUpdateEntity({
tableName,
recordId,
recordUuid,
- attributesList: attributes
+ attributesList: attributes,
+ formatToConvert: formatReturn
})
}
@@ -104,7 +116,7 @@ export function getEntitiesList({
* @param {string} tableName
* @param {string} language
* @param {string} recordUuid
- * @param {integer} recordId
+ * @param {number} recordId
*/
export function requestTranslations({ tableName, language, recordUuid, recordId, pageToken, pageSize }) {
return Instance.call(this).requestListTranslations({
@@ -116,3 +128,20 @@ export function requestTranslations({ tableName, language, recordUuid, recordId,
pageSize
})
}
+
+// Download a resource from file name
+export function getResource({ resourceUuid }, callBack = {
+ onData: () => {},
+ onStatus: () => {},
+ onEnd: () => {}
+}) {
+ const stream = Instance.call(this).getResource({
+ resourceUuid
+ })
+
+ stream.on('data', (response) => callBack.onData(response))
+ stream.on('status', (status) => callBack.onStatus(status))
+ stream.on('end', (end) => callBack.onEnd(end))
+
+ return stream
+}
diff --git a/src/api/ADempiere/system-core.js b/src/api/ADempiere/system-core.js
index 0cff82bf..e425addd 100644
--- a/src/api/ADempiere/system-core.js
+++ b/src/api/ADempiere/system-core.js
@@ -43,11 +43,15 @@ export function getWarehousesList({
})
}
-// Get Country definition from server using id or uuid for record
-export function getCountryDefinition({ countryUuid, countryId }) {
+/**
+ * Get Country definition from server using id or uuid for record
+ * @param {string} uuid
+ * @param {number} id
+ */
+export function getCountryDefinition({ uuid, id }) {
return SystemCoreInstance.call(this).requestGetCountry({
- countryUuid,
- countryId
+ uuid,
+ id
})
}
@@ -55,3 +59,91 @@ export function getCountryDefinition({ countryUuid, countryId }) {
export function listLanguages({ pageToken, pageSize }) {
return Instance.call(this).requestListLanguages({ pageToken, pageSize })
}
+
+export function requestCreateBusinessPartner({
+ value,
+ taxId,
+ duns,
+ naics,
+ name,
+ lastName,
+ description,
+ contactName,
+ eMail,
+ phone,
+ businessPartnerGroupUuid,
+ // Location
+ address1,
+ address2,
+ address3,
+ address4,
+ cityUuid,
+ cityName,
+ postalCode,
+ regionUuid,
+ regionName,
+ countryUuid,
+ posUuid
+}) {
+ return SystemCoreInstance.call(this).requestCreateBusinessPartner({
+ value,
+ taxId,
+ duns,
+ naics,
+ name,
+ lastName,
+ description,
+ contactName,
+ eMail,
+ phone,
+ businessPartnerGroupUuid,
+ // Location
+ address1,
+ address2,
+ address3,
+ address4,
+ cityUuid,
+ cityName,
+ postalCode,
+ regionUuid,
+ regionName,
+ countryUuid,
+ posUuid
+ })
+}
+
+export function requestGetBusinessPartner({
+ searchValue
+}) {
+ return SystemCoreInstance.call(this).requestGetBusinessPartner({
+ searchValue
+ })
+}
+
+export function requestListBusinessPartner({
+ searchValue,
+ value,
+ name,
+ contactName,
+ eMail,
+ postalCode,
+ phone,
+ // Query
+ criteria,
+ pageSize,
+ pageToken
+}) {
+ return SystemCoreInstance.call(this).requestListBusinessPartner({
+ searchValue,
+ value,
+ name,
+ contactName,
+ eMail,
+ postalCode,
+ phone,
+ // Query
+ criteria,
+ pageSize,
+ pageToken
+ })
+}
diff --git a/src/api/user.js b/src/api/user.js
index a5ba3956..a0970318 100644
--- a/src/api/user.js
+++ b/src/api/user.js
@@ -13,12 +13,11 @@ export function login({
userPass,
role
})
- } else {
- return Instance.call(this).requestLoginDefault({
- userName,
- userPass
- })
}
+ return Instance.call(this).requestLoginDefault({
+ userName,
+ userPass
+ })
}
// Get User Info from session Uuid or token
@@ -39,11 +38,6 @@ export function logout(sessionUuid) {
return Instance.call(this).requestLogOut(sessionUuid)
}
-// Get User menu from server
-export function getMenu(sessionUuid) {
- return Instance.call(this).requestUserMenuFromSession(sessionUuid)
-}
-
/**
*
* @param {string} attributes.sessionUuid
@@ -51,6 +45,10 @@ export function getMenu(sessionUuid) {
* @param {string} attributes.organizationUuid
* @param {string} attributes.warehouseUuid
*/
+// Get User menu from server
+export function getMenu(sessionUuid) {
+ return Instance.call(this).requestUserMenuFromSession(sessionUuid)
+}
export function changeRole(attributes) {
return Instance.call(this).requestChangeRole(attributes)
}
diff --git a/src/components/ADempiere/Badge/index.vue b/src/components/ADempiere/Badge/index.vue
index b32b878a..fb61baeb 100644
--- a/src/components/ADempiere/Badge/index.vue
+++ b/src/components/ADempiere/Badge/index.vue
@@ -44,6 +44,7 @@
+
+
+
+
+
+
+
diff --git a/src/components/ADempiere/ContextMenu/contextMenuDesktop.vue b/src/components/ADempiere/ContextMenu/contextMenuDesktop.vue
index 8beba7bb..18dae85e 100644
--- a/src/components/ADempiere/ContextMenu/contextMenuDesktop.vue
+++ b/src/components/ADempiere/ContextMenu/contextMenuDesktop.vue
@@ -2,7 +2,7 @@