Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 4800abb9

Von Moritz Bunkus vor fast 8 Jahren hinzugefügt

  • ID 4800abb9a0b8363c3c529927f34a5b26551497b2
  • Vorgänger ca0df4c4
  • Nachfolger 122f91e7

Verkaufsrechnungssuche: keine Multibox mehr nutzen

Unterschiede anzeigen:

SL/AR.pm
499 499
    $where .= " AND NOT invoice = 'f' ";  # remove ar transactions from Sales -> Reports -> Invoices
500 500
  };
501 501

  
502
  if ($form->{customernumber}) {
503
    $where .= " AND c.customernumber = ?";
504
    push(@values, trim($form->{customernumber}));
505
  }
506
  if ($form->{customer_id}) {
507
    $where .= " AND a.customer_id = ?";
508
    push(@values, $form->{customer_id});
509
  } elsif ($form->{customer}) {
502
  if ($form->{customer}) {
510 503
    $where .= " AND c.name ILIKE ?";
511 504
    push(@values, like($form->{customer}));
512 505
  }
bin/mozilla/ar.pl
40 40
use SL::FU;
41 41
use SL::GL;
42 42
use SL::IS;
43
use SL::DB::Business;
43 44
use SL::DB::Currency;
44 45
use SL::DB::Default;
45 46
use SL::DB::Employee;
......
789 790
  my $locale   = $main::locale;
790 791
  my $cgi      = $::request->{cgi};
791 792

  
792
  # setup customer selection
793
  $form->all_vc(\%myconfig, "customer", "AR");
794

  
795 793
  $form->{title}    = $locale->text('AR Transactions');
796 794

  
797
  # Auch in Rechnungsübersicht nach Kundentyp filtern - jan
798
  $form->get_lists("projects"       => { "key" => "ALL_PROJECTS", "all" => 1 },
799
                   "customers"      => "ALL_VC",
800
                   "business_types" => "ALL_BUSINESS_TYPES");
801 795
  $form->{ALL_EMPLOYEES} = SL::DB::Manager::Employee->get_all_sorted(query => [ deleted => 0 ]);
802
  $form->{ALL_DEPARTMENTS} = SL::DB::Manager::Department->get_all;
803
  $form->{SHOW_BUSINESS_TYPES} = scalar @{ $form->{ALL_BUSINESS_TYPES} } > 0;
796
  $form->{ALL_DEPARTMENTS} = SL::DB::Manager::Department->get_all_sorted;
797
  $form->{ALL_BUSINESS_TYPES} = SL::DB::Manager::Business->get_all_sorted;
804 798

  
805 799
  $form->{CT_CUSTOM_VARIABLES}                  = CVar->get_configs('module' => 'CT');
806 800
  ($form->{CT_CUSTOM_VARIABLES_FILTER_CODE},
......
811 805
  # constants and subs for template
812 806
  $form->{vc_keys}   = sub { "$_[0]->{name}--$_[0]->{id}" };
813 807

  
808
  $::request->layout->add_javascripts("autocomplete_project.js");
809

  
814 810
  $form->header;
815 811
  print $form->parse_html_template('ar/search', { %myconfig });
816 812

  
......
849 845

  
850 846
  my ($callback, $href, @columns);
851 847

  
852
  ($form->{customer}, $form->{customer_id}) = split(/--/, $form->{customer});
853

  
854 848
  report_generator_set_default_sort('transdate', 1);
855 849

  
856 850
  AR->ar_transactions(\%myconfig, \%$form);
templates/webpages/ar/search.html
1 1
[%- USE T8 %]
2
[%- USE L %]
2
[%- USE L %][%- USE P -%]
3 3
<h1>[% title %]</h1>
4 4

  
5 5
 <form method=post name="search" action=[% script %]>
......
10 10
    <table>
11 11
     <tr>
12 12
      <th align=right>[% 'Customer' | $T8 %]</th>
13
      <td colspan=3>
14
            [%- INCLUDE 'generic/multibox.html'
15
                 name          = 'customer',
16
                 default       = oldcustomer,
17
                 style         = 'width: 250px',
18
                 DATA          = ALL_VC,
19
                 id_sub        = 'vc_keys',
20
                 label_key     = 'name',
21
                 select        = vc_select,
22
                 limit         = vclimit,
23
                 show_empty    = 1,
24
                 allow_textbox = 1,
25
                 class         = 'initial_focus',
26
                 -%]
27
      </td>
13
      <td colspan=3>[% L.input_tag("customer", customer, style="width: 250px", class="initial_focus") %]</td>
28 14
     </tr>
29 15
    <tr>
30 16
     <th align="right" nowrap>[% 'Contact Person' | $T8 %]</th>
......
68 54
     </tr>
69 55
     <tr>
70 56
      <th align="right">[% 'Project Number' | $T8 %]</th>
71
      <td colspan="3">
72
            [%- INCLUDE 'generic/multibox.html'
73
                 name          =  'project_id',
74
                 style         = "width: 250px",
75
                 DATA          =  ALL_PROJECTS,
76
                 id_key        = 'id',
77
                 label_key     = 'projectnumber',
78
                 limit         = vclimit,
79
                 show_empty    = 1,
80
                 allow_textbox = 0,
81
            -%]
82
      </td>
57
      <td colspan="3">[% P.project_picker("project_id", project_id, style="width: 250px") %]</td>
83 58
     </tr>
84
    [% IF SHOW_BUSINESS_TYPES %]
59
    [% IF ALL_BUSINESS_TYPES.as_list.size > 0 %]
85 60
     <tr>
86 61
      <th align="right" nowrap>[% 'Customer type' | $T8 %]</th>
87
      <td colspan="3">
88
          [%- INCLUDE 'generic/multibox.html'
89
                 name          =  'business_id',
90
                 style         = "width: 250px",
91
                 DATA          =  ALL_BUSINESS_TYPES,
92
                 id_key        = 'id',
93
                 label_key     = 'description',
94
                 limit         = vclimit,
95
                 show_empty    = 1,
96
                 allow_textbox = 0,
97
            -%]
98
      </td>
62
      <td colspan="3">[% L.select_tag("business_id", ALL_BUSINESS_TYPES, with_empty=1, title_key="description", style="width: 250px") %]</td>
99 63
     </tr>
100 64
    [% END %]
101 65
     <tr>
......
255 219
   <br>
256 220
   <input class=submit type=submit name=action id="continue" value="[% 'Continue' | $T8 %]">
257 221
  </form>
258
 <script type="text/javascript">
259
 <!--
260
   $(document).ready(function(){
261
    $('customer').focus();
262
   })
263
 //-->
264
 </script>

Auch abrufbar als: Unified diff