- my $paid_missing = $form->{oldinvtotal} - $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>
- </tr>
- <tr>
- <td></td>
- <td></td>
- <td align="center">| . $locale->text('Missing amount') . qq|</td>
- <td align="center">| . H($form->format_amount(\%myconfig, $paid_missing, 2)) . qq|</td>
- </tr>
-|;
-
- map({ print($cgi->hidden("-name" => $_, "-value" => $form->{$_})); } qw(paidaccounts selectAR_paid oldinvtotal));
- print qq|<input type="hidden" name="oldtotalpaid" value="$totalpaid">
- </table>
- </td>
- </tr>
- <tr>
- <td><hr size="3" noshade></td>
- </tr>
- <tr>
- <td>
-|;
-
- print_options();
-
- print qq|
- </td>
- </tr>
-</table>
-|;
-
- my $invdate = $form->datetonum($form->{invdate}, \%myconfig);
- my $closedto = $form->datetonum($form->{closedto}, \%myconfig);
-
- if ($form->{id}) {
- my $show_storno = !$form->{storno} && !IS->has_storno(\%myconfig, $form, "ar") && (($totalpaid == 0) || ($totalpaid eq ""));
-
- print qq|
- <input class="submit" type="submit" accesskey="u" name="action" id="update_button" value="| . $locale->text('Update') . qq|">
- <input class="submit" type="submit" name="action" value="| . $locale->text('Ship to') . qq|">
- <input class="submit" type="submit" name="action" value="| . $locale->text('Print') . qq|">
- <input class="submit" type="submit" name="action" value="| . $locale->text('E-mail') . qq|"> |;
- print qq|<input class="submit" type="submit" name="action" value="| . $locale->text('Storno') . qq|"> | if ($show_storno);
- print qq|<input class="submit" type="submit" name="action" value="| . $locale->text('Post Payment') . qq|"> |;
- print qq|<input class="submit" type="submit" name="action" value="| . $locale->text('Use As Template') . qq|"> |;
- if ($form->{id} && !($form->{type} eq "credit_note")) {
- print qq| <input class="submit" type="submit" name="action" value="| . $locale->text('Credit Note') . qq|"> |;
- }
- if ($form->{radier}) {
- print qq| <input class="submit" type="submit" name="action" value="| . $locale->text('Delete') . qq|"> |;
- }
-
-
- if ($invdate > $closedto) {
- print qq| <input class="submit" type="submit" name="action" value="| . $locale->text('Order') . qq|"> |;
- }
-
- print qq| <input type="button" class="submit" onclick="follow_up_window()" value="| . $locale->text('Follow-Up') . qq|">|;
-
- } else {
- if ($invdate > $closedto) {
- print qq|
- <input class="submit" type="submit" name="action" id="update_button" value="| . $locale->text('Update') . qq|">
- <input class="submit" type="submit" name="action" value="| . $locale->text('Ship to') . qq|">
- <input class="submit" type="submit" name="action" value="| . $locale->text('Preview') . qq|">
- <input class="submit" type="submit" name="action" value="| . $locale->text('E-mail') . qq|">
- <input class="submit" type="submit" name="action" value="| . $locale->text('Print and Post') . qq|">
- <input class="submit" type="submit" name="action" value="| . $locale->text('Post') . qq|"> | .
- NTI($cgi->submit('-name' => 'action', '-value' => $locale->text('Save draft'), '-class' => 'submit'));
- }
- }
-
- # button for saving history
- if($form->{id} ne "") {
- print qq|
- <input type="button" class="submit" onclick="set_history_window(|
- . Q($form->{id})
- . qq|);" name="history" id="history" value="|
- . $locale->text('history')
- . qq|"> |;
- }
- # /button for saving history
-
- # mark_as_paid button
- if($form->{id} ne "") {
- print qq|<input type="submit" class="submit" name="action" value="| . $locale->text('mark as paid') . qq|">|;
- }
- # /mark_as_paid button
- print $form->write_trigger(\%myconfig, scalar(@triggers) / 3, @triggers) .
- qq|
-
-<input type="hidden" name="rowcount" value="$form->{rowcount}">
-| .
-$cgi->hidden("-name" => "callback", "-value" => $form->{callback})
-. $cgi->hidden('-name' => 'draft_id', '-default' => [$form->{draft_id}])
-. $cgi->hidden('-name' => 'draft_description', '-default' => [$form->{draft_description}])
-. $cgi->hidden('-name' => 'customer_discount', '-value' => [$form->{customer_discount}])
-. qq|
-</form>
-
-</body>
-
- </html>
-|;
+ print $form->parse_html_template('is/form_footer', {
+ is_type_credit_note => ($form->{type} eq "credit_note"),
+ totalpaid => $totalpaid,
+ paid_missing => $form->{invtotal} - $totalpaid,
+ print_options => print_options(inline => 1),
+ show_storno => $form->{id} && !$form->{storno} && !IS->has_storno(\%myconfig, $form, "ar") && !$totalpaid,
+ show_delete => ($form->current_date(\%myconfig) eq $form->{gldate}),
+ });
+##print $form->parse_html_template('is/_payments'); # parser
+##print $form->parse_html_template('webdav/_list'); # parser