Merge branch 'dev'
This commit is contained in:
commit
70328e6759
|
@ -1,18 +1,18 @@
|
|||
<div>
|
||||
<div class="box-wrapper">
|
||||
<div class="box">
|
||||
<img src="./logo.svg"/>
|
||||
<form name="form" ng-submit="$ctrl.submit()">
|
||||
<vn-textfield vn-id="userField" label="User" model="$ctrl.user" vn-focus></vn-textfield>
|
||||
<vn-textfield label="Password" model="$ctrl.password" type="password"></vn-textfield>
|
||||
<div class="footer">
|
||||
<vn-submit label="Enter"></vn-submit>
|
||||
<div class="spinner-wrapper">
|
||||
<vn-spinner enable="$ctrl.loading"></vn-spinner>
|
||||
<div class="box">
|
||||
<img src="./logo.svg"/>
|
||||
<form name="form" ng-submit="$ctrl.submit()">
|
||||
<vn-textfield vn-id="userField" label="User" model="$ctrl.user" vn-focus></vn-textfield>
|
||||
<vn-textfield label="Password" model="$ctrl.password" type="password"></vn-textfield>
|
||||
<div class="footer">
|
||||
<vn-submit label="Enter"></vn-submit>
|
||||
<div class="spinner-wrapper">
|
||||
<vn-spinner enable="$ctrl.loading"></vn-spinner>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<vn-snackbar vn-id="snackbar"></vn-snackbar>
|
||||
</div>
|
||||
|
|
|
@ -16,6 +16,7 @@ vn-login > div {
|
|||
margin: auto;
|
||||
height: inherit;
|
||||
}
|
||||
|
||||
.box {
|
||||
box-sizing: border-box;
|
||||
position: absolute;
|
||||
|
@ -27,15 +28,18 @@ vn-login > div {
|
|||
box-shadow: 0 0 1em 0 rgba(1,1,1,.6);
|
||||
border-radius: .5em;
|
||||
}
|
||||
|
||||
img {
|
||||
width: 100%;
|
||||
padding-bottom: 1em;
|
||||
}
|
||||
|
||||
.footer {
|
||||
margin-top: 1em;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.spinner-wrapper {
|
||||
position: absolute;
|
||||
width: 0;
|
||||
|
|
|
@ -28,7 +28,9 @@
|
|||
show-field="name"
|
||||
value-field="id"
|
||||
select-fields="surname"
|
||||
label="Salesperson">
|
||||
label="Salesperson"
|
||||
filter-search="{where: {or: [{name: {regexp: 'search'}}, {surname: {regexp: 'search'}}]}}"
|
||||
>
|
||||
</vn-autocomplete>
|
||||
<vn-autocomplete vn-one
|
||||
initial-data="$ctrl.client.contactChannel"
|
||||
|
|
|
@ -28,11 +28,14 @@
|
|||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-one>
|
||||
<vn-check label="Recargo de equivalencia" field="$ctrl.client.equalizationTax" vn-acl="administrative"></vn-check>
|
||||
<vn-check label="Equalization tax" field="$ctrl.client.equalizationTax" vn-acl="administrative"></vn-check>
|
||||
</vn-one>
|
||||
<vn-one>
|
||||
<vn-check label="Vies" field="$ctrl.client.vies" vn-acl="administrative"></vn-check>
|
||||
</vn-one>
|
||||
<vn-one>
|
||||
<vn-check label="Invoice by address" field="$ctrl.client.hasToInvoiceByAddress" vn-acl="administrative"></vn-check>
|
||||
</vn-one>
|
||||
</vn-horizontal>
|
||||
</vn-vertical>
|
||||
</vn-card>
|
||||
|
@ -72,7 +75,7 @@
|
|||
</vn-dialog>
|
||||
<vn-dialog
|
||||
vn-id="propagate-equalizationTax"
|
||||
on-response="$ctrl.returnDialogRE(response)">
|
||||
on-response="$ctrl.returnDialogEt(response)">
|
||||
<tpl-body>
|
||||
<vn-vertical>
|
||||
<vn-one text-center translate>You changes the equivalent tax</vn-one>
|
||||
|
|
|
@ -9,9 +9,11 @@ export default class Controller {
|
|||
this.billData = {};
|
||||
this.copyData();
|
||||
}
|
||||
|
||||
$onChanges() {
|
||||
this.copyData();
|
||||
}
|
||||
|
||||
copyData() {
|
||||
if (this.client) {
|
||||
this.billData.payMethodFk = this.client.payMethodFk;
|
||||
|
@ -23,10 +25,12 @@ export default class Controller {
|
|||
this.equalizationTax = this.client.equalizationTax;
|
||||
}
|
||||
}
|
||||
|
||||
submit() {
|
||||
return this.$.watcher.submit().then(
|
||||
() => this.checkPaymentChanges());
|
||||
}
|
||||
|
||||
checkPaymentChanges() {
|
||||
let equals = true;
|
||||
Object.keys(this.billData).forEach(
|
||||
|
@ -39,25 +43,26 @@ export default class Controller {
|
|||
);
|
||||
|
||||
if (equals) {
|
||||
this.checkREChanges();
|
||||
this.checkEtChanges();
|
||||
} else {
|
||||
this.$.sendMail.show();
|
||||
}
|
||||
}
|
||||
|
||||
returnDialog(response) {
|
||||
if (response === 'ACCEPT') {
|
||||
this.$http.post(`/mailer/manuscript/payment-update/${this.client.id}`).then(
|
||||
() => {
|
||||
this.vnApp.showMessage(this.translate.instant('Notification sent!'));
|
||||
this.checkREChanges();
|
||||
this.checkEtChanges();
|
||||
}
|
||||
);
|
||||
} else {
|
||||
this.checkREChanges();
|
||||
this.checkEtChanges();
|
||||
}
|
||||
}
|
||||
|
||||
checkREChanges() {
|
||||
checkEtChanges() {
|
||||
let equals = this.equalizationTax == this.client.equalizationTax;
|
||||
this.equalizationTax = this.client.equalizationTax;
|
||||
|
||||
|
@ -65,7 +70,7 @@ export default class Controller {
|
|||
this.$.propagateEqualizationTax.show();
|
||||
}
|
||||
|
||||
returnDialogRE(response) {
|
||||
returnDialogEt(response) {
|
||||
if (response === 'ACCEPT') {
|
||||
this.$http.patch(`/client/api/Clients/${this.client.id}/addressesPropagateRe`, {isEqualizated: this.client.equalizationTax}).then(
|
||||
res => {
|
||||
|
|
|
@ -8,5 +8,7 @@
|
|||
"You changes the equivalent tax": "Has cambiado el recargo de equivalencia",
|
||||
"Do you want to spread the change to their consignees?" : "¿Deseas propagar el cambio a sus consignatarios?",
|
||||
"Yes, propagate": "Si, propagar",
|
||||
"Equivalent tax spreaded": "Recargo de equivalencia propagado"
|
||||
"Equivalent tax spreaded": "Recargo de equivalencia propagado",
|
||||
"Invoice by address": "Facturar por consignatario",
|
||||
"Equalization tax": "Recargo de equivalencia"
|
||||
}
|
|
@ -1,3 +1,3 @@
|
|||
vn-descriptor{
|
||||
vn-descriptor {
|
||||
font-family: raleway-bold;
|
||||
}
|
|
@ -11,6 +11,6 @@ vn-item-client a:hover {
|
|||
background-color: #424242;
|
||||
}
|
||||
|
||||
.vn-item-client-name{
|
||||
.vn-item-client-name {
|
||||
font-family: raleway-bold;
|
||||
}
|
||||
|
|
|
@ -6,11 +6,13 @@ export default class Controller {
|
|||
this.$http = $http;
|
||||
this.$state = $state;
|
||||
}
|
||||
|
||||
$onChanges() {
|
||||
if (this.client) {
|
||||
this.getObservation(this.client.id);
|
||||
}
|
||||
}
|
||||
|
||||
getObservation(clientId) {
|
||||
let json = JSON.stringify({where: {clientFk: this.client.id}, order: 'created DESC'});
|
||||
this.$http.get(`/client/api/clientObservations?filter=${json}`).then(
|
||||
|
@ -19,6 +21,7 @@ export default class Controller {
|
|||
}
|
||||
);
|
||||
}
|
||||
|
||||
newObservation() {
|
||||
this.$state.go("clientCard.notes.create", {id: this.client.id});
|
||||
}
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
.notes-date{
|
||||
.notes-date {
|
||||
font-family: raleway-bold;
|
||||
}
|
|
@ -6,15 +6,18 @@ export default class Controller {
|
|||
// onSubmit() is defined by @vnSearchbar
|
||||
this.onSubmit = () => {};
|
||||
}
|
||||
|
||||
onSearch() {
|
||||
this.setStorageValue();
|
||||
this.onSubmit(this.filter);
|
||||
}
|
||||
|
||||
$onChanges() {
|
||||
var value = JSON.parse(this.$window.sessionStorage.getItem('filter'));
|
||||
if (value !== undefined)
|
||||
this.filter = value;
|
||||
}
|
||||
|
||||
setStorageValue() {
|
||||
this.$window.sessionStorage.setItem('filter', JSON.stringify(this.filter));
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ describe('Client', () => {
|
|||
}));
|
||||
|
||||
describe('onSearch()', () => {
|
||||
it(`should call setStorageValue() and onSubmit()`, () => {
|
||||
it('should call setStorageValue() and onSubmit()', () => {
|
||||
spyOn(controller, 'setStorageValue');
|
||||
spyOn(controller, 'onSubmit');
|
||||
controller.setStorageValue();
|
||||
|
@ -29,7 +29,7 @@ describe('Client', () => {
|
|||
});
|
||||
|
||||
describe('$onChanges()', () => {
|
||||
it(`should set filter properties using the search values`, () => {
|
||||
it('should set filter properties using the search values', () => {
|
||||
expect(controller.filter).not.toBeDefined();
|
||||
spyOn(JSON, 'parse').and.returnValue({data: 'data'});
|
||||
controller.$onChanges();
|
||||
|
|
|
@ -29,6 +29,7 @@ export default class Controller {
|
|||
this.repeatPassword = '';
|
||||
this.$.$apply();
|
||||
}
|
||||
|
||||
onPassChange(response) {
|
||||
if (response == 'ACCEPT' && this.canChangePassword)
|
||||
try {
|
||||
|
|
|
@ -32,6 +32,7 @@ class Autocomplete extends Component {
|
|||
get showDropDown() {
|
||||
return this._showDropDown;
|
||||
}
|
||||
|
||||
set showDropDown(value) {
|
||||
if (value && this.url && !this._preLoad) {
|
||||
this._preLoad = true;
|
||||
|
@ -77,6 +78,7 @@ class Autocomplete extends Component {
|
|||
get field() {
|
||||
return this.multiple ? this._multiField : this._field;
|
||||
}
|
||||
|
||||
set field(value) {
|
||||
if (!angular.equals(value, this.field)) {
|
||||
this.finding = true;
|
||||
|
@ -103,7 +105,7 @@ class Autocomplete extends Component {
|
|||
if (value && value.hasOwnProperty(this.valueField)) {
|
||||
this._field = value[this.valueField];
|
||||
if (this.multiple) {
|
||||
this._multiField = [value[this.valueField]]
|
||||
this._multiField = [value[this.valueField]];
|
||||
}
|
||||
if (value.hasOwnProperty(this.showField)) {
|
||||
this.displayValue = value[this.showField];
|
||||
|
@ -164,6 +166,7 @@ class Autocomplete extends Component {
|
|||
json => this.onItemRequest(null)
|
||||
);
|
||||
}
|
||||
|
||||
onItemRequest(data) {
|
||||
if (data && data.length > 0)
|
||||
this.showItem(data[0]);
|
||||
|
@ -191,10 +194,17 @@ class Autocomplete extends Component {
|
|||
findItems(search) {
|
||||
if (this.url && search && !this.finding) {
|
||||
this.maxRow = false;
|
||||
let filter = {where: {name: {regexp: search}}};
|
||||
if (this.filter && this.filter.where) {
|
||||
Object.assign(filter.where, this.filter.where);
|
||||
let filter = {};
|
||||
if (this.filterSearch) {
|
||||
let toSearch = this.filterSearch.replace(/search/g, search);
|
||||
filter = this.$scope.$eval(toSearch);
|
||||
} else {
|
||||
filter = {where: {name: {regexp: search}}};
|
||||
if (this.filter && this.filter.where) {
|
||||
Object.assign(filter.where, this.filter.where);
|
||||
}
|
||||
}
|
||||
filter.order = this.order;
|
||||
let json = JSON.stringify(filter);
|
||||
this.finding = true;
|
||||
this.$http.get(`${this.url}?filter=${json}`).then(
|
||||
|
@ -222,6 +232,7 @@ class Autocomplete extends Component {
|
|||
this.getItems();
|
||||
}
|
||||
}
|
||||
|
||||
getItems() {
|
||||
if (this.url === undefined) {
|
||||
this.items = copyObject(this.data);
|
||||
|
@ -273,6 +284,7 @@ class Autocomplete extends Component {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
$onInit() {
|
||||
this.findMore = this.url && this.maxRow;
|
||||
this.mouseFocus = false;
|
||||
|
@ -321,7 +333,6 @@ class Autocomplete extends Component {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
Autocomplete.$inject = ['$element', '$scope', '$http', '$timeout', '$filter'];
|
||||
|
||||
module.component('vnAutocomplete', {
|
||||
|
@ -339,7 +350,8 @@ module.component('vnAutocomplete', {
|
|||
label: '@',
|
||||
multiple: '@?',
|
||||
order: '@?',
|
||||
filter: '<?'
|
||||
filter: '<?',
|
||||
filterSearch: '@?'
|
||||
},
|
||||
transclude: {
|
||||
tplItem: '?tplItem'
|
||||
|
|
|
@ -120,8 +120,8 @@ describe('Component vnAutocomplete', () => {
|
|||
|
||||
it(`should perform a query if the item id isn't present in the controller.items property`, () => {
|
||||
controller.url = 'test.com';
|
||||
$httpBackend.whenGET('test.com?filter={"fields":{"id":true,"name":true},"where":{"id":3}}').respond();
|
||||
$httpBackend.expectGET('test.com?filter={"fields":{"id":true,"name":true},"where":{"id":3}}');
|
||||
$httpBackend.whenGET(`${controller.url}?filter={"fields":{"id":true,"name":true},"where":{"id":3}}`).respond();
|
||||
$httpBackend.expectGET(`${controller.url}?filter={"fields":{"id":true,"name":true},"where":{"id":3}}`);
|
||||
controller.items = [{id: 1, name: 'test1'}, {id: 2, name: 'Bruce Wayne'}];
|
||||
controller.field = 3;
|
||||
$httpBackend.flush();
|
||||
|
@ -136,8 +136,8 @@ describe('Component vnAutocomplete', () => {
|
|||
|
||||
it(`should set field performing a query as the item id isn't present in the controller.items property`, () => {
|
||||
controller.url = 'test.com';
|
||||
$httpBackend.whenGET('test.com?filter={"fields":{"id":true,"name":true},"where":{"id":3}}').respond();
|
||||
$httpBackend.expectGET('test.com?filter={"fields":{"id":true,"name":true},"where":{"id":3}}');
|
||||
$httpBackend.whenGET(`${controller.url}?filter={"fields":{"id":true,"name":true},"where":{"id":3}}`).respond();
|
||||
$httpBackend.expectGET(`${controller.url}?filter={"fields":{"id":true,"name":true},"where":{"id":3}}`);
|
||||
controller.items = [{id: 1, name: 'test1'}, {id: 2, name: 'Bruce Wayne'}];
|
||||
controller.field = 3;
|
||||
$httpBackend.flush();
|
||||
|
@ -150,9 +150,23 @@ describe('Component vnAutocomplete', () => {
|
|||
let controller = $componentController('vnAutocomplete', {$scope, $element, $httpBackend, $timeout});
|
||||
controller.url = 'test.com';
|
||||
let search = 'The Joker';
|
||||
let json = JSON.stringify({where: {name: {regexp: search}}});
|
||||
$httpBackend.whenGET(`test.com?filter=${json}`).respond([{id: 3, name: 'The Joker'}]);
|
||||
$httpBackend.expectGET(`test.com?filter=${json}`);
|
||||
let json = JSON.stringify({where: {name: {regexp: search}}, order: controller.order});
|
||||
$httpBackend.whenGET(`${controller.url}?filter=${json}`).respond([{id: 3, name: 'The Joker'}]);
|
||||
$httpBackend.expectGET(`${controller.url}?filter=${json}`);
|
||||
controller.findItems(search);
|
||||
$httpBackend.flush();
|
||||
|
||||
expect(controller.items[0]).toEqual({id: 3, name: 'The Joker'});
|
||||
});
|
||||
|
||||
it(`should perform a search and store the result in controller items with filterSearch`, () => {
|
||||
let controller = $componentController('vnAutocomplete', {$scope, $element, $httpBackend, $timeout});
|
||||
controller.url = 'test.com';
|
||||
let search = 'The Joker';
|
||||
controller.filterSearch = "{where: {surname: {regexp: 'search'}}}";
|
||||
let json = JSON.stringify({where: {surname: {regexp: search}}, order: controller.order});
|
||||
$httpBackend.whenGET(`${controller.url}?filter=${json}`).respond([{id: 3, name: 'The Joker'}]);
|
||||
$httpBackend.expectGET(`${controller.url}?filter=${json}`);
|
||||
controller.findItems(search);
|
||||
$httpBackend.flush();
|
||||
|
||||
|
@ -163,9 +177,9 @@ describe('Component vnAutocomplete', () => {
|
|||
controller.url = 'test.com';
|
||||
let search = 'Joker';
|
||||
controller.multiple = true;
|
||||
let json = JSON.stringify({where: {name: {regexp: search}}});
|
||||
$httpBackend.whenGET(`test.com?filter=${json}`).respond([{id: 3, name: 'The Joker'}, {id: 4, name: 'Joker'}]);
|
||||
$httpBackend.expectGET(`test.com?filter=${json}`);
|
||||
let json = JSON.stringify({where: {name: {regexp: search}}, order: controller.order});
|
||||
$httpBackend.whenGET(`${controller.url}?filter=${json}`).respond([{id: 3, name: 'The Joker'}, {id: 4, name: 'Joker'}]);
|
||||
$httpBackend.expectGET(`${controller.url}?filter=${json}`);
|
||||
controller.findItems(search);
|
||||
$httpBackend.flush();
|
||||
|
||||
|
@ -184,8 +198,8 @@ describe('Component vnAutocomplete', () => {
|
|||
describe('getItems()', () => {
|
||||
it(`should perfom a query to fill the items without filter`, () => {
|
||||
controller.url = 'test.com';
|
||||
$httpBackend.whenGET(`test.com?filter={"skip":0,"limit":10,"order":"name ASC"}`).respond([{id: 1, name: 'Batman'}, {id: 2, name: 'Bruce Wayne'}]);
|
||||
$httpBackend.expectGET(`test.com?filter={"skip":0,"limit":10,"order":"name ASC"}`);
|
||||
$httpBackend.whenGET(`${controller.url}?filter={"skip":0,"limit":10,"order":"name ASC"}`).respond([{id: 1, name: 'Batman'}, {id: 2, name: 'Bruce Wayne'}]);
|
||||
$httpBackend.expectGET(`${controller.url}?filter={"skip":0,"limit":10,"order":"name ASC"}`);
|
||||
controller.getItems();
|
||||
$httpBackend.flush();
|
||||
|
||||
|
|
|
@ -5,4 +5,4 @@ vn-icon {
|
|||
vn-icon > i {
|
||||
display: block;
|
||||
font-size: inherit !important;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import './getTemplate';
|
|||
import './app';
|
||||
import './interceptor';
|
||||
import './aclService';
|
||||
import './storageServices';
|
||||
|
||||
export * from './util';
|
||||
export {default as splitingRegister} from './splitingRegister';
|
||||
|
|
|
@ -0,0 +1,66 @@
|
|||
import {module} from '../module';
|
||||
|
||||
class VnStorage {
|
||||
constructor() {
|
||||
this._type = '';
|
||||
this.prefix = 'vn';
|
||||
}
|
||||
set type(value) {
|
||||
this._type = value;
|
||||
this.checkSupport();
|
||||
}
|
||||
get type() {
|
||||
return this._type;
|
||||
}
|
||||
get webStorage() {
|
||||
return window[this.type];
|
||||
}
|
||||
checkSupport() {
|
||||
try {
|
||||
let supported = (this.type in window && window[this.type] !== null);
|
||||
if (supported) {
|
||||
let key = '__' + Math.round(Math.random() * 1e7);
|
||||
let webStorage = window[this.type];
|
||||
webStorage.setItem(key, '');
|
||||
webStorage.removeItem(key);
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('VnStorage.notification.error', e.message);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
get(param) {
|
||||
let toRead = this.webStorage.getItem(`${this.prefix}.${param}`);
|
||||
if (toRead && toRead.startsWith('jsonObject:')) {
|
||||
toRead = JSON.parse(toRead.replace('jsonObject:', ''));
|
||||
}
|
||||
return toRead;
|
||||
}
|
||||
set(param, data) {
|
||||
let toStorage = typeof data === 'object' ? `jsonObject:${JSON.stringify(data)}` : data;
|
||||
this.webStorage.setItem(`${this.prefix}.${param}`, toStorage);
|
||||
}
|
||||
remove(param) {
|
||||
this.webStorage.removeItem(`${this.prefix}.${param}`);
|
||||
}
|
||||
clear() {
|
||||
this.webStorage.clear();
|
||||
}
|
||||
}
|
||||
|
||||
class SessionStorage extends VnStorage {
|
||||
constructor() {
|
||||
super();
|
||||
this.type = 'sessionStorage';
|
||||
}
|
||||
}
|
||||
|
||||
class LocalStorage extends VnStorage {
|
||||
constructor() {
|
||||
super();
|
||||
this.type = 'localStorage';
|
||||
}
|
||||
}
|
||||
|
||||
module.service('sessionStorage', SessionStorage);
|
||||
module.service('localStorage', LocalStorage);
|
|
@ -32,7 +32,6 @@ export class ProductionTable {
|
|||
onOrder(field, order) {
|
||||
let reverse = order === 'DESC';
|
||||
this.tickets = this.$filter('orderBy')(this.tickets, field, reverse);
|
||||
this.pageTickets();
|
||||
}
|
||||
pageTickets() {
|
||||
let init = (this.pageTable.filter.page - 1) * this.itemsDisplayedInList;
|
||||
|
@ -46,9 +45,9 @@ ProductionTable.$inject = ['$filter'];
|
|||
ngModule.component('vnProductionTable', {
|
||||
template: require('./production-table.html'),
|
||||
bindings: {
|
||||
tickets: '=',
|
||||
tickets: '<',
|
||||
footer: '<',
|
||||
checkAll: '='
|
||||
checkAll: '<'
|
||||
},
|
||||
controller: ProductionTable
|
||||
});
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
<div style="position: fixed; top: 0; right: 0; padding: .8em 1.5em; z-index: 10;">
|
||||
<vn-icon icon="apps" id="apps" translate-attr="{title: 'Applications'}"></vn-icon>
|
||||
<vn-icon icon="notifications" translate-attr="{title: 'Notifications'}"></vn-icon>
|
||||
<vn-icon icon="language" translate-attr="{title: 'Change language'}" ng-click="$ctrl.onChangeLanguage()"></vn-icon>
|
||||
<vn-icon icon="exit_to_app" translate-attr="{title: 'Logout'}" ng-click="$ctrl.onLogoutClick()"></vn-icon>
|
||||
<vn-icon icon="account_circle" translate-attr="{title: 'Profile'}" style="font-size: 35px;"></vn-icon>
|
||||
<!--
|
||||
TODO: Keep it commented until they are functional
|
||||
|
||||
<vn-icon icon="notifications" translate-attr="{title: 'Notifications'}"></vn-icon>
|
||||
<vn-icon icon="account_circle" translate-attr="{title: 'Profile'}"></vn-icon>
|
||||
-->
|
||||
<ul class="mdl-menu mdl-js-menu mdl-menu--bottom-right" pad-small for="apps">
|
||||
<li class="mdl-menu__item" ng-repeat="mod in $ctrl.modules track by $index" ui-sref="{{::mod.route.state}}">
|
||||
<vn-icon ng-if="mod.icon && !mod.icon.startsWith('/')" icon="{{::mod.icon}}"></vn-icon>
|
||||
|
|
|
@ -1,4 +1,13 @@
|
|||
vn-main-menu {
|
||||
& > div > vn-icon {
|
||||
font-size: 2.5em;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
color: #FF9300;
|
||||
}
|
||||
}
|
||||
|
||||
li.mdl-menu__item{
|
||||
background-color: #FF9300;
|
||||
margin-bottom: 8px;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
.display-block {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.well {
|
||||
min-height: 20px;
|
||||
padding: 19px;
|
||||
|
@ -10,6 +11,7 @@
|
|||
border-radius: 4px;
|
||||
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05);
|
||||
}
|
||||
|
||||
.form-group {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
@ -20,6 +22,7 @@
|
|||
height: auto;
|
||||
min-width: auto;
|
||||
}
|
||||
|
||||
.popover-label {
|
||||
font-weight: bold;
|
||||
color: black;
|
||||
|
@ -32,12 +35,15 @@
|
|||
height: 46px;
|
||||
line-height: 0px;
|
||||
}
|
||||
|
||||
input:disabled, button:disabled {
|
||||
cursor: not-allowed !important;
|
||||
}
|
||||
|
||||
input[type="submit"]:disabled, button:disabled {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.descriptor-icon{
|
||||
font-size:60px;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,6 +57,8 @@ export default {
|
|||
postcodeInput: `${components.vnTextfield}[name="postcode"]`,
|
||||
provinceInput: `${components.vnAutocomplete}[field="$ctrl.client.provinceFk"] > vn-vertical > ${components.vnTextfield}`,
|
||||
provinceFifthOption: `${components.vnAutocomplete}[field="$ctrl.client.provinceFk"] > vn-vertical > vn-drop-down > vn-vertical > vn-one:nth-child(2) > ul > li:nth-child(5)`,
|
||||
saveButton: 'body > vn-app > vn-vertical > vn-vertical > vn-client-card > vn-horizontal > vn-auto > vn-vertical > vn-client-fiscal-data > form > vn-button-bar > vn-submit > input'
|
||||
countryInput: `${components.vnAutocomplete}[field="$ctrl.client.countryFk"] > vn-vertical > ${components.vnTextfield}`,
|
||||
countryThirdOption: `${components.vnAutocomplete}[field="$ctrl.client.countryFk"] > vn-vertical > vn-drop-down > vn-vertical > vn-one:nth-child(3) > ul > li:nth-child(3)`,
|
||||
saveButton: `${components.vnSubmit}`
|
||||
}
|
||||
};
|
||||
|
|
|
@ -299,7 +299,6 @@ describe('Edit basicData path', () => {
|
|||
it('should select the channel', done => {
|
||||
nightmare
|
||||
.waitToClick(selectors.basicData.channelInput)
|
||||
.waitToClick(selectors.basicData.channelInput)
|
||||
.waitToClick(selectors.basicData.channelMetropolisOption)
|
||||
.waitToClick(selectors.basicData.saveButton)
|
||||
.wait(selectors.globalItems.snackbarIsActive)
|
||||
|
@ -317,7 +316,7 @@ describe('Edit basicData path', () => {
|
|||
.click(selectors.fiscalData.fiscalDataButton)
|
||||
.wait(selectors.fiscalData.addressInput)
|
||||
.click(selectors.basicData.basicDataButton)
|
||||
.wait(100)
|
||||
.wait(selectors.basicData.basicDataButton)
|
||||
.getInputValue(selectors.basicData.channelInput)
|
||||
.then(result => {
|
||||
expect(result).toEqual('Metropolis newspaper');
|
||||
|
|
|
@ -223,33 +223,61 @@ describe('Edit fiscalData path', () => {
|
|||
.catch(catchErrors(done));
|
||||
});
|
||||
|
||||
// it(`should edit the province`, done => {
|
||||
// nightmare
|
||||
// .waitToClick(selectors.fiscalData.provinceInput)
|
||||
// .waitToClick(selectors.fiscalData.provinceInput)
|
||||
// .waitToClick(selectors.fiscalData.provinceMetropolisOption)
|
||||
// .waitToClick(selectors.fiscalData.saveButton)
|
||||
// .wait(selectors.globalItems.snackbarIsActive)
|
||||
// .getInnerText(selectors.globalItems.snackbarIsActive)
|
||||
// .then(result => {
|
||||
// expect(result).toEqual(`¡Datos guardados!`);
|
||||
// done();
|
||||
// })
|
||||
// .catch(catchErrors(done));
|
||||
// });
|
||||
it(`should edit the province`, done => {
|
||||
nightmare
|
||||
.waitToClick(selectors.fiscalData.provinceInput)
|
||||
.waitToClick(selectors.fiscalData.provinceFifthOption)
|
||||
.waitToClick(selectors.fiscalData.saveButton)
|
||||
.wait(selectors.globalItems.snackbarIsActive)
|
||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||
.then(result => {
|
||||
expect(result).toEqual(`¡Datos guardados!`);
|
||||
done();
|
||||
})
|
||||
.catch(catchErrors(done));
|
||||
});
|
||||
|
||||
// it(`should confirm the province have been selected`, done => {
|
||||
// nightmare
|
||||
// .waitForSnackbarReset()
|
||||
// .click(selectors.fiscalData.fiscalDataButton)
|
||||
// .wait(selectors.fiscalData.addressInput)
|
||||
// .click(selectors.fiscalData.basicDataButton)
|
||||
// .wait(100)
|
||||
// .getInputValue(selectors.fiscalData.provinceInput)
|
||||
// .then(result => {
|
||||
// expect(result).toEqual('Province two');
|
||||
// done();
|
||||
// })
|
||||
// .catch(catchErrors(done));
|
||||
// });
|
||||
it(`should confirm the province have been selected`, done => {
|
||||
nightmare
|
||||
.waitForSnackbarReset()
|
||||
.click(selectors.basicData.basicDataButton)
|
||||
.wait(selectors.basicData.nameInput)
|
||||
.click(selectors.fiscalData.fiscalDataButton)
|
||||
.wait(100)
|
||||
.getInputValue(selectors.fiscalData.provinceInput)
|
||||
.then(result => {
|
||||
expect(result).toEqual('Province two');
|
||||
done();
|
||||
})
|
||||
.catch(catchErrors(done));
|
||||
});
|
||||
|
||||
it(`should edit the country`, done => {
|
||||
nightmare
|
||||
.waitToClick(selectors.fiscalData.countryInput)
|
||||
.waitToClick(selectors.fiscalData.countryThirdOption)
|
||||
.waitToClick(selectors.fiscalData.saveButton)
|
||||
.wait(selectors.globalItems.snackbarIsActive)
|
||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||
.then(result => {
|
||||
expect(result).toEqual(`¡Datos guardados!`);
|
||||
done();
|
||||
})
|
||||
.catch(catchErrors(done));
|
||||
});
|
||||
|
||||
it(`should confirm the country have been selected`, done => {
|
||||
nightmare
|
||||
.waitForSnackbarReset()
|
||||
.click(selectors.fiscalData.fiscalDataButton)
|
||||
.wait(selectors.fiscalData.addressInput)
|
||||
.click(selectors.fiscalData.basicDataButton)
|
||||
.wait(100)
|
||||
.getInputValue(selectors.fiscalData.countryInput)
|
||||
.then(result => {
|
||||
expect(result).toEqual('Holanda');
|
||||
done();
|
||||
})
|
||||
.catch(catchErrors(done));
|
||||
});
|
||||
});
|
||||
|
|
|
@ -64,6 +64,10 @@
|
|||
"type": "boolean",
|
||||
"description": "The client has equalization tax"
|
||||
},
|
||||
"hasToInvoiceByAddress": {
|
||||
"type": "boolean",
|
||||
"description": "The client has to be invoiced by address"
|
||||
},
|
||||
"hasToInvoice": {
|
||||
"type": "boolean",
|
||||
"description": "Global invoicing enabled for the client"
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 9.7 KiB |
|
@ -1,6 +1,8 @@
|
|||
{
|
||||
"initial:before": {
|
||||
"loopback#favicon": {}
|
||||
"loopback#favicon": {
|
||||
"params": "$!../favicon.ico"
|
||||
}
|
||||
},
|
||||
"initial": {
|
||||
"compression": {},
|
||||
|
|
|
@ -68,16 +68,17 @@ module.exports = function(Self) {
|
|||
}
|
||||
|
||||
function sum(tickets) {
|
||||
var obj = {lines: 0, m3: 0};
|
||||
tickets.forEach(function(t, i) {
|
||||
obj.lines += t.lines;
|
||||
obj.m3 += t.m3;
|
||||
if (tickets[i].problem)
|
||||
tickets[i].problem = tickets[i].problem.trim();
|
||||
}, this);
|
||||
let obj = {lines: 0, m3: 0};
|
||||
if (tickets && tickets.length)
|
||||
tickets.forEach(function(t, i) {
|
||||
obj.lines += t.lines;
|
||||
obj.m3 += t.m3;
|
||||
if (tickets[i].problem)
|
||||
tickets[i].problem = tickets[i].problem.trim();
|
||||
}, this);
|
||||
obj.m3 = obj.m3.toFixed(2);
|
||||
obj.total = tickets.length;
|
||||
obj.tickets = tickets;
|
||||
obj.total = tickets ? tickets.length : 0;
|
||||
obj.tickets = tickets || [];
|
||||
return obj;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,24 +1,24 @@
|
|||
<!doctype html>
|
||||
<html ng-app="salix">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Salix</title>
|
||||
<script src="/acl"></script>
|
||||
</head>
|
||||
<body>
|
||||
<vn-app></vn-app>
|
||||
<script type="text/javascript"
|
||||
src="/static/routes.js">
|
||||
</script>
|
||||
<script type="text/javascript"
|
||||
src="/static/bundle.manifest.js">
|
||||
</script>
|
||||
<script type="text/javascript"
|
||||
src="/static/bundle.vendor.js">
|
||||
</script>
|
||||
<script type="text/javascript"
|
||||
src="/static/bundle.salix.js">
|
||||
</script>
|
||||
</body>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Salix</title>
|
||||
<script src="/acl"></script>
|
||||
</head>
|
||||
<body>
|
||||
<vn-app></vn-app>
|
||||
<script type="text/javascript"
|
||||
src="/static/routes.js">
|
||||
</script>
|
||||
<script type="text/javascript"
|
||||
src="/static/bundle.manifest.js">
|
||||
</script>
|
||||
<script type="text/javascript"
|
||||
src="/static/bundle.vendor.js">
|
||||
</script>
|
||||
<script type="text/javascript"
|
||||
src="/static/bundle.salix.js">
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
Loading…
Reference in New Issue