Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision b8916e5c

Von Sven Schöling vor fast 15 Jahren hinzugefügt

  • ID b8916e5c2982dd12e0a612252c85f5e1648e162c
  • Vorgänger b65cc47a
  • Nachfolger 7130d91e

is_templates: form_footer erste Version

Unterschiede anzeigen:

bin/mozilla/is.pl
173 173
  $form->{selectcustomer} = 1;
174 174

  
175 175
  # departments
176
  if ($form->{all_departments}) {
177
    $form->{selectdepartment} = "<option>\n";
178
    $form->{department}       = "$form->{department}--$form->{department_id}";
179

  
180
    map {
181
      $form->{selectdepartment} .=
182
        "<option>$_->{description}--$_->{id}</option>\n"
183
    } (@{ $form->{all_departments} });
184
  }
176
#  if ($form->{all_departments}) {
177
#    $form->{selectdepartment} = "<option>\n";
178
#    $form->{department}       = "$form->{department}--$form->{department_id}";
179
#
180
#    map {
181
#      $form->{selectdepartment} .= "<option>$_->{description}--$_->{id}</option>\n"
182
#    } @{ $form->{all_departments} };
183
#  }
185 184

  
186 185
  $form->{employee} = "$form->{employee}--$form->{employee_id}";
187 186

  
......
191 190

  
192 191
  foreach my $key (keys %{ $form->{AR_links} }) {
193 192
    foreach my $ref (@{ $form->{AR_links}{$key} }) {
194
      $form->{"select$key"} .=
195
"<option>$ref->{accno}--$ref->{description}</option>\n";
193
      $form->{"select$key"} .= "<option>$ref->{accno}--$ref->{description}</option>\n";
196 194
    }
197 195

  
198 196
    if ($key eq "AR_paid") {
199 197
      next unless $form->{acc_trans}{$key};
200 198
      for my $i (1 .. scalar @{ $form->{acc_trans}{$key} }) {
201
        $form->{"AR_paid_$i"} =
202
          "$form->{acc_trans}{$key}->[$i-1]->{accno}--$form->{acc_trans}{$key}->[$i-1]->{description}";
199
        $form->{"AR_paid_$i"}      = "$form->{acc_trans}{$key}->[$i-1]->{accno}--$form->{acc_trans}{$key}->[$i-1]->{description}";
203 200

  
204 201
        # reverse paid
205
        $form->{"paid_$i"} = $form->{acc_trans}{$key}->[$i - 1]->{amount} * -1;
206
        $form->{"datepaid_$i"} =
207
          $form->{acc_trans}{$key}->[$i - 1]->{transdate};
208
        $form->{"forex_$i"} = $form->{"exchangerate_$i"} =
209
          $form->{acc_trans}{$key}->[$i - 1]->{exchangerate};
210
        $form->{"source_$i"} = $form->{acc_trans}{$key}->[$i - 1]->{source};
211
        $form->{"memo_$i"}   = $form->{acc_trans}{$key}->[$i - 1]->{memo};
202
        $form->{"paid_$i"}         = $form->{acc_trans}{$key}->[$i - 1]->{amount} * -1;
203
        $form->{"datepaid_$i"}     = $form->{acc_trans}{$key}->[$i - 1]->{transdate};
204
        $form->{"exchangerate_$i"} = $form->{acc_trans}{$key}->[$i - 1]->{exchangerate};
205
        $form->{"forex_$i"}        = $form->{"exchangerate_$i"};
206
        $form->{"source_$i"}       = $form->{acc_trans}{$key}->[$i - 1]->{source};
207
        $form->{"memo_$i"}         = $form->{acc_trans}{$key}->[$i - 1]->{memo};
212 208

  
213 209
        $form->{paidaccounts} = $i;
214 210
      }
215 211
    } else {
216
      $form->{$key} =
217
        "$form->{acc_trans}{$key}->[0]->{accno}--$form->{acc_trans}{$key}->[0]->{description}";
212
      $form->{$key} = "$form->{acc_trans}{$key}->[0]->{accno}--$form->{acc_trans}{$key}->[0]->{description}";
218 213
    }
219

  
220 214
  }
221 215

  
222 216
  $form->{paidaccounts} = 1 unless (exists $form->{paidaccounts});
223 217

  
224 218
  $form->{AR} = $form->{AR_1} unless $form->{id};
225 219

  
226
  $form->{locked} =
227
    ($form->datetonum($form->{invdate}, \%myconfig) <=
228
     $form->datetonum($form->{closedto}, \%myconfig));
220
  $form->{locked} = ($form->datetonum($form->{invdate},  \%myconfig)
221
                  <= $form->datetonum($form->{closedto}, \%myconfig));
