localizing dependencies for serviceWorker

This commit is contained in:
TLRZ Seyfferth
2018-01-15 13:16:29 +01:00
parent 0607663efd
commit ee717318ee
27 changed files with 10995 additions and 160 deletions
+94 -23
View File
@@ -1,24 +1,95 @@
accounting.settings = {
currency: {
symbol: "€",
format: "%v %s",
decimal: ",",
thousand: ".",
precision: 2
},
number: {
precision : 2, // default precision on numbers is 0
thousand: ".",
decimal : ","
}
};
$(document).ready(function(){
$('.tabs').tabs({
swipeable: true,
responsiveThreshold: 640
});
$('.fixed-action-btn').floatingActionButton();
$('.tooltipped').tooltip();
Vue.filter('currency', function(money){
return accounting.formatMoney(money);
});
Vue.filter('number', function(number, precision = 2){
return accounting.formatNumber(number, precision);
});
var app = new Vue({
el: "#app",
data : {
dimensions: [
'l',
'Stk.',
'Gl.',
'Fl.',
'T.',
],
articles : [],
inventory : {
ug : [],
mob : [],
stud : []
},
bon: [],
view: 'inventur',
ready: false,
},
computed: {
sales_ug: function (){
var total_sales = this.inventory.ug.reduce(function(total, item ) {
return total + item.Sale;
}, 0);
return total_sales;
},
bon_price: function() {
var total = this.bon.reduce(function(total, item) {
return total + item.count * item.price;
}, 0);
return accounting.formatMoney(total);
},
bon_sum: function() {
var total = this.bon.reduce(function(total, item) {
return total + item.count;
}, 0);
return total;
}
},
methods: {
addArticle: function() {
this.articles.push(new Article());
},
storeArticles: function() {
this.$http.post('./backend?controller=Article&action=store', JSON.stringify(this.articles))
.then(response => {
M.toast({html: response.body});
})
},
loadArticles: function() {
this.$http.get('./data/test_articles.json')
.then(response => { return response.json();})
.then(json => {
json.forEach(element => {
this.articles.push(Article.thaw(element));
});
}).then( x => {
M.toast({ html: 'Artikel wurden geladen.'});
}).then( x => {
this.articles.forEach(a => {
ia = new InventoryArticle();
ia.article = a;
this.inventory.ug.push(ia);
this.bon.push({count: 0, name: a.name, price: a.portion.price});
});
}).then( x => {
M.updateTextFields();
this.ready = true;
});
},
resetBon: function(article) {
this.bon.forEach(function (item){
item.count = 0;
});
},
bonned: function (items) {
return items.filter(function (item) {
return item.count > 0;
});
}
},
created: function(){
this.loadArticles();
}
});
View File
+4
View File
File diff suppressed because one or more lines are too long
+6
View File
File diff suppressed because one or more lines are too long
+10798
View File
File diff suppressed because it is too large Load Diff
+7
View File
File diff suppressed because one or more lines are too long
+6
View File
File diff suppressed because one or more lines are too long
+21
View File
@@ -0,0 +1,21 @@
accounting.settings = {
currency: {
symbol: "€",
format: "%v %s",
decimal: ",",
thousand: ".",
precision: 2
},
number: {
precision : 2, // default precision on numbers is 0
thousand: ".",
decimal : ","
}
};
$(document).ready(function(){
$('.tabs').tabs();
$('.fixed-action-btn').floatingActionButton();
$('.tooltipped').tooltip();
});
-95
View File
@@ -1,95 +0,0 @@
Vue.filter('currency', function(money){
return accounting.formatMoney(money);
});
Vue.filter('number', function(number, precision = 2){
return accounting.formatNumber(number, precision);
});
var app = new Vue({
el: "#app",
data : {
dimensions: [
'l',
'Stk.',
'Gl.',
'Fl.',
'T.',
],
articles : [],
inventory : {
ug : [],
mob : [],
stud : []
},
bon: [],
view: 'inventur',
ready: false,
},
computed: {
sales_ug: function (){
var total_sales = this.inventory.ug.reduce(function(total, item ) {
return total + item.Sale;
}, 0);
return total_sales;
},
bon_price: function() {
var total = this.bon.reduce(function(total, item) {
return total + item.count * item.price;
}, 0);
return accounting.formatMoney(total);
},
bon_sum: function() {
var total = this.bon.reduce(function(total, item) {
return total + item.count;
}, 0);
return total;
}
},
methods: {
addArticle: function() {
this.articles.push(new Article());
},
storeArticles: function() {
this.$http.post('./backend?controller=Article&action=store', JSON.stringify(this.articles))
.then(response => {
M.toast({html: response.body});
})
},
loadArticles: function() {
this.$http.get('./data/test_articles.json')
.then(response => { return response.json();})
.then(json => {
json.forEach(element => {
this.articles.push(Article.thaw(element));
});
}).then( x => {
M.toast({ html: 'Artikel wurden geladen.'});
}).then( x => {
this.articles.forEach(a => {
ia = new InventoryArticle();
ia.article = a;
this.inventory.ug.push(ia);
this.bon.push({count: 0, name: a.name, price: a.portion.price});
});
}).then( x => {
M.updateTextFields();
this.ready = true;
});
},
resetBon: function(article) {
this.bon.forEach(function (item){
item.count = 0;
});
},
bonned: function (items) {
return items.filter(function (item) {
return item.count > 0;
});
}
},
created: function(){
this.loadArticles();
}
});