Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 58d115ff

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

  • ID 58d115ff64da5d061341defca6d3a308f8a772b8
  • Vorgänger ee792a3f
  • Nachfolger fce441db

Weitere Template Fixes.

Unterschiede anzeigen:

bin/mozilla/is.pl
195 195
  }
196 196

  
197 197
  $form->{oldcustomer} = "$form->{customer}--$form->{customer_id}";
198
  $form->{selectcustomer} = 1;
198 199

  
199 200
  # departments
200 201
  if ($form->{all_departments}) {
......
356 357
  # customer
357 358
  $TMPL_VAR{vc_keys} = sub { "$_[0]->{name}--$_[0]->{id}" };
358 359
  $TMPL_VAR{vclimit} = $myconfig{vclimit};
359
  $TMPL_VAR{vc_select} = "customer_or_vendor_selection_window('$form->{vc}', '', @{[ $form->{vc} eq 'vendor' ? 1 : 0 ]}, 0)";
360
  push @custom_hiddens, "$form->{vc}_id";
361
  push @custom_hiddens, "old$form->{vc}";
362
  push @custom_hiddens, "select$form->{vc}";
360
  $TMPL_VAR{vc_select} = "customer_or_vendor_selection_window('customer', '', 0, 0)";
361
  push @custom_hiddens, "customer_id";
362
  push @custom_hiddens, "oldcustomer";
363
  push @custom_hiddens, "selectcustomer";
363 364

  
364 365
  # currencies and exchangerate
365 366
  my @values = map { $_       } @{ $form->{ALL_CURRENCIES} };
......
430 431
    $introws = 2;
431 432
  }
432 433
  $rows = ($rows > $introws) ? $rows : $introws;
433
  my $notes =
434
    qq|<textarea name="notes" rows="$rows" cols="26" wrap="soft">$form->{notes}</textarea>|;
435
  my $intnotes =
436
    qq|<textarea name="intnotes" rows="$rows" cols="35" wrap="soft">$form->{intnotes}</textarea>|;
434
  my $notes = qq|<textarea name="notes" rows="$rows" cols="26" wrap="soft">$form->{notes}</textarea>|;
435
  my $intnotes = qq|<textarea name="intnotes" rows="$rows" cols="35" wrap="soft">$form->{intnotes}</textarea>|;
437 436

  
438 437
  $form->{taxincluded} = ($form->{taxincluded} ? "checked" : "");
439 438

  
440 439
  my $taxincluded = "";
441 440
  if ($form->{taxaccounts}) {
442
    $taxincluded = qq|
443
	        <input name="taxincluded" class="checkbox" type="checkbox" $form->{taxincluded}> <b>|
444
      . $locale->text('Tax Included') . qq|</b><br><br>|;
441
    $taxincluded = qq| <input name="taxincluded" class="checkbox" type="checkbox" $form->{taxincluded}> <b>| . $locale->text('Tax Included') . qq|</b><br><br>|;
445 442
  }
446 443

  
447 444
  my ($tax, $subtotal);
......
449 446

  
450 447
    foreach my $item (split / /, $form->{taxaccounts}) {
451 448
      if ($form->{"${item}_base"}) {
452
        $form->{"${item}_total"} =
453
          $form->round_amount(
454
                             $form->{"${item}_base"} * $form->{"${item}_rate"},
455
                             2);
449
        $form->{"${item}_total"} = $form->round_amount( $form->{"${item}_base"} * $form->{"${item}_rate"}, 2);
456 450
        $form->{invtotal} += $form->{"${item}_total"};
457
        $form->{"${item}_total"} =
458
          $form->format_amount(\%myconfig, $form->{"${item}_total"}, 2);
451
        $form->{"${item}_total"} = $form->format_amount(\%myconfig, $form->{"${item}_total"}, 2);
459 452

  
460 453
        $tax .= qq|
461 454
	      <tr>
462
                <th align="right">$form->{"${item}_description"}&nbsp;|
463
                                    . $form->{"${item}_rate"} * 100 .qq|%</th>
464
		<td align="right">$form->{"${item}_total"}</td>
455
                <th align="right">$form->{"${item}_description"}&nbsp;| . $form->{"${item}_rate"} * 100 .qq|%</th>
456
                <td align="right">$form->{"${item}_total"}</td>
465 457
	      </tr>
466 458
|;
467 459
      }
468 460
    }