229 222

  
230 223
  $main::lxdebug->leave_sub();
231 224
}
......
399 392
  $form->{invtotal} = $form->{invsubtotal};
400 393

  
401 394
  my ($rows, $introws);
402
  if (($rows = $form->numtextrows($form->{notes}, 26, 8)) < 2) {
403
    $rows = 2;
404
  }
405
  if (($introws = $form->numtextrows($form->{intnotes}, 35, 8)) < 2) {
406
    $introws = 2;
407
  }
408
  $rows = ($rows > $introws) ? $rows : $introws;
409
  my $notes = qq|<textarea name="notes" rows="$rows" cols="26" wrap="soft">$form->{notes}</textarea>|;
410
  my $intnotes = qq|<textarea name="intnotes" rows="$rows" cols="35" wrap="soft">$form->{intnotes}</textarea>|;
411

  
412
  $form->{taxincluded} = ($form->{taxincluded} ? "checked" : "");
413

  
414
  my $taxincluded = "";
415
  if ($form->{taxaccounts}) {
416
    $taxincluded = qq| <input name="taxincluded" class="checkbox" type="checkbox" $form->{taxincluded}> <b>| . $locale->text('Tax Included') . qq|</b><br><br>|;
417
  }
395
  if (($rows    = $form->numtextrows($form->{notes}, 26, 8)) < 2)    { $rows    = 2; }
396
  if (($introws = $form->numtextrows($form->{intnotes}, 35, 8)) < 2) { $introws = 2; }
397
  $form->{rows} = ($rows > $introws) ? $rows : $introws;
418 398

  
419 399
  my ($tax, $subtotal);
420 400
  if (!$form->{taxincluded}) {
......
429 409
	      <tr>
430 410
                <th align="right">$form->{"${item}_description"}&nbsp;| . $form->{"${item}_rate"} * 100 .qq|%</th>
431 411
                <td align="right">$form->{"${item}_total"}</td>
432
	      </tr>
433
|;
412
	      </tr> |;
434 413
      }
435 414
    }
436 415

  
437
    $form->{invsubtotal} = $form->format_amount(\%myconfig, $form->{invsubtotal}, 2, 0);
416
#    $form->{invsubtotal} = $form->format_amount(\%myconfig, $form->{invsubtotal}, 2, 0);
438 417

  
439 418
    $subtotal = qq|
440 419
	      <tr>
......
446 425
  }
447 426

  
448 427
  if ($form->{taxincluded}) {
428
    $form->{taxaccounts_array} = [ split / /, $form->{taxaccounts} ];
449 429
    foreach my $item (split / /, $form->{taxaccounts}) {
450 430
      if ($form->{"${item}_base"}) {
451 431
        $form->{"${item}_total"} = $form->round_amount( ($form->{"${item}_base"} * $form->{"${item}_rate"} / (1 + $form->{"${item}_rate"})), 2);
......
453 433
        $form->{"${item}_total"} = $form->format_amount(\%myconfig, $form->{"${item}_total"}, 2);
454 434
        $form->{"${item}_netto"} = $form->format_amount(\%myconfig, $form->{"${item}_netto"}, 2);
455 435

  
456
        $tax .= qq|
457
	      <tr>
458
		<th align="right">Enthaltene $form->{"${item}_description"}&nbsp;|
459
		                    . $form->{"${item}_rate"} * 100 .qq|%</th>
460
		<td align="right">$form->{"${item}_total"}</td>
461
	      </tr>
462
	      <tr>
463
	        <th align="right">Nettobetrag</th>
464
		<td align="right">$form->{"${item}_netto"}</td>
465
	      </tr>
466
|;
436
#        $tax .= qq|
437
#	      <tr>
438
#		<th align="right">Enthaltene $form->{"${item}_description"}&nbsp;|
439
#		                    . $form->{"${item}_rate"} * 100 .qq|%</th>
440
#		<td align="right">$form->{"${item}_total"}</td>
441
#	      </tr>
442
#	      <tr>
443
#	        <th align="right">Nettobetrag</th>
444
#		<td align="right">$form->{"${item}_netto"}</td>
445
#	      </tr>
446
#|;
467 447
      }
468 448
    }
469 449

  
470 450
  }
471 451

  
472 452
  $form->{oldinvtotal} = $form->{invtotal};
473
  $form->{invtotal}    = $form->format_amount(\%myconfig, $form->{invtotal}, 2, 0);
453
#  $form->{invtotal}    = $form->format_amount(\%myconfig, $form->{invtotal}, 2, 0);
474 454

  
475
  my $follow_ups_block;
455
  # unfortunately locales doesn't support extended syntax
