This commit is contained in:
Gerard 2019-01-15 11:26:08 +01:00
commit 90d308afd6
7 changed files with 59 additions and 46 deletions

View File

@ -24,8 +24,8 @@ services:
image: registry.verdnatura.es/salix-mailer:${TAG} image: registry.verdnatura.es/salix-mailer:${TAG}
restart: unless-stopped restart: unless-stopped
build: build:
dockerfile: services/mailer/Dockerfile context: services/mailer
environment: environment:
- NODE_ENV - NODE_ENV
volumes: volumes:
- /config/vn-mailer - /containers/vn-mailer:/etc/vn-mailer

View File

@ -42,7 +42,8 @@ module.exports = Self => {
r.bankFk, r.bankFk,
firstName, firstName,
name, name,
r.clientFk r.clientFk,
FALSE pdf
FROM vn.receipt r FROM vn.receipt r
LEFT JOIN vn.worker w ON w.id = r.workerFk LEFT JOIN vn.worker w ON w.id = r.workerFk
JOIN vn.company c ON c.id = r.companyFk JOIN vn.company c ON c.id = r.companyFk
@ -60,7 +61,8 @@ module.exports = Self => {
NULL, NULL,
NULL, NULL,
NULL, NULL,
i.clientFk i.clientFk,
i.pdf
FROM vn.invoiceOut i FROM vn.invoiceOut i
JOIN vn.company c ON c.id = i.companyFk JOIN vn.company c ON c.id = i.companyFk
WHERE i.clientFk = ? AND i.companyFk = ? WHERE i.clientFk = ? AND i.companyFk = ?

View File

@ -6,7 +6,6 @@
data="addresses" data="addresses"
auto-load="true"> auto-load="true">
</vn-crud-model> </vn-crud-model>
<vn-vertical> <vn-vertical>
<vn-card pad-large compact> <vn-card pad-large compact>
<vn-title vn-one>Addresses</vn-title> <vn-title vn-one>Addresses</vn-title>

View File

@ -12,7 +12,7 @@ export default class Controller {
case 'search': case 'search':
return /^\d+$/.test(value) return /^\d+$/.test(value)
? {id: value} ? {id: value}
: {name: {regexp: value}}; : {name: {like: `%${value}%`}};
case 'phone': case 'phone':
return { return {
or: [ or: [
@ -23,7 +23,7 @@ export default class Controller {
case 'name': case 'name':
case 'socialName': case 'socialName':
case 'city': case 'city':
return {[param]: {regexp: value}}; return {[param]: {regexp: `%${value}%`}};
case 'id': case 'id':
case 'fi': case 'fi':
case 'postcode': case 'postcode':

View File

@ -30,7 +30,7 @@
</vn-one> </vn-one>
<vn-one> <vn-one>
<div class="totalBox" ng-if="riskTotal.length"> <div class="totalBox" ng-if="riskTotal.length">
<h6> Total por empresa</h6> <h6 translate>Total by company</h6>
<vn-auto ng-repeat="riskByCompany in riskTotal"> <vn-auto ng-repeat="riskByCompany in riskTotal">
<vn-label-value <vn-label-value
label="{{riskByCompany.company.code}}" label="{{riskByCompany.company.code}}"
@ -48,11 +48,11 @@
<vn-th>Creation date</vn-th> <vn-th>Creation date</vn-th>
<vn-th>Employee</vn-th> <vn-th>Employee</vn-th>
<vn-th>Reference</vn-th> <vn-th>Reference</vn-th>
<vn-th>Bank</vn-th> <vn-th number>Bank</vn-th>
<vn-th>Debit</vn-th> <vn-th number>Debit</vn-th>
<vn-th>Havings</vn-th> <vn-th number>Havings</vn-th>
<vn-th>Balance</vn-th> <vn-th number>Balance</vn-th>
<vn-th>Conciliated</vn-th> <vn-th center>Conciliated</vn-th>
<vn-th></vn-th> <vn-th></vn-th>
</vn-tr> </vn-tr>
</vn-thead> </vn-thead>
@ -62,23 +62,23 @@
<vn-td>{{::risk.created | dateTime:'dd/MM/yyyy HH:mm'}}</vn-td> <vn-td>{{::risk.created | dateTime:'dd/MM/yyyy HH:mm'}}</vn-td>
<vn-td>{{::risk.firstName}} {{::risk.name}}</vn-td> <vn-td>{{::risk.firstName}} {{::risk.name}}</vn-td>
<vn-td>{{::risk.ref ? 'N/FRA ' + risk.ref : ''}}</vn-td> <vn-td>{{::risk.ref ? 'N/FRA ' + risk.ref : ''}}</vn-td>
<vn-td>{{::risk.bankFk}}</vn-td> <vn-td number>{{::risk.bankFk}}</vn-td>
<vn-td>{{::risk.debit | currency:'€':2}}</vn-td> <vn-td number>{{::risk.debit | currency:'€':2}}</vn-td>
<vn-td>{{::risk.credit | currency:'€':2}}</vn-td> <vn-td number>{{::risk.credit | currency:'€':2}}</vn-td>
<vn-td>{{risk.balance | currency:'€':2}}</vn-td> <vn-td number>{{risk.balance | currency:'€':2}}</vn-td>
<vn-td style="text-align: center"> <vn-td center>
<vn-check <vn-check
field="risk.isConciliate" field="risk.isConciliate"
disabled="true"> disabled="true">
</vn-check> </vn-check>
</vn-td> </vn-td>
<vn-td style="text-align: center"> <vn-td center>
<a ng-show="risk.ref" <a ng-show="risk.pdf"
href="api/InvoiceOuts/{{::risk.ref}}/download?access_token={{::$ctrl.accessToken}}"> href="api/InvoiceOuts/{{::risk.ref}}/download?access_token={{::$ctrl.accessToken}}">
<vn-icon <vn-icon-button
icon="cloud_download" icon="cloud_download"
title="Download PDF"> title="Download PDF">
</vn-icon> </vn-icon-button>
</a> </a>
</vn-td> </vn-td>
</vn-tr> </vn-tr>
@ -94,8 +94,13 @@
</vn-pagination> </vn-pagination>
</vn-card> </vn-card>
</vn-vertical> </vn-vertical>
<a ui-sref="client.card.risk.create" vn-tooltip="New payment" <a ui-sref="client.card.risk.create"
vn-bind="+" fixed-bottom-right> vn-tooltip="New payment"
<vn-float-button vn-acl="administrative" vn-acl-action="remove" icon="add"></vn-float-button> vn-bind="+"
fixed-bottom-right>
<vn-float-button
vn-acl="administrative"
vn-acl-action="remove"
icon="add">
</vn-float-button>
</a> </a>

View File

@ -4,4 +4,7 @@ Bank: Caja
Debit: Debe Debit: Debe
Conciliated: Conciliado Conciliated: Conciliado
New payment: Añadir pago New payment: Añadir pago
Havings: Haber Havings: Haber
Balance: Balance
Total by company: Total por empresa
Download PDF: Descargar PDF

View File

@ -1,30 +1,34 @@
require('require-yaml'); require('require-yaml');
const fs = require('fs-extra'); const fs = require('fs-extra');
const package = require('../package.json'); const packageJson = require('../package.json');
let configPath = `/config/${package.name}`; let configPath = `/etc/${packageJson.name}`;
let nginxConfigPath = '/config/nginx';
let env = process.env.NODE_ENV ? process.env.NODE_ENV : 'development'; let env = process.env.NODE_ENV ? process.env.NODE_ENV : 'development';
if (env === 'development') { let config = require('./config/datasources.json');
configPath = `${__dirname}/config`; let configFiles = [
nginxConfigPath = '../../nginx'; `${configPath}/datasources.json`,
`${configPath}/datasources.${env}.json`
];
for (let configFile of configFiles) {
if (fs.existsSync(configFile))
Object.assign(config, require(configFile));
} }
let config = require(`${configPath}/datasources.json`); let proxyConf = {};
let configEnvFile = `${configPath}/datasources.${env}.json`; let proxyFiles = [
'../../nginx/config.yml',
`${configPath}/config.yml`,
`${configPath}/config.${env}.yml`
];
if (fs.existsSync(configEnvFile)) for (let proxyFile of proxyFiles) {
Object.assign(config, require(configEnvFile)); if (fs.existsSync(proxyFile))
Object.assign(proxyConf, require(proxyFile));
let proxyConf = require(`${nginxConfigPath}/config.yml`); }
let proxyEnvFile = `${nginxConfigPath}/config.${env}.yml`;
if (fs.existsSync(proxyEnvFile))
Object.assign(proxyConf, require(proxyEnvFile));
config.proxy = proxyConf; config.proxy = proxyConf;
config.package = package; config.package = packageJson;
config.env = env; config.env = env;
module.exports = config; module.exports = config;