Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 25000c1e

Von Moritz Bunkus vor fast 8 Jahren hinzugefügt

  • ID 25000c1e78ff40c097ea0872d46a9a8da4608313
  • Vorgänger aae306cd
  • Nachfolger 012f8a7f

Verkaufswertbericht: keine Multibox mehr nutzen

Unterschiede anzeigen:

bin/mozilla/vk.pl
36 36
use List::Util qw(sum first);
37 37

  
38 38
use SL::AM;
39
use SL::DB::Employee;
39 40
use SL::VK;
40 41
use SL::IS;
41 42
use SL::ReportGenerator;
......
57 58

  
58 59
  my ($customer);
59 60

  
60
  # setup customer selection
61
  $form->all_vc(\%myconfig, "customer", "AR");
61
  $::request->layout->add_javascripts("autocomplete_project.js");
62 62

  
63 63
  $form->{title}    = $locale->text('Sales Report');
64 64

  
65
  $form->get_lists("projects"        => { "key" => "ALL_PROJECTS", "all" => 1 },
66
                   "departments"     => "ALL_DEPARTMENTS",
65
  $form->get_lists("departments"     => "ALL_DEPARTMENTS",
67 66
                   "business_types"  => "ALL_BUSINESS_TYPES",
68 67
                   "salesmen"        => "ALL_SALESMEN",
69
                   'employees'       => 'ALL_EMPLOYEES',
70
                   'partsgroup'      => 'ALL_PARTSGROUPS',
71
                   "customers"       => "ALL_VC");
68
                   'partsgroup'      => 'ALL_PARTSGROUPS');
69

  
70
  $form->{ALL_EMPLOYEES} = SL::DB::Manager::Employee->get_all_sorted;
71

  
72 72
  $form->{CUSTOM_VARIABLES_IC}                  = CVar->get_configs('module' => 'IC');
73 73
  ($form->{CUSTOM_VARIABLES_FILTER_CODE_IC},
74 74
   $form->{CUSTOM_VARIABLES_INCLUSION_CODE_IC}) = CVar->render_search_options('variables'      => $form->{CUSTOM_VARIABLES_IC},
......
80 80
   $form->{CUSTOM_VARIABLES_INCLUSION_CODE_CT}) = CVar->render_search_options('variables'      => $form->{CUSTOM_VARIABLES_CT},
81 81
                                                                           'include_prefix' => 'l_',
82 82
                                                                           'include_value'  => 'Y');
83
  $form->{vc_keys}   = sub { "$_[0]->{name}--$_[0]->{id}" };
84
  $form->{employee_labels} = sub { $_[0]->{"name"} || $_[0]->{"login"} };
85
  $form->{salesman_labels} = $form->{employee_labels};
86

  
87 83
  $form->header;
88 84
  print $form->parse_html_template('vk/search_invoice', { %myconfig });
89 85

  
templates/webpages/vk/search_invoice.html
1
[%- USE T8 %]
2
[%- USE L %]
1
[%- USE T8 %][%- USE L %][%- USE P -%]
2
[%- SET style="width: 250px" %]
3 3
<h1>[% title %]</h1>
4 4

  
5 5
<form method=post name="search_invoice" action=[% script %]>
......
63 63

  
64 64
    <tr>
65 65
      <th align=right>[% 'Customer' | $T8 %]</th>
66
      <td>
67
        [%- INCLUDE 'generic/multibox.html'
68
          name          = 'customer',
69
          default       = oldcustomer,
70
          style         = 'width: 250px',
71
          DATA          = ALL_VC,
72
          id_sub        = 'vc_keys',
73
          label_key     = 'name',
74
          select        = vc_select,
75
          limit         = vclimit,
76
          show_empty    = 1,
77
          allow_textbox = 1,
78
          class         = 'initial_focus',
79
        -%]
80
      </td>
66
      <td>[% P.input_tag("customer", "", class="initial_focus", style=style) %]</td>
81 67

  
82 68
      <th align="right" nowrap>[% 'Customer Number' | $T8 %]</th>
83
      <td>
84
        <input name="customernumber" size="20">
85
      </td>
69
      <td>[% P.input_tag("customernumber", "", style=style) %]</td>
86 70
    </tr>
87 71

  
88 72
    <tr>
......
92 76
                         ALL_DEPARTMENTS,
93 77
                         title_key  = 'description',
94 78
                         with_empty = 1,
95
                         style      = 'width: 250px')
79
                         style      = style)
96 80
      -%]
97 81
      </td>
98 82

  
99 83
      <th align="right">[% 'Project Number' | $T8 %]</th>
100
      <td>
