From 75f23ba7925d9a331cb221823d686c541591cbcf Mon Sep 17 00:00:00 2001 From: Jared Camins-Esakov Date: Thu, 15 Aug 2013 11:28:30 -0400 Subject: [PATCH] Bug 10736: show duplicate invoice warning on second invoice If you have AcqWarnOnDuplicateInvoice set to warn it only warns if you have 2 or more invoices with the same number. It should warn if you're trying to create a duplicate. To test: 1) Turn on AcqWarnOnDuplicateInvoice. 2) Try to create an invoice that duplicates an invoice number you are already using exactly once. 3) Note that you get a warning after applying this patch. Signed-off-by: Nicole C. Engard all tests pass Signed-off-by: Jonathan Druart Signed-off-by: Galen Charlton --- acqui/parcels.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/acqui/parcels.pl b/acqui/parcels.pl index 37a0023b18..fbfa9fa023 100755 --- a/acqui/parcels.pl +++ b/acqui/parcels.pl @@ -112,7 +112,7 @@ if ( $op and $op eq 'new' ) { supplierid => $booksellerid, invoicenumber => $invoicenumber, ); - if ( $#invoices > 0 ) { + if ( scalar @invoices > 0 ) { $template->{'VARS'}->{'duplicate_invoices'} = \@invoices; $template->{'VARS'}->{'invoicenumber'} = $invoicenumber; $template->{'VARS'}->{'shipmentdate'} = $shipmentdate; -- 2.39.5