{{_.dear}}
{{{_.bodyDescription}}}
+
{{_.dear}}
+ +{{_.bodyDescription}}
+{{_.termLimits}}
++ {{_.payMethod}} + +
+ {{_.legalActions}} +
{{_.contact}}
+ +{{_.waitingForNews}}
+{{_.conclusion}}
+ ++
{{_.dear}}
{{_.bodyDescription}}
{{_.conclusion}}
- {{{previewAttachments}}} + + {{#isPreview}} + + + + + + + {{/isPreview}} +
+ {{supplierName}} +
+{{_.bodyDescription}}
+{{_.bodyDescription}}
+{{_.clientAdvice}}
-{{_.clientAdvice}}
TODOS LOS CAMPOS HAN DE SER CUMPLIMENTADOS OBLIGATORIAMENTE.
-UNA VEZ FIRMADA ESTA ORDEN DE DOMICILIACIÓN DEBE SER ENVIADA AL ACREEDOR PARA SU CUSTODIA Y ES RECOMENDABLE FACILITAR UNA COPIA A SU ENTIDAD BANCARIA.
+{{_.mandatoryFields}}
+{{_.sendOrder}}
diff --git a/services/print/application/template/sepa-core/locale/es.json b/services/print/application/template/sepa-core/locale/es.json index ed126e57d9..e5453e8589 100644 --- a/services/print/application/template/sepa-core/locale/es.json +++ b/services/print/application/template/sepa-core/locale/es.json @@ -1,5 +1,7 @@ { "title": "Orden de domiciliación de adeudo directo SEPA CORE", + "toCompleteBySupplier": "A cumplimentar por el acreedor", + "toCompleteByClient": "A cumplimentar por el deudor", "bodyDescription": "Mediante la firma de esta orden de domiciliación, el deudor autoriza (A) al acreedor a enviar instrucciones a la entidad del deudor para adeudar su cuenta y (B) a la entidad para efectuar los adeudos en su cuenta siguiendo las instrucciones del acreedor.Como parte de sus derechos, el deudor está legitimado al reembolso por su entidad en los términos y condiciones del contrato suscrito con la misma. La solicitud de reembolso deberá efectuarse dentro de las ocho semanas que adeudo en cuenta. Puede obtener información adicional sobre sus derechos en su entidad financiera.", "orderReference": "Referencia de la orden de domiciliación", "supplierIdentifier": "Identificador del acreedor", @@ -15,10 +17,15 @@ "swift": "Swift BIC", "accountNumber": "Número de cuenta - IBAN", "accountHolder": "(Titular/es de la cuenta de cargo)", + "accountNumberFormat": "En España el IBAN consta de 24 posiciones comenzando siempre por ES", "paymentType": "Tipo de pago", + "recurrent": "Recurrente", + "unique": "Único", "signLocation": "Fecha - Localidad", "sign": "Firma del deudor y sello", - "fiscalAddress": "VERDNATURA LEVANTE SL, B97367486 Avda. Espioca, 100, 46460 Silla _ www.verdnatura.es _ clientes@verdnatura.es", + "mandatoryFields": "TODOS LOS CAMPOS HAN DE SER CUMPLIMENTADOS OBLIGATORIAMENTE.", + "sendOrder": "UNA VEZ FIRMADA ESTA ORDEN DE DOMICILIACIÓN DEBE SER ENVIADA AL ACREEDOR PARA SU CUSTODIA Y ES RECOMENDABLE FACILITAR UNA COPIA A SU ENTIDAD BANCARIA.", + "fiscalAddress": "VERDNATURA LEVANTE SL, B97367486 Avda. Espioca, 100, 46460 Silla · www.verdnatura.es · clientes@verdnatura.es", "privacy": "- AVISO - Este mensaje es privado y confidencial, y debe ser utilizado exclusivamente por la persona destinataria del mismo. Si usted ha recibido este mensaje por error, le rogamos lo comunique al remitente y borre dicho mensaje y cualquier documento adjunto que pudiera contener. Verdnatura Levante SL no renuncia a la confidencialidad ni a ningún privilegio por causa de transmisión errónea o mal funcionamiento. Igualmente no se hace responsable de los cambios, alteraciones, errores u omisiones que pudieran hacerse al mensaje una vez enviado.", "privacyLaw": "En cumplimiento de lo dispuesto en la Ley Orgánica 15/1999, de Protección de Datos de Carácter Personal, le comunicamos que los datos personales que facilite se incluirán en ficheros automatizados de VERDNATURA LEVANTE S.L., pudiendo en todo momento ejercitar los derechos de acceso, rectificación, cancelación y oposición, comunicándolo por escrito al domicilio social de la entidad. La finalidad del fichero es la gestión administrativa, contabilidad, y facturación." } \ No newline at end of file diff --git a/services/print/application/template/sepa-core/sepa-core.js b/services/print/application/template/sepa-core/sepa-core.js index 74e08fd31b..304e327dae 100644 --- a/services/print/application/template/sepa-core/sepa-core.js +++ b/services/print/application/template/sepa-core/sepa-core.js @@ -10,7 +10,7 @@ module.exports = class SepaCore { LOWER(ct.code) AS countryCode, c.email AS recipient, c.socialName AS clientName, - c.postalAddress AS clientStreet, + c.street AS clientStreet, c.postcode AS clientPostCode, c.city AS clientCity, p.name AS clientProvince, diff --git a/services/print/application/template/sepa-core/static/image/action.png b/services/print/application/template/sepa-core/static/image/action.png deleted file mode 100644 index 2cd16c453d..0000000000 Binary files a/services/print/application/template/sepa-core/static/image/action.png and /dev/null differ diff --git a/services/print/application/template/sepa-core/static/image/facebook.png b/services/print/application/template/sepa-core/static/image/facebook.png deleted file mode 100644 index 7ab54c538c..0000000000 Binary files a/services/print/application/template/sepa-core/static/image/facebook.png and /dev/null differ diff --git a/services/print/application/template/sepa-core/static/image/header.png b/services/print/application/template/sepa-core/static/image/header.png deleted file mode 100644 index 3c063ae444..0000000000 Binary files a/services/print/application/template/sepa-core/static/image/header.png and /dev/null differ diff --git a/services/print/application/template/sepa-core/static/image/info.png b/services/print/application/template/sepa-core/static/image/info.png deleted file mode 100644 index fb75cbc4ef..0000000000 Binary files a/services/print/application/template/sepa-core/static/image/info.png and /dev/null differ diff --git a/services/print/application/template/sepa-core/static/image/instagram.png b/services/print/application/template/sepa-core/static/image/instagram.png deleted file mode 100644 index 66550c4a58..0000000000 Binary files a/services/print/application/template/sepa-core/static/image/instagram.png and /dev/null differ diff --git a/services/print/application/template/sepa-core/static/image/linkedin.png b/services/print/application/template/sepa-core/static/image/linkedin.png deleted file mode 100644 index 0d191e5aee..0000000000 Binary files a/services/print/application/template/sepa-core/static/image/linkedin.png and /dev/null differ diff --git a/services/print/application/template/sepa-core/static/image/logo.png b/services/print/application/template/sepa-core/static/image/logo.png deleted file mode 100644 index 55e26fec6d..0000000000 Binary files a/services/print/application/template/sepa-core/static/image/logo.png and /dev/null differ diff --git a/services/print/application/template/sepa-core/static/image/logo.svg b/services/print/application/template/sepa-core/static/image/logo.svg deleted file mode 100644 index 51baf46d35..0000000000 --- a/services/print/application/template/sepa-core/static/image/logo.svg +++ /dev/null @@ -1,48 +0,0 @@ - - - \ No newline at end of file diff --git a/services/print/application/template/sepa-core/static/image/pinterest.png b/services/print/application/template/sepa-core/static/image/pinterest.png deleted file mode 100644 index 4d7b28ef81..0000000000 Binary files a/services/print/application/template/sepa-core/static/image/pinterest.png and /dev/null differ diff --git a/services/print/application/template/sepa-core/static/image/twitter.png b/services/print/application/template/sepa-core/static/image/twitter.png deleted file mode 100644 index c4a8ab0c1c..0000000000 Binary files a/services/print/application/template/sepa-core/static/image/twitter.png and /dev/null differ diff --git a/services/print/application/template/sepa-core/static/image/youtube.png b/services/print/application/template/sepa-core/static/image/youtube.png deleted file mode 100644 index 11871deb54..0000000000 Binary files a/services/print/application/template/sepa-core/static/image/youtube.png and /dev/null differ diff --git a/services/print/application/template/sepa-core/style.css b/services/print/application/template/sepa-core/style.css new file mode 100644 index 0000000000..5b1e628d67 --- /dev/null +++ b/services/print/application/template/sepa-core/style.css @@ -0,0 +1,22 @@ +img { + margin: 0 +} + +.body { + font-family: arial, sans-serif; + max-width: 90%; + margin: 0 auto; + font-size: 14px; + color: #000 +} + +body .title { + text-align: center; + padding-bottom: 20px +} + +body .title h1 { + font-size: 16px; + color: #333; + margin: 0 +} \ No newline at end of file diff --git a/services/print/server/server.js b/services/print/server/server.js index 9ef4074ea4..c94a4f8345 100644 --- a/services/print/server/server.js +++ b/services/print/server/server.js @@ -10,13 +10,8 @@ var path = require('path'); app.use(bodyParser.json()); app.use(bodyParser.urlencoded({extended: true})); -// Auth middleware -var requestToken = function(request, response, next) { - auth.init(request, response, next); -}; - // Load routes -app.use('/', requestToken, require('../application/router.js')); +app.use('/', require('../application/router.js')); app.start = function() { var listener = app.listen(config.app.port, function() { diff --git a/services/print/static/css/component.css b/services/print/static/css/component.css index 6da33bee3f..2b2b8e1577 100644 --- a/services/print/static/css/component.css +++ b/services/print/static/css/component.css @@ -1,75 +1,203 @@ -.panel { - border: 1px solid #DDD; - margin-bottom: 10px; - padding:10px -} - -.row { - margin-bottom: 15px; - overflow: hidden; - content: ''; - clear: both -} - -.row .text { - margin-bottom: 5px -} - -.row .control { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box -} - -.row .description { - font-size: 8px; - color: #999 -} - -.row .v-align { - padding-top: 5px; - line-height: 21px -} - -.row:last-child { - margin-bottom: 0 -} - -.row.inline .text { - margin-bottom: 0; - width: 40%; - float: left -} - -.row.inline .control { - font-weight: bold; - padding-left: 20px; - color: #000; - width: 60%; - float: left -} - -.box { - border-top: 1px solid #CCC; - border-right: 1px solid #CCC; - border-bottom: 1px solid #CCC; - font-weight: bold; - text-align: center; - padding-top: 4px; - width: 25px; - height: 21px; - color: #000; - float: left -} - -.row .control .box:first-child { - border-left: 1px solid #CCC; -} - -p { - text-align: justify -} - -p.small { - font-size: 10px -} \ No newline at end of file +body { + margin: 0 auto; + width: 210mm +} + +img { + margin: 0 +} + +p { + text-align: justify +} + +.panel { + border: 1px solid #DDD; + margin-bottom: 10px; + position: relative; + padding:10px +} + +.row { + margin-bottom: 15px; + overflow: hidden +} + +.row.small { + margin-bottom: 5px +} + +.row .text { + margin-bottom: 5px +} + +.row .control { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box +} + +.row .text, .row .control { + overflow: hidden +} + +.row .description { + position: relative; + padding-top: 2px; + overflow: hidden; + font-size: 9px; + display: block; + color: #999 +} + +.row .line { + border-bottom: 1px solid #DDD; + border-right: 1px solid #DDD; + border-left: 1px solid #DDD; + margin-top: 10px; + color: #999; + padding: 5px +} + +.row .description span { + background-color: #FFF; + margin: -5px 0 0 50px; + display: block; + padding: 5px; + float: left +} + +.row:last-child { + margin-bottom: 0 +} + +.row.inline .text { + margin-bottom: 0; + width: 40%; + float: left +} + +.row.inline .control { + font-weight: bold; + padding-left: 20px; + color: #000; + width: 60%; + float: left +} + +.row.inline .description { + position: static; + overflow: visible +} + +.box { + border-top: 1px solid #CCC; + border-right: 1px solid #CCC; + border-bottom: 1px solid #CCC; + font-weight: bold; + text-align: center; + padding-top: 4px; + width: 25px; + height: 21px; + color: #000; + float: left +} + +.box.crossed { + font-weight: 100; + font-size: 16px +} + +.row .control .box:first-child { + border-left: 1px solid #CCC; +} + +.font.small { + font-size: 10px +} + +.font.gray { + color: #555 +} + +.font.verticalAlign { + height: 27px; + line-height: 27px +} + +.font.centered { + height: 27px; + line-height: 27px; + text-align: center +} + +.verticalText { + -moz-transform: rotate(90deg); + -webkit-transform: rotate(90deg); + transform: rotate(90deg); + position: absolute; + text-align: center; + font-size: .65em; + width: 200px; + right: -115px; + top: 50% +} + +.columns { + overflow: hidden +} + +.columns .size100 { + width: 100%; + float: left +} + +.columns .size75 { + width: 75%; + float: left +} + +.columns .size50 { + width: 50%; + float: left +} + +.columns .size33 { + width: 33.33%; + float: left +} + +.columns .size25 { + width: 25%; + float: left +} + +.pull-left { + float: left +} + +.pull-right { + float: right +} + + +.grid { + border-bottom: 3px solid #888888 +} + +.grid .row { + padding: 5px; + margin-bottom: 0 +} + +.grid .header { + border-bottom: 1px solid #808080; + border-top: 1px solid #808080; + background-color: #c0c0c0; +} + + +.grid .row.inline > div { + float: left; +} + diff --git a/services/production/common/methods/ticket/change-worker.js b/services/production/common/methods/ticket/change-worker.js index c1fcea0809..896c8a7f9e 100644 --- a/services/production/common/methods/ticket/change-worker.js +++ b/services/production/common/methods/ticket/change-worker.js @@ -1,5 +1,5 @@ -module.exports = function(Ticket) { - Ticket.remoteMethodCtx('changeWorker', { +module.exports = function(Self) { + Self.remoteMethodCtx('changeWorker', { description: 'Change worker of tickets state', accepts: [ { @@ -11,7 +11,7 @@ module.exports = function(Ticket) { } ], returns: { - arg: 'response', + arg: 'response', type: 'boolean' }, http: { @@ -19,17 +19,29 @@ module.exports = function(Ticket) { path: '/:worker/changeWorker' } }); - - Ticket.changeWorker = function(ctx, worker, cb) { - var tickets = ctx.req.body.tickets; + + Self.changeWorker = function(ctx, worker, cb) { + let tickets = ctx.req.body.tickets; changeWorker(worker, tickets, cb); }; - let changeWorker = function(worker, tickets, cb) { - var FakeProduction = Ticket.app.models.FakeProduction; - - FakeProduction.updateAll({ticketFk: {inq: tickets}}, {workerFk: worker}, function(err, info){ - (err) ? cb(err, null) : cb(null, info); + function changeWorker(worker, tickets, cb) { + let ticketTracking = Self.app.models.ticketTracking; + let toSave = []; + for (let ticket of tickets) { + toSave.push( + { + stateFk: 20, + ticketFk: ticket, + workerFk: worker + } + ); + } + ticketTracking.create(toSave, function(err, info) { + if (err) + cb(err, null); + else + cb(null, info); }); - }; + } }; diff --git a/services/production/common/models/ticket-tracking.json b/services/production/common/models/ticket-tracking.json new file mode 100644 index 0000000000..bdf54191a6 --- /dev/null +++ b/services/production/common/models/ticket-tracking.json @@ -0,0 +1,33 @@ +{ + "name": "ticketTracking", + "base": "VnModel", + "properties": { + "id": { + "id": true, + "type": "Number", + "forceId": false + }, + "created": { + "type": "Date", + "required": false + } + }, + "relations": { + "ticket": { + "type": "belongsTo", + "model": "Ticket", + "foreignKey": "ticketFk" + }, + "state": { + "type": "belongsTo", + "model": "State", + "foreignKey": "stateFk" + }, + "worker": { + "type": "belongsTo", + "model": "worker", + "foreignKey": "workerFk" + } + } + } + \ No newline at end of file diff --git a/services/production/common/models/worker.json b/services/production/common/models/worker.json new file mode 100644 index 0000000000..cf34ee0c18 --- /dev/null +++ b/services/production/common/models/worker.json @@ -0,0 +1,31 @@ +{ + "name": "worker", + "base": "VnModel", + "properties": { + "id": { + "id": true, + "type": "Number", + "forceId": false + }, + "workerCode": { + "type": "String" + }, + "firstName": { + "type": "String" + }, + "name": { + "type": "String" + } + , + "phone": { + "type": "String" + } + }, + "relations": { + "user": { + "type": "belongsTo", + "model": "User", + "foreignKey": "userFk" + } + } +} \ No newline at end of file diff --git a/services/production/server/model-config.json b/services/production/server/model-config.json index d4d72f77d9..07e3368346 100644 --- a/services/production/server/model-config.json +++ b/services/production/server/model-config.json @@ -59,6 +59,12 @@ }, "Route": { "dataSource": "salix" + }, + "ticketTracking": { + "dataSource": "vn" + }, + "worker": { + "dataSource": "vn" } }