This commit is contained in:
Carlos Jimenez Ruiz 2019-02-06 09:13:02 +01:00
commit cf57d866ff
99 changed files with 908 additions and 478 deletions

View File

@ -38,7 +38,7 @@
"Vehicle": {
"dataSource": "vn"
},
"UserTableConfiguration": {
"UserConfigView": {
"dataSource": "vn"
}
}

View File

@ -1,9 +1,9 @@
{
"name": "UserTableConfiguration",
"name": "UserConfigView",
"base": "VnModel",
"options": {
"mysql": {
"table": "salix.userTableConfiguration"
"table": "salix.userConfigView"
}
},
"properties": {
@ -21,10 +21,10 @@
}
},
"relations": {
"worker": {
"user": {
"type": "belongsTo",
"model": "Worker",
"foreignKey": "workerFk"
"model": "Account",
"foreignKey": "userFk"
}
}
}

View File

@ -164,7 +164,7 @@ export default {
newPaymentButton: `${components.vnFloatButton}`,
newPaymentBankInut: `vn-client-risk-create vn-textfield[field="$ctrl.receipt.bankFk"] input`,
newPaymentAmountInput: `vn-client-risk-create vn-textfield[field="$ctrl.receipt.amountPaid"] input`,
saveButton: `${components.vnSubmit}`,
saveButton: `vn-client-risk-create vn-button[label="Save"]`,
firstRiskLineBalance: 'vn-client-risk-index vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(8)'
},

View File

@ -13,6 +13,5 @@ COPY front/nginx.conf sites-available/salix
RUN rm sites-enabled/default && ln -s ../sites-available/salix sites-enabled/salix
COPY dist /salix/dist
COPY front/salix/manifest.json /salix/dist/
CMD ["nginx", "-g", "daemon off;"]

View File

