This commit is contained in:
Carlos Jimenez Ruiz 2019-01-31 14:14:52 +01:00
commit d109e480a9
123 changed files with 1467 additions and 726 deletions

View File

@ -73,17 +73,17 @@ let actions = {
}, },
changeLanguageToEnglish: function(done) { changeLanguageToEnglish: function(done) {
this.wait('#lang') let langSelector = 'vn-user-configuration-popover vn-autocomplete[field="$ctrl.lang"]';
.evaluate(selector => {
return document.querySelector(selector).title; this.waitToClick('#user')
}, '#lang') .wait(langSelector)
.then(title => { .waitToGetProperty(`${langSelector} input`, 'value')
if (title === 'Change language') { .then(lang => {
if (lang === 'English') {
this.then(done) this.then(done)
.catch(done); .catch(done);
} else { } else {
this.click('#lang') this.autocompleteSearch(langSelector, 'English')
.click('vn-main-menu [vn-id="langs-menu"] ul > li[name="en"]')
.then(done) .then(done)
.catch(done); .catch(done);
} }

View File

@ -270,11 +270,11 @@ export default {
warehouseAutocomplete: 'vn-item-diary vn-autocomplete[field="$ctrl.warehouseFk"]', warehouseAutocomplete: 'vn-item-diary vn-autocomplete[field="$ctrl.warehouseFk"]',
}, },
ticketSummary: { ticketSummary: {
sale: 'vn-ticket-summary [name="sales"] table > tbody > tr', sale: 'vn-ticket-summary [name="sales"] vn-table > div > vn-tbody > vn-tr',
firstSaleItemId: 'vn-ticket-summary [name="sales"] table > tbody > tr > td:nth-child(2) > span', firstSaleItemId: 'vn-ticket-summary [name="sales"] vn-table > div > vn-tbody > vn-tr > vn-td:nth-child(2) > span',
popoverDiaryButton: 'vn-ticket-summary vn-item-descriptor-popover vn-item-descriptor vn-icon[icon="icon-transaction"]', popoverDiaryButton: 'vn-ticket-summary vn-item-descriptor-popover vn-item-descriptor vn-icon[icon="icon-transaction"]',
firstSaleQuantity: 'vn-ticket-summary [name="sales"] table > tbody > tr > td:nth-child(4)', firstSaleQuantity: 'vn-ticket-summary [name="sales"] vn-table > div > vn-tbody > vn-tr > vn-td:nth-child(4)',
firstSaleDiscount: 'vn-ticket-summary [name="sales"] table > tbody > tr > td:nth-child(6)' firstSaleDiscount: 'vn-ticket-summary [name="sales"] vn-table > div > vn-tbody > vn-tr > vn-td:nth-child(6)'
}, },
ticketsIndex: { ticketsIndex: {
newTicketButton: 'vn-ticket-index > a', newTicketButton: 'vn-ticket-index > a',

View File

@ -44,7 +44,7 @@ describe('Claim detail', () => {
.waitToGetProperty(selectors.claimDetail.totalClaimed, 'innerText'); .waitToGetProperty(selectors.claimDetail.totalClaimed, 'innerText');
expect(claimedQuantity).toEqual('10'); expect(claimedQuantity).toEqual('10');
expect(totalClaimed).toEqual('29.50 €'); expect(totalClaimed).toContain('29.50');
}); });
it('should delete the second item from the claim', async() => { it('should delete the second item from the claim', async() => {

View File

@ -65,7 +65,7 @@ describe('Client risk path', () => {
expect(company).toEqual('VNL'); expect(company).toEqual('VNL');
expect(firstRiskLineBalance).toEqual('0.00 €'); expect(firstRiskLineBalance).toContain('0.00');
}); });
it('should now click the new payment button', async() => { it('should now click the new payment button', async() => {
@ -91,7 +91,7 @@ describe('Client risk path', () => {
let result = await nightmare let result = await nightmare
.waitToGetProperty(selectors.clientRisk.firstRiskLineBalance, 'innerText'); .waitToGetProperty(selectors.clientRisk.firstRiskLineBalance, 'innerText');
expect(result).toEqual('100.00 €'); expect(result).toContain('100.00');
}); });
it('should again click the new payment button', async() => { it('should again click the new payment button', async() => {
@ -117,7 +117,7 @@ describe('Client risk path', () => {
let result = await nightmare let result = await nightmare
.waitToGetProperty(selectors.clientRisk.firstRiskLineBalance, 'innerText'); .waitToGetProperty(selectors.clientRisk.firstRiskLineBalance, 'innerText');
expect(result).toEqual('-50.00 €'); expect(result).toContain('-€50.00');
}); });
it('should now click on the Clients button of the top bar menu', async() => { it('should now click on the Clients button of the top bar menu', async() => {

View File

@ -73,7 +73,7 @@ describe('Ticket Edit basic data path', () => {
.wait(1900) .wait(1900)
.waitToGetProperty(selectors.ticketBasicData.stepTwoTotalPriceDif, 'innerText'); .waitToGetProperty(selectors.ticketBasicData.stepTwoTotalPriceDif, 'innerText');
expect(result).toContain('-187.75'); expect(result).toContain('-187.75');
}); });
it(`should then click next to move on to step three`, async() => { it(`should then click next to move on to step three`, async() => {

View File

@ -11,6 +11,7 @@ import './style.scss';
* @property {Array} data Static data for the autocomplete * @property {Array} data Static data for the autocomplete
* @property {Object} intialData A initial data to avoid the server request used to get the selection * @property {Object} intialData A initial data to avoid the server request used to get the selection
* @property {Boolean} multiple Wether to allow multiple selection * @property {Boolean} multiple Wether to allow multiple selection
* @property {Object} selection Current object selected
* *
* @event change Thrown when value is changed * @event change Thrown when value is changed
*/ */
@ -293,7 +294,7 @@ ngModule.component('vnAutocomplete', {
valueField: '@?', valueField: '@?',
initialData: '<?', initialData: '<?',
showFilter: '<?', showFilter: '<?',
selection: '<?', selection: '=?',
multiple: '<?', multiple: '<?',
data: '<?', data: '<?',
url: '@?', url: '@?',

View File

@ -6,7 +6,7 @@
icon="remove" icon="remove"
ng-click="$ctrl.remove()" ng-click="$ctrl.remove()"
tabindex="-1" tabindex="-1"
title="Remove number"> translate-attr="{title: 'Remove'}">
</vn-icon-button> </vn-icon-button>
</div> </div>
<div class="infix"> <div class="infix">
@ -29,7 +29,7 @@
icon="add" icon="add"
ng-click="$ctrl.add()" ng-click="$ctrl.add()"
tabindex="-1" tabindex="-1"
title="Add number"> translate-attr="{title: 'Add'}">
</vn-icon-button> </vn-icon-button>
<i class="material-icons" <i class="material-icons"
ng-if="$ctrl.hasInfo" ng-if="$ctrl.hasInfo"

View File

@ -1,3 +1,5 @@
@import "padding";
vn-searchbar { vn-searchbar {
padding-top: 6px; padding-top: 6px;
display: block; display: block;
@ -6,3 +8,11 @@ vn-searchbar {
color: black; color: black;
} }
} }
.search-panel {
max-height: 44em;
& > form {
@extend .pad-large;
}
}

View File

@ -5,15 +5,29 @@ import ngModule from '../module';
* *
* @return {String} The formated number * @return {String} The formated number
*/ */
export default function currency() {
return function(input, symbol, fractionSize) { export default function currency($translate) {
if (!fractionSize) function currency(input, symbol = 'EUR', fractionSize = 2) {
fractionSize = 2; let options = {
if (typeof input == 'number' && fractionSize) { style: 'currency',
input = input.toFixed(fractionSize); currency: symbol,
return `${input} ${symbol}`; minimumFractionDigits: fractionSize,
maximumFractionDigits: fractionSize
};
if (typeof input == 'number') {
return new Intl.NumberFormat($translate.use(), options)
.format(input);
} }
return undefined; return undefined;
}; }
currency.$stateful = true;
return currency;
} }
currency.$inject = ['$translate'];
ngModule.filter('currency', currency); ngModule.filter('currency', currency);

View File

@ -12,28 +12,28 @@ describe('Currency filter', () => {
}; };
it('should return a ONE decimal number as per the argument', () => { it('should return a ONE decimal number as per the argument', () => {
let html = `<div id="test" >{{200 | currency: '': 1}}</div>`; let html = `<div id="test" >{{200 | currency: 'EUR': 1}}</div>`;
compile(html); compile(html);
expect($element[0].innerHTML).toEqual('200.0 €'); expect($element[0].innerHTML).toContain('200.0');
}); });
it('should return a TWO decimals number as per the argument', () => { it('should return a TWO decimals number as per the argument', () => {
let html = `<div id="test" >{{200 | currency: '': 2}}</div>`; let html = `<div id="test" >{{200 | currency: 'EUR': 2}}</div>`;
compile(html); compile(html);
expect($element[0].innerHTML).toEqual('200.00 €'); expect($element[0].innerHTML).toContain('200.00');
}); });
it('should return a TEN decimals number as per the argument', () => { it('should return a TEN decimals number as per the argument', () => {
let html = `<div id="test" >{{200 | currency: '': 10}}</div>`; let html = `<div id="test" >{{200 | currency: 'EUR': 10}}</div>`;
compile(html); compile(html);
expect($element[0].innerHTML).toEqual('200.0000000000 €'); expect($element[0].innerHTML).toContain('200.0000000000');
}); });
it('sould return nothing when the value is not set', () => { it('sould return nothing when the value is not set', () => {
let html = `<div id="test" >{{null | currency: '': 2}}</div>`; let html = `<div id="test" >{{null | currency: 'EUR': 2}}</div>`;
compile(html); compile(html);
expect($element[0].innerHTML).toEqual(''); expect($element[0].innerHTML).toEqual('');

View File

@ -3,16 +3,22 @@
<img src="./logo.svg" alt="Logo"></img> <img src="./logo.svg" alt="Logo"></img>
</a> </a>
<vn-icon <vn-icon
ng-if="$ctrl.showMenuButton" ng-if="$ctrl.showLeftMenuButton"
class="show-menu" class="show-menu"
icon="menu" icon="menu"
ng-click="$ctrl.showMenu()"> ng-click="$ctrl.showLeftMenu()">
</vn-icon> </vn-icon>
<div class="main-title" translate> <div class="main-title" translate>
{{$ctrl.$state.current.description}} {{$ctrl.$state.current.description}}
</div> </div>
<vn-spinner enable="$ctrl.vnApp.loading"></vn-spinner> <vn-spinner enable="$ctrl.vnApp.loading"></vn-spinner>
<vn-main-menu></vn-main-menu> <vn-main-menu></vn-main-menu>
<vn-icon
ng-if="$ctrl.rightMenu"
class="show-menu"
icon="menu"
ng-click="$ctrl.showRightMenu()">
</vn-icon>
</vn-topbar> </vn-topbar>
<div ui-view <div ui-view
class="main-view" class="main-view"
@ -21,7 +27,7 @@
</div> </div>
<div <div
class="background" class="background"
ng-class="{shown: $ctrl.menuShown}" ng-class="{shown: $ctrl.leftMenuShown || $ctrl.rightMenuShown}"
ng-click="$ctrl.hideMenu()"> ng-click="$ctrl.hideMenus()">
</div> </div>
<vn-snackbar vn-id="snackbar"></vn-snackbar> <vn-snackbar vn-id="snackbar"></vn-snackbar>

View File

@ -12,8 +12,8 @@ export default class App {
$transitions.onStart({}, transition => { $transitions.onStart({}, transition => {
let state = transition.targetState().name(); let state = transition.targetState().name();
this.showMenuButton = state.split('.').length >= 3; this.showLeftMenuButton = state.split('.').length >= 3;
if (this.menuShown) this.hideMenu(); this.hideMenus();
}); });
} }
@ -30,22 +30,31 @@ export default class App {
return state && state != 'login'; return state && state != 'login';
} }
get leftBlock() { get leftMenu() {
return this.$element[0].querySelector('.left-block'); return this.$element[0].querySelector('.left-menu');
} }
showMenu() { showLeftMenu() {
let leftBlock = this.leftBlock; if (!this.leftMenu) return;
if (!leftBlock) return; this.leftMenu.classList.add('shown');
leftBlock.classList.add('shown'); this.leftMenuShown = true;
this.menuShown = true;
} }
hideMenu() { showRightMenu() {
this.menuShown = false; if (!this.rightMenu) return;
let leftBlock = this.leftBlock; this.rightMenu.classList.add('shown');
if (!leftBlock) return; this.rightMenuShown = true;
leftBlock.classList.remove('shown'); }
hideMenus() {
if (this.leftMenuShown) {
this.leftMenu.classList.remove('shown');
this.leftMenuShown = false;
}
if (this.rightMenuShown) {
this.rightMenu.classList.remove('shown');
this.rightMenuShown = false;
}
} }
showMessage(message) { showMessage(message) {

View File

@ -20,14 +20,14 @@ vn-app {
z-index: 2; z-index: 2;
box-shadow: 0 .1em .2em rgba(1, 1, 1, .2); box-shadow: 0 .1em .2em rgba(1, 1, 1, .2);
height: $topbar-height; height: $topbar-height;
padding: .3em; padding: .4em;
& > header { & > header {
& > * { & > * {
padding: .3em; padding: .3em;
} }
& > .logo > img { & > .logo > img {
height: 1.6em; height: 1.4em;
display: block; display: block;
} }
& > .show-menu { & > .show-menu {
@ -58,19 +58,24 @@ vn-app {
&.padding { &.padding {
padding-top: $topbar-height; padding-top: $topbar-height;
} }
.index-block { .content-block {
@extend .margin-medium; @extend .margin-medium;
form vn-horizontal {
& > * {
padding: .2em;
}
}
} }
vn-main-block { vn-main-block {
display: block; display: block;
margin: 0 auto; margin: 0 auto;
padding-left: $menu-width; padding-left: $menu-width;
.left-block { %side-menu {
display: block;
position: fixed; position: fixed;
z-index: 5; z-index: 5;
top: $topbar-height;
left: 0;
bottom: 0; bottom: 0;
width: $menu-width; width: $menu-width;
min-width: $menu-width; min-width: $menu-width;
@ -78,21 +83,16 @@ vn-app {
box-shadow: 0 .1em .2em rgba(1, 1, 1, .2); box-shadow: 0 .1em .2em rgba(1, 1, 1, .2);
overflow: auto; overflow: auto;
} }
.content-block { .left-menu {
@extend .margin-medium; @extend %side-menu;
top: $topbar-height;
form vn-horizontal { left: 0;
& > * {
padding: .2em;
}
}
} }
.right-block { .right-menu {
width: $menu-width; @extend %side-menu;
min-width: $menu-width; top: $topbar-height;
padding-left: 1em; right: 0;
} }
} }
} }
& > .background { & > .background {
@ -118,29 +118,32 @@ vn-app {
} }
} }
& > .main-view { & > .main-view {
.index-block { .content-block {
margin-left: 0; margin-left: 0;
margin-right: 0; margin-right: 0;
form vn-horizontal {
flex-direction: column;
}
} }
vn-main-block { vn-main-block {
padding-left: 0; padding-left: 0;
.left-block { %side-menu-mobile {
top: 0; top: 0;
transform: translateZ(0) translateX(-$menu-width);
transition: transform 200ms ease-out; transition: transform 200ms ease-out;
&.shown { &.shown {
transform: translateZ(0) translateX(0); transform: translateZ(0) translateX(0);
} }
} }
.content-block { .left-menu {
margin-left: 0; @extend %side-menu-mobile;
margin-right: 0; transform: translateZ(0) translateX(-$menu-width);
}
form vn-horizontal { .right-menu {
flex-direction: column; @extend %side-menu-mobile;
} transform: translateZ(0) translateX($menu-width);
} }
} }
} }

View File

@ -9,14 +9,14 @@
<vn-icon icon="{{::mod.icon || 'photo'}}"></vn-icon> <vn-icon icon="{{::mod.icon || 'photo'}}"></vn-icon>
</div> </div>
<h4 ng-bind-html="$ctrl.getModuleName(mod)"></h4> <h4 ng-bind-html="$ctrl.getModuleName(mod)"></h4>
<!--
<span <span
ng-show='mod.keyBind' ng-show='mod.keyBind'
vn-tooltip="Ctrl + Alt + {{mod.keyBind}}"> vn-tooltip="Ctrl + Alt + {{mod.keyBind}}">
({{::mod.keyBind}}) ({{::mod.keyBind}})
</span> </span>
<span ng-show='!mod.keyBind'>&nbsp;</span> <span ng-show='!mod.keyBind'>&nbsp;</span>
-->
</a> </a>
</div> </div>
</div> </div>

View File

@ -57,9 +57,9 @@ vn-home {
color: white; color: white;
margin: 0; margin: 0;
& > .bind-letter { /* & > .bind-letter {
color: #FD0; color: #FD0;
} } */
} }
} }
} }

View File

@ -5,22 +5,6 @@
class="unselectable"> class="unselectable">
{{currentUserName}} {{currentUserName}}
</div> </div>
<vn-icon
id="lang"
icon="language"
vn-popover="langs-menu"
translate-attr="{title: 'Change language'}">
</vn-icon>
<vn-menu vn-id="langs-menu">
<ul pad-small>
<li
ng-repeat="lang in ::$ctrl.langs"
name="{{::lang.code}}"
ng-click="$ctrl.onChangeLangClick(lang.code)">
<span>{{::lang.name}}</span>
</li>
</ul>
</vn-menu>
<vn-icon <vn-icon
id="apps" id="apps"
icon="apps" icon="apps"

View File

@ -1,16 +1,6 @@
import ngModule from '../../module'; import ngModule from '../../module';
import './style.scss'; import './style.scss';
let languages = {
es: 'Español',
en: 'English',
ca: 'Català',
pt: 'Português',
fr: 'Français',
nl: 'Nederlands',
mn: 'Монгол хэл'
};
export default class MainMenu { export default class MainMenu {
constructor($translate, $scope, $http, $window, vnModules, vnAuth) { constructor($translate, $scope, $http, $window, vnModules, vnAuth) {
this.$ = $scope; this.$ = $scope;
@ -18,15 +8,11 @@ export default class MainMenu {
this.$translate = $translate; this.$translate = $translate;
this.$window = $window; this.$window = $window;
this.modules = vnModules.get(); this.modules = vnModules.get();
this.langs = [];
this.vnAuth = vnAuth; this.vnAuth = vnAuth;
}
for (let code of $translate.getAvailableLanguageKeys()) { $onInit() {
this.langs.push({ this.getCurrentUserName();
code: code,
name: languages[code] ? languages[code] : code
});
}
} }
getCurrentUserName() { getCurrentUserName() {
@ -43,14 +29,6 @@ export default class MainMenu {
onLogoutClick() { onLogoutClick() {
this.vnAuth.logout(); this.vnAuth.logout();
} }
onChangeLangClick(lang) {
this.$translate.use(lang);
}
$onInit() {
this.getCurrentUserName();
}
} }
MainMenu.$inject = ['$translate', '$scope', '$http', '$window', 'vnModules', 'vnAuth']; MainMenu.$inject = ['$translate', '$scope', '$http', '$window', 'vnModules', 'vnAuth'];

View File

@ -12,7 +12,7 @@ vn-main-menu {
& > * { & > * {
cursor: pointer; cursor: pointer;
padding-left: .1em; padding-left: .3em;
&:hover { &:hover {
color: $main-01; color: $main-01;
@ -21,7 +21,7 @@ vn-main-menu {
& > #user { & > #user {
vertical-align: middle; vertical-align: middle;
font-weight: bold; font-weight: bold;
padding-right: .6em; padding-right: .4em;
} }
& > vn-icon, & > vn-icon,
& > a > vn-icon { & > a > vn-icon {
@ -41,6 +41,7 @@ vn-main-menu {
padding: .8em; padding: .8em;
border-radius: .1em; border-radius: .1em;
min-width: 8em; min-width: 8em;
white-space: nowrap;
&:last-child { &:last-child {
margin-bottom: 0; margin-bottom: 0;

View File

@ -16,72 +16,67 @@
data="companiesData" data="companiesData"
order="code"> order="code">
</vn-crud-model> </vn-crud-model>
<vn-popover vn-id="popover"> <vn-popover vn-id="popover">
<vn-vertical class="body"> <vn-vertical class="body">
<form name="form" ng-submit="$ctrl.onSubmit()"> <vn-autocomplete
<vn-horizontal> vn-one
<vn-autocomplete label="Local warehouse"
vn-one id="localWarehouse"
label="Local warehouse" field="$ctrl.localWarehouseFk"
id="localWarehouse" data="warehousesData"
field="$ctrl.localWarehouseFk" select-fields="['id','name']"
data="warehousesData" show-field="name"
select-fields="['id','name']" value-field="id">
show-field="name" </vn-autocomplete>
value-field="id"> <vn-autocomplete
</vn-autocomplete> vn-one
</vn-horizontal> label="Local bank"
<vn-horizontal> id="localBank"
<vn-autocomplete field="$ctrl.localBankFk"
vn-one data="banksData"
label="Local bank" select-fields="['id','bank']"
id="localBank" show-field="bank"
field="$ctrl.localBankFk" order="id"
data="banksData" value-field="id">
select-fields="['id','bank']" <tpl-item>{{id}}: {{bank}}</tpl-item>
show-field="bank" </vn-autocomplete>
order="id" <vn-autocomplete
value-field="id"> vn-one
<tpl-item>{{id}}: {{bank}}</tpl-item> label="Local company"
</vn-autocomplete> id="localCompany"
</vn-horizontal> field="$ctrl.localCompanyFk"
<vn-horizontal> data="companiesData"
<vn-autocomplete select-fields="['id','code']"
vn-one show-field="code"
label="Local company" value-field="id">
id="localCompany" </vn-autocomplete>
field="$ctrl.localCompanyFk" <vn-autocomplete
data="companiesData" vn-one
select-fields="['id','code']" label="User warehouse"
show-field="code" id="userWarehouse"
value-field="id"> field="$ctrl.warehouseFk"
</vn-autocomplete> data="warehousesData"
</vn-horizontal> select-fields="['id', 'name']"
<vn-horizontal> show-field="name"
<vn-autocomplete value-field="id">
vn-one </vn-autocomplete>
label="User warehouse" <vn-autocomplete
id="userWarehouse" vn-one
field="$ctrl.warehouseFk" label="User company"
data="warehousesData" id="userCompany"
select-fields="['id', 'name']" field="$ctrl.companyFk"
show-field="name" data="companiesData"
value-field="id"> select-fields="['id', 'code']"
</vn-autocomplete> show-field="code"
</vn-horizontal> value-field="id">
<vn-horizontal> </vn-autocomplete>
<vn-autocomplete <vn-autocomplete
vn-one vn-one
label="User company" label="Language"
id="userCompany" field="$ctrl.lang"
field="$ctrl.companyFk" data="$ctrl.langs"
data="companiesData" show-field="name"
select-fields="['id', 'code']" value-field="code">
show-field="code" </vn-autocomplete>
value-field="id">
</vn-autocomplete>
</vn-horizontal>
</form>
</vn-vertical> </vn-vertical>
</vn-popover> </vn-popover>

View File

@ -1,6 +1,16 @@
import ngModule from '../../module'; import ngModule from '../../module';
import './style.scss'; import './style.scss';
let languages = {
es: 'Español',
en: 'English',
ca: 'Català',
pt: 'Português',
fr: 'Français',
nl: 'Nederlands',
mn: 'Монгол хэл'
};
class Controller { class Controller {
constructor($scope, $http, $state, vnApp, $translate) { constructor($scope, $http, $state, vnApp, $translate) {
this.$scope = $scope; this.$scope = $scope;
@ -9,6 +19,25 @@ class Controller {
this.vnApp = vnApp; this.vnApp = vnApp;
this.$translate = $translate; this.$translate = $translate;
this.getUserConfig(); this.getUserConfig();
this.lang = $translate.use();
this.langs = [];
for (let code of $translate.getAvailableLanguageKeys()) {
this.langs.push({
code: code,
name: languages[code] ? languages[code] : code
});
}
}
set lang(value) {
this._lang = value;
this.$translate.use(value);
}
get lang() {
return this._lang;
} }
set localBankFk(value) { set localBankFk(value) {

View File

@ -11,7 +11,7 @@ describe('Salix', () => {
beforeEach(angular.mock.inject(($componentController, _$httpBackend_, $rootScope) => { beforeEach(angular.mock.inject(($componentController, _$httpBackend_, $rootScope) => {
$httpBackend = _$httpBackend_; $httpBackend = _$httpBackend_;
$scope = $rootScope.$new(); $scope = $rootScope.$new();
controller = $componentController('vnUserConfigurationPopover', {$scope: $scope, $translate: null}); controller = $componentController('vnUserConfigurationPopover', {$scope});
})); }));
describe('localBankFk() setter', () => { describe('localBankFk() setter', () => {

View File

@ -28,6 +28,8 @@ Order by: Ordenar por
Order: Orden Order: Orden
Ascendant: Ascendente Ascendant: Ascendente
Descendant: Descendente Descendant: Descendente
Add: Añadir
Remove: Quitar
# Modules # Modules

View File

@ -50,6 +50,7 @@ function backWatch(done) {
nodemon({ nodemon({
exec: commands.join(' && '), exec: commands.join(' && '),
ext: 'js html css',
args: ['backOnly'], args: ['backOnly'],
watch: backSources, watch: backSources,
done: done done: done

View File

@ -30,5 +30,6 @@
"You can't create a ticket for a inactive client": "You can't create a ticket for a inactive client", "You can't create a ticket for a inactive client": "You can't create a ticket for a inactive client",
"Worker cannot be blank": "Worker cannot be blank", "Worker cannot be blank": "Worker cannot be blank",
"You must delete the claim id %d first": "You must delete the claim id %d first", "You must delete the claim id %d first": "You must delete the claim id %d first",
"You don't have enough privileges": "You don't have enough privileges" "You don't have enough privileges": "You don't have enough privileges",
"Tag value cannot be blank": "Tag value cannot be blank"
} }

View File

@ -58,11 +58,12 @@
"You can't create an order for a inactive client": "You can't create an order for a inactive client", "You can't create an order for a inactive client": "You can't create an order for a inactive client",
"You can't create an order for a client that doesn't has tax data verified": "You can't create an order for a client that doesn't has tax data verified", "You can't create an order for a client that doesn't has tax data verified": "You can't create an order for a client that doesn't has tax data verified",
"You must delete the claim id %d first": "Antes debes borrar la reclamacion %d", "You must delete the claim id %d first": "Antes debes borrar la reclamacion %d",
"You don't have enough privileges": "You don't have enough privileges", "You don't have enough privileges": "No tienes suficientes permisos",
"Cannot check VIES and Equalization Tax": "No puedes marcar VIES y RE al mismo", "Cannot check VIES and Equalization Tax": "No puedes marcar VIES y RE al mismo",
"Cannot check Equalization Tax in this NIF/CIF": "No se puede marcar RE en este NIF/CIF", "Cannot check Equalization Tax in this NIF/CIF": "No se puede marcar RE en este NIF/CIF",
"You can't make changes on the basic data of an confirmed order or with rows": "No puedes cambiar los datos basicos de una orden con artículos", "You can't make changes on the basic data of an confirmed order or with rows": "No puedes cambiar los datos basicos de una orden con artículos",
"INVALID_USER_NAME": "El nombre de usuario solo debe contener letras minúsculas o, a partir del segundo carácter, números o subguiones, no esta permitido el uso de la letra ñ", "INVALID_USER_NAME": "El nombre de usuario solo debe contener letras minúsculas o, a partir del segundo carácter, números o subguiones, no esta permitido el uso de la letra ñ",
"You can't create a ticket for a frozen client": "No puedes crear un ticket para un cliente congelado", "You can't create a ticket for a frozen client": "No puedes crear un ticket para un cliente congelado",
"You can't create a ticket for a inactive client": "No puedes crear un ticket para un cliente inactivo" "You can't create a ticket for a inactive client": "No puedes crear un ticket para un cliente inactivo",
"Tag value cannot be blank": "El valor del tag no puede quedar en blanco"
} }

View File

@ -1,5 +1,5 @@
<vn-main-block> <vn-main-block>
<div class="left-block"> <div class="left-menu">
<vn-zone-descriptor zone="$ctrl.zone"></vn-zone-descriptor> <vn-zone-descriptor zone="$ctrl.zone"></vn-zone-descriptor>
<vn-left-menu></vn-left-menu> <vn-left-menu></vn-left-menu>
</div> </div>

View File

@ -5,8 +5,8 @@
form="form" form="form"
save="post"> save="post">
</vn-watcher> </vn-watcher>
<form name="form" ng-submit="$ctrl.onSubmit()" margin-medium> <div class="content-block">
<div style="max-width: 50em; margin: 0 auto;"> <form name="form" ng-submit="$ctrl.onSubmit()" compact>
<vn-card pad-large> <vn-card pad-large>
<vn-horizontal> <vn-horizontal>
<vn-textfield vn-two vn-focus <vn-textfield vn-two vn-focus
@ -66,5 +66,5 @@
<vn-submit label="Create"></vn-submit> <vn-submit label="Create"></vn-submit>
<vn-button ui-sref="zone.index" label="Cancel"></vn-button> <vn-button ui-sref="zone.index" label="Cancel"></vn-button>
</vn-button-bar> </vn-button-bar>
</div> </form>
</form> </div>

View File

@ -35,10 +35,10 @@
value="{{$ctrl.zone.travelingDays}}"> value="{{$ctrl.zone.travelingDays}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Price" <vn-label-value label="Price"
value="{{$ctrl.zone.price | currency: '': 2}}"> value="{{$ctrl.zone.price | currency: 'EUR': 2}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Bonus" <vn-label-value label="Bonus"
value="{{$ctrl.zone.price | currency: '': 2}}"> value="{{$ctrl.zone.price | currency: 'EUR': 2}}">
</vn-label-value> </vn-label-value>
</vn-one> </vn-one>
</div> </div>

View File

@ -6,7 +6,7 @@
data="zones" data="zones"
auto-load="false"> auto-load="false">
</vn-crud-model> </vn-crud-model>
<div class="index-block"> <div class="content-block">
<div class="vn-list"> <div class="vn-list">
<vn-card pad-medium-h> <vn-card pad-medium-h>
<vn-searchbar <vn-searchbar
@ -37,7 +37,7 @@
<vn-td>{{::zone.agencyMode.name}}</vn-td> <vn-td>{{::zone.agencyMode.name}}</vn-td>
<vn-td>{{::zone.warehouse.name}}</vn-td> <vn-td>{{::zone.warehouse.name}}</vn-td>
<vn-td>{{::zone.hour | date: 'HH:mm'}}</vn-td> <vn-td>{{::zone.hour | date: 'HH:mm'}}</vn-td>
<vn-td number>{{::zone.price | currency:'€':2}}</vn-td> <vn-td number>{{::zone.price | currency: 'EUR':2}}</vn-td>
<vn-td> <vn-td>
<vn-icon-button <vn-icon-button
ng-click="$ctrl.preview($event, zone)" ng-click="$ctrl.preview($event, zone)"

View File

@ -1,4 +1,4 @@
<div pad-large style="min-width: 30em"> <div class="search-panel">
<form ng-submit="$ctrl.onSearch()"> <form ng-submit="$ctrl.onSearch()">
<vn-horizontal> <vn-horizontal>
<vn-textfield <vn-textfield

View File

@ -18,8 +18,7 @@
"url": "/index?q", "url": "/index?q",
"state": "zone.index", "state": "zone.index",
"component": "vn-zone-index", "component": "vn-zone-index",
"description": "Zones", "description": "Zones"
"acl": ["developer"]
}, { }, {
"url": "/create", "url": "/create",
"state": "zone.create", "state": "zone.create",

View File

@ -1,4 +1,4 @@
<div pad-large style="min-width: 30em"> <div class="search-panel">
<form ng-submit="$ctrl.onSearch()"> <form ng-submit="$ctrl.onSearch()">
<vn-horizontal> <vn-horizontal>
<vn-textfield <vn-textfield

View File

@ -24,10 +24,10 @@
value="{{::$ctrl.summary.travelingDays}}"> value="{{::$ctrl.summary.travelingDays}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Price" <vn-label-value label="Price"
value="{{::$ctrl.summary.price | currency: '': 2}}"> value="{{::$ctrl.summary.price | currency: 'EUR': 2}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Bonus" <vn-label-value label="Bonus"
value="{{::$ctrl.summary.price | currency: '': 2}}"> value="{{::$ctrl.summary.price | currency: 'EUR': 2}}">
</vn-label-value> </vn-label-value>
</vn-one> </vn-one>
</vn-horizontal> </vn-horizontal>

View File

@ -10,7 +10,7 @@
<vn-horizontal> <vn-horizontal>
<div class="totalBox" ng-show="$ctrl.salesClaimed.length > 0"> <div class="totalBox" ng-show="$ctrl.salesClaimed.length > 0">
<vn-label-value label="Total claimed" <vn-label-value label="Total claimed"
value="{{$ctrl.claimedTotal | currency:'€':2}}"> value="{{$ctrl.claimedTotal | currency: 'EUR':2}}">
</vn-label-value> </vn-label-value>
</div> </div>
</vn-horizontal> </vn-horizontal>
@ -75,12 +75,12 @@
<vn-td number>{{saleClaimed.sale.ticket.landed | dateTime: 'dd/MM/yyyy'}}</vn-td> <vn-td number>{{saleClaimed.sale.ticket.landed | dateTime: 'dd/MM/yyyy'}}</vn-td>
<vn-td number>{{saleClaimed.sale.quantity}}</vn-td> <vn-td number>{{saleClaimed.sale.quantity}}</vn-td>
<vn-td number>{{saleClaimed.sale.concept}}</vn-td> <vn-td number>{{saleClaimed.sale.concept}}</vn-td>
<vn-td number>{{saleClaimed.sale.price | currency:'€':2}}</vn-td> <vn-td number>{{saleClaimed.sale.price | currency: 'EUR':2}}</vn-td>
<vn-td number>{{saleClaimed.sale.discount}} %</vn-td> <vn-td number>{{saleClaimed.sale.discount}} %</vn-td>
<vn-td number> <vn-td number>
{{(saleClaimed.sale.quantity * saleClaimed.sale.price) - {{(saleClaimed.sale.quantity * saleClaimed.sale.price) -
((saleClaimed.sale.discount * ((saleClaimed.sale.discount *
(saleClaimed.sale.quantity * saleClaimed.sale.price))/100) | currency:'€':2 (saleClaimed.sale.quantity * saleClaimed.sale.price))/100) | currency: 'EUR':2
}} }}
</vn-td> </vn-td>
<vn-td number> <vn-td number>
@ -138,10 +138,10 @@
<vn-td number>{{sale.landed | dateTime: 'dd/MM/yyyy'}}</vn-td> <vn-td number>{{sale.landed | dateTime: 'dd/MM/yyyy'}}</vn-td>
<vn-td number>{{sale.quantity}}</vn-td> <vn-td number>{{sale.quantity}}</vn-td>
<vn-td number>{{sale.concept}}</vn-td> <vn-td number>{{sale.concept}}</vn-td>
<vn-td number>{{sale.price | currency:'€':2}}</vn-td> <vn-td number>{{sale.price | currency: 'EUR':2}}</vn-td>
<vn-td number>{{sale.discount}} %</vn-td> <vn-td number>{{sale.discount}} %</vn-td>
<vn-td number> <vn-td number>
{{(sale.quantity * sale.price) - ((sale.discount * (sale.quantity * sale.price))/100) | currency:'€':2}} {{(sale.quantity * sale.price) - ((sale.discount * (sale.quantity * sale.price))/100) | currency: 'EUR':2}}
</vn-td> </vn-td>
</vn-tr> </vn-tr>
</vn-tbody> </vn-tbody>

View File

@ -1,5 +1,5 @@
<vn-main-block> <vn-main-block>
<div class="left-block"> <div class="left-menu">
<vn-claim-descriptor claim="$ctrl.claim"></vn-claim-descriptor> <vn-claim-descriptor claim="$ctrl.claim"></vn-claim-descriptor>
<vn-left-menu></vn-left-menu> <vn-left-menu></vn-left-menu>
</div> </div>

View File

@ -12,10 +12,10 @@
<vn-horizontal> <vn-horizontal>
<div class="totalBox"> <div class="totalBox">
<vn-label-value label="Total" <vn-label-value label="Total"
value="{{$ctrl.paidTotal | currency:'€':2}}"> value="{{$ctrl.paidTotal | currency: 'EUR':2}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Total claimed" <vn-label-value label="Total claimed"
value="{{$ctrl.claimedTotal | currency:'€':2}}"> value="{{$ctrl.claimedTotal | currency: 'EUR':2}}">
</vn-label-value> </vn-label-value>
</div> </div>
</vn-horizontal> </vn-horizontal>
@ -52,10 +52,10 @@
</vn-textfield> </vn-textfield>
</vn-td> </vn-td>
<vn-td>{{::saleClaimed.sale.concept}}</vn-td> <vn-td>{{::saleClaimed.sale.concept}}</vn-td>
<vn-td number>{{::saleClaimed.sale.price | currency:'€':2}}</vn-td> <vn-td number>{{::saleClaimed.sale.price | currency: 'EUR':2}}</vn-td>
<vn-td number>{{::saleClaimed.sale.discount}} %</vn-td> <vn-td number>{{::saleClaimed.sale.discount}} %</vn-td>
<vn-td number> <vn-td number>
{{::$ctrl.getSaleTotal(saleClaimed.sale) | currency:'€':2}} {{::$ctrl.getSaleTotal(saleClaimed.sale) | currency: 'EUR':2}}
</vn-td> </vn-td>
<vn-td number> <vn-td number>
<vn-icon-button <vn-icon-button
@ -104,10 +104,10 @@
<vn-td number>{{sale.landed | dateTime: 'dd/MM/yyyy'}}</vn-td> <vn-td number>{{sale.landed | dateTime: 'dd/MM/yyyy'}}</vn-td>
<vn-td number>{{sale.quantity}}</vn-td> <vn-td number>{{sale.quantity}}</vn-td>
<vn-td number>{{sale.concept}}</vn-td> <vn-td number>{{sale.concept}}</vn-td>
<vn-td number>{{sale.price | currency:'€':2}}</vn-td> <vn-td number>{{sale.price | currency: 'EUR':2}}</vn-td>
<vn-td number>{{sale.discount}} %</vn-td> <vn-td number>{{sale.discount}} %</vn-td>
<vn-td number> <vn-td number>
{{(sale.quantity * sale.price) - ((sale.discount * (sale.quantity * sale.price))/100) | currency:'€':2}} {{(sale.quantity * sale.price) - ((sale.discount * (sale.quantity * sale.price))/100) | currency: 'EUR':2}}
</vn-td> </vn-td>
</vn-tr> </vn-tr>
</vn-tbody> </vn-tbody>

View File

@ -6,7 +6,7 @@
data="claims" data="claims"
auto-load="false"> auto-load="false">
</vn-crud-model> </vn-crud-model>
<div class="index-block"> <div class="content-block">
<div class="vn-list"> <div class="vn-list">
<vn-card pad-medium-h> <vn-card pad-medium-h>
<vn-searchbar <vn-searchbar

View File

@ -1,4 +1,4 @@
<div pad-large style="min-width: 30em"> <div class="search-panel">
<form ng-submit="$ctrl.onSearch()"> <form ng-submit="$ctrl.onSearch()">
<vn-horizontal> <vn-horizontal>
<vn-textfield <vn-textfield

View File

@ -63,12 +63,12 @@
<vn-td number>{{saleClaimed.sale.quantity}}</vn-td> <vn-td number>{{saleClaimed.sale.quantity}}</vn-td>
<vn-td number>{{saleClaimed.quantity}}</vn-td> <vn-td number>{{saleClaimed.quantity}}</vn-td>
<vn-td>{{saleClaimed.sale.concept}}</vn-td> <vn-td>{{saleClaimed.sale.concept}}</vn-td>
<vn-td number>{{saleClaimed.sale.price | currency:'€':2}}</vn-td> <vn-td number>{{saleClaimed.sale.price | currency: 'EUR':2}}</vn-td>
<vn-td number>{{saleClaimed.sale.discount}} %</vn-td> <vn-td number>{{saleClaimed.sale.discount}} %</vn-td>
<vn-td number> <vn-td number>
{{(saleClaimed.sale.quantity * saleClaimed.sale.price) - {{(saleClaimed.sale.quantity * saleClaimed.sale.price) -
((saleClaimed.sale.discount * ((saleClaimed.sale.discount *
(saleClaimed.sale.quantity * saleClaimed.sale.price))/100) | currency:'€':2 (saleClaimed.sale.quantity * saleClaimed.sale.price))/100) | currency: 'EUR':2
}} }}
</vn-td> </vn-td>
</vn-tr> </vn-tr>
@ -138,7 +138,7 @@
<vn-td number> <vn-td number>
{{(action.sale.quantity * action.sale.price) - {{(action.sale.quantity * action.sale.price) -
((action.sale.discount * ((action.sale.discount *
(action.sale.quantity * action.sale.price))/100) | currency:'€':2 (action.sale.quantity * action.sale.price))/100) | currency: 'EUR':2
}} }}
</vn-td> </vn-td>
</vn-tr> </vn-tr>

View File

@ -7,7 +7,7 @@ describe('Client activeWorkersWithRole', () => {
let isSalesPerson = await app.models.Account.hasRole(result[0].id, 'salesPerson'); let isSalesPerson = await app.models.Account.hasRole(result[0].id, 'salesPerson');
expect(result.length).toEqual(10); expect(result.length).toEqual(11);
expect(isSalesPerson).toBeTruthy(); expect(isSalesPerson).toBeTruthy();
}); });

View File

@ -6,7 +6,7 @@ describe('Client listWorkers', () => {
.then(result => { .then(result => {
let amountOfEmployees = Object.keys(result).length; let amountOfEmployees = Object.keys(result).length;
expect(amountOfEmployees).toEqual(43); expect(amountOfEmployees).toEqual(44);
done(); done();
}) })
.catch(done.fail); .catch(done.fail);

View File

@ -1,5 +1,5 @@
<vn-main-block> <vn-main-block>
<div class="left-block"> <div class="left-menu">
<vn-client-descriptor client="$ctrl.client"></vn-client-descriptor> <vn-client-descriptor client="$ctrl.client"></vn-client-descriptor>
<vn-left-menu></vn-left-menu> <vn-left-menu></vn-left-menu>
</div> </div>

View File

@ -5,8 +5,8 @@
form="form" form="form"
save="post"> save="post">
</vn-watcher> </vn-watcher>
<form name="form" ng-submit="$ctrl.onSubmit()" margin-medium> <div class="content-block">
<div style="max-width: 50em; margin: 0 auto;"> <form name="form" ng-submit="$ctrl.onSubmit()" compact>
<vn-card pad-large> <vn-card pad-large>
<vn-horizontal> <vn-horizontal>
<vn-textfield vn-two label="Comercial Name" field="$ctrl.client.name" vn-focus></vn-textfield> <vn-textfield vn-two label="Comercial Name" field="$ctrl.client.name" vn-focus></vn-textfield>
@ -87,5 +87,5 @@
<vn-submit label="Create"></vn-submit> <vn-submit label="Create"></vn-submit>
<vn-button ui-sref="client.index" label="Cancel"></vn-button> <vn-button ui-sref="client.index" label="Cancel"></vn-button>
</vn-button-bar> </vn-button-bar>
</div> </form>
</form> </div>

View File

@ -18,7 +18,7 @@
</vn-thead> </vn-thead>
<vn-tbody> <vn-tbody>
<vn-tr ng-repeat="insurance in insurances"> <vn-tr ng-repeat="insurance in insurances">
<vn-td number>{{::insurance.credit | currency: '': 2}}</vn-td> <vn-td number>{{::insurance.credit | currency: 'EUR': 2}}</vn-td>
<vn-td number>{{::insurance.grade}}</vn-td> <vn-td number>{{::insurance.grade}}</vn-td>
<vn-td>{{::insurance.created | date: 'dd/MM/yyyy'}}</vn-td> <vn-td>{{::insurance.created | date: 'dd/MM/yyyy'}}</vn-td>
</vn-tr> </vn-tr>

View File

@ -27,10 +27,10 @@
value="{{$ctrl.client.phone | phone}}"> value="{{$ctrl.client.phone | phone}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Credit" <vn-label-value label="Credit"
value="{{$ctrl.client.credit | currency: '': 2}}"> value="{{$ctrl.client.credit | currency: 'EUR': 2}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Secured credit" <vn-label-value label="Secured credit"
value="{{$ctrl.client.creditInsurance | currency: '': 2}}"> value="{{$ctrl.client.creditInsurance | currency: 'EUR': 2}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Sales person" <vn-label-value label="Sales person"
value="{{$ctrl.client.salesPerson.user.nickname}}"> value="{{$ctrl.client.salesPerson.user.nickname}}">

View File

@ -15,7 +15,7 @@
<vn-horizontal> <vn-horizontal>
<div class="totalBox" ng-if="model.data.length > 0"> <div class="totalBox" ng-if="model.data.length > 0">
<vn-label-value label="Total" <vn-label-value label="Total"
value="{{edit.model.sumAmount | currency: '': 2}}"> value="{{edit.model.sumAmount | currency: 'EUR': 2}}">
</vn-label-value> </vn-label-value>
</div> </div>
</vn-horizontal> </vn-horizontal>
@ -33,7 +33,7 @@
<vn-tr ng-repeat="greuge in greuges"> <vn-tr ng-repeat="greuge in greuges">
<vn-td>{{::greuge.shipped | date:'dd/MM/yyyy HH:mm' }}</vn-td> <vn-td>{{::greuge.shipped | date:'dd/MM/yyyy HH:mm' }}</vn-td>
<vn-td>{{::greuge.description}}</vn-td> <vn-td>{{::greuge.description}}</vn-td>
<vn-td>{{::greuge.amount | currency: '': 2}}</vn-td> <vn-td>{{::greuge.amount | currency: 'EUR': 2}}</vn-td>
<vn-td>{{::greuge.greugeType.name}}</vn-td> <vn-td>{{::greuge.greugeType.name}}</vn-td>
</vn-tr> </vn-tr>
</vn-tbody> </vn-tbody>

View File

@ -6,7 +6,7 @@
data="clients" data="clients"
auto-load="false"> auto-load="false">
</vn-crud-model> </vn-crud-model>
<div class="index-block"> <div class="content-block">
<div class="vn-list"> <div class="vn-list">
<vn-card pad-medium-h> <vn-card pad-medium-h>
<vn-searchbar <vn-searchbar

View File

@ -32,7 +32,7 @@
</vn-td> </vn-td>
<vn-td>{{::recovery.started | date:'dd/MM/yyyy' }}</vn-td> <vn-td>{{::recovery.started | date:'dd/MM/yyyy' }}</vn-td>
<vn-td>{{recovery.finished | date:'dd/MM/yyyy' }}</vn-td> <vn-td>{{recovery.finished | date:'dd/MM/yyyy' }}</vn-td>
<vn-td>{{::recovery.amount | currency:' €': 0}}</vn-td> <vn-td>{{::recovery.amount | currency: 'EUR': 0}}</vn-td>
<vn-td>{{::recovery.period}}</vn-td> <vn-td>{{::recovery.period}}</vn-td>
</vn-tr> </vn-tr>
</vn-tbody> </vn-tbody>

View File

@ -34,7 +34,7 @@
<vn-auto ng-repeat="riskByCompany in riskTotal"> <vn-auto ng-repeat="riskByCompany in riskTotal">
<vn-label-value <vn-label-value
label="{{riskByCompany.company.code}}" label="{{riskByCompany.company.code}}"
value="{{riskByCompany.amount | currency:'€':2}}"> value="{{riskByCompany.amount | currency: 'EUR':2}}">
</vn-label-value> </vn-label-value>
</vn-auto> </vn-auto>
</div> </div>
@ -65,9 +65,9 @@
<span ng-show="risk.ref" translate>BILL</span> {{::risk.ref}} <span ng-show="risk.ref" translate>BILL</span> {{::risk.ref}}
</vn-td> </vn-td>
<vn-td number>{{::risk.bankFk}}</vn-td> <vn-td number>{{::risk.bankFk}}</vn-td>
<vn-td number>{{::risk.debit | currency:'€':2}}</vn-td> <vn-td number>{{::risk.debit | currency: 'EUR':2}}</vn-td>
<vn-td number>{{::risk.credit | currency:'€':2}}</vn-td> <vn-td number>{{::risk.credit | currency: 'EUR':2}}</vn-td>
<vn-td number>{{risk.balance | currency:'€':2}}</vn-td> <vn-td number>{{risk.balance | currency: 'EUR':2}}</vn-td>
<vn-td center> <vn-td center>
<vn-check <vn-check
field="risk.isConciliate" field="risk.isConciliate"

View File

@ -1,4 +1,4 @@
<div pad-large style="min-width: 30em"> <div class="search-panel">
<form ng-submit="$ctrl.onSearch()"> <form ng-submit="$ctrl.onSearch()">
<vn-horizontal> <vn-horizontal>
<vn-textfield <vn-textfield

View File

@ -149,16 +149,16 @@
<vn-one> <vn-one>
<h4 translate>Business data</h4> <h4 translate>Business data</h4>
<vn-label-value label="Total greuge" <vn-label-value label="Total greuge"
value="{{$ctrl.summary.totalGreuge | currency:'€':2}}"> value="{{$ctrl.summary.totalGreuge | currency: 'EUR':2}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Mana" <vn-label-value label="Mana"
value="{{$ctrl.summary.mana.mana | currency:'€':2}}"> value="{{$ctrl.summary.mana.mana | currency: 'EUR':2}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Rate" <vn-label-value label="Rate"
value="{{$ctrl.summary.claimsRatio[0].priceIncreasing | percentage}}"> value="{{$ctrl.summary.claimsRatio[0].priceIncreasing | percentage}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Average invoiced" <vn-label-value label="Average invoiced"
value="{{$ctrl.summary.averageInvoiced.invoiced | currency:'€':2}}"> value="{{$ctrl.summary.averageInvoiced.invoiced | currency: 'EUR':2}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Claims" <vn-label-value label="Claims"
value="{{$ctrl.summary.claimsRatio[0].claimingRate | percentage}}"> value="{{$ctrl.summary.claimsRatio[0].claimingRate | percentage}}">
@ -167,26 +167,26 @@
<vn-one> <vn-one>
<h4 translate>Financial information</h4> <h4 translate>Financial information</h4>
<vn-label-value label="Risk" <vn-label-value label="Risk"
value="{{$ctrl.summary.debt.debt | currency:'€':2}}" value="{{$ctrl.summary.debt.debt | currency: 'EUR':2}}"
ng-class="{alert: $ctrl.summary.debt.debt > $ctrl.summary.credit}" ng-class="{alert: $ctrl.summary.debt.debt > $ctrl.summary.credit}"
info="Invoices minus payments plus orders not yet invoiced"> info="Invoices minus payments plus orders not yet invoiced">
</vn-label-value> </vn-label-value>
<vn-label-value label="Credit" <vn-label-value label="Credit"
value="{{$ctrl.summary.credit | currency:'€':2 }} " value="{{$ctrl.summary.credit | currency: 'EUR':2 }} "
ng-class="{alert: $ctrl.summary.credit > $ctrl.summary.creditInsurance || ng-class="{alert: $ctrl.summary.credit > $ctrl.summary.creditInsurance ||
($ctrl.summary.credit && $ctrl.summary.creditInsurance == null)}" ($ctrl.summary.credit && $ctrl.summary.creditInsurance == null)}"
info="Verdnatura's maximum risk"> info="Verdnatura's maximum risk">
</vn-label-value> </vn-label-value>
<vn-label-value label="Secured credit" <vn-label-value label="Secured credit"
value="{{$ctrl.summary.creditInsurance | currency:'€':2}} ({{$ctrl.summary.classifications[0].insurances[0].grade}})" value="{{$ctrl.summary.creditInsurance | currency: 'EUR':2}} ({{$ctrl.summary.classifications[0].insurances[0].grade}})"
info="Solunion's maximum risk"> info="Solunion's maximum risk">
</vn-label-value> </vn-label-value>
<vn-label-value label="Balance" <vn-label-value label="Balance"
value="{{$ctrl.summary.sumRisk | currency:'€':2}}" value="{{$ctrl.summary.sumRisk | currency: 'EUR':2}}"
info="Invoices minus payments"> info="Invoices minus payments">
</vn-label-value> </vn-label-value>
<vn-label-value label="Balance due" <vn-label-value label="Balance due"
value="{{$ctrl.summary.defaulters[0].amount | currency:'€':2}}" value="{{$ctrl.summary.defaulters[0].amount | currency: 'EUR':2}}"
ng-class="{alert: $ctrl.summary.defaulters[0].amount}" ng-class="{alert: $ctrl.summary.defaulters[0].amount}"
info="Deviated invoices minus payments"> info="Deviated invoices minus payments">
</vn-label-value> </vn-label-value>

View File

@ -33,7 +33,7 @@
</vn-icon> </vn-icon>
</vn-td> </vn-td>
<vn-td>{{::transaction.id}}</vn-td> <vn-td>{{::transaction.id}}</vn-td>
<vn-td number>{{::transaction.amount | currency: '':2}}</vn-td> <vn-td number>{{::transaction.amount | currency: 'EUR':2}}</vn-td>
<vn-td>{{::transaction.created | dateTime:'dd/MM/yyyy'}}</vn-td> <vn-td>{{::transaction.created | dateTime:'dd/MM/yyyy'}}</vn-td>
<vn-td style="width: 3em; text-align: center"> <vn-td style="width: 3em; text-align: center">
<vn-icon-button <vn-icon-button

View File

@ -1,7 +1,7 @@
const app = require('vn-loopback/server/server'); const app = require('vn-loopback/server/server');
describe('item getLastEntries()', () => { describe('item getLastEntries()', () => {
it('should return one entry for a given item', async () => { it('should return one entry for a given item', async() => {
let date = new Date(); let date = new Date();
let filter = {where: {itemFk: 1, date: date}}; let filter = {where: {itemFk: 1, date: date}};
let result = await app.models.Item.getLastEntries(filter); let result = await app.models.Item.getLastEntries(filter);
@ -9,9 +9,10 @@ describe('item getLastEntries()', () => {
expect(result.length).toEqual(1); expect(result.length).toEqual(1);
}); });
it('should return three entries for a given item', async () => { it('should return three entries for a given item', async() => {
let date = new Date(); let date = new Date();
date.setMonth(date.getMonth() - 2);
date.setMonth(date.getMonth() - 2, 15);
let filter = {where: {itemFk: 1, date: date}}; let filter = {where: {itemFk: 1, date: date}};
let result = await app.models.Item.getLastEntries(filter); let result = await app.models.Item.getLastEntries(filter);

View File

@ -3,6 +3,12 @@ let UserError = require('vn-loopback/util/user-error');
module.exports = Self => { module.exports = Self => {
require('../methods/item-tag/filterItemTags')(Self); require('../methods/item-tag/filterItemTags')(Self);
Self.rewriteDbError(function(err) {
if (err.code === 'ER_BAD_NULL_ERROR')
return new UserError(`Tag value cannot be blank`);
return err;
});
Self.rewriteDbError(function(err) { Self.rewriteDbError(function(err) {
if (err.code === 'ER_DUP_ENTRY') if (err.code === 'ER_DUP_ENTRY')
return new UserError(`The tag can't be repeated`); return new UserError(`The tag can't be repeated`);

View File

@ -1,5 +1,5 @@
<vn-main-block> <vn-main-block>
<div class="left-block"> <div class="left-menu">
<vn-item-descriptor item="$ctrl.item"></vn-item-descriptor> <vn-item-descriptor item="$ctrl.item"></vn-item-descriptor>
<vn-left-menu></vn-left-menu> <vn-left-menu></vn-left-menu>
</div> </div>

View File

@ -5,8 +5,8 @@
form="form" form="form"
save="post"> save="post">
</vn-watcher> </vn-watcher>
<form name="form" ng-submit="$ctrl.onSubmit()" margin-medium> <div class="content-block">
<div compact> <form name="form" ng-submit="$ctrl.onSubmit()" compact>
<vn-card pad-large> <vn-card pad-large>
<vn-horizontal> <vn-horizontal>
<vn-textfield <vn-textfield
@ -61,5 +61,5 @@
>Cancel >Cancel
</button> </button>
</vn-button-bar> </vn-button-bar>
</div> </form>
</form> </div>

View File

@ -6,7 +6,7 @@
data="items" data="items"
auto-load="false"> auto-load="false">
</vn-crud-model> </vn-crud-model>
<div class="index-block"> <div class="content-block">
<div class="vn-list"> <div class="vn-list">
<vn-card pad-medium-h> <vn-card pad-medium-h>
<vn-searchbar <vn-searchbar

View File

@ -34,6 +34,7 @@ Add barcode: Añadir código de barras
Remove barcode: Quitar código de barras Remove barcode: Quitar código de barras
Buyer: Comprador Buyer: Comprador
No results: Sin resultados No results: Sin resultados
Enter a new search: Introduce una nueva búsqueda
Tag: Etiqueta Tag: Etiqueta
Worker: Trabajador Worker: Trabajador
Available: Disponible Available: Disponible
@ -46,14 +47,16 @@ Density: Densidad
# Sections # Sections
Items: Artículos Items: Artículos
List: Listado
New item: Nuevo artículo New item: Nuevo artículo
Summary: Vista previa
Basic data: Datos básicos Basic data: Datos básicos
Tax: IVA Tax: IVA
History: Historial History: Historial
Niches: Nichos Niches: Nichos
Botanical: Botánico Botanical: Botánico
Barcodes: Códigos de barras Barcodes: Códigos de barras
Diary: Registro Diary: Histórico
Item diary: Registro de compra-venta Item diary: Registro de compra-venta
Last entries: Últimas entradas Last entries: Últimas entradas
Tags: Etiquetas Tags: Etiquetas

View File

@ -1,6 +1,6 @@
<mg-ajax path="/item/api/Tags" options="mgIndex as tags"></mg-ajax> <mg-ajax path="/item/api/Tags" options="mgIndex as tags"></mg-ajax>
<div style="min-width: 30em; max-height: 540px; overflow: auto;"> <div class="search-panel">
<form pad-large ng-submit="$ctrl.onSearch()"> <form ng-submit="$ctrl.onSearch()">
<vn-horizontal> <vn-horizontal>
<vn-textfield <vn-textfield
vn-one vn-one

View File

@ -1,5 +1,5 @@
<vn-main-block> <vn-main-block>
<div class="left-block"> <div class="left-menu">
<vn-order-descriptor order="$ctrl.order"></vn-order-descriptor> <vn-order-descriptor order="$ctrl.order"></vn-order-descriptor>
<vn-left-menu></vn-left-menu> <vn-left-menu></vn-left-menu>
</div> </div>

View File

@ -5,105 +5,101 @@
limit="50" limit="50"
data="items" on-data-change="$ctrl.onDataChange()" > data="items" on-data-change="$ctrl.onDataChange()" >
</vn-crud-model> </vn-crud-model>
<vn-horizontal> <div class="items">
<vn-vertical vn-one> <vn-card>
<vn-card> <vn-horizontal class="catalog-header" pad-medium-h>
<vn-vertical> <vn-one ng-if="model.moreRows">
<vn-horizontal class="catalog-header" pad-medium-h> <span translate>More than</span> {{model.limit}} <span translate>results</span>
<vn-one ng-if="model.moreRows"> </vn-one>
<span translate>More than</span> {{model.limit}} <span translate>results</span></vn-one> <vn-one>
<vn-one> <vn-horizontal>
<vn-horizontal> <vn-autocomplete vn-id="field" vn-one
<vn-autocomplete vn-id="field" vn-one data="$ctrl.fieldList"
data="$ctrl.fieldList" initial-data="$ctrl.field"
initial-data="$ctrl.field" field="$ctrl.field"
field="$ctrl.field" translate-fields="['name']"
translate-fields="['name']" show-field="name"
show-field="name" value-field="field"
value-field="field" label="Order by">
label="Order by"> </vn-autocomplete>
</vn-autocomplete> <vn-autocomplete vn-one
<vn-autocomplete vn-one data="$ctrl.wayList"
data="$ctrl.wayList" initial-data="$ctrl.way"
initial-data="$ctrl.way" field="$ctrl.way"
field="$ctrl.way" translate-fields="['name']"
translate-fields="['name']" show-field="name"
show-field="name" value-field="way"
value-field="way" label="Order">
label="Order"> </vn-autocomplete>
</vn-autocomplete>
</vn-horizontal>
</vn-one>
</vn-horizontal> </vn-horizontal>
<vn-horizontal class="catalog-list" pad-small> </vn-one>
<section class="product" ng-repeat="item in items"> </vn-horizontal>
<vn-one> <vn-horizontal class="catalog-list" pad-small>
<vn-horizontal> <section class="product" ng-repeat="item in items">
<vn-one class="image"> <vn-one>
<img <vn-horizontal>
ng-src="//verdnatura.es/vn-image-data/catalog/200x200/{{::item.image}}" <vn-one class="image">
zoom-image="//verdnatura.es/vn-image-data/catalog/1600x900/{{::item.image}}" <img
on-error-src pointer/> ng-src="//verdnatura.es/vn-image-data/catalog/200x200/{{::item.image}}"
</vn-one> zoom-image="//verdnatura.es/vn-image-data/catalog/1600x900/{{::item.image}}"
<vn-one pad-small class="description ellipsize"> on-error-src pointer/>
<vn-vertical>
<h2 class="ellipsize" vn-tooltip="{{::item.name}}">
{{::item.name}}
</h2>
<span class="ellipsize" vn-tooltip="{{::item.subName}}">
{{::item.subName}}
</span>
<vn-label-value
label="{{::item.tag5}}"
value="{{::item.value5}}">
</vn-label-value>
<vn-label-value
label="{{::item.tag6}}"
value="{{::item.value6}}">
</vn-label-value>
<vn-label-value
label="{{::item.tag7}}"
value="{{::item.value7}}">
</vn-label-value>
<vn-label-value
label="{{::item.tag8}}"
value="{{::item.value8}}">
</vn-label-value>
<vn-horizontal class="price">
<vn-one>
<span>{{::item.available}}</span>
<span translate>from</span>
<span>{{::item.price | currency: ' €': 2}}</span>
</vn-one>
<vn-auto>
<a href="" vn-tooltip="Add">
<vn-icon icon="add_circle" ng-click="$ctrl.preview($event, item)"></vn-icon>
</a>
</vn-auto>
</vn-horizontal>
</vn-vertical>
</vn-one>
</vn-horizontal>
</vn-one> </vn-one>
</section> <vn-one pad-small class="description ellipsize">
</vn-horizontal> <vn-vertical>
<vn-horizontal ng-if="!model.data || model.data.length == 0"> <h2 class="ellipsize" vn-tooltip="{{::item.name}}">
<vn-one pad-small translate style="text-align: center"> {{::item.name}}
No results </h2>
</vn-one> <span class="ellipsize" vn-tooltip="{{::item.subName}}">
</vn-horizontal> {{::item.subName}}
</vn-vertical> </span>
</vn-card>
<vn-pagination margin-small-v model="model"></vn-pagination>
</vn-vertical>
<vn-auto class="right-block"> <vn-label-value
<vn-catalog-filter order="$ctrl.order"></vn-catalog-filter> label="{{::item.tag5}}"
</vn-auto> value="{{::item.value5}}">
</vn-horizontal> </vn-label-value>
<vn-label-value
label="{{::item.tag6}}"
value="{{::item.value6}}">
</vn-label-value>
<vn-label-value
label="{{::item.tag7}}"
value="{{::item.value7}}">
</vn-label-value>
<vn-label-value
label="{{::item.tag8}}"
value="{{::item.value8}}">
</vn-label-value>
<vn-horizontal class="price">
<vn-one>
<span>{{::item.available}}</span>
<span translate>from</span>
<span>{{::item.price | currency: 'EUR': 2}}</span>
</vn-one>
<vn-auto>
<a href="" vn-tooltip="Add">
<vn-icon icon="add_circle" ng-click="$ctrl.preview($event, item)"></vn-icon>
</a>
</vn-auto>
</vn-horizontal>
</vn-vertical>
</vn-one>
</vn-horizontal>
</vn-one>
</section>
</vn-horizontal>
<vn-horizontal ng-if="!model.data || model.data.length == 0">
<vn-one pad-small translate style="text-align: center">
No results
</vn-one>
</vn-horizontal>
</vn-card>
<vn-pagination margin-small-v model="model"></vn-pagination>
</div>
<vn-catalog-filter
class="right-menu"
order="$ctrl.order">
</vn-catalog-filter>
<vn-order-prices-popover <vn-order-prices-popover
vn-id="pricesPopover" vn-id="pricesPopover"
order="$ctrl.order"> order="$ctrl.order">

View File

@ -125,5 +125,5 @@ ngModule.component('vnOrderCatalog', {
controller: Controller, controller: Controller,
bindings: { bindings: {
order: '<', order: '<',
}, }
}); });

View File

@ -8,13 +8,18 @@ vn-order-catalog {
vn-one:first-child { vn-one:first-child {
padding-top: 2em; padding-top: 2em;
} }
vn-one:nth-child(2) { vn-one:nth-child(2) {
padding-top: 0.5em; padding-top: 0.5em;
} }
span { span {
color: $secondary-font-color color: $secondary-font-color
} }
} }
& > .items {
padding-right: 16em;
@media screen and (max-width: 800px) {
padding-right: 0;
}
}
} }

View File

@ -1,5 +1,5 @@
<div margin-medium> <div class="content-block">
<div style="max-width: 70em; margin: 0 auto;" > <div compact>
<vn-card pad-large> <vn-card pad-large>
<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>

View File

@ -35,7 +35,7 @@
value="{{$ctrl.order.rows.length || 0}}"> value="{{$ctrl.order.rows.length || 0}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Total" <vn-label-value label="Total"
value="{{$ctrl.order.total | currency: '': 2}}"> value="{{$ctrl.order.total | currency: 'EUR': 2}}">
</vn-label-value> </vn-label-value>
</div> </div>
<div class="quicklinks"> <div class="quicklinks">

View File

@ -1,101 +1,93 @@
<vn-crud-model <vn-crud-model
vn-id="model" vn-id="model"
url="/order/api/ItemCategories" url="/order/api/ItemCategories"
data="categories" auto-load="true"> data="categories"
auto-load="true">
</vn-crud-model> </vn-crud-model>
<vn-horizontal> <div>
<vn-vertical vn-one> <vn-horizontal class="item-category">
<vn-card > <vn-one ng-repeat="category in categories">
<vn-vertical> <vn-icon
<vn-horizontal pad-medium class="item-category"> ng-class="{'active': $ctrl.category.id == category.id}"
<vn-one margin-small-v ng-repeat="category in categories"> icon="{{::category.icon}}"
<vn-icon vn-tooltip="{{::category.name}}"
ng-class="{'active': $ctrl.category.id == category.id}" ng-click="$ctrl.category = {
pad-small id: category.id,
icon="{{::category.icon}}" value: category.name
vn-tooltip="{{::category.name}}" }">
ng-click="$ctrl.category = { </vn-icon>
id: category.id, </vn-one>
value: category.name </vn-horizontal>
}"> <vn-horizontal class="input">
</vn-icon> <vn-autocomplete
</vn-one> vn-one
</vn-horizontal> vn-id="type"
<vn-horizontal pad-medium class="catalog-header"> data="$ctrl.itemTypes"
<vn-autocomplete vn-one on-change="$ctrl.type = {
vn-id="type" id: value,
data="$ctrl.itemTypes" value: type.selection.name
on-change="$ctrl.type = { }"
id: value, field="$ctrl.type.id"
value: type.selection.name show-field="name"
}" value-field="id"
field="$ctrl.type.id" label="Type">
show-field="name" <t-left-icons>
value-field="id" <i class="material-icons">search</i>
label="Type"> </t-left-icons>
<t-left-icons> <t-right-icons>
<i class="material-icons">search</i> <i class="material-icons"
</t-left-icons> ng-click="$ctrl.openPanel($event)"
<t-right-icons> style="cursor: pointer; color: #aaa">
<i class="material-icons" keyboard_arrow_down
ng-click="$ctrl.openPanel($event)" </i>
style="cursor: pointer; color: #aaa"> </t-right-icons>
keyboard_arrow_down </vn-autocomplete>
</i> </vn-horizontal>
</t-right-icons> <vn-horizontal class="input">
</vn-autocomplete> <vn-textfield
</vn-horizontal> vn-one
vn-id="search"
<vn-horizontal pad-medium class="catalog-header"> ng-keyUp="$ctrl.onSearch($event)"
<vn-one> label="Search tag"
<vn-textfield model="$ctrl.value">
vn-id="search" <t-left-icons>
ng-keyUp="$ctrl.onSearch($event)" <i class="material-icons">search</i>
label="Search tag" </t-left-icons>
model="$ctrl.value"> <t-right-icons>
<t-left-icons> <i class="material-icons"
<i class="material-icons">search</i> ng-click="$ctrl.openPanel($event)"
</t-left-icons> style="cursor: pointer; color: #aaa">
<t-right-icons> keyboard_arrow_down
<i class="material-icons" </i>
ng-click="$ctrl.openPanel($event)" </t-right-icons>
style="cursor: pointer; color: #aaa"> </vn-textfield>
keyboard_arrow_down </vn-horizontal>
</i> <vn-popover
</t-right-icons> vn-id="popover"
</vn-textfield> on-close="$ctrl.onPopoverClose()">
<vn-order-catalog-search-panel/>
<vn-popover </vn-popover>
vn-id="popover" <vn-horizontal class="chips" style="flex-wrap: wrap">
on-close="$ctrl.onPopoverClose()"> <vn-chip
<vn-order-catalog-search-panel/> ng-if="$ctrl.category"
</vn-popover> vn-tooltip="Category"
</vn-one> on-remove="$ctrl.category = null"
</vn-horizontal> ellipsize>
<span translate>{{$ctrl.category.value}}</span>
<vn-horizontal pad-medium style="flex-wrap: wrap"> </vn-chip>
<vn-chip <vn-chip
ng-if="$ctrl.category" ng-if="$ctrl.type"
vn-tooltip="Category" vn-tooltip="Type"
on-remove="$ctrl.category = null" ellipsize> on-remove="$ctrl.type = null"
<span translate>{{$ctrl.category.value}}</span> ellipsize>
</vn-chip> <span translate>{{$ctrl.type.value}}</span>
</vn-chip>
<vn-chip <vn-chip
ng-if="$ctrl.type" ng-repeat="tag in $ctrl.tags"
vn-tooltip="Type" vn-tooltip="Value"
on-remove="$ctrl.type = null" ellipsize> on-remove="$ctrl.remove($index)"
<span translate>{{$ctrl.type.value}}</span> ellipsize>
</vn-chip> <span translate>{{::tag.value}}</span>
</vn-chip>
<vn-chip </vn-horizontal>
ng-repeat="tag in $ctrl.tags" </div>
vn-tooltip="Value"
on-remove="$ctrl.remove($index)" ellipsize>
<span translate>{{::tag.value}}</span>
</vn-chip>
</vn-horizontal>
</vn-vertical>
</vn-card>
</vn-vertical>
</vn-horizontal>

View File

@ -2,7 +2,8 @@ import ngModule from '../module';
import './style.scss'; import './style.scss';
class Controller { class Controller {
constructor($http, $scope, $state, $compile, $transitions, $window) { constructor($element, $http, $scope, $state, $compile, $transitions) {
this.$element = $element;
this.$http = $http; this.$http = $http;
this.$scope = $scope; this.$scope = $scope;
this.$state = $state; this.$state = $state;
@ -13,6 +14,14 @@ class Controller {
this.tags = []; this.tags = [];
} }
$onInit() {
this.app.rightMenu = this.$element[0];
}
$onDestroy() {
this.app.rightMenu = null;
}
get order() { get order() {
return this._order; return this._order;
} }
@ -159,15 +168,16 @@ class Controller {
} }
} }
Controller.$inject = ['$http', '$scope', '$state', '$compile', '$transitions', '$window']; Controller.$inject = ['$element', '$http', '$scope', '$state', '$compile', '$transitions'];
ngModule.component('vnCatalogFilter', { ngModule.component('vnCatalogFilter', {
template: require('./index.html'), template: require('./index.html'),
controller: Controller, controller: Controller,
require: { require: {
catalog: '^vnOrderCatalog', catalog: '^vnOrderCatalog',
app: '^vnApp'
}, },
bindings: { bindings: {
order: '<', order: '<',
}, }
}); });

View File

@ -17,7 +17,7 @@ describe('Order', () => {
$state.params.category = '{"id": 1, "value": "My Category"}'; $state.params.category = '{"id": 1, "value": "My Category"}';
$state.params.type = '{"id": 1, "value": "My type"}'; $state.params.type = '{"id": 1, "value": "My type"}';
$state.current.name = 'my.current.state'; $state.current.name = 'my.current.state';
controller = $componentController('vnCatalogFilter', {$scope, $state}); controller = $componentController('vnCatalogFilter', {$element: null, $scope, $state});
controller.catalog = { controller.catalog = {
$scope: $scope, $scope: $scope,
getOrderBy: () => { getOrderBy: () => {

View File

@ -1,31 +1,44 @@
@import "colors"; @import "colors";
@import "padding";
vn-catalog-filter { vn-catalog-filter > div {
& > .input {
@extend .pad-medium-h;
border-color: $lines;
border-bottom: 1px solid rgba($lines, 0.5);
}
.item-category { .item-category {
@extend .pad-small;
justify-content: flex-start; justify-content: flex-start;
align-items: flex-start; align-items: flex-start;
flex-wrap: wrap; flex-wrap: wrap;
vn-icon { & > vn-one {
background-color: $secondary-font-color; @extend .pad-small;
border-radius: 50%; min-width: 33.33%;
cursor: pointer; text-align: center;
box-sizing: border-box;
i:before { & > vn-icon {
font-size: 32pt; @extend .pad-small;
width: 1em; background-color: $secondary-font-color;
height: 1em; border-radius: 50%;
cursor: pointer;
&.active {
background-color: $main-01;
color: #FFF
}
& > i:before {
font-size: 32pt;
width: 1em;
height: 1em;
}
} }
} }
}
vn-icon.active { .chips {
background-color: $main-01; flex-wrap: wrap;
color: #FFF @extend .pad-medium;
}
& > vn-one {
width: 33.33%;
text-align: center
}
} }
} }

View File

@ -5,7 +5,7 @@
limit="20" limit="20"
data="orders" auto-load="false"> data="orders" auto-load="false">
</vn-crud-model> </vn-crud-model>
<div class="index-block"> <div class="content-block">
<div class="vn-list"> <div class="vn-list">
<vn-card pad-medium-h> <vn-card pad-medium-h>
<vn-searchbar auto-load="false" <vn-searchbar auto-load="false"

View File

@ -8,13 +8,13 @@
<vn-horizontal> <vn-horizontal>
<div class="totalBox"> <div class="totalBox">
<vn-label translate>Subtotal</vn-label> <vn-label translate>Subtotal</vn-label>
<span>{{$ctrl.subtotal | currency:'€':2}}</span> <span>{{$ctrl.subtotal | currency: 'EUR':2}}</span>
<p> <p>
<vn-label translate>VAT</vn-label> <vn-label translate>VAT</vn-label>
<span>{{$ctrl.VAT | currency:'€':2}}</span> <span>{{$ctrl.VAT | currency: 'EUR':2}}</span>
</p> </p>
<vn-label><strong>Total</strong></vn-label> <vn-label><strong>Total</strong></vn-label>
<strong>{{$ctrl.order.total | currency:'€':2}}</strong> <strong>{{$ctrl.order.total | currency: 'EUR':2}}</strong>
</div> </div>
</vn-horizontal> </vn-horizontal>
<vn-table> <vn-table>
@ -49,7 +49,7 @@
<vn-td>{{row.shipped | date: 'dd/MM/yyyy'}}</vn-td> <vn-td>{{row.shipped | date: 'dd/MM/yyyy'}}</vn-td>
<vn-td number>{{row.quantity}}</vn-td> <vn-td number>{{row.quantity}}</vn-td>
<vn-td number> <vn-td number>
{{row.price | currency:'€':2}} {{row.price | currency: 'EUR':2}}
</vn-td> </vn-td>
<vn-td ng-if="!$ctrl.order.isConfirmed"> <vn-td ng-if="!$ctrl.order.isConfirmed">
<vn-icon-button <vn-icon-button

View File

@ -3,12 +3,19 @@ Catalog: Catálogo
from: desde from: desde
results: resultados results: resultados
More than: Más de More than: Más de
No results: Sin resultados
Enter a new search: Introduce una nueva búsqueda
Plant: Planta Plant: Planta
Flower: Flor Flower: Flor
Handmade: Confección Handmade: Confección
Green: Verde Green: Verde
Lines: Lineas
Accessories: Complemento Accessories: Complemento
Category: Reino Category: Reino
Search tag: Buscar etiqueta Search tag: Buscar etiqueta
Order by: Ordenar por
Order: Orden
Price: Precio Price: Precio
Ascendant: Ascendente
Descendant: Descendente
Created from: Creado desde Created from: Creado desde

View File

@ -1,6 +1,6 @@
<vn-popover vn-id="popover" on-close="$ctrl.clear()"> <vn-popover vn-id="popover" on-close="$ctrl.clear()">
<vn-card class="vn-descriptor"> <div class="vn-descriptor">
<vn-horizontal class="header"> <div class="header">
<a translate-attr="{title: 'Return to module index'}" ui-sref="item.index"> <a translate-attr="{title: 'Return to module index'}" ui-sref="item.index">
<vn-icon icon="chevron_left"></vn-icon> <vn-icon icon="chevron_left"></vn-icon>
</a> </a>
@ -8,7 +8,7 @@
<a translate-attr="{title: 'Preview'}" ui-sref="item.card.summary({id: $ctrl.item.id})"> <a translate-attr="{title: 'Preview'}" ui-sref="item.card.summary({id: $ctrl.item.id})">
<vn-icon icon="desktop_windows"></vn-icon> <vn-icon icon="desktop_windows"></vn-icon>
</a> </a>
</vn-horizontal> </div>
<div pad-medium> <div pad-medium>
<vn-horizontal> <vn-horizontal>
<h5>{{$ctrl.item.id}}</h5> <h5>{{$ctrl.item.id}}</h5>
@ -39,7 +39,7 @@
ng-repeat="price in $ctrl.prices"> ng-repeat="price in $ctrl.prices">
<vn-one class="ellipsize text" title="{{::price.warehouse}}">{{::price.warehouse}}</vn-one> <vn-one class="ellipsize text" title="{{::price.warehouse}}">{{::price.warehouse}}</vn-one>
<vn-one class="number text"> <vn-one class="number text">
<span orange ng-click="$ctrl.addQuantity(price)" class="link unselectable">{{::price.grouping}}</span><span> x {{::price.price | currency: '': 2}}</span> <span orange ng-click="$ctrl.addQuantity(price)" class="link unselectable">{{::price.grouping}}</span><span> x {{::price.price | currency: 'EUR': 2}}</span>
</vn-one> </vn-one>
<vn-one> <vn-one>
<vn-input-number <vn-input-number
@ -59,12 +59,32 @@
</vn-vertical> </vn-vertical>
</vn-horizontal> </vn-horizontal>
<vn-horizontal class="buttons-bar"> <vn-horizontal class="buttons-bar">
<vn-one <div class="quicklinks" vn-one>
vn-tooltip="Last entries" <a ng-if="$ctrl.quicklinks.btnOne"
tooltip-position="down"> vn-tooltip="{{::$ctrl.quicklinks.btnOne.tooltip}}"
<vn-button ui-sref="item.card.diary({id: $ctrl.item.id})" icon="icon-transaction"> ui-sref="{{::$ctrl.quicklinks.btnOne.state}}" target="_blank">
</vn-button> <vn-icon
</vn-one> class="mdl-button mdl-js-button mdl-button--colored"
icon="{{::$ctrl.quicklinks.btnOne.icon}}">
</vn-icon>
</a>
<a ng-if="$ctrl.quicklinks.btnTwo"
vn-tooltip="{{::$ctrl.quicklinks.btnTwo.tooltip}}"
ui-sref="{{::$ctrl.quicklinks.btnTwo.state}}" target="_blank">
<vn-icon
class="mdl-button mdl-js-button mdl-button--colored"
icon="{{::$ctrl.quicklinks.btnTwo.icon}}">
</vn-icon>
</a>
<a ng-if="$ctrl.quicklinks.btnThree"
vn-tooltip="{{::$ctrl.quicklinks.btnThree.tooltip}}"
ui-sref="{{::$ctrl.quicklinks.btnThree.state}}" target="_blank">
<vn-icon
class="mdl-button mdl-js-button mdl-button--colored"
icon="{{::$ctrl.quicklinks.btnThree.icon}}">
</vn-icon>
</a>
</div>
<vn-one> <vn-one>
<vn-submit <vn-submit
label="Save" label="Save"
@ -73,5 +93,5 @@
</vn-one> </vn-one>
</vn-horizontal> </vn-horizontal>
</div> </div>
</vn-card> </div>
</vn-popover> </vn-popover>

View File

@ -26,6 +26,13 @@ class Controller {
order: 'priority ASC', order: 'priority ASC',
include: {relation: 'tag'} include: {relation: 'tag'}
}; };
this.quicklinks = {
btnOne: {
icon: 'icon-transaction',
state: `item.card.diary({id: ${this.item.id}})`,
tooltip: 'Diary'
}
};
this.$http.get(`/item/api/ItemTags?filter=${JSON.stringify(filter)}`).then(response => { this.$http.get(`/item/api/ItemTags?filter=${JSON.stringify(filter)}`).then(response => {
this.tags = response.data; this.tags = response.data;
}); });

View File

@ -44,11 +44,17 @@ vn-order-prices-popover {
vn-one.text{ vn-one.text{
padding-top:10px!important; padding-top:10px!important;
} }
vn-horizontal.buttons-bar{ vn-horizontal.buttons-bar{
padding-top: 16px; padding-top: 16px;
text-align: center; text-align: center;
} }
.quicklinks vn-icon {
font-size: 1.8em !important;
padding: 0 !important;
& > i {
line-height: 36px
}
}
vn-one.error{ vn-one.error{
display: none; display: none;
} }

View File

@ -1,4 +1,4 @@
<div pad-large style="min-width: 30em"> <div class="search-panel">
<form ng-submit="$ctrl.onSearch()"> <form ng-submit="$ctrl.onSearch()">
<vn-horizontal> <vn-horizontal>
<vn-textfield <vn-textfield

View File

@ -34,9 +34,9 @@
</vn-label-value> </vn-label-value>
</vn-one> </vn-one>
<vn-one class="taxes"> <vn-one class="taxes">
<p><vn-label translate>Subtotal</vn-label> {{$ctrl.summary.subTotal | currency:' €':2}}</p> <p><vn-label translate>Subtotal</vn-label> {{$ctrl.summary.subTotal | currency: 'EUR':2}}</p>
<p><vn-label translate>VAT</vn-label> {{$ctrl.summary.VAT | currency:' €':2}}</p> <p><vn-label translate>VAT</vn-label> {{$ctrl.summary.VAT | currency: 'EUR':2}}</p>
<p><vn-label><strong>Total</strong></vn-label> <strong>{{$ctrl.summary.total | currency:' €':2}}</strong></p> <p><vn-label><strong>Total</strong></vn-label> <strong>{{$ctrl.summary.total | currency: 'EUR':2}}</strong></p>
</vn-one> </vn-one>
<vn-auto> <vn-auto>
<table class="vn-grid"> <table class="vn-grid">
@ -70,8 +70,8 @@
</td> </td>
<td><vn-fetched-tags max-length="6" item="row.item"/></td> <td><vn-fetched-tags max-length="6" item="row.item"/></td>
<td number>{{::row.quantity}}</td> <td number>{{::row.quantity}}</td>
<td number>{{::row.price | currency:'€':2}}</td> <td number>{{::row.price | currency: 'EUR':2}}</td>
<td number>{{::row.quantity * row.price | currency:'€':2}}</td> <td number>{{::row.quantity * row.price | currency: 'EUR':2}}</td>
</tr> </tr>
<tr ng-if="!$ctrl.summary.rows" class="list list-element"> <tr ng-if="!$ctrl.summary.rows" class="list list-element">
<td colspan="8" style="text-align: center" translate>No results</td> <td colspan="8" style="text-align: center" translate>No results</td>

View File

@ -1,5 +1,5 @@
<vn-main-block> <vn-main-block>
<div class="left-block"> <div class="left-menu">
<vn-ticket-descriptor ticket="$ctrl.ticket"></vn-ticket-descriptor> <vn-ticket-descriptor ticket="$ctrl.ticket"></vn-ticket-descriptor>
<vn-left-menu></vn-left-menu> <vn-left-menu></vn-left-menu>
</div> </div>

View File

@ -24,17 +24,17 @@
<tfoot> <tfoot>
<tr> <tr>
<td number colspan="7"> <td number colspan="7">
<span translate>Base</span> {{$ctrl.base() | currency:'€':3}} <span translate>Base</span> {{$ctrl.base() | currency: 'EUR':3}}
</td> </td>
</tr> </tr>
<tr> <tr>
<td number colspan="7"> <td number colspan="7">
<span translate>Margin</span> {{$ctrl.profitMargin() | currency:'€':3}} <span translate>Margin</span> {{$ctrl.profitMargin() | currency: 'EUR':3}}
</td> </td>
</tr> </tr>
<tr> <tr>
<td number colspan="7"> <td number colspan="7">
<span translate>Total</span> {{$ctrl.total() | currency:'€':3}} <span translate>Total</span> {{$ctrl.total() | currency: 'EUR':3}}
</td> </td>
</tr> </tr>
</tfoot> </tfoot>
@ -66,10 +66,10 @@
}">{{::component.componentRate.name}}</td> }">{{::component.componentRate.name}}</td>
<td ng-class="::{ <td ng-class="::{
first: $index == 0,last: $index == sale.components.length - 1 first: $index == 0,last: $index == sale.components.length - 1
}" number>{{::component.value | currency:'€':3}}</td> }" number>{{::component.value | currency: 'EUR':3}}</td>
<td ng-class="::{ <td ng-class="::{
first: $index == 0,last: $index == sale.components.length - 1 first: $index == 0,last: $index == sale.components.length - 1
}" number>{{::sale.quantity * component.value | currency:'€':3}}</td> }" number>{{::sale.quantity * component.value | currency: 'EUR':3}}</td>
</tr> </tr>
<tr ng-if="model.data.length === 0" class="list list-element"> <tr ng-if="model.data.length === 0" class="list list-element">
<td colspan="7" style="text-align: center" translate>No results</td> <td colspan="7" style="text-align: center" translate>No results</td>

View File

@ -1,5 +1,5 @@
<div margin-medium> <div class="content-block">
<div style="max-width: 70em; margin: 0 auto;" > <div compact>
<vn-card pad-large> <vn-card pad-large>
<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>

View File

@ -17,17 +17,17 @@
<td number>{{("000000"+sale.itemFk).slice(-6)}}</td> <td number>{{("000000"+sale.itemFk).slice(-6)}}</td>
<td><vn-fetched-tags max-length="6" item="sale.item"/></td> <td><vn-fetched-tags max-length="6" item="sale.item"/></td>
<td number>{{::sale.quantity}}</td> <td number>{{::sale.quantity}}</td>
<td number>{{::sale.price | currency: '': 2}}</td> <td number>{{::sale.price | currency: 'EUR': 2}}</td>
<td number>{{::sale.component.newPrice | currency: '': 2}}</td> <td number>{{::sale.component.newPrice | currency: 'EUR': 2}}</td>
<td number>{{::sale.component.difference | currency: '': 2}}</td> <td number>{{::sale.component.difference | currency: 'EUR': 2}}</td>
</tr> </tr>
</tbody> </tbody>
<tfoot> <tfoot>
<tr> <tr>
<td colspan="3"></td> <td colspan="3"></td>
<td number><strong>{{$ctrl.totalPrice | currency: '': 2}}</strong></td> <td number><strong>{{$ctrl.totalPrice | currency: 'EUR': 2}}</strong></td>
<td number><strong>{{$ctrl.totalNewPrice | currency: '': 2}}</strong></td> <td number><strong>{{$ctrl.totalNewPrice | currency: 'EUR': 2}}</strong></td>
<td number><strong>{{$ctrl.totalPriceDifference | currency: '': 2}}</strong></td> <td number><strong>{{$ctrl.totalPriceDifference | currency: 'EUR': 2}}</strong></td>
</tr> </tr>
</tfoot> </tfoot>
</table> </table>

View File

@ -6,7 +6,7 @@
order="shipped ASC" order="shipped ASC"
auto-load="false"> auto-load="false">
</vn-crud-model> </vn-crud-model>
<div class="index-block"> <div class="content-block">
<div class="vn-list"> <div class="vn-list">
<vn-card pad-medium-h> <vn-card pad-medium-h>
<vn-horizontal> <vn-horizontal>
@ -73,7 +73,7 @@
<vn-td class="{{$ctrl.stateColor(ticket)}}">{{::ticket.state}}</vn-td> <vn-td class="{{$ctrl.stateColor(ticket)}}">{{::ticket.state}}</vn-td>
<vn-td>{{::ticket.agencyMode}}</vn-td> <vn-td>{{::ticket.agencyMode}}</vn-td>
<vn-td>{{::ticket.warehouse}}</vn-td> <vn-td>{{::ticket.warehouse}}</vn-td>
<vn-td number>{{::ticket.total | currency: '': 2}}</vn-td> <vn-td number>{{::ticket.total | currency: 'EUR': 2}}</vn-td>
<vn-td> <vn-td>
<vn-icon-button <vn-icon-button
ng-click="$ctrl.preview($event, ticket)" ng-click="$ctrl.preview($event, ticket)"

View File

@ -51,7 +51,7 @@
<vn-one> <vn-one>
<span>{{::sale.quantity}}</span> <span>{{::sale.quantity}}</span>
<span translate>by</span> <span translate>by</span>
<span>{{::sale.price | currency: '': 2}}</span> <span>{{::sale.price | currency: 'EUR': 2}}</span>
</vn-one> </vn-one>
</vn-horizontal> </vn-horizontal>
</vn-vertical> </vn-vertical>

View File

@ -37,7 +37,7 @@
<vn-td>{{::request.requester.user.nickname}}</vn-td> <vn-td>{{::request.requester.user.nickname}}</vn-td>
<vn-td>{{::request.atender.user.nickname}}</vn-td> <vn-td>{{::request.atender.user.nickname}}</vn-td>
<vn-td number>{{::request.quantity}}</vn-td> <vn-td number>{{::request.quantity}}</vn-td>
<vn-td number>{{::request.price | currency: '': 2}}</vn-td> <vn-td number>{{::request.price | currency: 'EUR': 2}}</vn-td>
<vn-td number> <vn-td number>
<span <span
ng-show="::request.saleFk" ng-show="::request.saleFk"

View File

@ -1,5 +1,5 @@
<vn-horizontal pad-medium class="header"> <vn-horizontal pad-medium class="header">
<h5>MANÁ: {{$ctrl.mana | currency:' €':0}}</h5> <h5>MANÁ: {{$ctrl.mana | currency: 'EUR':0}}</h5>
</vn-horizontal> </vn-horizontal>
<div pad-medium> <div pad-medium>
<vn-textfield <vn-textfield
@ -15,6 +15,6 @@
<p class="simulatorTitle" translate>New price</p> <p class="simulatorTitle" translate>New price</p>
<p>{{($ctrl.edit[0].quantity * $ctrl.edit[0].price) <p>{{($ctrl.edit[0].quantity * $ctrl.edit[0].price)
- (($ctrl.newDiscount * ($ctrl.edit[0].quantity * $ctrl.edit[0].price))/100) - (($ctrl.newDiscount * ($ctrl.edit[0].quantity * $ctrl.edit[0].price))/100)
| currency:' €':2}}</p> | currency: 'EUR':2}}</p>
</div> </div>
</div> </div>

View File

@ -116,10 +116,10 @@
ng-click="$ctrl.showEditPricePopover($event, sale)" ng-click="$ctrl.showEditPricePopover($event, sale)"
pointer pointer
vn-tooltip="Edit price"> vn-tooltip="Edit price">
{{sale.price | currency:'€':2}} {{sale.price | currency: 'EUR':2}}
</vn-td> </vn-td>
<vn-td number ng-if="!$ctrl.isEditable"> <vn-td number ng-if="!$ctrl.isEditable">
{{sale.price | currency:'€':2}} {{sale.price | currency: 'EUR':2}}
</vn-td> </vn-td>
<vn-td number <vn-td number
ng-if="$ctrl.isEditable" ng-if="$ctrl.isEditable"
@ -134,7 +134,7 @@
{{sale.discount}} % {{sale.discount}} %
</vn-td> </vn-td>
<vn-td number> <vn-td number>
{{$ctrl.getSaleTotal(sale) | currency:'€':2}} {{$ctrl.getSaleTotal(sale) | currency: 'EUR':2}}
</vn-td> </vn-td>
</vn-tr> </vn-tr>
</vn-tbody> </vn-tbody>
@ -146,15 +146,15 @@
ng-if="$ctrl.sales.length > 0"> ng-if="$ctrl.sales.length > 0">
<p> <p>
<vn-label translate>Subtotal</vn-label> <vn-label translate>Subtotal</vn-label>
<span>{{$ctrl.subTotal | currency:'€':2}}</span> <span>{{$ctrl.subTotal | currency: 'EUR':2}}</span>
</p> </p>
<p> <p>
<vn-label translate>VAT</vn-label> <vn-label translate>VAT</vn-label>
<span>{{$ctrl.VAT | currency:'€':2}}</span> <span>{{$ctrl.VAT | currency: 'EUR':2}}</span>
</p> </p>
<p> <p>
<vn-label><strong>Total</strong></vn-label> <vn-label><strong>Total</strong></vn-label>
<strong>{{$ctrl.total | currency:'€':2}}</strong> <strong>{{$ctrl.total | currency: 'EUR':2}}</strong>
</p> </p>
</div> </div>
</vn-vertical> </vn-vertical>
@ -169,7 +169,7 @@
vn-id="editPricePopover" vn-id="editPricePopover"
on-open="$ctrl.getManaSalespersonMana()"> on-open="$ctrl.getManaSalespersonMana()">
<vn-horizontal pad-medium class="header"> <vn-horizontal pad-medium class="header">
<h5>MANÁ: {{$ctrl.mana | currency:'€':0}}</h5> <h5>MANÁ: {{$ctrl.mana | currency: 'EUR':0}}</h5>
</vn-horizontal> </vn-horizontal>
<div pad-medium> <div pad-medium>
<vn-textfield <vn-textfield
@ -185,7 +185,7 @@
<p class="simulatorTitle" translate>New price</p> <p class="simulatorTitle" translate>New price</p>
<p>{{($ctrl.sale.quantity * $ctrl.editedPrice) <p>{{($ctrl.sale.quantity * $ctrl.editedPrice)
- (($ctrl.sale.discount * ($ctrl.sale.quantity * $ctrl.editedPrice))/100) - (($ctrl.sale.discount * ($ctrl.sale.quantity * $ctrl.editedPrice))/100)
| currency:'€':2}}</p> | currency: 'EUR':2}}</p>
</div> </div>
</div> </div>
</vn-popover> </vn-popover>

View File

@ -1,4 +1,4 @@
<div pad-large style="min-width: 30em"> <div class="search-panel">
<form ng-submit="$ctrl.onSearch()"> <form ng-submit="$ctrl.onSearch()">
<vn-horizontal> <vn-horizontal>
<vn-textfield <vn-textfield

View File

@ -46,27 +46,27 @@
</vn-label-value> </vn-label-value>
</vn-one> </vn-one>
<vn-one class="taxes"> <vn-one class="taxes">
<p><vn-label translate>Subtotal</vn-label> {{$ctrl.summary.subTotal | currency:' €':2}}</p> <p><vn-label translate>Subtotal</vn-label> {{$ctrl.summary.subTotal | currency: 'EUR':2}}</p>
<p><vn-label translate>VAT</vn-label> {{$ctrl.summary.VAT | currency:' €':2}}</p> <p><vn-label translate>VAT</vn-label> {{$ctrl.summary.VAT | currency: 'EUR':2}}</p>
<p><vn-label><strong>Total</strong></vn-label> <strong>{{$ctrl.summary.total | currency:' €':2}}</strong></p> <p><vn-label><strong>Total</strong></vn-label> <strong>{{$ctrl.summary.total | currency: 'EUR':2}}</strong></p>
</vn-one> </vn-one>
<vn-auto name="sales"> <vn-auto name="sales">
<h4 translate>Sale</h4> <h4 translate>Sale</h4>
<table class="vn-grid"> <vn-table class="vn-grid">
<thead> <vn-thead>
<tr> <vn-tr>
<th></th> <vn-th></vn-th>
<th number translate>Item</th> <vn-th number>Item</vn-th>
<th translate>Description</th> <vn-th>Description</vn-th>
<th number translate>Quantity</th> <vn-th number>Quantity</vn-th>
<th number translate>Price</th> <vn-th number>Price</vn-th>
<th number translate>Discount</th> <vn-th number>Discount</vn-th>
<th number translate>Amount</th> <vn-th number>Amount</vn-th>
</tr> </vn-tr>
</thead> </vn-thead>
<tbody> <vn-tbody>
<tr ng-repeat="sale in $ctrl.summary.sales track by sale.id"> <vn-tr ng-repeat="sale in $ctrl.summary.sales track by sale.id">
<td> <vn-td>
<a ui-sref="claim.card.basicData({id: sale.claimBeginning.claimFk})"> <a ui-sref="claim.card.basicData({id: sale.claimBeginning.claimFk})">
<vn-icon <vn-icon
ng-show="sale.claimBeginning.claimFk" ng-show="sale.claimBeginning.claimFk"
@ -82,25 +82,25 @@
vn-tooltip="Visible: {{::sale.visible || 0}} <br> {{::$ctrl.translate.instant('Available')}} {{::sale.available || 0}}"> vn-tooltip="Visible: {{::sale.visible || 0}} <br> {{::$ctrl.translate.instant('Available')}} {{::sale.available || 0}}">
</vn-icon> </vn-icon>
<vn-icon ng-show="sale.reserved" icon="icon-reserva"></vn-icon> <vn-icon ng-show="sale.reserved" icon="icon-reserva"></vn-icon>
</td> </vn-td>
<td number> <vn-td number>
<span <span
ng-click="$ctrl.showDescriptor($event, sale.itemFk)" ng-click="$ctrl.showDescriptor($event, sale.itemFk)"
class="link" pointer> class="link" pointer>
{{sale.itemFk | zeroFill:6}} {{sale.itemFk | zeroFill:6}}
</span> </span>
</td> </vn-td>
<td><vn-fetched-tags max-length="6" item="sale.item" title="sale.concept"/></td> <vn-td><vn-fetched-tags max-length="6" item="sale.item" title="sale.concept"/></vn-td>
<td number>{{::sale.quantity}}</td> <vn-td number>{{::sale.quantity}}</vn-td>
<td number>{{::sale.price | currency:'€':2}}</td> <vn-td number>{{::sale.price | currency: 'EUR':2}}</vn-td>
<td number>{{::sale.discount}} %</td> <vn-td number>{{::sale.discount}} %</vn-td>
<td number>{{::sale.quantity * sale.price | currency:'€':2}}</td> <vn-td number>{{::sale.quantity * sale.price | currency: 'EUR':2}}</vn-td>
</tr> </vn-tr>
<tr ng-if="!$ctrl.summary.sales" class="list list-element"> <vn-tr ng-if="!$ctrl.summary.sales" class="list list-element">
<td colspan="8" style="text-align: center" translate>No results</td> <vn-td colspan="8" style="text-align: center" translate>No results</vn-td>
</tr> </vn-tr>
</tbody> </vn-tbody>
</table> </vn-table>
</vn-auto> </vn-auto>
<vn-one ng-if="$ctrl.summary.packagings.length != 0"> <vn-one ng-if="$ctrl.summary.packagings.length != 0">
<h4 translate>Packages</h4> <h4 translate>Packages</h4>

View File

@ -6,7 +6,7 @@
data="travels" data="travels"
auto-load="false"> auto-load="false">
</vn-crud-model> </vn-crud-model>
<div class="index-block"> <div class="content-block">
<div class="vn-list"> <div class="vn-list">
<vn-card pad-medium-h> <vn-card pad-medium-h>
<vn-searchbar <vn-searchbar

View File

@ -1,4 +1,4 @@
<div pad-large style="min-width: 30em"> <div class="search-panel">
<form ng-submit="$ctrl.onSearch()"> <form ng-submit="$ctrl.onSearch()">
<vn-horizontal> <vn-horizontal>
<vn-textfield <vn-textfield

View File

@ -3,7 +3,7 @@
"base": "VnModel", "base": "VnModel",
"options": { "options": {
"mysql": { "mysql": {
"table": "personDepartment" "table": "workerDepartment"
} }
}, },
"properties": { "properties": {

View File

@ -3,7 +3,7 @@
"base": "VnModel", "base": "VnModel",
"options": { "options": {
"mysql": { "mysql": {
"table": "personMedia" "table": "workerMedia"
} }
}, },
"properties": { "properties": {

View File

@ -1,5 +1,5 @@
<vn-main-block> <vn-main-block>
<div class="left-block"> <div class="left-menu">
<vn-worker-descriptor worker="$ctrl.worker"></vn-worker-descriptor> <vn-worker-descriptor worker="$ctrl.worker"></vn-worker-descriptor>
<vn-left-menu></vn-left-menu> <vn-left-menu></vn-left-menu>
</div> </div>

View File

@ -5,7 +5,7 @@
limit="20" limit="20"
data="workers"> data="workers">
</vn-crud-model> </vn-crud-model>
<div class="index-block"> <div class="content-block">
<div class="vn-list"> <div class="vn-list">
<vn-card pad-medium-h> <vn-card pad-medium-h>
<vn-searchbar <vn-searchbar

View File

@ -1,4 +1,4 @@
<div pad-large style="min-width: 30em"> <div class="search-panel">
<form ng-submit="$ctrl.onSearch()"> <form ng-submit="$ctrl.onSearch()">
<vn-horizontal> <vn-horizontal>
<vn-textfield <vn-textfield

View File

@ -34,8 +34,8 @@
} }
.row { .row {
margin-bottom: 15px; white-space: nowrap;
overflow: hidden margin-bottom: 15px
} }
.row.small { .row.small {
@ -52,10 +52,6 @@
box-sizing: border-box box-sizing: border-box
} }
.row .text, .row .control {
overflow: hidden
}
.row .description { .row .description {
position: relative; position: relative;
padding-top: 2px; padding-top: 2px;
@ -87,17 +83,18 @@
} }
.row.inline .text { .row.inline .text {
display: inline-block;
margin-bottom: 0; margin-bottom: 0;
width: 40%; width: 40%;
float: left
} }
.row.inline .control { .row.inline .control {
display: inline-block;
font-weight: bold; font-weight: bold;
padding-left: 20px; padding-left: 20px;
color: #000; color: #000;
width: 60%; width: 60%
float: left
} }
.row.inline .description { .row.inline .description {
@ -105,36 +102,29 @@
overflow: visible overflow: visible
} }
.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;
font-weight: bold
}
.grid .row.inline > section {
float: left;
}
.panel { .panel {
border: 1px solid #DDD; position: relative
margin-bottom: 10px;
position: relative;
padding:20px
} }
.panel .header { .panel .header {
background-color: #FFF; background-color: #FFF;
position:absolute;
left: 17.5px;
top: -12px;
padding: 2.5px 5px;
font-weight: bold; font-weight: bold;
margin-top: -20px }
.panel .body {
border: 1px solid #CCC;
margin-top: 10px;
overflow: hidden;
padding: 20px
}
.panel .body h3 {
margin-top: 0
} }
.box { .box {
@ -162,3 +152,54 @@
.pull-right { .pull-right {
float: right float: right
} }
.verticalText {
-moz-transform: rotate(90deg);
-webkit-transform: rotate(90deg);
transform: rotate(90deg);
position: absolute;
text-align: center;
font-size: .65em;
width: 200px;
border: 2px solid #000;
right: -110px;
top: 50%
}
vn-table {
border-collapse: collapse;
margin: 20px 0;
display: table;
width: 100%;
}
vn-thead {
border-bottom: 1px solid #808080;
border-top: 1px solid #808080;
display: table-header-group
}
vn-tbody {
border-top: 3px solid #888888;
display: table-row-group
}
vn-tfoot {
border-top: 1px solid #808080;
display: table-footer-group
}
vn-tr {
display: table-row
}
vn-th {
font-weight: bold
}
vn-td, vn-th {
vertical-align: middle;
display: table-cell;
text-align: left;
padding: 5px 0
}

View File

@ -8,6 +8,8 @@
{"type": "report", "name": "delivery-note"}, {"type": "report", "name": "delivery-note"},
{"type": "report", "name": "invoice"}, {"type": "report", "name": "invoice"},
{"type": "report", "name": "rpt-claim-pickup-order"}, {"type": "report", "name": "rpt-claim-pickup-order"},
{"type": "report", "name": "rpt-letter-debtor"},
{"type": "report", "name": "rpt-sepa-core"},
{"type": "static", "name": "email-header"}, {"type": "static", "name": "email-header"},
{"type": "static", "name": "email-footer"}, {"type": "static", "name": "email-footer"},
{"type": "static", "name": "report-header"}, {"type": "static", "name": "report-header"},

View File

@ -95,9 +95,10 @@ module.exports = {
const template = await fs.readFile(templatePath, 'utf8'); const template = await fs.readFile(templatePath, 'utf8');
const css = require(stylePath); const css = require(stylePath);
const cssOptions = {inlinePseudoElements: true};
component.i18n = require(localePath); component.i18n = require(localePath);
component.template = juice.inlineContent(template, css); component.template = juice.inlineContent(template, css, cssOptions);
}, },
async toPdf(name, ctx) { async toPdf(name, ctx) {

View File

@ -16,8 +16,8 @@ module.exports = app => {
app.get(`/api/report/${name}`, (request, response, next) => { app.get(`/api/report/${name}`, (request, response, next) => {
reportEngine.toPdf(name, request).then(stream => { reportEngine.toPdf(name, request).then(stream => {
response.setHeader('Content-Disposition', `attachment; filename="${name}.pdf"`); // response.setHeader('Content-Disposition', `attachment; filename="${name}.pdf"`);
response.setHeader('Content-type', 'application/pdf'); // response.setHeader('Content-type', 'application/pdf');
stream.pipe(response); stream.pipe(response);
}).catch(e => { }).catch(e => {
next(e); next(e);

View File

@ -1,6 +1,4 @@
const database = require(`${appPath}/lib/database`); const database = require(`${appPath}/lib/database`);
const emailHeader = require('../email-header');
const emailFooter = require('../email-footer');
const UserException = require(`${appPath}/lib/exceptions/userException`); const UserException = require(`${appPath}/lib/exceptions/userException`);
module.exports = { module.exports = {
@ -42,7 +40,7 @@ module.exports = {
}, },
}, },
components: { components: {
'email-header': emailHeader, 'email-header': require('../email-header'),
'email-footer': emailFooter, 'email-footer': require('../email-footer'),
}, },
}; };

Some files were not shown because too many files have changed in this diff Show More