From 934074eef66defde5354ab6621142f1b71b28ac4 Mon Sep 17 00:00:00 2001 From: Alex Arnaud Date: Wed, 6 Oct 2021 16:46:42 +0200 Subject: [PATCH] Bug 20119: Add option to update claims count and claim date --- acqui/lateorders.pl | 4 +++ .../prog/en/modules/acqui/lateorders.tt | 30 +++++++++++++++++++--- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/acqui/lateorders.pl b/acqui/lateorders.pl index a5d0db1..1d6f8fc 100755 --- a/acqui/lateorders.pl +++ b/acqui/lateorders.pl @@ -121,7 +121,11 @@ if ($op and $op eq "send_alert"){ if ($op and $op eq "print_alert") { my @orderids = $input->multi_param('ordernumber'); + my $increment_claims = $input->param('claim-increment'); + if ( $increment_claims ) { + Koha::Acquisition::Orders->find($_)->claim() for @orderids; + } my $pdf = C4::Letters::PrintClaimOrderNotice(\@orderids, 'ACQCLAIM'); print $input->header( -type => 'application/pdf', diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt index 186fd34..163286d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt @@ -213,7 +213,7 @@ - + [% ELSE %]

There are no late orders.

@@ -285,6 +285,26 @@ + + + [% MACRO jsinclude BLOCK %] [% Asset.js("js/acquisitions-menu.js") | $raw %] [% INCLUDE 'datatables.inc' %] @@ -371,13 +391,17 @@ $("#type").val(""); }); - $('#print-claim').on('click', function(e) { + $('#print-claim-confirmed').on('click', function(e) { e.preventDefault(); - var form = $(this).parents('form') + var form = $('form[name="claim"]'); var op = form.find('input[name="op"]'); + if( $('#claim-increment').is(':checked') ){ + form.append(''); + } op.val('print_alert'); form.submit(); + $('#print-claim-confirm').modal('hide'); op.val('send_alert'); }); }); -- 2.7.4