Compare commits

..

No commits in common. "dev" and "dev" have entirely different histories.
dev ... dev

13 changed files with 67 additions and 48 deletions

1
.gitignore vendored
View File

@ -1,6 +1,5 @@
node_modules node_modules
build/ build/
dist/
config.my.php config.my.php
.vscode/ .vscode/
.quasar .quasar

View File

@ -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 | 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/ bookworm main" \
> /etc/apt/sources.list.d/vn.list \ > /etc/apt/sources.list.d/vn.list \
&& apt-get update \ && apt-get update \

59
Jenkinsfile vendored
View File

@ -4,7 +4,6 @@ def BRANCH_ENV = [
test: 'test', test: 'test',
master: 'production' master: 'production'
] ]
def remote = [:]
node { node {
stage('Setup') { stage('Setup') {
@ -29,28 +28,35 @@ pipeline {
} }
agent { agent {
docker { docker {
image 'registry.verdnatura.es/verdnatura/debuild:2.23.4-vn7' image 'registry.verdnatura.es/debuild:2.23.4-vn1'
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 'mkdir -p debuild' sh 'vn-includedeb bookworm'
sh 'mv ../hedera-web_* debuild' }
}
stage('Container') {
when {
anyOf {
branch 'master'
branch 'test'
}
}
environment {
CREDS = credentials('docker-registry')
}
steps {
script { script {
def files = findFiles(glob: 'debuild/*.changes') def packageJson = readJSON file: 'package.json'
files.each { file -> env.CHANGES_FILE = file.name } env.VERSION = packageJson.version
}
configFileProvider([
configFile(fileId: "dput.cf", variable: 'DPUT_CONFIG')
]) {
sshagent(credentials: ['jenkins-agent']) {
sh 'dput --config "$DPUT_CONFIG" verdnatura "debuild/$CHANGES_FILE"'
}
} }
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') {
@ -60,35 +66,18 @@ pipeline {
branch 'test' branch 'test'
} }
} }
environment {
CREDS = credentials('docker-registry')
IMAGE = "$REGISTRY/verdnatura/hedera-web"
}
steps { steps {
script { script {
def packageJson = readJSON file: 'package.json' def packageJson = readJSON file: 'package.json'
env.VERSION = "${packageJson.version}" 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([ withKubeConfig([
serverUrl: "$KUBERNETES_API", serverUrl: "$KUBERNETES_API",
credentialsId: 'kubernetes', credentialsId: 'kubernetes',
namespace: 'salix' namespace: 'salix'
]) { ]) {
sh 'kubectl set image deployment/hedera-web-$BRANCH_NAME hedera-web-$BRANCH_NAME=$IMAGE:$TAG' sh 'kubectl set image deployment/hedera-web-$BRANCH_NAME hedera-web-$BRANCH_NAME=$REGISTRY/hedera-web:$VERSION'
sh 'kubectl set image deployment/hedera-web-cron-$BRANCH_NAME hedera-web-cron-$BRANCH_NAME=$IMAGE:$TAG' sh 'kubectl set image deployment/hedera-web-cron-$BRANCH_NAME hedera-web-cron-$BRANCH_NAME=$REGISTRY/hedera-web:$VERSION'
} }
} }
} }

2
debian/changelog vendored
View File

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

View File

@ -1,9 +1,12 @@
version: '3.7' version: '3.7'
services: services:
main: main:
image: registry.verdnatura.es/verdnatura/hedera-web:${TAG:?} image: registry.verdnatura.es/hedera-web:${VERSION:?}
build: build:
context: . context: .
dockerfile: Dockerfile dockerfile: Dockerfile
args: args:
- VERSION=${VERSION:?} - VERSION=${VERSION:?}
cron:
image: registry.verdnatura.es/hedera-web:${VERSION:?}
command: 'cron -f'

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

@ -105,8 +105,7 @@
auto-load="false" auto-load="false"
result-index="3" result-index="3"
on-status-changed="onItemsChange"> on-status-changed="onItemsChange">
DROP TEMPORARY TABLE IF EXISTS tmp.item; CREATE OR REPLACE TEMPORARY TABLE tmp.item
CREATE TEMPORARY TABLE tmp.item
(INDEX (itemFk)) (INDEX (itemFk))
ENGINE = MEMORY ENGINE = MEMORY
SELECT i.id itemFk SELECT i.id itemFk

View File

@ -67,7 +67,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 +98,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;
} }

View File

@ -162,6 +162,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

@ -26,7 +26,7 @@
<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, it.categoryFk realm
FROM shelfMultiConfig c FROM shelfConfig c
JOIN vn.itemType it ON it.id = c.family JOIN vn.itemType it ON it.id = c.family
</db-model> </db-model>
</htk-combo> </htk-combo>

View File

@ -1,6 +1,6 @@
{ {
"name": "hedera-web", "name": "hedera-web",
"version": "25.4.4", "version": "24.14.8",
"description": "Verdnatura web page", "description": "Verdnatura web page",
"license": "GPL-3.0", "license": "GPL-3.0",
"repository": { "repository": {

View File

@ -8,7 +8,7 @@ class Clean extends Edi\Method {
$cleanPeriod = $db->getValue( $cleanPeriod = $db->getValue(
"SELECT ic.cleanPeriod "SELECT ic.cleanPeriod
FROM imapMultiConfig ic FROM imapConfig ic
JOIN util.config c ON c.environment = ic.environment"); JOIN util.config c ON c.environment = ic.environment");
$deleted = 0; $deleted = 0;

View File

@ -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 imapMultiConfig ic FROM imapConfig 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}',