476 456
  if ($form->{id}) {
477 457
    my $follow_ups = FU->follow_ups('trans_id' => $form->{id});
478

  
479 458
    if (@{ $follow_ups} ) {
480
      my $num_due       = sum map { $_->{due} * 1 } @{ $follow_ups };
481
      $follow_ups_block = qq|
482
      <tr>
483
        <td colspan="2">| . $locale->text("There are #1 unfinished follow-ups of which #2 are due.", scalar @{ $follow_ups }, $num_due) . qq|</td>
484
      </tr>
485
|;
486
    }
487
  }
488

  
489
  print qq|
490
  <tr>
491
    <td>
492
      <table width="100%">
493
	<tr valign="bottom">
494
	  <td>
495
	    <table>
496
	      <tr>
497
		<th align="left">| . $locale->text('Notes') . qq|</th>
498
		<th align="left">| . $locale->text('Internal Notes') . qq|</th>
499
                <th align="right">| . $locale->text('Payment Terms') . qq|</th>
500
	      </tr>
501
	      <tr valign="top">
502
		<td>$notes</td>
503
		<td>$intnotes</td>
504
                <td><select name="payment_id" onChange="if (this.value) set_duedate(['payment_id__' + this.value, 'invdate__' + invdate.value],['duedate'])">$payment
505
                </select></td>
506
	      </tr>
507
        $follow_ups_block
508
	    </table>
509
	  </td>
510
          <td>
511
            <table>
512
            <tr>
513
              <th  align=left>| . $locale->text('Ertrag') . qq|</th>
514
              <td>| .  $form->format_amount(\%myconfig, $form->{marge_total}, 2, 0) . qq|</td>
515
            </tr>
516
            <tr>
517
              <th  align=left>| . $locale->text('Ertrag prozentual') . qq|</th>
518
              <td>| .  $form->format_amount(\%myconfig, $form->{marge_percent}, 2, 0) . qq| %</td>
519
            </tr>
520
            <input type=hidden name="marge_total" value="$form->{"marge_total"}">
521
            <input type=hidden name="marge_percent" value="$form->{"marge_percent"}">
522
            </table>
523
          </td>
524
	  <td align="right">
525
	    $taxincluded
526
	    <table>
527
	      $subtotal
528
	      $tax
529
	      <tr>
530
		<th align="right">| . $locale->text('Total') . qq|</th>
531
		<td align="right">$form->{invtotal}</td>
532
	      </tr>
533
	    </table>
534
	  </td>
535
	</tr>
536
      </table>
537
    </td>
538
  </tr>
539
|;
540
  my $webdav_list;
541
  if ($main::webdav) {
542
    $webdav_list = qq|
543
  <tr>
544
    <td><hr size="3" noshade></td>
545
  </tr>
546
  <tr>
547
    <th class="listtop" align="left">Dokumente im Webdav-Repository</th>
548
  </tr>
549
    <table width="100%">
550
      <td align="left" width="30%"><b>Dateiname</b></td>
551
      <td align="left" width="70%"><b>Webdavlink</b></td>
552
|;
553
    foreach my $file (@{ $form->{WEBDAV} }) {
554
      $webdav_list .= qq|
555
      <tr>
556
        <td align="left">$file->{name}</td>
557
        <td align="left"><a href="$file->{link}">$file->{type}</a></td>
558
      </tr>
559
|;
459
      $form->{follow_ups_text} = $locale->text("There are #1 unfinished follow-ups of which #2 are due.",
460
                                               scalar @{ $follow_ups },
461
                                               sum map { $_->{due} * 1 } @{ $follow_ups });
560 462
    }
561
    $webdav_list .= qq|
562
    </table>
563
  </tr>
564
|;
565

  
566
    print $webdav_list;
567 463
  }
568
if ($form->{type} eq "credit_note") {
569
  print qq|
570
  <tr>
571
    <td>
572
      <table width="100%">
573
	<tr class="listheading">
574
	  <th colspan="6" class="listheading">|
575
    . $locale->text('Payments') . qq|</th>
576
	</tr>
577
|;
578
} else {
579
  print qq|
580
  <tr>
581
    <td>
582
      <table width="100%">
583
	<tr class="listheading">
584
	  <th colspan="6" class="listheading">|
585
    . $locale->text('Incoming Payments') . qq|</th>
586
	</tr>
587
|;
588
}
589 464

  
590
  my @column_index;
591
  if ($form->{currency} eq $form->{defaultcurrency}) {
592
    @column_index = qw(datepaid source memo paid AR_paid);
593
  } else {
594
    @column_index = qw(datepaid source memo paid exchangerate AR_paid);
595
  }
596

  
597
  my %column_data;
