Skip to content

Commit 4f2dbd9

Browse files
committed
Overpayments minor UI fixes
This fixes an unexpected blank line in the invoice search workflow.
1 parent 126d84e commit 4f2dbd9

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

lib/LedgerSMB/Scripts/payment.pm

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1675,20 +1675,19 @@ sub use_overpayment2 {
16751675
@vc_info = $Payment->get_entity_credit_account();
16761676
push @vc_info, {}; # inserting a blank at the start
16771677
for my $ref (0 .. $#vc_info) {
1678-
my ($name) = split(/:/, $vc_info[$ref]->{name});
1678+
my ($vcname) = split(/:/, $vc_info[$ref]->{name});
16791679
push @vc_list, { value => $vc_info[$ref]->{id},
1680-
name => $name,
1680+
name => $vcname,
16811681
vc_discount_accno => $vc_info[$ref]->{discount}};
1682-
my $n_name = $name if $vc_info[$ref]->{id} = $Payment->{new_entity_id};
1682+
$n_name = $vcname if $vc_info[$ref]->{id} == $Payment->{new_entity_id};
16831683
}
16841684

16851685

1686-
$count=1;
16871686
#lets see which invoice do we have printed
1688-
while ($Payment->{"entity_id_$count"})
1687+
for my $count(1 .. $request->{count})
16891688
{
16901689
# we should rename the checkbox to remove_ or ignore_
1691-
if ($Payment->{"checkbox_$count"})
1690+
if ($Payment->{"checkbox_$count"} or not $Payment->{"entity_id_$count"})
16921691
{
16931692
$count++;
16941693
next;
@@ -1724,7 +1723,7 @@ sub use_overpayment2 {
17241723
id => $Payment->{"invoice_id_$count"},
17251724
is_invoice => $Payment->{"is_invoice_$count"},
17261725
href => $uri },
1727-
entity_name => $name,
1726+
entity_name => $Payment->{"entity_name_$count"},
17281727
entity_id => $Payment->{"entity_id_$count"},
17291728
vc_discount_accno => $Payment->{"vc_discount_accno_$count"},
17301729
invoice_date => $Payment->{"invoice_date_$count"},
@@ -1780,7 +1779,7 @@ sub use_overpayment2 {
17801779
vc_discount_accno => $vc_discount_accno,
17811780
entity_id => qq|$Selected_entity->{entity_credit_id}--$name|,
17821781
invoice_date => $ref->{invoice_date},
1783-
applied_due => $Payment->{"due_$count"},
1782+
applied_due => $ref->{due},
17841783
due => $ref->{due},
17851784
discount => $ref->{discount},
17861785
selected_accno => {

0 commit comments

Comments
 (0)