Browse Source

Bug 8417: Make the order receive date editable

Currently the date of the order reception is the date of shipping date,
which is wrong.
This patch makes this date editable (with default is today).

Test plan:
1/ Create an order and receive it
2/ Confirm that you can edit the reception date and it's take into
account as the datereceived.

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
3.22.x
Jonathan Druart 9 years ago
committed by Tomas Cohen Arazi
parent
commit
57999441a8
  1. 8
      C4/Acquisition.pm
  2. 2
      acqui/finishreceive.pl
  3. 12
      acqui/orderreceive.pl
  4. 10
      koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt

8
C4/Acquisition.pm

@ -1392,7 +1392,13 @@ sub ModReceiveOrder {
my $order_vendornote = $params->{order_vendornote};
my $dbh = C4::Context->dbh;
$datereceived = output_pref({ dt=>dt_from_string, dateonly=>1, dateformat=>'iso' }) unless $datereceived;
$datereceived = output_pref(
{
dt => ( $datereceived ? dt_from_string( $datereceived ) : dt_from_string ),
dateformat => 'iso',
dateonly => 1,
}
);
my $suggestionid = GetSuggestionFromBiblionumber( $biblionumber );
if ($suggestionid) {
ModSuggestion( {suggestionid=>$suggestionid,

2
acqui/finishreceive.pl

@ -48,10 +48,10 @@ my $origquantityrec = $input->param('origquantityrec');
my $quantityrec = $input->param('quantityrec');
my $quantity = $input->param('quantity');
my $unitprice = $input->param('cost');
my $datereceived = $input->param('datereceived'),
my $invoiceid = $input->param('invoiceid');
my $invoice = GetInvoice($invoiceid);
my $invoiceno = $invoice->{invoicenumber};
my $datereceived = $invoice->{shipmentdate};
my $booksellerid = $input->param('booksellerid');
my $cnt = 0;
my $ecost = $input->param('ecost');

12
acqui/orderreceive.pl

@ -67,7 +67,6 @@ use C4::Koha; # GetKohaAuthorisedValues GetItemTypes
use C4::Acquisition;
use C4::Auth;
use C4::Output;
use C4::Dates qw/format_date/;
use C4::Budgets qw/ GetBudget GetBudgetHierarchy CanUserUseBudget GetBudgetPeriods /;
use C4::Members;
use C4::Branch; # GetBranches
@ -76,7 +75,7 @@ use C4::Biblio;
use C4::Suggestions;
use Koha::Acquisition::Bookseller;
use Koha::DateUtils qw( dt_from_string );
my $input = new CGI;
@ -85,11 +84,8 @@ my $invoiceid = $input->param('invoiceid');
my $invoice = GetInvoice($invoiceid);
my $booksellerid = $invoice->{booksellerid};
my $freight = $invoice->{shipmentcost};
my $datereceived = $invoice->{shipmentdate};
my $ordernumber = $input->param('ordernumber');
$datereceived = $datereceived ? C4::Dates->new($datereceived, 'iso') : C4::Dates->new();
my $bookseller = Koha::Acquisition::Bookseller->fetch({ id => $booksellerid });
my $results;
$results = SearchOrders({
@ -196,6 +192,8 @@ my $member = GetMember( borrowernumber => $authorisedby );
my $budget = GetBudget( $order->{budget_id} );
my $datereceived = $order->{datereceived} ? dt_from_string( $order->{datereceived} ) : dt_from_string;
$template->param(
AcqCreateItem => $AcqCreateItem,
count => 1,
@ -205,7 +203,6 @@ $template->param(
booksellerid => $order->{'booksellerid'},
freight => $freight,
name => $bookseller->{'name'},
date => format_date($order->{entrydate}),
title => $order->{'title'},
author => $order->{'author'},
copyrightdate => $order->{'copyrightdate'},
@ -221,8 +218,7 @@ $template->param(
membersurname => $member->{surname} || "",
invoiceid => $invoice->{invoiceid},
invoice => $invoice->{invoicenumber},
datereceived => $datereceived->output(),
datereceived_iso => $datereceived->output('iso'),
datereceived => $datereceived,
order_internalnote => $order->{order_internalnote},
order_vendornote => $order->{order_vendornote},
suggestionid => $suggestion->{suggestionid},

10
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt

@ -1,6 +1,8 @@
[% USE KohaDates %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Acquisitions &rsaquo; Receipt summary for : [% name %] [% IF ( invoice ) %]invoice, [% invoice %][% END %]</title>
[% INCLUDE 'doc-head-close.inc' %]
[% INCLUDE 'calendar.inc' %]
[% INCLUDE 'additem.js.inc' %]
<script type="text/javascript" src="[% themelang %]/js/additem.js"></script>
<script type="text/javascript" src="[% themelang %]/js/cataloging.js"></script>
@ -259,14 +261,16 @@
<input type="hidden" name="invoiceid" value="[% invoiceid %]" />
<input type="hidden" name="ordernumber" value="[% ordernumber %]" />
<input type="hidden" name="booksellerid" value="[% booksellerid %]" />
<input type="hidden" name="datereceived" value="[% datereceived_iso %]" />
<input type="hidden" name="gstrate" value="[% gstrate %]" />
</div>
<div class="yui-u">
<fieldset class="rows">
<legend>Accounting details</legend>
<ol>
<li><label for="datereceived">Date received: </label><span> [% datereceived %] </span></li>
<ol>
<li>
<label for="datereceived">Date received: </label>
<input type="text" size="10" id="datereceived" name="datereceived" value="[% datereceived | $KohaDates %]" class="datepicker" />
</li>
<li><label for="bookfund">Fund: </label><select id="bookfund" name="bookfund">
<option value="">Keep current ([% budget_period_description %] - [% bookfund %])</option>
[% FOREACH period IN budget_loop %]

Loading…
Cancel
Save