598
  $column_data{datepaid}     = "<th>" . $locale->text('Date') . "</th>";
599
  $column_data{paid}         = "<th>" . $locale->text('Amount') . "</th>";
600
  $column_data{exchangerate} = "<th>" . $locale->text('Exch') . "</th>";
601
  $column_data{AR_paid}      = "<th>" . $locale->text('Account') . "</th>";
602
  $column_data{source}       = "<th>" . $locale->text('Source') . "</th>";
603
  $column_data{memo}         = "<th>" . $locale->text('Memo') . "</th>";
604

  
605
  print "
606
	<tr>
607
";
608
  map { print "$column_data{$_}\n" } @column_index;
609
  print "
610
        </tr>
611
";
612

  
613
  my @triggers  = ();
614
  my $totalpaid = 0;
615

  
616
  $form->{paidaccounts}++ if ($form->{"paid_$form->{paidaccounts}"});
617
  for my $i (1 .. $form->{paidaccounts}) {
618 465

  
619
    print "
620
        <tr>\n";
621

  
622
    $form->{"selectAR_paid_$i"} = $form->{selectAR_paid};
623
    $form->{"selectAR_paid_$i"} =~
624
      s/option>\Q$form->{"AR_paid_$i"}\E/option selected>$form->{"AR_paid_$i"}/;
625

  
626
    # format amounts
627
    $totalpaid += $form->{"paid_$i"};
628
    if ($form->{"paid_$i"}) {
629
      $form->{"paid_$i"} = $form->format_amount(\%myconfig, $form->{"paid_$i"}, 2);
630
    }
631
    $form->{"exchangerate_$i"} = $form->format_amount(\%myconfig, $form->{"exchangerate_$i"});
632

  
633
    if ($form->{"exchangerate_$i"} == 0) {
634
      $form->{"exchangerate_$i"} = "";
635
    }
636
    my $exchangerate = qq|&nbsp;|;
637
    if ($form->{currency} ne $form->{defaultcurrency}) {
638
      if ($form->{"forex_$i"}) {
639
        $exchangerate = qq|<input type="hidden" name="exchangerate_$i" value="$form->{"exchangerate_$i"}">$form->{"exchangerate_$i"}|;
640
      } else {
641
        $exchangerate = qq|<input name="exchangerate_$i" size="10" value="$form->{"exchangerate_$i"}">|;
642
      }
643
    }
644

  
645
    $exchangerate .= qq|<input type="hidden" name="forex_$i" value="$form->{"forex_$i"}">|;
646

  
647
    $column_data{"paid_$i"} =
648
      qq|<td align="center"><input name="paid_$i" size="11" value="$form->{"paid_$i"}" onBlur=\"check_right_number_format(this)\"></td>|;
649
    $column_data{"exchangerate_$i"} = qq|<td align="center">$exchangerate</td>|;
650
    $column_data{"AR_paid_$i"}      =
651
      qq|<td align="center"><select name="AR_paid_$i">$form->{"selectAR_paid_$i"}</select></td>|;
652
    $column_data{"datepaid_$i"} =
653
      qq|<td align="center"><input id="datepaid_$i" name="datepaid_$i"  size="11" title="$myconfig{dateformat}" value="$form->{"datepaid_$i"}" onBlur=\"check_right_date_format(this)\">
654
         <input type="button" name="datepaid_$i" id="trigger_datepaid_$i" value="?"></td>|;
655
    $column_data{"source_$i"} =
656
      qq|<td align=center><input name="source_$i" size="11" value="$form->{"source_$i"}"></td>|;
657
    $column_data{"memo_$i"} =
658
      qq|<td align="center"><input name="memo_$i" size="11" value="$form->{"memo_$i"}"></td>|;
659

  
660
    map { print qq|$column_data{"${_}_$i"}\n| } @column_index;
661
    print "
662
        </tr>\n";
663
    push(@triggers, "datepaid_$i", "BL", "trigger_datepaid_$i");
664
  }
665

  
666
  my $paid_missing = $form->{oldinvtotal} - $totalpaid;
667

  
668
  print qq|
669
    <tr>
670
      <td></td>
671
      <td></td>
672
      <td align="center">| . $locale->text('Total') . qq|</td>
673
      <td align="center">| . H($form->format_amount(\%myconfig, $totalpaid, 2)) . qq|</td>
674
    </tr>
675
    <tr>
676
      <td></td>
677
      <td></td>
678
      <td align="center">| . $locale->text('Missing amount') . qq|</td>
679
      <td align="center">| . H($form->format_amount(\%myconfig, $paid_missing, 2)) . qq|</td>
680
    </tr>
