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

Revision

Revision 211 | Zur aktuellen Revision | Blame | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

<!-- $Id: supplier_warehouse.tpl 312 2023-08-12 14:49:09Z lars $ BEGIN -->
<script>
    $(function () {
        $('#f_l_bestellbar').change(toggle_extra_rows).change();
        $('#add_statuscode').button({
            icons:
                {
                    primary: "ui-icon-plus"
                }
        }).click(add_statuscode);
        $('.del_code').button({
            icons:
                {
                    primary: "ui-icon-trash"
                }
        }).click(del_code_row);

        function toggle_extra_rows() {
            if ($('#f_l_bestellbar').is(":checked")) {
                $('#logistiker_row').show();
                $('#artikelstatus_row').show();
                $('#rechnungstatus_row').show();
                $('#one4b_row').show();
            } else {
                $('#logistiker_row').hide();
                $('#artikelstatus_row').hide();
                $('#rechnungstatus_row').hide();
                $('#one4b_row').hide();
            }
            $('#')
        }

        function add_statuscode() {
            anz = $('.code').length;
            $('#code_table').append("<tr class='rechts code' id='code_row_" + anz + "'><td><input type='text' name='code[" + anz + "][key]'></td><td><input type='text' name='code[" + anz + "][value]'></td><td><input type='text' name='code[" + anz + "][image]'><input type='hidden' name='code[" + anz + "][id]' value='" + anz + "'></td><td><select name='code[" + anz + "][lieferstatus]'><option label='ohne' value='' selected='selected'>ohne</option><option label='0' value='0'>0</option><option label='1' value='1'>1</option><option label='2' value='2'>2</option><option label='3' value='3'>3</option><option label='4' value='4'>4</option></select></td><td><button class='delete' id='del_code_" + anz + "'>&nbsp;</button></tr>");
            $('#del_code_' + anz).button({
                icons:
                    {
                        primary: "ui-icon-trash"
                    }
            }).click(del_code_row);
            return false;
        }

        function del_code_row() {
            id = this.id.split("_");
            $('#code_row_' + id[2]).remove();
            return false;
        }
    });
