| 553 |
lars |
1 |
<!-- $Id: artikel_preise.tpl 1093 2021-04-29 13:50:56Z tiefland $ BEGIN -->
|
|
|
2 |
<tr>
|
|
|
3 |
<td class="links">
|
|
|
4 |
<b>Preise</b>
|
|
|
5 |
</td>
|
|
|
6 |
<td>
|
|
|
7 |
{assign var=Feld value="preise"}
|
| 554 |
lars |
8 |
<style>
|
|
|
9 |
body
|
|
|
10 |
{
|
|
|
11 |
font-family: verdana, Helvetica, sans-serif;
|
|
|
12 |
font-size: 10pt;
|
|
|
13 |
}
|
|
|
14 |
</style>
|
|
|
15 |
{for $i=1;$i<$preis_anz;$i++}
|
|
|
16 |
<div id="reiter{$i}" class="reiter">
|
|
|
17 |
<ul>
|
|
|
18 |
<li>
|
|
|
19 |
{assign var="preisLabel" value=";"|explode: $preise[$i]}
|
|
|
20 |
<a href="#preis{$i}">{$preisLabel[0]|default:"Preis {$i}"}</a>
|
|
|
21 |
</li>
|
|
|
22 |
{if isset($web_rechte.online_shop.artikel.preisstaffel)}
|
|
|
23 |
<li>
|
|
|
24 |
<a href="#staffel{$i}">Staffel {$preisLabel[0]|default:"Preis {$i}"}</a>
|
|
|
25 |
</li>
|
|
|
26 |
{/if}
|
|
|
27 |
</ul>
|
|
|
28 |
<div id="preis{$i}">
|
|
|
29 |
<table>
|
|
|
30 |
<tr>
|
|
|
31 |
<td>{$preisLabel[0]}:</td>
|
|
|
32 |
<td>neuer Preis:</td>
|
|
|
33 |
<td>neuer Preis gültig ab:</td>
|
|
|
34 |
<td>neuer Preis gültig bis:</td>
|
|
|
35 |
</tr>
|
|
|
36 |
<tr>
|
|
|
37 |
<td>
|
| 566 |
lars |
38 |
{$preis|var_dump}
|
| 554 |
lars |
39 |
{if !in_array("preise",$gesperrte_felder) || !$zeile.mutter}
|
| 568 |
lars |
40 |
<input type="text" {if $cfg[$i]["Brutto_Netto_Rechner"]==1}class="Brutto_Netto_Rechner_Basis"{/if} id="staffel_{$i}_preis_0" name="staffel[{$i}][preis][0]" value="{$item->price[$i-1]->preis}" data-calc-preis="{$preis[$i].preis_calc[0]}" />
|
| 554 |
lars |
41 |
<input type="hidden" name="staffel[{$i}][menge][0]" value="0" />
|
|
|
42 |
{else}
|
|
|
43 |
<div {if $cfg[$i]["Brutto_Netto_Rechner"]==1}class="Brutto_Netto_Rechner_Basis"{/if} id="staffel_{$i}_preis_0" data-calc-preis="{$preis[$i].preis_calc[0]}">{$preis[$i].preis[0]}</div>
|
|
|
44 |
{/if}
|
|
|
45 |
{if $cfg[$i]["Preiskalkulation"]==1}
|
|
|
46 |
<a id="calc" data-preis-index="{$i}"></a>
|
|
|
47 |
{/if}
|
|
|
48 |
{if $cfg[$i]["Brutto_Netto_Rechner"]==1}
|
|
|
49 |
<br />Nettopreis:
|
|
|
50 |
<span class="veraenderter_Brutto_Netto_Rechner_staffel_{$i}_preis_0"> </span>
|
|
|
51 |
{/if}
|
|
|
52 |
</td>
|
|
|
53 |
<td>
|
|
|
54 |
{if !in_array("preise",$gesperrte_felder) || !$zeile.mutter}
|
|
|
55 |
<input type="text" id="staffel_{$i}_preisneu_0" name="staffel[{$i}][preisneu][0]" value="{$preis[$i].preisneu[0]}" />
|
|
|
56 |
{else}
|
|
|
57 |
<div>{$preis[$i].preisneu[0]}</div>
|
|
|
58 |
{/if}
|
|
|
59 |
</td>
|
|
|
60 |
<td>
|
|
|
61 |
{if !in_array("preise",$gesperrte_felder) || !$zeile.mutter}
|
|
|
62 |
<input class="datefrom" type="date" id="staffel_{$i}_datefrom_0" name="staffel[{$i}][datefrom][0]" value="{$preis[$i].datefrom[0]}" data-default="{$smarty.session["artikel.php"].datefrom[0]}" />
|
|
|
63 |
{else}
|
|
|
64 |
<div>{$preis[$i].datefrom[0]}</div>
|
|
|
65 |
{/if}
|
|
|
66 |
</td>
|
|
|
67 |
<td>
|
|
|
68 |
{if !in_array("preise",$gesperrte_felder) || !$zeile.mutter}
|
|
|
69 |
<input type="date" id="staffel_{$i}_dateto_0" name="staffel[{$i}][dateto][0]" value="{$preis[$i].dateto[0]}" />
|
|
|
70 |
{else}
|
|
|
71 |
<div>{$preis[$i].dateto[0]}</div>
|
|
|
72 |
{/if}
|
|
|
73 |
</td>
|
|
|
74 |
</tr>
|
|
|
75 |
</table>
|
|
|
76 |
{if $preis[$i].geaendert_am}
|
|
|
77 |
<br />
|
|
|
78 |
geändert: {$preis[$i].geaendert_am|date_format:"d.m.Y H:i:s"}
|
|
|
79 |
{/if}
|
|
|
80 |
</div>
|
|
|
81 |
{if isset($web_rechte.online_shop.artikel.preisstaffel)}
|
|
|
82 |
<div id="staffel{$i}" class="staffel">
|
|
|
83 |
<table id="table_staffel_{$i}">
|
|
|
84 |
{foreach $preis[$i].menge as $nr => $wert}
|
|
|
85 |
{if $nr ne 0}
|
|
|
86 |
<tr id="tr_staffel_{$i}_{$nr}" class="tr_staffel_{$i}">
|
|
|
87 |
<td>
|
|
|
88 |
ab:
|
|
|
89 |
<input type="text" name="staffel[{$i}][menge][]" value="{$wert}"/>
|
|
|
90 |
</td>
|
|
|
91 |
<td>
|
|
|
92 |
Preis:
|
|
|
93 |
<input type="text" name="staffel[{$i}][preis][]" value="{$preis[$i].preis[$nr]}" />
|
|
|
94 |
</td>
|
|
|
95 |
<td>
|
|
|
96 |
neuer Preis:
|
|
|
97 |
<input type="text" name="staffel[{$i}][preisneu][]" value="{$preis[$i].preisneu[$nr]}" />
|
|
|
98 |
</td>
|
|
|
99 |
<td>
|
|
|
100 |
neuer Preis gültig ab:
|
|
|
101 |
<input class="datefrom" type="date" name="staffel[{$i}][datefrom][]" value="{$preis[$i].datefrom[$nr]}" data-default="{$smarty.session["artikel.php"].datefrom[0]}" />
|
|
|
102 |
</td>
|
|
|
103 |
<td>
|
|
|
104 |
neuer Preis gültig bis:
|
|
|
105 |
<input type="date" name="staffel[{$i}][dateto][]" value="{$preis[$i].dateto[$nr]}" />
|
|
|
106 |
</td>
|
|
|
107 |
<td>
|
|
|
108 |
<img src="../dokumente/gfx/delete_record.gif" style="cursor:pointer" id="del_staffel_{$i}_{$nr}" class="delete"/>
|
|
|
109 |
</td>
|
|
|
110 |
</tr>
|
|
|
111 |
{/if}
|
|
|
112 |
{/foreach}
|
|
|
113 |
</table>
|
|
|
114 |
<span>
|
|
|
115 |
<img src="../dokumente/gfx/add.gif" style="cursor:pointer" id="new_staffel_{$i}"/>
|
|
|
116 |
</span>
|
|
|
117 |
</div>
|
|
|
118 |
{/if}
|
|
|
119 |
</div>
|
|
|
120 |
{/for}
|
|
|
121 |
<script>
|
|
|
122 |
$(function()
|
|
|
123 |
{
|
|
|
124 |
{for $i=1;$i<$preis_anz;$i++}
|
|
|
125 |
$('#reiter'+{$i}).tabs();
|
|
|
126 |
$('#new_staffel_'+{$i}).click(add_staffel);
|
|
|
127 |
$('.delete').click(del_staffel);
|
|
|
128 |
{if $cfg[$i]["Brutto_Netto_Rechner"]==1}
|
|
|
129 |
$('#staffel_{$i}_preis_0').change(Brutto_Netto_Rechner_Single);
|
|
|
130 |
{/if}
|
|
|
131 |
{/for}
|
|
|
132 |
$('#tax1').change(Brutto_Netto_Rechner).change();
|
|
|
133 |
});
|
|
|
134 |
function add_staffel()
|
|
|
135 |
{
|
|
|
136 |
arr=this.id.split('_');
|
|
|
137 |
nr=arr[2];
|
|
|
138 |
elems=$('.tr_staffel_'+nr).length;
|
|
|
139 |
next_id=Math.abs(elems+1);
|
|
|
140 |
arr[0]="table";
|
|
|
141 |
table_id=arr.join('_');
|
|
|
142 |
del_id='del_staffel_'+nr+'_'+next_id;
|
|
|
143 |
r_html='<tr id="tr_staffel_'+nr+'_'+next_id+'" class="tr_staffel_'+nr+'"><td>ab: <input type="text" name="staffel['+nr+'][menge][]" value=""></td><td>Preis: <input type="text" name="staffel['+nr+'][preis][]" value="" onkeyup="killkomma_neu(this);" onblur="this.value=killkomma(this.value);"></td><td>neuer Preis: <input type="text" name="staffel['+nr+'][preisneu][]" value="" onkeyup="killkomma_neu(this);" onblur="this.value=killkomma(this.value);"></td><td>neuer Preis g¨ltig ab:<input type="date" name="staffel['+nr+'][datefrom][]" value="" /></td><td>neuer Preis g¨ltig bis:<input type="date" name="staffel['+nr+'][dateto][]" value="" /></td><td><img src="../dokumente/gfx/delete_record.gif" style="cursor:pointer" id="'+del_id+'" class="delete"></td></tr>';
|
|
|
144 |
$('#'+table_id).append(r_html);
|
|
|
145 |
$('#'+del_id).click(del_staffel);
|
|
|
146 |
}
|
|
|
147 |
|
|
|
148 |
function del_staffel()
|
|
|
149 |
{
|
|
|
150 |
arr=this.id.split('_');
|
|
|
151 |
arr[0]="tr";
|
|
|
152 |
tr_id=arr.join('_');
|
|
|
153 |
$('#'+tr_id).remove();
|
|
|
154 |
}
|
|
|
155 |
function Brutto_Netto_Rechner(){
|
|
|
156 |
$(".Brutto_Netto_Rechner_Basis").each(Brutto_Netto_Rechner_Single);
|
|
|
157 |
}
|
|
|
158 |
|
|
|
159 |
function Brutto_Netto_Rechner_Single()
|
|
|
160 |
{
|
|
|
161 |
mwstString=$("#tax1 :selected").text();
|
|
|
162 |
var mwst;
|
|
|
163 |
if(mwstString.toString().indexOf("%") != -1){
|
|
|
164 |
mwst = mwstString.split("%");
|
|
|
165 |
mwst = mwst[0];
|
|
|
166 |
}else{
|
|
|
167 |
mwst = mwstString;
|
|
|
168 |
}
|
|
|
169 |
mwst = mwst.trim();
|
|
|
170 |
name = $(this).attr("id");
|
|
|
171 |
value = $(this).val();
|
|
|
172 |
|
|
|
173 |
className="veraenderter_Brutto_Netto_Rechner_"+name;
|
|
|
174 |
url="/Online-Shop/errechneNettoPreis.php?preis="+value+"&mwst="+mwst;
|
|
|
175 |
$.ajax({
|
|
|
176 |
"async" :false,
|
|
|
177 |
"url":url,
|
|
|
178 |
"success":function(html){
|
|
|
179 |
$('.'+className).html(html);
|
|
|
180 |
},
|
|
|
181 |
});
|
|
|
182 |
}
|
|
|
183 |
</script>
|
| 553 |
lars |
184 |
{assign var=Feld2 value= "tax1"}
|
|
|
185 |
{if ( isset( $user_rechte[$smarty.const.modul_name][$smarty.const.tool_name][$Feld2] ) )}
|
|
|
186 |
<br />
|
|
|
187 |
Steuersatz:
|
|
|
188 |
{if in_array( strtolower( $Feld ), $gesperrte_felder ) && $zeile["mutter"]}
|
|
|
189 |
{$taxArr[$zeile["tax1"]]}
|
|
|
190 |
{else}
|
|
|
191 |
{html_options name="tax1" options=$taxArr selected=$zeile.tax1 id="tax1"}
|
|
|
192 |
{/if}
|
|
|
193 |
{/if}
|
|
|
194 |
</td>
|
|
|
195 |
</tr>
|
| 554 |
lars |
196 |
<script>
|
|
|
197 |
$(function(){
|
|
|
198 |
$('#calc').button({
|
|
|
199 |
icons:{
|
|
|
200 |
primary:"ui-icon-calculator"
|
|
|
201 |
}
|
|
|
202 |
}).click(show_min_price_dlg);
|
|
|
203 |
$('.datefrom').focus(function(){
|
|
|
204 |
if(!$(this).val())
|
|
|
205 |
{
|
|
|
206 |
$(this).val($(this).attr("data-default"));
|
|
|
207 |
}
|
|
|
208 |
})
|
|
|
209 |
$('#min_price_dlg').dialog({
|
|
|
210 |
autoOpen:false,
|
|
|
211 |
modal:true,
|
|
|
212 |
resizable:false,
|
|
|
213 |
width:400,
|
|
|
214 |
buttons:[
|
|
|
215 |
{
|
|
|
216 |
text:"berchnen",
|
|
|
217 |
icons: {
|
|
|
218 |
primary: "ui-icon-calculator"
|
|
|
219 |
},
|
|
|
220 |
click:function()
|
|
|
221 |
{
|
|
|
222 |
calc_min_price();
|
|
|
223 |
}
|
|
|
224 |
},
|
|
|
225 |
{
|
|
|
226 |
text:"speichern",
|
|
|
227 |
icons: {
|
|
|
228 |
primary: "ui-icon-check"
|
|
|
229 |
},
|
|
|
230 |
click:function()
|
|
|
231 |
{
|
|
|
232 |
daten={
|
|
|
233 |
minPreis:$('#mindestpreis').val(),
|
|
|
234 |
artikel:$('#a_id').val(),
|
|
|
235 |
pIndex:$('#pIndex').val()
|
|
|
236 |
}
|
|
|
237 |
$.post("save_min_price.php",daten);
|
|
|
238 |
document.location.href="artikel.php?action=edit&ID="+$('#a_id').val();
|
|
|
239 |
$(this).dialog("close");
|
|
|
240 |
}
|
|
|
241 |
},
|
|
|
242 |
{
|
|
|
243 |
text:"verwerfen",
|
|
|
244 |
icons:{
|
|
|
245 |
primary:"ui-icon-close"
|
|
|
246 |
},
|
|
|
247 |
click:function()
|
|
|
248 |
{
|
|
|
249 |
$(this).dialog("close");
|
|
|
250 |
}
|
|
|
251 |
}]
|
|
|
252 |
|
|
|
253 |
})
|
|
|
254 |
})
|
|
|
255 |
|
|
|
256 |
function calc_min_price()
|
|
|
257 |
{
|
|
|
258 |
daten={
|
|
|
259 |
ek:$('#ek').val(),
|
|
|
260 |
nachlass1:$('#nachlass1').val(),
|
|
|
261 |
nachlass2:$('#nachlass2').val(),
|
|
|
262 |
nachlass3:$('#nachlass3').val(),
|
|
|
263 |
skonto:$('#skonto').val(),
|
|
|
264 |
zuschlag:$('#zuschlag').val()
|
|
|
265 |
}
|
|
|
266 |
$.post("calc_min_price.php",daten,function(html)
|
|
|
267 |
{
|
|
|
268 |
$('#mindestpreis').val(html);
|
|
|
269 |
});
|
|
|
270 |
}
|
|
|
271 |
|
|
|
272 |
function show_min_price_dlg()
|
|
|
273 |
{
|
|
|
274 |
pId=$(this).attr("data-preis-index");
|
|
|
275 |
$('#pIndex').val(pId)
|
|
|
276 |
$('#min_price_dlg').dialog("open");
|
|
|
277 |
}
|
|
|
278 |
</script>
|
|
|
279 |
<div id="min_price_dlg" title="Mininmalpreis berechnen">
|
|
|
280 |
<table>
|
|
|
281 |
<tr>
|
|
|
282 |
<td>Einkaufspreis (netto)</td>
|
|
|
283 |
<td>
|
|
|
284 |
<input type="text" id="ek" />
|
|
|
285 |
</td>
|
|
|
286 |
</tr>
|
|
|
287 |
<tr>
|
|
|
288 |
<td>Nachlass 1 (%)</td>
|
|
|
289 |
<td>
|
|
|
290 |
<input type="number" id="nachlass1" min="0" max="100" class="input" />
|
|
|
291 |
</td>
|
|
|
292 |
</tr>
|
|
|
293 |
<tr>
|
|
|
294 |
<td>Nachlass 2 (%)</td>
|
|
|
295 |
<td>
|
|
|
296 |
<input type="number" id="nachlass2" value="" min="0" max="100" class="input" />
|
|
|
297 |
</td>
|
|
|
298 |
</tr>
|
|
|
299 |
<tr>
|
|
|
300 |
<td>Nachlass 3 (%)</td>
|
|
|
301 |
<td>
|
|
|
302 |
<input type="number" id="nachlass3" value="" min="0" max="100" class="input" />
|
|
|
303 |
</td>
|
|
|
304 |
</tr>
|
|
|
305 |
<tr>
|
|
|
306 |
<td>Skonto (%)</td>
|
|
|
307 |
<td>
|
|
|
308 |
<input type="number" id="skonto" value="" min="0" max="100" class="input" />
|
|
|
309 |
</td>
|
|
|
310 |
</tr>
|
|
|
311 |
<tr>
|
|
|
312 |
<td>Zuschlag (%)</td>
|
|
|
313 |
<td>
|
|
|
314 |
<input type="number" value="" id="zuschlag" min="0" max="100" class="input" />
|
|
|
315 |
</td>
|
|
|
316 |
</tr>
|
|
|
317 |
<tr>
|
|
|
318 |
<td>Ergebnis</td>
|
|
|
319 |
<td>
|
|
|
320 |
<input type="text" id="mindestpreis" value="" readonly="readonly" disabled="disabled" />
|
|
|
321 |
</td>
|
|
|
322 |
</tr>
|
|
|
323 |
</table>
|
|
|
324 |
<input type="hidden" id="pIndex" />
|
|
|
325 |
</div>
|
| 553 |
lars |
326 |
<!-- $Id: artikel_preise.tpl 1093 2021-04-29 13:50:56Z tiefland $ END -->
|