derp
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Joan Sanchez 2022-05-26 16:14:10 +02:00
parent 6586595976
commit a5f3580b17
16 changed files with 47 additions and 35 deletions

View File

@ -0,0 +1,3 @@
alter table `vn`.`client`
add hasIncoterms tinyint(1) default 0 not null comment 'Received incoterms authorization from client';

View File

@ -95,6 +95,10 @@ module.exports = Self => {
{
arg: 'despiteOfClient',
type: 'number'
},
{
arg: 'hasIncoterms',
type: 'boolean'
}
],
returns: {

View File

@ -32,10 +32,10 @@
"model": "Sample",
"foreignKey": "typeFk"
},
"worker": {
"user": {
"type": "belongsTo",
"model": "Worker",
"foreignKey": "workerFk"
"model": "Account",
"foreignKey": "userFk"
},
"account": {
"type": "belongsTo",

View File

@ -98,6 +98,9 @@
"hasCoreVnh": {
"type": "boolean"
},
"hasIncoterms": {
"type": "boolean"
},
"isTaxDataChecked":{
"type": "boolean"
},

View File

@ -185,6 +185,14 @@
vn-acl="administrative">
</vn-check>
</vn-horizontal>
<vn-horizontal>
<vn-check
vn-one
label="Incoterms authorization"
ng-model="$ctrl.client.hasIncoterms"
vn-acl="administrative">
</vn-check>
</vn-horizontal>
</vn-card>
<vn-button-bar>
<vn-submit

View File

@ -9,4 +9,5 @@ Found a client with this phone or email: El cliente con id <a href="#!/client/{{
Sage tax type: Tipo de impuesto Sage
Sage transaction type: Tipo de transacción Sage
Previous client: Cliente anterior
In case of a company succession, specify the grantor company: En el caso de que haya habido una sucesión de empresa, indicar la empresa cedente
In case of a company succession, specify the grantor company: En el caso de que haya habido una sucesión de empresa, indicar la empresa cedente
Incoterms authorization: Autorización incoterms

View File

@ -30,9 +30,9 @@
</vn-td>
<vn-td>
<span
ng-click="workerDescriptor.show($event, sample.worker.id)"
class="link">
{{::sample.worker.user.name}}
ng-click="workerDescriptor.show($event, sample.user.id)"
ng-class="{'link': sample.user}">
{{::sample.user.name || 'System' | translate}}
</span>
</vn-td>
<vn-td>{{::sample.company.code}}</vn-td>

View File

@ -12,15 +12,9 @@ class Controller extends Section {
fields: ['code', 'description']
}
}, {
relation: 'worker',
relation: 'user',
scope: {
fields: ['userFk'],
include: {
relation: 'user',
scope: {
fields: ['name']
}
}
fields: ['id', 'name']
}
}, {
relation: 'company',

View File

@ -15,6 +15,7 @@ module.exports = async function(request, response, next) {
SELECT
t.id,
t.clientFk,
t.companyFk,
c.name clientName,
c.email recipient,
c.salesPersonFk,

View File

@ -23,6 +23,7 @@ module.exports = async function(request, response, next) {
SELECT
t.id,
t.clientFk,
t.companyFk,
c.name clientName,
c.email recipient,
c.salesPersonFk,

View File

@ -17,6 +17,7 @@ module.exports = async function(request, response, next) {
SELECT
t.id,
t.clientFk,
t.companyFk,
c.name clientName,
c.email recipient,
c.salesPersonFk,

View File

@ -16,6 +16,7 @@ module.exports = async function(request, response, next) {
SELECT
t.id,
t.clientFk,
t.companyFk,
c.name clientName,
c.email recipient,
c.salesPersonFk,

View File

@ -94,8 +94,10 @@ module.exports = {
const {firstOrder} = await db.findOne(`
SELECT COUNT(*) as firstOrder
FROM ticket t
JOIN client c ON c.id = t.clientFk
WHERE t.clientFk = ?
AND NOT t.isDeleted
AND c.isVies
`, [ticket.clientFk]);
if (firstOrder == 1) {
@ -108,6 +110,15 @@ module.exports = {
const email = new Email('incoterms-authorization', args);
await email.send();
const sample = await db.findOne(
`SELECT id
FROM sample
WHERE code = 'incoterms-authorization'`);
await db.rawSql(`
INSERT INTO clientSample (clientFk, typeFk, companyFk) VALUES(?, ?, ?)
`, [ticket.clientFk, sample.id, ticket.companyFk])
}
} catch (error) {
// Domain not found

View File

@ -1,5 +1,5 @@
subject: Orden de recogida
title: Orden de recogida
subject: Autorización incoterms
title: Autorización incoterms
description:
dear: Estimado cliente
instructions: Aqui tienes tu orden de recogida.
instructions: A continuación le adjuntamos la autorización incoterms que deberá entregar rellenada y firmada.

View File

@ -68,22 +68,6 @@
</p>
</div>
</div>
<!-- <div class="signature">
<p>{{$t('issued', [
'Algemesí',
invoice.issued.getDate(),
$t('months')[invoice.issued.getMonth()],
invoice.issued.getFullYear()])
}}
</p>
<p><em>({{$t('signature')}})</em></p>
<img v-bind:src="getReportSrc('signature.png')">
<p>
<div>{{$t('signer.name')}}: JUAN VICENTE FERRER ROIG</div>
<div>{{$t('signer.ID')}}: 73943586N</div>
<div>{{$t('signer.position')}}: ADMINISTRADOR</div>
</p>
</div> -->
</div>
</div>
<!-- Footer block -->

View File

@ -3,7 +3,7 @@ const reportHeader = new Component('report-header');
const reportFooter = new Component('report-footer');
module.exports = {
name: 'cmr-authorization',
name: 'incoterms-authorization',
async serverPrefetch() {
this.ticket = await this.findOneFromDef('ticket', [this.ticketId]);
if (!this.ticket)