Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into dev
gitea/salix/dev This commit looks good Details

This commit is contained in:
Javi Gallego 2019-05-09 11:25:51 +02:00
commit 0d0f354902
16 changed files with 3231 additions and 2809 deletions

View File

@ -1,11 +0,0 @@
DROP TRIGGER IF EXISTS `vn2008`.`TicketsAfterUpdate`;
DELIMITER $$
USE `vn2008`$$
CREATE DEFINER=`root`@`%` TRIGGER `vn2008`.`TicketsAfterUpdate`
AFTER UPDATE ON `Tickets` FOR EACH ROW
BEGIN
CALL stock.queueAdd ('ticket', NEW.Id_Ticket, OLD.Id_Ticket);
END$$
DELIMITER ;

View File

@ -1,4 +1,4 @@
INSERT INTO `vn`.`sample`(`id`, `code`, `description`, `isVisible`, `hasCompany`)
INSERT INTO `vn`.`sample`(`code`, `description`, `isVisible`, `hasCompany`)
VALUES
(17, 'client-lcr', 'Autorisation pour débit', 1, 1);
('client-lcr', 'Email de solicitud de datos bancarios LCR', 1, 1);

File diff suppressed because one or more lines are too long

View File

@ -281,11 +281,17 @@ UPDATE `vn`.`client` SET defaultAddressFk = 10 WHERE id = 110;
UPDATE `vn`.`client` SET defaultAddressFk = 11 WHERE id = 200;
UPDATE `vn`.`client` SET defaultAddressFk = 12 WHERE id = 400;
UPDATE `vn`.`client` `c`
CREATE TEMPORARY TABLE `tmp`.`clientAddress`
select `c`.`id` `clientFk`,`c`.`name`,`a`.`id` `addressFk` FROM `vn`.`client` `c`
JOIN `vn`.`address` `a` ON `a`.`clientFk` = `c`.`id`
SET `c`.`defaultAddressFk` = `a`.`id`
WHERE `defaultAddressFk` IS NULL;
UPDATE `vn`.`client` `c`
JOIN `tmp`.`clientAddress` `a` ON `a`.`clientFk` = `c`.`id`
SET `c`.`defaultAddressFk` = `a`.`addressFk`;
DROP TEMPORARY TABLE `tmp`.`clientAddress`;
INSERT INTO `vn`.`clientCredit`(`id`, `clientFk`, `workerFk`, `amount`, `created`)
VALUES
(1 , 101, 5, 300, DATE_ADD(CURDATE(), INTERVAL -1 MONTH)),
@ -635,7 +641,7 @@ INSERT INTO `vn`.`sale`(`id`, `itemFk`, `ticketFk`, `concept`, `quantity`, `pric
(5, 1, 2, 'Ranged weapon longbow 2m', 10, 9.10, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL -10 DAY)),
(6, 1, 3, 'Ranged weapon longbow 2m', 15, 6.50, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL -5 DAY)),
(7, 2, 11, 'Melee weapon combat fist 15cm', 15, 1.46, 0, 0, 0, CURDATE()),
(8, 4, 11, 'Melee weapon heavy shield 1x0.5m', 10, 3.04, 0, 0, 0, CURDATE()),
(8, 4, 11, 'Melee weapon heavy shield 1x0.5m', 10, 3.05, 0, 0, 0, CURDATE()),
(9, 1, 16, 'Ranged weapon longbow 2m', 5, 9.10, 0, 0, 0, CURDATE()),
(10, 2, 16, 'Melee weapon combat fist 15cm', 10, 1.07, 0, 0, 0, CURDATE()),
(11, 1, 16, 'Ranged weapon longbow 2m', 2, 9.10, 0, 0, 0, CURDATE()),

File diff suppressed because it is too large Load Diff

View File

@ -41,7 +41,7 @@ describe('Ticket Edit basic data path', () => {
it(`should select a reason for the changes made then click on finalize`, async() => {
let url = await nightmare
.autocompleteSearch(selectors.ticketBasicData.chargesReasonAutocomplete, 'No realizar modificaciones en precios')
.autocompleteSearch(selectors.ticketBasicData.chargesReasonAutocomplete, 'Cambiar los precios en el ticket')
.waitToClick(selectors.ticketBasicData.finalizeButton)
.waitForURL('summary')
.parsedUrl();
@ -73,7 +73,7 @@ describe('Ticket Edit basic data path', () => {
.wait(1900)
.waitToGetProperty(selectors.ticketBasicData.stepTwoTotalPriceDif, 'innerText');
expect(result).toContain('-€203.25');
expect(result).toContain('-€13.95');
});
it(`should then click next to move on to step three`, async() => {

View File

@ -7,6 +7,6 @@ describe('Client get', () => {
expect(result.id).toEqual(101);
expect(result.name).toEqual('Bruce Wayne');
expect(result.debt).toEqual(-14.78);
expect(result.debt).toEqual(-14.65);
});
});

View File

@ -4,7 +4,7 @@ describe('client getDebt()', () => {
it('should return the client debt', async() => {
let result = await app.models.Client.getDebt(101);
expect(result.debt).toEqual(-14.78);
expect(result.debt).toEqual(-14.65);
});
});

View File

@ -17,7 +17,7 @@ describe('client summary()', () => {
it('should return a summary object containing debt', async() => {
let result = await app.models.Client.summary(101);
expect(result.debt.debt).toEqual(-14.78);
expect(result.debt.debt).toEqual(-14.65);
});
it('should return a summary object containing averageInvoiced', async() => {

View File

@ -11,9 +11,9 @@ describe('sale priceDifference()', () => {
};
let result = await app.models.Sale.priceDifference(11, data);
expect(result.totalUnitPrice).toEqual(4.5);
expect(result.totalUnitPrice).toEqual(4.51);
expect(result.totalNewPrice).toEqual(4.24);
expect(result.totalDifference).toEqual(3.75);
expect(result.totalDifference).toEqual(3.85);
});
it('should return an error if the ticket state is not valid for modifications', async() => {

View File

@ -37,8 +37,7 @@ class Controller {
getTotalDifferenceOfPrice() {
let totalPriceDifference = 0;
this.ticket.sale.items.forEach(item => {
let itemTotalPriceDifference = item.quantity * item.component.difference;
totalPriceDifference += itemTotalPriceDifference;
totalPriceDifference += item.component.difference;
});
this.totalPriceDifference = totalPriceDifference;
}

View File

@ -60,7 +60,7 @@ describe('Ticket', () => {
controller.getTotalDifferenceOfPrice();
expect(controller.totalPriceDifference).toEqual(3);
expect(controller.totalPriceDifference).toEqual(0.3);
});
});
});

View File

@ -100,7 +100,9 @@
}
.emptyField {
border-bottom: 1px dotted grey
border-bottom: 1px dotted grey;
min-height: 1em;
display: block
}
.field.rectangle span {
@ -214,20 +216,14 @@ table {
}
.signature {
width: 100%;
width: 100%
}
.signature td {
text-align: center;
margin: auto;
width: 40%;
padding: 0 50px 0 50px;
.signature section {
height: 150px
}
.signature-image {
height: 150px;
}
.signature-line {
border-bottom: 1px solid #DDD;
.signature p {
margin-right: 50%;
margin-top: 140px
}

View File

@ -17,3 +17,15 @@
.grey-background {
background-color: #DDD
}
.emptyField {
width: 100%;
}
.row-oriented.input-table > tbody > tr > td {
width: 10% !important
}
.row-oriented.input-table > tbody > tr > th {
width: 90% !important
}

View File

@ -57,7 +57,7 @@
<td>{{$t('client.fi')}}:</td>
<th>
<section class="field square">
<span v-for="i in 11">{{fi.charAt(i)}}</span>
<span v-for="i in 12">{{fi.charAt(i)}}</span>
</section>
</th>
</tr>
@ -72,15 +72,15 @@
<section class="vertical-text">
{{$t('client.toCompleteByClient')}}
</section>
<table class="row-oriented">
<table class="row-oriented input-table">
<tbody>
<tr>
<td>{{$t('bank.name')}}:</td>
<td class="emptyField"><span></span></td>
<th><span class="emptyField"></span></th>
</tr>
<tr>
<td>{{$t('bank.street')}}:</td>
<td class="emptyField"><span></span></td>
<th><span class="emptyField"></span></th>
</tr>
</tbody>
</table>
@ -168,22 +168,14 @@
<p>{{$t('authorization')}}</p>
<!-- signature -->
<table class="signature">
<tbody>
<tr>
<td>
<img class="signature-image" :src="embeded['/assets/images/signature.png']">
<div class="signature-line"></div>
<p>(signature autorisée du tiré)</p>
</td>
<td>
<div class="signature-image"></div>
<div class="signature-line"></div>
<p>(lieu et date)</p>
</td>
</tr>
</tbody>
</table>
<section class="signature panel">
<section class="header">{{$t('client.sign')}}</section>
<section class="body centered">
<section>
<p>{{$t('client.signDate')}}:</p>
</section>
</section>
</section>
</section>
<!-- Footer component -->
<report-footer id="pageFooter"

View File

@ -26,16 +26,8 @@ module.exports = {
name: 'Nom',
street: 'Adresse',
fi: 'Siren',
location: 'CP - Población - Provincia',
country: 'País del deudor',
swift: 'Swift BIC',
accountNumber: 'Número de cuenta - IBAN',
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',
sign: 'Signature autorisée du tiré',
signDate: 'Lieu et date',
toCompleteByClient: 'À remplir par le débiteur',
},
order: 'Ord. domiciliación {0}',