Merge branch 'dev' into 2517-clientBalanceCompensaciones
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Javi Gallego 2020-12-18 08:21:36 +01:00
commit 87adbbfa3c
95 changed files with 3920 additions and 1199 deletions

File diff suppressed because one or more lines are too long

View File

@ -148,21 +148,25 @@ INSERT INTO `vn`.`shelving` (`code`, `parkingFk`, `isPrinted`, `priority`, `park
('GVC', '1', '0', '1', '0', '106'), ('GVC', '1', '0', '1', '0', '106'),
('HEJ', '2', '0', '1', '0', '106'); ('HEJ', '2', '0', '1', '0', '106');
INSERT INTO `vn`.`accountingType`(`id`, `description`, `receiptDescription`, `code`)
VALUES
(1, 'Digital money', '', NULL),
(2, 'Cash', 'Cash', 'cash'),
(3, 'Card', 'Pay on receipt', NULL),
(4, 'Stolen Money', '', NULL),
(5, 'Miscellaneous', '', NULL),
(7, 'Compensation', '', 'compensation');
INSERT INTO `vn`.`bank`(`id`, `bank`, `account`, `cash`, `entityFk`, `isActive`, `currencyFk`) INSERT INTO `vn`.`bank`(`id`, `bank`, `account`, `cash`, `entityFk`, `isActive`, `currencyFk`)
VALUES VALUES
(1, 'Pay on receipt', '0000000000', 3, 0, 1, 1), (1, 'Pay on receipt', '0000000000', 3, 0, 1, 1),
(2, 'Cash', '1111111111', 2, 0, 1, 1), (2, 'Cash', '1111111111', 2, 0, 1, 1),
(3, 'Compensation', '0000000000', 7, 0, 1, 1); (3, 'Compensation', '0000000000', 7, 0, 1, 1);
INSERT INTO `vn`.`accountingType`(`id`, `description`, `receiptDescription`,`code`)
VALUES
(1, 'CC y Polizas de crédito', NULL, NULL),
(2, 'Caja registradora', NULL, NULL),
(3, 'Tarjeta de credito', NULL, NULL),
(4, 'Lineas de financiacion', NULL, NULL),
(5, 'Otros productos', NULL, NULL),
(6, 'Prestamos', NULL, NULL),
(7, 'Leasing', NULL, NULL),
(8, 'Compensaciones', 'Compensation', 'compensation'),
(9, 'Cash', 'Cash', 'cash'),
(10, 'Card', 'Pay on receipt', NULL);
INSERT INTO `vn`.`deliveryMethod`(`id`, `code`, `description`) INSERT INTO `vn`.`deliveryMethod`(`id`, `code`, `description`)
VALUES VALUES
(1, 'AGENCY', 'Agencia'), (1, 'AGENCY', 'Agencia'),
@ -444,13 +448,13 @@ INSERT INTO `vn`.`supplierAccount`(`id`, `supplierFk`, `iban`, `bankEntityFk`)
VALUES VALUES
(241, 442, 'ES111122333344111122221111', 128); (241, 442, 'ES111122333344111122221111', 128);
INSERT INTO `vn`.`company`(`id`, `code`, `supplierAccountFk`, `workerManagerFk`, `companyCode`, `sage200Company`, `expired`) INSERT INTO `vn`.`company`(`id`, `code`, `supplierAccountFk`, `workerManagerFk`, `companyCode`, `sage200Company`, `expired`, `phytosanitary`)
VALUES VALUES
(69 , 'CCs', NULL, 30, NULL, 0, NULL), (69 , 'CCs', NULL, 30, NULL, 0, NULL, NULL),
(442 , 'VNL', 241, 30, 2 , 1, NULL), (442 , 'VNL', 241, 30, 2 , 1, NULL, 'VNL Company - Plant passport'),
(567 , 'VNH', NULL, 30, NULL, 4, NULL), (567 , 'VNH', NULL, 30, NULL, 4, NULL, 'VNH Company - Plant passport'),
(791 , 'FTH', NULL, 30, NULL, 3, '2015-11-30'), (791 , 'FTH', NULL, 30, NULL, 3, '2015-11-30', NULL),
(1381, 'ORN', NULL, 30, NULL, 7, NULL); (1381, 'ORN', NULL, 30, NULL, 7, NULL, 'ORN Company - Plant passport');
INSERT INTO `vn`.`invoiceOut`(`id`, `serial`, `amount`, `issued`,`clientFk`, `created`, `companyFk`, `dued`, `booked`, `bankFk`, `hasPdf`) INSERT INTO `vn`.`invoiceOut`(`id`, `serial`, `amount`, `issued`,`clientFk`, `created`, `companyFk`, `dued`, `booked`, `bankFk`, `hasPdf`)
VALUES VALUES

File diff suppressed because it is too large Load Diff

View File

@ -827,7 +827,7 @@ export default {
firstTravelReference: 'vn-travel-extra-community > vn-data-viewer div > vn-tbody > vn-tr > vn-td-editable', firstTravelReference: 'vn-travel-extra-community > vn-data-viewer div > vn-tbody > vn-tr > vn-td-editable',
removeContinentFilter: 'vn-searchbar > form > vn-textfield > div.container > div.prepend > prepend > div > span:nth-child(3) > vn-icon > i' removeContinentFilter: 'vn-searchbar > form > vn-textfield > div.container > div.prepend > prepend > div > span:nth-child(3) > vn-icon > i'
}, },
travelBasicDada: { travelBasicData: {
reference: 'vn-travel-basic-data vn-textfield[ng-model="$ctrl.travel.ref"]', reference: 'vn-travel-basic-data vn-textfield[ng-model="$ctrl.travel.ref"]',
agency: 'vn-travel-basic-data vn-autocomplete[ng-model="$ctrl.travel.agencyModeFk"]', agency: 'vn-travel-basic-data vn-autocomplete[ng-model="$ctrl.travel.agencyModeFk"]',
deliveryDate: 'vn-travel-basic-data vn-date-picker[ng-model="$ctrl.travel.landed"]', deliveryDate: 'vn-travel-basic-data vn-date-picker[ng-model="$ctrl.travel.landed"]',

View File

@ -27,13 +27,6 @@ describe('Client create path', () => {
await page.waitForState('client.create'); await page.waitForState('client.create');
}); });
it('should receive an error when clicking the create button having all the form fields empty', async() => {
await page.waitToClick(selectors.createClientView.createButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Some fields are invalid');
});
it('should receive an error when clicking the create button having name and Business name fields empty', async() => { it('should receive an error when clicking the create button having name and Business name fields empty', async() => {
await page.write(selectors.createClientView.taxNumber, '74451390E'); await page.write(selectors.createClientView.taxNumber, '74451390E');
await page.write(selectors.createClientView.userName, 'CaptainMarvel'); await page.write(selectors.createClientView.userName, 'CaptainMarvel');

View File

@ -20,6 +20,7 @@ describe('Client credit insurance path', () => {
}); });
it('should open the create a new credit contract form', async() => { it('should open the create a new credit contract form', async() => {
await page.waitForTimeout(1000);
await page.waitToClick(selectors.clientCreditInsurance.addNewContract); await page.waitToClick(selectors.clientCreditInsurance.addNewContract);
await page.waitForState('client.card.creditInsurance.create'); await page.waitForState('client.card.creditInsurance.create');
}); });

View File

@ -54,7 +54,8 @@ describe('Item edit tax path', () => {
expect(firstVatType).toEqual('Reduced VAT'); expect(firstVatType).toEqual('Reduced VAT');
}); });
it(`should now click the undo changes button and see the changes works`, async() => { // # #2680 Undo changes button bugs
xit(`should now click the undo changes button and see the form is restored`, async() => {
await page.waitToClick(selectors.itemTax.undoChangesButton); await page.waitToClick(selectors.itemTax.undoChangesButton);
const firstVatType = await page.waitToGetProperty(selectors.itemTax.firstClass, 'value'); const firstVatType = await page.waitToGetProperty(selectors.itemTax.firstClass, 'value');

View File

@ -24,13 +24,6 @@ describe('Ticket Create new tracking state path', () => {
await page.waitForState('ticket.card.tracking.edit'); await page.waitForState('ticket.card.tracking.edit');
}); });
it(`should attempt create a new state but receive an error if state is empty`, async() => {
await page.waitToClick(selectors.createStateView.saveStateButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('State cannot be blank');
});
it(`should create a new state`, async() => { it(`should create a new state`, async() => {
await page.autocompleteSearch(selectors.createStateView.state, '¿Fecha?'); await page.autocompleteSearch(selectors.createStateView.state, '¿Fecha?');
await page.waitToClick(selectors.createStateView.saveStateButton); await page.waitToClick(selectors.createStateView.saveStateButton);

View File

@ -25,31 +25,32 @@ describe('Travel basic data path', () => {
const lastMonth = new Date(); const lastMonth = new Date();
lastMonth.setMonth(lastMonth.getMonth() - 1); lastMonth.setMonth(lastMonth.getMonth() - 1);
await page.pickDate(selectors.travelBasicDada.deliveryDate, lastMonth); await page.pickDate(selectors.travelBasicData.deliveryDate, lastMonth);
await page.waitToClick(selectors.travelBasicDada.save); await page.waitToClick(selectors.travelBasicData.save);
const message = await page.waitForSnackbar(); const message = await page.waitForSnackbar();
expect(message.text).toContain('Landing cannot be lesser than shipment'); expect(message.text).toContain('Landing cannot be lesser than shipment');
}); });
it('should undo the changes', async() => { it('should undo the changes', async() => {
await page.waitToClick(selectors.travelBasicDada.undoChanges); await page.clearInput(selectors.travelBasicData.reference);
await page.waitToClick(selectors.travelBasicDada.save); await page.write(selectors.travelBasicData.reference, 'totally pointless ref');
const message = await page.waitForSnackbar(); await page.waitToClick(selectors.travelBasicData.undoChanges);
const result = await page.waitToGetProperty(selectors.travelBasicData.reference, 'value');
expect(message.text).toContain('No changes to save'); expect(result).toEqual('third travel');
}); });
it('should now edit the whole form then save', async() => { it('should now edit the whole form then save', async() => {
await page.clearInput(selectors.travelBasicDada.reference); await page.clearInput(selectors.travelBasicData.reference);
await page.write(selectors.travelBasicDada.reference, 'new reference!'); await page.write(selectors.travelBasicData.reference, 'new reference!');
await page.waitForTimeout(2000); await page.waitForTimeout(2000);
await page.autocompleteSearch(selectors.travelBasicDada.agency, 'Entanglement'); await page.autocompleteSearch(selectors.travelBasicData.agency, 'Entanglement');
await page.autocompleteSearch(selectors.travelBasicDada.outputWarehouse, 'Warehouse Three'); await page.autocompleteSearch(selectors.travelBasicData.outputWarehouse, 'Warehouse Three');
await page.autocompleteSearch(selectors.travelBasicDada.inputWarehouse, 'Warehouse Four'); await page.autocompleteSearch(selectors.travelBasicData.inputWarehouse, 'Warehouse Four');
await page.waitToClick(selectors.travelBasicDada.delivered); await page.waitToClick(selectors.travelBasicData.delivered);
await page.waitToClick(selectors.travelBasicDada.received); await page.waitToClick(selectors.travelBasicData.received);
await page.waitToClick(selectors.travelBasicDada.save); await page.waitToClick(selectors.travelBasicData.save);
const message = await page.waitForSnackbar(); const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!'); expect(message.text).toContain('Data saved!');
@ -57,35 +58,35 @@ describe('Travel basic data path', () => {
it('should reload the section and check the reference was saved', async() => { it('should reload the section and check the reference was saved', async() => {
await page.reloadSection('travel.card.basicData'); await page.reloadSection('travel.card.basicData');
const result = await page.waitToGetProperty(selectors.travelBasicDada.reference, 'value'); const result = await page.waitToGetProperty(selectors.travelBasicData.reference, 'value');
expect(result).toEqual('new reference!'); expect(result).toEqual('new reference!');
}); });
it('should check the agency was saved', async() => { it('should check the agency was saved', async() => {
const result = await page.waitToGetProperty(selectors.travelBasicDada.agency, 'value'); const result = await page.waitToGetProperty(selectors.travelBasicData.agency, 'value');
expect(result).toEqual('Entanglement'); expect(result).toEqual('Entanglement');
}); });
it('should check the output warehouse date was saved', async() => { it('should check the output warehouse date was saved', async() => {
const result = await page.waitToGetProperty(selectors.travelBasicDada.outputWarehouse, 'value'); const result = await page.waitToGetProperty(selectors.travelBasicData.outputWarehouse, 'value');
expect(result).toEqual('Warehouse Three'); expect(result).toEqual('Warehouse Three');
}); });
it('should check the input warehouse date was saved', async() => { it('should check the input warehouse date was saved', async() => {
const result = await page.waitToGetProperty(selectors.travelBasicDada.inputWarehouse, 'value'); const result = await page.waitToGetProperty(selectors.travelBasicData.inputWarehouse, 'value');
expect(result).toEqual('Warehouse Four'); expect(result).toEqual('Warehouse Four');
}); });
it(`should check the delivered checkbox was saved even tho it doesn't make sense`, async() => { it(`should check the delivered checkbox was saved even tho it doesn't make sense`, async() => {
await page.waitForClassPresent(selectors.travelBasicDada.delivered, 'checked'); await page.waitForClassPresent(selectors.travelBasicData.delivered, 'checked');
}); });
it(`should check the received checkbox was saved even tho it doesn't make sense`, async() => { it(`should check the received checkbox was saved even tho it doesn't make sense`, async() => {
await page.waitForClassPresent(selectors.travelBasicDada.received, 'checked'); await page.waitForClassPresent(selectors.travelBasicData.received, 'checked');
}); });
it('should navigate to the travel logs', async() => { it('should navigate to the travel logs', async() => {

View File

@ -76,6 +76,13 @@
&:hover, &:hover,
&:focus { &:focus {
outline: none; outline: none;
&.cancel {
&:hover,
&:focus {
background-color: transparent;
}
}
} }
&.round { &.round {
border-radius: 50%; border-radius: 50%;
@ -106,4 +113,14 @@
opacity: .7; opacity: .7;
cursor: initial; cursor: initial;
} }
&.cancel {
color: $color-button;
background-color: transparent;
box-shadow: none;
&:not(.disabled) {
&:hover {
color: lighten($color-button, 10%);
}
}
}
} }

View File

@ -2,6 +2,6 @@
{{::$ctrl.question}} {{::$ctrl.question}}
</tpl-body> </tpl-body>
<tpl-buttons> <tpl-buttons>
<button response="cancel" translate>Cancel</button> <input type="button" response="cancel" translate-attr="{value: 'Cancel'}">
<button response="accept" translate vn-focus>Accept</button> <button response="accept" translate>Accept</button>
</tpl-buttons> </tpl-buttons>

View File

@ -34,7 +34,6 @@
input[type="button"], input[type="button"],
input[type="submit"], input[type="submit"],
input[type="reset"] { input[type="reset"] {
@extend %clickable;
text-transform: uppercase; text-transform: uppercase;
background-color: transparent; background-color: transparent;
border: none; border: none;
@ -44,6 +43,20 @@
padding: 11px; padding: 11px;
margin: -11px; margin: -11px;
margin-left: 11px; margin-left: 11px;
&:hover,
&:focus {
color: lighten($color-button, 10%);
}
}
button {
background-color: $color-button;
color: white;
&:hover,
&:focus {
background-color: lighten($color-button, 10%);
color: white;
}
} }
} }
} }

View File

@ -53,33 +53,32 @@
</vn-vertical> </vn-vertical>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit
disabled="!watcher.dataChanged()"
label="Save">
</vn-submit>
<vn-button <vn-button
label="Undo changes" disabled="!watcher.dataChanged()"
ng-if="watcher.dataChanged()"
ng-click="watcher.loadOriginalData()">
</vn-button>
<vn-button
ng-if="!watcher.dataChanged()"
label="Synchronize all" label="Synchronize all"
ng-click="$ctrl.onSynchronizeAll()"> ng-click="$ctrl.onSynchronizeAll()">
</vn-button> </vn-button>
<vn-button <vn-button
ng-if="!watcher.dataChanged()" disabled="!watcher.dataChanged()"
label="Synchronize user" label="Synchronize user"
ng-click="syncUser.show()"> ng-click="syncUser.show()">
</vn-button> </vn-button>
<vn-button <vn-button
ng-if="!watcher.dataChanged()" disabled="!watcher.dataChanged()"
label="Synchronize roles" label="Synchronize roles"
ng-click="$ctrl.onSynchronizeRoles()"> ng-click="$ctrl.onSynchronizeRoles()">
</vn-button> </vn-button>
<vn-button
class="cancel"
label="Undo changes"
disabled="!watcher.dataChanged()"
ng-click="watcher.loadOriginalData()">
</vn-button>
</vn-button-bar> </vn-button-bar>
<vn-submit
icon="save"
vn-tooltip="Save"
class="round"
fixed-bottom-right>
</vn-submit>
</form> </form>
<vn-dialog <vn-dialog
vn-id="syncUser" vn-id="syncUser"

View File

@ -56,10 +56,15 @@
</vn-autocomplete> </vn-autocomplete>
</vn-horizontal> </vn-horizontal>
</vn-card> </vn-card>
<vn-submit <vn-button-bar>
icon="check" <vn-submit
vn-tooltip="Create" disabled="!watcher.dataChanged()"
class="round" label="Save">
fixed-bottom-right> </vn-submit>
</vn-submit> <vn-button
class="cancel"
label="Cancel"
ui-sref="account.acl">
</vn-button>
</vn-button-bar>
</form> </form>

View File

@ -29,16 +29,15 @@
</vn-vertical> </vn-vertical>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit
disabled="!watcher.dataChanged()"
label="Save">
</vn-submit>
<vn-button <vn-button
class="cancel"
label="Undo changes" label="Undo changes"
ng-if="watcher.dataChanged()" disabled="!watcher.dataChanged()"
ng-click="watcher.loadOriginalData()"> ng-click="watcher.loadOriginalData()">
</vn-button> </vn-button>
</vn-button-bar> </vn-button-bar>
<vn-submit
icon="save"
vn-tooltip="Save"
class="round"
fixed-bottom-right>
</vn-submit>
</form> </form>

View File

@ -24,10 +24,15 @@
</vn-textfield> </vn-textfield>
</vn-vertical> </vn-vertical>
</vn-card> </vn-card>
<vn-submit <vn-button-bar>
icon="check" <vn-submit
vn-tooltip="Create" disabled="!watcher.dataChanged()"
class="round" label="Create">
fixed-bottom-right> </vn-submit>
</vn-submit> <vn-button
class="cancel"
label="Cancel"
ui-sref="account.alias">
</vn-button>
</vn-button-bar>
</form> </form>

View File

@ -37,16 +37,15 @@
</vn-vertical> </vn-vertical>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit
disabled="!watcher.dataChanged()"
label="Save">
</vn-submit>
<vn-button <vn-button
class="cancel"
label="Undo changes" label="Undo changes"
ng-if="watcher.dataChanged()" disabled="!watcher.dataChanged()"
ng-click="watcher.loadOriginalData()"> ng-click="watcher.loadOriginalData()">
</vn-button> </vn-button>
</vn-button-bar> </vn-button-bar>
<vn-submit
icon="save"
vn-tooltip="Save"
class="round"
fixed-bottom-right>
</vn-submit>
</form> </form>

View File

@ -44,10 +44,14 @@
</vn-check> </vn-check>
</vn-vertical> </vn-vertical>
</vn-card> </vn-card>
<vn-submit <vn-button-bar>
icon="check" <vn-submit
vn-tooltip="Create" label="Create">
class="round" </vn-submit>
fixed-bottom-right> <vn-button
</vn-submit> class="cancel"
label="Cancel"
ui-sref="account.index">
</vn-button>
</vn-button-bar>
</form> </form>

View File

@ -48,21 +48,20 @@
</vn-vertical> </vn-vertical>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit
disabled="!watcher.dataChanged()"
label="Save">
</vn-submit>
<vn-button <vn-button
disabled="watcher.dataChanged()" disabled="watcher.dataChanged()"
label="Test connection" label="Test connection"
ng-click="$ctrl.onTestConection()"> ng-click="$ctrl.onTestConection()">
</vn-button> </vn-button>
<vn-button <vn-button
class="cancel"
label="Undo changes" label="Undo changes"
ng-if="watcher.dataChanged()" disabled="!watcher.dataChanged()"
ng-click="watcher.loadOriginalData()"> ng-click="watcher.loadOriginalData()">
</vn-button> </vn-button>
</vn-button-bar> </vn-button-bar>
<vn-submit
icon="save"
vn-tooltip="Save"
class="round"
fixed-bottom-right>
</vn-submit>
</form> </form>

View File

@ -27,12 +27,18 @@
</vn-textfield> </vn-textfield>
</vn-vertical> </vn-vertical>
</vn-card> </vn-card>
<vn-submit <vn-button-bar>
icon="save" <vn-submit
vn-tooltip="Save" disabled="!watcher.dataChanged()"
class="round" label="Save">
fixed-bottom-right> </vn-submit>
</vn-submit> <vn-button
class="cancel"
label="Undo changes"
disabled="!watcher.dataChanged()"
ng-click="watcher.loadOriginalData()">
</vn-button>
</vn-button-bar>
</form> </form>
</div> </div>
<div <div

View File

@ -24,16 +24,15 @@
</vn-vertical> </vn-vertical>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit
disabled="!watcher.dataChanged()"
label="Save">
</vn-submit>
<vn-button <vn-button
class="cancel"
label="Undo changes" label="Undo changes"
ng-if="watcher.dataChanged()" disabled="!watcher.dataChanged()"
ng-click="watcher.loadOriginalData()"> ng-click="watcher.loadOriginalData()">
</vn-button> </vn-button>
</vn-button-bar> </vn-button-bar>
<vn-submit
icon="save"
vn-tooltip="Save"
class="round"
fixed-bottom-right>
</vn-submit>
</form> </form>

View File

@ -24,10 +24,15 @@
</vn-textfield> </vn-textfield>
</vn-vertical> </vn-vertical>
</vn-card> </vn-card>
<vn-submit <vn-button-bar>
icon="check" <vn-submit
vn-tooltip="Create" disabled="!watcher.dataChanged()"
class="round" label="Create">
fixed-bottom-right> </vn-submit>
</vn-submit> <vn-button
class="cancel"
label="Cancel"
ui-sref="account.role">
</vn-button>
</vn-button-bar>
</form> </form>

View File

@ -47,21 +47,20 @@
</vn-vertical> </vn-vertical>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit
disabled="!watcher.dataChanged()"
label="Save">
</vn-submit>
<vn-button <vn-button
disabled="watcher.dataChanged()" disabled="watcher.dataChanged()"
label="Test connection" label="Test connection"
ng-click="$ctrl.onTestConection()"> ng-click="$ctrl.onTestConection()">
</vn-button> </vn-button>
<vn-button <vn-button
class="cancel"
label="Undo changes" label="Undo changes"
ng-if="watcher.dataChanged()" disabled="!watcher.dataChanged()"
ng-click="watcher.loadOriginalData()"> ng-click="watcher.loadOriginalData()">
</vn-button> </vn-button>
</vn-button-bar> </vn-button-bar>
<vn-submit </form>
icon="save"
vn-tooltip="Save"
class="round"
fixed-bottom-right>
</vn-submit>
</form>

View File

@ -62,9 +62,14 @@
</vn-horizontal> </vn-horizontal>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit label="Save"></vn-submit> <vn-submit
<vn-button label="Undo changes" disabled="!watcher.dataChanged()"
ng-if="$ctrl.$.form.$dirty" label="Save">
</vn-submit>
<vn-button
class="cancel"
label="Undo changes"
disabled="!watcher.dataChanged()"
ng-click="watcher.loadOriginalData()"> ng-click="watcher.loadOriginalData()">
</vn-button> </vn-button>
</vn-button-bar> </vn-button-bar>

View File

@ -105,9 +105,17 @@
</vn-vertical> </vn-vertical>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit <vn-submit
label="Save" disabled="!watcher.dataChanged()"
ng-click="$ctrl.onSubmit()"> ng-click="$ctrl.onSubmit()"
label="Save">
</vn-submit> </vn-submit>
<!-- # #2680 Undo changes button bugs -->
<!-- <vn-button
class="cancel"
label="Undo changes"
disabled="!watcher.dataChanged()"
ng-click="watcher.loadOriginalData()">
</vn-button> -->
</vn-button-bar> </vn-button-bar>
</vn-vertical> </vn-vertical>

View File

@ -339,28 +339,5 @@ module.exports = Self => {
if (count <= 0) if (count <= 0)
throw new UserError('The role cannot set this credit amount'); throw new UserError('The role cannot set this credit amount');
// Si se puso a 0 por gerencia, solo gerencia puede aumentarlo
let query = 'SELECT * FROM clientCredit WHERE clientFk = ? ORDER BY created DESC LIMIT 1';
let instances = await Self.rawSql(query, [finalState.id]);
if (instances.length !== 1 || instances[0].amount > 0)
return;
query = `
SELECT COUNT(*) AS hasRoleManager
FROM worker em
JOIN account.user ac ON ac.id = em.userFk
JOIN salix.RoleMapping rm ON rm.principalId = ac.id
JOIN account.role r on r.id = rm.roleId
WHERE em.id = ?
AND rm.principalType = 'USER'
AND r.name = 'manager'`;
let instance = await Self.rawSql(query, [instances[0].workerFk]);
if (instance[0].hasRoleManager)
throw new UserError('Only manager can change the credit');
} }
}; };

View File

@ -71,7 +71,15 @@
</vn-horizontal> </vn-horizontal>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit label="Save"></vn-submit> <vn-submit
<vn-button label="Undo changes" ng-if="watcher.dataChanged()" ng-click="watcher.loadOriginalData()"></vn-button> disabled="!watcher.dataChanged()"
label="Save">
</vn-submit>
<vn-button
class="cancel"
label="Undo changes"
disabled="!watcher.dataChanged()"
ng-click="watcher.loadOriginalData()">
</vn-button>
</vn-button-bar> </vn-button-bar>
</form> </form>

View File

@ -95,8 +95,16 @@
</vn-horizontal> </vn-horizontal>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit label="Save" vn-acl="salesAssistant"></vn-submit> <vn-submit
<vn-button label="Undo changes" ng-if="watcher.dataChanged()" ng-click="watcher.loadOriginalData()"></vn-button> disabled="!watcher.dataChanged()"
label="Save">
</vn-submit>
<vn-button
class="cancel"
label="Undo changes"
disabled="!watcher.dataChanged()"
ng-click="watcher.loadOriginalData()">
</vn-button>
</vn-button-bar> </vn-button-bar>
</form> </form>

View File

@ -46,6 +46,16 @@
</vn-one> </vn-one>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit label="Save"></vn-submit> <vn-submit
disabled="!watcher.dataChanged()"
label="Save">
</vn-submit>
<!-- # #2680 Undo changes button bugs -->
<!-- <vn-button
class="cancel"
label="Undo changes"
disabled="!watcher.dataChanged()"
ng-click="watcher.loadOriginalData()">
</vn-button> -->
</vn-button-bar> </vn-button-bar>
</form> </form>

View File

@ -125,8 +125,15 @@
</vn-horizontal> </vn-horizontal>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit label="Create"></vn-submit> <vn-submit
<vn-button ui-sref="client.index" label="Cancel"></vn-button> disabled="!watcher.dataChanged()"
label="Create">
</vn-submit>
<vn-button
class="cancel"
label="Cancel"
ui-sref="client.index">
</vn-button>
</vn-button-bar> </vn-button-bar>
</form> </form>
<!-- New postcode dialog --> <!-- New postcode dialog -->

View File

@ -25,7 +25,13 @@
</vn-horizontal> </vn-horizontal>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit label="Save"></vn-submit> <vn-submit
<vn-button ui-sref="client.card.creditInsurance.index" label="Cancel"></vn-button> label="Save">
</vn-submit>
<vn-button
class="cancel"
label="Cancel"
ui-sref="client.card.creditInsurance.index"></vn-button>
</vn-button>
</vn-button-bar> </vn-button-bar>
</form> </form>

View File

@ -19,8 +19,14 @@
</vn-horizontal> </vn-horizontal>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit label="Save"></vn-submit> <vn-submit
<vn-button ng-click="$ctrl.cancel()" label="Cancel"></vn-button> ng-if="watcher.dataChanged()"
label="Save">
</vn-submit>
<vn-button
ng-click="$ctrl.cancel()"
label="Cancel">
</vn-button>
</vn-button-bar> </vn-button-bar>
</form> </form>
<vn-confirm <vn-confirm

View File

@ -94,8 +94,15 @@
</vn-vertical> </vn-vertical>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit label="Upload"></vn-submit> <vn-submit
<vn-button ui-sref="client.card.dms.index" label="Cancel"></vn-button> disabled="!watcher.dataChanged()"
label="Upload">
</vn-submit>
<vn-button
class="cancel"
label="Cancel"
ui-sref="client.card.dms.index">
</vn-button>
</vn-button-bar> </vn-button-bar>
</div> </div>
</form> </form>

View File

@ -202,8 +202,16 @@
</vn-horizontal> </vn-horizontal>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit label="Save"></vn-submit> <vn-submit
<vn-button label="Undo changes" ng-if="$ctrl.$.form.$dirty" ng-click="watcher.loadOriginalData()"></vn-button> disabled="!watcher.dataChanged()"
label="Save">
</vn-submit>
<vn-button
class="cancel"
label="Undo changes"
disabled="!watcher.dataChanged()"
ng-click="watcher.loadOriginalData()">
</vn-button>
</vn-button-bar> </vn-button-bar>
</form> </form>
<vn-confirm <vn-confirm

View File

@ -40,7 +40,13 @@
</vn-horizontal> </vn-horizontal>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit label="Save"></vn-submit> <vn-submit
<vn-button ng-click="$ctrl.goToIndex()" label="Cancel"></vn-button> ng-if="watcher.dataChanged()"
label="Save">
</vn-submit>
<vn-button
ng-click="$ctrl.goToIndex()"
label="Cancel">
</vn-button>
</vn-button-bar> </vn-button-bar>
</form> </form>

View File

@ -17,8 +17,14 @@
</vn-textarea> </vn-textarea>
</vn-horizontal> </vn-horizontal>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit label="Save"></vn-submit> <vn-submit
<vn-button ng-click="$ctrl.cancel()" label="Cancel"></vn-button> ng-if="watcher.dataChanged()"
label="Save">
</vn-submit>
<vn-button
ng-click="$ctrl.cancel()"
label="Cancel">
</vn-button>
</vn-button-bar> </vn-button-bar>
</form> </form>

View File

@ -32,7 +32,14 @@
</vn-horizontal> </vn-horizontal>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit label="Save"></vn-submit> <vn-submit
<vn-button ng-click="$ctrl.cancel()" label="Cancel"></vn-button> disabled="!watcher.dataChanged()"
label="Save">
</vn-submit>
<vn-button
class="cancel"
label="Cancel"
ng-click="$ctrl.cancel()">
</vn-button>
</vn-button-bar> </vn-button-bar>
</form> </form>

View File

@ -53,12 +53,20 @@
</vn-horizontal> </vn-horizontal>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit label="Send"></vn-submit> <vn-submit
<vn-button ng-if="sampleType.selection.hasPreview" disabled="!sampleType.selection"
label="Send">
</vn-submit>
<vn-button
disabled="!sampleType.selection.hasPreview"
label="Preview" label="Preview"
ng-click="$ctrl.showPreview()"> ng-click="$ctrl.showPreview()">
</vn-button> </vn-button>
<vn-button ui-sref="client.card.sample.index" label="Cancel"></vn-button> <vn-button
class="cancel"
label="Cancel"
ui-sref="client.card.sample.index">
</vn-button>
</vn-button-bar> </vn-button-bar>
</form> </form>
<vn-dialog <vn-dialog

View File

@ -26,9 +26,21 @@
</vn-horizontal> </vn-horizontal>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit label="Save"></vn-submit> <vn-submit
<vn-button ng-if="$ctrl.canChangePassword" label="Change password" vn-dialog="change-pass"></vn-button> disabled="!watcher.dataChanged()"
<vn-button label="Undo changes" ng-if="$ctrl.$.form.$dirty" ng-click="watcher.loadOriginalData()"></vn-button> label="Save">
</vn-submit>
<vn-button
ng-if="$ctrl.canChangePassword"
label="Change password"
vn-dialog="change-pass">
</vn-button>
<vn-button
class="cancel"
label="Undo changes"
disabled="!watcher.dataChanged()"
ng-click="watcher.loadOriginalData()">
</vn-button>
</vn-button-bar> </vn-button-bar>
</form> </form>
<vn-dialog <vn-dialog

View File

@ -110,7 +110,15 @@
</vn-horizontal> </vn-horizontal>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit label="Save"></vn-submit> <vn-submit
<vn-button label="Undo changes" ng-if="watcher.dataChanged()" ng-click="watcher.loadOriginalData()"></vn-button> disabled="!watcher.dataChanged()"
label="Save">
</vn-submit>
<vn-button
class="cancel"
label="Undo changes"
disabled="!watcher.dataChanged()"
ng-click="watcher.loadOriginalData()">
</vn-button>
</vn-button-bar> </vn-button-bar>
</form> </form>

View File

@ -50,7 +50,14 @@
</vn-horizontal> </vn-horizontal>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit label="Create"></vn-submit> <vn-submit
<vn-button ui-sref="entry.index" label="Cancel"></vn-button> disabled="!watcher.dataChanged()"
label="Create">
</vn-submit>
<vn-button
class="cancel"
label="Cancel"
ui-sref="entry.index"></vn-button>
</vn-button>
</vn-button-bar> </vn-button-bar>
</form> </form>

View File

@ -42,6 +42,16 @@
</vn-one> </vn-one>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit label="Save"></vn-submit> <vn-submit
disabled="!watcher.dataChanged()"
label="Save">
</vn-submit>
<!-- # #2680 Undo changes button bugs -->
<!-- <vn-button
class="cancel"
label="Undo changes"
disabled="!watcher.dataChanged()"
ng-click="watcher.loadOriginalData()">
</vn-button> -->
</vn-button-bar> </vn-button-bar>
</form> </form>

View File

@ -158,8 +158,16 @@
</vn-horizontal> </vn-horizontal>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit label="Save"></vn-submit> <vn-submit
<vn-button label="Undo changes" ng-if="$ctrl.$scope.form.$dirty" ng-click="watcher.loadOriginalData()"></vn-button> disabled="!watcher.dataChanged()"
label="Save">
</vn-submit>
<vn-button
class="cancel"
label="Undo changes"
disabled="!watcher.dataChanged()"
ng-click="watcher.loadOriginalData()">
</vn-button>
</vn-button-bar> </vn-button-bar>
</form> </form>

View File

@ -45,11 +45,16 @@
</vn-horizontal> </vn-horizontal>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit label="Save"></vn-submit> <vn-submit
<vn-button disabled="!watcher.dataChanged()"
ng-if="watcher.dataChanged()" label="Save">
</vn-submit>
<!-- # #2680 Undo changes button bugs -->
<!-- <vn-button
class="cancel"
label="Undo changes" label="Undo changes"
disabled="!watcher.dataChanged()"
ng-click="watcher.loadOriginalData()"> ng-click="watcher.loadOriginalData()">
</vn-button> </vn-button> -->
</vn-button-bar> </vn-button-bar>
</form> </form>

View File

@ -61,9 +61,11 @@
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit <vn-submit
disabled="!watcher.dataChanged()"
label="Create"> label="Create">
</vn-submit> </vn-submit>
<vn-button <vn-button
class="cancel"
label="Cancel" label="Cancel"
ui-sref="item.index"> ui-sref="item.index">
</vn-button> </vn-button>

View File

@ -57,6 +57,16 @@
</vn-one> </vn-one>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit label="Save"></vn-submit> <vn-submit
disabled="!watcher.dataChanged()"
label="Save">
</vn-submit>
<!-- # #2680 Undo changes button bugs -->
<!-- <vn-button
class="cancel"
label="Undo changes"
disabled="!watcher.dataChanged()"
ng-click="watcher.loadOriginalData()">
</vn-button> -->
</vn-button-bar> </vn-button-bar>
</form> </form>

View File

@ -73,6 +73,9 @@
</vn-one> </vn-one>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit label="Save"></vn-submit> <vn-submit
disabled="!watcher.dataChanged()"
label="Save">
</vn-submit>
</vn-button-bar> </vn-button-bar>
</form> </form>

View File

@ -28,7 +28,16 @@
</vn-horizontal> </vn-horizontal>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit label="Save"></vn-submit> <vn-submit
<vn-button label="Undo changes" ng-if="watcher.dataChanged()" ng-click="watcher.loadOriginalData()"></vn-button> disabled="!watcher.dataChanged()"
label="Save">
</vn-submit>
<!-- # #2680 Undo changes button bugs -->
<!-- <vn-button
class="cancel"
label="Undo changes"
disabled="!watcher.dataChanged()"
ng-click="watcher.loadOriginalData()">
</vn-button> -->
</vn-button-bar> </vn-button-bar>
</form> </form>

View File

@ -66,7 +66,15 @@
</vn-horizontal> </vn-horizontal>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit label="Save"></vn-submit> <vn-submit
<vn-button label="Undo changes" ng-if="watcher.dataChanged()" ng-click="watcher.loadOriginalData()"></vn-button> disabled="!watcher.dataChanged()"
label="Save">
</vn-submit>
<vn-button
class="cancel"
label="Undo changes"
disabled="!watcher.dataChanged()"
ng-click="watcher.loadOriginalData()">
</vn-button>
</vn-button-bar> </vn-button-bar>
</form> </form>

View File

@ -3,7 +3,14 @@
<vn-order-create-card vn-id="card" on-save=""></vn-order-create-card> <vn-order-create-card vn-id="card" on-save=""></vn-order-create-card>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit ng-click="$ctrl.onSubmit()" label="Create"> <vn-submit
ng-click="$ctrl.onSubmit()"
label="Create">
</vn-submit> </vn-submit>
<vn-button
class="cancel"
label="Cancel"
ui-sref="order.index">
</vn-button>
</vn-button-bar> </vn-button-bar>
</div> </div>

View File

@ -80,7 +80,15 @@
</vn-horizontal> </vn-horizontal>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit label="Save"></vn-submit> <vn-submit
<vn-button label="Undo changes" ng-if="watcher.dataChanged()" ng-click="watcher.loadOriginalData()"></vn-button> disabled="!watcher.dataChanged()"
label="Save">
</vn-submit>
<vn-button
class="cancel"
label="Undo changes"
disabled="!watcher.dataChanged()"
ng-click="watcher.loadOriginalData()">
</vn-button>
</vn-button-bar> </vn-button-bar>
</form> </form>

View File

@ -43,7 +43,14 @@
</vn-horizontal> </vn-horizontal>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit label="Create"></vn-submit> <vn-submit
<vn-button ui-sref="route.index" label="Cancel"></vn-button> disabled="!watcher.dataChanged()"
label="Create">
</vn-submit>
<vn-button
class="cancel"
label="Cancel"
ui-sref="route.index">
</vn-button>
</vn-button-bar> </vn-button-bar>
</form> </form>

View File

@ -36,7 +36,15 @@
</vn-horizontal> </vn-horizontal>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit label="Save"></vn-submit> <vn-submit
<vn-button label="Undo changes" ng-if="watcher.dataChanged()" ng-click="watcher.loadOriginalData()"></vn-button> disabled="!watcher.dataChanged()"
label="Save">
</vn-submit>
<vn-button
class="cancel"
label="Undo changes"
disabled="!watcher.dataChanged()"
ng-click="watcher.loadOriginalData()">
</vn-button>
</vn-button-bar> </vn-button-bar>
</form> </form>

View File

@ -69,6 +69,16 @@
</vn-one> </vn-one>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit label="Save"></vn-submit> <vn-submit
disabled="!watcher.dataChanged()"
label="Save">
</vn-submit>
<!-- # #2680 Undo changes button bugs -->
<!-- <vn-button
class="cancel"
label="Undo changes"
disabled="!watcher.dataChanged()"
ng-click="watcher.loadOriginalData()">
</vn-button> -->
</vn-button-bar> </vn-button-bar>
</form> </form>

View File

@ -163,8 +163,16 @@
</vn-horizontal> </vn-horizontal>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit label="Save"></vn-submit> <vn-submit
<vn-button label="Undo changes" ng-if="$ctrl.$.form.$dirty" ng-click="watcher.loadOriginalData()"></vn-button> disabled="!watcher.dataChanged()"
label="Save">
</vn-submit>
<vn-button
class="cancel"
label="Undo changes"
disabled="!watcher.dataChanged()"
ng-click="watcher.loadOriginalData()">
</vn-button>
</vn-button-bar> </vn-button-bar>
</form> </form>
<!-- New postcode dialog --> <!-- New postcode dialog -->

View File

@ -3,7 +3,14 @@
<vn-ticket-create-card vn-id="card" on-save=""></vn-ticket-create-card> <vn-ticket-create-card vn-id="card" on-save=""></vn-ticket-create-card>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit ng-click="$ctrl.onSubmit()" label="Create"> <vn-submit
ng-click="$ctrl.onSubmit()"
label="Create">
</vn-submit> </vn-submit>
<vn-button
class="cancel"
label="Cancel"
ui-sref="ticket.index">
</vn-button>
</vn-button-bar> </vn-button-bar>
</div> </div>

View File

@ -92,8 +92,15 @@
</vn-vertical> </vn-vertical>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit label="Upload"></vn-submit> <vn-submit
<vn-button ui-sref="ticket.card.dms.index" label="Cancel"></vn-button> ng-click="$ctrl.onSubmit()"
label="Upload">
</vn-submit>
<vn-button
class="cancel"
label="Cancel"
ui-sref="ticket.card.dms.index">
</vn-button>
</vn-button-bar> </vn-button-bar>
</div> </div>
</form> </form>

View File

@ -57,6 +57,16 @@
</vn-one> </vn-one>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit label="Save"></vn-submit> <vn-submit
disabled="!watcher.dataChanged()"
label="Save">
</vn-submit>
<!-- # #2680 Undo changes button bugs -->
<!-- <vn-button
class="cancel"
label="Undo changes"
disabled="!watcher.dataChanged()"
ng-click="watcher.loadOriginalData()">
</vn-button> -->
</vn-button-bar> </vn-button-bar>
</form> </form>

View File

@ -56,6 +56,16 @@
</vn-icon-button> </vn-icon-button>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit label="Save"></vn-submit> <vn-submit
disabled="!watcher.dataChanged()"
label="Save">
</vn-submit>
<!-- # #2680 Undo changes button bugs -->
<!-- <vn-button
class="cancel"
label="Undo changes"
disabled="!watcher.dataChanged()"
ng-click="watcher.loadOriginalData()">
</vn-button> -->
</vn-button-bar> </vn-button-bar>
</form> </form>

View File

@ -41,8 +41,15 @@
</vn-horizontal> </vn-horizontal>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit label="Create"></vn-submit> <vn-submit
<vn-button ui-sref="ticket.card.request.index" label="Cancel"></vn-button> disabled="!watcher.dataChanged()"
label="Create">
</vn-submit>
<vn-button
class="cancel"
label="Cancel"
ui-sref="ticket.card.request.index">
</vn-button>
</vn-button-bar> </vn-button-bar>
</div> </div>
</form> </form>

View File

@ -71,7 +71,17 @@
</vn-icon-button> </vn-icon-button>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit label="Save"></vn-submit> <vn-submit
disabled="!watcher.dataChanged()"
label="Save">
</vn-submit>
<!-- # #2680 Undo changes button bugs -->
<!-- <vn-button
class="cancel"
label="Undo changes"
disabled="!watcher.dataChanged()"
ng-click="watcher.loadOriginalData()">
</vn-button> -->
</vn-button-bar> </vn-button-bar>
</form> </form>

View File

@ -33,7 +33,14 @@
</vn-horizontal> </vn-horizontal>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit label="Save"></vn-submit> <vn-submit
<vn-button ui-sref="ticket.card.tracking.index" label="Cancel"></vn-button> disabled="!watcher.dataChanged()"
label="Save">
</vn-submit>
<vn-button
class="cancel"
label="Cancel"
ui-sref="ticket.card.tracking.index">
</vn-button>
</vn-button-bar> </vn-button-bar>
</form> </form>

View File

@ -72,7 +72,15 @@
</vn-horizontal> </vn-horizontal>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit label="Save"></vn-submit> <vn-submit
<vn-button label="Undo changes" ng-if="watcher.dataChanged()" ng-click="watcher.loadOriginalData()"></vn-button> disabled="!watcher.dataChanged()"
label="Save">
</vn-submit>
<vn-button
class="cancel"
label="Undo changes"
disabled="!watcher.dataChanged()"
ng-click="watcher.loadOriginalData()">
</vn-button>
</vn-button-bar> </vn-button-bar>
</form> </form>

View File

@ -42,7 +42,14 @@
</vn-horizontal> </vn-horizontal>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit label="Save"></vn-submit> <vn-submit
<vn-button label="Undo changes" ng-if="watcher.dataChanged()" ng-click="watcher.loadOriginalData()"></vn-button> disabled="!watcher.dataChanged()"
label="Save">
</vn-submit>
<vn-button
class="cancel"
label="Cancel"
ui-sref="travel.index">
</vn-button>
</vn-button-bar> </vn-button-bar>
</form> </form>

View File

@ -109,8 +109,15 @@
</vn-horizontal> </vn-horizontal>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit label="Upload"></vn-submit> <vn-submit
<vn-button ui-sref="travel.card.thermograph.index" label="Cancel"></vn-button> disabled="!watcher.dataChanged()"
label="Upload">
</vn-submit>
<vn-button
class="cancel"
label="Cancel"
ui-sref="travel.card.thermograph.index">
</vn-button>
</vn-button-bar> </vn-button-bar>
</div> </div>
</form> </form>

View File

@ -33,7 +33,15 @@
</vn-vertical> </vn-vertical>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit label="Save"></vn-submit> <vn-submit
<vn-button label="Undo changes" ng-if="watcher.dataChanged()" ng-click="watcher.loadOriginalData()"></vn-button> disabled="!watcher.dataChanged()"
label="Save">
</vn-submit>
<vn-button
class="cancel"
label="Undo changes"
disabled="!watcher.dataChanged()"
ng-click="watcher.loadOriginalData()">
</vn-button>
</vn-button-bar> </vn-button-bar>
</form> </form>

View File

@ -76,8 +76,14 @@
</vn-vertical> </vn-vertical>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit label="Upload"></vn-submit> <vn-submit
<vn-button ui-sref="worker.card.dms.index" label="Cancel"></vn-button> label="Upload">
</vn-submit>
<vn-button
class="cancel"
label="Cancel"
ui-sref="worker.card.dms.index"></vn-button>
</vn-button>
</vn-button-bar> </vn-button-bar>
</div> </div>
</form> </form>

View File

@ -14,10 +14,14 @@
</vn-vertical> </vn-vertical>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit label="Save"></vn-submit> <vn-submit
disabled="!watcher.dataChanged()"
label="Save">
</vn-submit>
<vn-button <vn-button
class="cancel"
label="Undo changes" label="Undo changes"
ng-if="form.$dirty" disabled="!watcher.dataChanged()"
ng-click="watcher.loadOriginalData()"> ng-click="watcher.loadOriginalData()">
</vn-button> </vn-button>
</vn-button-bar> </vn-button-bar>

View File

@ -93,17 +93,16 @@
</vn-horizontal> </vn-horizontal>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit
disabled="!watcher.dataChanged()"
vn-acl="deliveryBoss"
label="Save">
</vn-submit>
<vn-button <vn-button
class="cancel"
label="Undo changes" label="Undo changes"
ng-if="watcher.dataChanged()" disabled="!watcher.dataChanged()"
ng-click="watcher.loadOriginalData()"> ng-click="watcher.loadOriginalData()">
</vn-button> </vn-button>
</vn-button-bar> </vn-button-bar>
<vn-submit
icon="save"
vn-acl="deliveryBoss"
vn-tooltip="Save"
class="round"
fixed-bottom-right>
</vn-submit>
</form> </form>

View File

@ -84,10 +84,15 @@
<vn-check ng-model="$ctrl.zone.isVolumetric" label="Volumetric"></vn-check> <vn-check ng-model="$ctrl.zone.isVolumetric" label="Volumetric"></vn-check>
</vn-horizontal> </vn-horizontal>
</vn-card> </vn-card>
<vn-submit <vn-button-bar>
icon="check" <vn-submit
vn-tooltip="Create" disabled="!watcher.dataChanged()"
class="round" label="Create">
fixed-bottom-right> </vn-submit>
</vn-submit> <vn-button
class="cancel"
label="Cancel"
ui-sref="zone.index">
</vn-button>
</vn-button-bar>
</form> </form>

View File

@ -4,7 +4,7 @@
*/ */
.grid { .grid {
font-family: Arial, sans-serif; font-family: Arial, Helvetica, sans-serif;
font-size: 16px !important; font-size: 16px !important;
width: 100% width: 100%
} }
@ -63,7 +63,6 @@
.panel { .panel {
position: relative; position: relative;
margin-bottom: 15px; margin-bottom: 15px;
padding-top: 10px;
break-inside: avoid; break-inside: avoid;
break-before: always; break-before: always;
break-after: always; break-after: always;
@ -72,10 +71,11 @@
.panel .header { .panel .header {
background-color: #FFF; background-color: #FFF;
padding: 2.5px 10px; padding: 2.5px 10px;
position: absolute; position: relative;
font-weight: bold; font-weight: bold;
top: 0px; display: inline-block;
left: 17.5px; left: 17.5px;
top: 10px;
} }
.panel .body { .panel .body {
@ -168,18 +168,22 @@ table {
.column-oriented td, .column-oriented td,
.column-oriented th { .column-oriented th {
padding: 5px 10px padding: 10px
} }
.column-oriented thead { .column-oriented thead {
display: table-header-group; display: table-header-group
background-color: #e5e5e5
} }
.column-oriented thead tr { .column-oriented thead tr {
border-bottom: 1px solid #808080; border-top: 1px solid #AFB1B2;
border-top: 1px solid #808080; background-color: #BABDBD;
background-color: #e5e5e5 border-bottom: 1px solid #AFB1B2;
}
.column-oriented thead.light tr {
background-color: #FFF;
color: #AFB1B2
} }
.column-oriented tfoot { .column-oriented tfoot {
@ -193,13 +197,10 @@ table {
} }
.column-oriented tfoot tr:first-child td { .column-oriented tfoot tr:first-child td {
border-top: 2px solid #AFB1B2;
padding-top: 20px !important; padding-top: 20px !important;
} }
.column-oriented tfoot tr:first-child {
border-top: 2px solid #808080;
}
.column-oriented .description { .column-oriented .description {
font-size: 0.8em font-size: 0.8em
} }

View File

@ -9,6 +9,6 @@ body {
.title { .title {
margin-bottom: 20px; margin-bottom: 20px;
font-weight: 100; font-weight: 100;
font-size: 2em; font-size: 3em;
margin-top: 0 margin-top: 0
} }

View File

@ -5,7 +5,6 @@
<div class="centerText" v-if="centerText" class="uppercase">{{centerText}}</div> <div class="centerText" v-if="centerText" class="uppercase">{{centerText}}</div>
<div class="pageCount" v-html="$t('numPages')"></div> <div class="pageCount" v-html="$t('numPages')"></div>
</div> </div>
<p class="phytosanitary" v-if="showPhytosanitary">{{phytosanitary}}</p>
<p class="privacy" v-html="$t('law.privacy')"></p> <p class="privacy" v-html="$t('law.privacy')"></p>
</div> </div>
</div> </div>

View File

@ -1,18 +1,4 @@
const db = require('../../database');
module.exports = { module.exports = {
name: 'report-footer', name: 'report-footer',
async serverPrefetch() { props: ['leftText', 'centerText']
const companyCode = this.companyCode || 'VNL';
this.phytosanitary = await this.getPhytosanitary(companyCode);
},
methods: {
getPhytosanitary(code) {
return db.findValue(`
SELECT phytosanitary FROM company c
WHERE c.code = :code`, {code});
}
},
props: ['companyCode', 'showPhytosanitary', 'leftText', 'centerText']
}; };

View File

@ -4,4 +4,5 @@ require('./uppercase');
require('./currency'); require('./currency');
require('./percentage'); require('./percentage');
require('./number'); require('./number');
require('./zerofill');

View File

@ -0,0 +1,9 @@
import zerofill from '../zerofill.js';
describe('zerofill filter', () => {
const superDuperNumber = 1984;
it('should filter the number filling it with zeros up to 6 characters length', () => {
expect(zerofill(superDuperNumber, '000000')).toEqual('001984');
});
});

View File

@ -0,0 +1,11 @@
const {KeyValueModel} = require('loopback');
const Vue = require('vue');
const zerofill = function(value, pad) {
const valueStr = String(value);
return pad.substring(0, pad.length - valueStr.length) + valueStr;
};
Vue.filter('zerofill', zerofill);
module.exports = zerofill;

View File

@ -9,3 +9,11 @@
.bottom-line tr:nth-last-child() { .bottom-line tr:nth-last-child() {
border-bottom: none; border-bottom: none;
} }
.report-info {
font-size: 20px
}
.description strong {
text-transform: uppercase;
}

View File

@ -14,7 +14,7 @@
<div class="size50"> <div class="size50">
<h1 class="title uppercase">{{$t('title')}}</h1> <h1 class="title uppercase">{{$t('title')}}</h1>
<div class="size75"> <div class="size75">
<table class="row-oriented"> <table class="row-oriented report-info">
<tbody> <tbody>
<tr> <tr>
<td class="font gray">{{$t('Client')}}</td> <td class="font gray">{{$t('Client')}}</td>
@ -59,29 +59,22 @@
</tr> </tr>
</thead> </thead>
<tbody v-for="sale in sales"> <tbody v-for="sale in sales">
<tr class="font bold"> <tr>
<td>{{sale.itemFk}}</td> <td>{{sale.itemFk | zerofill('000000')}}</td>
<td class="number">{{Math.trunc(sale.subtotal)}}</td> <td class="number">{{Math.trunc(sale.subtotal)}}</td>
<td width="50%">{{sale.concept}}</td> <td width="50%">{{sale.concept}}</td>
</tr> </tr>
<tr class="description"> <tr class="description font light-gray">
<td> <td colspan="7">
<div v-if="sale.value5"> <span v-if="sale.value5">
<strong class="font gray">{{sale.tag5}}</strong> <strong>{{sale.tag5}}</strong> {{sale.value5}}
<span>{{sale.value5}}</span> </span>
</div> <span v-if="sale.value6">
</td> <strong>{{sale.tag6}}</strong> {{sale.value6}}
<td class="centered"> </span>
<div v-if="sale.value6"> <span v-if="sale.value7">
<strong class="font gray">{{sale.tag6}}</strong> <strong>{{sale.tag7}}</strong> {{sale.value7}}
<span>{{sale.value6}}</span> </span>
</div>
</td>
<td class="align-right">
<div v-if="sale.value7">
<strong class="font gray">{{sale.tag7}}</strong>
<span>{{sale.value7}}</span>
</div>
</td> </td>
</tr> </tr>
</tbody> </tbody>

View File

@ -1,7 +1,3 @@
table.column-oriented {
margin-top: 50px !important
}
.sign { .sign {
margin: 150px auto; margin: 150px auto;
width: 300px width: 300px

View File

@ -12,25 +12,23 @@
<div class="grid-block"> <div class="grid-block">
<div class="columns"> <div class="columns">
<div class="size50"> <div class="size50">
<div class="size75"> <h1 class="title uppercase">{{$t('title')}}</h1>
<h1 class="title uppercase">{{$t('title')}}</h1> <table class="row-oriented">
<table class="row-oriented"> <tbody>
<tbody> <tr>
<tr> <td class="font gray uppercase">{{$t('claimId')}}</td>
<td class="font gray uppercase">{{$t('claimId')}}</td> <th>{{claimId}}</th>
<th>{{claimId}}</th> </tr>
</tr> <tr>
<tr> <td class="font gray uppercase">{{$t('clientId')}}</td>
<td class="font gray uppercase">{{$t('clientId')}}</td> <th>{{client.id}}</th>
<th>{{client.id}}</th> </tr>
</tr> <tr>
<tr> <td class="font gray uppercase">{{$t('date')}}</td>
<td class="font gray uppercase">{{$t('date')}}</td> <th>{{dated}}</th>
<th>{{dated}}</th> </tr>
</tr> </tbody>
</tbody> </table>
</table>
</div>
</div> </div>
<div class="size50"> <div class="size50">
<div class="panel"> <div class="panel">
@ -51,7 +49,7 @@
</div> </div>
</div> </div>
<table class="column-oriented"> <table class="column-oriented vn-mt-lg">
<thead> <thead>
<tr> <tr>
<th>{{$t('reference')}}</th> <th>{{$t('reference')}}</th>

View File

@ -9,15 +9,32 @@
max-width: 150px max-width: 150px
} }
.description.phytosanitary { .description strong {
background-color: #e5e5e5 text-transform: uppercase;
} }
h3 { h2 {
font-weight: 100; font-weight: 100;
color: #555 color: #555
} }
.ticket-info { .ticket-info {
font-size: 20px font-size: 26px
}
#phytosanitary {
padding-right: 10px
}
#phytosanitary .flag img {
width: 100%
}
#phytosanitary .flag .flag-text {
padding-left: 10px;
box-sizing: border-box;
}
.phytosanitary-info {
margin-top: 10px
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

View File

@ -14,7 +14,7 @@
<div class="grid-block"> <div class="grid-block">
<div class="columns"> <div class="columns">
<div class="size50"> <div class="size50">
<div class="size75"> <div class="size75 vn-mt-lg">
<h1 class="title uppercase">{{$t('title')}}</h1> <h1 class="title uppercase">{{$t('title')}}</h1>
<table class="row-oriented ticket-info"> <table class="row-oriented ticket-info">
<tbody> <tbody>
@ -66,59 +66,46 @@
</div> </div>
<!-- Sales block --> <!-- Sales block -->
<h3>{{$t('saleLines')}}</h3> <h2>{{$t('saleLines')}}</h2>
<table class="column-oriented"> <table class="column-oriented">
<thead> <thead>
<tr> <tr>
<td>{{$t('reference')}}</td> <th width="5%">{{$t('reference')}}</th>
<td class="number">{{$t('quantity')}}</td> <th class="number">{{$t('quantity')}}</th>
<td width="50%">{{$t('concept')}}</td> <th width="50%">{{$t('concept')}}</th>
<td class="number">{{$t('price')}}</td> <th class="number">{{$t('price')}}</th>
<td class="centered">{{$t('discount')}}</td> <th class="centered" width="5%">{{$t('discount')}}</th>
<td class="centered">{{$t('vat')}}</td> <th class="centered">{{$t('vat')}}</th>
<td class="number">{{$t('amount')}}</td> <th class="number">{{$t('amount')}}</th>
</tr> </tr>
</thead> </thead>
<tbody v-for="sale in sales"> <tbody v-for="sale in sales" class="no-page-break">
<tr class="font bold"> <tr>
<td>{{sale.itemFk}}</td> <td width="5%">{{sale.itemFk | zerofill('000000')}}</td>
<td class="number">{{sale.quantity}}</td> <td class="number">{{sale.quantity}}</td>
<td width="50%">{{sale.concept}}</td> <td width="50%">{{sale.concept}}</td>
<td class="number">{{sale.price | currency('EUR', $i18n.locale)}}</td> <td class="number">{{sale.price | currency('EUR', $i18n.locale)}}</td>
<td class="centered">{{(sale.discount / 100) | percentage}}</td> <td class="centered" width="5%">{{(sale.discount / 100) | percentage}}</td>
<td class="centered">{{sale.vatType}}</td> <td class="centered">{{sale.vatType}}</td>
<td class="number">{{sale.price * sale.quantity * (1 - sale.discount / 100) | currency('EUR', $i18n.locale)}}</td> <td class="number">{{sale.price * sale.quantity * (1 - sale.discount / 100) | currency('EUR', $i18n.locale)}}</td>
</tr> </tr>
<tr class="description"> <tr class="description font light-gray">
<td colspan="2" class="centered">
<div v-if="sale.value5">
<strong class="font gray">{{sale.tag5}}</strong>
<span>{{sale.value5}}</span>
</div>
</td>
<td colspan="3" class="centered">
<div v-if="sale.value6">
<strong class="font gray">{{sale.tag6}}</strong>
<span>{{sale.value6}}</span>
</div>
</td>
<td colspan="2" class="centered">
<div v-if="sale.value7">
<strong class="font gray">{{sale.tag7}}</strong>
<span>{{sale.value7}}</span>
</div>
</td>
</tr>
<tr class="description phytosanitary" v-if="sale.passportNumber">
<td colspan="7"> <td colspan="7">
{{sale.ediBotanic}} {{sale.denomination}} {{sale.countryCode}}-{{sale.passportNumber}} <span v-if="sale.value5">
<span v-if="sale.isProtectedZone">ZP</span> <strong>{{sale.tag5}}</strong> {{sale.value5}}
</span>
<span v-if="sale.value6">
<strong>{{sale.tag6}}</strong> {{sale.value6}}
</span>
<span v-if="sale.value7">
<strong>{{sale.tag7}}</strong> {{sale.value7}}
</span>
</td> </td>
</tr> </tr>
</tbody> </tbody>
<tfoot> <tfoot>
<tr> <tr>
<td colspan="6"> <td colspan="6" class="font bold">
<span class="pull-right">{{$t('subtotal')}}</span> <span class="pull-right">{{$t('subtotal')}}</span>
</td> </td>
<td class="number">{{getSubTotal() | currency('EUR', $i18n.locale)}}</td> <td class="number">{{getSubTotal() | currency('EUR', $i18n.locale)}}</td>
@ -130,52 +117,89 @@
<div class="columns"> <div class="columns">
<!-- Services block--> <!-- Services block-->
<div class="size100 no-page-break" v-if="services.length > 0"> <div class="size100 no-page-break" v-if="services.length > 0">
<h3>{{$t('services')}}</h3> <h2>{{$t('services')}}</h2>
<table class="column-oriented"> <table class="column-oriented">
<thead> <thead>
<tr> <tr>
<td>{{$t('concept')}}</td> <th width="5%"></th>
<td class="number">{{$t('quantity')}}</td> <th class="number">{{$t('quantity')}}</th>
<td>{{$t('vatType')}}</td> <th width="50%">{{$t('concept')}}</th>
<td class="number">{{$t('amount')}}</td> <th class="number">{{$t('price')}}</th>
<th class="centered" width="5%"></th>
<th class="centered">{{$t('vat')}}</th>
<th class="number">{{$t('amount')}}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr v-for="service in services"> <tr v-for="service in services">
<td>{{service.description}}</td> <td width="5%"></td>
<td class="number">{{service.quantity}}</td> <td class="number">{{service.quantity}}</td>
<td>{{service.taxDescription}}</td> <td width="50%">{{service.description}}</td>
<td class="number">{{service.price | currency('EUR', $i18n.locale)}}</td>
<td class="centered" width="5%"></td>
<td class="centered">{{service.taxDescription}}</td>
<td class="number">{{service.price | currency('EUR', $i18n.locale)}}</td> <td class="number">{{service.price | currency('EUR', $i18n.locale)}}</td>
</tr> </tr>
</tbody> </tbody>
<tfoot> <tfoot>
<tr> <tr>
<td colspan="3"></td> <td colspan="6" class="font bold">
<td class="number">{{$t('total')}} {{serviceTotal | currency('EUR', $i18n.locale)}}</td> <span class="pull-right">{{$t('subtotal')}}</span>
</td>
<td class="number">{{serviceTotal | currency('EUR', $i18n.locale)}}</td>
</tr> </tr>
</tfoot> </tfoot>
</table> </table>
</div> </div>
<!-- End of services block --> <!-- End of services block -->
</div>
<!-- Taxes block --> <div class="columns">
<div id="taxes" class="size50 pull-right no-page-break" v-if="taxes"> <!-- Packages block -->
<h3>{{$t('taxBreakdown')}}</h3> <div id="packagings" class="size100 no-page-break" v-if="packagings.length > 0">
<h2>{{$t('packagings')}}</h2>
<table class="column-oriented"> <table class="column-oriented">
<thead> <thead>
<tr> <tr>
<td width="45%">{{$t('type')}}</td> <th>{{$t('reference')}}</th>
<td width="20%" class="number"> <th class="number">{{$t('quantity')}}</th>
<th wihth="75%">{{$t('concept')}}</th>
</tr>
</thead>
<tbody>
<tr v-for="packaging in packagings">
<td>{{packaging.itemFk | zerofill('000000')}}</td>
<td class="number">{{packaging.quantity}}</td>
<td width="85%">{{packaging.name}}</td>
</tr>
</tbody>
</table>
</div>
<!-- End of packages block -->
</div>
<div class="columns vn-mt-xl">
<!-- Taxes block -->
<div id="taxes" class="size50 pull-right no-page-break" v-if="taxes">
<!-- <h2>{{$t('taxBreakdown')}}</h2> -->
<table class="column-oriented">
<thead>
<tr>
<th colspan="4">{{$t('taxBreakdown')}}</th>
</tr>
</thead>
<thead class="light">
<tr>
<th width="45%">{{$t('type')}}</th>
<th width="25%" class="number">
{{$t('taxBase')}} {{$t('taxBase')}}
</td> </th>
<td>{{$t('tax')}}</td> <th>{{$t('tax')}}</th>
<td class="number">{{$t('fee')}}</td> <th class="number">{{$t('fee')}}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr v-for="tax in taxes"> <tr v-for="tax in taxes">
<td width="45%">{{tax.name}}</td> <td width="45%">{{tax.name}}</td>
<td width="20%" class="number"> <td width="25%" class="number">
{{tax.Base | currency('EUR', $i18n.locale)}} {{tax.Base | currency('EUR', $i18n.locale)}}
</td> </td>
<td>{{tax.vatPercent | percentage}}</td> <td>{{tax.vatPercent | percentage}}</td>
@ -199,29 +223,45 @@
</table> </table>
</div> </div>
<!-- End of taxes block --> <!-- End of taxes block -->
<!-- Packages block --> <!-- Phytosanitary block -->
<div id="packagings" class="size100 no-page-break" v-if="packagings.length > 0"> <div id="phytosanitary" class="size50 pull-left no-page-break">
<h3>{{$t('packagings')}}</h3> <div class="panel">
<table class="column-oriented"> <div class="body">
<thead> <div class="flag">
<tr> <div class="columns">
<td>Id</td> <div class="size25">
<td>{{$t('concept')}}</td> <img v-bind:src="getReportSrc('europe.png')"/>
<td class="number">{{$t('quantity')}}</td> </div>
</tr> <div class="size75 flag-text">
</thead> <strong>{{$t('plantPassport')}}</strong><br/>
<tbody> </div>
<tr v-for="packaging in packagings"> </div>
<td>{{packaging.itemFk}}</td> </div>
<td>{{packaging.name}}</td> <div class="phytosanitary-info">
<td class="number">{{packaging.quantity}}</td> <div>
</tr> <strong>A</strong>
</tbody> <span>{{getBotanical()}}</span>
</table> </div>
<div>
<strong>B</strong>
<span>ES17462130</span>
</div>
<div>
<strong>C</strong>
<span>{{ticket.id}}</span>
</div>
<div>
<strong>D</strong>
<span>ES</span>
</div>
</div>
</div>
</div>
</div> </div>
<!-- End of packages block --> <!-- End of phytosanitary block -->
</div>
<div class="columns">
<!-- Signature block --> <!-- Signature block -->
<div class="size50 pull-left no-page-break"> <div class="size50 pull-left no-page-break">
<div id="signature" class="panel" v-if="signature && signature.id"> <div id="signature" class="panel" v-if="signature && signature.id">
@ -239,7 +279,6 @@
<!-- Footer block --> <!-- Footer block -->
<report-footer id="pageFooter" <report-footer id="pageFooter"
v-bind:company-code="ticket.companyCode" v-bind:company-code="ticket.companyCode"
v-bind:show-phytosanitary="true"
v-bind:left-text="$t('ticket', [ticket.id])" v-bind:left-text="$t('ticket', [ticket.id])"
v-bind:center-text="client.socialName" v-bind:center-text="client.socialName"
v-bind="$props"> v-bind="$props">

View File

@ -95,6 +95,22 @@ module.exports = {
}, },
getTotal() { getTotal() {
return this.getTotalBase() + this.getTotalTax(); return this.getTotalBase() + this.getTotalTax();
},
getBotanical() {
let phytosanitary = [];
this.sales.forEach(sale => {
let itemPhytosanitary;
if (sale.latinGenusName || sale.latinSpeciesName)
itemPhytosanitary = [sale.latinGenusName, sale.latinSpeciesName].filter(Boolean).join(' ');
else if (sale.botanical)
itemPhytosanitary = sale.botanical;
phytosanitary.push(itemPhytosanitary);
});
return phytosanitary.filter((item, index) =>
phytosanitary.indexOf(item) == index
).join(', ');
} }
}, },
components: { components: {

View File

@ -23,4 +23,5 @@ packagings: Buckets and packaging
services: Services services: Services
vatType: VAT Type vatType: VAT Type
digitalSignature: Digital signature digitalSignature: Digital signature
ticket: Delivery note {0} ticket: Delivery note {0}
plantPassport: Plant passport

View File

@ -23,4 +23,5 @@ packagings: Cubos y embalajes
services: Servicios services: Servicios
vatType: Tipo de IVA vatType: Tipo de IVA
digitalSignature: Firma digital digitalSignature: Firma digital
ticket: Albarán {0} ticket: Albarán {0}
plantPassport: Pasaporte fitosanitario

View File

@ -23,4 +23,5 @@ packagings: Bacs et emballages
services: Service services: Service
vatType: Type de TVA vatType: Type de TVA
digitalSignature: Signature numérique digitalSignature: Signature numérique
ticket: BL {0} ticket: BL {0}
plantPassport: Passeport phytosanitaire

View File

@ -23,4 +23,5 @@ packagings: Baldes e Embalagens
services: Serviços services: Serviços
vatType: Tipo de IVA vatType: Tipo de IVA
digitalSignature: Assinatura digital digitalSignature: Assinatura digital
ticket: Nota de Entrega {0} ticket: Nota de Entrega {0}
plantPassport: Passaporte vegetal

View File

@ -14,10 +14,9 @@ SELECT
i.inkFk, i.inkFk,
s.ticketFk, s.ticketFk,
tcl.code vatType, tcl.code vatType,
ibwg.ediBotanic, ib.botanical,
ppa.denomination, eg.latinGenusName,
pp.number passportNumber, es.latinSpeciesName,
be.isProtectedZone, c.code AS countryCode,
i.tag5, i.tag5,
i.value5, i.value5,
i.tag6, i.tag6,
@ -34,20 +33,14 @@ FROM vn.sale s
LEFT JOIN country c ON c.id = o.countryFk LEFT JOIN country c ON c.id = o.countryFk
LEFT JOIN supplier sp ON sp.id = t.companyFk LEFT JOIN supplier sp ON sp.id = t.companyFk
LEFT JOIN itemType it ON it.id = i.typeFk LEFT JOIN itemType it ON it.id = i.typeFk
LEFT JOIN itemCategory ic ON ic.id = it.categoryFk
LEFT JOIN itemTaxCountry itc ON itc.itemFk = i.id LEFT JOIN itemTaxCountry itc ON itc.itemFk = i.id
AND itc.countryFk = sp.countryFk AND itc.countryFk = sp.countryFk
LEFT JOIN taxClass tcl ON tcl.id = itc.taxClassFk LEFT JOIN taxClass tcl ON tcl.id = itc.taxClassFk
LEFT JOIN plantpassport pp ON pp.producerFk = i.producerFk LEFT JOIN itemBotanical ib ON ib.itemFk = i.id
LEFT JOIN plantpassportAuthority ppa ON ppa.id = pp.plantpassportAuthorityFk AND ic.code = 'plant'
LEFT JOIN itemBotanicalWithGenus ibwg ON ibwg.itemFk = i.id LEFT JOIN ediGenus eg ON eg.id = ib.genusFk
LEFT JOIN botanicExport be ON be.restriction = 'pasaporte fitosanitario' LEFT JOIN ediSpecie es ON es.id = ib.specieFk
LEFT JOIN ediGenus eg ON eg.id = be.ediGenusFk
LEFT JOIN ediSpecie es ON es.id = be.ediSpecieFk
AND ibwg.ediBotanic LIKE CONCAT(
IFNULL(eg.latinGenusName, ''),
IF(es.latinSpeciesName > '',
CONCAT(' ', es.latinSpeciesName), ''),
'%')
WHERE s.ticketFk = ? WHERE s.ticketFk = ?
GROUP BY s.id GROUP BY s.id
ORDER BY (it.isPackaging), s.concept, s.itemFk ORDER BY (it.isPackaging), s.concept, s.itemFk

View File

@ -1,5 +1,5 @@
SELECT SELECT
tc.description taxDescription, tc.code taxDescription,
ts.description, ts.description,
ts.quantity, ts.quantity,
ts.price ts.price

View File

@ -86,11 +86,11 @@
<table class="column-oriented repeatable"> <table class="column-oriented repeatable">
<thead> <thead>
<tr> <tr>
<td class="number">{{$t('order')}}</td> <th class="number">{{$t('order')}}</th>
<td class="number">{{$t('ticket')}}</td> <th class="number">{{$t('ticket')}}</th>
<td width="50%">{{$t('client')}}</td> <th width="50%">{{$t('client')}}</th>
<td class="number">{{$t('address')}}</td> <th class="number">{{$t('address')}}</th>
<td class="number">{{$t('packages')}}</td> <th class="number">{{$t('packages')}}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>

View File

@ -21,4 +21,4 @@ import: Importe
stowaway: Encajado dentro del ticket stowaway: Encajado dentro del ticket
route: Ruta route: Ruta
routeId: Ruta {0} routeId: Ruta {0}
ticket: Tiquet ticket: Ticket

View File

@ -3,4 +3,12 @@
h3 { h3 {
font-weight: 100; font-weight: 100;
color: #555 color: #555
}
.report-info {
font-size: 20px
}
.description strong {
text-transform: uppercase;
} }

View File

@ -14,26 +14,24 @@
<div class="grid-block"> <div class="grid-block">
<div class="columns"> <div class="columns">
<div class="size50"> <div class="size50">
<div class="size75"> <div class="body">
<div class="body"> <h1 class="title uppercase">{{$t('title')}}</h1>
<h1 class="title uppercase">{{$t('title')}}</h1> <table class="row-oriented report-info">
<table class="row-oriented"> <tbody>
<tbody> <tr>
<tr> <td class="font gray uppercase">{{$t('entryId')}}</td>
<td class="font gray uppercase">{{$t('entryId')}}</td> <th>{{entry.id}}</th>
<th>{{entry.id}}</th> </tr>
</tr> <tr>
<tr> <td class="font gray uppercase">{{$t('date')}}</td>
<td class="font gray uppercase">{{$t('date')}}</td> <th>{{entry.landed | date('%d-%m-%Y')}}</th>
<th>{{entry.landed | date('%d-%m-%Y')}}</th> </tr>
</tr> <tr>
<tr> <td class="font gray uppercase">{{$t('ref')}}</td>
<td class="font gray uppercase">{{$t('ref')}}</td> <th>{{entry.ref}}</th>
<th>{{entry.ref}}</th> </tr>
</tr> </tbody>
</tbody> </table>
</table>
</div>
</div> </div>
</div> </div>
<div class="size50"> <div class="size50">
@ -56,50 +54,43 @@
</div> </div>
<!-- Buy block --> <!-- Buy block -->
<table class="column-oriented"> <table class="column-oriented vn-mt-lg">
<thead> <thead>
<tr> <tr>
<td class="number">{{$t('boxes')}}</td> <th class="number">{{$t('boxes')}}</th>
<td class="number">{{$t('packing')}}</td> <th class="number">{{$t('packing')}}</th>
<td width="50%">{{$t('concept')}}</td> <th width="50%">{{$t('concept')}}</th>
<td width="10%" class="number">{{$t('quantity')}}</td> <th width="10%" class="number">{{$t('quantity')}}</th>
<td width="15%" class="number">{{$t('price')}}</td> <th width="15%" class="number">{{$t('price')}}</th>
<td width="15%" class="number">{{$t('amount')}}</td> <th width="15%" class="number">{{$t('amount')}}</th>
</tr> </tr>
</thead> </thead>
<tbody v-for="buy in buys"> <tbody v-for="buy in buys">
<tr class="font bold"> <tr>
<td class="number">{{buy.box}}</td> <td class="number">{{buy.box}}</td>
<td class="number">{{buy.packing}}</td> <td class="number">{{buy.packing}}</td>
<td width="50%">{{buy.itemName}}</td> <td width="50%">{{buy.itemName}}</td>
<td width="10%" class="number">{{buy.quantity | number}}</td> <td width="10%" class="number">{{buy.quantity | number($i18n.locale)}}</td>
<td width="15%" class="number">{{buy.buyingValue | currency('EUR', $i18n.locale)}}</td> <td width="15%" class="number">{{buy.buyingValue | currency('EUR', $i18n.locale)}}</td>
<td width="15%" class="number">{{buy.buyingValue * buy.quantity | currency('EUR', $i18n.locale)}}</td> <td width="15%" class="number">{{buy.buyingValue * buy.quantity | currency('EUR', $i18n.locale)}}</td>
</tr> </tr>
<tr class="description"> <tr class="description font light-gray">
<td colspan="2"> <td colspan="7">
<div v-if="buy.value5"> <span v-if="buy.value5">
<strong class="font gray">{{buy.tag5}}</strong> <strong>{{buy.tag5}}</strong> {{buy.value5}}
<span>{{buy.value5}}</span> </span>
</div> <span v-if="buy.value6">
</td> <strong>{{buy.tag6}}</strong> {{buy.value6}}
<td colspan="2" class="centered"> </span>
<div v-if="buy.value6"> <span v-if="buy.value7">
<strong class="font gray">{{buy.tag6}}</strong> <strong>{{buy.tag7}}</strong> {{buy.value7}}
<span>{{buy.value6}}</span> </span>
</div>
</td>
<td colspan="2" class="align-right">
<div v-if="buy.value7">
<strong class="font gray">{{buy.tag7}}</strong>
<span>{{buy.value7}}</span>
</div>
</td> </td>
</tr> </tr>
</tbody> </tbody>
<tfoot> <tfoot>
<tr> <tr>
<td colspan="5"> <td colspan="5" class="font bold">
<span class="pull-right">{{$t('total')}}</span> <span class="pull-right">{{$t('total')}}</span>
</td> </td>
<td class="number">{{getTotal() | currency('EUR', $i18n.locale)}}</td> <td class="number">{{getTotal() | currency('EUR', $i18n.locale)}}</td>