681
|;
682

  
683
  map({ print($cgi->hidden("-name" => $_, "-value" => $form->{$_})); } qw(paidaccounts selectAR_paid oldinvtotal));
684
  print qq|<input type="hidden" name="oldtotalpaid" value="$totalpaid">
685
    </table>
686
    </td>
687
  </tr>
688
  <tr>
689
    <td><hr size="3" noshade></td>
690
  </tr>
691
  <tr>
692
    <td>
693
|;
694

  
695
  print_options();
696

  
697
  print qq|
698
    </td>
699
  </tr>
700
</table>
701
|;
702

  
703
  my $invdate  = $form->datetonum($form->{invdate},  \%myconfig);
704
  my $closedto = $form->datetonum($form->{closedto}, \%myconfig);
705

  
706
  if ($form->{id}) {
707
    my $show_storno = !$form->{storno} && !IS->has_storno(\%myconfig, $form, "ar") && (($totalpaid == 0) || ($totalpaid eq ""));
708

  
709
    print qq|
710
    <input class="submit" type="submit" accesskey="u" name="action" id="update_button" value="| . $locale->text('Update') . qq|">
711
    <input class="submit" type="submit" name="action" value="| . $locale->text('Ship to') . qq|">
712
    <input class="submit" type="submit" name="action" value="| . $locale->text('Print') . qq|">
713
    <input class="submit" type="submit" name="action" value="| . $locale->text('E-mail') . qq|"> |;
714
    print qq|<input class="submit" type="submit" name="action" value="| . $locale->text('Storno') . qq|"> | if ($show_storno);
715
    print qq|<input class="submit" type="submit" name="action" value="| . $locale->text('Post Payment') . qq|"> |;
716
    print qq|<input class="submit" type="submit" name="action" value="| . $locale->text('Use As Template') . qq|"> |;
717
    if ($form->{id} && !($form->{type} eq "credit_note")) {
718
      print qq| <input class="submit" type="submit" name="action" value="| . $locale->text('Credit Note') . qq|"> |;
719
    }
720
    if ($form->{radier}) {
721
      print qq| <input class="submit" type="submit" name="action" value="| . $locale->text('Delete') . qq|"> |;
722
    }
723

  
724

  
725
    if ($invdate > $closedto) {
726
      print qq| <input class="submit" type="submit" name="action" value="| . $locale->text('Order') . qq|"> |;
727
    }
728

  
729
    print qq| <input type="button" class="submit" onclick="follow_up_window()" value="| . $locale->text('Follow-Up') . qq|">|;
730

  
731
  } else {
732
    if ($invdate > $closedto) {
733
      print qq|
734
      <input class="submit" type="submit" name="action" id="update_button" value="| . $locale->text('Update') . qq|">
735
      <input class="submit" type="submit" name="action" value="| . $locale->text('Ship to') . qq|">
736
      <input class="submit" type="submit" name="action" value="| . $locale->text('Preview') . qq|">
737
      <input class="submit" type="submit" name="action" value="| . $locale->text('E-mail') . qq|">
738
      <input class="submit" type="submit" name="action" value="| . $locale->text('Print and Post') . qq|">
739
      <input class="submit" type="submit" name="action" value="| . $locale->text('Post') . qq|"> | .
740
        NTI($cgi->submit('-name' => 'action', '-value' => $locale->text('Save draft'), '-class' => 'submit'));
741
    }
742
  }
743

  
744
  # button for saving history
745
  if($form->{id} ne "") {
746
    print qq|
747
  	  <input type="button" class="submit" onclick="set_history_window(|
748
  	  . Q($form->{id})
749
  	  . qq|);" name="history" id="history" value="|
750
  	  . $locale->text('history')
751
  	  . qq|"> |;
752
  }
753
  # /button for saving history
754

  
755
  # mark_as_paid button
756
  if($form->{id} ne "") {
757
    print qq|<input type="submit" class="submit" name="action" value="| . $locale->text('mark as paid') . qq|">|;
758
  }
759
  # /mark_as_paid button
760
  print $form->write_trigger(\%myconfig, scalar(@triggers) / 3, @triggers) .
761
    qq|
762

  
763
<input type="hidden" name="rowcount" value="$form->{rowcount}">
764
| .
765
$cgi->hidden("-name" => "callback", "-value" => $form->{callback})
766
. $cgi->hidden('-name' => 'draft_id', '-default' => [$form->{draft_id}])
767
. $cgi->hidden('-name' => 'draft_description', '-default' => [$form->{draft_description}])
768
. $cgi->hidden('-name' => 'customer_discount', '-value' => [$form->{customer_discount}])
769
. qq|
770
</form>
771

  
772
</body>
773

  
774
 </html>
