Merge branch 'master' of https://gitea.verdnatura.es/verdnatura/salix into test
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
commit
508a4b2d34
|
@ -71,11 +71,10 @@ module.exports = Self => {
|
|||
}
|
||||
|
||||
try {
|
||||
const response = await Self.get(fileCabinet, filter);
|
||||
const [documents] = response.Items;
|
||||
if (!documents) return false;
|
||||
const [response] = await Self.get(fileCabinet, filter);
|
||||
if (!response) return false;
|
||||
|
||||
return {id: documents.Id};
|
||||
return {id: response['Document ID']};
|
||||
} catch (error) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ module.exports = Self => {
|
|||
|
||||
const email = new Email('delivery-note', params);
|
||||
|
||||
const docuwareFile = await models.Docuware.download(ctx, id, 'deliveryNote');
|
||||
const docuwareFile = await models.Docuware.download(id, 'deliveryNote');
|
||||
|
||||
return email.send({
|
||||
overrideAttachments: true,
|
||||
|
|
|
@ -16,19 +16,9 @@ describe('docuware download()', () => {
|
|||
|
||||
it('should return the document data', async() => {
|
||||
const docuwareId = 1;
|
||||
const response = {
|
||||
Items: [
|
||||
{
|
||||
Id: docuwareId,
|
||||
Fields: [
|
||||
{
|
||||
FieldName: 'ESTADO',
|
||||
Item: 'Firmado'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
const response = [{
|
||||
'Document ID': docuwareId
|
||||
}];
|
||||
spyOn(docuwareModel, 'get').and.returnValue((new Promise(resolve => resolve(response))));
|
||||
|
||||
const result = await models.Docuware.checkFile(ticketId, fileCabinetName, null, true);
|
||||
|
|
|
@ -111,7 +111,7 @@ module.exports = Self => {
|
|||
throw new UserError('Action not allowed on the test environment');
|
||||
|
||||
// delete old
|
||||
const docuwareFile = await models.Docuware.checkFile(ctx, id, fileCabinet, false);
|
||||
const docuwareFile = await models.Docuware.checkFile(id, fileCabinet, false);
|
||||
if (docuwareFile) {
|
||||
const deleteJson = {
|
||||
'Field': [{'FieldName': 'ESTADO', 'Item': 'Pendiente eliminar', 'ItemElementName': 'String'}]
|
||||
|
|
|
@ -25,10 +25,6 @@ class Controller extends SearchPanel {
|
|||
this.filter.values.push({});
|
||||
setTimeout(() => this.parentPopover.relocate());
|
||||
}
|
||||
|
||||
changeTag() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
ngModule.vnComponent('vnOrderCatalogSearchPanel', {
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
<vn-th field="street" expand>Street</vn-th>
|
||||
<vn-th field="city">City</vn-th>
|
||||
<vn-th field="postalCode" translate-attr="{title: 'Postcode'}" shrink>PC</vn-th>
|
||||
<vn-th field="clientFk" expand>Client</vn-th>
|
||||
<vn-th field="nickname" expand>Client</vn-th>
|
||||
<vn-th field="warehouse" expand>Warehouse</vn-th>
|
||||
<vn-th field="packages" shrink>Packages</vn-th>
|
||||
<vn-th field="volume" shrink>m³</vn-th>
|
||||
|
@ -100,9 +100,9 @@
|
|||
</field>
|
||||
</vn-td-editable>
|
||||
<vn-td expand title="{{::ticket.street}}">{{::ticket.street}}</vn-td>
|
||||
<vn-td
|
||||
expand
|
||||
ng-click="$ctrl.goToBuscaman(ticket)"
|
||||
<vn-td
|
||||
expand
|
||||
ng-click="$ctrl.goToBuscaman(ticket)"
|
||||
class="link"
|
||||
vn-tooltip="Open buscaman"
|
||||
tooltip-position="up">
|
||||
|
|
|
@ -32,6 +32,14 @@ module.exports = Self => {
|
|||
});
|
||||
|
||||
Self.docuwareDownload = async id => {
|
||||
const models = Self.app.models;
|
||||
const docuwareInfo = await models.Docuware.findOne({
|
||||
where: {
|
||||
code: 'deliveryNote',
|
||||
action: 'find'
|
||||
}
|
||||
});
|
||||
|
||||
const filter = {
|
||||
condition: [
|
||||
{
|
||||
|
@ -50,6 +58,6 @@ module.exports = Self => {
|
|||
}
|
||||
]
|
||||
};
|
||||
return Self.app.models.Docuware.download(id, 'deliveryNote', filter);
|
||||
return models.Docuware.download(id, 'deliveryNote', filter);
|
||||
};
|
||||
};
|
||||
|
|
|
@ -42,4 +42,5 @@ module.exports = function(Self) {
|
|||
require('../methods/ticket/expeditionPalletLabel')(Self);
|
||||
require('../methods/ticket/saveSign')(Self);
|
||||
require('../methods/ticket/invoiceTickets')(Self);
|
||||
require('../methods/ticket/docuwareDownload')(Self);
|
||||
};
|
||||
|
|
|
@ -3,10 +3,11 @@ import Section from 'salix/components/section';
|
|||
import './style.scss';
|
||||
|
||||
class Controller extends Section {
|
||||
constructor($element, $, vnReport, vnEmail) {
|
||||
constructor($element, $, vnReport, vnEmail, vnFile) {
|
||||
super($element, $);
|
||||
this.vnReport = vnReport;
|
||||
this.vnEmail = vnEmail;
|
||||
this.vnFile = vnFile;
|
||||
}
|
||||
|
||||
get ticketId() {
|
||||
|
@ -322,7 +323,7 @@ class Controller extends Section {
|
|||
}
|
||||
|
||||
docuwareDownload() {
|
||||
this.vnFile.download(`api/Ticket/${this.ticket.id}/docuwareDownload`);
|
||||
this.vnFile.download(`api/Tickets/${this.ticket.id}/docuwareDownload`);
|
||||
}
|
||||
|
||||
setTicketWeight(weight) {
|
||||
|
@ -335,7 +336,7 @@ class Controller extends Section {
|
|||
}
|
||||
}
|
||||
|
||||
Controller.$inject = ['$element', '$scope', 'vnReport', 'vnEmail'];
|
||||
Controller.$inject = ['$element', '$scope', 'vnReport', 'vnEmail', 'vnFile'];
|
||||
|
||||
ngModule.vnComponent('vnTicketDescriptorMenu', {
|
||||
template: require('./index.html'),
|
||||
|
|
|
@ -5,7 +5,7 @@ class Controller extends Section {
|
|||
onSubmit() {
|
||||
const sip = this.worker.sip;
|
||||
const params = {
|
||||
userFk: this.worker.userFk,
|
||||
userFk: this.worker.id,
|
||||
extension: sip.extension
|
||||
};
|
||||
this.$.watcher.check();
|
||||
|
|
|
@ -8,4 +8,4 @@ SELECT
|
|||
FROM supplier s
|
||||
JOIN entry e ON e.supplierFk = s.id
|
||||
LEFT JOIN province p ON p.id = s.provinceFk
|
||||
WHERE e.id = ?
|
||||
WHERE e.id = ?
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
<h3 class="uppercase">{{invoice.name}}</h3>
|
||||
<div>{{invoice.postalAddress}}</div>
|
||||
<div>{{invoice.postcodeCity}}</div>
|
||||
<div>{{invoice.postCode}}, {{invoice.city}}, ({{invoice.province}})</div>
|
||||
<div v-if="invoice.nif">{{$t('fiscalId')}}: {{invoice.nif}}</div>
|
||||
<div v-if="invoice.phone">{{$t('phone')}}: {{invoice.phone}}</div>
|
||||
</div>
|
||||
|
|
|
@ -4,6 +4,9 @@ SELECT
|
|||
i.issued,
|
||||
s.name,
|
||||
s.street AS postalAddress,
|
||||
s.city,
|
||||
s.postCode,
|
||||
pr.name province,
|
||||
s.nif,
|
||||
s.phone,
|
||||
p.name payMethod
|
||||
|
@ -11,4 +14,5 @@ SELECT
|
|||
JOIN supplier s ON s.id = i.supplierFk
|
||||
JOIN company c ON c.id = i.companyFk
|
||||
JOIN payMethod p ON p.id = s.payMethodFk
|
||||
LEFT JOIN province pr ON pr.id = s.provinceFk
|
||||
WHERE i.id = ?
|
||||
|
|
Loading…
Reference in New Issue