101
        [%- INCLUDE 'generic/multibox.html'
102
          name          =  'project_id',
103
          style         = "width: 250px",
104
          DATA          =  ALL_PROJECTS,
105
          id_key        = 'id',
106
          label_key     = 'projectnumber',
107
          limit         = vclimit,
108
          show_empty    = 1,
109
          allow_textbox = 0,
110
        -%]
111
      </td>
84
      <td>[% P.project_picker("project_id", "", style=style) %]</td>
112 85
    </tr>
113 86

  
114 87
    <tr>
115 88
      <th align="right" nowrap>[% 'Part Number' | $T8 %]</th>
116
      <td><input name="partnumber" size="20"></td>
89
      <td>[% P.input_tag("partnumber", "", style=style) %]</td>
117 90
    </tr>
118 91

  
119 92
    <tr>
120 93
      <th align="right" nowrap>[% 'Part Description' | $T8 %]</th>
121
      <td>
122
        <input name="description" size="40">
123
      </td>
94
      <td>[% P.input_tag("description", "", style=style) %]</td>
124 95
    </tr>
125 96

  
126 97
    <tr>
127 98
      <th align="right">[% 'Partsgroup' | $T8 %]</th>
128
      <td>
129
        [%- INCLUDE 'generic/multibox.html'
130
          name          = 'partsgroup_id',
131
          style         = 'width: 250px',
132
          DATA          =  ALL_PARTSGROUPS,
133
          id_key        = 'id',
134
          label_key     = 'partsgroup',
135
          show_empty    = 1,
136
          allow_textbox = 0,
137
        -%]
138
      </td>
139

  
99
      <td>[% P.select_tag("partsgroupd_id", ALL_PARTSGROUPS, title_key="partsgroup", with_empty=1, style=style) %]</td>
140 100
      <td align="right" nowrap>[% 'Country' | $T8 %]</td>
141
      <td><input name="country" size="20"></td>
101
      <td>[% P.input_tag("country", "", style=style) %]</td>
142 102
    </tr>
143 103

  
144 104
    <tr>
145 105
      <th align="right">[% 'Employee' | $T8 %]</th>
146
      <td>
147
        [%- INCLUDE 'generic/multibox.html'
148
          name          = 'employee_id',
149
          style         = 'width: 250px',
150
          DATA          =  ALL_EMPLOYEES,
151
          id_key        = 'id',
152
          label_sub     = 'employee_labels',
153
          limit         = vclimit,
154
          show_empty    = 1,
155
          allow_textbox = 0,
156
          default       = ' ',
157
        -%]
158
      </td>
106
      <td>[% L.select_tag("employee_id", ALL_EMPLOYEES, title_key="safe_name", with_empty=1, style=style) %]</td>
159 107

  
160 108
      <th align="right">[% 'Salesman' | $T8 %]</th>
161
      <td>
162
        [%- INCLUDE 'generic/multibox.html'
163
          name          = 'salesman_id',
164
          style         = 'width: 250px',
165
          DATA          =  ALL_SALESMEN,
166
          id_key        = 'id',
167
          label_sub     = 'salesman_labels',
168
          limit         = vclimit,
169
          show_empty    = 1,
170
          allow_textbox = 0,
171
        -%]
172
      </td>
109
      <td>[% L.select_tag("salesman_id", ALL_EMPLOYEES, title_key="safe_name", with_empty=1, style=style) %]</td>
173 110
    </tr>
174 111

  
175 112
    <tr>
176 113
      <th align="right">[% 'Customer type' | $T8 %]</th>
177
      <td>
178
        [%- INCLUDE 'generic/multibox.html'
179
           name          =  'business_id',
180
           style         = "width: 250px",
181
           DATA          =  ALL_BUSINESS_TYPES,
182
           id_key        = 'id',
183
           label_key     = 'description',
184
           limit         = vclimit,
185
           show_empty    = 1,
186
           allow_textbox = 0,
187
        -%]
188
      </td>
114
      <td>[% L.select_tag("business_id", ALL_BUSINESS_TYPES, title_key="description", with_empty=1, style=style) %]</td>
189 115
    </tr>
190 116

  
191 117
    <tr>
192 118
      <th align=right nowrap>[% 'Invoice Date' | $T8 %] [% 'From' | $T8 %]</th>
193 119
      <td>
194 120
        [% L.date_tag('transdatefrom') %]
195
      </td>
196

  
197
      <th align=right>[% 'Bis' | $T8 %]</th>
198

  
199
      <td>
121
        [% 'Bis' | $T8 %]
200 122
        [% L.date_tag('transdateto') %]
201 123
      </td>
202 124
    </tr>

Auch abrufbar als: Unified diff