Bugzilla – Attachment 154874 Details for
Bug 34445
Default budget is not selected in addorderiso2709.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34445: Set default budget in addorderiso2709.pl
Bug-34445-Set-default-budget-in-addorderiso2709pl.patch (text/plain), 3.10 KB, created by
Marcel de Rooy
on 2023-08-28 08:56:30 UTC
(
hide
)
Description:
Bug 34445: Set default budget in addorderiso2709.pl
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2023-08-28 08:56:30 UTC
Size:
3.10 KB
patch
obsolete
>From 770d00dffc18e097a41ea274a373a5effbc9ab1f Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >Date: Mon, 31 Jul 2023 09:48:18 +0000 >Subject: [PATCH] Bug 34445: Set default budget in addorderiso2709.pl >Content-Type: text/plain; charset=utf-8 > >This patch allows the default budget to be used as a fallback if no budget is selected. Currently the default budget is set using lines 129-133 but then is never used. > >QA follow-up: >- perl tidied >- budget_codes changed to budget_ids for consistency > >Test plan: >1) Apply patch >2) restart_all >3) Follow the steps from the bug description >4) Order lines should be added properly > >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >[EDIT] Rearranged comments >--- > acqui/addorderiso2709.pl | 16 ++++++++++------ > 1 file changed, 10 insertions(+), 6 deletions(-) > >diff --git a/acqui/addorderiso2709.pl b/acqui/addorderiso2709.pl >index fb31a8bcee..250d9c2bb3 100755 >--- a/acqui/addorderiso2709.pl >+++ b/acqui/addorderiso2709.pl >@@ -224,7 +224,8 @@ if ($op eq ""){ > my @notforloans = $input->multi_param('notforloan_' . $import_record->import_record_id); > my @uris = $input->multi_param('uri_' . $import_record->import_record_id); > my @copynos = $input->multi_param('copyno_' . $import_record->import_record_id); >- my @budget_codes = $input->multi_param('budget_code_' . $import_record->import_record_id); >+ my @budget_ids = >+ $input->multi_param( 'budget_code_' . $import_record->import_record_id ); # bad field name used in template! > my @itemprices = $input->multi_param('itemprice_' . $import_record->import_record_id); > my @replacementprices = $input->multi_param('replacementprice_' . $import_record->import_record_id); > my @itemcallnumbers = $input->multi_param('itemcallnumber_' . $import_record->import_record_id); >@@ -257,11 +258,14 @@ if ($op eq ""){ > # Group orderlines from MarcItemFieldsToOrder > my $budget_hash; > for (my $i = 0; $i < $count; $i++) { >- $budget_hash->{$budget_codes[$i]}->{quantity} += 1; >- $budget_hash->{$budget_codes[$i]}->{price} = $itemprices[$i]; >- $budget_hash->{$budget_codes[$i]}->{replacementprice} = $replacementprices[$i]; >- $budget_hash->{$budget_codes[$i]}->{itemnumbers} //= []; >- push @{ $budget_hash->{$budget_codes[$i]}->{itemnumbers} }, $itemnumbers[$i]; >+ $budget_ids[$i] = $budget_id if !$budget_ids[$i]; # Use default budget if no budget selected in the UI >+ $budget_hash->{ $budget_ids[$i] }->{quantity} += 1; >+ $budget_hash->{ $budget_ids[$i] }->{price} = $itemprices[$i]; >+ $budget_hash->{ $budget_ids[$i] }->{replacementprice} = >+ $replacementprices[$i]; >+ $budget_hash->{ $budget_ids[$i] }->{itemnumbers} //= []; >+ push @{ $budget_hash->{ $budget_ids[$i] }->{itemnumbers} }, >+ $itemnumbers[$i]; > } > > # Create orderlines from MarcItemFieldsToOrder >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 34445
:
154084
|
154085
|
154413
|
154791
|
154795
| 154874