Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision df005c49

Von Sven Schöling vor mehr als 15 Jahren hinzugefügt

  • ID df005c490a2d6a9b7e50ea44fc7557e39ce7d6ca
  • Vorgänger b60e2ebf
  • Nachfolger 48579303

Templatebasierte OE Suche übernommen.

Unterschiede anzeigen:

bin/mozilla/oe.pl
507 507
    my $rows = scalar @{ $form->{item_list} };
508 508

  
509 509
    # hier ist das problem fuer bug 817 $form->{discount} wird nicht durchgeschliffen
510
    # ferner fallunterscheidung fuer verkauf oder einkauf s.a. bug 736	jb 04.05.2009 
511
    # select discount as vendor_discount from vendor || 
510
    # ferner fallunterscheidung fuer verkauf oder einkauf s.a. bug 736	jb 04.05.2009
511
    # select discount as vendor_discount from vendor ||
512 512
    # select discount as customer_discount from customer
513 513
    $form->{"discount_$i"} = $form->format_amount(\%myconfig, $form->{"$form->{vc}_discount"} * 100);
514 514

  
......
588 588
  check_oe_access();
589 589

  
590 590
  if ($form->{type} eq 'purchase_order') {
591
    $form->{title} = $locale->text('Purchase Orders');
592
    $form->{vc}    = 'vendor';
593
    $ordlabel      = $locale->text('Order Number');
594
    $ordnumber     = 'ordnumber';
595
    $employee      = $locale->text('Employee');
596
  }
591
    $form->{vc}        = 'vendor';
592
    $form->{ordnrname} = 'ordnumber';
593
    $form->{title}     = $locale->text('Purchase Orders');
594
    $form->{ordlabel}  = $locale->text('Order Number');