469 461

  
470
    $form->{invsubtotal} =
471
      $form->format_amount(\%myconfig, $form->{invsubtotal}, 2, 0);
462
    $form->{invsubtotal} = $form->format_amount(\%myconfig, $form->{invsubtotal}, 2, 0);
472 463

  
473 464
    $subtotal = qq|
474 465
	      <tr>
......
482 473
  if ($form->{taxincluded}) {
483 474
    foreach my $item (split / /, $form->{taxaccounts}) {
484 475
      if ($form->{"${item}_base"}) {
485
        $form->{"${item}_total"} =
486
          $form->round_amount(
487
                           ($form->{"${item}_base"} * $form->{"${item}_rate"} /
488
                              (1 + $form->{"${item}_rate"})
489
                           ),
490
                           2);
491
        $form->{"${item}_netto"} =
492
          $form->round_amount(
493
                          ($form->{"${item}_base"} - $form->{"${item}_total"}),
494
                          2);
495
        $form->{"${item}_total"} =
496
          $form->format_amount(\%myconfig, $form->{"${item}_total"}, 2);
497
        $form->{"${item}_netto"} =
498
          $form->format_amount(\%myconfig, $form->{"${item}_netto"}, 2);
476
        $form->{"${item}_total"} = $form->round_amount( ($form->{"${item}_base"} * $form->{"${item}_rate"} / (1 + $form->{"${item}_rate"})), 2);
477
        $form->{"${item}_netto"} = $form->round_amount( ($form->{"${item}_base"} - $form->{"${item}_total"}), 2);
478
        $form->{"${item}_total"} = $form->format_amount(\%myconfig, $form->{"${item}_total"}, 2);
479
        $form->{"${item}_netto"} = $form->format_amount(\%myconfig, $form->{"${item}_netto"}, 2);
499 480

  
500 481
        $tax .= qq|
501 482
	      <tr>
......
514 495
  }
515 496

  
516 497
  $form->{oldinvtotal} = $form->{invtotal};
517
  $form->{invtotal}    =
518
    $form->format_amount(\%myconfig, $form->{invtotal}, 2, 0);
498
  $form->{invtotal}    = $form->format_amount(\%myconfig, $form->{invtotal}, 2, 0);
519 499

  
520 500
  my $follow_ups_block;
521 501
  if ($form->{id}) {
......
671 651
    # format amounts
672 652
    $totalpaid += $form->{"paid_$i"};
673 653
    if ($form->{"paid_$i"}) {
674
      $form->{"paid_$i"} =
675
        $form->format_amount(\%myconfig, $form->{"paid_$i"}, 2);
654
      $form->{"paid_$i"} = $form->format_amount(\%myconfig, $form->{"paid_$i"}, 2);
676 655
    }
677
    $form->{"exchangerate_$i"} =
678
      $form->format_amount(\%myconfig, $form->{"exchangerate_$i"});
656
    $form->{"exchangerate_$i"} = $form->format_amount(\%myconfig, $form->{"exchangerate_$i"});
679 657

  
680 658
    if ($form->{"exchangerate_$i"} == 0) {
681 659
      $form->{"exchangerate_$i"} = "";
......
754 732
    my $show_storno = !$form->{storno} && !IS->has_storno(\%myconfig, $form, "ar") && (($totalpaid == 0) || ($totalpaid eq ""));
755 733

  
756 734
    print qq|
757
    <input class="submit" type="submit" accesskey="u" name="action" id="update_button" value="|
758
      . $locale->text('Update') . qq|">
759
    <input class="submit" type="submit" name="action" value="|
760
      . $locale->text('Ship to') . qq|">
761
    <input class="submit" type="submit" name="action" value="|
762
      . $locale->text('Print') . qq|">
763
    <input class="submit" type="submit" name="action" value="|
764
      . $locale->text('E-mail') . qq|"> |;
765
    print qq|<input class="submit" type="submit" name="action" value="|
766
      . $locale->text('Storno') . qq|"> | if ($show_storno);
767
    print qq|<input class="submit" type="submit" name="action" value="|
768
      . $locale->text('Post Payment') . qq|">
769
|;
770
    print qq|<input class="submit" type="submit" name="action" value="|
771
      . $locale->text('Use As Template') . qq|">
772
|;
735
    <input class="submit" type="submit" accesskey="u" name="action" id="update_button" value="| . $locale->text('Update') . qq|">
736
    <input class="submit" type="submit" name="action" value="| . $locale->text('Ship to') . qq|">
737
    <input class="submit" type="submit" name="action" value="| . $locale->text('Print') . qq|">
738
    <input class="submit" type="submit" name="action" value="| . $locale->text('E-mail') . qq|"> |;
739
    print qq|<input class="submit" type="submit" name="action" value="| . $locale->text('Storno') . qq|"> | if ($show_storno);
740
    print qq|<input class="submit" type="submit" name="action" value="| . $locale->text('Post Payment') . qq|"> |;
741
    print qq|<input class="submit" type="submit" name="action" value="| . $locale->text('Use As Template') . qq|"> |;
773 742
    if ($form->{id} && !($form->{type} eq "credit_note")) {
774
      print qq|
775
    <input class="submit" type="submit" name="action" value="|
776
      . $locale->text('Credit Note') . qq|">
777
|;
743
      print qq| <input class="submit" type="submit" name="action" value="| . $locale->text('Credit Note') . qq|"> |;
778 744
    }
779 745
    if ($form->{radier}) {
780
    print qq|
781
    <input class="submit" type="submit" name="action" value="|
782
      . $locale->text('Delete') . qq|">
783
|;
746
      print qq| <input class="submit" type="submit" name="action" value="| . $locale->text('Delete') . qq|"> |;
784 747
    }
785 748

  
786 749

  
787 750
    if ($invdate > $closedto) {
788
      print qq|
789
      <input class="submit" type="submit" name="action" value="|
790
        . $locale->text('Order') . qq|">
791
|;
751
      print qq| <input class="submit" type="submit" name="action" value="| . $locale->text('Order') . qq|"> |;
792 752
    }
793 753

  
794
    print qq|
795
      <input type="button" class="submit" onclick="follow_up_window()" value="|
796
      . $locale->text('Follow-Up')
797
      . qq|">|;
754
    print qq| <input type="button" class="submit" onclick="follow_up_window()" value="| . $locale->text('Follow-Up') . qq|">|;
798 755

  
799 756
  } else {
800 757
    if ($invdate > $closedto) {
801
      print qq|<input class="submit" type="submit" name="action" id="update_button" value="|
802
        . $locale->text('Update') . qq|">
803
      <input class="submit" type="submit" name="action" value="|
804
        . $locale->text('Ship to') . qq|">
805
      <input class="submit" type="submit" name="action" value="|
806
        . $locale->text('Preview') . qq|">
807
      <input class="submit" type="submit" name="action" value="|
808
        . $locale->text('E-mail') . qq|">
809
      <input class="submit" type="submit" name="action" value="|
810
        . $locale->text('Print and Post') . qq|">
811
      <input class="submit" type="submit" name="action" value="|
812
        . $locale->text('Post') . qq|"> | .
813
        NTI($cgi->submit('-name' => 'action', '-value' => $locale->text('Save draft'),
814
                         '-class' => 'submit'));
758
      print qq|
759
      <input class="submit" type="submit" name="action" id="update_button" value="| . $locale->text('Update') . qq|">
760
      <input class="submit" type="submit" name="action" value="| . $locale->text('Ship to') . qq|">
761
      <input class="submit" type="submit" name="action" value="| . $locale->text('Preview') . qq|">
762
      <input class="submit" type="submit" name="action" value="| . $locale->text('E-mail') . qq|">
763
      <input class="submit" type="submit" name="action" value="| . $locale->text('Print and Post') . qq|">
764
      <input class="submit" type="submit" name="action" value="| . $locale->text('Post') . qq|"> | .
765
        NTI($cgi->submit('-name' => 'action', '-value' => $locale->text('Save draft'), '-class' => 'submit'));
815 766
    }
816 767
  }
817 768

  
......
828 779

  
829 780
  # mark_as_paid button
830 781
  if($form->{id} ne "") {
831
    print qq|<input type="submit" class="submit" name="action" value="|
832
          . $locale->text('mark as paid') . qq|">|;
782
    print qq|<input type="submit" class="submit" name="action" value="| . $locale->text('mark as paid') . qq|">|;
833 783
  }
834 784
  # /mark_as_paid button
835 785
  print $form->write_trigger(\%myconfig, scalar(@triggers) / 3, @triggers) .

Auch abrufbar als: Unified diff