Bug 15164 - Allow editing of the invoice number after initial saving

When you notice a typo in your invoice number after finishing with the
receiving process, the only way to correct it right now is in the
database - or by undoing all the steps and starting over.

It would be nice if the invoice number could be edited.

Test Plan:
1) Apply this patch
2) Browse to acqui/invoice.pl for an invoice
3) Note the new "Invoice number" field contains the existing invoice
4) Alter the invoice number
5) Save the invoice
6) Note the invoice number has been updated
7) Edit the invoice again
8) Attempt to save the invoice with an empty invoice number field
9) Note that you cannot save the invoice without having an invoice number

Followed test plan, works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
Kyle M Hall 2016-08-17 13:43:01 +00:00
parent d356e71ecb
commit e87cf98c2e
2 changed files with 9 additions and 1 deletions

View File

@ -80,8 +80,10 @@ elsif ( $op && $op eq 'reopen' ) {
elsif ( $op && $op eq 'mod' ) {
my $shipmentcost = $input->param('shipmentcost');
my $shipment_budget_id = $input->param('shipment_budget_id');
my $invoicenumber = $input->param('invoicenumber');
ModInvoice(
invoiceid => $invoiceid,
invoicenumber => $invoicenumber,
shipmentdate => output_pref( { str => scalar $input->param('shipmentdate'), dateformat => 'iso', dateonly => 1 } ),
billingdate => output_pref( { str => scalar $input->param('billingdate'), dateformat => 'iso', dateonly => 1 } ),
shipmentcost => $shipmentcost,

View File

@ -73,9 +73,15 @@
<h1>Invoice: [% invoicenumber %]</h1>
<p>Vendor: <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]">[% suppliername %]</a></p>
<form action="/cgi-bin/koha/acqui/invoice.pl" method="post">
<form action="/cgi-bin/koha/acqui/invoice.pl" method="post" class="validated">
<fieldset class="rows">
<ol>
<li>
<label for="shipmentdate">Invoice number:</label>
<input type="text" id="invoicenumber" name="invoicenumber" value="[% invoicenumber %]" class="required" required="required"/>
<span class="required">Required</span>
</li>
<li><label for="shipmentdate">Shipment date:</label>
<input type="text" size="10" id="shipmentdate" name="shipmentdate" value="[% shipmentdate | $KohaDates %]" class="datepicker" /></li>