</script>
<div id="warehouseError" style="color: red!important;"></div>
<form method="post" id="lager_form">
    {if $supplierWarehouse.id}
        <input type="hidden" name="_method" value="PATCH">
    {/if}
    <input type="hidden" name="_token" value="{csrf_token()}">
    <input type="hidden" value="{$supplierWarehouse.id}" id="f_l_id">
    <input type="hidden" value="{$supplier.id}" id="f_s_id">
    <table width="100%">
        <tr>
            <td class="links">
                <label for="f_l_name">Name</label>
            </td>
            <td class="rechts">
                <input type="text" name="name" value="{$supplierWarehouse.name}" id="f_l_name">
                <div id="warehouseNameError" style="color: red!important;"></div>
            </td>
        </tr>
        <tr>
            <td class="links">
                <label for="f_l_rang">Rang</label>
            </td>
            <td class="rechts">
                <input type="text" name="rank" id="f_l_rang" value="{$supplierWarehouse.rank}">
                <div id="warehouseRankError" style="color: red!important;"></div>
            </td>
        </tr>
        <tr>
            <td class="links">
                <label for="f_l_bestellbar">Artikel bestellbar?</label>
            </td>
            <td>
                <input type="hidden" name="orderable" value="0">
                <input type="checkbox" name="orderable" value="1" id="f_l_bestellbar"
                       {if $supplierWarehouse.orderable==1}checked="checked"{/if}>
                <table>
                    {if $logistiker}
                        <tr id="logistiker_row">
                            <td>
                                <label for="f_l_logistiker">Logistiker ändern:</label>
                            </td>
                            <td>
                                <select name="logistiker_id" class="logistiker_select" id="f_l_logistiker">
                                    <option value="0">--- Bitte wählen ---</option>
                                    {html_options options=$logistiker selected=$supplierWarehouse.logistiker_id}
                                </select>
                            </td>
                        </tr>
                    {/if}
                    {if $artikelstatus}
                        <tr id="artikelstatus_row">
                            <td>
                                <label for="f_l_artikelstatus">Artikelstatus ändern</label>
                            </td>
                            <td>
                                <select name="item_status" class="artikelstatus_select" id="f_l_artikelstatus">
                                    <option value="-1">--- Nicht ändern ---</option>
                                    {html_options options=$item_status selected=$item_status_id}
                                </select>
                            </td>
                        </tr>
                    {/if}
                    {if $rechnungStatus}
                        <tr id="rechnungstatus_row">
                            <td>
                                <label for="f_l_rechnungstatus">Rechnungstatus ändern</label>
                            </td>
                            <td>
                                <select name="invoice_status" class="artikelstatus_select" id="f_l_rechnungstatus">
                                    <option value="-1">--- Nicht ändern ---</option>
                                    {html_options options=$invoice_status selected=$invoice_status_id}
                                </select>
                            </td>
                        </tr>
                    {/if}
                    {if $one4b}
                        <tr id="one4b_row">
                            <td><label for="f_l_one4b">One4B?</label></td>
                            <td>
                                <input type="hidden" name="one4b" value="0">
                                <input type="checkbox" name="one4b" value="1" id="f_l_one4b"
                                       {if $supplierWarehouse.one4b==1}checked="checked"{/if}>
                            </td>
                        </tr>
                    {/if}
                </table>
            </td>
        </tr>
        <tr>
            <td class="links">Lieferstatus positiv</td>
            <td class="rechts">
                {html_options name="pos_delivery_status" options=$lstatus selected=$supplierWarehouse.lstatus_pos}
            </td>
        </tr>
        {if isset($user_rechte.bestellwesen.lieferanten.verf_codes)}
            <tr>
                <td class="links">Verf&uuml;gbarkeits-Codes:</td>
                <td class="rechts">
                    <table width="100%" id="code_table">
                        <tr class="links">
                            <td>Code</td>
                            <td>entspricht-Text</td>
                            <td>Bildnummer</td>
                            <td>Lieferstatus positiv</td>
                            <td>
                                <button id="add_statuscode">&nbsp;</button>
                            </td>
                        </tr>
                        {section loop=$supplierWarehouse.verf_codes name=c_ind}
                            <tr class="rechts code" id="code_row_{$supplierWarehouse.verf_codes[c_ind].id}">
                                <td>
                                    <input type="text" name="code[{$supplierWarehouse.verf_codes[c_ind].id}][key]"
                                           value="{$supplierWarehouse.verf_codes[c_ind].key}">
                                </td>
                                <td>
                                    <input type="text" name="code[{$supplierWarehouse.verf_codes[c_ind].id}][value]"
                                           value="{$supplierWarehouse.verf_codes[c_ind].value}">
                                </td>
                                <td>
                                    <input type="text" name="code[{$supplierWarehouse.verf_codes[c_ind].id}][image]"
                                           value="{$supplierWarehouse.verf_codes[c_ind].image}">
                                    <input type="hidden" name="code[{$supplierWarehouse.verf_codes[c_ind].id}][id]"
                                           value="{$supplierWarehouse.verf_codes[c_ind].id}">
                                </td>
                                <td>
                                    <select name="code[{$supplierWarehouse.verf_codes[c_ind].id}][lieferstatus]">
                                        {html_options options=$lstatus selected={$supplierWarehouse.verf_codes[c_ind].lieferstatus}}
                                    </select>
                                </td>
                                <td>
                                    <button id="delete_code_{$supplierWarehouse.verf_codes[c_ind].id}" class="del_code">&nbsp;
                                    </button>
                                </td>
                            </tr>
                            {sectionelse}
                            <tr class="rechts code">
                                <td>
                                    <input type="text" name="code[0][key]" value="0">
                                </td>
                                <td>
                                    <input type="text" name="code[0][value]">
                                </td>
                                <td>
                                    <input type="text" name="code[0][image]" value="0">
                                    <input type="hidden" name="code[0][id]" value="0">
                                </td>
                                <td>
                                    {html_options name="code[0][lieferstatus]" options=$lstatus}
                                </td>
                            </tr>
                        {/section}
                    </table>
                </td>
            </tr>
        {/if}
    </table>
    <input type="hidden" name="mode" value="{if $supplierWarehouse.id}update{else}save{/if}">
</form>
<!-- $Id: supplier_warehouse.tpl 312 2023-08-12 14:49:09Z lars $ END -->