The lineitem-level amount billed specifically lives in the MOA+203
segment. This change ensures that if there are multiple MOAs for a
linetiem, we specifically use the MOA+203 to determine the price.
Signed-off-by: Bill Erickson <berick@esilibrary.com>
# Segment Group 26 concerns *lineitem* price (i.e, total for all copies
# on this lineitem).
+ # e.g. MOA+203:56.62’
my $lineitem_price = $sg25->{SG26}[0]{MOA}[0]{C516}{5004};
+ if (@{$sg25->{SG26}} > 1) {
+ # if there are multiple MOAs, use the MOA+203
+
+ for my $moa (@{$sg25->{SG26}}) {
+ $lineitem_price = $moa->{MOA}[0]{C516}{5004}
+ if $moa->{MOA}[0]{C516}{5025} eq '203';
+ }
+ }
+
+ $logger->info($log_prefix . "extracted LI price $lineitem_price");
+
+
# Segment Group 28 concerns *unit* (lineitem detail) price. We may
# not actually use this. TBD.
my $per_unit_price;