qq|SELECT a.id, a.invnumber, a.ordnumber, a.transdate, | .
qq| a.duedate, a.netamount, a.amount, a.paid, | .
qq| a.invoice, a.datepaid, a.terms, a.notes, a.shipvia, | .
- qq| a.shippingpoint, a.storno, a.globalproject_id, | .
+ qq| a.shippingpoint, a.storno, a.storno_id, a.globalproject_id, | .
qq| a.marge_total, a.marge_percent, | .
qq| a.transaction_description, | .
qq| pr.projectnumber AS globalprojectnumber, | .
# ToDO: - insert a global check for stornos, so that a storno is only possible a limited time after saving it
print qq| <input class=submit type=submit name=action value="| . $locale->text('Storno') . qq|"> |
- if ($form->{id} && !IS->has_storno(\%myconfig, $form, 'ap') && !IS->is_storno(\%myconfig, $form, 'ap'));
+ if ($form->{id} && !IS->has_storno(\%myconfig, $form, 'ap') && !IS->is_storno(\%myconfig, $form, 'ap', $form->{id}));
print qq| <input class=submit type=submit name=action value="| . $locale->text('Post Payment') . qq|">
<input class=submit type=submit name=action value="| . $locale->text('Use As Template') . qq|">
map { $ar->{$_} = $form->format_amount(\%myconfig, $ar->{$_}, 2) } qw(netamount tax amount paid due marge_total marge_percent);
- my $is_storno = $ar->{storno} && IS->is_storno(\%myconfig, $form, 'ar');
- my $has_storno = $ar->{storno} && !$is_storno;
+ my $is_storno = $ar->{storno} && !$ar->{storno_id};
+ my $has_storno = $ar->{storno} && $ar->{storno_id};
$ar->{type} =
$has_storno ? $locale->text("Invoice with Storno (abbreviation)") :