@ -47,9 +47,6 @@ export default class Dialog extends Component {
if (this.onOpen)
this.onOpen();
let firstFocusable = this.element.querySelector('input, textarea');
if (firstFocusable) firstFocusable.focus();
}
/**

View File

@ -37,4 +37,5 @@ September: Septiembre
October: Octubre
November: Noviembre
December: Diciembre
Has delivery: Hay reparto
Has delivery: Hay reparto
Loading: Cargando

View File

@ -3,10 +3,10 @@
<img src="./logo.svg" alt="Logo"></img>
</a>
<vn-icon
ng-if="$ctrl.showLeftMenuButton"
class="show-menu"
icon="menu"
ng-click="$ctrl.showLeftMenu()">
class="show-menu"
ng-if="$ctrl.leftMenu"
ng-click="$ctrl.leftMenu.show()">
</vn-icon>
<div class="main-title" translate>
{{$ctrl.$state.current.description}}
@ -14,20 +14,15 @@
<vn-spinner enable="$ctrl.vnApp.loading"></vn-spinner>
<vn-main-menu></vn-main-menu>
<vn-icon
ng-if="$ctrl.rightMenu"
class="show-menu"
icon="menu"
ng-click="$ctrl.showRightMenu()">
class="show-menu"
ng-if="$ctrl.rightMenu"
ng-click="$ctrl.rightMenu.show()">
</vn-icon>
</vn-topbar>
<div ui-view
class="main-view"
ng-class="{'padding': $ctrl.showTopbar}">
ng-class="{padding: $ctrl.showTopbar}">
<vn-home></vn-home>
</div>
<div
class="background"
ng-class="{shown: $ctrl.leftMenuShown || $ctrl.rightMenuShown}"
ng-click="$ctrl.hideMenus()">
</div>
<vn-snackbar vn-id="snackbar"></vn-snackbar>

View File

@ -1,19 +1,18 @@
import ngModule from '../../module';
import './style.scss';
/**
* The main graphical application component.
*
* @property {SideMenu} leftMenu The left menu, if it's present
* @property {SideMenu} rightMenu The left menu, if it's present
*/
export default class App {
constructor($, $element, vnApp, $state, $transitions) {
constructor($, $state, vnApp) {
Object.assign(this, {
$,
$element,
vnApp,
$state
});
$transitions.onStart({}, transition => {
let state = transition.targetState().name();
this.showLeftMenuButton = state.split('.').length >= 3;
this.hideMenus();
$state,
vnApp
});
}
@ -30,33 +29,6 @@ export default class App {
return state && state != 'login';
}
get leftMenu() {
return this.$element[0].querySelector('.left-menu');
}
showLeftMenu() {
if (!this.leftMenu) return;
this.leftMenu.classList.add('shown');
this.leftMenuShown = true;
}
showRightMenu() {
if (!this.rightMenu) return;
this.rightMenu.classList.add('shown');
this.rightMenuShown = true;
}
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) {
this.$.snackbar.show({message: message});
}
@ -69,7 +41,7 @@ export default class App {
this.$.snackbar.showError({message: message});
}
}
App.$inject = ['$scope', '$element', 'vnApp', '$state', '$transitions'];
App.$inject = ['$scope', '$state', 'vnApp'];
ngModule.component('vnApp', {
template: require('./app.html'),

View File

@ -1,9 +1,6 @@
@import "background";
@import "margin";
$menu-width: 16em;
$topbar-height: 4em;
$mobile-width: 800px;
@import "variables";
body {
@extend .bg-content;
@ -72,27 +69,6 @@ vn-app {
margin: 0 auto;
padding-left: $menu-width;
%side-menu {
display: block;
position: fixed;
z-index: 5;
bottom: 0;
width: $menu-width;
min-width: $menu-width;
background-color: white;
box-shadow: 0 .1em .2em rgba(1, 1, 1, .2);
overflow: auto;
}
.left-menu {
@extend %side-menu;
top: $topbar-height;
left: 0;
}
.right-menu {
@extend %side-menu;
top: $topbar-height;
right: 0;
}
}
.main-with-right-menu {
padding-right: $menu-width;
@ -102,18 +78,6 @@ vn-app {
}
}
}
& > .background {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: black;
z-index: 14;
opacity: 0;
transition: opacity 200ms ease-out;
}
@media screen and (max-width: $mobile-width) {
& > vn-topbar > header {
@ -135,32 +99,10 @@ vn-app {
}
vn-main-block {
padding-left: 0;
%side-menu-mobile {
top: 0;
transition: transform 200ms ease-out;
z-index: 15;
&.shown {
transform: translateZ(0) translateX(0);
}
}
.left-menu {
@extend %side-menu-mobile;
transform: translateZ(0) translateX(-$menu-width);
}
.right-menu {
@extend %side-menu-mobile;
transform: translateZ(0) translateX($menu-width);
}
}
.main-with-right-menu {
padding-right: 0;
}
}
& > .background.shown {
display: block;
opacity: .3;
}
}
}

View File

@ -0,0 +1 @@
import './style.scss';

View File

@ -0,0 +1,26 @@
@import "variables";
@keyframes fadein {
from {
opacity: 0;
}
}
vn-background {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: black;
z-index: 14;
@media screen and (max-width: $mobile-width) {
&.shown {
display: block;
opacity: .3;
animation: 500ms ease-out fadein;
}
}
}

View File

@ -2,6 +2,8 @@ import './app/app';
import './login/login';
import './home/home';
import './main-menu/main-menu';
import './background/background';
import './side-menu/side-menu';
import './left-menu/left-menu';
import './topbar/topbar';
import './user-configuration-popover';

View File

@ -5,26 +5,31 @@
class="unselectable">
{{currentUserName}}
</div>
<vn-icon
id="apps"
icon="apps"
vn-popover="apps-menu"
translate-attr="{title: 'Applications'}">
</vn-icon>
<vn-menu vn-id="apps-menu">
<ul pad-small>
<li ng-repeat="mod in ::$ctrl.modules" ui-sref="{{::mod.route.state}}">
<vn-icon icon="{{::mod.icon || 'photo'}}"></vn-icon>
<span translate>{{::mod.name}}</span>
</li>
</ul>
</vn-menu>
<vn-icon
id="logout"
icon="exit_to_app"
translate-attr="{title: 'Logout'}"
ng-click="$ctrl.onLogoutClick()">
</vn-icon>
<div>
<vn-icon
id="apps"
icon="apps"
vn-popover="apps-menu"
translate-attr="{title: 'Applications'}">
</vn-icon>
<vn-menu vn-id="apps-menu">
<ul pad-small>
<li ng-repeat="mod in ::$ctrl.modules" ui-sref="{{::mod.route.state}}">
<vn-icon icon="{{::mod.icon || 'photo'}}"></vn-icon>
<span translate>{{::mod.name}}</span>
</li>
</ul>
</vn-menu>
</div>
<div>
<vn-icon
id="logout"
icon="exit_to_app"
translate-attr="{title: 'Logout'}"
ng-click="$ctrl.onLogoutClick()">
</vn-icon>
</div>
</div>
<vn-user-configuration-popover vn-id="popover">
<vn-user-configuration-popover
vn-id="popover">
</vn-user-configuration-popover>

View File

@ -2,13 +2,13 @@ import ngModule from '../../module';
import './style.scss';
export default class MainMenu {
constructor($translate, $scope, $http, $window, vnModules, vnAuth) {
this.$ = $scope;
this.$http = $http;
this.$translate = $translate;
this.$window = $window;
this.modules = vnModules.get();
this.vnAuth = vnAuth;
constructor($, $http, vnAuth, vnModules) {
Object.assign(this, {
$,
$http,
vnAuth,
modules: vnModules.get()
});
}
$onInit() {
@ -30,7 +30,7 @@ export default class MainMenu {
this.vnAuth.logout();
}
}
MainMenu.$inject = ['$translate', '$scope', '$http', '$window', 'vnModules', 'vnAuth'];
MainMenu.$inject = ['$scope', '$http', 'vnAuth', 'vnModules'];
ngModule.component('vnMainMenu', {
template: require('./main-menu.html'),

View File

@ -12,7 +12,7 @@ vn-main-menu {
& > * {
cursor: pointer;
padding-left: .3em;
padding-left: .6em;
&:hover {
color: $main-01;
@ -21,10 +21,9 @@ vn-main-menu {
& > #user {
vertical-align: middle;
font-weight: bold;
padding-right: .4em;
margin-right: .2em;
}
& > vn-icon,
& > a > vn-icon {
& > div > vn-icon {
display: block;
font-size: 2.1em;
}

View File

@ -0,0 +1,9 @@
<vn-background
ng-class="{shown: $ctrl.shown}"
ng-click="$ctrl.hide()">
</vn-background>
<div
class="menu"
ng-class="{shown: $ctrl.shown}"
ng-transclude>
</div>

View File

@ -0,0 +1,78 @@
import ngModule from '../../module';
import './style.scss';
/**
* A side menu.
*
* @property {String} side [left|right] The side where the menu is displayed
* @property {Boolean} shown Whether the menu it's currently displayed (Only for small viewports)
*/
export default class SideMenu {
constructor($, $element, $window, $transitions) {
Object.assign(this, {
$,
$element,
$window,
$transitions,
side: 'left'
});
}
$onInit() {
this.menu = this.$element[0].querySelector('.menu');
if (this.side == 'right') {
this.menu.classList.add('right');
this.app.rightMenu = this;
} else {
this.menu.classList.add('left');
this.app.leftMenu = this;
}
}
$onDestroy() {
if (this.side == 'right')
this.app.rightMenu = null;
else
this.app.leftMenu = null;
}
onEscape(event) {
if (!event.defaultPrevented && event.key == 'Escape') {
event.preventDefault();
this.hide();
this.$.$digest();
}
}
onTransition(transition) {
if (transition.from().name !== transition.to().name)
this.hide();
}
show() {
this.shown = true;
this.handler = e => this.onEscape(e);
this.$window.addEventListener('keydown', this.handler);
this.stateHandler = this.$transitions.onStart({}, t => this.onTransition(t));
}
hide() {
this.$window.removeEventListener('keydown', this.handler);
this.stateHandler();
this.shown = false;
}
}
SideMenu.$inject = ['$scope', '$element', '$window', '$transitions'];
ngModule.component('vnSideMenu', {
template: require('./side-menu.html'),
controller: SideMenu,
transclude: true,
bindings: {
side: '@?'
},
require: {
app: '^vnApp'
}
});

View File

@ -0,0 +1,37 @@
@import "variables";
vn-side-menu > .menu {
display: block;
position: fixed;
z-index: 5;
bottom: 0;
width: $menu-width;
min-width: $menu-width;
background-color: white;
box-shadow: 0 .1em .2em rgba(1, 1, 1, .2);
overflow: auto;
top: $topbar-height;
&.left {
left: 0;
}
&.right {
right: 0;
}
@media screen and (max-width: $mobile-width) {
top: 0;
transition: transform 200ms ease-out;
z-index: 15;
&.left {
transform: translateZ(0) translateX(-$menu-width);
}
&.right {
transform: translateZ(0) translateX($menu-width);
}
&.shown {
transform: translateZ(0) translateX(0);
}
}
}

View File

@ -4,7 +4,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=no"/>
<meta name="mobile-web-app-capable" content="yes"/>
<link rel="manifest" href="manifest.json"/>
<link rel="manifest" href="<%= require('./manifest.json') %>"/>
<title vn-title translate></title>
</head>
<body>

View File

@ -1,12 +1,12 @@
{
"name": "Salix",
"start_url": "index.html",
"display": "standalone",
"theme_color": "#3d3d3d",
"icons": [
{
"src": "favicon.ico",
"sizes": "512x512"
}
],
"start_url": "index.html",
"display": "standalone",
"theme_color": "#3d3d3d"
]
}

View File

@ -77,4 +77,9 @@
}
}
}
}
vn-popover {
.vn-descriptor > .header > a:first-child {
visibility: hidden;
}
}

View File

@ -13,3 +13,4 @@ import './effects.scss';
import './order-product.scss';
import './summary.scss';
import './descriptor.scss';
import './modal-form.scss';

View File

@ -0,0 +1,38 @@
@import 'colors';
@import "./padding";
vn-dialog.modal-form {
vn-horizontal.header{
@extend .pad-small;
background-color: $main-01;
h5{
color: white;
margin: 0 auto;
}
}
tpl-body {
width: 100%;
}
table {
width: 100%
}
& > div{
padding: 0!important;
}
vn-textfield {
width: 100%;
}
.buttons{
margin-top: 0!important;
}
p{
display: none;
}
button.close > vn-icon{
color: white!important;
}
vn-ticket-sale-edit-discount > div {
padding-bottom: 0!important;
}
}

View File

@ -0,0 +1,4 @@
$menu-width: 16em;
$topbar-height: 4em;
$mobile-width: 800px;

View File

@ -65,5 +65,6 @@
"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 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"
"Tag value cannot be blank": "El valor del tag no puede quedar en blanco",
"ORDER_EMPTY": "Cesta vacía"
}

View File

@ -17,14 +17,6 @@ class Controller {
this.ndMonth = this.$scope.ndMonth;
}
$onInit() {
this.app.rightMenu = this.$element[0];
}
$onDestroy() {
this.app.rightMenu = null;
}
get zone() {
return this._zone;
}
@ -152,9 +144,6 @@ Controller.$inject = ['$element', '$scope', '$stateParams', '$http'];
ngModule.component('vnZoneCalendar', {
template: require('./index.html'),
controller: Controller,
require: {
app: '^vnApp'
},
bindings: {
zone: '<'
}

View File

@ -1,7 +1,7 @@
<vn-main-block>
<div class="left-menu">
<vn-side-menu side="left">
<vn-zone-descriptor zone="$ctrl.zone"></vn-zone-descriptor>
<vn-left-menu></vn-left-menu>
</div>
</vn-side-menu>
<div class="content-block" ui-view></div>
</vn-main-block>

View File

@ -16,8 +16,7 @@
on-selection="$ctrl.onSelection(item)">
</vn-treeview>
</vn-card>
<vn-zone-calendar
class="right-menu"
zone="::$ctrl.zone">
</vn-zone-calendar>
<vn-side-menu side="right">
<vn-zone-calendar zone="::$ctrl.zone"></vn-zone-calendar>
</vn-side-menu>
</div>

View File

@ -1,7 +1,7 @@
<vn-main-block>
<div class="left-menu">
<vn-side-menu side="left">
<vn-claim-descriptor claim="$ctrl.claim"></vn-claim-descriptor>
<vn-left-menu></vn-left-menu>
</div>
</vn-side-menu>
<div class="content-block" ui-view></div>
</vn-main-block>

View File

@ -1,7 +1,7 @@
<vn-main-block>
<div class="left-menu">
<vn-side-menu side="left">
<vn-client-descriptor client="$ctrl.client"></vn-client-descriptor>
<vn-left-menu></vn-left-menu>
</div>
</vn-side-menu>
<div class="content-block" ui-view></div>
</vn-main-block>

View File

@ -5,8 +5,5 @@ vn-client-descriptor-popover {
& > vn-card{
margin: 0!important;
}
.header > a:first-child {
display: none
}
}
}
}

View File

@ -1,44 +1,45 @@
<mg-ajax path="/client/api/receipts" options="vnPost"></mg-ajax>
<vn-watcher
vn-id="watcher"
data="$ctrl.receipt"
form="form"
save="post">
</vn-watcher>
<form name="form" ng-submit="$ctrl.onSubmit()" compact>
<vn-card pad-large>
<vn-horizontal>
<vn-date-picker vn-one
label="Date"
model="$ctrl.receipt.payed"
ini-options="{dateFormat: 'd-m-Y', time_24hr: true}">
</vn-date-picker>
<vn-autocomplete vn-one
url="/api/Companies"
label="Company"
show-field="code"
value-field="id"
field="$ctrl.receipt.companyFk">
</vn-autocomplete>
<vn-dialog
vn-id="dialog"
class="modal-form">
<tpl-body>
<mg-ajax path="/client/api/receipts" options="vnPost"></mg-ajax>
<vn-horizontal class="header">
<h5><span translate>New payment</span></h5>
</vn-horizontal>
<vn-horizontal>
<vn-textfield
vn-one
margin-medium-right
label="Bank"
field="$ctrl.receipt.bankFk">
</vn-textfield>
<vn-textfield
vn-one
margin-medium-right
label="Amount"
field="$ctrl.receipt.amountPaid"
vn-focus>
</vn-textfield>
<div pad-medium>
<vn-horizontal>
<vn-date-picker vn-one
label="Date"
model="$ctrl.receipt.payed"
ini-options="{dateFormat: 'd-m-Y', time_24hr: true}">
</vn-date-picker>
<vn-autocomplete vn-one
url="/api/Companies"
label="Company"
show-field="code"
value-field="id"
field="$ctrl.receipt.companyFk">
</vn-autocomplete>
</vn-horizontal>
<vn-horizontal>
<vn-textfield
vn-one
margin-medium-right
label="Bank"
field="$ctrl.receipt.bankFk">
</vn-textfield>
<vn-textfield
vn-one
margin-medium-right
label="Amount"
field="$ctrl.receipt.amountPaid"
vn-focus>
</vn-textfield>
</vn-horizontal>
</div>
<vn-horizontal margin-medium class="buttons-bar">
<vn-button vn-one label="Save" ng-click="$ctrl.save()"></vn-button>
<vn-button vn-one ng-click="$ctrl.hide()" label="Cancel"></vn-button>
</vn-horizontal>
</vn-card>
<vn-button-bar>
<vn-submit label="Save"></vn-submit>
<vn-button ng-click="$ctrl.cancel($event)" label="Cancel"></vn-button>
</vn-button-bar>
</form>
</tpl-body>
</vn-dialog>

View File

@ -1,11 +1,13 @@
import ngModule from '../../module';
import './style.scss';
class Controller {
constructor($scope, $state, $http, $stateParams) {
constructor($scope, $state, $http, vnApp, $translate) {
this.$http = $http;
this.$ = $scope;
this.$state = $state;
this.$stateParams = $stateParams;
this.vnApp = vnApp;
this.$translate = $translate;
this.receipt = {
payed: new Date(),
@ -13,21 +15,26 @@ class Controller {
companyFk: window.localStorage.defaultCompanyFk,
bankFk: window.localStorage.defaultBankFk
};
if (this.$stateParams.payed)
this.receipt.payed = this.$stateParams.payed;
if (this.$stateParams.bankFk)
this.receipt.bankFk = this.$stateParams.bankFk;
if (this.$stateParams.amountPaid)
this.receipt.amountPaid = this.$stateParams.amountPaid;
if (this.$stateParams.companyFk)
this.receipt.companyFk = this.$stateParams.companyFk;
}
$onInit() {
set payed(value) {
this.receipt.payed = value;
}
set bankFk(value) {
this.receipt.bankFk = value;
}
set amountPaid(value) {
this.receipt.amountPaid = value;
}
set companyFk(value) {
this.receipt.companyFk = value;
this.getAmountPaid();
}
getAmountPaid() {
let filter = {
where: {
clientFk: this.$state.params.id,
@ -41,25 +48,34 @@ class Controller {
});
}
cancel() {
this.goToIndex();
show() {
this.$.dialog.show();
}
goToIndex() {
this.$state.go('client.card.risk.index');
hide() {
this.$.dialog.hide();
}
onSubmit() {
this.$.watcher.submit().then(
() => {
this.goToIndex();
}
);
save() {
let query = `/client/api/receipts`;
this.$http.post(query, this.receipt).then(() => {
this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
this.hide();
if (this.onResponse)
this.onResponse();
});
}
}
Controller.$inject = ['$scope', '$state', '$http', '$stateParams'];
Controller.$inject = ['$scope', '$state', '$http', 'vnApp', '$translate'];
ngModule.component('vnClientRiskCreate', {
template: require('./index.html'),
controller: Controller
controller: Controller,
bindings: {
payed: '<?',
bankFk: '<?',
amountPaid: '<?',
onResponse: '&?',
companyFk: '<?'
}
});

View File

@ -0,0 +1,3 @@
vn-horizontal.buttons-bar{
text-align: center;
}

View File

@ -94,13 +94,16 @@
<vn-pagination model="model"></vn-pagination>
</vn-card>
</vn-vertical>
<a ui-sref="client.card.risk.create"
<vn-float-button
vn-acl="administrative"
vn-acl-action="remove"
icon="add"
vn-tooltip="New payment"
vn-bind="+"
fixed-bottom-right>
<vn-float-button
vn-acl="administrative"
vn-acl-action="remove"
icon="add">
</vn-float-button>
</a>
fixed-bottom-right
ng-click="$ctrl.openCreateDialog()">
</vn-float-button>
<vn-client-risk-create vn-id="riskCreateDialog">
</vn-client-risk-create>

View File

@ -31,6 +31,9 @@ class Controller {
setOrder(value) {
this.params.params.companyFk = value;
this.filter.where.companyFk = value;
}
refresh() {
this.$.model.refresh();
this.$.riskModel.refresh();
}
@ -55,6 +58,14 @@ class Controller {
return this._risks;
}
openCreateDialog() {
this.$.riskCreateDialog.companyFk = this.companyFk;
this.$.riskCreateDialog.onResponse = () => {
this.refresh();
};
this.$.riskCreateDialog.show();
}
onDownload() {
alert('Not implemented yet');
}

View File

@ -1,75 +1,75 @@
<div class="search-panel">
<form ng-submit="$ctrl.onSearch()">
<vn-horizontal>
<vn-textfield
vn-one
label="General search"
model="filter.search"
vn-focus>
</vn-textfield>
</vn-horizontal>
<vn-horizontal>
<vn-textfield
vn-one
label="Client id"
model="filter.id">
</vn-textfield>
<vn-textfield
vn-one
label="Tax number"
model="filter.fi">
</vn-textfield>
</vn-horizontal>
<vn-horizontal>
<vn-textfield
vn-one label="Name"
model="filter.name">
</vn-textfield>
<vn-autocomplete
vn-one
field="filter.salesPersonFk"
url="/client/api/Clients/activeWorkersWithRole"
search-function="{firstName: $search}"
show-field="firstName"
value-field="id"
where="{role: 'salesPerson'}"
label="Salesperson">
<tpl-item>{{firstName}} {{name}}</tpl-item>
</vn-autocomplete>
</vn-horizontal>
<vn-horizontal>
<vn-textfield
vn-one
label="Social name"
model="filter.socialName">
</vn-textfield>
</vn-horizontal>
<vn-horizontal>
<vn-textfield
vn-one
label="Town/City"
model="filter.city">
</vn-textfield>
<vn-textfield
vn-one
label="Postcode"
model="filter.postcode">
</vn-textfield>
</vn-horizontal>
<vn-horizontal>
<vn-textfield
vn-one
label="Email"
model="filter.email">
</vn-textfield>
<vn-textfield
vn-one
label="Phone"
model="filter.phone">
</vn-textfield>
</vn-horizontal>
<vn-horizontal margin-large-top>
<vn-submit label="Search"></vn-submit>
</vn-horizontal>
</form>
<form ng-submit="$ctrl.onSearch()">
<vn-horizontal>
<vn-textfield
vn-one
label="General search"
model="filter.search"
vn-focus>
</vn-textfield>
</vn-horizontal>
<vn-horizontal>
<vn-textfield
vn-one
label="Client id"
model="filter.id">
</vn-textfield>
<vn-textfield
vn-one
label="Tax number"
model="filter.fi">
</vn-textfield>
</vn-horizontal>
<vn-horizontal>
<vn-textfield
vn-one label="Name"
model="filter.name">
</vn-textfield>
<vn-autocomplete
vn-one
field="filter.salesPersonFk"
url="/client/api/Clients/activeWorkersWithRole"
search-function="{firstName: $search}"
show-field="firstName"
value-field="id"
where="{role: 'salesPerson'}"
label="Salesperson">
<tpl-item>{{firstName}} {{name}}</tpl-item>
</vn-autocomplete>
</vn-horizontal>
<vn-horizontal>
<vn-textfield
vn-one
label="Social name"
model="filter.socialName">
</vn-textfield>
</vn-horizontal>
<vn-horizontal>
<vn-textfield
vn-one
label="Town/City"
model="filter.city">
</vn-textfield>
<vn-textfield
vn-one
label="Postcode"
model="filter.postcode">
</vn-textfield>
</vn-horizontal>
<vn-horizontal>
<vn-textfield
vn-one
label="Email"
model="filter.email">
</vn-textfield>
<vn-textfield
vn-one
label="Phone"
model="filter.phone">
</vn-textfield>
</vn-horizontal>
<vn-horizontal margin-large-top>
<vn-submit label="Search"></vn-submit>
</vn-horizontal>
</form>
</div>

View File

@ -1,7 +1,7 @@
<vn-main-block>
<div class="left-menu">
<vn-side-menu side="left">
<vn-item-descriptor item="$ctrl.item"></vn-item-descriptor>
<vn-left-menu></vn-left-menu>
</div>
</vn-side-menu>
<div class="content-block" ui-view></div>
</vn-main-block>

View File

@ -3,9 +3,5 @@ vn-item-descriptor-popover {
display: block;
width: 16em;
min-height: 28em;
.header > a:first-child {
display: none
}
}
}

View File

@ -39,7 +39,7 @@
<vn-tr ng-repeat="entry in entries">
<vn-td number>
<vn-check
field="entries.isIgnored"
field="entry.isIgnored"
disabled="true">
</vn-check>
</vn-td>

View File

@ -4,12 +4,8 @@ vn-ticket-descriptor-popover {
width: 16em;
max-height: 28em;
&>vn-card {
& > vn-card {
margin: 0!important;
}
.header > a:first-child {
display: none
}
}
}

View File

@ -1,5 +1,4 @@
import ngModule from '../module';
import './style.scss';
class Controller {
constructor($state, $scope, $http, vnApp, $translate) {

View File

@ -37,7 +37,7 @@ module.exports = Self => {
},
});
Self.catalogFilter = async (orderFk, orderBy, filter, tags) => {
Self.catalogFilter = async(orderFk, orderBy, filter, tags) => {
let conn = Self.dataSource.connector;
const stmts = [];
let stmt;

View File

@ -1,7 +1,7 @@
<vn-main-block>
<div class="left-menu">
<vn-side-menu side="left">
<vn-order-descriptor order="$ctrl.order"></vn-order-descriptor>
<vn-left-menu></vn-left-menu>
</div>
</vn-side-menu>
<div class="content-block" ui-view></div>
</vn-main-block>

View File

@ -97,10 +97,9 @@
</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-side-menu side="right">
<vn-catalog-filter order="$ctrl.order"></vn-catalog-filter>
</vn-side-menu>
<vn-order-prices-popover
vn-id="pricesPopover"
order="$ctrl.order">

View File

@ -19,9 +19,7 @@
</vn-one>
</vn-horizontal>
<vn-horizontal class="input">
<vn-autocomplete
vn-one
vn-id="type"
<vn-autocomplete vn-id="type" vn-one
data="$ctrl.itemTypes"
on-change="$ctrl.type = {
id: value,

View File

@ -14,18 +14,15 @@ class Controller {
this.tags = [];
}
$onInit() {
this.app.rightMenu = this.$element[0];
}
$onDestroy() {
this.app.rightMenu = null;
}
get order() {
return this._order;
}
/**
* Sets filter values from state params
*
* @param {Object} value - Order data
*/
set order(value) {
if (!value.id || this._order) return;
@ -57,20 +54,18 @@ class Controller {
this.itemTypes = [];
this.type = null;
if (!value || (this.category && this.category.id == value.id)) {
if (!value || (this.category && this.category.id == value.id))
this._category = null;
this.updateStateParams();
else
this._category = value;
return;
}
this._category = value;
this.updateStateParams();
const query = `/item/api/ItemCategories/${value.id}/itemTypes`;
this.$http.get(query).then(res => {
this.itemTypes = res.data;
});
if (this.tags.length > 0)
this.applyFilters();
if (value)
this.updateItemTypes();
}
get type() {
@ -91,6 +86,16 @@ class Controller {
this.applyFilters();
}
/**
* Refreshes item type dropdown data
*/
updateItemTypes() {
const query = `/item/api/ItemCategories/${this.category.id}/itemTypes`;
this.$http.get(query).then(res => {
this.itemTypes = res.data;
});
}
onSearch(event) {
if (event.key !== 'Enter') return;
this.tags.push({
@ -153,6 +158,9 @@ class Controller {
this.$panel = null;
}
/**
* Updates url state params from filter values
*/
updateStateParams() {
const params = {};
@ -174,8 +182,7 @@ ngModule.component('vnCatalogFilter', {
template: require('./index.html'),
controller: Controller,
require: {
catalog: '^vnOrderCatalog',
app: '^vnApp'
catalog: '^vnOrderCatalog'
},
bindings: {
order: '<',

View File

@ -41,4 +41,8 @@ vn-catalog-filter > div {
flex-wrap: wrap;
@extend .pad-medium;
}
vn-autocomplete[vn-id="type"] .list {
max-height: 20em
}
}

View File

@ -70,7 +70,7 @@
</vn-card>
<vn-button-bar ng-if="!$ctrl.order.isConfirmed">
<vn-button
label="Save"
label="Confirm"
ng-click="$ctrl.save()">
</vn-button>
</vn-button-bar>

View File

@ -92,6 +92,7 @@ class Controller {
this.$http.post(query).then(() => {
this.vnApp.showSuccess(this.$translate.instant('Order confirmed'));
this.$state.go(`ticket.index`, {clientFk: this.order.clientFk});
});
}
}

View File

@ -1,2 +1,3 @@
Remove item: Eliminar articulo
Order confirmed: Pedido confirmado
Delete row: Eliminar linea
Order confirmed: Pedido confirmado
Are you sure you want to delete this row?: ¿Estas seguro de que quieres borrar esta línea?

View File

@ -27,6 +27,9 @@
},
"checked": {
"type": "Number"
},
"externalId": {
"type": "Number"
}
},
"relations": {

View File

@ -1,7 +1,7 @@
<vn-main-block>
<div class="left-menu">
<vn-side-menu side="left">
<vn-ticket-descriptor ticket="$ctrl.ticket" card-reload="$ctrl.reload()"></vn-ticket-descriptor>
<vn-left-menu></vn-left-menu>
</div>
</vn-side-menu>
<div class="content-block" ui-view></div>
</vn-main-block>

View File

@ -16,8 +16,10 @@
label="Address"
show-field="nickname"
value-field="id"
field="$ctrl.ticket.addressFk">
<tpl-item>{{::nickname}}
field="$ctrl.ticket.addressFk"
order="isActive DESC">
<tpl-item ng-class="::{notActive: isActive === false}">
<span class="inactive" translate>{{::isActive ? '' : 'INACTIVE'}}</span> {{::nickname}}
<span ng-show="city || province || street">- {{::street}} - {{::city}} - {{::province.name}} - {{::agencyMode.name}}</span>
</tpl-item>
</vn-autocomplete>

View File

@ -1,5 +1,6 @@
import ngModule from '../../module';
import {toJsonDate} from 'core/lib/date';
import './style.scss';
class Controller {
constructor($scope, $http, $translate, vnApp) {

View File

@ -0,0 +1,13 @@
@import 'colors';
tpl-item{
&.notActive {
background-color: $main-bg;
color: $secondary-font-color;
width: 100%;
}
& > .inactive {
text-transform: uppercase;
}
}

View File

@ -34,6 +34,6 @@
<vn-pagination model="model"></vn-pagination>
</vn-card>
</vn-vertical>
<a ui-sref="ticket.card.tracking.edit" vn-bind="+" vn-visible-by="production, administrative, salesperson" fixed-bottom-right>
<a ui-sref="ticket.card.tracking.edit" vn-bind="+" fixed-bottom-right>
<vn-float-button icon="add"></vn-float-button>
</a>

View File

@ -1,7 +1,7 @@
<vn-main-block>
<div class="left-menu">
<vn-side-menu side="left">
<vn-worker-descriptor worker="$ctrl.worker"></vn-worker-descriptor>
<vn-left-menu></vn-left-menu>
</div>
</vn-side-menu>
<div class="content-block" ui-view></div>
</vn-main-block>

View File

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

View File

@ -26,7 +26,7 @@
<p>{{$t('sections.howToBuy.stock')}}</p>
<p>{{$t('sections.howToBuy.delivery')}}</p> -->
</section>
<email-footer></email-footer>
<email-footer :locale="locale"></email-footer>
</section>
</body>
</html>

View File

@ -30,7 +30,8 @@ module.exports = {
});
},
created() {
this.$i18n.locale = this.locale;
if (this.locale)
this.$i18n.locale = this.locale;
},
methods: {
fetchClient(claimFk) {

View File

@ -62,7 +62,7 @@
</section>
</p>
</section>
<email-footer></email-footer>
<email-footer :locale="locale"></email-footer>
</section>
</body>
</html>

View File

@ -19,7 +19,8 @@ module.exports = {
});
},
created() {
this.$i18n.locale = this.locale;
if (this.locale)
this.$i18n.locale = this.locale;
},
methods: {
fetchClient(clientFk) {

View File

@ -1,3 +0,0 @@
.blue {
color: blue
}

View File

@ -1,4 +0,0 @@
<div>
<span class="red">{{$t('clientId')}}: {{ id1 }} {{ id2 }}</span>
<span class="blue">heey</span>
</div>

View File

@ -1,35 +0,0 @@
const database = require(`${appPath}/lib/database`);
const UserException = require(`${appPath}/lib/exceptions/userException`);
module.exports = {
name: 'delivery-note',
async asyncData(ctx, params) {
const promises = [];
const dataIndex = promises.push(this.methods.fetchData()) - 1;
const itemsIndex = promises.push(this.methods.fetchItems()) - 1;
return Promise.all(promises).then(result => {
const [[data]] = result[dataIndex];
const [[items]] = result[itemsIndex];
return {
id1: data.id,
id2: items.id,
};
});
},
data() {
return {
id: null,
};
},
methods: {
fetchData() {
return database.pool.query('SELECT 1 AS id');
},
fetchItems() {
return database.pool.query('SELECT 2 AS id');
},
},
};

View File

@ -1,8 +0,0 @@
module.exports = {
messages: {
es: {
clientId: 'Id cliente',
},
},
}
;

View File

@ -6,6 +6,9 @@ module.exports = {
};
},
created() {
if (this.locale)
this.$i18n.locale = this.locale;
const embeded = [];
this.files.map(file => {
const src = this.isPreview ? `/api/${file}` : `cid:${file}`;
@ -27,4 +30,5 @@ module.exports = {
],
};
},
props: ['locale']
};

View File

@ -19,5 +19,24 @@ module.exports = {
escrito al domicilio social de la entidad. La finalidad del fichero es la gestión administrativa, contabilidad, y facturación.`,
},
},
/* fr: {
buttons: {
webAcccess: 'Visitez notre site web',
info: 'Ayúdanos a mejorar',
},
privacy: {
fiscalAddress: 'VERDNATURA LEVANTE SL, B97367486 Avda. Espioca, 100, 46460 Silla · www.verdnatura.es · clientes@verdnatura.es',
disclaimer: `- AVISO - Ce message est privé et confidentiel et doit être utilisé.
exclusivamente por la persona destinataria del mismo. Si has recibido este mensaje
por error, te rogamos lo comuniques al remitente y borres dicho mensaje y cualquier documento
adjunto que pudiera contener. Verdnatura Levante SL no renuncia a la confidencialidad ni a
ningún privilegio por causa de transmisión errónea o mal funcionamiento. Igualmente no se hace
responsable de los cambios, alteraciones, errores u omisiones que pudieran hacerse al mensaje una vez enviado.`,
law: `En cumplimiento de lo dispuesto en la Ley Orgánica 15/1999, de Protección de Datos de Carácter Personal,
te comunicamos que los datos personales que facilites se incluirán en ficheros automatizados de VERDNATURA LEVANTE S.L.,
pudiendo en todo momento ejercitar los derechos de acceso, rectificación, cancelación y oposición, comunicándolo por
escrito al domicilio social de la entidad. La finalidad del fichero es la gestión administrativa, contabilidad, y facturación.`,
},
}, */
},
};

View File

@ -52,7 +52,7 @@
</p>
</section>
<!-- Footer component -->
<email-footer></email-footer>
<email-footer :locale="locale"></email-footer>
<!-- End footer component -->
</section>
</body>

View File

@ -30,7 +30,8 @@ module.exports = {
});
},
created() {
this.$i18n.locale = this.locale;
if (this.locale)
this.$i18n.locale = this.locale;
},
methods: {
fetchClient(clientFk, companyFk) {

View File

@ -35,7 +35,7 @@
</p>
</section>
<!-- Footer component -->
<email-footer></email-footer>
<email-footer :locale="locale"></email-footer>
<!-- End footer component -->
</section>
</body>

View File

@ -31,7 +31,8 @@ module.exports = {
});
},
created() {
this.$i18n.locale = this.locale;
if (this.locale)
this.$i18n.locale = this.locale;
},
methods: {
fetchClient(clientFk, companyFk) {

View File

@ -38,7 +38,7 @@
<p>{{ $t('notifyAnError') }}</p>
</section>
<!-- Footer component -->
<email-footer></email-footer>
<email-footer :locale="locale"></email-footer>
<!-- End footer component -->
</section>
</body>

View File

@ -21,7 +21,8 @@ module.exports = {
});
},
created() {
this.$i18n.locale = this.locale;
if (this.locale)
this.$i18n.locale = this.locale;
},
methods: {
fetchClient(clientFk) {

View File

@ -49,7 +49,7 @@
</p>
</section>
<!-- Footer component -->
<email-footer></email-footer>
<email-footer :locale="locale"></email-footer>
<!-- End footer component -->
</section>
</body>

View File

@ -19,7 +19,8 @@ module.exports = {
});
},
created() {
this.$i18n.locale = this.locale;
if (this.locale)
this.$i18n.locale = this.locale;
},
data() {
return {

View File

@ -1,4 +1,8 @@
module.exports = {
name: 'report-footer',
props: ['leftText', 'centerText']
created() {
if (this.locale)
this.$i18n.locale = this.locale;
},
props: ['leftText', 'centerText', 'locale']
};

View File

@ -1,6 +1,9 @@
module.exports = {
name: 'report-header',
created() {
if (this.locale)
this.$i18n.locale = this.locale;
const embeded = [];
this.files.map(file => {
embeded[file] = `file://${__dirname + file}`;
@ -12,4 +15,5 @@ module.exports = {
files: ['/assets/images/report-logo.svg'],
};
},
props: ['locale']
};

View File

@ -75,7 +75,8 @@
<report-footer id="pageFooter"
:left-text="$t('claim', [claimId])"
:center-text="clientName">
:center-text="clientName"
:locale="locale">
</report-footer>
</section>
</body>

View File

@ -27,7 +27,8 @@ module.exports = {
});
},
created() {
this.$i18n.locale = this.locale;
if (this.locale)
this.$i18n.locale = this.locale;
},
methods: {
dated: () => {

View File

@ -0,0 +1,7 @@
const CssReader = require(`${appPath}/lib/cssReader`);
module.exports = new CssReader([
`${appPath}/common/css/layout.css`,
`${appPath}/common/css/misc.css`,
`${__dirname}/style.css`])
.mergeStyles();

View File

@ -0,0 +1,14 @@
.container {
color: #000
}
.title {
font-weight: 100;
margin-top: 0;
margin-bottom: 20px;
font-size: 2em
}
table.column-oriented {
margin-top: 50px !important
}

View File

@ -0,0 +1,86 @@
<!DOCTYPE html>
<html lang="es">
<body>
<section class="container">
<report-header></report-header>
<section class="main">
<section class="columns">
<section class="size50">
<section class="size75">
<h1 class="title uppercase">{{$t('title')}}</h1>
<table class="row-oriented">
<tbody>
<tr>
<td class="font gray uppercase">{{$t('clientId')}}</td>
<th>{{clientId}}</th>
</tr>
<tr>
<td class="font gray uppercase">{{$t('ticketId')}}</td>
<th>{{ticketId}}</th>
</tr>
<tr>
<td class="font gray uppercase">{{$t('date')}}</td>
<th>{{dated()}}</th>
</tr>
</tbody>
</table>
</section>
</section>
<section class="size50">
<section class="panel">
<section class="header">{{$t('clientData')}}</section>
<section class="body">
<h3 class="uppercase">{{clientName}}</h3>
<section>
{{street}}
</section>
<section>
{{postcode}}, {{city}} ({{province}})
</section>
<section>
{{country}}
</section>
</section>
</section>
</section>
</section>
<table class="column-oriented">
<thead>
<tr>
<th>{{$t('date')}}</th>
<th>{{$t('concept')}}</th>
<th class="number">{{$t('invoiced')}}</th>
<th class="number">{{$t('payed')}}</th>
<th class="number">{{$t('balance')}}</th>
</tr>
</thead>
<tbody>
<tr v-for="sale in sales" :key="sale.id">
<td>{{toISOString(sale.issued)}}</td>
<td>{{sale.ref}}</td>
<td class="number">{{sale.debtOut}}</td>
<td class="number">{{sale.debtIn}}</td>
<td class="number">{{a}}</td>
</tr>
</tbody>
<tfoot>
<!-- <tr>
<td></td>
<td></td>
<td class="number"><strong class="pull-left">Total</strong> {{getTotalDebtOut()}}</td>
<td class="number">{{getTotalDebtIn()}}</td>
<td class="number">{{totalBalance}}</td>
</tr> -->
</tfoot>
</table>
</section>
<report-footer id="pageFooter"
:left-text="$t('ticket', [clientId])"
:center-text="clientName"
:locale="locale">
</report-footer>
</section>
</body>
</html>

View File

@ -0,0 +1,72 @@
const strftime = require('strftime');
const database = require(`${appPath}/lib/database`);
const UserException = require(`${appPath}/lib/exceptions/userException`);
module.exports = {
name: 'rpt-delivery-note',
async asyncData(ctx, params) {
const promises = [];
const data = {};
if (!params.ticketFk)
throw new UserException('No ticket id specified');
promises.push(this.methods.fetchClient(params.ticketFk));
// promises.push(this.methods.fetchSales(params.ticketFk));
return Promise.all(promises).then(result => {
const [[client]] = result[0];
// const [[sales]] = result[1];
if (!client)
throw new UserException('No client data found');
Object.assign(data, client);
return data;
});
},
created() {
if (this.locale)
this.$i18n.locale = this.locale;
},
data() {
return {totalBalance: 0.00};
},
methods: {
fetchClient(ticketFk) {
return database.pool.query(
`SELECT
c.id clientId,
u.lang locale,
c.email AS recipient,
c.socialName AS clientName,
c.street,
c.postcode,
c.city,
c.fi,
p.name AS province,
ct.country
FROM ticket t
JOIN client c ON c.id = t.clientFk
JOIN account.user u ON u.id = c.id
JOIN country ct ON ct.id = c.countryFk
LEFT JOIN province p ON p.id = c.provinceFk
WHERE t.id = ?`, [ticketFk]);
},
fetchSales(clientFk, companyFk) {
return database.pool.query(
`CALL vn.clientGetDebtDiary(?, ?)`, [clientFk, companyFk]);
},
dated: () => {
return strftime('%d-%m-%Y', new Date());
},
toISOString: date => {
return strftime('%d-%m-%Y', date);
},
},
components: {
'report-header': require('../report-header'),
'report-footer': require('../report-footer'),
},
};

View File

@ -0,0 +1,16 @@
module.exports = {
messages: {
es: {
title: 'Albarán',
ticketId: 'Albarán',
clientId: 'Cliente',
clientData: 'Datos del cliente',
date: 'Fecha',
concept: 'Concepto',
invoiced: 'Facturado',
payed: 'Pagado',
balance: 'Saldo',
ticket: 'Albarán {0}'
},
},
};

View File

@ -74,7 +74,8 @@
<report-footer id="pageFooter"
:left-text="$t('client', [clientId])"
:center-text="clientName">
:center-text="clientName"
:locale="locale">
</report-footer>
</section>
</body>

View File

@ -30,7 +30,8 @@ module.exports = {
});
},
created() {
this.$i18n.locale = this.locale;
if (this.locale)
this.$i18n.locale = this.locale;
},
data() {
return {totalBalance: 0.00};

View File

@ -142,7 +142,8 @@
<report-footer id="pageFooter"
:left-text="$t('order', [mandateCode])"
:center-text="clientName">
:center-text="clientName"
:locale="locale">
</report-footer>
</section>
</body>

View File

@ -0,0 +1,7 @@
const CssReader = require(`${appPath}/lib/cssReader`);
module.exports = new CssReader([
`${appPath}/common/css/layout.css`,
`${appPath}/common/css/misc.css`,
`${__dirname}/style.css`])
.mergeStyles();

View File

@ -0,0 +1,3 @@
table.column-oriented {
margin-top: 50px !important
}

View File

@ -0,0 +1,35 @@
<!DOCTYPE html>
<html lang="es">
<body>
<section class="container">
<report-header :locale="locale"></report-header>
<section class="main">
<!-- Report start -->
<h1 class="title">{{$t('title')}}</h1>
<p>{{$t('date')}} {{dated()}}</p>
<table class="column-oriented">
<thead>
<tr>
<th>Id</th>
<th>{{$t('concept')}}</th>
<th>{{$t('quantity')}}</th>
</tr>
</thead>
<tbody>
<tr v-for="sale in sales" :key="sale.id">
<td class="font gray">{{sale.id}}</td>
<td>{{sale.concept}}</td>
<td>{{sale.quantity}}</td>
</tr>
</tbody>
</table>
<!-- Report end -->
</section>
<report-footer id="pageFooter"
:left-text="$t('client', [client.id])"
:center-text="client.name"
:locale="locale">
</report-footer>
</section>
</body>
</html>

View File

@ -0,0 +1,32 @@
const strftime = require('strftime');
module.exports = {
name: 'sample-report',
created() {
if (this.locale)
this.$i18n.locale = this.locale;
},
data() {
return {
client: {
id: 10252,
name: 'Batman',
},
sales: [
{id: 1, concept: 'My item 1', quantity: 25},
{id: 2, concept: 'My item 2', quantity: 50},
{id: 3, concept: 'My item 3', quantity: 150}
],
locale: 'es'
};
},
methods: {
dated: () => {
return strftime('%d-%m-%Y', new Date());
},
},
components: {
'report-header': require('../report-header'),
'report-footer': require('../report-footer'),
},
};

View File

@ -0,0 +1,11 @@
module.exports = {
messages: {
es: {
title: 'Sample report',
date: 'Fecha',
quantity: 'Cantidad',
concept: 'Concepto',
client: 'Cliente {0}',
},
},
};

View File

@ -27,7 +27,8 @@ module.exports = {
});
},
created() {
this.$i18n.locale = this.locale;
if (this.locale)
this.$i18n.locale = this.locale;
},
methods: {

View File

@ -0,0 +1,9 @@
CREATE TABLE `salix`.`userConfigView` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`userFk` int(10) unsigned NOT NULL,
`tableCode` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`configuration` text COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`),
UNIQUE KEY `uniqueUser_TableCode` (`userFk`,`tableCode`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

View File

@ -1,18 +0,0 @@
CREATE TABLE `salix`.`userTableConfiguration` (
`id` INT NOT NULL AUTO_INCREMENT,
`workerFk` INT(11) NOT NULL,
`tableCode` VARCHAR(255) NOT NULL,
`configuration` TEXT NULL,
PRIMARY KEY (`id`));
ALTER TABLE `salix`.`userTableConfiguration`
ADD INDEX `fgn_worker_idx` (`workerFk` ASC);
ALTER TABLE `salix`.`userTableConfiguration`
ADD CONSTRAINT `fgn_worker`
FOREIGN KEY (`workerFk`)
REFERENCES `vn2008`.`Trabajadores` (`Id_Trabajador`)
ON DELETE CASCADE
ON UPDATE CASCADE;

View File

@ -0,0 +1,2 @@
INSERT INTO `salix`.`ACL` (`id`, `model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES (144, 'Stowaway', '*', '*', 'ALLOW', 'ROLE', 'employee');
INSERT INTO `salix`.`ACL` (`id`, `model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES (145, 'Ticket', 'getPossibleStowaways', 'READ', 'ALLOW', 'ROLE', 'employee');

View File

@ -29,7 +29,13 @@ let baseConfig = {
loader: 'json-loader!yaml-loader'
}, {
test: /\.html$/,
loader: 'html-loader'
loader: 'html-loader',
options: {
attrs: [
'img:src',
'link:href'
]
}
}, {
test: /\.css$/,
loader: 'style-loader!css-loader'
@ -50,6 +56,10 @@ let baseConfig = {
}, {
test: /\.(svg|png|ttf|woff|woff2)$/,
loader: 'file-loader'
}, {
test: /manifest\.json$/,
type: 'javascript/auto',
loader: 'file-loader'
}
]
},