Compare commits

..

131 Commits

Author SHA1 Message Date
William Buezas 2176c6e259 Fix ticket print 2024-09-12 11:47:05 -03:00
William Buezas 533c7560dc Confirm view adjustments 2024-09-12 09:58:45 -03:00
William Buezas c4a64bff91 hide table aspect in invoices view 2024-09-12 09:19:17 -03:00
William Buezas 3c71c71df1 remove console.log 2024-09-12 08:14:32 -03:00
William Buezas e76e4e4f8c Add prop 2024-09-11 15:12:26 -03:00
William Buezas f95a8c9daa Resolve conflicts 2024-09-11 15:10:54 -03:00
Javier Segarra facb565d26 Merge pull request 'Unload order when order check fails' (!83) from wbuezas/hedera-web-mindshore:feature/UnloadOrder into 4922-vueMigration
Reviewed-on: #83
2024-09-11 06:30:03 +00:00
Javier Segarra a7edc9b87a Merge branch '4922-vueMigration' into feature/UnloadOrder 2024-09-10 20:08:16 +00:00
William Buezas 93e739f35c Create a constant for store local storage order name 2024-09-10 17:07:29 -03:00
William Buezas 65e0d752d6 remove header actions 2024-09-10 16:48:05 -03:00
William Buezas 418911b903 Remove console.log 2024-09-10 12:40:02 -03:00
William Buezas decf955224 Unload order when checkOrder fails 2024-09-10 12:38:36 -03:00
Javier Segarra d736ea716b Merge pull request 'Basket view' (!81) from wbuezas/hedera-web-mindshore:feature/Basket into 4922-vueMigration
Reviewed-on: #81
2024-09-10 14:15:23 +00:00
William Buezas a9427ddab9 Prevent entering basket view before checks 2024-09-10 09:19:47 -03:00
Javier Segarra 057bfae517 Merge pull request 'Add menu translations' (!82) from wbuezas/hedera-web-mindshore:feature/AddMenuTranslations into 4922-vueMigration
Reviewed-on: #82
2024-09-09 20:19:31 +00:00
Javier Segarra 929623949b perf: change code position(clean code) 2024-09-09 22:19:05 +02:00
Javier Segarra 38a88bb0cc feat: changes 2024-09-09 22:18:44 +02:00
William Buezas 265ff5c47f Confirm view 2024-09-09 08:50:21 -03:00
William Buezas c41d1430f7 Add menu translations 2024-09-07 19:34:22 -03:00
William Buezas 2bff9304e8 Add title view translation 2024-09-06 11:31:07 -03:00
William Buezas c53658e6e0 Add empty list 2024-09-06 11:20:09 -03:00
William Buezas e94f8c6b23 Add missed code 2024-09-06 10:53:28 -03:00
William Buezas c52fe7a870 WIP 2024-09-05 07:46:47 -03:00
William Buezas bfbe3621d6 Resolve conflicts 2024-09-04 07:17:22 -03:00
Javier Segarra 05568280f3 Merge pull request 'Pedidos stepper' (!80) from wbuezas/hedera-web-mindshore:feature/PedidosStepper into 4922-vueMigration
Reviewed-on: #80
Reviewed-by: Javier Segarra <jsegarra@verdnatura.es>
2024-09-03 14:06:01 +00:00
William Buezas 6bfa5b9715 Small changes 2024-09-03 08:17:22 -03:00
William Buezas 6631be401b Add minimal to QDate when is mobile 2024-09-02 18:27:14 -03:00
William Buezas ba2ded5c48 Add contracted prop for narrow windows 2024-09-02 17:53:43 -03:00
William Buezas 723a977ecd Small fix 2024-09-02 16:29:18 -03:00
William Buezas a1d67ebc6f update branch 2024-09-02 16:27:54 -03:00
William Buezas 7026e3416f Remove fetching of default order method 2024-09-02 12:39:03 -03:00
William Buezas 975495113d Set monday as first day of week 2024-09-01 21:43:49 -03:00
William Buezas 8e0f09cc0f Add next and back buttons custom labels 2024-09-01 21:42:09 -03:00
William Buezas 95e23c05fa Translate back and next buttons labels 2024-09-01 21:36:13 -03:00
William Buezas 6423ecfb05 Fix agency step title 2024-09-01 21:33:37 -03:00
William Buezas 3a21292030 Add validation to address step in method PICKUP 2024-09-01 21:29:57 -03:00
William Buezas f2bd3c2fa6 Add title to address step 2024-09-01 21:27:12 -03:00
William Buezas 020e0afc96 Add locale to QDate and initiate localeDates in store 2024-09-01 21:15:54 -03:00
William Buezas 766417bb73 Basket 2024-09-01 20:58:05 -03:00
William Buezas c77c2e6648 Update branch 2024-08-30 18:06:37 -03:00
William Buezas 6fe518601f WIP 2024-08-30 18:03:49 -03:00
William Buezas cb2c9871cc Stepper 2024-08-28 16:12:34 -03:00
Javier Segarra a832a1889a Merge pull request 'Modulo Administración' (!78) from wbuezas/hedera-web-mindshore:feature/Administracion into 4922-vueMigration
Reviewed-on: #78
2024-08-23 19:29:45 +00:00
William Buezas 7c4123ca0b Resolve conflicts 2024-08-23 16:23:14 -03:00
William Buezas facbe9b990 WIP 2024-08-23 16:09:50 -03:00
William Buezas 57880705d0 WIP 2024-08-23 13:43:32 -03:00
Javier Segarra ed29a1939c Merge pull request 'Mejoras sección pedidos' (!79) from wbuezas/hedera-web-mindshore:feature/MejorasPedidos into 4922-vueMigration
Reviewed-on: #79
2024-08-23 12:05:15 +00:00
Javier Segarra 5456db8add perf: date proposal 2024-08-22 23:32:47 +02:00
Javier Segarra 053b9f8457 fix: comments 2024-08-22 23:28:10 +02:00
Javier Segarra 8866331926 feat: extra-form slot for other table 2024-08-22 22:52:30 +02:00
William Buezas 33ef1da2a9 Small changes 2024-08-22 12:35:35 -03:00
Javier Segarra 2e2c83dcde perf: remove console.log 2024-08-21 13:45:43 +02:00
William Buezas 73eb3dcbee Updating VnInput 2024-08-19 08:44:40 -03:00
William Buezas 05d735702e Formatting and small changes 2024-08-19 08:21:23 -03:00
Javier Segarra 462a8a3cf8 eprf: add max value 2024-08-19 12:38:45 +02:00
Javier Segarra f821b8689a perf: improve interceptor 2024-08-19 12:38:33 +02:00
Javier Segarra e47edb9827 fix: eslint warnings 2024-08-19 12:38:17 +02:00
William Buezas 25f4f822b4 Extra improvements 2024-08-18 21:58:02 -03:00
William Buezas ef35914f34 Card list change 2024-08-18 21:39:44 -03:00
William Buezas b19bf710e8 Resolve conflicts 2024-08-18 20:33:17 -03:00
William Buezas 17a519e2ee Small changes 2024-08-18 20:10:57 -03:00
William Buezas 95a2bfb69c Add error interceptor 2024-08-17 20:25:55 -03:00
William Buezas 6e41548fdf Create jApi error interceptor 2024-08-17 20:23:15 -03:00
William Buezas c86c1cc0c0 General improvements 2024-08-17 19:59:35 -03:00
William Buezas 87c151c057 Add news details change 2024-08-17 19:36:19 -03:00
William Buezas 13af1d03a3 Change eslint config 2024-08-17 00:06:19 -03:00
William Buezas 14bef2383f News 2024-08-16 23:11:56 -03:00
Javier Segarra 5053a908f7 Merge pull request 'Vistas sección pedidos' (!77) from wbuezas/hedera-web-mindshore:feature/Pedidos into 4922-vueMigration
Reviewed-on: #77
Reviewed-by: Javier Segarra <jsegarra@verdnatura.es>
2024-08-16 06:52:22 +00:00
William Buezas 7e0c591026 Add tooltips 2024-08-14 12:22:51 -03:00
William Buezas 594b17b4ab Fix teleport submit problem 2024-08-14 12:16:46 -03:00
William Buezas 887ee8aea4 Create date format util with translations 2024-08-14 11:28:15 -03:00
William Buezas 44627dbc8a Replace prompt with VnConfirm 2024-08-14 10:56:07 -03:00
William Buezas f2c8b90324 Create print service and fix slot in VnTable 2024-08-14 09:31:42 -03:00
William Buezas e0f55f8ca3 Change class casing 2024-08-14 09:09:52 -03:00
William Buezas f36eb1bd88 Create VnTable and use it 2024-08-14 09:08:46 -03:00
William Buezas b728ecaf29 Add vn date 2024-08-14 08:54:15 -03:00
William Buezas 7c96106faa Change serial column name to invoice 2024-08-14 08:47:24 -03:00
William Buezas a0fc1cfc07 use line.discount directly 2024-08-14 08:39:51 -03:00
William Buezas b66c47955c Move script tag to the start of the file 2024-08-14 08:37:04 -03:00
William Buezas ec14ca334a WIP 2024-08-14 08:30:53 -03:00
William Buezas 7837925be9 Photos view 2024-08-13 16:37:28 -03:00
William Buezas 2fb892c71a WIP 2024-08-12 11:41:06 -03:00
William Buezas 2a1cd59492 Visits view 2024-08-08 11:24:43 -03:00
William Buezas 76b99ed293 Admin section WIP 2024-08-07 17:34:00 -03:00
William Buezas 67c6f84de3 Several changes 2024-08-02 21:56:20 -03:00
William Buezas 745e9a569c Translation files, pending orders, and more changes 2024-07-28 18:45:38 -03:00
William Buezas ad2d494481 Create CardList component 2024-07-27 22:55:40 -03:00
Javier Segarra 24687e57e6 Merge pull request 'Account config and change password form' (!73) from wbuezas/hedera-web-mindshore:feature/AccountConfig into 4922-vueMigration
Reviewed-on: #73
Reviewed-by: Javier Segarra <jsegarra@verdnatura.es>
2024-07-26 20:24:41 +00:00
Javier Segarra c20f48b2bf Merge branch '4922-vueMigration' into feature/AccountConfig 2024-07-26 22:23:21 +02:00
Javier Segarra 6bad41db20 feat: add password visibility 2024-07-26 22:18:17 +02:00
Javier Segarra eb0328753a Merge pull request 'Agencies packages' (!74) from wbuezas/hedera-web-mindshore:feature/Agencies into 4922-vueMigration
Reviewed-on: #74
2024-07-26 20:05:39 +00:00
Javier Segarra e067f5f7bd feat: langs button 2024-07-26 22:05:01 +02:00
Javier Segarra 34a0d93ece fix: email i18n 2024-07-26 21:55:42 +02:00
William Buezas 4256f45373 Add verificationToken as a prop to let the view handle it 2024-07-26 10:36:48 -03:00
William Buezas 93cc0d4286 Add login when password changed 2024-07-26 09:25:46 -03:00
William Buezas ef36566442 Create change password with and without token and add related features 2024-07-26 09:09:21 -03:00
William Buezas 06cd9b01d3 Change password form fields validation 2024-07-26 08:54:11 -03:00
William Buezas 7f831ae3a5 Remove unused style tag 2024-07-26 08:41:19 -03:00
William Buezas 382378e867 Agencies packages 2024-07-25 11:39:25 -03:00
William Buezas 401487dfd3 Resolve conflicts 2024-07-24 14:52:54 -03:00
William Buezas aa4ccf65f5 Change password form and several changes 2024-07-24 14:42:02 -03:00
Javier Segarra fb267b910b Merge pull request 'Address details and VnForm' (!72) from wbuezas/hedera-web-mindshore:feature/AddressDetails into 4922-vueMigration
Reviewed-on: #72
Reviewed-by: Javier Segarra <jsegarra@verdnatura.es>
2024-07-24 14:19:39 +00:00
Javier Segarra 24a9c130d1 On AddressDetails: Merge branch 'feature/AddressDetails' of https://gitea.verdnatura.es/wbuezas/hedera-web-mindshore into feature/AddressDetails 2024-07-23 23:07:40 +02:00
Javier Segarra f59b37c722 Merge branch 'feature/AddressDetails' of https://gitea.verdnatura.es/wbuezas/hedera-web-mindshore into feature/AddressDetails 2024-07-23 22:39:45 +02:00
Javier Segarra 160552ff2f fix: hover AddressListCardActions 2024-07-23 22:37:22 +02:00
William Buezas 83e3e034a8 Show Addresses list actions always 2024-07-23 16:37:24 -03:00
William Buezas 61062c1418 Add app.provide api 2024-07-23 11:26:12 -03:00
William Buezas 2cbbaf619c small change 2024-07-23 11:02:39 -03:00
William Buezas ec0d783672 WIP 2024-07-23 10:58:35 -03:00
William Buezas 07c5f64265 improvements 2024-07-22 13:51:54 -03:00
William Buezas dcbc154caa Components creation: AddressDetails, VnForm, VnInput and VnSelect 2024-07-22 11:17:56 -03:00
Javier Segarra 0d3da684b4 Merge pull request 'Address List view' (!71) from wbuezas/hedera-web-mindshore:feature/AddressList into 4922-vueMigration
Reviewed-on: #71
Reviewed-by: Javier Segarra <jsegarra@verdnatura.es>
2024-07-19 17:58:11 +00:00
William Buezas 8d2f041c46 Small change 2024-07-19 09:24:20 -03:00
William Buezas 28b2dd386f Address List view 2024-07-19 09:19:26 -03:00
Javier Segarra d589b89a62 Merge pull request 'Home view adjustments' (!70) from wbuezas/hedera-web-mindshore:feature/HomeViewAdjustments into 4922-vueMigration
Reviewed-on: #70
Reviewed-by: Javier Segarra <jsegarra@verdnatura.es>
2024-07-19 12:17:13 +00:00
Javier Segarra 04660bd05e feat: VnImg 2024-07-19 13:58:50 +02:00
Javier Segarra 1d6ec00c78 Merge branch '4922-vueMigration' into feature/HomeViewAdjustments 2024-07-19 11:16:07 +00:00
Javier Segarra ce557dc5b9 Merge pull request 'Init config' (!68) from wbuezas/hedera-web-mindshore:feature/InitConfig into 4922-vueMigration
Reviewed-on: #68
Reviewed-by: Javier Segarra <jsegarra@verdnatura.es>
2024-07-19 11:13:55 +00:00
Javier Segarra 4387a868bc perf: update 2024-07-19 09:36:25 +02:00
William Buezas 003f42dd03 Home view adjustments 2024-07-18 08:51:11 -03:00
William Buezas 9dfeb2f7ef package fix 2024-07-17 15:45:56 -03:00
William Buezas 8bea750244 Fix build 2024-07-17 15:10:27 -03:00
William Buezas bf2094163d More linting and formatting 2024-07-17 09:23:30 -03:00
William Buezas e0cc4e40ba Change components auto import casing type 2024-07-17 09:23:20 -03:00
William Buezas 47c6fe02ec Config prettier and eslint for src folder 2024-07-17 09:22:54 -03:00
Juan Ferrer 6458d8db5e #4922 Catalog & fixes 2023-01-16 08:32:48 +01:00
Juan Ferrer 0234e14c6b #4922 invoices & orders 2022-12-13 18:29:04 +01:00
Juan Ferrer 7e26aa773c refs #4922 password recovery, app store, error handler, fixes 2022-12-09 11:28:38 +01:00
Juan Ferrer 0d0be4ee5f refs #4922 Login, logout, home, layout style 2022-12-06 11:41:41 +01:00
Juan Ferrer 042b8b0309 refs #4922 Login UI 2022-11-30 18:59:07 +01:00
Juan Ferrer b7658b76cf refs #4922 Quasar added 2022-11-29 20:32:57 +01:00
291 changed files with 39860 additions and 18852 deletions

9
.editorconfig Normal file
View File

@ -0,0 +1,9 @@
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

8
.eslintignore Normal file
View File

@ -0,0 +1,8 @@
/dist
/src-bex/www
/src-capacitor
/src-cordova
/.quasar
/node_modules
.eslintrc.js
babel.config.js

85
.eslintrc.js Normal file
View File

