";
my @triggers = ();
- my $totalpaid = 0;
+ $form->{totalpaid} = 0;
$form->{paidaccounts}++ if ($form->{"paid_$form->{paidaccounts}"});
for my $i (1 .. $form->{paidaccounts}) {
'-labels' => \%AP_paid_labels,
'-default' => $form->{"AP_paid_$i"}));
- $totalpaid += $form->{"paid_$i"};
+ $form->{totalpaid} += $form->{"paid_$i"};
# format amounts
if ($form->{"paid_$i"}) {
push(@triggers, "datepaid_$i", "BL", "trigger_datepaid_$i");
}
- my $paid_missing = $form->{invtotal_unformatted} - $totalpaid;
+ my $paid_missing = $form->{invtotal_unformatted} - $form->{totalpaid};
print qq|
<tr>
<td></td>
<td></td>
<td align="center">| . $locale->text('Total') . qq|</td>
- <td align="center">| . H($form->format_amount(\%myconfig, $totalpaid, 2)) . qq|</td>
+ <td align="center">| . H($form->format_amount(\%myconfig, $form->{totalpaid}, 2)) . qq|</td>
</tr>
<tr>
<td></td>
|;
}
# ToDO: - insert a global check for stornos, so that a storno is only possible a limited time after saving it
- our $total_paid;
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', $form->{id}) && (($total_paid == 0) || ($total_paid eq "")));
+ if ($form->{id} && !IS->has_storno(\%myconfig, $form, 'ap') && !IS->is_storno(\%myconfig, $form, 'ap', $form->{id}) && (($form->{totalpaid} == 0) || ($form->{totalpaid} eq "")));
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|">
$form->{defaultcurrency} = $form->get_default_currency(\%myconfig);
- our $invdate;
for my $i (1 .. $form->{paidaccounts}) {
if ($form->parse_amount(\%myconfig, $form->{"paid_$i"})) {
my $datepaid = $form->datetonum($form->{"datepaid_$i"}, \%myconfig);
if ($form->{defaultcurrency} && ($form->{currency} ne $form->{defaultcurrency})) {
$form->{"exchangerate_$i"} = $form->{exchangerate}
- if ($invdate == $datepaid);
+ if ($form->{transdate} == $datepaid);
$form->isblank("exchangerate_$i",
$locale->text('Exchangerate for payment missing!'));
}
</tr>
|;
- our $checked;
print qq|
<tr>
<td align=right>
<th align=left colspan=3>| . $locale->text('Monthly') . qq|</th>
</tr>
<tr>
- <td align=right> <input name=duetyp class=radio type=radio value="13"
-$checked></td>
- <td><input name=duetyp class=radio type=radio value="A" $checked > 1. | . $locale->text('Quarter') . qq|</td>
-|;
- $checked = "checked";
- print qq|
- <td><input name=duetyp class=radio type=radio value="1" $checked > | . $locale->text('January') . qq|</td>
-|;
- $checked = "";
- print qq|
- <td><input name=duetyp class=radio type=radio value="5" $checked > | . $locale->text('May') . qq|</td>
- <td><input name=duetyp class=radio type=radio value="9" $checked > | . $locale->text('September') . qq|</td>
+ <td align=right> <input name=duetyp class=radio type=radio value="13"></td>
+ <td><input name=duetyp class=radio type=radio value="A"> 1. | . $locale->text('Quarter') . qq|</td>
+ <td><input name=duetyp class=radio type=radio value="1" "checked"> | . $locale->text('January') . qq|</td>
+ <td><input name=duetyp class=radio type=radio value="5" > | . $locale->text('May') . qq|</td>
+ <td><input name=duetyp class=radio type=radio value="9" > | . $locale->text('September') . qq|</td>
</tr>
<tr>
<td align= right> </td>
- <td><input name=duetyp class=radio type=radio value="B" $checked> 2. | . $locale->text('Quarter') . qq|</td>
- <td><input name=duetyp class=radio type=radio value="2" $checked > | . $locale->text('February') . qq|</td>
- <td><input name=duetyp class=radio type=radio value="6" $checked > | . $locale->text('June') . qq|</td>
- <td><input name=duetyp class=radio type=radio value="10" $checked > | . $locale->text('October') . qq|</td>
+ <td><input name=duetyp class=radio type=radio value="B"> 2. | . $locale->text('Quarter') . qq|</td>
+ <td><input name=duetyp class=radio type=radio value="2" > | . $locale->text('February') . qq|</td>
+ <td><input name=duetyp class=radio type=radio value="6" > | . $locale->text('June') . qq|</td>
+ <td><input name=duetyp class=radio type=radio value="10" > | . $locale->text('October') . qq|</td>
</tr>
<tr>
<td> </td>
- <td><input name=duetyp class=radio type=radio value="C" $checked> 3. | . $locale->text('Quarter') . qq|</td>
- <td><input name=duetyp class=radio type=radio value="3" $checked > | . $locale->text('March') . qq|</td>
- <td><input name=duetyp class=radio type=radio value="7" $checked > | . $locale->text('July') . qq|</td>
- <td><input name=duetyp class=radio type=radio value="11" $checked > | . $locale->text('November') . qq|</td>
+ <td><input name=duetyp class=radio type=radio value="C"> 3. | . $locale->text('Quarter') . qq|</td>
+ <td><input name=duetyp class=radio type=radio value="3" > | . $locale->text('March') . qq|</td>
+ <td><input name=duetyp class=radio type=radio value="7" > | . $locale->text('July') . qq|</td>
+ <td><input name=duetyp class=radio type=radio value="11" > | . $locale->text('November') . qq|</td>
</tr>
<tr>
<td> </td>
- <td><input name=duetyp class=radio type=radio value="D" $checked> 4. | . $locale->text('Quarter') . qq| </td>
- <td><input name=duetyp class=radio type=radio value="4" $checked > | . $locale->text('April') . qq|</td>
- <td><input name=duetyp class=radio type=radio value="8" $checked > | . $locale->text('August') . qq|</td>
- <td><input name=duetyp class=radio type=radio value="12" $checked > | . $locale->text('December') . qq|</td>
+ <td><input name=duetyp class=radio type=radio value="D"> 4. | . $locale->text('Quarter') . qq| </td>
+ <td><input name=duetyp class=radio type=radio value="4" > | . $locale->text('April') . qq|</td>
+ <td><input name=duetyp class=radio type=radio value="8" > | . $locale->text('August') . qq|</td>
+ <td><input name=duetyp class=radio type=radio value="12" > | . $locale->text('December') . qq|</td>
</tr>
<tr>
<td colspan=5><hr size=3 noshade></td>
</tr>
<tr>
- <th align=left><input name=reporttype class=radio type=radio value="free" $checked> | . $locale->text('Free report period') . qq|</th>
+ <th align=left><input name=reporttype class=radio type=radio value="free"> | . $locale->text('Free report period') . qq|</th>
<td align=left colspan=4>| . $locale->text('From') . qq|
$button1
$button1_2