595

  
596
  } elsif ($form->{type} eq 'request_quotation') {
597
    $form->{vc}        = 'vendor';
598
    $form->{ordnrname} = 'quonumber';
599
    $form->{title}     = $locale->text('Request for Quotations');
600
    $form->{ordlabel}  = $locale->text('RFQ Number');
601

  
602
  } elsif ($form->{type} eq 'sales_order') {
603
    $form->{vc}        = 'customer';
604
    $form->{ordnrname} = 'ordnumber';
605
    $form->{title}     = $locale->text('Sales Orders');
606
    $form->{ordlabel}  = $locale->text('Order Number');
607

  
608
  } elsif ($form->{type} eq 'sales_quotation') {
609
    $form->{vc}        = 'customer';
610
    $form->{ordnrname} = 'quonumber';
611
    $form->{title}     = $locale->text('Quotations');
612
    $form->{ordlabel}  = $locale->text('Quotation Number');
597 613

  
598
  if ($form->{type} eq 'request_quotation') {
599
    $form->{title} = $locale->text('Request for Quotations');
600
    $form->{vc}    = 'vendor';
601
    $ordlabel      = $locale->text('RFQ Number');
602
    $ordnumber     = 'quonumber';
603
    $employee      = $locale->text('Employee');
604
  }
605

  
606
  if ($form->{type} eq 'sales_order') {
607
    $form->{title} = $locale->text('Sales Orders');
608
    $form->{vc}    = 'customer';
609
    $ordlabel      = $locale->text('Order Number');
610
    $ordnumber     = 'ordnumber';
611
    $employee      = $locale->text('Employee');
612
  }
613

  
614
  if ($form->{type} eq 'sales_quotation') {
615
    $form->{title} = $locale->text('Quotations');
616
    $form->{vc}    = 'customer';
617
    $ordlabel      = $locale->text('Quotation Number');
618
    $ordnumber     = 'quonumber';
619
    $employee      = $locale->text('Employee');
620
  }
621

  
622
  # setup vendor / customer selection
623
  $form->all_vc(\%myconfig, $form->{vc},
624
                ($form->{vc} eq 'customer') ? "AR" : "AP");
625

  
626
  # departments
627
  if (@{ $form->{all_departments} }) {
628
    $form->{selectdepartment} = "<option>\n";
629

  
630
    map {
631
      $form->{selectdepartment} .=
632
        "<option>$_->{description}--$_->{id}</option>\n"
633
    } (@{ $form->{all_departments} });
634
  }
635

  
636
  $department = qq|
637
        <tr>
638
	  <th align=right nowrap>| . $locale->text('Department') . qq|</th>
639
	  <td colspan=3><select name=department>$form->{selectdepartment}</select></td>
640
	</tr>
641
| if $form->{selectdepartment};
642

  
643
  my $delivered;
644
  if (($form->{"type"} eq "sales_order") ||
645
      ($form->{"type"} eq "purchase_order")) {
646
    $delivered = qq|
647
        <tr>
648
          <td><input name="notdelivered" id="notdelivered" class="checkbox" type="checkbox" value="1" checked>
649
            <label for="notdelivered">|. $locale->text('Not delivered') . qq|</label></td>
650
          <td><input name="delivered" id="delivered" class="checkbox" type="checkbox" value="1" checked>
651
            <label for="delivered">| . $locale->text('Delivered') . qq|</label></td>
652
        </tr>
653
|;
654
  }
655

  
656
  # use JavaScript Calendar or not
657
  $form->{jsscript} = 1;
658
  $jsscript = "";
659

  
660
  $button1 = qq|
661
     <td><input name=transdatefrom id=transdatefrom size=11 title="$myconfig{dateformat}" onBlur=\"check_right_date_format(this)\">
662
     <input type=button name=transdatefrom id="trigger3" value=|
663
    . $locale->text('button') . qq|></td>
664
    |;
665
  $button2 = qq|
666
     <td><input name=transdateto id=transdateto size=11 title="$myconfig{dateformat}" onBlur=\"check_right_date_format(this)\">
667
     <input type=button name=transdateto name=transdateto id="trigger4" value=|
668
    . $locale->text('button') . qq|></td>
669
   |;
670
  $button3 = qq|
671
     <td><input name=reqdatefrom id=reqdatefrom size=11 title="$myconfig{dateformat}" onBlur=\"check_right_date_format(this)\">
672
     <input type=button name=reqdatefrom id="trigger5" value=|
673
    . $locale->text('button') . qq|></td>
674
    |;
675
  $button4 = qq|
676
     <td><input name=reqdateto id=reqdateto size=11 title="$myconfig{dateformat}" onBlur=\"check_right_date_format(this)\">
677
     <input type=button name=reqdateto name=reqdateto id="trigger6" value=|
678
    . $locale->text('button') . qq|></td>
679
   |;
680
 
681
  #write Trigger
682
  $jsscript =
683
   Form->write_trigger(\%myconfig, "4", "transdatefrom", "BR", "trigger3",
684
                       "transdateto", "BL", "trigger4",
685
                       "reqdatefrom", "BR", "trigger5", "reqdateto", "BL", "trigger6");
686

  
687
  my $vc = $form->{vc} eq "customer" ? "customers" : "vendors";
688

  
689
  $form->get_lists("projects"  => { "key" => "ALL_PROJECTS",
690
                                    "all" => 1 },
691
                   "employees" => "ALL_EMPLOYEES",
692
                   "salesmen"  => "ALL_SALESMEN",
693
                   $vc         => "ALL_" . uc($vc)
694
                  );
695

  
696
  my %labels = ();
697
  my @values = ("");
698
  foreach my $item (@{ $form->{"ALL_PROJECTS"} }) {
699
    push(@values, $item->{"id"});
700
    $labels{$item->{"id"}} = $item->{"projectnumber"};
701
  }
702
  my $projectnumber =
703
    NTI($cgi->popup_menu('-name' => 'project_id', '-values' => \@values,
704
                         '-labels' => \%labels));
705

  
706
  #employees
707
  %labels = ();
708
  @values = ("");
709
  foreach my $item (@{ $form->{"ALL_EMPLOYEES"} }) {
710
    push(@values, $item->{"id"});
711
    $labels{$item->{"id"}} = $item->{"name"} ne "" ? $item->{"name"} : $item->{"login"};
712
  }
713

  
714
  #salesmen
715
  my %labels_salesmen = ();
716
  my @values_salesmen = ('');
717
  foreach my $item (@{ $form->{"ALL_SALESMEN"} }) {
718
    push(@values_salesmen, $item->{"id"});
719
    $labels_salesmen{$item->{"id"}} = $item->{"name"} ne "" ? $item->{"name"} : $item->{"login"};
720
  }
721

  
722
  my $employee_block = qq|
723
    <tr>
724
      <th align="right">| . $locale->text('Employee') . qq|</th>
725
      <td>| .  NTI($cgi->popup_menu('-name'   => 'employee_id', '-values' => \@values, '-labels' => \%labels)) . qq|</td>
726
    </tr>
727
    <tr>
728
      <th align="right">| . $locale->text('Salesman') . qq|</th>
729
      <td>| .
730
        NTI($cgi->popup_menu('-name'   => 'salesman_id',
731
                             '-values' => \@values_salesmen,
732
                             '-labels' => \%labels_salesmen)) . qq|
733
      </td>
734
    </tr>|;
735

  
736
  %labels = ();
737
  @values = ("");
738

  
739
  foreach my $item (@{ $form->{($form->{vc} eq "customer" ? "ALL_CUSTOMERS" : "ALL_VENDORS")}}) {
740
    push(@values, $item->{name}.qq|--|.$item->{"id"});
741
    $labels{$item->{name}.qq|--|.$item->{"id"}} = $item->{"name"};
614
  } else {
615
    $form->show_generic_error($locale->text('oe.pl::search called with unknown type'), back_button => 1);
742 616
  }
743 617

  
744
  my $vc_label = $form->{vc} eq "customer" ? $locale->text('Customer') : $locale->text('Vendor');
745
  $vc =
746
    $myconfig{vclimit} <=  scalar(@values)
747
    ? qq|<input type="text" value="| . H(($form->{"old$form->{vc}"} =~ /^(.*)\-\-.*$/)) . qq|" name="$form->{vc}">|
748
    : NTI($cgi->popup_menu('-name' => "$form->{vc}",
749
                           '-default' => $form->{"old$form->{vc}"},
750
                           '-onChange' => 'document.getElementById(\'update_button\').click();',
751
                           '-values' => \@values,
752
                           '-labels' => \%labels));
753
  $form->header;
754

  
755
  print qq|
756
<body>
757

  
758
<form method=post action=$form->{script}>
759

  
760
<table width=100%>
761
  <tr>
762
    <th class=listtop>$form->{title}</th>
763
  </tr>
764
  <tr height="5"></tr>
765
  <tr>
766
    <td>
767
      <table>
768
        <tr>
769
          <th align=right>$vc_label</th>
770
          <td colspan=3>$vc</td>
771
        </tr>
772
$department
773
        <tr>
774
          <th align=right>$ordlabel</th>
775
          <td colspan=3><input name="$ordnumber" size=20></td>
776
        </tr>
777
$employee_block
778
        <tr>
779
          <th align="right">| . $locale->text('Transaction description') . qq|</th>
780
          <td colspan="3"><input name="transaction_description" size=20></td>
781
        </tr>
782
        <tr>
783
          <th align="right">| . $locale->text("Project Number") . qq|</th>
784
          <td colspan="3">$projectnumber</td>
785
        </tr>
786
        <tr>
787
          <th align=right>| . $locale->text('Order Date') . " " . $locale->text('From') . qq|</th> $button1
788
          <th align=right>| . $locale->text('Bis') . qq|</th> $button2
789
        </tr>
790
        <input type=hidden name=sort value=transdate>
791
        <tr>
792
          <th align=right>| . $locale->text('Delivery Date') . " " . $locale->text('From') . qq|</th> $button3
793
          <th align=right>| . $locale->text('Bis') . qq|</th> $button4
794
        </tr>
795
        <input type=hidden name=sort value=reqdate>
796
        <tr>
797
          <th align=right>| . $locale->text('Include in Report') . qq|</th>
798
          <td colspan=5>
799
	    <table>
800
        <tr>
801
          <td><input type="checkbox" name="open" value="1" id="open" checked> <label for="open">| . $locale->text("Open") . qq|</td>
802
          <td><input type="checkbox" name="closed" value="1" id="closed"> <label for="closed">| . $locale->text("Closed") . qq|</td>
803
        </tr>
804
        $delivered
805
	      <tr>
806
		<td><input name="l_id" class=checkbox type=checkbox value=Y> | . $locale->text('ID') . qq|</td>
807
		<td><input name="l_$ordnumber" class=checkbox type=checkbox value=Y checked> $ordlabel</td>
808
	      </tr>
809
	      <tr>
810
		<td><input name="l_transdate" class=checkbox type=checkbox value=Y checked> | . $locale->text('Date') . qq|</td>
811
		<td><input name="l_reqdate" class=checkbox type=checkbox value=Y checked> | . $locale->text('Required by') . qq|</td>
812
	      </tr>
813
	      <tr>
814
	        <td><input name="l_name" class=checkbox type=checkbox value=Y checked> $vc_label</td>
815
	        <td><input name="l_employee" class=checkbox type=checkbox value=Y checked> $employee</td>
816

  
817
		<td><input name="l_shipvia" class=checkbox type=checkbox value=Y> | . $locale->text('Ship via') . qq|</td>
818
	      </tr>
819
	      <tr>
820
		<td><input name="l_netamount" class=checkbox type=checkbox value=Y> | . $locale->text('Amount') . qq|</td>
821
		<td><input name="l_tax" class=checkbox type=checkbox value=Y> | . $locale->text('Tax') . qq|</td>
822
		<td><input name="l_amount" class=checkbox type=checkbox value=Y checked> | . $locale->text('Total') . qq|</td>
823
	      </tr>
824
	      <tr>
825
		<td><input name="l_marge_total" class=checkbox type=checkbox value=Y> | .             $locale->text('Ertrag') . qq|</td>
826
		<td><input name="l_marge_percent" class=checkbox type=checkbox value=Y> | .             $locale->text('Ertrag prozentual') . qq|</td>
827
	      </tr>
828
	      <tr>
829
          <td><input name="l_globalprojectnumber" class=checkbox type=checkbox value=Y> | . $locale->text('Project Number') . qq|</td>
830
          <td><input name="l_transaction_description" class=checkbox type=checkbox value=Y> | . $locale->text('Transaction description') . qq|</td>
831
	      </tr>
832
	      <tr>
833
	        <td><input name="l_subtotal" class=checkbox type=checkbox value=Y> | . $locale->text('Subtotal') . qq|</td>
834
                <td><input name="l_salesman" class="checkbox" type="checkbox" value="Y"> | . $locale->text('Salesman') . qq|</td>
835
	      </tr>
836
	    </table>
837
          </td>
838
        </tr>
839
      </table>
840
    </td>
841
  </tr>
842
  <tr><td colspan=4><hr size=3 noshade></td></tr>
843
</table>
844

  
845
$jsscript
846

  
847
<br>
848
<input type=hidden name=nextsub value=orders>
849
<input type=hidden name=vc value=$form->{vc}>
850
<input type=hidden name=type value=$form->{type}>
618
  # setup vendor / customer data
619
  $form->all_vc(\%myconfig, $form->{vc}, ($form->{vc} eq 'customer') ? "AR" : "AP");
620
  $form->get_lists("projects"     => { "key" => "ALL_PROJECTS", "all" => 1 },
621
                   "employees"    => "ALL_EMPLOYEES",
622
                   "salesmen"     => "ALL_SALESMEN",
623
                   "departments"  => "ALL_DEPARTMENTS",
624
                   "$form->{vc}s" => "ALL_VC");
625

  
626
  # constants and subs for template
627
  $form->{jsscript}        = 1;
628
  $form->{employee_labels} = sub { $_[0]->{"name"} || $_[0]->{"login"} };
629
  $form->{vc_keys}         = sub { "$_[0]->{name}--$_[0]->{id}" };
630
  $form->{salesman_labels} = $form->{employee_labels};
851 631

  
852
<input class=submit type=submit name=action value="|
853
    . $locale->text('Continue') . qq|">
854
</form>
632
  $form->header();
855 633

  
856
</body>
857
</html>
858
|;
634
  print $form->parse_html_template('oe/search');
859 635

  
860 636
  $lxdebug->leave_sub();
861 637
}

Auch abrufbar als: Unified diff