Compare commits
135 Commits
6492-agenc
...
dev
Author | SHA1 | Date |
---|---|---|
|
a956c268b6 | |
|
5b968b6e46 | |
|
ef65622014 | |
|
35efe67c63 | |
|
6dbcf162ca | |
|
20f5dc46f7 | |
|
c0ab27bd7a | |
|
6508a4e4f0 | |
|
6fa75b3abc | |
|
ce230b1133 | |
|
f2ca49b261 | |
|
a5b8e56506 | |
|
93562bb4dd | |
|
aaa9d34404 | |
|
de5740856e | |
|
70746995ca | |
|
90dea8fde9 | |
|
f57967cd17 | |
|
1c54922692 | |
|
8929f8c55a | |
|
7f2c645682 | |
|
099f494101 | |
|
ddc5c2adc7 | |
|
16d1e1fd69 | |
|
340c68406c | |
|
c2f7ee1be8 | |
|
4d81b6c5b2 | |
|
fba0c73402 | |
|
5ac6652663 | |
|
21da29ab8d | |
|
1f373f1bc3 | |
|
47acbb7ebb | |
|
f863d8a897 | |
|
5186387162 | |
|
fd11c1ea00 | |
|
8a022aac66 | |
|
ddaff6afe9 | |
|
bdf7a16003 | |
|
3db9314dfd | |
|
7ff9e2e97d | |
|
0d61a9de03 | |
|
979b1293a9 | |
|
29168a6927 | |
|
b62185289f | |
|
d66047c451 | |
|
03be5f9a56 | |
|
96fd08b369 | |
|
36573342b7 | |
|
14451121ac | |
|
44a45a25b2 | |
|
7618e65105 | |
|
1efb84dd83 | |
|
90137ab08f | |
|
b73e292cb0 | |
|
444732460e | |
|
ab88575c72 | |
|
5cf6ef5b1c | |
|
dcf46094f0 | |
|
c6589989d4 | |
|
59e7999385 | |
|
756fccaa78 | |
|
7174842cfa | |
|
d6e7d3b025 | |
|
5bc20e9e05 | |
|
6be7bccff7 | |
|
bf5ba5dac1 | |
|
0d2ac8f9fb | |
|
cb61ad5d11 | |
|
5abcf9e71d | |
|
0952a690a5 | |
|
cc5faf97da | |
|
9507292a13 | |
|
17baf12449 | |
|
749189d726 | |
|
7a94c3a01e | |
|
c4977b7997 | |
|
ca4457bf54 | |
|
d1c4f9dba2 | |
|
921b029b06 | |
|
ff63cd11c3 | |
|
1f1043a43c | |
|
a868a5b540 | |
|
baa596430e | |
|
5ca765486f | |
|
61fac85554 | |
|
3a714debfc | |
|
647dd09013 | |
|
05c71c7425 | |
|
90e2b0abb5 | |
|
bcbbee411f | |
|
961ff02053 | |
|
e7eb2a01fe | |
|
98cefc8f0f | |
|
e40a28b649 | |
|
f869e7413c | |
|
29e800ea30 | |
|
1eb98b772a | |
|
1fe6816c08 | |
|
5bbc342471 | |
|
d808fa71d1 | |
|
ac226205b0 | |
|
87f17409f7 | |
|
ae70cbaaf4 | |
|
6e1613a26c | |
|
359ddb5d18 | |
|
d75fe3fc00 | |
|
e6cd88ee82 | |
|
a405cba00b | |
|
e4f55ca9e9 | |
|
d8ea9134d4 | |
|
a96859b6bb | |
|
e210a09f6b | |
|
5304a77f94 | |
|
3f63da06f1 | |
|
7d120598bc | |
|
4cf91140f7 | |
|
06554b7dee | |
|
83c6886ee6 | |
|
4765bc78de | |
|
0a9635feb2 | |
|
00c8e4b1e3 | |
|
1414b6c96e | |
|
244b3f939e | |
|
1d2f9061c5 | |
|
a121750fa7 | |
|
73ba16634e | |
|
2515cbcee7 | |
|
d1cdba800d | |
|
02ddc87755 | |
|
7689be689f | |
|
33778629e6 | |
|
496061fb3c | |
|
0b85c1230a | |
|
3ed871cb4c | |
|
c7159a1e13 |
.gitignoreDockerfileJenkinsfileREADME.mdconfig.phpimport.jspackage-lock.jsonpackage.json
debian
docker-compose.ymlforms
account/address
admin/items
agencies
packages
provinces
ecomerce
reports
rest
|
@ -1,5 +1,6 @@
|
||||||
node_modules
|
node_modules
|
||||||
build/
|
build/
|
||||||
|
dist/
|
||||||
config.my.php
|
config.my.php
|
||||||
.vscode/
|
.vscode/
|
||||||
.quasar
|
.quasar
|
||||||
|
|
|
@ -28,7 +28,7 @@ RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
|
||||||
|
|
||||||
# Hedera
|
# Hedera
|
||||||
|
|
||||||
RUN curl -sL https://apt.verdnatura.es/conf/verdnatura.gpg | apt-key add - \
|
RUN curl -sL https://apt.verdnatura.es/conf/verdnatura.gpg | tee /etc/apt/trusted.gpg.d/verdnatura.gpg \
|
||||||
&& echo "deb http://apt.verdnatura.es/ bookworm main" \
|
&& echo "deb http://apt.verdnatura.es/ bookworm main" \
|
||||||
> /etc/apt/sources.list.d/vn.list \
|
> /etc/apt/sources.list.d/vn.list \
|
||||||
&& apt-get update \
|
&& apt-get update \
|
||||||
|
|
|
@ -1,34 +1,25 @@
|
||||||
#!/usr/bin/env groovy
|
#!/usr/bin/env groovy
|
||||||
|
|
||||||
|
def BRANCH_ENV = [
|
||||||
|
test: 'test',
|
||||||
|
master: 'production'
|
||||||
|
]
|
||||||
|
def remote = [:]
|
||||||
|
|
||||||
|
node {
|
||||||
|
stage('Setup') {
|
||||||
|
env.NODE_ENV = BRANCH_ENV[env.BRANCH_NAME] ?: 'dev'
|
||||||
|
|
||||||
|
echo "NODE_NAME: ${env.NODE_NAME}"
|
||||||
|
echo "WORKSPACE: ${env.WORKSPACE}"
|
||||||
|
}
|
||||||
|
}
|
||||||
pipeline {
|
pipeline {
|
||||||
agent any
|
agent any
|
||||||
environment {
|
environment {
|
||||||
PROJECT_NAME = 'hedera-web'
|
PROJECT_NAME = 'hedera-web'
|
||||||
STACK_NAME = "${env.PROJECT_NAME}-${env.BRANCH_NAME}"
|
|
||||||
}
|
}
|
||||||
stages {
|
stages {
|
||||||
stage('Checkout') {
|
|
||||||
steps {
|
|
||||||
script {
|
|
||||||
def packageJson = readJSON file: 'package.json'
|
|
||||||
env.VERSION = packageJson.version
|
|
||||||
|
|
||||||
switch (env.BRANCH_NAME) {
|
|
||||||
case 'master':
|
|
||||||
env.NODE_ENV = 'production'
|
|
||||||
env.MAIN_REPLICAS = 3
|
|
||||||
env.CRON_REPLICAS = 1
|
|
||||||
break
|
|
||||||
case 'test':
|
|
||||||
env.NODE_ENV = 'test'
|
|
||||||
env.MAIN_REPLICAS = 1
|
|
||||||
env.CRON_REPLICAS = 0
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
setEnv()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stage('Debuild') {
|
stage('Debuild') {
|
||||||
when {
|
when {
|
||||||
anyOf {
|
anyOf {
|
||||||
|
@ -38,31 +29,28 @@ pipeline {
|
||||||
}
|
}
|
||||||
agent {
|
agent {
|
||||||
docker {
|
docker {
|
||||||
image 'registry.verdnatura.es/debuild:2.23.4-vn1'
|
image 'registry.verdnatura.es/verdnatura/debuild:2.23.4-vn7'
|
||||||
registryUrl 'https://registry.verdnatura.es/'
|
registryUrl 'https://registry.verdnatura.es/'
|
||||||
registryCredentialsId 'docker-registry'
|
registryCredentialsId 'docker-registry'
|
||||||
args '-v /mnt/appdata/reprepro:/reprepro'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
sh 'debuild -us -uc -b'
|
sh 'debuild -us -uc -b'
|
||||||
sh 'vn-includedeb bookworm'
|
sh 'mkdir -p debuild'
|
||||||
|
sh 'mv ../hedera-web_* debuild'
|
||||||
|
|
||||||
|
script {
|
||||||
|
def files = findFiles(glob: 'debuild/*.changes')
|
||||||
|
files.each { file -> env.CHANGES_FILE = file.name }
|
||||||
|
}
|
||||||
|
|
||||||
|
configFileProvider([
|
||||||
|
configFile(fileId: "dput.cf", variable: 'DPUT_CONFIG')
|
||||||
|
]) {
|
||||||
|
sshagent(credentials: ['jenkins-agent']) {
|
||||||
|
sh 'dput --config "$DPUT_CONFIG" verdnatura "debuild/$CHANGES_FILE"'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Container') {
|
|
||||||
when {
|
|
||||||
anyOf {
|
|
||||||
branch 'master'
|
|
||||||
branch 'test'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
environment {
|
|
||||||
CREDS = credentials('docker-registry')
|
|
||||||
}
|
|
||||||
steps {
|
|
||||||
sh 'docker login --username $CREDS_USR --password $CREDS_PSW $REGISTRY'
|
|
||||||
sh 'docker-compose build --build-arg BUILD_ID=$BUILD_ID --parallel'
|
|
||||||
sh 'docker-compose push'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Deploy') {
|
stage('Deploy') {
|
||||||
|
@ -73,15 +61,41 @@ pipeline {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
environment {
|
environment {
|
||||||
DOCKER_HOST = "${env.SWARM_HOST}"
|
CREDS = credentials('docker-registry')
|
||||||
|
IMAGE = "$REGISTRY/verdnatura/hedera-web"
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
sh "docker stack deploy --with-registry-auth --compose-file docker-compose.yml ${env.STACK_NAME}"
|
script {
|
||||||
|
def packageJson = readJSON file: 'package.json'
|
||||||
|
env.VERSION = "${packageJson.version}"
|
||||||
|
env.TAG = "${packageJson.version}-build${env.BUILD_ID}"
|
||||||
|
}
|
||||||
|
|
||||||
|
sh 'docker-compose build --build-arg BUILD_ID=$BUILD_ID --parallel'
|
||||||
|
sh 'docker login --username $CREDS_USR --password $CREDS_PSW $REGISTRY'
|
||||||
|
sh 'docker push $IMAGE:$TAG'
|
||||||
|
|
||||||
|
script {
|
||||||
|
if (env.BRANCH_NAME == 'master') {
|
||||||
|
sh 'docker tag $IMAGE:$TAG $IMAGE:latest'
|
||||||
|
sh 'docker push $IMAGE:latest'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
withKubeConfig([
|
||||||
|
serverUrl: "$KUBERNETES_API",
|
||||||
|
credentialsId: 'kubernetes',
|
||||||
|
namespace: 'salix'
|
||||||
|
]) {
|
||||||
|
sh 'kubectl set image deployment/hedera-web-$BRANCH_NAME hedera-web-$BRANCH_NAME=$IMAGE:$TAG'
|
||||||
|
sh 'kubectl set image deployment/hedera-web-cron-$BRANCH_NAME hedera-web-cron-$BRANCH_NAME=$IMAGE:$TAG'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
post {
|
post {
|
||||||
unsuccessful {
|
unsuccessful {
|
||||||
|
setEnv()
|
||||||
sendEmail()
|
sendEmail()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
48
README.md
48
README.md
|
@ -1,36 +1,58 @@
|
||||||
# Hedera
|
# Hedera
|
||||||
|
|
||||||
Hedera is the main web page for Verdnatura.
|
Hedera is the main web shop page for Verdnatura.
|
||||||
|
|
||||||
## Getting Started
|
## Prerequisites
|
||||||
|
|
||||||
Required dependencies.
|
Required applications.
|
||||||
* PHP >= 7.0
|
* PHP >= 8.4
|
||||||
* Node.js >= 8.0
|
* Node.js >= 20.0
|
||||||
|
|
||||||
### Web application
|
Take a look to *debian/control* file to see additional dependencies.
|
||||||
|
|
||||||
Launch fronted.
|
Copy config.php to *config.my.php* and place your DB config there.
|
||||||
|
|
||||||
|
### Installing dependencies and launching
|
||||||
|
|
||||||
|
Pull from repository.
|
||||||
|
|
||||||
|
Run this commands on project root directory to install Node dependencies.
|
||||||
```
|
```
|
||||||
npm run front
|
$ npm install
|
||||||
```
|
```
|
||||||
|
|
||||||
Launch backend.
|
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 db
|
$ npm run front
|
||||||
npm run back
|
```
|
||||||
php -S 127.0.0.1:3001 -t . index.php
|
|
||||||
|
Launch salix backend.
|
||||||
|
```
|
||||||
|
$ npm run db
|
||||||
|
$ npm run back
|
||||||
|
```
|
||||||
|
Launch project backend.
|
||||||
|
```
|
||||||
|
$ php -S 127.0.0.1:3001 -t . index.php
|
||||||
```
|
```
|
||||||
|
|
||||||
### Command line
|
### Command line
|
||||||
|
|
||||||
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/)
|
||||||
|
|
|
@ -12,6 +12,8 @@
|
||||||
*
|
*
|
||||||
* - 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 [
|
||||||
/**
|
/**
|
||||||
|
@ -22,7 +24,7 @@ return [
|
||||||
,'port' => 3306
|
,'port' => 3306
|
||||||
,'schema' => 'hedera'
|
,'schema' => 'hedera'
|
||||||
,'user' => 'hedera-web'
|
,'user' => 'hedera-web'
|
||||||
,'pass' => ''
|
,'pass' => '' // base64 encoded
|
||||||
,'tz' => 'Europe/madrid'
|
,'tz' => 'Europe/madrid'
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
hedera-web (23.40.6) stable; urgency=low
|
hedera-web (25.4.4) stable; urgency=low
|
||||||
|
|
||||||
* Initial Release.
|
* Initial Release.
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@ MAILTO=webmaster
|
||||||
*/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
|
||||||
|
|
|
@ -1,47 +1,9 @@
|
||||||
version: '3.7'
|
version: '3.7'
|
||||||
services:
|
services:
|
||||||
main:
|
main:
|
||||||
image: registry.verdnatura.es/hedera-web:${BRANCH_NAME:?}
|
image: registry.verdnatura.es/verdnatura/hedera-web:${TAG:?}
|
||||||
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
|
|
||||||
resources:
|
|
||||||
limits:
|
|
||||||
memory: 2G
|
|
||||||
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
|
|
||||||
resources:
|
|
||||||
limits:
|
|
||||||
memory: 1G
|
|
||||||
configs:
|
|
||||||
config:
|
|
||||||
external: true
|
|
||||||
name: ${PROJECT_NAME:?}-${BRANCH_NAME:?}
|
|
||||||
|
|
|
@ -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, country FROM vn.country
|
SELECT id, name FROM vn.country
|
||||||
ORDER BY country
|
ORDER BY name
|
||||||
</db-model>
|
</db-model>
|
||||||
</htk-combo>
|
</htk-combo>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -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.longName LIKE CONCAT('%', #search, '%')
|
WHERE i.isActive
|
||||||
OR i.id = #search
|
AND (i.longName LIKE CONCAT('%', #search, '%') OR i.id = #search)
|
||||||
ORDER BY i.longName LIMIT 50
|
ORDER BY i.longName LIMIT 50
|
||||||
</db-model>
|
</db-model>
|
||||||
<custom>
|
<custom>
|
||||||
|
|
|
@ -3,12 +3,5 @@ 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
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
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
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
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
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
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
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
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
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
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
|
||||||
|
|
|
@ -7,14 +7,9 @@
|
||||||
<htk-grid>
|
<htk-grid>
|
||||||
<db-model property="model">
|
<db-model property="model">
|
||||||
<custom>
|
<custom>
|
||||||
CALL vn2008.agencyVolume()
|
CALL vn.agencyVolume()
|
||||||
</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"/>
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
import './style.scss';
|
|
||||||
|
|
||||||
export default new Class({
|
|
||||||
Extends: Hedera.Form,
|
|
||||||
Template: require('./ui.xml')
|
|
||||||
});
|
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
ByProvince: Desglose per província
|
|
||||||
Return: Tornar
|
|
||||||
SelectAgency: Selecciona una agència al llistat de l'esquerra
|
|
||||||
Province: Província
|
|
||||||
Expeditions: Exps.
|
|
||||||
Left: Falten
|
|
|
@ -1,6 +0,0 @@
|
||||||
ByProvince: Breakdown by province
|
|
||||||
Return: Return
|
|
||||||
SelectAgency: Select an agency
|
|
||||||
Province: Province
|
|
||||||
Expeditions: Exps.
|
|
||||||
Left: Left
|
|
|
@ -1,6 +0,0 @@
|
||||||
ByProvince: Desglose por provincia
|
|
||||||
Return: Volver
|
|
||||||
SelectAgency: Selecciona una agencia
|
|
||||||
Province: Provincia
|
|
||||||
Expeditions: Exps.
|
|
||||||
Left: Faltan
|
|
|
@ -1,6 +0,0 @@
|
||||||
ByProvince: Par province
|
|
||||||
Return: Retour
|
|
||||||
SelectAgency: Sélectionnez une agence
|
|
||||||
Province: Province
|
|
||||||
Expeditions: Expéditions
|
|
||||||
Left: Restant
|
|
|
@ -1,6 +0,0 @@
|
||||||
ByProvince: Desglosse por Distritos
|
|
||||||
Return: Voltar
|
|
||||||
SelectAgency: Seleccione uma agência
|
|
||||||
Province: Distrito
|
|
||||||
Expeditions: Exps.
|
|
||||||
Left: Faltam
|
|
|
@ -1,18 +0,0 @@
|
||||||
<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>
|
|
|
@ -275,7 +275,7 @@
|
||||||
}
|
}
|
||||||
& > .htk-image {
|
& > .htk-image {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 180px;
|
height: 210px;
|
||||||
|
|
||||||
& > img {
|
& > img {
|
||||||
height: initial;
|
height: initial;
|
||||||
|
|
|
@ -117,7 +117,7 @@
|
||||||
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.tag8, i.value8,
|
i.tag7, i.value7, i.tag8, i.value8,
|
||||||
i.relevancy, i.size, i.category, i.minQuantity,
|
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,19 +126,13 @@
|
||||||
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
|
LEFT JOIN image im ON im.collectionFk = 'catalog'
|
||||||
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
|
DROP TEMPORARY TABLE tmp.item;
|
||||||
tmp.item,
|
CALL vn.ticketCalculatePurge();
|
||||||
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"/>
|
||||||
|
|
|
@ -120,7 +120,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.country
|
SELECT a.id, a.nickname, p.name province, a.city, a.street, a.isActive, c.name
|
||||||
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
|
||||||
|
|
|
@ -67,7 +67,7 @@ export default new Class({
|
||||||
methods = ['balance'];
|
methods = ['balance'];
|
||||||
selectedMethod = 'BALANCE';
|
selectedMethod = 'BALANCE';
|
||||||
} else {
|
} else {
|
||||||
methods = ['card', 'transfer', 'later'];
|
methods = ['card'];
|
||||||
|
|
||||||
if (!creditExceededCond) {
|
if (!creditExceededCond) {
|
||||||
methods.push('credit');
|
methods.push('credit');
|
||||||
|
@ -98,9 +98,6 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -162,32 +162,6 @@
|
||||||
<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">
|
||||||
|
|
|
@ -4,29 +4,16 @@ export default new Class({
|
||||||
Extends: Hedera.Form,
|
Extends: Hedera.Form,
|
||||||
Template: require('./ui.xml'),
|
Template: require('./ui.xml'),
|
||||||
|
|
||||||
donwloadRenderer(column, invoice) {
|
onDownloadClick(column, value, row) {
|
||||||
var invoiceId = invoice.$.id;
|
var model = this.$.invoices;
|
||||||
|
var hasPdf = model.get(row, 'hasPdf');
|
||||||
|
var id = model.get(row, 'id');
|
||||||
|
|
||||||
if (invoice.$.hasPdf && invoiceId) {
|
if (hasPdf && id) {
|
||||||
var params = {
|
let params = Vn.Url.makeUri({ access_token: this.conn.token });
|
||||||
srv: 'rest:dms/invoice',
|
window.open(`/api/InvoiceOuts/${id}/download?${params}`);
|
||||||
invoice: invoiceId,
|
|
||||||
access_token: this.conn.token
|
|
||||||
};
|
|
||||||
|
|
||||||
Object.assign(column, {
|
|
||||||
tip: _('Download PDF'),
|
|
||||||
disabled: false,
|
|
||||||
icon: 'download',
|
|
||||||
href: '?'+ Vn.Url.makeUri(params)
|
|
||||||
});
|
|
||||||
} else
|
} else
|
||||||
Object.assign(column, {
|
Htk.Toast.showWarning(_('Request the invoice to your salesperson'));
|
||||||
tip: _('Request the invoice to your salesperson'),
|
|
||||||
disabled: true,
|
|
||||||
icon: 'warning',
|
|
||||||
href: null
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<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="tickets">
|
<db-model property="model" id="invoices">
|
||||||
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,8 +16,9 @@
|
||||||
<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
|
||||||
renderer="donwloadRenderer"
|
icon="download"
|
||||||
target="_blank"/>
|
tip="_Download PDF"
|
||||||
|
on-clicked="onDownloadClick"/>
|
||||||
</htk-grid>
|
</htk-grid>
|
||||||
</div>
|
</div>
|
||||||
</vn>
|
</vn>
|
||||||
|
|
|
@ -26,8 +26,8 @@
|
||||||
<label><t>Realm</t></label>
|
<label><t>Realm</t></label>
|
||||||
<htk-combo form="lot" column="realm" not-null="false">
|
<htk-combo form="lot" column="realm" not-null="false">
|
||||||
<db-model property="model">
|
<db-model property="model">
|
||||||
SELECT id, reino FROM vn2008.reinos
|
SELECT id, name FROM vn.itemCategory
|
||||||
WHERE display != FALSE ORDER BY reino
|
WHERE display ORDER BY name
|
||||||
</db-model>
|
</db-model>
|
||||||
</htk-combo>
|
</htk-combo>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -25,9 +25,9 @@
|
||||||
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, t.reino_id realm
|
c.shelf, c.maxAmount, c.showPacking, c.stack, it.categoryFk realm
|
||||||
FROM shelfConfig c
|
FROM shelfMultiConfig c
|
||||||
JOIN vn2008.Tipos t ON t.tipo_id = c.family
|
JOIN vn.itemType it ON it.id = c.family
|
||||||
</db-model>
|
</db-model>
|
||||||
</htk-combo>
|
</htk-combo>
|
||||||
</div>
|
</div>
|
||||||
|
@ -39,8 +39,8 @@
|
||||||
<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, reino FROM vn2008.reinos
|
SELECT id, name FROM vn.itemCategory
|
||||||
WHERE display != FALSE ORDER BY reino
|
WHERE display ORDER BY name
|
||||||
</db-model>
|
</db-model>
|
||||||
</htk-combo>
|
</htk-combo>
|
||||||
</div>
|
</div>
|
||||||
|
@ -48,8 +48,8 @@
|
||||||
<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 tipo_id, Tipo FROM vn2008.Tipos
|
SELECT id, name FROM vn.itemType
|
||||||
WHERE reino_id = #realm ORDER BY Tipo
|
WHERE categoryFk = #realm ORDER BY name
|
||||||
</db-model>
|
</db-model>
|
||||||
</htk-combo>
|
</htk-combo>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -40,9 +40,7 @@ export const routes = {
|
||||||
},
|
},
|
||||||
agencies: {
|
agencies: {
|
||||||
packages:
|
packages:
|
||||||
() => import('agencies/packages'),
|
() => import('agencies/packages')
|
||||||
provinces:
|
|
||||||
() => import('agencies/provinces')
|
|
||||||
},
|
},
|
||||||
cms: {
|
cms: {
|
||||||
about:
|
about:
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "hedera-web",
|
"name": "hedera-web",
|
||||||
"version": "24.8.0",
|
"version": "24.8.1",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "hedera-web",
|
"name": "hedera-web",
|
||||||
"version": "24.8.0",
|
"version": "24.8.1",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"js-yaml": "^3.12.1",
|
"js-yaml": "^3.12.1",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "hedera-web",
|
"name": "hedera-web",
|
||||||
"version": "24.8.0",
|
"version": "25.4.4",
|
||||||
"description": "Verdnatura web page",
|
"description": "Verdnatura web page",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|
|
@ -1,21 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
use Vn\Web\Security;
|
|
||||||
use Vn\Web\Util;
|
|
||||||
use Vn\Lib;
|
|
||||||
|
|
||||||
class Invoice extends Vn\Web\RestRequest {
|
|
||||||
const PARAMS = ['invoice'];
|
|
||||||
const SECURITY = Security::INVOKER;
|
|
||||||
|
|
||||||
function run($db) {
|
|
||||||
$pdfPath = $db->getValueFromFile(__DIR__ .'/invoice',
|
|
||||||
['invoice' =>(int) $_GET['invoice']]);
|
|
||||||
|
|
||||||
if (!$pdfPath)
|
|
||||||
throw new Lib\UserException(s('Invoice id not found'));
|
|
||||||
|
|
||||||
Util::printFile($pdfPath);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
|
|
||||||
SELECT CONCAT_WS('/', c.pdfsDir, vn.invoiceOut_getPath(#invoice))
|
|
||||||
FROM config c
|
|
||||||
JOIN myInvoice i
|
|
||||||
WHERE i.id = #invoice
|
|
|
@ -8,7 +8,7 @@ class Clean extends Edi\Method {
|
||||||
|
|
||||||
$cleanPeriod = $db->getValue(
|
$cleanPeriod = $db->getValue(
|
||||||
"SELECT ic.cleanPeriod
|
"SELECT ic.cleanPeriod
|
||||||
FROM imapConfig ic
|
FROM imapMultiConfig ic
|
||||||
JOIN util.config c ON c.environment = ic.environment");
|
JOIN util.config c ON c.environment = ic.environment");
|
||||||
|
|
||||||
$deleted = 0;
|
$deleted = 0;
|
||||||
|
|
|
@ -14,7 +14,7 @@ abstract class Method extends \Vn\Lib\Method {
|
||||||
|
|
||||||
$imapConf = $db->getRow(
|
$imapConf = $db->getRow(
|
||||||
"SELECT ic.host, ic.user, ic.pass, ic.successFolder, ic.errorFolder
|
"SELECT ic.host, ic.user, ic.pass, ic.successFolder, ic.errorFolder
|
||||||
FROM imapConfig ic
|
FROM imapMultiConfig ic
|
||||||
JOIN util.config c ON c.environment = ic.environment");
|
JOIN util.config c ON c.environment = ic.environment");
|
||||||
|
|
||||||
$this->mailbox = sprintf('{%s/imap/ssl/novalidate-cert}',
|
$this->mailbox = sprintf('{%s/imap/ssl/novalidate-cert}',
|
||||||
|
|
|
@ -18,7 +18,7 @@ class Segment {
|
||||||
|
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
case Type::DATE:
|
case Type::DATE:
|
||||||
$tmp = Date.vnNew();
|
$tmp = new Date();
|
||||||
$tmp->setDate(substr($v, 0, 4), substr($v, 4, 2), substr($v, 6, 2));
|
$tmp->setDate(substr($v, 0, 4), substr($v, 4, 2), substr($v, 6, 2));
|
||||||
return $tmp;
|
return $tmp;
|
||||||
case Type::TIME:
|
case Type::TIME:
|
||||||
|
|
|
@ -1,41 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Ejemplo:
|
|
||||||
* <Cube><Cube time="2010-12-10"><Cube currency="USD" rate="1.3244"/>
|
|
||||||
*/
|
|
||||||
class ExchangeRate extends Vn\Lib\Method {
|
|
||||||
function run($db) {
|
|
||||||
$db->selectDb('vn2008');
|
|
||||||
|
|
||||||
// Indica la URL del archivo
|
|
||||||
|
|
||||||
$xml = new SimpleXMLElement(
|
|
||||||
'http://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist-90d.xml', 0, TRUE);
|
|
||||||
|
|
||||||
$date = $db->getValue("SELECT MAX(date) fecha FROM reference_rate");
|
|
||||||
$maxDate = $date ? DateTime::createFromFormat('Y-m-d', $date) : NULL;
|
|
||||||
|
|
||||||
foreach ($xml->Cube[0]->Cube as $cube) {
|
|
||||||
$xmlDate = new DateTime($cube['time']);
|
|
||||||
|
|
||||||
// Si existen datos más recientes de la máxima fecha los añade
|
|
||||||
|
|
||||||
if ($maxDate <= $xmlDate)
|
|
||||||
foreach ($cube->Cube as $subCube)
|
|
||||||
if ($subCube['currency'] == 'USD') {
|
|
||||||
$params = [
|
|
||||||
'date' => $xmlDate,
|
|
||||||
'rate' => $subCube['rate']
|
|
||||||
];
|
|
||||||
$db->query(
|
|
||||||
'REPLACE INTO reference_rate(moneda_id, date, rate)
|
|
||||||
VALUES(2, #date, #rate)',
|
|
||||||
$params
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$db->queryFromFile(__DIR__.'/exrate-add');
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,6 +0,0 @@
|
||||||
INSERT INTO reference_rate (moneda_id, date, rate)
|
|
||||||
SELECT 2, TIMESTAMPADD (DAY, 1, r1.date), r1.rate
|
|
||||||
FROM reference_rate r1
|
|
||||||
LEFT JOIN reference_rate r2
|
|
||||||
ON TIMESTAMPADD(DAY, 1, r1.date) = r2.date
|
|
||||||
WHERE r2.date IS NULL AND r1.date < TIMESTAMPADD (DAY, -2, CURDATE())
|
|
Loading…
Reference in New Issue