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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt (-6 / +17 lines)
Lines 94-100 Link Here
94
            <main>
94
            <main>
95
95
96
<h1>Receive items from : [% name | html %] [% IF ( invoice ) %][[% invoice | html %]] [% END %] (order #[% multiple_orders | html %])</h1>
96
<h1>Receive items from : [% name | html %] [% IF ( invoice ) %][[% invoice | html %]] [% END %] (order #[% multiple_orders | html %])</h1>
97
97
[% SET only_one_order = ( multiple_orders.split(',').size == 1 ) %]
98
[% IF multiple_orders %]
98
[% IF multiple_orders %]
99
    <table id="multiple_orders" class="table table-bordered table-striped">
99
    <table id="multiple_orders" class="table table-bordered table-striped">
100
        <thead>
100
        <thead>
Lines 393-402 Link Here
393
                    </div>
393
                    </div>
394
                </div>
394
                </div>
395
                <div class="modal-footer">
395
                <div class="modal-footer">
396
                    <button type="button" class="btn btn-defualt modal-prev">Previous order</button>
396
                [% IF only_one_order %]
397
                    <button type="button" class="btn btn-primary modal-save" disabled>Confirm</button>
398
                    <a class="cancel btn btn-default" href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid | html %]&sticky_filters=1">Cancel</a>
399
                [% ELSE %]
400
                    <button type="button" class="btn btn-default modal-prev">Previous order</button>
397
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
401
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
398
                    <button type="button" class="btn btn-primary modal-save">Save changes</button>
402
                    <button type="button" class="btn btn-primary modal-save">Save changes</button>
399
                    <button type="button" class="btn btn-defualt modal-next">Next order</button>
403
                    <button type="button" class="btn btn-default modal-next">Next order</button>
404
                [% END %]
400
                </div>
405
                </div>
401
            </div>
406
            </div>
402
        </div>
407
        </div>
Lines 625-631 Link Here
625
                        }
630
                        }
626
                    }
631
                    }
627
                ],
632
                ],
628
                [% IF multiple_orders.split(',').size == 1 %]
633
                [% IF only_one_order %]
629
                    "drawCallback": function( settings ) {
634
                    "drawCallback": function( settings ) {
630
                        $(this).find("tbody tr td:last-child a.order_edit_toggle").click();
635
                        $(this).find("tbody tr td:last-child a.order_edit_toggle").click();
631
                    },
636
                    },
Lines 873-878 Link Here
873
                $("#quantity").val(qty);
878
                $("#quantity").val(qty);
874
                var row = $("#order_edit").data('row');
879
                var row = $("#order_edit").data('row');
875
                row.quantity_received = qty;
880
                row.quantity_received = qty;
881
            [% IF only_one_order %]
882
                $('.modal-save').prop('disabled', qty < 1 );
883
            [% END %]
876
            })
884
            })
877
885
878
            $("#order_edit").on("change", "#tax_rate", function() {
886
            $("#order_edit").on("change", "#tax_rate", function() {
Lines 1298-1304 Link Here
1298
                var saved_rows = save_row();
1306
                var saved_rows = save_row();
1299
                if(Object.keys(saved_rows).length) $('.save').prop('disabled', false);
1307
                if(Object.keys(saved_rows).length) $('.save').prop('disabled', false);
1300
                $("#order_edit").modal('hide');
1308
                $("#order_edit").modal('hide');
1301
                [% IF multiple_orders.split(',').size == 1 %]
1309
                [% IF only_one_order %]
1302
                    $(".save").click();
1310
                    $(".save").click();
1303
                [% END %]
1311
                [% END %]
1304
            })
1312
            })
Lines 1317-1323 Link Here
1317
            });
1325
            });
1318
1326
1319
            $("#order_edit").on("hide.bs.modal", function() {
1327
            $("#order_edit").on("hide.bs.modal", function() {
1328
            [% IF only_one_order %] [%# On the single case, dismissing the modal equals to cancelling %]
1329
                location.href = "/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid | html %]&sticky_filters=1";
1330
            [% ELSE %]
1320
                $("#child_orders_table").DataTable().off('preDraw').destroy();
1331
                $("#child_orders_table").DataTable().off('preDraw').destroy();
1332
            [% END %]
1321
            });
1333
            });
1322
        });
1334
        });
1323
    </script>
1335
    </script>
1324
- 

Return to bug 33784