Subversion-Projekte lars-tiefland.webanos.marine-sales.de

Revision

Revision 571 | Zur aktuellen Revision | Details | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

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