updates
This commit is contained in:
parent
134137e3a4
commit
49146a8ba6
@ -1,313 +1 @@
|
||||
[{
|
||||
"name": "Edelpils",
|
||||
"dimension": "l",
|
||||
"content": {
|
||||
"size": 0.33,
|
||||
"price": 0
|
||||
},
|
||||
"portion": {
|
||||
"size": 0.33,
|
||||
"price": 3.5,
|
||||
"type": "Fl."
|
||||
}
|
||||
}, {
|
||||
"name": "Schwarzbier",
|
||||
"dimension": "l",
|
||||
"content": {
|
||||
"size": 0.33,
|
||||
"price": 0
|
||||
},
|
||||
"portion": {
|
||||
"size": 0.33,
|
||||
"price": 3.5,
|
||||
"type": "Fl."
|
||||
}
|
||||
}, {
|
||||
"name": "Schöfferhofer",
|
||||
"dimension": "l",
|
||||
"content": {
|
||||
"size": 0.33,
|
||||
"price": 0
|
||||
},
|
||||
"portion": {
|
||||
"size": 0.33,
|
||||
"price": 3.5,
|
||||
"type": "Fl."
|
||||
}
|
||||
}, {
|
||||
"name": "Bitburger af.",
|
||||
"dimension": "l",
|
||||
"content": {
|
||||
"size": 0.33,
|
||||
"price": 0
|
||||
},
|
||||
"portion": {
|
||||
"size": 0.33,
|
||||
"price": 3.5,
|
||||
"type": "Fl."
|
||||
}
|
||||
}, {
|
||||
"name": "Riesling",
|
||||
"dimension": "l",
|
||||
"content": {
|
||||
"size": 1,
|
||||
"price": 0
|
||||
},
|
||||
"portion": {
|
||||
"size": 0.2,
|
||||
"price": 6,
|
||||
"type": "Gl."
|
||||
}
|
||||
}, {
|
||||
"name": "Amareno",
|
||||
"dimension": "l",
|
||||
"content": {
|
||||
"size": 0.75,
|
||||
"price": 0
|
||||
},
|
||||
"portion": {
|
||||
"size": 0.2,
|
||||
"price": 6.5,
|
||||
"type": "Gl."
|
||||
}
|
||||
}, {
|
||||
"name": "Secco",
|
||||
"dimension": "l",
|
||||
"content": {
|
||||
"size": 0.75,
|
||||
"price": 0
|
||||
},
|
||||
"portion": {
|
||||
"size": 0.1,
|
||||
"price": 6,
|
||||
"type": "Gl."
|
||||
}
|
||||
}, {
|
||||
"name": "B-Saft",
|
||||
"dimension": "l",
|
||||
"content": {
|
||||
"size": 1,
|
||||
"price": 0
|
||||
},
|
||||
"portion": {
|
||||
"size": 0.2,
|
||||
"price": 3.5,
|
||||
"type": "Gl."
|
||||
}
|
||||
}, {
|
||||
"name": "K-Saft",
|
||||
"dimension": "l",
|
||||
"content": {
|
||||
"size": 1,
|
||||
"price": 0
|
||||
},
|
||||
"portion": {
|
||||
"size": 0.2,
|
||||
"price": 3.5,
|
||||
"type": "Gl."
|
||||
}
|
||||
}, {
|
||||
"name": "O-Saft",
|
||||
"dimension": "l",
|
||||
"content": {
|
||||
"size": 1,
|
||||
"price": 0
|
||||
},
|
||||
"portion": {
|
||||
"size": 0.2,
|
||||
"price": 3.5,
|
||||
"type": "Gl."
|
||||
}
|
||||
}, {
|
||||
"name": "G-Saft",
|
||||
"dimension": "l",
|
||||
"content": {
|
||||
"size": 1,
|
||||
"price": 0
|
||||
},
|
||||
"portion": {
|
||||
"size": 0.2,
|
||||
"price": 3.5,
|
||||
"type": "Gl."
|
||||
}
|
||||
}, {
|
||||
"name": "Vita Cola",
|
||||
"dimension": "l",
|
||||
"content": {
|
||||
"size": 1,
|
||||
"price": 0
|
||||
},
|
||||
"portion": {
|
||||
"size": 0.2,
|
||||
"price": 2.5,
|
||||
"type": "Gl."
|
||||
}
|
||||
}, {
|
||||
"name": "Vita Orange",
|
||||
"dimension": "l",
|
||||
"content": {
|
||||
"size": 1,
|
||||
"price": 0
|
||||
},
|
||||
"portion": {
|
||||
"size": 0.2,
|
||||
"price": 2.5,
|
||||
"type": "Gl."
|
||||
}
|
||||
}, {
|
||||
"name": "Vita Zitrone",
|
||||
"dimension": "l",
|
||||
"content": {
|
||||
"size": 1,
|
||||
"price": 0
|
||||
},
|
||||
"portion": {
|
||||
"size": 0.2,
|
||||
"price": 2.5,
|
||||
"type": "Gl."
|
||||
}
|
||||
}, {
|
||||
"name": "Tonic",
|
||||
"dimension": "l",
|
||||
"content": {
|
||||
"size": 0.25,
|
||||
"price": 0
|
||||
},
|
||||
"portion": {
|
||||
"size": 0.25,
|
||||
"price": 3,
|
||||
"type": "Fl."
|
||||
}
|
||||
}, {
|
||||
"name": "Bitter Lemon",
|
||||
"dimension": "l",
|
||||
"content": {
|
||||
"size": 0.25,
|
||||
"price": 0
|
||||
},
|
||||
"portion": {
|
||||
"size": 0.25,
|
||||
"price": 3,
|
||||
"type": "Fl."
|
||||
}
|
||||
}, {
|
||||
"name": "Ginger Ale",
|
||||
"dimension": "l",
|
||||
"content": {
|
||||
"size": 0.25,
|
||||
"price": 0
|
||||
},
|
||||
"portion": {
|
||||
"size": 0.25,
|
||||
"price": 3,
|
||||
"type": "Fl."
|
||||
}
|
||||
}, {
|
||||
"name": "Apfelschorle",
|
||||
"dimension": "l",
|
||||
"content": {
|
||||
"size": 0.25,
|
||||
"price": 0
|
||||
},
|
||||
"portion": {
|
||||
"size": 0.25,
|
||||
"price": 3,
|
||||
"type": "Fl."
|
||||
}
|
||||
}, {
|
||||
"name": "TWQ naturell",
|
||||
"dimension": "l",
|
||||
"content": {
|
||||
"size": 0.25,
|
||||
"price": 0
|
||||
},
|
||||
"portion": {
|
||||
"size": 0.25,
|
||||
"price": 2.5,
|
||||
"type": "Fl."
|
||||
}
|
||||
}, {
|
||||
"name": "TWQ medium",
|
||||
"dimension": "l",
|
||||
"content": {
|
||||
"size": 0.25,
|
||||
"price": 0
|
||||
},
|
||||
"portion": {
|
||||
"size": 0.25,
|
||||
"price": 2.5,
|
||||
"type": "Fl."
|
||||
}
|
||||
}, {
|
||||
"name": "TWQ classic",
|
||||
"dimension": "l",
|
||||
"content": {
|
||||
"size": 0.25,
|
||||
"price": 0
|
||||
},
|
||||
"portion": {
|
||||
"size": 0.25,
|
||||
"price": 2.5,
|
||||
"type": "Fl."
|
||||
}
|
||||
}, {
|
||||
"name": "Kaffee",
|
||||
"dimension": "Tasse",
|
||||
"content": {
|
||||
"size": 1,
|
||||
"price": 0
|
||||
},
|
||||
"portion": {
|
||||
"size": 1,
|
||||
"price": 2.5,
|
||||
"type": "T"
|
||||
}
|
||||
}, {
|
||||
"name": "Latte Macchiato",
|
||||
"dimension": "Glas",
|
||||
"content": {
|
||||
"size": 1,
|
||||
"price": 0
|
||||
},
|
||||
"portion": {
|
||||
"size": 1,
|
||||
"price": 3.5,
|
||||
"type": "Gl."
|
||||
}
|
||||
}, {
|
||||
"name": "dopp. Esp.",
|
||||
"dimension": "Tasse",
|
||||
"content": {
|
||||
"size": 1,
|
||||
"price": 0
|
||||
},
|
||||
"portion": {
|
||||
"size": 1,
|
||||
"price": 3.5,
|
||||
"type": "T"
|
||||
}
|
||||
}, {
|
||||
"name": "Brezel",
|
||||
"dimension": "Stück",
|
||||
"content": {
|
||||
"size": 1,
|
||||
"price": 0
|
||||
},
|
||||
"portion": {
|
||||
"size": 1,
|
||||
"price": 2.5,
|
||||
"type": "Stk."
|
||||
}
|
||||
}, {
|
||||
"name": "Schokoriegel",
|
||||
"dimension": "Stück",
|
||||
"content": {
|
||||
"size": 1,
|
||||
"price": 0
|
||||
},
|
||||
"portion": {
|
||||
"size": 1,
|
||||
"price": 2,
|
||||
"type": "Stk."
|
||||
}
|
||||
}]
|
||||
[{"name":"Edelpils","dimension":"l","content":{"size":0.33,"price":0},"portion":{"size":0.33,"price":3.5,"type":"Fl."}},{"name":"Schwarzbier","dimension":"l","content":{"size":0.33,"price":0},"portion":{"size":0.33,"price":3.5,"type":"Fl."}},{"name":"Schöfferhofer","dimension":"l","content":{"size":0.33,"price":0},"portion":{"size":0.33,"price":3.5,"type":"Fl."}},{"name":"Bitburger af.","dimension":"l","content":{"size":0.33,"price":0},"portion":{"size":0.33,"price":3.5,"type":"Fl."}},{"name":"Weiswein","dimension":"l","content":{"size":1,"price":0},"portion":{"size":0.2,"price":6,"type":"Gl."}},{"name":"Rotwein","dimension":"l","content":{"size":0.75,"price":0},"portion":{"size":0.2,"price":6.5,"type":"Gl."}},{"name":"Secco","dimension":"l","content":{"size":0.75,"price":0},"portion":{"size":0.1,"price":6,"type":"Gl."}},{"name":"B-Saft","dimension":"l","content":{"size":1,"price":0},"portion":{"size":0.2,"price":3.5,"type":"Gl."}},{"name":"K-Saft","dimension":"l","content":{"size":1,"price":0},"portion":{"size":0.2,"price":3.5,"type":"Gl."}},{"name":"O-Saft","dimension":"l","content":{"size":1,"price":0},"portion":{"size":0.2,"price":3.5,"type":"Gl."}},{"name":"G-Saft","dimension":"l","content":{"size":1,"price":0},"portion":{"size":0.2,"price":3.5,"type":"Gl."}},{"name":"Vita Cola","dimension":"l","content":{"size":1,"price":0},"portion":{"size":0.2,"price":2.5,"type":"Gl."}},{"name":"Vita Orange","dimension":"l","content":{"size":1,"price":0},"portion":{"size":0.2,"price":2.5,"type":"Gl."}},{"name":"Vita Zitrone","dimension":"l","content":{"size":1,"price":0},"portion":{"size":0.2,"price":2.5,"type":"Gl."}},{"name":"Tonic","dimension":"l","content":{"size":0.25,"price":0},"portion":{"size":0.25,"price":3,"type":"Fl."}},{"name":"Bitter Lemon","dimension":"l","content":{"size":0.25,"price":0},"portion":{"size":0.25,"price":3,"type":"Fl."}},{"name":"Ginger Ale","dimension":"l","content":{"size":0.25,"price":0},"portion":{"size":0.25,"price":3,"type":"Fl."}},{"name":"Apfelschorle","dimension":"l","content":{"size":0.25,"price":0},"portion":{"size":0.25,"price":3,"type":"Fl."}},{"name":"TWQ naturell","dimension":"l","content":{"size":0.25,"price":0},"portion":{"size":0.25,"price":2.5,"type":"Fl."}},{"name":"TWQ medium","dimension":"l","content":{"size":0.25,"price":0},"portion":{"size":0.25,"price":2.5,"type":"Fl."}},{"name":"TWQ classic","dimension":"l","content":{"size":0.25,"price":0},"portion":{"size":0.25,"price":2.5,"type":"Fl."}},{"name":"Kaffee","dimension":"Tasse","content":{"size":1,"price":0},"portion":{"size":1,"price":2.5,"type":"T"}},{"name":"Latte Macchiato","dimension":"Glas","content":{"size":1,"price":0},"portion":{"size":1,"price":3.5,"type":"Gl."}},{"name":"dopp. Esp.","dimension":"Tasse","content":{"size":1,"price":0},"portion":{"size":1,"price":3.5,"type":"T"}},{"name":"Brezel","dimension":"Stück","content":{"size":1,"price":0},"portion":{"size":1,"price":2.5,"type":"Stk."}},{"name":"Schokoriegel","dimension":"Stück","content":{"size":1,"price":0},"portion":{"size":1,"price":2,"type":"Stk."}}]
|
||||
164
index.html
164
index.html
@ -9,20 +9,20 @@
|
||||
<!--Import Google Icon Font-->
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
<!--Import materialize.css-->
|
||||
<link type="text/css" rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/css/materialize.min.css" media="screen,projection"/>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-alpha.3/css/materialize.min.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div id="app" style="max-width:100%; max-height:100%;">
|
||||
<div id="app">
|
||||
<nav class="nav-extended teal">
|
||||
<div class="nav-wrapper container">
|
||||
<a href="#" class="brand-logo">Inventur</a>
|
||||
<a href="#" data-activates="mobile" class="button-collapse"><i class="material-icons">menu</i></a>
|
||||
<a href="#" data-activates="mobile" class="sidenav-trigger"><i class="material-icons">menu</i></a>
|
||||
<ul id="nav-mobile" class="right hide-on-med-and-down">
|
||||
<li><a href="#"></a></li>
|
||||
</ul>
|
||||
<ul id="mobile" class="side-nav">
|
||||
<ul id="mobile" class="sidenav">
|
||||
<li><a href="#"></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
@ -34,87 +34,103 @@
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
<div class="container" id="article">
|
||||
<table class="">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Artikelname</th>
|
||||
<th>Gesamtmenge</th>
|
||||
<th>Portionsmenge</th>
|
||||
<th>Gesamtpreis</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="a in articles" class="row item">
|
||||
<td>
|
||||
<div class="input-field col s12">
|
||||
<input v-model="a.name" placeholder="Artikelname" class="validate">
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="input-field col s10">
|
||||
<input v-model.number="a.content.size" placeholder="Gesamtinhalt" type="number" class="validate" step="0.01">
|
||||
</div>
|
||||
<div class="input-field col s2">
|
||||
<input v-model="a.dimension" placeholder="Dimension" class="validate">
|
||||
</div>
|
||||
<div class="container">
|
||||
<div class="col s12" id="article">
|
||||
<div v-for="(a, index) in articles" class="card">
|
||||
<div class="card-content row">
|
||||
<div class="input-field inline col s12">
|
||||
<input v-model="a.name" placeholder="Artikelname" class="validate" :id="'a_name_'+index">
|
||||
<label :for="'a_name_'+index" class="active">Name</label>
|
||||
</div>
|
||||
<div class="input-field col s10">
|
||||
<input v-model.number="a.content.size" placeholder="Gesamtinhalt" type="number" class="validate" step="0.01" :id="'a_csize_'+index">
|
||||
<label :for="'a_csize_'+index" class="active">Gesamtinhalt</label>
|
||||
</div>
|
||||
<div class="input-field col s2">
|
||||
<input v-model="a.dimension" placeholder="Dimension" class="validate" :id="'a_dim_'+index" max="5">
|
||||
<label :for="'a_dim_'+index" class="active">Dimension</label>
|
||||
<span class="helper-text">z.B. Liter(l), Stück(Stk.)</span>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
<div class="input-field col s7">
|
||||
<input v-model.number="a.portion.size" placeholder="Gesamtinhalt" type="number" class="validate" step="0.01">
|
||||
</div>
|
||||
<div class="input-field col s2">
|
||||
<input v-model="a.portion.type" placeholder="Art" class="validate">
|
||||
</div>
|
||||
<div class="input-field col s3">
|
||||
<input v-model.number="a.portion.price" placeholder="Preis" type="number" step="0.01" class="validate">
|
||||
</div>
|
||||
<div class="input-field col s7">
|
||||
<input v-model.number="a.portion.size" placeholder="Gesamtinhalt" type="number" class="validate" step="0.01" :id="'a_psize_'+index" max="5">
|
||||
<label :for="'a_psize_'+index" class="active">Portionsinhalt</label>
|
||||
</div>
|
||||
<div class="input-field col s2">
|
||||
<input v-model="a.portion.type" placeholder="Art" class="validate" :id="'a_ptype_'+index" max="5">
|
||||
<label :for="'a_ptype_'+index" class="active">Portionsbezeichnung</label>
|
||||
</div>
|
||||
<div class="input-field col s3">
|
||||
<input v-model.number="a.portion.price" placeholder="Preis" type="number" step="0.01" class="validate" :id="'a_pprice_'+index" max="5">
|
||||
<label :for="'a_pprice_'+index" class="active">Portionspreis</label>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
<th class="">
|
||||
<div class="col s12 right">
|
||||
<span class="right">{{ a.ContentPrice.toFixed(2) }} €</span>
|
||||
</div>
|
||||
</th>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr slot="footer"><td colspan="4">
|
||||
<button class="btn waves-effect waves-light" @click="addArticle">Artikel hinzufügen</button>
|
||||
</td></tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<div class="col s12 right">
|
||||
<span class="right">Gesamtpreis {{ a.ContentPrice | currency }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div slot="footer">
|
||||
<button class="btn waves-effect waves-light" @click="addArticle">Artikel hinzufügen</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="container" id="inventory">
|
||||
<div v-for="(a, index) in inventory.ug" class="row hoverable">
|
||||
<div class="col m2">{{ a.article.name }} <br/> {{a.article.portion.price.toFixed(2)}} €</div>
|
||||
<div class="col s12 m8">
|
||||
<div class="input-field inline">
|
||||
<input v-model.number="a.start" placeholder="Anfang" title="Anfang" >
|
||||
<div class="col s12" id="inventory">
|
||||
<div v-for="(a, index) in inventory.ug" class="row hoverable">
|
||||
<div class="col m2">{{ a.article.name }} <br/> {{a.article.portion.price.toFixed(2)}} €</div>
|
||||
<div class="col s12 m8">
|
||||
<div class="input-field inline">
|
||||
<input v-model.number="a.start" placeholder="Anfang" title="Anfang" type="number" :step="a.StepSize">
|
||||
</div>
|
||||
<div class="input-field inline">
|
||||
<input v-model.number="a.fetched" placeholder="Zugang" title="Zugang" type="number" :step="a.StepSize">
|
||||
</div>
|
||||
<div class="input-field inline">
|
||||
<input v-model.number="a.end" placeholder="Ende" title="Ende" type="number" :step="a.StepSize">
|
||||
</div>
|
||||
<div class="input-field inline">
|
||||
<input v-model.number="a.lost" placeholder="Verlust" title="Verlust" type="number" :step="a.StepSize">
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-field inline">
|
||||
<input v-model.number="a.fetched" placeholder="Zugang" title="Zugang" >
|
||||
</div>
|
||||
<div class="input-field inline">
|
||||
<input v-model.number="a.end" placeholder="Ende" title="Ende" >
|
||||
</div>
|
||||
<div class="input-field inline">
|
||||
<input v-model.number="a.lost" placeholder="Verlust" title="Verlust" >
|
||||
<div class="col m2 right">{{ a.Sold | number }} {{ a.article.PortionType }} <br/> {{ a.Sale | currency }}</div>
|
||||
</div>
|
||||
<div class="row teal lighten-2">
|
||||
<div class="col right">
|
||||
{{ sales_ug | currency }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col m2 right">{{ a.Sold }} {{ a.article.PortionType }} <br/> {{ a.Sale.toFixed(2) }} €</div>
|
||||
</div>
|
||||
<div class="row teal lighten-2">
|
||||
<div class="col right">
|
||||
{{ sales_ug.toFixed(2) }} €
|
||||
<div class="col s12" id="calc">
|
||||
<div class="row">
|
||||
<div class="col s12 m4">
|
||||
<table class="darken-4 grey">
|
||||
<tr v-for="item in bonned(bon)">
|
||||
<td class="right">{{ item.count }} ×</td>
|
||||
<td>{{ item.name }}</td>
|
||||
<td class="right">{{ item.price * item.count | currency }}</td>
|
||||
</tr>
|
||||
<tr class="">
|
||||
<td class="right">{{ bon_sum > 0 ?bon_sum: "" }}</td>
|
||||
<td>{{ bon_sum > 0 ? "Artikel": ""}}</td>
|
||||
<th class="right">{{ bon_price }}</th>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="col s12 m8">
|
||||
<div class="row">
|
||||
<div class="col s4" v-for="a in bon">
|
||||
<button class="waves-effect waves-light btn-large col s12" @click="a.count++;">{{ a.name }}</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="container" id="calc"></div>
|
||||
|
||||
<div class="fixed-action-btn">
|
||||
<a href="#" class="btn-floating btn-large teal">
|
||||
<i class="large material-icons">more</i>
|
||||
@ -125,11 +141,11 @@
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/js/materialize.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-alpha.3/js/materialize.min.js"></script>
|
||||
<script src="js/moment-with-locales.min.js"></script>
|
||||
<script src="js/accounting.min.js"></script>
|
||||
<script src="https://unpkg.com/vue/dist/vue.js"></script>
|
||||
<script src="//cdn.jsdelivr.net/npm/vue-resource"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/vue-resource"></script>
|
||||
<script src="js/app.js"></script>
|
||||
<script src="js/vue.js"></script>
|
||||
<script src="js/model/article.js"></script>
|
||||
|
||||
11
js/app.js
11
js/app.js
@ -5,7 +5,16 @@ accounting.settings = {
|
||||
decimal: ",",
|
||||
thousand: ".",
|
||||
precision: 2
|
||||
}
|
||||
},
|
||||
number: {
|
||||
precision : 2, // default precision on numbers is 0
|
||||
thousand: ".",
|
||||
decimal : ","
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
$('.tabs').tabs();
|
||||
$('.fixed-action-btn').floatingActionButton();
|
||||
})
|
||||
|
||||
@ -46,6 +46,10 @@ InventoryArticle.prototype = {
|
||||
},
|
||||
get Sale() {
|
||||
return this.Sold * this.article.PortionPrice;
|
||||
},
|
||||
get StepSize() {
|
||||
singlePack = this.article.Portions == 1;
|
||||
return singlePack ? 1 : 0.05;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
37
js/vue.js
37
js/vue.js
@ -1,3 +1,10 @@
|
||||
Vue.filter('currency', function(money){
|
||||
return accounting.formatMoney(money);
|
||||
});
|
||||
Vue.filter('number', function(number){
|
||||
return accounting.formatNumber(number);
|
||||
});
|
||||
|
||||
var app = new Vue({
|
||||
el: "#app",
|
||||
data : {
|
||||
@ -13,7 +20,8 @@ var app = new Vue({
|
||||
ug : [],
|
||||
mob : [],
|
||||
stud : []
|
||||
}
|
||||
},
|
||||
bon: []
|
||||
},
|
||||
computed: {
|
||||
sales_ug: function (){
|
||||
@ -21,6 +29,18 @@ var app = new Vue({
|
||||
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: {
|
||||
@ -30,7 +50,7 @@ var app = new Vue({
|
||||
storeArticles: function() {
|
||||
this.$http.post('./backend?controller=Article&action=store', JSON.stringify(this.articles))
|
||||
.then(response => {
|
||||
Materialize.toast(response.body, 2000);
|
||||
M.toast({html: response.body});
|
||||
})
|
||||
},
|
||||
loadArticles: function() {
|
||||
@ -41,15 +61,24 @@ var app = new Vue({
|
||||
this.articles.push(Article.thaw(element));
|
||||
});
|
||||
}).then( x => {
|
||||
Materialize.toast('Artikel wurden geladen.', 2000);
|
||||
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 => {
|
||||
Materialize.updateTextFields();
|
||||
M.updateTextFields();
|
||||
});
|
||||
},
|
||||
bonArticle: function(article) {
|
||||
|
||||
},
|
||||
bonned: function (items) {
|
||||
return items.filter(function (item) {
|
||||
return item.count > 0;
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user