@ -0,0 +1,85 @@
module.exports = {
// https://eslint.org/docs/user-guide/configuring#configuration-cascading-and-hierarchy
// This option interrupts the configuration hierarchy at this file
// Remove this if you have an higher level ESLint config file (it usually happens into a monorepos)
root: true,
parserOptions: {
parser: '@babel/eslint-parser',
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
sourceType: 'module' // Allows for the use of imports
},
env: {
browser: true,
'vue/setup-compiler-macros': true
},
extends: ['standard'],
plugins: ['vue', 'prettier'],
globals: {
ga: 'readonly', // Google Analytics
cordova: 'readonly',
__statics: 'readonly',
__QUASAR_SSR__: 'readonly',
__QUASAR_SSR_SERVER__: 'readonly',
__QUASAR_SSR_CLIENT__: 'readonly',
__QUASAR_SSR_PWA__: 'readonly',
process: 'readonly',
Capacitor: 'readonly',
chrome: 'readonly'
},
// add your custom rules here
rules: {
// allow async-await
'generator-star-spacing': 'off',
// allow paren-less arrow functions
'arrow-parens': 'off',
'one-var': 'off',
'no-void': 'off',
'multiline-ternary': 'off',
'import/first': 'off',
'import/named': 'error',
'import/namespace': 'error',
'import/default': 'error',
'import/export': 'error',
'import/extensions': 'off',
'import/no-unresolved': 'off',
'import/no-extraneous-dependencies': 'off',
'prefer-promise-reject-errors': 'off',
semi: 'off',
// allow debugger during development only
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
},
overrides: [
{
files: ['src/**/*.{js,vue,scss}', 'quasar.config.js'], // Aplica ESLint solo a archivos .js, .vue y .scss dentro de src (Proyecto de quasar)
extends: [
// Base ESLint recommended rules
'eslint:recommended',
// Uncomment any of the lines below to choose desired strictness,
// but leave only one uncommented!
// See https://eslint.vuejs.org/rules/#available-rules
// 'plugin:vue/vue3-essential', // Priority A: Essential (Error Prevention)
'plugin:vue/vue3-strongly-recommended', // Priority B: Strongly Recommended (Improving Readability)
// 'plugin:vue/vue3-recommended', // Priority C: Recommended (Minimizing Arbitrary Choices and Cognitive Overhead)
// https://github.com/prettier/eslint-config-prettier#installation
// usage with Prettier, provided by 'eslint-config-prettier'.
'prettier'
],
rules: {
semi: 'off',
'space-before-function-paren': 'off',
'prefer-promise-reject-errors': 'off',
'vue/no-multiple-template-root': 'off'
},
parserOptions: {
ecmaVersion: '2021'
},
plugins: ['vue']
}
]
};

View File

@ -1,15 +0,0 @@
extends: eslint:recommended
parserOptions:
ecmaVersion: 2017
sourceType: module
rules:
no-undef: 0
no-redeclare: 0
no-mixed-spaces-and-tabs: 0
no-console: 0
no-cond-assign: 0
no-unexpected-multiline: 0
brace-style: [error, 1tbs]
space-before-function-paren: [error, never]
padded-blocks: [error, never]
func-call-spacing: [error, never]

36
.gitignore vendored
View File

@ -1,6 +1,36 @@
node_modules
build/ build/
dist/
config.my.php config.my.php
.vscode/
.DS_Store
.thumbs.db
node_modules
# Quasar core related directories
.quasar .quasar
/dist
# Cordova related directories and files
/src-cordova/node_modules
/src-cordova/platforms
/src-cordova/plugins
/src-cordova/www
# Capacitor related directories and files
/src-capacitor/www
/src-capacitor/node_modules
# BEX related directories and files
/src-bex/www
/src-bex/js/core
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.idea
*.suo
*.ntvs*
*.njsproj
*.sln

3
.npmrc Normal file
View File

@ -0,0 +1,3 @@
# pnpm-related options
shamefully-hoist=true
strict-peer-dependencies=false

9
.postcssrc.js Normal file
View File

@ -0,0 +1,9 @@
/* eslint-disable */
// https://github.com/michael-ciniawsky/postcss-load-config
module.exports = {
plugins: [
// to edit target browsers: use "browserslist" field in package.json
require('autoprefixer')
]
}

9
.prettierrc.js Normal file
View File

@ -0,0 +1,9 @@
module.exports = {
printWidth: 80,
tabWidth: 4,
useTabs: false,
singleQuote: true,
bracketSpacing: true,
arrowParens: 'avoid',
trailingComma: 'none'
};

14
.vscode/extensions.json vendored Normal file
View File

@ -0,0 +1,14 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"editorconfig.editorconfig",
"vue.volar",
"wayou.vscode-todo-highlight"
],
"unwantedRecommendations": [
"octref.vetur",
"hookyqr.beautify",
"dbaeumer.jshint",
"ms-vscode.vscode-typescript-tslint-plugin"
]
}

22
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,22 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9000
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 9000
}
]
}

9
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,9 @@
{
"editor.bracketPairColorization.enabled": true,
"editor.guides.bracketPairs": true,
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": ["source.fixAll.eslint"],
"eslint.validate": ["javascript", "javascriptreact", "typescript", "vue"],
"cSpell.words": ["axios", "composables"]
}

View File

@ -1,5 +1,5 @@
# Not using buster because of bug: https://bugs.php.net/bug.php?id=78870 # Not using buster because of bug: https://bugs.php.net/bug.php?id=78870
FROM debian:bookworm-slim FROM debian:stretch-slim
ARG DEBIAN_FRONTEND=noninteractive ARG DEBIAN_FRONTEND=noninteractive
@ -23,19 +23,19 @@ RUN a2dissite 000-default
# NodeJs # NodeJs
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \ RUN curl -fsSL https://deb.nodesource.com/setup_14.x | bash - \
&& apt-get install -y --no-install-recommends nodejs && apt-get install -y --no-install-recommends nodejs
# Hedera # Hedera
RUN curl -sL https://apt.verdnatura.es/conf/verdnatura.gpg | tee /etc/apt/trusted.gpg.d/verdnatura.gpg \ RUN curl -sL https://apt.verdnatura.es/conf/verdnatura.gpg | apt-key add - \
&& echo "deb http://apt.verdnatura.es/ bookworm main" \ && echo "deb http://apt.verdnatura.es/ stretch main" \
> /etc/apt/sources.list.d/vn.list \ > /etc/apt/sources.list.d/vn.list \
&& apt-get update \ && apt-get update \
&& apt-get install -y --no-install-recommends \ && apt-get install -y --no-install-recommends \
php-apcu \
php-image-text \ php-image-text \
php-text-captcha \ php-text-captcha \
php-apcu \
php-zip \ php-zip \
hedera-web \ hedera-web \
cron cron

View File

