View | Details | Raw Unified | Return to bug 34444
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt (-8 / +9 lines)
Lines 372-378 Link Here
372
                                        </td>
372
                                        </td>
373
                                        <td>
373
                                        <td>
374
                                            <span class="order_name" data-order_id="[% order.ordernumber | html %]">[% order.budget_name | html %]</span></br>
374
                                            <span class="order_name" data-order_id="[% order.ordernumber | html %]">[% order.budget_name | html %]</span></br>
375
                                            <a href="#" class="modify_fund" data-order_id="[% order.ordernumber | html %]" data-budget_id="[% order.budget_id | html %]" data-sort_1="[% order.sort1 | html %]" data-sort_2="[% order.sort2 | html %]" data-sort1="[% order.sort1 | html %]" data-sort2="[% order.sort2 | html %]">Modify fund</a>
375
                                            <a href="#" class="modify_fund" data-order_id="[% order.ordernumber | html %]" data-budget_id="[% order.budget_id | html %]" data-sort1="[% order.sort1 | html %]" data-sort2="[% order.sort2 | html %]">Modify fund</a>
376
                                        </td>
376
                                        </td>
377
                                    </tr>
377
                                    </tr>
378
                                [% END # /FOREACH order %]
378
                                [% END # /FOREACH order %]
Lines 596-611 Link Here
596
                $("#update_fund").data('order_id',$(this).data('order_id'));
596
                $("#update_fund").data('order_id',$(this).data('order_id'));
597
                $("#modify_budget_id").html(disabledBudgetsCopy);
597
                $("#modify_budget_id").html(disabledBudgetsCopy);
598
                $("#modify_budget_id").val(selected).find('option[value="'+selected+'"]').removeClass('b_inactive');
598
                $("#modify_budget_id").val(selected).find('option[value="'+selected+'"]').removeClass('b_inactive');
599
                $("#sort1").val(sort1);
599
                $("#updateFund").find('[name="sort1"]').val(sort1);
600
                $("#sort2").val(sort2);
600
                $("#updateFund").find('[name="sort2"]').val(sort2);
601
                $("#modify_budget_id").find('.b_inactive').remove();
601
                $("#modify_budget_id").find('.b_inactive').remove();
602
                $("#modify_budget_id").change();
602
                $("#modify_budget_id").change();
603
                $("#updateFund").modal('show');
603
                $("#updateFund").modal('show');
604
            });
604
            });
605
            $("#update_fund").on('click',function(){
605
            $("#update_fund").on('click',function(){
606
                var new_fund = $("#modify_budget_id").val();
606
                var new_fund = $("#modify_budget_id").val();
607
                var sort1 = $("#sort1").val();
607
                var sort1 = $("#updateFund").find('[name="sort1"]').val();
608
                var sort2 = $("#sort2").val();
608
                var sort2 = $("#updateFund").find('[name="sort2"]').val();
609
                var new_fund_name = $('#modify_budget_id option[value="'+new_fund+'"]').text();
609
                var new_fund_name = $('#modify_budget_id option[value="'+new_fund+'"]').text();
610
                var order_id = $(this).data('order_id');
610
                var order_id = $(this).data('order_id');
611
                let options = {
611
                let options = {
Lines 623-628 Link Here
623
                        $("#updateFund").modal('hide');
623
                        $("#updateFund").modal('hide');
624
                        $('#updateFund .showallfunds').prop('checked',false);
624
                        $('#updateFund .showallfunds').prop('checked',false);
625
                        $('.modify_fund[data-order_id="'+order_id+'"]').data('budget_id',new_fund);
625
                        $('.modify_fund[data-order_id="'+order_id+'"]').data('budget_id',new_fund);
626
                        $('.modify_fund[data-order_id="'+order_id+'"]').data('sort1',sort1);
627
                        $('.modify_fund[data-order_id="'+order_id+'"]').data('sort2',sort2);
626
                        $('.order_name[data-order_id="'+order_id+'"]').text(new_fund_name);
628
                        $('.order_name[data-order_id="'+order_id+'"]').text(new_fund_name);
627
                        humanMsg.displayAlert( _("Order updated"), { className: 'humanError' } );
629
                        humanMsg.displayAlert( _("Order updated"), { className: 'humanError' } );
628
                    })
630
                    })
Lines 633-648 Link Here
633
            $("#modify_budget_id").change(function(){
635
            $("#modify_budget_id").change(function(){
634
                var destination_sort1 = $(this).parents('.modal-body').find('input[name="sort1"]');
636
                var destination_sort1 = $(this).parents('.modal-body').find('input[name="sort1"]');
635
                var sort1_authcat = $(this).find("option:selected").attr('data-sort1-authcat');
637
                var sort1_authcat = $(this).find("option:selected").attr('data-sort1-authcat');
636
                var sort1 = $(destination_sort1).val() || "";
637
                if ( destination_sort1.length < 1 ) {
638
                if ( destination_sort1.length < 1 ) {
638
                    destination_sort1 = $(this).parents('.modal-body').find('select[name="sort1"]');
639
                    destination_sort1 = $(this).parents('.modal-body').find('select[name="sort1"]');
639
                }
640
                }
641
                var sort1 = $(destination_sort1).val() || "";
640
                var destination_sort2 = $(this).parents('.modal-body').find('input[name="sort2"]');
642
                var destination_sort2 = $(this).parents('.modal-body').find('input[name="sort2"]');
641
                var sort2_authcat = $(this).find("option:selected").attr('data-sort2-authcat');
643
                var sort2_authcat = $(this).find("option:selected").attr('data-sort2-authcat');
642
                var sort2 = $(destination_sort2).val() || "";
643
                if ( destination_sort2.length < 1 ) {
644
                if ( destination_sort2.length < 1 ) {
644
                    destination_sort2 = $(this).parents('.modal-body').find('select[name="sort2"]');
645
                    destination_sort2 = $(this).parents('.modal-body').find('select[name="sort2"]');
645
                }
646
                }
647
                var sort2 = $(destination_sort2).val() || "";
646
                getAuthValueDropbox( 'sort1', sort1_authcat, destination_sort1, sort1 );
648
                getAuthValueDropbox( 'sort1', sort1_authcat, destination_sort1, sort1 );
647
                getAuthValueDropbox( 'sort2', sort2_authcat, destination_sort2, sort2 );
649
                getAuthValueDropbox( 'sort2', sort2_authcat, destination_sort2, sort2 );
648
            });
650
            });
649
- 

Return to bug 34444