775
|;
466
  print $form->parse_html_template('is/form_footer');
467

  
468
#  print qq|
469
#  <tr>
470
#    <td>
471
#      <table width="100%">
472
#	<tr valign="bottom">
473
#	  <td>
474
#	    <table>
475
#	      <tr>
476
#		<th align="left">| . $locale->text('Notes') . qq|</th>
477
#		<th align="left">| . $locale->text('Internal Notes') . qq|</th>
478
#                <th align="right">| . $locale->text('Payment Terms') . qq|</th>
479
#	      </tr>
480
#	      <tr valign="top">
481
#		<td>$notes</td>
482
#		<td>$intnotes</td>
483
#                <td><select name="payment_id" onChange="if (this.value) set_duedate(['payment_id__' + this.value, 'invdate__' + invdate.value],['duedate'])">$payment
484
#                </select></td>
485
#	      </tr>
486
#        $follow_ups_block
487
#	    </table>
488
#	  </td>
489
#          <td>
490
#            <table>
491
#            <tr>
492
#              <th  align=left>| . $locale->text('Ertrag') . qq|</th>
493
#              <td>| .  $form->format_amount(\%myconfig, $form->{marge_total}, 2, 0) . qq|</td>
494
#            </tr>
495
#            <tr>
496
#              <th  align=left>| . $locale->text('Ertrag prozentual') . qq|</th>
497
#              <td>| .  $form->format_amount(\%myconfig, $form->{marge_percent}, 2, 0) . qq| %</td>
498
#            </tr>
499
#            <input type=hidden name="marge_total" value="$form->{"marge_total"}">
500
#            <input type=hidden name="marge_percent" value="$form->{"marge_percent"}">
501
#            </table>
502
#          </td>
503
#	  <td align="right">
504
#	    $taxincluded
505
#	    <table>
506
#	      $subtotal
507
#	      $tax
508
#	      <tr>
509
#		<th align="right">| . $locale->text('Total') . qq|</th>
510
#		<td align="right">$form->{invtotal}</td>
511
#	      </tr>
512
#	    </table>
513
#	  </td>
514
#	</tr>
515
#      </table>
516
#    </td>
517
#  </tr>
518
#|;
519
#  my $webdav_list;
520
#  if ($main::webdav) {
521
#    $webdav_list = qq|
522
#  <tr>
523
#    <td><hr size="3" noshade></td>
524
#  </tr>
525
#  <tr>
526
#    <th class="listtop" align="left">Dokumente im Webdav-Repository</th>
527
#  </tr>
528
#    <table width="100%">
529
#      <td align="left" width="30%"><b>Dateiname</b></td>
530
#      <td align="left" width="70%"><b>Webdavlink</b></td>
531
#|;
532
#    foreach my $file (@{ $form->{WEBDAV} }) {
533
#      $webdav_list .= qq|
534
#      <tr>
535
#        <td align="left">$file->{name}</td>
536
#        <td align="left"><a href="$file->{link}">$file->{type}</a></td>
537
#      </tr>
538
#|;
539
#    }
540
#    $webdav_list .= qq|
541
#    </table>
542
#  </tr>
543
#|;
544
#
545
#    print $webdav_list;
546
#  }
547
#if ($form->{type} eq "credit_note") {
548
#  print qq|
549
#  <tr>
550
#    <td>
551
#      <table width="100%">
552
#	<tr class="listheading">
553
#	  <th colspan="6" class="listheading">|
554
#    . $locale->text('Payments') . qq|</th>
555
#	</tr>
556
#|;
557
#} else {
558
#  print qq|
559
#  <tr>
560
#    <td>
561
#      <table width="100%">
562
#	<tr class="listheading">
563
#	  <th colspan="6" class="listheading">|
564
#    . $locale->text('Incoming Payments') . qq|</th>
565
#	</tr>
566
#|;
567
#}
568
#
569
#  my @column_index;
570
#  if ($form->{currency} eq $form->{defaultcurrency}) {
571
#    @column_index = qw(datepaid source memo paid AR_paid);
572
#  } else {
573
#    @column_index = qw(datepaid source memo paid exchangerate AR_paid);
574
#  }
575
#
576
#  my %column_data;
577
#  $column_data{datepaid}     = "<th>" . $locale->text('Date') . "</th>";
578
#  $column_data{paid}         = "<th>" . $locale->text('Amount') . "</th>";
579
#  $column_data{exchangerate} = "<th>" . $locale->text('Exch') . "</th>";
580
#  $column_data{AR_paid}      = "<th>" . $locale->text('Account') . "</th>";
581
#  $column_data{source}       = "<th>" . $locale->text('Source') . "</th>";
582
#  $column_data{memo}         = "<th>" . $locale->text('Memo') . "</th>";
583
#
584
#  print "
585
#	<tr>
586
#";
587
#  map { print "$column_data{$_}\n" } @column_index;
588
#  print "
589
#        </tr>
590
#";
591
#
592
#  my @triggers  = ();
593
#  my $totalpaid = 0;
594
#
595
#  $form->{paidaccounts}++ if ($form->{"paid_$form->{paidaccounts}"});
596
#  for my $i (1 .. $form->{paidaccounts}) {
597
#
598
#    print "
599
#        <tr>\n";
600
#
601
#    $form->{"selectAR_paid_$i"} = $form->{selectAR_paid};
602
#    $form->{"selectAR_paid_$i"} =~
603
#      s/option>\Q$form->{"AR_paid_$i"}\E/option selected>$form->{"AR_paid_$i"}/;
604
#
605
#    # format amounts
606
#    $totalpaid += $form->{"paid_$i"};
607
#    if ($form->{"paid_$i"}) {
608
#      $form->{"paid_$i"} = $form->format_amount(\%myconfig, $form->{"paid_$i"}, 2);
609
#    }
610
#    $form->{"exchangerate_$i"} = $form->format_amount(\%myconfig, $form->{"exchangerate_$i"});
611
#
612
#    if ($form->{"exchangerate_$i"} == 0) {
613
#      $form->{"exchangerate_$i"} = "";
614
#    }
615
#    my $exchangerate = qq|&nbsp;|;
616
#    if ($form->{currency} ne $form->{defaultcurrency}) {
617
#      if ($form->{"forex_$i"}) {
618
#        $exchangerate = qq|<input type="hidden" name="exchangerate_$i" value="$form->{"exchangerate_$i"}">$form->{"exchangerate_$i"}|;
619
#      } else {
620
#        $exchangerate = qq|<input name="exchangerate_$i" size="10" value="$form->{"exchangerate_$i"}">|;
621
#      }
622
#    }
623
#
624
#    $exchangerate .= qq|<input type="hidden" name="forex_$i" value="$form->{"forex_$i"}">|;
625
#
626
#    $column_data{"paid_$i"} =
627
#      qq|<td align="center"><input name="paid_$i" size="11" value="$form->{"paid_$i"}" onBlur=\"check_right_number_format(this)\"></td>|;
628
#    $column_data{"exchangerate_$i"} = qq|<td align="center">$exchangerate</td>|;
629
#    $column_data{"AR_paid_$i"}      =
630
#      qq|<td align="center"><select name="AR_paid_$i">$form->{"selectAR_paid_$i"}</select></td>|;
631
#    $column_data{"datepaid_$i"} =
632
#      qq|<td align="center"><input id="datepaid_$i" name="datepaid_$i"  size="11" title="$myconfig{dateformat}" value="$form->{"datepaid_$i"}" onBlur=\"check_right_date_format(this)\">
633
#         <input type="button" name="datepaid_$i" id="trigger_datepaid_$i" value="?"></td>|;
634
#    $column_data{"source_$i"} =
635
#      qq|<td align=center><input name="source_$i" size="11" value="$form->{"source_$i"}"></td>|;
636
#    $column_data{"memo_$i"} =
637
#      qq|<td align="center"><input name="memo_$i" size="11" value="$form->{"memo_$i"}"></td>|;
638
#
639
#    map { print qq|$column_data{"${_}_$i"}\n| } @column_index;
640
#    print "
641
#        </tr>\n";
642
#    push(@triggers, "datepaid_$i", "BL", "trigger_datepaid_$i");
643
#  }
644
#
645
#  my $paid_missing = $form->{oldinvtotal} - $totalpaid;
646
#
647
#  print qq|
648
#    <tr>
649
#      <td></td>
650
#      <td></td>
651
#      <td align="center">| . $locale->text('Total') . qq|</td>
652
#      <td align="center">| . H($form->format_amount(\%myconfig, $totalpaid, 2)) . qq|</td>
653
#    </tr>
654
#    <tr>
655
#      <td></td>
656
#      <td></td>
657
#      <td align="center">| . $locale->text('Missing amount') . qq|</td>
658
#      <td align="center">| . H($form->format_amount(\%myconfig, $paid_missing, 2)) . qq|</td>
659
#    </tr>
660
#|;
661
#
662
#  map({ print($cgi->hidden("-name" => $_, "-value" => $form->{$_})); } qw(paidaccounts selectAR_paid oldinvtotal));
663
#  print qq|<input type="hidden" name="oldtotalpaid" value="$totalpaid">
664
#    </table>
665
#    </td>
666
#  </tr>
667
#  <tr>
668
#    <td><hr size="3" noshade></td>
669
#  </tr>
670
#  <tr>
671
#    <td>
672
#|;
673
#
674
#  print_options();
675
#
676
#  print qq|
677
#    </td>
678
#  </tr>
679
#</table>
680
#|;
681
#
682
#  my $invdate  = $form->datetonum($form->{invdate},  \%myconfig);
683
#  my $closedto = $form->datetonum($form->{closedto}, \%myconfig);
684
#
685
#  if ($form->{id}) {
686
#    my $show_storno = !$form->{storno} && !IS->has_storno(\%myconfig, $form, "ar") && (($totalpaid == 0) || ($totalpaid eq ""));
687
#
688
#    print qq|
689
#    <input class="submit" type="submit" accesskey="u" name="action" id="update_button" value="| . $locale->text('Update') . qq|">
690
#    <input class="submit" type="submit" name="action" value="| . $locale->text('Ship to') . qq|">
691
#    <input class="submit" type="submit" name="action" value="| . $locale->text('Print') . qq|">
692
#    <input class="submit" type="submit" name="action" value="| . $locale->text('E-mail') . qq|"> |;
693
#    print qq|<input class="submit" type="submit" name="action" value="| . $locale->text('Storno') . qq|"> | if ($show_storno);
694
#    print qq|<input class="submit" type="submit" name="action" value="| . $locale->text('Post Payment') . qq|"> |;
695
#    print qq|<input class="submit" type="submit" name="action" value="| . $locale->text('Use As Template') . qq|"> |;
696
#    if ($form->{id} && !($form->{type} eq "credit_note")) {
697
#      print qq| <input class="submit" type="submit" name="action" value="| . $locale->text('Credit Note') . qq|"> |;
698
#    }
699
#    if ($form->{radier}) {
700
#      print qq| <input class="submit" type="submit" name="action" value="| . $locale->text('Delete') . qq|"> |;
701
#    }
702
#
703
#
704
#    if ($invdate > $closedto) {
705
#      print qq| <input class="submit" type="submit" name="action" value="| . $locale->text('Order') . qq|"> |;
706
#    }
707
#
708
#    print qq| <input type="button" class="submit" onclick="follow_up_window()" value="| . $locale->text('Follow-Up') . qq|">|;
709
#
710
#  } else {
711
#    if ($invdate > $closedto) {
712
#      print qq|
713
#      <input class="submit" type="submit" name="action" id="update_button" value="| . $locale->text('Update') . qq|">
714
#      <input class="submit" type="submit" name="action" value="| . $locale->text('Ship to') . qq|">
715
#      <input class="submit" type="submit" name="action" value="| . $locale->text('Preview') . qq|">
716
#      <input class="submit" type="submit" name="action" value="| . $locale->text('E-mail') . qq|">
717
#      <input class="submit" type="submit" name="action" value="| . $locale->text('Print and Post') . qq|">
718
#      <input class="submit" type="submit" name="action" value="| . $locale->text('Post') . qq|"> | .
719
#        NTI($cgi->submit('-name' => 'action', '-value' => $locale->text('Save draft'), '-class' => 'submit'));
720
#    }
721
#  }
722
#
723
#  # button for saving history
724
#  if($form->{id} ne "") {
725
#    print qq|
726
#  	  <input type="button" class="submit" onclick="set_history_window(|
727
#  	  . Q($form->{id})
728
#  	  . qq|);" name="history" id="history" value="|
729
#  	  . $locale->text('history')
730
#  	  . qq|"> |;
731
#  }
732
#  # /button for saving history
733
#
734
#  # mark_as_paid button
735
#  if($form->{id} ne "") {
736
#    print qq|<input type="submit" class="submit" name="action" value="| . $locale->text('mark as paid') . qq|">|;
737
#  }
738
#  # /mark_as_paid button
739
#  print $form->write_trigger(\%myconfig, scalar(@triggers) / 3, @triggers) .
740
#    qq|
741
#
742
#<input type="hidden" name="rowcount" value="$form->{rowcount}">
743
#| .
744
#$cgi->hidden("-name" => "callback", "-value" => $form->{callback})
745
#. $cgi->hidden('-name' => 'draft_id', '-default' => [$form->{draft_id}])
746
#. $cgi->hidden('-name' => 'draft_description', '-default' => [$form->{draft_description}])
747
#. $cgi->hidden('-name' => 'customer_discount', '-value' => [$form->{customer_discount}])
748
#. qq|
749
#</form>
750
#
751
#</body>
752
#
753
# </html>
754
#|;
776 755

  
777 756
  $main::lxdebug->leave_sub();
778 757
}

Auch abrufbar als: Unified diff