- 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>
-|;
-
- $invdate = $form->datetonum($form->{invdate}, \%myconfig);
- $closedto = $form->datetonum($form->{closedto}, \%myconfig);
-
- if ($form->{id}) {
- my $show_storno = !$form->{storno} && !IS->has_storno(\%myconfig, $form, "ar");
-
- 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|">
-|;
- }
-
- } 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}])
-. qq|
-</form>
-
-</body>
-
- </html>
-|;
-
- $lxdebug->leave_sub();