@ -1,58 +1,35 @@
# Hedera # Hedera
Hedera is the main web shop page for Verdnatura. Hedera is the main web page for Verdnatura.
## Prerequisites ## Getting Started
Required applications. Required dependencies.
* PHP >= 8.4
* Node.js >= 20.0
Take a look to *debian/control* file to see additional dependencies. - PHP >= 7.0
- Node.js >= 8.0
Copy config.php to *config.my.php* and place your DB config there. Launch application for development.
### Installing dependencies and launching
Pull from repository.
Run this commands on project root directory to install Node dependencies.
``` ```
$ npm install $ npm run dev
``` ```
Install project dependences (debian/control).
Pull from repository [php-vn-lib](https://gitea.verdnatura.es/verdnatura/php-vn-lib) and install [dependences](https://gitea.verdnatura.es/verdnatura/php-vn-lib/src/branch/master/debian/control) of this project.
Configure config.php file.
Launch project fronted.
```
$ npm run front
```
Launch salix backend.
```
$ npm run db
$ npm run back
```
Launch project backend. Launch project backend.
```
$ php -S 127.0.0.1:3001 -t . index.php
```
### Command line ```
$ php -S 127.0.0.1:3002 -t . index.php
Run server side method from command line. Run server side method from command line.
``` ```
$ php hedera-web.php -m method_path
$ php hedera-web.php -m method_path
``` ```
## Built with ## Built with
* [nodejs](https://nodejs.org/)
* [php](https://www.php.net/)
* [Webpack](https://webpack.js.org/) * [Webpack](https://webpack.js.org/)
* [MooTools](https://mootools.net/) * [MooTools](https://mootools.net/)
* [TinyMCE](https://www.tinymce.com/) * [TinyMCE](https://www.tinymce.com/)
```

14
babel.config.js Normal file
View File

@ -0,0 +1,14 @@
/* eslint-disable */
module.exports = api => {
return {
presets: [
[
'@quasar/babel-preset-app',
api.caller(caller => caller && caller.target === 'node')
? { targets: { node: 'current' } }
: {}
]
]
}
}

View File

@ -12,8 +12,6 @@
* *
* - http://www.mydomain.org -> config.www.php * - http://www.mydomain.org -> config.www.php
* - http://test.mydomain.org -> config.test.php * - http://test.mydomain.org -> config.test.php
*
* Put the password in base64.
*/ */
return [ return [
/** /**
@ -24,7 +22,7 @@ return [
,'port' => 3306 ,'port' => 3306
,'schema' => 'hedera' ,'schema' => 'hedera'
,'user' => 'hedera-web' ,'user' => 'hedera-web'
,'pass' => '' // base64 encoded ,'pass' => ''
,'tz' => 'Europe/madrid' ,'tz' => 'Europe/madrid'
] ]
]; ];

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
hedera-web (25.4.4) stable; urgency=low hedera-web (22.48.2) stable; urgency=low
* Initial Release. * Initial Release.

2
debian/control vendored
View File

@ -10,7 +10,7 @@ Vcs-Git: https://gitea.verdnatura.es/verdnatura/hedera-web
Package: hedera-web Package: hedera-web
Architecture: all Architecture: all
Depends: apache2 | httpd, nodejs, php-cli, php-vn-lib, php-apcu, php-imap, php-soap, libphp-phpmailer, php-gd, php-pear Depends: apache2 | httpd, nodejs, php-cli, php-vn-lib, php-apcu, php-imap, php-soap, libphp-phpmailer, php-gd, php-pear
Suggests: php-image-text, php-text-captcha, php-zip, cron Suggests: php-text-captcha, php-zip, cron
Section: misc Section: misc
Priority: optional Priority: optional
Description: Verdnatura's web page Description: Verdnatura's web page

2
debian/cron.d vendored
View File

@ -1,8 +1,10 @@
MAILTO=webmaster MAILTO=webmaster
*/1 * * * * root hedera-web.php -m misc/mail */1 * * * * root hedera-web.php -m misc/mail
*/4 * * * * root hedera-web.php -m tpv/confirm-mail
*/2 * * * * root hedera-web.php -m edi/load */2 * * * * root hedera-web.php -m edi/load
0 23 * * * root hedera-web.php -m edi/clean 0 23 * * * root hedera-web.php -m edi/clean
0 5 * * * root hedera-web.php -m edi/update 0 5 * * * root hedera-web.php -m edi/update
0 5 * * * root hedera-web.php -m misc/exchange-rate
0 0 * * * root hedera-web.php -m image/sync 0 0 * * * root hedera-web.php -m image/sync
0 1 * * * root /usr/share/hedera-web/utils/image-clean.sh > /dev/null 0 1 * * * root /usr/share/hedera-web/utils/image-clean.sh > /dev/null
0 */1 * * * root /usr/share/hedera-web/utils/update-browscap.sh > /dev/null 0 */1 * * * root /usr/share/hedera-web/utils/update-browscap.sh > /dev/null

2
debian/links vendored
View File

@ -1,3 +1,3 @@
usr/share/hedera-web/hedera-web.php usr/bin/hedera-web.php usr/share/hedera-web/hedera-web.php usr/bin/hedera-web.php
etc/hedera-web/apache.conf etc/apache2/conf-available/hedera-web.conf etc/hedera-web/apache.conf etc/apache2/conf-available/hedera-web.conf
etc/hedera-web/php.ini etc/php/8.2/apache2/conf.d/99-hedera-web.ini etc/hedera-web/php.ini etc/php/7.0/apache2/conf.d/99-hedera-web.ini

View File

@ -1,9 +1,41 @@
version: '3.7' version: '3.7'
services: services:
main: main:
image: registry.verdnatura.es/verdnatura/hedera-web:${TAG:?} image: registry.verdnatura.es/hedera-web:${BRANCH_NAME:?}
build: build:
context: . context: .
dockerfile: Dockerfile dockerfile: Dockerfile
args: args:
- VERSION=${VERSION:?} - VERSION=${VERSION:?}
ports:
- 80
configs:
- source: config
target: /etc/hedera-web/config.my.php
volumes:
- /mnt/appdata:/mnt/storage
- /mnt/appdata/image:/var/lib/hedera-web/image-db
- /mnt/appdata/vn-access:/var/lib/hedera-web/vn-access
deploy:
replicas: ${MAIN_REPLICAS:?}
placement:
constraints:
- node.role == worker
cron:
image: registry.verdnatura.es/hedera-web:${BRANCH_NAME:?}
command: 'cron -f'
configs:
- source: config
target: /etc/hedera-web/config.my.php
volumes:
- /mnt/appdata:/mnt/storage
- /mnt/appdata/image:/var/lib/hedera-web/image-db
deploy:
replicas: ${CRON_REPLICAS:?}
placement:
constraints:
- node.role == worker
configs:
config:
external: true
name: ${PROJECT_NAME:?}-${BRANCH_NAME:?}

View File

@ -65,8 +65,8 @@
one-way="true" one-way="true"
one-time="true"> one-time="true">
<db-model property="model"> <db-model property="model">
SELECT id, name FROM vn.country SELECT id, country FROM vn.country
ORDER BY name ORDER BY country
</db-model> </db-model>
</htk-combo> </htk-combo>
</div> </div>

View File

@ -7,7 +7,70 @@ export default new Class({
activate() { activate() {
this.$.userModel.setInfo('c', 'myClient', 'hedera'); this.$.userModel.setInfo('c', 'myClient', 'hedera');
this.$.userModel.setInfo('u', 'myUser', 'account'); this.$.userModel.setInfo('u', 'myUser', 'account');
this.$.changePassword.conn = this.conn
this.$.changePassword.user = this.gui.user if (this.hash.$.verificationToken)
this.onPassChangeClick();
} }
});
,onPassChangeClick() {
this.$.oldPassword.value = '';
this.$.newPassword.value = '';
this.$.repeatPassword.value = '';
var verificationToken = this.hash.$.verificationToken;
this.$.oldPassword.style.display = verificationToken ? 'none' : 'block';
this.$.changePassword.show();
if (verificationToken)
this.$.newPassword.focus();
else
this.$.oldPassword.focus();
}
,async onPassModifyClick() {
var oldPassword = this.$.oldPassword.value;
var newPassword = this.$.newPassword.value;
var repeatedPassword = this.$.repeatPassword.value;
if (newPassword == '' && repeatedPassword == '')
throw new Error(_('Passwords empty'));
if (newPassword !== repeatedPassword)
throw new Error(_('Passwords doesn\'t match'));
var verificationToken = this.hash.$.verificationToken;
var params = {newPassword};
let err;
try {
if (verificationToken) {
params.verificationToken = verificationToken;
await this.conn.send('user/restore-password', params);
} else {
let userId = this.gui.user.id;
params.oldPassword = oldPassword;
await this.conn.patch(
`Accounts/${userId}/changePassword`, params);
}
} catch(e) {
err = e;
Htk.Toast.showError(err.message);
if (this.hash.$.verificationToken)
this.$.newPassword.select();
else
this.$.oldPassword.select();
return;
}
this.$.changePassword.hide();
this.hash.unset('verificationToken');
Htk.Toast.showMessage(_('Password changed!'));
this.$.userForm.refresh();
}
,onPassInfoClick() {
this.$.passwordInfo.show();
}
});

View File

@ -1,5 +1,11 @@
<vn> <vn>
<vn-group> <vn-group>
<db-form v-model="passwordForm">
<db-model property="model">
SELECT length, nAlpha, nUpper, nDigits, nPunct
FROM account.userPassword
</db-model>
</db-form>
<db-form id="user-form"> <db-form id="user-form">
<db-model property="model" id="user-model" updatable="true"> <db-model property="model" id="user-model" updatable="true">
SELECT u.id, u.name, u.email, u.nickname, SELECT u.id, u.name, u.email, u.nickname,
@ -21,7 +27,7 @@
<htk-bar-button <htk-bar-button
icon="lock_reset" icon="lock_reset"
tip="_Change password" tip="_Change password"
on-click="this.$.changePassword.open()"/> on-click="this.onPassChangeClick()"/>
</div> </div>
<div id="form" class="conf"> <div id="form" class="conf">
<div class="form box vn-w-sm vn-pa-lg"> <div class="form box vn-w-sm vn-pa-lg">
@ -68,5 +74,62 @@
</div> </div>
</div> </div>
</div> </div>
<htk-change-password id="change-password"/> <htk-popup
id="change-password"
modal="true">
<div property="child-node" class="htk-dialog vn-w-xs vn-pa-lg">
<div class="form">
<h5 class="vn-mb-md">
<t>Change password</t>
</h5>
<input
id="old-password"
type="password"
placeholder="_Old password"/>
<input
id="new-password"
type="password"
placeholder="_New password"/>
<input
id="repeat-password"
type="password"
placeholder="_Repeat password"/>
</div>
<div class="button-bar">
<button class="thin" on-click="this.onPassModifyClick()">
<t>Modify</t>
</button>
<button class="thin" on-click="this.onPassInfoClick()">
<t>Requirements</t>
</button>
<div class="clear"/>
</div>
</div>
</htk-popup>
<htk-popup
id="password-info"
modal="true">
<div property="child-node" class="htk-dialog pass-info vn-w-xs vn-pa-lg">
<h5 class="vn-mb-md">
<t>Password requirements</t>
</h5>
<ul>
<li>
{{passwordForm.length}} <t>characters long</t>
</li>
<li>
{{passwordForm.nAlpha}} <t>alphabetic characters</t>
</li>
<li>
{{passwordForm.nUpper}} <t>capital letters</t>
</li>
<li>
{{passwordForm.nDigits}} <t>digits</t>
</li>
<li>
{{passwordForm.nPunct}} <t>symbols</t>
</li>
</ul>
</div>
</htk-popup>
</vn> </vn>

View File

@ -18,8 +18,8 @@
LEFT JOIN image im LEFT JOIN image im
ON im.collectionFk = 'catalog' ON im.collectionFk = 'catalog'
AND im.name = i.image AND im.name = i.image
WHERE i.isActive WHERE i.longName LIKE CONCAT('%', #search, '%')
AND (i.longName LIKE CONCAT('%', #search, '%') OR i.id = #search) OR i.id = #search
ORDER BY i.longName LIMIT 50 ORDER BY i.longName LIMIT 50
</db-model> </db-model>
<custom> <custom>

View File

@ -7,8 +7,8 @@ export default new Class({
,activate() { ,activate() {
if (!this.hash.$.to) if (!this.hash.$.to)
this.hash.assign({ this.hash.assign({
from: Date.vnNew(), from: new Date(),
to: Date.vnNew() to: new Date()
}); });
} }
}); });

View File

@ -3,5 +3,12 @@ import './style.scss';
export default new Class({ export default new Class({
Extends: Hedera.Form, Extends: Hedera.Form,
Template: require('./ui.xml'), Template: require('./ui.xml'),
onShowClick(column, agencyId) {
this.hash.setAll({
form: 'agencies/provinces',
agency: agencyId
});
}
}); });

View File

@ -1,4 +1,5 @@
ListByAgency: Paquets per agència ListByAgency: Paquets per agència
ShowByProvince: Mostrar desglose per província
Agency: Agència Agency: Agència
Exps: Exps. Exps: Exps.
Bundles: Paquets Bundles: Paquets

View File

@ -1,4 +1,5 @@
ListByAgency: Bundles by agency ListByAgency: Bundles by agency
ShowByProvince: Show breakdown by province
Agency: Agency Agency: Agency
Exps: Exps. Exps: Exps.
Bundles: Bundles Bundles: Bundles

View File

@ -1,4 +1,5 @@
ListByAgency: Bultos por agencia ListByAgency: Bultos por agencia
ShowByProvince: Mostrar desglose por provincia
Agency: Agencia Agency: Agencia
Exps: Exps. Exps: Exps.
Bundles: Bultos Bundles: Bultos

View File

@ -1,4 +1,5 @@
ListByAgency: Liste par agence ListByAgency: Liste par agence
ShowByProvince: Montrer par province
Agency: Agence Agency: Agence
Exps: Expéditeur Exps: Expéditeur
Bundles: Cartons Bundles: Cartons

View File

@ -1,4 +1,5 @@
ListByAgency: Bultos por agencia ListByAgency: Bultos por agencia
ShowByProvince: Mostrar desglosse por Distrito
Agency: Agencia Agency: Agencia
Exps: Exps. Exps: Exps.
Bundles: Bultos Bundles: Bultos

View File

@ -7,9 +7,14 @@
<htk-grid> <htk-grid>
<db-model property="model"> <db-model property="model">
<custom> <custom>
CALL vn.agencyVolume() CALL vn2008.agencia_volume ()
</custom> </custom>
</db-model> </db-model>
<htk-column-button
column="agency_id"
icon="search"
tip="_ShowByProvince"
on-clicked="onShowClick"/>
<htk-column-text title="_Agency" column="Agencia"/> <htk-column-text title="_Agency" column="Agencia"/>
<htk-column-spin title="_Exps" column="expediciones"/> <htk-column-spin title="_Exps" column="expediciones"/>
<htk-column-spin title="_Bundles" column="Bultos"/> <htk-column-spin title="_Bundles" column="Bultos"/>

View File

@ -0,0 +1,7 @@
import './style.scss';
export default new Class({
Extends: Hedera.Form,
Template: require('./ui.xml')
});

View File

@ -0,0 +1,6 @@
ByProvince: Desglose per província
Return: Tornar
SelectAgency: Selecciona una agència al llistat de l'esquerra
Province: Província
Expeditions: Exps.
Left: Falten

View File

@ -0,0 +1,6 @@
ByProvince: Breakdown by province
Return: Return
SelectAgency: Select an agency
Province: Province
Expeditions: Exps.
Left: Left

View File

@ -0,0 +1,6 @@
ByProvince: Desglose por provincia
Return: Volver
SelectAgency: Selecciona una agencia
Province: Provincia
Expeditions: Exps.
Left: Faltan

View File

@ -0,0 +1,6 @@
ByProvince: Par province
Return: Retour
SelectAgency: Sélectionnez une agence
Province: Province
Expeditions: Expéditions
Left: Restant

View File

@ -0,0 +1,6 @@
ByProvince: Desglosse por Distritos
Return: Voltar
SelectAgency: Seleccione uma agência
Province: Distrito
Expeditions: Exps.
Left: Faltam

View File

@ -0,0 +1,18 @@
<vn>
<div id="title">
<h1><t>ByProvince</t></h1>
</div>
<div id="form" class="provinces vn-w-sm">
<div class="box">
<htk-grid>
<db-model property="model" lot="hash">
CALL vn2008.desglose_volume(#agency)
</db-model>
<htk-column-text title="_Province" column="Provincia"/>
<htk-column-spin title="_Expeditions" column="expediciones"/>
<htk-column-spin title="_Bundles" column="Bultos"/>
<htk-column-spin title="_Left" column="Prevision"/>
</htk-grid>
</div>
</div>
</vn>

View File

@ -14,7 +14,7 @@ export default new Class({
,refreshCaptcha() { ,refreshCaptcha() {
params = { params = {
srv: 'rest:misc/captcha', srv: 'rest:misc/captcha',
stamp: Date.vnNew().getTime() stamp: new Date().getTime()
}; };
this.$.captchaImg.src = '?'+ Vn.Url.makeUri(params); this.$.captchaImg.src = '?'+ Vn.Url.makeUri(params);
} }

View File

@ -51,4 +51,4 @@
} }
.new-text li { .new-text li {
margin: 4px 0; margin: 4px 0;
} }

View File

@ -13,8 +13,7 @@ BecauseOurSalesDep: >-
Pour nos professionnels de service commercial qui sera toujours de trouver une Pour nos professionnels de service commercial qui sera toujours de trouver une
solution à vos besoins. solution à vos besoins.
BecauseOurWorkShop: Parce que nous avons un atelier de couture pour aider. BecauseOurWorkShop: Parce que nous avons un atelier de couture pour aider.
BecauseWeHaveWhatYouNeed: >- BecauseWeHaveWhatYouNeed: Parce que nous avons ce que vous avez besoin quand vous en avez besoin ...
Parce que nous avons ce que vous avez besoin quand vous en avez besoin ...
AboutDesc: >- AboutDesc: >-
Nous sommes une société spécialisée dans le commerce de gros et de la Nous sommes une société spécialisée dans le commerce de gros et de la
distribution d'une large gamme d'accessoires, des verts et des fleurs à des distribution d'une large gamme d'accessoires, des verts et des fleurs à des
@ -32,6 +31,6 @@ AboutDisp: >-
Mercaflor - Mercavalencia (Valencia) qui effectuent des ventes directes Mercaflor - Mercavalencia (Valencia) qui effectuent des ventes directes
seulement. seulement.
AboutOrder: >- AboutOrder: >-
Vous pouvez faire vos commandes et réservations par téléphone au +33 783 285 Vous pouvez faire vos commandes et réservations par téléphone au +33 781 533
437, en ligne grâce à notre site Internet ou directement dans nos 900, en ligne grâce à notre site Internet ou directement dans nos
installations. installations.

View File

@ -5,64 +5,17 @@ export default new Class({
Template: require('./ui.xml'), Template: require('./ui.xml'),
async open() { async open() {
await this.loadOrder(); const isOk = await Hedera.BasketChecker.check(this.conn, this.hash);
if (this.orderId) { if (isOk) await Hedera.Form.prototype.open.call(this);
await Hedera.Form.prototype.open.call(this);
this.$.lot.assign({id: this.orderId});
}
}, },
activate() { activate() {
this.$.items.setInfo('bi', 'myOrderRow', 'hedera'); this.$.items.setInfo('bi', 'myBasketItem', 'hedera');
},
async onHashChange() {
if (!this.isOpen) return;
await this.loadOrder();
if (this.orderId)
this.$.lot.assign({id: this.orderId});
},
async loadOrder() {
const basket = new Hedera.Basket(this.app);
if (this.hash.$.id) {
this.orderId = this.hash.$.id;
} else if (await basket.check()) {
this.orderId = basket.orderId;
}
},
onOrderReady(form) {
if (form.row < 0)
return;
if (form.$.method != 'PICKUP') {
Vn.Node.show(this.$.address);
Vn.Node.setText(this.$.method, _('Agency'));
} else {
Vn.Node.hide(this.$.address);
Vn.Node.setText(this.$.method, _('Warehouse'));
}
}, },
onConfigureClick() { onConfigureClick() {
Htk.Toast.showWarning(_('RememberReconfiguringImpact')); Htk.Toast.showWarning(_('RememberReconfiguringImpact'));
this.hash.setAll({ this.hash.setAll({form: 'ecomerce/checkout'});
form: 'ecomerce/checkout',
id: this.orderId
});
},
async onCatalogClick() {
const basket = new Hedera.Basket(this.app);
await basket.load(this.orderId);
},
onConfirmClick() {
this.hash.setAll({
form: 'ecomerce/confirm',
id: this.orderId
});
}, },
onDeleteClick(form) { onDeleteClick(form) {

View File

@ -1,16 +1,11 @@
ShoppingBasket: Cistella de la compra ShoppingBasket: Cistella de la compra
Order: Encàrrec
ShippingInformation: Dades d'enviament
DeliveryAddress: Adreça de lliurament
Delivery at: Lliurament el
Agency: Agència
Warehouse: Magatzem
Delete: Borrar encàrrec Delete: Borrar encàrrec
GoToCatalog: Anar al catàleg GoToCatalog: Anar al catàleg
ConfigureOrder: Configurar encàrrec ConfigureOrder: Configurar encàrrec
Checkout: Tramitar encàrrec Checkout: Tramitar encàrrec
OrderNumber: N encàrec OrderNumber: N encàrec
DateExit: Data d'eixida DateExit: Data d'eixida
Warehouse: Magatzem
OrderTotal: Total encàrrec OrderTotal: Total encàrrec
Amount: Quant Amount: Quant
Pack: Pack Pack: Pack

View File

@ -1,16 +1,11 @@
ShoppingBasket: Shopping basket ShoppingBasket: Shopping basket
Order: Order
ShippingInformation: Shipping information
DeliveryAddress: Delivery address
Delivery at: Delivery at
Agency: Agency
Warehouse: Store
Delete: Delete order Delete: Delete order
GoToCatalog: Go to catalog GoToCatalog: Go to catalog
ConfigureOrder: Configure order ConfigureOrder: Configure order
Checkout: Checkout Checkout: Checkout
OrderNumber: Order number OrderNumber: Order number
DateExit: Shipping date DateExit: Shipping date
Warehouse: Store
OrderTotal: Total OrderTotal: Total
Amount: Amount Amount: Amount
Pack: Pack Pack: Pack

View File

@ -1,16 +1,11 @@
ShoppingBasket: Cesta de la compra ShoppingBasket: Cesta de la compra
Order: Pedido
ShippingInformation: Datos de envío
DeliveryAddress: Dirección de entrega
Delivery at: Entrega el
Agency: Agencia
Warehouse: Almacén
Delete: Borrar pedido Delete: Borrar pedido
GoToCatalog: Ir al catálogo GoToCatalog: Ir al catálogo
ConfigureOrder: Configurar pedido ConfigureOrder: Configurar pedido
Checkout: Finalizar pedido Checkout: Finalizar pedido
OrderNumber: Nº pedido OrderNumber: Nº pedido
DateExit: Fecha de salida DateExit: Fecha de salida
Warehouse: Almacén
OrderTotal: Total OrderTotal: Total
Amount: Cantidad Amount: Cantidad
Pack: Pack Pack: Pack

View File

@ -1,16 +1,11 @@
ShoppingBasket: Panier ShoppingBasket: Panier
Order: Commande
ShippingInformation: Informations sur la livraison
DeliveryAddress: Addresse de livraison
Delivery at: Livraison à
Agency: Agence
Warehouse: Entrepôt
Delete: Effacer Delete: Effacer
GoToCatalog: Aller au catalogue GoToCatalog: Aller au catalogue
ConfigureOrder: Définissez l'ordre ConfigureOrder: Définissez l'ordre
Checkout: Caisse Checkout: Caisse
OrderNumber: Numéro de commande OrderNumber: Numéro de commande
DateExit: Date de sortie DateExit: Date de sortie
Warehouse: Magasin
OrderTotal: Total commande OrderTotal: Total commande
Amount: Quant Amount: Quant
Pack: Pack Pack: Pack

View File

@ -1,16 +1,11 @@
ShoppingBasket: Cesta da compra ShoppingBasket: Cesta da compra
Order: Encomenda
ShippingInformation: Dados de envio
DeliveryAddress: Endereço de entrega
Delivery at: Entrega na
Agency: Agência
Warehouse: Armazém
Delete: Eliminar encomenda Delete: Eliminar encomenda
GoToCatalog: Ir ao catálogo GoToCatalog: Ir ao catálogo
ConfigureOrder: Configurar encomenda ConfigureOrder: Configurar encomenda
Checkout: Finalizar encomenda Checkout: Finalizar encomenda
OrderNumber: Nº encomenda OrderNumber: Nº encomenda
DateExit: Data de saída DateExit: Data de saída
Warehouse: Armazém
OrderTotal: Total OrderTotal: Total
Amount: Quantidade Amount: Quantidade
Pack: Pack Pack: Pack

View File

@ -1,93 +1,76 @@
.hedera-basket { .basket .head {
.head { border-bottom: 1px solid #DDD;
border-bottom: 1px solid #DDD;
& > div > div {
margin: 15px 0;
}
& > div > div:first-child {
margin: 0;
}
p {
margin: 3px 0;
&.important {
font-size: 1.2rem;
font-weight: bold;
}
}
.total {
font-weight: bold;
margin: 0;
padding: 0;
font-size: 1.4rem;
text-align: right;
}
}
.form > p {
margin: 0;
font-size: 1.4rem;
color: white;
text-align: right;
}
/* Lines */
.line {
display: flex;
align-items: center;
gap: 12px;
margin: 10px 0;
height: 80px;
}
.line:first-child {
margin-top: 0;
}
.line:last-child {
margin-bottom: 0;
}
.line > .delete {
margin: 0 -8px;
}
.line > .photo {
flex: none;
border-radius: 50%;
width: 68px;
height: 68px;
gap: 0;
}
.line > .info {
flex: 1;
overflow: hidden;
}
.line > .info > * {
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
.line > .info > h2 {
font-size: 1rem;
font-weight: normal;
margin: 0;
}
.line > .info > p {
margin: 0;
}
.line > .info > .tags {
color: #777;
}
.line .subtotal {
float: right;
}
/* Fields */
td.available-exceeded input {
background-color: #FCC;
}
.icon > img {
border-radius: 50%;
}
} }
.basket .head p {
font-weight: bold;
margin: 0;
padding: 0;
font-size: 1.4rem;
text-align: right;
}
.basket .form > p {
margin: 0;
font-size: 1.4rem;
color: white;
text-align: right;
}
/* Lines */
.basket .line {
display: flex;
align-items: center;
gap: 12px;
margin: 10px 0;
height: 80px;
}
.basket .line:first-child {
margin-top: 0;
}
.basket .line:last-child {
margin-bottom: 0;
}
.basket .line > .delete {
margin: 0 -8px;
}
.basket .line > .photo {
flex: none;
border-radius: 50%;
width: 68px;
height: 68px;
gap: 0;
}
.basket .line > .info {
flex: 1;
overflow: hidden;
}
.basket .line > .info > * {
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
.basket .line > .info > h2 {
font-size: 1rem;
font-weight: normal;
margin: 0;
}
.basket .line > .info > p {
margin: 0;
}
.basket .line > .info > .tags {
color: #777;
}
.basket .line .subtotal {
float: right;
}
/* Fields */
.basket td.available-exceeded input {
background-color: #FCC;
}
.basket .icon > img {
border-radius: 50%;
}

View File

@ -1,6 +1,6 @@
<vn> <vn>
<div id="title"> <div id="title">
<h1>{{_(params.$.id ? 'Order' : 'ShoppingBasket')}}</h1> <h1><t>ShoppingBasket</t></h1>
</div> </div>
<div id="actions"> <div id="actions">
<htk-bar-button <htk-bar-button
@ -8,52 +8,18 @@
tip="_ConfigureOrder" tip="_ConfigureOrder"
on-click="this.onConfigureClick()"/> on-click="this.onConfigureClick()"/>
<htk-bar-button <htk-bar-button
icon="shopping_bag" icon="local_florist"
tip="_Catalog" tip="_Catalog"
on-click="this.onCatalogClick()"/> on-click="this.hash.setAll({form: 'ecomerce/catalog'})"/>
<htk-bar-button <htk-bar-button
icon="shopping_cart_checkout" icon="shopping_cart_checkout"
tip="_Checkout" tip="_Checkout"
on-click="this.onConfirmClick()"/> on-click="this.hash.setAll({form: 'ecomerce/confirm'})"/>
</div> </div>
<vn-group> <div id="form" class="basket">
<vn-lot-query id="params" on-change="this.onHashChange()">
<vn-spec name="id" type="Number"/>
</vn-lot-query>
<vn-lot id="lot"/>
<db-form v-model="order" on-ready="onOrderReady">
<db-model property="model" lot="lot">
SELECT o.id, o.sent,
ag.description agency, v.code method,
ad.nickname, ad.postalCode, ad.city, ad.street
FROM myOrder o
JOIN vn.agencyMode ag ON ag.id = o.agencyModeFk
LEFT JOIN myAddress ad ON ad.id = o.addressFk
JOIN vn.deliveryMethod v ON v.id = o.deliveryMethodFk
WHERE o.id = #id;
</db-model>
</db-form>
</vn-group>
<div id="form" class="hedera-basket">
<div class="box vn-w-sm vn-pa-lg"> <div class="box vn-w-sm vn-pa-lg">
<div class="head vn-pb-lg"> <div class="head vn-pb-lg">
<h5>#{{order.id}}</h5> <p>
<div class="delivery">
<h6><t>ShippingInformation</t></h6>
<p>{{order.nickname}}</p>
<p>
<t>Delivery at</t> {{Vn.Value.format(order.sent, _('%D'))}}
</p>
<p>
<span id="method"><t>Agency</t></span> {{order.agency}}
</p>
</div>
<div id="address" class="address vn-mt-md">
<h6><t>DeliveryAddress</t></h6>
<p>{{order.street}}</p>
<p>{{order.postalCode}}, {{order.city}}</p>
</div>
<p class="total">
<t>Total</t> <t>Total</t>
<htk-text format="%.2d€"> <htk-text format="%.2d€">
<db-calc-sum property="param" func="subtotal" model="items"/> <db-calc-sum property="param" func="subtotal" model="items"/>
@ -62,16 +28,15 @@
</div> </div>
<div class="lines vn-pt-lg"> <div class="lines vn-pt-lg">
<htk-repeater form-id="iter"> <htk-repeater form-id="iter">
<db-model id="items" property="model" lot="lot" updatable="true"> <db-model id="items" property="model" updatable="true">
SELECT bi.id, bi.amount, bi.price, i.longName item, SELECT bi.id, bi.amount, bi.price, i.longName item,
i.tag5, i.value5, i.tag6, i.value6, i.tag7, i.value7, i.tag5, i.value5, i.tag6, i.value6, i.tag7, i.value7,
i.image, im.updated i.image, im.updated
FROM myOrderRow bi FROM myBasketItem bi
JOIN vn.item i ON i.id = bi.itemFk JOIN vn.item i ON i.id = bi.itemFk
LEFT JOIN image im LEFT JOIN image im
ON im.collectionFk = 'catalog' ON im.collectionFk = 'catalog'
AND im.name = i.image AND im.name = i.image
WHERE orderFk = #id
</db-model> </db-model>
<custom> <custom>
<div class="line"> <div class="line">

View File

@ -7,27 +7,19 @@ const Catalog = new Class({
,_menuShown: false ,_menuShown: false
,async open() { ,async open() {
const basket = new Hedera.Basket(this.app); let isOk = true;
if (!localStorage.getItem('hederaGuest')) { if (!localStorage.getItem('hederaGuest'))
if (await basket.check('catalog')) isOk = await Hedera.BasketChecker.check(this.conn, this.hash);
this.orderId = basket.orderId; else
} else { await this.conn.execQuery('CALL mybasket_configureForGuest');
const resultSet = await this.conn.execQuery(
'CALL myOrder_configureForGuest(@orderId); SELECT @orderId;');
resultSet.fetchResult(); if (isOk) await Hedera.Form.prototype.open.call(this);
this.orderId = resultSet.fetchValue();
}
if (this.orderId)
await Hedera.Form.prototype.open.call(this);
} }
,activate() { ,activate() {
document.body.appendChild(this.$.rightPanel); document.body.appendChild(this.$.rightPanel);
this.$.items.setInfo('i', 'item', 'vn', ['id']); this.$.items.setInfo('i', 'item', 'vn', ['id']);
this.$.orderLot.assign({orderId: this.orderId});
if (localStorage.getItem('hederaView')) if (localStorage.getItem('hederaView'))
this.setView(parseInt(localStorage.getItem('hederaView'))); this.setView(parseInt(localStorage.getItem('hederaView')));
@ -106,7 +98,6 @@ const Catalog = new Class({
break; break;
} }
params.orderId = this.orderId;
const refreshItems = hasTagFilter const refreshItems = hasTagFilter
|| params.search != null || params.search != null
|| params.type != null; || params.type != null;
@ -202,12 +193,6 @@ const Catalog = new Class({
this.hideMenu(); this.hideMenu();
} }
,itemRenderer(builder, form) {
var minQuantity = builder.$.minQuantity;
minQuantity.style.display = form.$.minQuantity
? 'block' : 'hidden';
}
,realmRenderer(builder, form) { ,realmRenderer(builder, form) {
var link = builder.$.link; var link = builder.$.link;
@ -260,11 +245,7 @@ const Catalog = new Class({
if (this.isGuest()) if (this.isGuest())
return; return;
this.hash.setAll({ this.hash.setAll({form: 'ecomerce/checkout'});
form: 'ecomerce/checkout',
id: this.orderId,
continue: 'catalog'
});
} }
,onAddItemClick(event, form) { ,onAddItemClick(event, form) {
@ -274,13 +255,8 @@ const Catalog = new Class({
this.onEraseClick(); this.onEraseClick();
this.$.$card.row = form.row; this.$.$card.row = form.row;
this.$.cardLot.assign({ this.$.cardLot.assign({item: form.$.id});
item: form.$.id,
orderId: this.orderId
});
this.$.cardPopup.show(event.currentTarget); this.$.cardPopup.show(event.currentTarget);
this.$.cardMinQuantity.style.display = form.$.minQuantity
? 'block' : 'none';
} }
,onAddLotClick(column, value, row) { ,onAddLotClick(column, value, row) {
@ -308,7 +284,7 @@ const Catalog = new Class({
,async onConfirmClick() { ,async onConfirmClick() {
var sql = ''; var sql = '';
var query = new Sql.String({query: 'CALL myOrder_addItem(#orderId, #warehouse, #item, #amount);'}); var query = new Sql.String({query: 'CALL myBasket_addItem(#warehouse, #item, #amount);'});
var amountSum = 0; var amountSum = 0;
for (var warehouse in this.items) { for (var warehouse in this.items) {
@ -316,7 +292,6 @@ const Catalog = new Class({
amountSum += amount; amountSum += amount;
const params = { const params = {
orderId: this.orderId,
warehouse: warehouse, warehouse: warehouse,
item: this.$.cardLot.$.item, item: this.$.cardLot.$.item,
amount: amount amount: amount
@ -325,7 +300,7 @@ const Catalog = new Class({
} }
if (amountSum > 0) { if (amountSum > 0) {
await this.conn.execQuery(sql); this.conn.execQuery(sql);
var itemName = this.$.$card.get('item'); var itemName = this.$.$card.get('item');
Htk.Toast.showMessage( Htk.Toast.showMessage(

View File

@ -46,4 +46,3 @@ NoMoreAmountAvailable: No hi ha més quantitat disponible
MinimalGrouping: Empaquetat mínim MinimalGrouping: Empaquetat mínim
Available: Disponible Available: Disponible
GroupingPrice: Preu per grup GroupingPrice: Preu per grup
MinimalQuantity: Quantitat mínima

View File

@ -46,4 +46,3 @@ NoMoreAmountAvailable: No more amount available
MinimalGrouping: Minimal packing MinimalGrouping: Minimal packing
Available: Available Available: Available
GroupingPrice: Price per group GroupingPrice: Price per group
MinimalQuantity: Minimal quantity

View File

@ -46,4 +46,3 @@ NoMoreAmountAvailable: No hay más cantidad disponible
MinimalGrouping: Empaquetado mínimo MinimalGrouping: Empaquetado mínimo
Available: Disponible Available: Disponible
GroupingPrice: Precio per grupo GroupingPrice: Precio per grupo
MinimalQuantity: Cantidad mínima

View File

@ -46,4 +46,3 @@ NoMoreAmountAvailable: Pas plus disponible
MinimalGrouping: Emballage minimal MinimalGrouping: Emballage minimal
Available: Disponible Available: Disponible
GroupingPrice: Prix par groupe GroupingPrice: Prix par groupe
MinimalQuantity: Quantité minimum

View File

@ -46,4 +46,3 @@ NoMoreAmountAvailable: Não há mais quantidade disponível
MinimalGrouping: Embalagem mínima MinimalGrouping: Embalagem mínima
Available: Disponível Available: Disponível
GroupingPrice: Preço por grupo GroupingPrice: Preço por grupo
MinimalQuantity: Quantidade mínima

View File

@ -192,25 +192,6 @@
margin: 0; margin: 0;
margin-bottom: 1px; margin-bottom: 1px;
} }
& > .min-quantity {
bottom: 32px;
right: 0;
}
}
.min-quantity {
position: absolute;
display: none;
bottom: 30px;
right: 0;
font-size: .8rem;
color: #a44;
cursor: pointer;
& > span {
font-size: 16px;
vertical-align: middle;
}
} }
/* Tags */ /* Tags */
@ -275,7 +256,7 @@
} }
& > .htk-image { & > .htk-image {
width: 100%; width: 100%;
height: 210px; height: 180px;
& > img { & > img {
height: initial; height: initial;
@ -285,7 +266,7 @@
flex: auto; flex: auto;
overflow: hidden; overflow: hidden;
margin: 10px; margin: 10px;
height: 185px; height: 170px;
& > h2 { & > h2 {
max-height: 3rem; max-height: 3rem;
@ -370,7 +351,6 @@
& > .top { & > .top {
padding: 14px; padding: 14px;
position: relative;
& > .item-info { & > .item-info {
margin-left: 126px; margin-left: 126px;
@ -391,11 +371,6 @@
margin-top: 15px 0; margin-top: 15px 0;
font-size: .9rem; font-size: .9rem;
} }
& > .min-quantity {
bottom: 0;
right: 0;
padding: 14px;
}
} }
& > .lots-grid { & > .lots-grid {
border-top: 1px solid #DDD; border-top: 1px solid #DDD;

View File

@ -91,13 +91,12 @@
param="producer"/> param="producer"/>
</vn-group> </vn-group>
<vn-group> <vn-group>
<vn-lot id="order-lot"/>
<db-form v-model="basket"> <db-form v-model="basket">
<db-model property="model" lot="order-lot"> <db-model property="model">
SELECT o.id, o.sent, ad.nickname SELECT b.id, b.sent, a.description agency, m.code method
FROM myOrder o FROM myBasket b
LEFT JOIN myAddress ad ON ad.id = o.addressFk JOIN vn.agencyMode a ON a.id = b.agencyModeFk
WHERE o.id = #orderId JOIN vn.deliveryMethod m ON m.id = b.deliveryMethodFk
</db-model> </db-model>
</db-form> </db-form>
<db-model <db-model
@ -113,11 +112,10 @@
FROM vn.item i FROM vn.item i
JOIN vn.itemType t ON t.id = i.typeFk JOIN vn.itemType t ON t.id = i.typeFk
WHERE #filter; WHERE #filter;
CALL myOrder_calcCatalogFull(#orderId); CALL myBasket_calcCatalogFull;
SELECT i.id, i.longName item, i.subName, SELECT i.id, i.longName item, i.subName,
i.tag5, i.value5, i.tag6, i.value6, i.tag5, i.value5, i.tag6, i.value6, i.tag7, i.value7,
i.tag7, i.value7, i.tag8, i.value8, i.relevancy, i.size, i.category,
i.relevancy, i.size, i.category, b.minQuantity,
k.name ink, p.name producer, o.name origin, k.name ink, p.name producer, o.name origin,
b.available, b.price, b.`grouping`, b.available, b.price, b.`grouping`,
i.image, im.updated i.image, im.updated
@ -126,13 +124,19 @@
LEFT JOIN vn.ink k ON k.id = i.inkFk LEFT JOIN vn.ink k ON k.id = i.inkFk
LEFT JOIN vn.producer p ON p.id = i.producerFk LEFT JOIN vn.producer p ON p.id = i.producerFk
LEFT JOIN vn.origin o ON o.id = i.originFk LEFT JOIN vn.origin o ON o.id = i.originFk
LEFT JOIN image im ON im.collectionFk = 'catalog' LEFT JOIN image im
ON im.collectionFk = 'catalog'
AND im.name = i.image AND im.name = i.image
WHERE b.available > 0 WHERE b.available > 0
ORDER BY i.relevancy DESC, i.name, i.size ORDER BY i.relevancy DESC, i.name, i.size
LIMIT 5000; LIMIT 5000;
DROP TEMPORARY TABLE tmp.item; DROP TEMPORARY TABLE
CALL vn.ticketCalculatePurge(); tmp.item,
tmp.ticketCalculateItem,
tmp.ticketComponentPrice,
tmp.ticketComponent,
tmp.ticketLot,
tmp.zoneGetShipped;
</db-model> </db-model>
<db-form id="$card" v-model="card" model="items"/> <db-form id="$card" v-model="card" model="items"/>
<vn-lot id="card-lot"/> <vn-lot id="card-lot"/>
@ -143,8 +147,7 @@
id="grid-view" id="grid-view"
empty-message="_Choose filter from right menu" empty-message="_Choose filter from right menu"
form-id="item" form-id="item"
model="items" model="items">
renderer="itemRenderer">
<custom> <custom>
<div <div
id="item-box" id="item-box"
@ -182,10 +185,6 @@
<td>{{item.tag7}}</td> <td>{{item.tag7}}</td>
<td>{{item.value7}}</td> <td>{{item.value7}}</td>
</tr> </tr>
<tr>
<td>{{item.tag8}}</td>
<td>{{item.value8}}</td>
</tr>
</table> </table>
<div class="available-price"> <div class="available-price">
<span class="grouping" title="_MinimalGrouping"> <span class="grouping" title="_MinimalGrouping">
@ -198,12 +197,6 @@
{{Vn.Value.format(item.price, '%.02d€')}} {{Vn.Value.format(item.price, '%.02d€')}}
</span> </span>
</div> </div>
<div id="min-quantity" class="min-quantity" title="_MinimalQuantity">
<span class="htk-icon material-symbols-rounded">
production_quantity_limits
</span>
{{item.minQuantity}}
</div>
</div> </div>
</div> </div>
</custom> </custom>
@ -212,8 +205,11 @@
</div> </div>
<div id="right-panel" class="catalog-panel right-panel side-panel" on-click="onRightPanelClick"> <div id="right-panel" class="catalog-panel right-panel side-panel" on-click="onRightPanelClick">
<div class="basket-info"> <div class="basket-info">
<p>{{basket.nickname}}</p>
<p>{{Vn.Value.format(basket.sent, '%D')}}</p> <p>{{Vn.Value.format(basket.sent, '%D')}}</p>
<p>
{{_(basket.method != 'PICKUP' ? 'Agency' : 'Warehouse')}}
{{basket.agency}}
</p>
<button class="thin" on-click="this.onConfigureClick()"> <button class="thin" on-click="this.onConfigureClick()">
<t>Modify</t> <t>Modify</t>
</button> </button>
@ -265,7 +261,7 @@
lot="params" lot="params"
result-index="1" result-index="1"
on-status-changed="refreshTitle"> on-status-changed="refreshTitle">
CALL myOrder_getAvailable(#orderId); CALL myBasket_getAvailable;
SELECT DISTINCT t.id, l.name SELECT DISTINCT t.id, l.name
FROM vn.item i FROM vn.item i
JOIN vn.itemType t ON t.id = i.typeFk JOIN vn.itemType t ON t.id = i.typeFk
@ -287,7 +283,7 @@
property="model" property="model"
auto-load="false" auto-load="false"
result-index="1"> result-index="1">
CALL myOrder_getAvailable(#orderId); CALL myBasket_getAvailable;
SELECT DISTINCT l.id, l.name SELECT DISTINCT l.id, l.name
FROM vn.item i FROM vn.item i
JOIN vn.itemType t ON t.id = i.typeFk JOIN vn.itemType t ON t.id = i.typeFk
@ -308,7 +304,7 @@
property="model" property="model"
auto-load="false" auto-load="false"
result-index="1"> result-index="1">
CALL myOrder_getAvailable(#orderId); CALL myBasket_getAvailable;
SELECT DISTINCT p.id, p.name SELECT DISTINCT p.id, p.name
FROM vn.item i FROM vn.item i
JOIN vn.itemType t ON t.id = i.typeFk JOIN vn.itemType t ON t.id = i.typeFk
@ -329,7 +325,7 @@
property="model" property="model"
auto-load="false" auto-load="false"
result-index="1"> result-index="1">
CALL myOrder_getAvailable(#orderId); CALL myBasket_getAvailable;
SELECT DISTINCT o.id, l.name, o.code SELECT DISTINCT o.id, l.name, o.code
FROM vn.item i FROM vn.item i
JOIN vn.itemType t ON t.id = i.typeFk JOIN vn.itemType t ON t.id = i.typeFk
@ -351,7 +347,7 @@
property="model" property="model"
auto-load="false" auto-load="false"
result-index="1"> result-index="1">
CALL myOrder_getAvailable(#orderId); CALL myBasket_getAvailable;
SELECT DISTINCT i.category, i.category SELECT DISTINCT i.category, i.category
FROM vn.item i FROM vn.item i
JOIN vn.itemType t ON t.id = i.typeFk JOIN vn.itemType t ON t.id = i.typeFk
@ -462,12 +458,6 @@
</tr> </tr>
</custom> </custom>
</htk-repeater> </htk-repeater>
<div id="card-min-quantity" class="min-quantity" title="_MinimalQuantity">
<span class="htk-icon material-symbols-rounded">
production_quantity_limits
</span>
{{card.minQuantity}}
</div>
</div> </div>
<htk-grid class="lots-grid" show-header="false"> <htk-grid class="lots-grid" show-header="false">
<db-model <db-model
@ -476,7 +466,7 @@
result-index="1" result-index="1"
on-status-changed-after="onCardLoad" on-status-changed-after="onCardLoad"
lot="card-lot"> lot="card-lot">
CALL myOrder_calcCatalogFromItem(#orderId, #item); CALL myBasket_calcCatalogFromItem(#item);
SELECT l.warehouseFk, w.name warehouse, p.`grouping`, SELECT l.warehouseFk, w.name warehouse, p.`grouping`,
p.price, p.priceKg, p.rate, l.available p.price, p.priceKg, p.rate, l.available
FROM tmp.ticketLot l FROM tmp.ticketLot l

View File

@ -8,7 +8,7 @@ export default new Class({
this.autoStepLocked = true; this.autoStepLocked = true;
this.$.assistant.stepsIndex = this.agencySteps; this.$.assistant.stepsIndex = this.agencySteps;
this.today = Date.vnNew(); this.today = new Date();
this.today.setHours(0, 0, 0, 0); this.today.setHours(0, 0, 0, 0);
}, },
@ -22,8 +22,8 @@ export default new Class({
let date; let date;
const row = orderForm.$ || defaultsForm.$ || {}; const row = orderForm.$ || defaultsForm.$ || {};
if (!date || date.getTime() < (Date.vnNew()).getTime()) { if (!date || date.getTime() < (new Date()).getTime()) {
date = Date.vnNew(); date = new Date();
date.setHours(0, 0, 0, 0); date.setHours(0, 0, 0, 0);
let addDays = 0; let addDays = 0;
@ -44,7 +44,7 @@ export default new Class({
} }
this.$.lot.assign({ this.$.lot.assign({
date, date: date,
method: row.deliveryMethod, method: row.deliveryMethod,
agency: row.agencyModeFk, agency: row.agencyModeFk,
address: row.addressFk address: row.addressFk
@ -59,21 +59,11 @@ export default new Class({
async onConfirmClick() { async onConfirmClick() {
this.disableButtons(true); this.disableButtons(true);
let id = this.$.params.$.id; const query = 'CALL myBasket_configure(#date, #method, #agency, #address)';
const params = Object.assign({}, this.$.lot.$);
let query;
if (id) {
params.id = id;
query = 'CALL myOrder_configure(#id, #date, #method, #agency, #address)';
} else {
query = 'CALL myOrder_create(@orderId, #date, #method, #agency, #address); SELECT @orderId;';
}
let resultSet; let resultSet;
try { try {
resultSet = await this.conn.execQuery(query, params); resultSet = await this.conn.execQuery(query, this.$.lot.$);
} finally { } finally {
this.disableButtons(false); this.disableButtons(false);
} }
@ -81,31 +71,16 @@ export default new Class({
if (!resultSet.fetchResult()) if (!resultSet.fetchResult())
return; return;
let redirect; if (this.$.orderForm.numRows > 0)
const basket = new Hedera.Basket(this.app);
if (id) {
Htk.Toast.showMessage(_('OrderUpdated')); Htk.Toast.showMessage(_('OrderUpdated'));
else
Htk.Toast.showMessage(_('OrderStarted'));
switch(this.hash.$.continue) { this.hash.setAll({form: 'ecomerce/catalog'});
case 'catalog':
redirect = {form: 'ecomerce/catalog'};
break;
default:
redirect = {form: 'ecomerce/basket'};
if (id !== basket.orderId)
redirect.id = id;
}
} else {
basket.loadIntoBasket(resultSet.fetchValue());
redirect = {form: 'ecomerce/catalog'};
}
this.hash.setAll(redirect);
}, },
onCancelClick() { onCancelClick() {
if (this.$.params.$.id) if (this.$.orderForm.numRows > 0)
window.history.back(); window.history.back();
else else
this.hash.setAll({form: 'ecomerce/orders'}); this.hash.setAll({form: 'ecomerce/orders'});
@ -175,9 +150,13 @@ export default new Class({
this.$.assistant.moveNext(); this.$.assistant.moveNext();
}, },
goNextStep() {
this.$.assistant.moveNext();
},
onAddressClick(addressId) { onAddressClick(addressId) {
this.$.lot.set('address', addressId); this.$.lot.set('address', addressId);
this.$.assistant.moveNext(); this.goNextStep();
}, },
onAddressChange() { onAddressChange() {
@ -213,9 +192,9 @@ export default new Class({
const defaults = this.$.defaults.$ || {}; const defaults = this.$.defaults.$ || {};
if (defaults.agencyModeFk) if (defaults.agencyModeFk)
agencies.push(defaults.agencyModeFk); defaults.push(defaults.agencyModeFk);
if (defaults.defaultAgencyFk) if (defaults.defaultAgencyFk)
agencies.push(defaults.defaultAgencyFk); defaults.push(defaults.defaultAgencyFk);
for (const agency of agencies) for (const agency of agencies)
if (model.search('id', agency) !== -1) { if (model.search('id', agency) !== -1) {

View File

@ -1,55 +1,54 @@
.hedera-checkout { .checkout .bar {
.bar { margin-bottom: 16px;
margin-bottom: 16px;
}
/* Step */
.answers button,
.answers p,
.radio > div {
font-size: 1.2rem;
}
.answers .htk-select {
max-width: 15em;
margin: 0 auto;
font-size: 1.4rem;
}
.answers p {
margin: 0.3em 0;
}
.target {
max-width: 28em;
margin: 0 auto;
}
.address {
border-radius: 0.1em;
padding: 0.6em 1.4em;
}
.address.selected {
background-color: rgba(1, 1, 1, .1);
}
.address:hover {
cursor: pointer;
background-color: rgba(1, 1, 1, .05);
}
.address p.consignee {
font-weight: bold;
}
.radio {
max-width: 20em;
margin: 0 auto;
}
.radio > div {
padding: 0.5em;
}
.thin-calendar {
max-width: 24em;
margin: 0 auto;
box-shadow: none;
}
.htk-assistant .thin {
float: right;
}
} }
/* Step */
.answers button,
.answers p,
.radio > div {
font-size: 1.2rem;
}
.answers .htk-select {
max-width: 15em;
margin: 0 auto;
font-size: 1.4rem;
}
.answers p {
margin: 0.3em 0;
}
.target {
max-width: 28em;
margin: 0 auto;
}
.address {
border-radius: 0.1em;
padding: 0.6em 1.4em;
}
.address.selected {
background-color: rgba(1, 1, 1, .1);
}
.address:hover {
cursor: pointer;
background-color: rgba(1, 1, 1, .05);
}
.address p.consignee {
font-weight: bold;
}
.radio {
max-width: 20em;
margin: 0 auto;
}
.radio > div {
padding: 0.5em;
}
.thin-calendar {
max-width: 24em;
margin: 0 auto;
box-shadow: none;
}
.htk-assistant .thin {
float: right;
}

View File

@ -1,7 +1,4 @@
<vn> <vn>
<vn-lot-query id="params">
<vn-spec name="id" type="Number"/>
</vn-lot-query>
<vn-group> <vn-group>
<vn-lot id="lot" on-change="this.onAddressChange()"/> <vn-lot id="lot" on-change="this.onAddressChange()"/>
<db-form id="defaults" on-ready="onValuesReady"> <db-form id="defaults" on-ready="onValuesReady">
@ -11,11 +8,10 @@
</db-model> </db-model>
</db-form> </db-form>
<db-form id="order-form" on-ready="onValuesReady"> <db-form id="order-form" on-ready="onValuesReady">
<db-model property="model" lot="params"> <db-model property="model">
SELECT m.code deliveryMethod, o.sent, o.agencyModeFk, o.addressFk SELECT m.code deliveryMethod, o.sent, o.agencyModeFk, o.addressFk
FROM myOrder o FROM myBasket o
JOIN vn.deliveryMethod m ON m.id = o.deliveryMethodFk JOIN vn.deliveryMethod m ON m.id = o.deliveryMethodFk
WHERE o.id = #id
</db-model> </db-model>
</db-form> </db-form>
<db-model id="agencies" <db-model id="agencies"
@ -58,7 +54,7 @@
tip="_Cancel" tip="_Cancel"
on-click="onCancelClick"/> on-click="onCancelClick"/>
</div> </div>
<div id="form" class="hedera-checkout"> <div id="form" class="checkout">
<div class="vn-w-sm"> <div class="vn-w-sm">
<div class="box bar"> <div class="box bar">
<htk-assistant-bar <htk-assistant-bar
@ -120,7 +116,7 @@
form-id="iter" form-id="iter"
on-change="onAddressChange"> on-change="onAddressChange">
<db-model property="model" id="addresses"> <db-model property="model" id="addresses">
SELECT a.id, a.nickname, p.name province, a.city, a.street, a.isActive, c.name SELECT a.id, a.nickname, p.name province, a.city, a.street, a.isActive, c.country
FROM myAddress a FROM myAddress a
LEFT JOIN vn.province p ON p.id = a.provinceFk LEFT JOIN vn.province p ON p.id = a.provinceFk
JOIN vn.country c ON c.id = p.countryFk JOIN vn.country c ON c.id = p.countryFk

View File

@ -5,13 +5,8 @@ export default new Class({
Template: require('./ui.xml'), Template: require('./ui.xml'),
async open() { async open() {
const basket = new Hedera.Basket(this.app); const isOk = await Hedera.BasketChecker.check(this.conn, this.hash);
try { if (isOk) await Hedera.Form.prototype.open.call(this);
await basket.checkOrder(this.hash.$.id);
} catch (err) {
Htk.Toast.showError(err.message);
}
await Hedera.Form.prototype.open.call(this);
}, },
onOrderReady(form) { onOrderReady(form) {
@ -67,7 +62,7 @@ export default new Class({
methods = ['balance']; methods = ['balance'];
selectedMethod = 'BALANCE'; selectedMethod = 'BALANCE';
} else { } else {
methods = ['card']; methods = ['card', 'transfer', 'later'];
if (!creditExceededCond) { if (!creditExceededCond) {
methods.push('credit'); methods.push('credit');
@ -98,6 +93,9 @@ export default new Class({
case 'CARD': case 'CARD':
id = 'cardMethod'; id = 'cardMethod';
break; break;
case 'TRANSFER':
id = 'transferMethod';
break;
default: default:
id = null; id = null;
} }
@ -108,22 +106,25 @@ export default new Class({
Vn.Node.addClass(this.$[id], 'selected'); Vn.Node.addClass(this.$[id], 'selected');
}, },
disableButtons(disable) {
this.$.modify.disabled = disable;
this.$.confirm.disabled = disable;
},
onModifyClick() { onModifyClick() {
window.history.back(); window.history.back();
}, },
async onConfirmClick() { async onConfirmClick() {
Vn.Node.disableInputs(this.node); this.disableButtons(true);
try { await this.$.confirmQuery.execute();
await this.conn.execQuery( },
'CALL myOrder_confirm(#id)',
this.$.params.$ onConfirm(query, resultSet) {
); this.disableButtons(false);
Hedera.Basket.unload();
if (resultSet.fetchResult())
this.$.successDialog.show(); this.$.successDialog.show();
} finally {
Vn.Node.disableInputs(this.node, false);
}
}, },
async onDialogResponse() { async onDialogResponse() {

View File

@ -1,95 +1,93 @@
.hedera-confirm { .confirm .summary {
.summary { margin-bottom: 16px;
margin-bottom: 16px;
}
p {
margin: .2em 0;
}
/* Table */
.debt-info {
padding: 0;
}
.debt-info > table {
border-collapse: collapse;
}
td {
padding: .15em 0;
}
.sum-total > td {
border-top: solid 1px #DDD;
font-weight: bold;
}
.currency {
text-align: right;
}
.credit-info {
display: none;
}
.exceeded-info {
display: none;
color: #E53935;
}
/* Pay */
.amount-selector,
.pay-methods > div {
display: none;
}
.pay-methods > div {
margin: .3em 0;
}
.pay-methods > div > label > input[type=radio] {
margin: 0;
margin-right: .5em;
vertical-align: middle;
}
.pay-methods > div > div {
padding: .5em 1.5em;
display: none;
}
.pay-methods > div.selected > div {
display: block;
}
.transfer-account {
margin-top: .5em;
}
.transfer-account > p {
margin: .1em 0;
}
.payment > div {
margin-bottom: 1.4em;
}
.payment > .button-bar {
display: flex;
justify-content: space-between;
margin-bottom: 0;
margin-top: 32px;
}
.payment > .button-bar button{
font-size: 1.2rem;
border-radius: 2rem;
padding: .5rem 1rem;
margin: 0;
}
.modify-order {
border: 1px solid #1a1a1a;
}
.modify-order:hover {
color: white;
background-color: #1a1a1a;
}
.confirm-order {
border: 1px solid #8cc63f;
background-color: #8cc63f;
color: white;
}
.confirm-order:hover {
background-color: transparent;
color: #6b5;
}
} }
.confirm p {
margin: .2em 0;
}
/* Table */
.confirm .debt-info {
padding: 0;
}
.confirm .debt-info > table {
border-collapse: collapse;
}
.confirm td {
padding: .15em 0;
}
.confirm .sum-total > td {
border-top: solid 1px #DDD;
font-weight: bold;
}
.confirm .currency {
text-align: right;
}
.confirm .credit-info {
display: none;
}
.confirm .exceeded-info {
display: none;
color: #E53935;
}
/* Pay */
.confirm .amount-selector,
.confirm .pay-methods > div {
display: none;
}
.confirm .pay-methods > div {
margin: .3em 0;
}
.confirm .pay-methods > div > label > input[type=radio] {
margin: 0;
margin-right: .5em;
vertical-align: middle;
}
.confirm .pay-methods > div > div {
padding: .5em 1.5em;
display: none;
}
.confirm .pay-methods > div.selected > div {
display: block;
}
.confirm .transfer-account {
margin-top: .5em;
}
.confirm .transfer-account > p {
margin: .1em 0;
}
.confirm .payment > div {
margin-bottom: 1.4em;
}
.confirm .payment > .button-bar {
display: flex;
justify-content: space-between;
margin-bottom: 0;
margin-top: 32px;
}
.confirm .payment > .button-bar button{
font-size: 1.2rem;
border-radius: 2rem;
padding: .5rem 1rem;
margin: 0;
}
.confirm .modify-order {
border: 1px solid #1a1a1a;
}
.confirm .modify-order:hover {
color: white;
background-color: #1a1a1a;
}
.confirm .confirm-order {
border: 1px solid #8cc63f;
background-color: #8cc63f;
color: white;
}
.confirm .confirm-order:hover {
background-color: transparent;
color: #6b5;
}

View File

@ -1,16 +1,13 @@
<vn> <vn>
<vn-lot-query id="params">
<vn-spec name="id" type="Number"/>
</vn-lot-query>
<vn-group> <vn-group>
<db-form v-model="order" on-ready="onOrderReady"> <db-form v-model="order" on-ready="onOrderReady">
<db-model property="model" result-index="1" lot="params"> <db-model property="model" result-index="1">
CALL myOrder_getTax(#id); CALL myBasket_getTax;
SELECT o.id, o.sent, o.notes, o.companyFk, SELECT o.id, o.sent, o.notes, o.companyFk,
ag.description agency, v.code method, ag.description agency, v.code method,
ad.nickname, ad.postalCode, ad.city, ad.street, ad.nickname, ad.postalCode, ad.city, ad.street,
t.*, c.credit, myClient_getDebt(NULL) debt t.*, c.credit, myClient_getDebt(NULL) debt
FROM myOrder o FROM myBasket o
JOIN vn.agencyMode ag ON ag.id = o.agencyModeFk JOIN vn.agencyMode ag ON ag.id = o.agencyModeFk
LEFT JOIN myAddress ad ON ad.id = o.addressFk LEFT JOIN myAddress ad ON ad.id = o.addressFk
JOIN vn.deliveryMethod v ON v.id = o.deliveryMethodFk JOIN vn.deliveryMethod v ON v.id = o.deliveryMethodFk
@ -20,27 +17,27 @@
IFNULL(SUM(taxableBase), 0) taxableBase, IFNULL(SUM(taxableBase), 0) taxableBase,
IFNULL(SUM(tax), 0) tax IFNULL(SUM(tax), 0) tax
FROM tmp.orderAmount FROM tmp.orderAmount
) t ) t;
WHERE o.id = #id;
DROP TEMPORARY TABLE DROP TEMPORARY TABLE
tmp.orderAmount, tmp.orderAmount,
tmp.orderTax; tmp.orderTax;
</db-model> </db-model>
</db-form> </db-form>
<db-query id="confirm-query" on-ready="onConfirm">
CALL myBasket_confirm
</db-query>
</vn-group> </vn-group>
<div id="title"> <div id="title">
<h1><t>Order summary</t></h1> <h1><t>Order summary</t></h1>
</div> </div>
<div id="form" class="hedera-confirm"> <div id="form" class="confirm">
<div class="vn-w-sm"> <div class="vn-w-sm">
<div class="box vn-pa-lg summary"> <div class="box vn-pa-lg summary">
<div> <div>
<h5>#{{order.id}}</h5>
<div class="delivery"> <div class="delivery">
<h6><t>ShippingInformation</t></h6> <h6><t>ShippingInformation</t></h6>
<p>{{order.nickname}}</p>
<p> <p>
<t>Delivery at</t> {{Vn.Value.format(order.sent, _('%D'))}} <t>Delivery at</t> {{Vn.Value.format(order.sent, _('%D'))}}
</p> </p>
<p> <p>
<span id="method"><t>Agency</t></span> {{order.agency}} <span id="method"><t>Agency</t></span> {{order.agency}}
@ -48,6 +45,7 @@
</div> </div>
<div id="address" class="address vn-mt-md"> <div id="address" class="address vn-mt-md">
<h6><t>DeliveryAddress</t></h6> <h6><t>DeliveryAddress</t></h6>
<p>{{order.nickname}}</p>
<p>{{order.street}}</p> <p>{{order.street}}</p>
<p>{{order.postalCode}}, {{order.city}}</p> <p>{{order.postalCode}}, {{order.city}}</p>
</div> </div>
@ -162,6 +160,32 @@
<t>You will be redirected to the payment.</t> <t>You will be redirected to the payment.</t>
</div> </div>
</div> </div>
<div id="transfer-method">
<label>
<htk-radio radio-group="pay-method" value="TRANSFER"/>
<t>Bank Transfer</t>
</label>
<div>
<t>Make a transfer to one account.</t>
<htk-repeater form-id="iter">
<db-model property="model">
SELECT name, iban FROM mainAccountBank
</db-model>
<custom>
<div class="transfer-account">
<p>{{iter.name}}</p>
<p>{{iter.iban}}</p>
</div>
</custom>
</htk-repeater>
</div>
</div>
<div id="later-method">
<label>
<htk-radio radio-group="pay-method" value="LATER"/>
<t>Pay later</t>
</label>
</div>
</div> </div>
</div> </div>
<div class="button-bar vn-mt-md"> <div class="button-bar vn-mt-md">

View File

@ -3,17 +3,30 @@ import './style.scss';
export default new Class({ export default new Class({
Extends: Hedera.Form, Extends: Hedera.Form,
Template: require('./ui.xml'), Template: require('./ui.xml'),
donwloadRenderer(column, invoice) {
var invoiceId = invoice.$.id;
onDownloadClick(column, value, row) { if (invoice.$.hasPdf && invoiceId) {
var model = this.$.invoices; var params = {
var hasPdf = model.get(row, 'hasPdf'); srv: 'rest:dms/invoice',
var id = model.get(row, 'id'); invoice: invoiceId,
access_token: this.conn.token
};
if (hasPdf && id) { Object.assign(column, {
let params = Vn.Url.makeUri({ access_token: this.conn.token }); tip: _('Download PDF'),
window.open(`/api/InvoiceOuts/${id}/download?${params}`); disabled: false,
icon: 'download',
href: '?'+ Vn.Url.makeUri(params)
});
} else } else
Htk.Toast.showWarning(_('Request the invoice to your salesperson')); Object.assign(column, {
tip: _('Request the invoice to your salesperson'),
disabled: true,
icon: 'warning',
href: null
});
} }
}); });

View File

@ -2,11 +2,11 @@
<div id="title"> <div id="title">
<h1><t>Invoices</t></h1> <h1><t>Invoices</t></h1>
</div> </div>
<div id="form" class="hedera-invoices"> <div id="form" class="invoices">
<htk-grid <htk-grid
class="box vn-w-sm" class="box vn-w-sm"
show-header="false"> show-header="false">
<db-model property="model" id="invoices"> <db-model property="model" id="tickets">
SELECT id, ref, issued, amount, hasPdf SELECT id, ref, issued, amount, hasPdf
FROM myInvoice FROM myInvoice
ORDER BY issued DESC ORDER BY issued DESC
@ -16,9 +16,8 @@
<htk-column-date title="_Date" column="issued" format="_%e %b %Y"/> <htk-column-date title="_Date" column="issued" format="_%e %b %Y"/>
<htk-column-spin title="_Import" column="amount" unit="€" digits="2"/> <htk-column-spin title="_Import" column="amount" unit="€" digits="2"/>
<htk-column-button <htk-column-button
icon="download" renderer="donwloadRenderer"
tip="_Download PDF" target="_blank"/>
on-clicked="onDownloadClick"/>
</htk-grid> </htk-grid>
</div> </div>
</vn> </vn>

View File

@ -5,7 +5,7 @@ OrderNumber: N encàrrec
DateMake: Data de creació DateMake: Data de creació
DateExit: Data d'eixida DateExit: Data d'eixida
SendMethod: Forma d'enviament SendMethod: Forma d'enviament
LastOrders: Comandes confirmades LastOrders: Últimes comandes
'Balance:': 'Saldo:' 'Balance:': 'Saldo:'
PaymentInfo: >- PaymentInfo: >-
La quantitat mostrada és el teu saldo pendent (negatiu) o favorable a dia La quantitat mostrada és el teu saldo pendent (negatiu) o favorable a dia

View File

@ -5,7 +5,7 @@ OrderNumber: Order number
DateMake: Creation date DateMake: Creation date
DateExit: Shipping date DateExit: Shipping date
SendMethod: Delivery method SendMethod: Delivery method
LastOrders: Confirmed orders LastOrders: Last orders
'Balance:': 'Balance:' 'Balance:': 'Balance:'
PaymentInfo: >- PaymentInfo: >-
The amount shown is your slope (negative) or favorable balance today, it The amount shown is your slope (negative) or favorable balance today, it

View File

@ -5,7 +5,7 @@ OrderNumber: Nº pedido
DateMake: Fecha de creación DateMake: Fecha de creación
DateExit: Fecha de salida DateExit: Fecha de salida
SendMethod: Forma de envío SendMethod: Forma de envío
LastOrders: Pedidos confirmados LastOrders: Últimos pedidos
'Balance:': 'Saldo:' 'Balance:': 'Saldo:'
PaymentInfo: >- PaymentInfo: >-
La cantidad mostrada es tu saldo pendiente (negativa) o favorable a día de La cantidad mostrada es tu saldo pendiente (negativa) o favorable a día de

View File

@ -5,7 +5,7 @@ OrderNumber: Numéro de commande
DateMake: Date de creation DateMake: Date de creation
DateExit: Date de sortie DateExit: Date de sortie
SendMethod: Typo SendMethod: Typo
LastOrders: Commandes confirmées LastOrders: Les dernières commandes
'Balance:': 'Balance:' 'Balance:': 'Balance:'
PaymentInfo: >- PaymentInfo: >-
Le montant indiqué est votre pente (négative) ou balance favorable Le montant indiqué est votre pente (négative) ou balance favorable

View File

@ -0,0 +1,37 @@
OpenOrders: Open orders
StartOrder: Start order
ContinueOrder: Continue order
OrderNumber: Order number
DateMake: Creation date
DateExit: Shipping date
SendMethod: Delivery method
LastOrders: Last orders
'Balance:': 'Balance:'
PaymentInfo: >-
Үзүүлсэн хэмжээ цаашид захиалга эзэлж биш, таны налуу (сөрөг), эсвэл
тааламжтай тэнцвэр нь өнөөдөр юм. Хэрэв та дүн арилгаж гэж хэлж байсан нь доош
нь төлбөр хийж, өөрийн хүссэн хэмжээгээр орж хүсэж байгаа бол таны захиалга
ирдэг бол авах, энэ хэмжээ тэнцүү буюу 0-ээс их байх ёстой.
MakePayment: Make payment
Company: Company
Pending: Pending
Pay: Pay
Basket: Basket
ShoppingBasket: Shopping basket
SeeOrder: Show details of the order
Delivery: Delivery
TicketNumber: Ticket number
SentAddress: Delivery address
Consignee: Consignee
Boxes: Bundles
TotalWithVAT: Total with VAT
PayOrder: Pay order
'AmountToPay:': 'Amount to pay (€):'
AmountError: >-
The amount must be a positive number less than or equal to the outstanding
amount
PayError: Failed to make the payment
An error has been in the payment: >-
It seems that there has been an error in the payment
Retry: Retry
Accept: Accept

View File

@ -5,7 +5,7 @@ OrderNumber: Nº pedido
DateMake: Data de criação DateMake: Data de criação
DateExit: Data de saída DateExit: Data de saída
SendMethod: Forma de envío SendMethod: Forma de envío
LastOrders: Encomendas confirmadas LastOrders: Últimas encomendas
'Balance:': 'Saldo:' 'Balance:': 'Saldo:'
PaymentInfo: >- PaymentInfo: >-
A quantidade mostrada é seu saldo pendente (negativo) ou favorável a dia de A quantidade mostrada é seu saldo pendente (negativo) ou favorável a dia de

View File

@ -33,6 +33,7 @@
/* List */ /* List */
.hedera-orders .htk-list .total { .orders .htk-list .total {
float: right; float: right;
} }

View File

@ -34,7 +34,7 @@
tip="_ShoppingBasket" tip="_ShoppingBasket"
on-click="onBasketClick"/> on-click="onBasketClick"/>
</div> </div>
<div id="form" class="hedera-orders"> <div id="form" class="orders">
<htk-repeater <htk-repeater
class="htk-list box confirmed vn-w-sm" class="htk-list box confirmed vn-w-sm"
form-id="iter" form-id="iter"

View File

@ -1,21 +0,0 @@
import './style.scss';
export default new Class({
Extends: Hedera.Form,
Template: require('./ui.xml'),
activate() {
this.basket = new Hedera.Basket(this.app);
this.$.orders.setInfo('o', 'myOrder', 'hedera', ['id'], 'id');
},
async onRemoveOrderClick(form) {
if (confirm(_('AreYouSureDeleteOrder')))
await form.deleteRow();
},
async loadOrder(id) {
const basket = new Hedera.Basket(this.app);
await basket.load(id);
}
});

View File

@ -1,8 +0,0 @@
Pending: Pendents
PendingOrders: Comandes pendents
NewOrder: Nova comanda
ViewOrder: Veure comanda
RemoveOrder: Eliminar comanda
LoadOrderIntoCart: Carregar comanda a la cistella
AreYouSureDeleteOrder: Segur que vols esborrar la comanda?
OrderLoadedIntoBasket: Comanda carregada a la cistella!

View File

@ -1,8 +0,0 @@
Pending: Pending
PendingOrders: Pending orders
NewOrder: New order
ViewOrder: View order
RemoveOrder: Delete order
LoadOrderIntoCart: Load order into cart
AreYouSureDeleteOrder: Are you sure you want to delete the order?
OrderLoadedIntoBasket: Order loaded into basket!

View File

@ -1,8 +0,0 @@
Pending: Pendientes
PendingOrders: Pedidos pendientes
NewOrder: Nuevo pedido
ViewOrder: Ver pedido
RemoveOrder: Eliminar pedido
LoadOrderIntoCart: Cargar pedido en la cesta
AreYouSureDeleteOrder: ¿Seguro que quieres borrar el pedido?
OrderLoadedIntoBasket: ¡Pedido cargado en la cesta!

View File

@ -1,8 +0,0 @@
Pending: En attente
PendingOrders: Commandes en attente
NewOrder: Nouvelle commande
ViewOrder: Afficher la commande
RemoveOrder: Supprimer la commande
LoadOrderIntoCart: Charger la commande dans le panier
AreYouSureDeleteOrder: Êtes-vous sûr de vouloir supprimer la commande?
OrderLoadedIntoBasket: Commande chargée dans le panier!

View File

@ -1,8 +0,0 @@
Pending: Pendentes
PendingOrders: Pedidos pendentes
NewOrder: Novo pedido
ViewOrder: Ver pedido
RemoveOrder: Excluir pedido
LoadOrderIntoCart: Carrega o pedido no carrinho
AreYouSureDeleteOrder: Tem certeza de que deseja excluir o pedido?
OrderLoadedIntoBasket: Pedido carregado na cesta!

View File

@ -1,54 +0,0 @@
<vn>
<div id="title">
<h1><t>PendingOrders</t></h1>
</div>
<div id="actions">
<htk-bar-button
class="start-order"
icon="add_shopping_cart"
tip="_NewOrder"
on-click="hash.setAll({form: 'ecomerce/checkout'})"/>
</div>
<div id="form" class="hedera-pending">
<htk-repeater
class="htk-list box confirmed vn-w-sm"
form-id="iter">
<db-model property="model" id="orders">
SELECT o.id, o.sent, o.deliveryMethodFk, o.taxableBase,
a.nickname, am.description agency
FROM myOrder o
JOIN myAddress a ON a.id = o.addressFk
JOIN vn.agencyMode am ON am.id = o.agencyModeFk
WHERE NOT o.isConfirmed
ORDER BY o.sent DESC
</db-model>
<custom>
<a class="item"
title="{{_('ViewOrder')}}"
href="{{'#!form=ecomerce/basket&amp;id='+iter.id}}">
<div class="content">
<p class="important">
{{Vn.Value.format(iter.sent, '%D')}}
</p>
<p>#{{iter.id}}</p>
<p>{{iter.nickname}}</p>
<p>{{iter.agency}}</p>
<p>{{Vn.Value.format(iter.taxableBase, '%.2d€')}}</p>
</div>
<div
class="actions"
on-click="$event.preventDefault()">
<htk-button
icon="delete"
tip="_RemoveOrder"
on-click="this.onRemoveOrderClick($iter)"/>
<htk-button
icon="shopping_bag"
tip="_LoadOrderIntoCart"
on-click="this.loadOrder(iter.id)"/>
</div>
</a>
</custom>
</htk-repeater>
</div>
</vn>

View File

@ -1,79 +1,78 @@
.hedera-ticket { /* Header */
/* Header */
.head { .ticket .head {
padding: 0; padding: 0;
padding-bottom: 3px; padding-bottom: 3px;
border-bottom: 1px solid #DDD; border-bottom: 1px solid #DDD;
margin-bottom: 1px; margin-bottom: 1px;
}
.head > div > div {
margin: 15px 0;
}
.head > div > div:first-child {
margin: 0;
}
.head p {
margin: 3px 0;
}
.head p.important {
font-size: 1.2rem;
font-weight: bold;
}
.total {
text-align: right;
}
.packages {
margin-top: 14px;
padding-top: 14px;
border-top: 1px solid #DDD;
display: block;
}
/* Lines */
.line {
display: flex;
align-items: center;
gap: 12px;
margin: 10px 0;
height: 80px;
}
.line:last-child {
margin-bottom: 0;
}
.line > .photo {
flex: none;
border-radius: 50%;
width: 68px;
height: 68px;
gap: 0;
}
.line > .info {
flex: 1;
overflow: hidden;
}
.line > .info > * {
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
.line > .info > h2 {
font-size: 1rem;
font-weight: normal;
margin-bottom: 2px;
}
.line > .info > p {
margin: 0;
}
.line > .info > .tags {
color: #777;
}
.line > .info .discount {
color: green;
}
.line > .info > .subtotal {
float: right;
}
} }
.ticket .head > div > div {
margin: 15px 0;
}
.ticket .head > div > div:first-child {
margin: 0;
}
.ticket .head p {
margin: 3px 0;
}
.ticket .head p.important {
font-size: 1.2rem;
font-weight: bold;
}
.ticket .total {
text-align: right;
}
.ticket .packages {
margin-top: 14px;
padding-top: 14px;
border-top: 1px solid #DDD;
display: block;
}
/* Lines */
.ticket .line {
display: flex;
align-items: center;
gap: 12px;
margin: 10px 0;
height: 80px;
}
.ticket .line:last-child {
margin-bottom: 0;
}
.ticket .line > .photo {
flex: none;
border-radius: 50%;
width: 68px;
height: 68px;
gap: 0;
}
.ticket .line > .info {
flex: 1;
overflow: hidden;
}
.ticket .line > .info > * {
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
.ticket .line > .info > h2 {
font-size: 1rem;
font-weight: normal;
margin-bottom: 2px;
}
.ticket .line > .info > p {
margin: 0;
}
.ticket .line > .info > .tags {
color: #777;
}
.ticket .line > .info .discount {
color: green;
}
.ticket .line > .info > .subtotal {
float: right;
}

View File

@ -14,7 +14,7 @@
tip="_Print delivery note" tip="_Print delivery note"
on-click="this.onPrintClick()"/> on-click="this.onPrintClick()"/>
</div> </div>
<div id="form" class="hedera-ticket"> <div id="form" class="ticket">
<div class="box vn-w-sm vn-pa-lg"> <div class="box vn-w-sm vn-pa-lg">
<htk-loader class="head" form="ticket-form"> <htk-loader class="head" form="ticket-form">
<h5>#{{ticket.id}}</h5> <h5>#{{ticket.id}}</h5>

View File

@ -1,44 +1,42 @@
<vn> <vn>
<vn-lot id="lot"/> <vn-lot id="lot"/>
<div id="title"> <div id="title">
<h1><t>Item list</t></h1> <h1><t>Item list</t></h1>
</div> </div>
<div id="actions" class="action-bar"> <div id="actions" class="action-bar">
<htk-bar-button <htk-bar-button
icon="print" icon="print"
tip="_Preview" tip="_Preview"
on-click="this.onPreviewClick()"/> on-click="this.onPreviewClick()"/>
</div> </div>
<div id="form" class="items"> <div id="form" class="items">
<div class="form box vn-w-sm vn-pa-lg"> <div class="form box vn-w-sm vn-pa-lg">
<div class="form-group"> <div class="form-group">
<label><t>Store</t></label> <label><t>Store</t></label>
<htk-combo form="lot" column="warehouse"> <htk-combo form="lot" column="warehouse">
<db-model property="model"> <db-model property="model">
SELECT id, name SELECT id, name FROM vn2008.warehouse
FROM vn.warehouse WHERE reserve ORDER BY name
WHERE hasAvailable </db-model>
ORDER BY name </htk-combo>
</db-model> </div>
</htk-combo> <div class="form-group">
</div> <label><t>Realm</t></label>
<div class="form-group"> <htk-combo form="lot" column="realm" not-null="false">
<label><t>Realm</t></label> <db-model property="model">
<htk-combo form="lot" column="realm" not-null="false"> SELECT id, reino FROM vn2008.reinos
<db-model property="model"> WHERE display != FALSE ORDER BY reino
SELECT id, name FROM vn.itemCategory </db-model>
WHERE display ORDER BY name </htk-combo>
</db-model> </div>
</htk-combo> <div class="form-group">
</div> <label><t>Rate</t></label>
<div class="form-group"> <select id="rate">
<label><t>Rate</t></label> <option>3</option>
<select id="rate"> <option>2</option>
<option>3</option> <option>1</option>
<option>2</option> </select>
<option>1</option> </div>
</select> </div>
</div> </div>
</div> </vn>
</div>
</vn>

View File

@ -6,7 +6,7 @@ export default new Class({
activate() { activate() {
this.$.lot.assign({ this.$.lot.assign({
date: Date.vnNew(), date: new Date(),
useIds: false useIds: false
}); });
}, },

View File

@ -1,107 +1,105 @@
<vn> <vn>
<vn-lot-query id="params"> <vn-lot-query id="params">
<vn-spec name="config" type="Number"/> <vn-spec name="config" type="Number"/>
</vn-lot-query> </vn-lot-query>
<vn-lot id="lot"/> <vn-lot id="lot"/>
<div id="title"> <div id="title">
<h1><t>Shelves</t></h1> <h1><t>Shelves</t></h1>
</div> </div>
<div id="actions" class="action-bar"> <div id="actions" class="action-bar">
<htk-bar-button <htk-bar-button
icon="print" icon="print"
tip="_Preview" tip="_Preview"
on-click="this.onPreviewClick()"/> on-click="this.onPreviewClick()"/>
</div> </div>
<div id="form" class="shelves"> <div id="form" class="shelves">
<div class="form box vn-w-sm vn-pa-lg"> <div class="form box vn-w-sm vn-pa-lg">
<div class="form-group"> <div class="form-group">
<label><t>Configuration</t></label> <label><t>Configuration</t></label>
<htk-combo <htk-combo
id="config" id="config"
placeholder="_Select config" placeholder="_Select config"
form="params" form="params"
column="config" column="config"
on-changed="this.onConfigChange()" on-changed="this.onConfigChange()"
on-ready="this.onConfigChange()"> on-ready="this.onConfigChange()">
<db-model property="model"> <db-model property="model">
SELECT c.id, c.name reportTitle, c.namePrefix, c.warehouse, c.family, SELECT c.id, c.name reportTitle, c.namePrefix, c.warehouse, c.family,
c.shelf, c.maxAmount, c.showPacking, c.stack, it.categoryFk realm c.shelf, c.maxAmount, c.showPacking, c.stack, t.reino_id realm
FROM shelfMultiConfig c FROM shelfConfig c
JOIN vn.itemType it ON it.id = c.family JOIN vn2008.Tipos t ON t.tipo_id = c.family
</db-model> </db-model>
</htk-combo> </htk-combo>
</div> </div>
<div class="form-group"> <div class="form-group">
<label><t>Date</t></label> <label><t>Date</t></label>
<htk-date-chooser form="lot" name="date"/> <htk-date-chooser form="lot" name="date"/>
</div> </div>
<div class="form-group"> <div class="form-group">
<label><t>Reign</t></label> <label><t>Reign</t></label>
<htk-combo form="lot" name="realm"> <htk-combo form="lot" name="realm">
<db-model property="model"> <db-model property="model">
SELECT id, name FROM vn.itemCategory SELECT id, reino FROM vn2008.reinos
WHERE display ORDER BY name WHERE display != FALSE ORDER BY reino
</db-model> </db-model>
</htk-combo> </htk-combo>
</div> </div>
<div class="form-group"> <div class="form-group">
<label><t>Family</t></label> <label><t>Family</t></label>
<htk-combo form="lot" name="family"> <htk-combo form="lot" name="family">
<db-model property="model" lot="lot"> <db-model property="model" lot="lot">
SELECT id, name FROM vn.itemType SELECT tipo_id, Tipo FROM vn2008.Tipos
WHERE categoryFk = #realm ORDER BY name WHERE reino_id = #realm ORDER BY Tipo
</db-model> </db-model>
</htk-combo> </htk-combo>
</div> </div>
<div class="form-group"> <div class="form-group">
<label><t>Store</t></label> <label><t>Store</t></label>
<htk-combo form="lot"> <htk-combo form="lot">
<db-model property="model"> <db-model property="model">
SELECT id, name SELECT id, name FROM vn2008.warehouse
FROM vn.warehouse WHERE reserve ORDER BY name
WHERE hasAvailable </db-model>
ORDER BY name </htk-combo>
</db-model> </div>
</htk-combo> <div class="form-group">
</div> <label><t>Shelf</t></label>
<div class="form-group"> <htk-combo form="lot" name="shelf">
<label><t>Shelf</t></label> <db-model property="model">
<htk-combo form="lot" name="shelf"> SELECT id, name FROM shelf
<db-model property="model"> </db-model>
SELECT id, name FROM shelf </htk-combo>
</db-model> </div>
</htk-combo> <div class="form-group">
</div> <label><t>Name prefix</t></label>
<div class="form-group"> <htk-entry form="lot" name="namePrefix"/>
<label><t>Name prefix</t></label> </div>
<htk-entry form="lot" name="namePrefix"/> <div class="form-group">
</div> <label><t>Limit amount per item</t></label>
<div class="form-group"> <htk-entry form="lot" name="maxAmount"/>
<label><t>Limit amount per item</t></label> </div>
<htk-entry form="lot" name="maxAmount"/> <div class="form-group">
</div> <label><t>Title</t></label>
<div class="form-group"> <htk-entry form="lot" name="reportTitle"/>
<label><t>Title</t></label> </div>
<htk-entry form="lot" name="reportTitle"/> <div class="form-group">
</div> <label>
<div class="form-group"> <htk-check form="lot" name="showPacking"/>
<label> <t>Show packing</t>
<htk-check form="lot" name="showPacking"/> </label>
<t>Show packing</t> </div>
</label> <div class="form-group">
</div> <label>
<div class="form-group"> <htk-check form="lot" name="stack"/>
<label> <t>Stack different items</t>
<htk-check form="lot" name="stack"/> </label>
<t>Stack different items</t> </div>
</label> <div class="form-group">
</div> <label>
<div class="form-group"> <htk-check form="lot" name="useIds"/>
<label> <t>Use ids instead of names</t>
<htk-check form="lot" name="useIds"/> </label>
<t>Use ids instead of names</t> </div>
</label> </div>
</div> </div>
</div> </vn>
</div>
</vn>

View File

@ -40,7 +40,9 @@ export const routes = {
}, },
agencies: { agencies: {
packages: packages:
() => import('agencies/packages') () => import('agencies/packages'),
provinces:
() => import('agencies/provinces')
}, },
cms: { cms: {
about: about:
@ -68,9 +70,7 @@ export const routes = {
orders: orders:
() => import('ecomerce/orders'), () => import('ecomerce/orders'),
ticket: ticket:
() => import('ecomerce/ticket'), () => import('ecomerce/ticket')
pending:
() => import('ecomerce/pending')
}, },
news: { news: {
new: new:

View File

@ -1,123 +1,130 @@
const Result = require('./result');
var Result = require('./result');
/** /**
* This class stores the database results. * This class stores the database results.
*/ */
module.exports = new Class({ module.exports = new Class({
results: null results: null,
,error: null error: null,
/** /**
* Initilizes the resultset object. * Initilizes the resultset object.
*/ */
,initialize(results, error) { initialize(results, error) {
this.results = results; this.results = results;
this.error = error; this.error = error;
} },
/**
* Gets the query error.
*
* @return {Db.Err} the error or null if no errors hapened
*/
,getError() {
return this.error;
}
,fetch() {
if (this.error)
throw this.error;
if (this.results !== null
&& this.results.length > 0)
return this.results.shift();
return null; /**
} * Gets the query error.
*
/** * @return {Db.Err} the error or null if no errors hapened
* Fetchs the next result from the resultset. */
* getError() {
* @return {Db.Result} the result or %null if error or there are no more results return this.error;
*/ },
,fetchResult() {
var result = this.fetch();
if (result !== null) {
if (result.data instanceof Array)
return new Result(result);
else
return true;
}
return null; fetch() {
} if (this.error) {
throw this.error;
}
console.log('this.results', this.results);
if (this.results !== null && this.results.length > 0) {
return this.results.shift();
}
/** return null;
* Fetchs the first row object from the next resultset. },
*
* @return {Array} the row if success, %null otherwise
*/
,fetchObject() {
var result = this.fetch();
if (result !== null /**
&& result.data instanceof Array * Fetchs the next result from the resultset.
&& result.data.length > 0) *
return result.data[0]; * @return {Db.Result} the result or %null if error or there are no more results
*/
fetchResult() {
const result = this.fetch();
console.log('test result', result);
if (result !== null) {
if (result.data instanceof Array) {
return new Result(result);
} else {
return true;
}
}
return null; return null;
} },
/** /**
* Fetchs data from the next resultset. * Fetchs the first row object from the next resultset.
* *
* @return {Array} the data * @return {Array} the row if success, %null otherwise
*/ */
,fetchData() { fetchObject() {
var result = this.fetch(); const result = this.fetch();
if (result !== null if (
&& result.data instanceof Array) result !== null &&
return result.data; result.data instanceof Array &&
result.data.length > 0
) {
return result.data[0];
}
return null; return null;
} },
/** /**
* Fetchs the first row and column value from the next resultset. * Fetchs data from the next resultset.
* *
* @return {Object} the value if success, %null otherwise * @return {Array} the data
*/ */
,fetchValue() { fetchData() {
var row = this.fetchRow(); const result = this.fetch();
if (row instanceof Array && row.length > 0) if (result !== null && result.data instanceof Array) {
return row[0]; return result.data;
}
return null; return null;
} },
/** /**
* Fetchs the first row from the next resultset. * Fetchs the first row and column value from the next resultset.
* *
* @return {Array} the row if success, %null otherwise * @return {Object} the value if success, %null otherwise
*/ */
,fetchRow() { fetchValue() {
var result = this.fetch(); const row = this.fetchRow();
if (result !== null if (row instanceof Array && row.length > 0) {
&& result.data instanceof Array return row[0];
&& result.data.length > 0) { }
var object = result.data[0];
var row = new Array(result.columns.length); return null;
for(var i = 0; i < row.length; i++) },
row[i] = object[result.columns[i].name];
return row; /**
} * Fetchs the first row from the next resultset.
*
return null; * @return {Array} the row if success, %null otherwise
} */
fetchRow() {
const result = this.fetch();
if (
result !== null &&
result.data instanceof Array &&
result.data.length > 0
) {
const object = result.data[0];
const row = new Array(result.columns.length);
for (let i = 0; i < row.length; i++) {
row[i] = object[result.columns[i].name];
}
return row;
}
return null;
}
}); });

View File

@ -9,24 +9,6 @@ module.exports = new Class({
,get() { ,get() {
return this._conn; return this._conn;
} }
},
hash: {
type: Vn.Hash
,get() {
return this._hash;
}
},
gui: {
type: Gui
,get() {
return this._gui;
}
},
login: {
type: Login
,get() {
return this._login;
}
} }
} }
@ -53,7 +35,6 @@ module.exports = new Class({
,showLogin() { ,showLogin() {
const login = this._login = new Login({ const login = this._login = new Login({
app: this,
conn: this._conn, conn: this._conn,
hash: this._hash hash: this._hash
}); });
@ -66,7 +47,6 @@ module.exports = new Class({
if (this._gui) return; if (this._gui) return;
const gui = this._gui = new Gui({ const gui = this._gui = new Gui({
app: this,
conn: this._conn, conn: this._conn,
hash: this._hash hash: this._hash
}); });
@ -218,11 +198,11 @@ module.exports = new Class({
,async _onConnError(conn, err) { ,async _onConnError(conn, err) {
if (!(err instanceof Vn.JsonException)) return; if (!(err instanceof Vn.JsonException)) return;
switch (err.exception) { switch (err.exception) {
case 'UserDisabledError': case 'UserDisabled':
Htk.Toast.showError(_('User disabled')); Htk.Toast.showError(_('User disabled'));
await this._logout(); await this._logout();
return; return;
case 'OutdatedVersionError': case 'OutdatedVersion':
this._newVersion(); this._newVersion();
return; return;
} }
@ -238,13 +218,12 @@ module.exports = new Class({
if (err instanceof Vn.JsonException) { if (err instanceof Vn.JsonException) {
const statusCode = err.statusCode; const statusCode = err.statusCode;
if (statusCode >= 400 && statusCode < 500) { if (statusCode >= 400 && statusCode < 500) {
if (err.statusCode == 403) { if (err.statusCode == 403)
Htk.Toast.showError(err.message || Htk.Toast.showError(_('You don\'t have enough privileges'));
_('You don\'t have enough privileges')); else {
} else {
switch (err.exception) { switch (err.exception) {
case 'UserDisabledError': case 'UserDisabled':
case 'OutdatedVersionError': case 'OutdatedVersion':
return; return;
} }
if (err.statusCode == 401) if (err.statusCode == 401)

View File

@ -0,0 +1,21 @@
module.exports = {
async check(conn, hash) {
this.hash = hash;
const resultSet = await conn.execQuery('CALL myBasket_check');
const status = resultSet.fetchValue();
if (!status) return;
const isOk = status == 'UPDATED' || status == 'OK';
if (status == 'UPDATED')
Htk.Toast.showWarning(_('Order items updated'));
if (!isOk)
this.hash.setAll({form: 'ecomerce/checkout'});
return isOk;
}
};

View File

@ -1,77 +0,0 @@
module.exports = class {
constructor(app) {
this.app = app;
let orderId = localStorage.getItem('hederaBasket');
if (orderId) orderId = parseInt(orderId);
this.orderId = orderId;
}
async checkOrder(orderId) {
const resultSet = await this.app.conn.execQuery(
'CALL myOrder_checkConfig(#id)',
{id: orderId}
);
resultSet.fetchValue();
}
async check(checkoutContinue) {
if (this.orderId) {
return await this.checkRedirect(checkoutContinue);
} else {
this.redirect();
return false;
}
}
async checkRedirect(checkoutContinue) {
try {
await this.checkOrder(this.orderId);
return true;
} catch(err) {
if (err.exception == 'Vn.Lib.UserError') {
switch(err.code) {
case 'orderConfirmed':
case 'orderNotOwnedByUser':
this.constructor.unload();
await this.redirect();
break;
default:
this.app.hash.setAll({
form: 'ecomerce/checkout',
id: this.orderId,
continue: checkoutContinue
});
Htk.Toast.showError(err.message);
}
return false;
} else
throw err;
}
}
async redirect() {
const resultSet = await this.app.conn.execQuery(
'SELECT COUNT(*) > 0 FROM myOrder');
if (resultSet.fetchValue()) {
this.app.hash.setAll({form: 'ecomerce/pending'});
Htk.Toast.showMessage(_('Load an order'));
} else {
this.app.hash.setAll({form: 'ecomerce/checkout'});
}
}
async load(orderId) {
this.loadIntoBasket(orderId);
if (await this.checkRedirect('catalog'))
this.app.hash.setAll({
form: 'ecomerce/catalog'
});
}
loadIntoBasket(orderId) {
if (this.orderId != orderId) {
localStorage.setItem('hederaBasket', orderId);
this.orderId = orderId;
Htk.Toast.showMessage(_('OrderLoadedIntoBasket'));
}
}
static unload() {
localStorage.removeItem('hederaBasket');
}
};

View File

@ -7,7 +7,6 @@ module.exports = new Class({
,initialize(gui) { ,initialize(gui) {
this.gui = gui; this.gui = gui;
this.app = gui.app;
this.conn = gui.conn; this.conn = gui.conn;
this.hash = gui.hash; this.hash = gui.hash;
} }

View File

@ -50,16 +50,19 @@ module.exports = new Class({
this.doc.body.appendChild(this.node); this.doc.body.appendChild(this.node);
Htk.Toast.pushTop(this.$.formHolder); Htk.Toast.pushTop(this.$.formHolder);
await this.refreshUserData();
Vn.Node.setText(this.$.userName, this.user.nickname);
const resultSet = await this._conn.execQuery( const resultSet = await this._conn.execQuery(
'SELECT defaultForm FROM config;' 'SELECT id, name, nickname FROM account.myUser;'
+'SELECT defaultForm FROM config;'
+'SELECT url FROM imageConfig;' +'SELECT url FROM imageConfig;'
+'SELECT dbproduccion FROM vn.config;' +'SELECT dbproduccion FROM vn.config;'
+'SELECT productionDomain, testDomain FROM config;' +'SELECT productionDomain, testDomain FROM config;'
); );
// Retrieving the user name
this.user = resultSet.fetchObject();
Vn.Node.setText(this.$.userName, this.user.nickname);
// Retrieving configuration parameters // Retrieving configuration parameters
Vn.Config.defaultForm = resultSet.fetchValue(); Vn.Config.defaultForm = resultSet.fetchValue();
@ -116,12 +119,6 @@ module.exports = new Class({
Htk.Toast.showWarning(_('By using this site you accept cookies')); Htk.Toast.showWarning(_('By using this site you accept cookies'));
} }
} }
,async refreshUserData() {
const resultSet = await this._conn.execQuery(
'SELECT id, name, nickname FROM account.myUser');
this.user = resultSet.fetchObject();
}
,async hide() { ,async hide() {
if (!this._shown) if (!this._shown)
@ -466,41 +463,29 @@ module.exports = new Class({
} }
//++++++++++++++++++++++++++++++++++++++++++++++++++++++ Supplant //++++++++++++++++++++++++++++++++++++++++++++++++++++++ Supplant
/**
* Supplants another user.
*
* @param {String} supplantUser The user name
*/
,async supplantUser(supplantUser) {
const json = await this._conn.send('client/supplant', {supplantUser});
this._conn.token = json;
sessionStorage.setItem('supplantUser', supplantUser);
await this.refreshUserData();
Vn.Node.setText(this.$.supplanted, this.user.nickname);
this.$.supplant.classList.toggle('show', true);
await this.loadMenu();
}
/*
* Ends the user supplanting and restores the original login.
*/
,async onSupplantExitClick() {
this._conn.post('Accounts/logout');
this._conn.fetchToken();
sessionStorage.removeItem('supplantUser');
this.$.supplant.classList.toggle('show', false);
await this.refreshUserData();
await this.loadMenu();
this._onFormChange();
}
,async supplantInit() { ,async supplantInit() {
var user = sessionStorage.getItem('supplantUser'); var user = sessionStorage.getItem('supplantUser');
if (user == null) return; if (user == null) return;
await this.supplantUser(user);
await this._conn.supplantUser(user);
sessionStorage.setItem('supplantUser', user);
await this.loadMenu();
const res = await this._conn.execQuery(
'SELECT nickname FROM account.myUser');
const userName = res.fetchValue();
Vn.Node.setText(this.$.supplanted, userName);
this.$.supplant.classList.toggle('show', true);
}
,async onSupplantExitClick() {
this.$.supplant.classList.toggle('show', false);
await this._conn.supplantEnd();
sessionStorage.removeItem('supplantUser');
await this.loadMenu();
this._onFormChange();
} }
//++++++++++++++++++++++++++++++++++++++++++++++++++++++ Destroy //++++++++++++++++++++++++++++++++++++++++++++++++++++++ Destroy

View File

@ -10,6 +10,6 @@ Hedera = module.exports = {
,Report : require('./report') ,Report : require('./report')
,App : require('./app') ,App : require('./app')
,Tpv : require('./tpv') ,Tpv : require('./tpv')
,Basket : require('./basket') ,BasketChecker : require('./basket-checker')
}; };

View File

@ -38,8 +38,7 @@ AppName: Verdnatura
Home: Inici Home: Inici
Orders: Encàrrecs Orders: Encàrrecs
Basket: Cistella Basket: Cistella
Pending orders: Pendents Last orders: Últims comandes
Last orders: Confirmades
Invoices: Factures Invoices: Factures
Catalog: Catàleg Catalog: Catàleg
About: Coneix-nos About: Coneix-nos
@ -63,22 +62,3 @@ Agencies: Agències
Configuration: Configuració Configuration: Configuració
Account: Compte Account: Compte
Addresses: Adreces Addresses: Adreces
Load an order: Si us plau carrega una comanda pendent a la cistella o en comença una de nova
Old password: Contrasenya antiga
New password: Nova contrasenya
Repeat password: Repetir contrasenya
Requirements: Requisits
Modify: Modificar
Password requirements: Requisits de contrasenya
characters long: caràcters de longitud
alphabetic characters: caràcters alfabètics
capital letters: majúscules
digits: dígits
symbols: símbols
Password changed!: Contrasenya modificada!
Password doesn't meet the requirements: ''
Passwords doesn't match: Les contrasenyes no coincideixen!
Passwords empty: Les contrasenyes en blanc
Change password: Canvia la contrasenya

View File

@ -34,8 +34,7 @@ AppName: Verdnatura
Home: Home Home: Home
Orders: Orders Orders: Orders
Basket: Basket Basket: Basket
Pending orders: Pending Last orders: Last orders
Last orders: Confirmed
Invoices: Invoices Invoices: Invoices
Catalog: Catalog Catalog: Catalog
About: About About: About
@ -59,5 +58,3 @@ Agencies: Agencies
Configuration: Configuration Configuration: Configuration
Account: Account Account: Account
Addresses: Addresses Addresses: Addresses
Load an order: Please load a pending order to the cart or start a new one

View File

@ -38,8 +38,7 @@ AppName: Verdnatura
Home: Inicio Home: Inicio
Orders: Pedidos Orders: Pedidos
Basket: Cesta Basket: Cesta
Pending orders: Pendientes Last orders: Últimos pedidos
Last orders: Confirmados
Invoices: Facturas Invoices: Facturas
Catalog: Catálogo Catalog: Catálogo
About: Conócenos About: Conócenos
@ -63,24 +62,3 @@ Agencies: Agencias
Configuration: Configuración Configuration: Configuración
Account: Cuenta Account: Cuenta
Addresses: Direcciones Addresses: Direcciones
Load an order: Por favor carga un pedido pendiente en la cesta o empieza uno nuevo
Old password: Contaseña antigua
New password: Nueva contraseña
Repeat password: Repetir contraseña
Requirements: Requisitos
Modify: Modificar
Password requirements: Requisitos de constraseña
characters long: carácteres de longitud
alphabetic characters: carácteres alfabéticos
capital letters: letras mayúsculas
digits: dígitos
symbols: 'símbolos. Ej: $%&.'
Password changed!: ¡Contraseña modificada!
Password doesn't meet the requirements: >-
La nueva contraseña no reune los requisitos de seguridad necesarios, pulsa en
info para más detalle
Passwords doesn't match: ¡Las contraseñas no coinciden!
Passwords empty: Contraseña vacía
Change password: Cambiar contraseña

View File

@ -5,7 +5,7 @@ Remind me: Retenir mon mot de passe
Log in as guest: Entrez en tant qu'invité Log in as guest: Entrez en tant qu'invité
Login: Se connecter Login: Se connecter
Login mail: info@verdnatura.es Login mail: info@verdnatura.es
Login phone: +33 783 285 437 Login phone: +33 781 533 900
Password forgotten? Push here: Vous avez oublié votre mot de passe? Password forgotten? Push here: Vous avez oublié votre mot de passe?
Yet you are not a customer?: Vous n'êtes pas encore client? Yet you are not a customer?: Vous n'êtes pas encore client?
Sign up: S'inscrire Sign up: S'inscrire
@ -38,8 +38,7 @@ AppName: Verdnatura
Home: Accueil Home: Accueil
Orders: Commandes Orders: Commandes
Basket: Panier Basket: Panier
Pending orders: En attente Last orders: Dernières commandes
Last orders: Confirmées
Invoices: Facturas Invoices: Facturas
Catalog: Catalogue Catalog: Catalogue
About: Nous About: Nous
@ -63,22 +62,3 @@ Agencies: Agences
Configuration: Configuration Configuration: Configuration
Account: Compte Account: Compte
Addresses: Adresses Addresses: Adresses
Load an order: Veuillez télécharger une commande en attente dans le panier ou en démarrer une nouvelle
Old password: Ancien mot de passe
New password: Nouveau mot de passe
Repeat password: Répéter le mot de passe
Requirements: Exigences
Modify: Modifier
Password requirements: Mot de passe exigences
characters long: Longs caractères
alphabetic characters: les caractères alphabétiques
capital letters: lettres majuscules
digits: chiffres
symbols: 'symboles. Ej: $%&.'
Password changed!: Mot de passe modifié!
Password doesn't meet the requirements: ''
Passwords doesn't match: Les mots de passe ne correspondent pas!
Passwords empty: ''
Change password: Changer le mot de passe

View File

@ -36,8 +36,7 @@ AppName: VerdNatura
Home: Principio Home: Principio
Orders: Encomendas Orders: Encomendas
Basket: Cesta Basket: Cesta
Pending orders: Pendentes Last orders: Últimas encomendas
Last orders: Confirmados
Invoices: Facturas Invoices: Facturas
Catalog: Catálogo Catalog: Catálogo
About: Conheça-nos About: Conheça-nos
@ -61,22 +60,3 @@ Agencies: Agências
Configuration: Configuração Configuration: Configuração
Account: Conta Account: Conta
Addresses: Moradas Addresses: Moradas
Load an order: Carregue um pedido pendente no carrinho ou inicie um novo
Old password: Palavra-passe antiga
New password: Nova Palavra-passe
Repeat password: Repetir Palavra-passe
Requirements: Requisitos
Modify: Modificar
Password requirements: Requisitos de Palavra-passe
characters long: caracteres
alphabetic characters: caracteres alfabéticos
capital letters: letras maiúsculas
digits: dígitos
symbols: 'símbolos. Ej: $%&.'
Password changed!: Palavra-passe Modificada!
Password doesn't meet the requirements: Palavra-passe não atende aos requisitos
Passwords doesn't match: As Palavras-Passe não coincidem!
Passwords empty: Palavra-passe vazia
Change password: Mudar Palavra-passe

Some files were not shown because too many files have changed in this diff Show More