Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 8dc4cef2

Von Bernd Bleßmann vor mehr als 9 Jahren hinzugefügt

  • ID 8dc4cef21cbcdcd2fd3bc6539aefd6fa104bb8c5
  • Vorgänger ad033a76
  • Nachfolger e3b47235

surplus: Erfassungsdatum bei Stammdatensuche Kunden/Lieferanten ...

... im Bericht anzeigen und danach filtern.

Conflicts:

SL/CT.pm
bin/mozilla/ct.pl
templates/webpages/ct/search.html

Übernahme aus Kundenprojekt.

Unterschiede anzeigen:

SL/CT.pm
76 76
      "city"               => "ct.city",
77 77
      "country"            => "ct.country",
78 78
      "discount"           => "ct.discount",
79
      "insertdate"         => "ct.itime",
79 80
      "salesman"           => "e.name",
80 81
      "payment"            => "pt.description"
81 82
    );
......
92 93
  }
93 94
  my $sortdir   = !defined $form->{sortdir} ? 'ASC' : $form->{sortdir} ? 'ASC' : 'DESC';
94 95

  
95
  if ($sortorder !~ /(business|id|discount)/ && !$join_records) {
96
  if ($sortorder !~ /(business|id|discount|itime)/ && !$join_records) {
96 97
    $sortorder  = "lower($sortorder) ${sortdir}";
97 98
  } else {
98 99
    $sortorder .= " ${sortdir}";
......
176 177
    push(@values, conv_i($form->{salesman_id}));
177 178
  }
178 179

  
180
  if($form->{insertdatefrom}) {
181
    $where .= qq| AND (ct.itime::DATE >= ?)|;
182
    push@values, conv_date($form->{insertdatefrom});
183
  }
184

  
185
  if($form->{insertdateto}) {
186
    $where .= qq| AND (ct.itime::DATE <= ?)|;
187
    push @values, conv_date($form->{insertdateto});
188
  }
189

  
179 190
  # Nur Kunden finden, bei denen ich selber der Verkäufer bin
180 191
  # Gilt nicht für Lieferanten
181 192
  if ($cv eq 'customer' &&   !$main::auth->assert('customer_vendor_all_edit', 1)) {
......
203 214
  }
204 215

  
205 216
  my $query =
206
    qq|SELECT ct.*, b.description AS business, e.name as salesman, |.
217
    qq|SELECT ct.*, ct.itime::DATE AS insertdate, b.description AS business, e.name as salesman, | .
207 218
    qq|  pt.description as payment | .
208 219
    (qq|, NULL AS invnumber, NULL AS ordnumber, NULL AS quonumber, NULL AS invid, NULL AS module, NULL AS formtype, NULL AS closed | x!! $join_records) .
209 220
    qq|FROM $cv ct | .
......
223 234
      push(@values, @saved_values);
224 235
      $query .=
225 236
        qq| UNION | .
226
        qq|SELECT ct.*, b.description AS business, e.name as salesman, |.
237
        qq|SELECT ct.*, ct.itime::DATE AS insertdate, b.description AS business, e.name as salesman, | .
227 238
        qq|  pt.description as payment, | .
228 239
        qq|  a.invnumber, a.ordnumber, a.quonumber, a.id AS invid, | .
229 240
        qq|  '$module' AS module, 'invoice' AS formtype, | .
......
240 251
      push(@values, @saved_values);
241 252
      $query .=
242 253
        qq| UNION | .
243
        qq|SELECT ct.*, b.description AS business, e.name as salesman, |.
254
        qq|SELECT ct.*, ct.itime::DATE AS insertdate, b.description AS business, e.name as salesman, | .
244 255
        qq|  pt.description as payment, | .
245 256
        qq|  ' ' AS invnumber, o.ordnumber, o.quonumber, o.id AS invid, | .
246 257
        qq|  'oe' AS module, 'order' AS formtype, o.closed | .
......
256 267
      push(@values, @saved_values);
257 268
      $query .=
258 269
        qq| UNION | .
259
        qq|SELECT ct.*, b.description AS business, e.name as salesman, | .
270
        qq|SELECT ct.*, ct.itime::DATE AS insertdate, b.description AS business, e.name as salesman, | .
260 271
        qq|  pt.description as payment, | .
261 272
        qq|  ' ' AS invnumber, o.ordnumber, o.quonumber, o.id AS invid, | .
262 273
        qq|  'oe' AS module, 'quotation' AS formtype, o.closed | .
bin/mozilla/ct.pl
160 160
    }
161 161
  }
162 162

  
163
  if ( $form->{insertdatefrom} or $form->{insertdateto} ) {
164
    push @options, $locale->text('Insert Date');
165
    push @options, $locale->text('From') . " " . $locale->date(\%myconfig, $form->{insertdatefrom}, 1) if $form->{insertdatefrom};
166
    push @options, $locale->text('Bis')  . " " . $locale->date(\%myconfig, $form->{insertdateto},   1) if $form->{insertdateto};
167
  };
168

  
163 169
  my @columns = (
164 170
    'id',        'name',    "$form->{db}number",   'contact',   'phone',    'discount',
165 171
    'fax',       'email',   'taxnumber',           'street',    'zipcode' , 'city',
166 172
    'business',  'payment', 'invnumber', 'ordnumber',           'quonumber', 'salesman',
167
    'country'
173
    'country',   'insertdate'
168 174
  );
169 175

  
170 176
  my @includeable_custom_variables = grep { $_->{includeable} } @{ $cvar_configs };
......
194 200
    'salesman'          => { 'text' => $locale->text('Salesman'), },
195 201
    'discount'          => { 'text' => $locale->text('Discount'), },
196 202
    'payment'           => { 'text' => $locale->text('Payment Terms'), },
203
    'insertdate'        => { 'text' => $locale->text('Insert Date'), },
197 204
    %column_defs_cvars,
198 205
  );
199 206

  
......
201 208

  
202 209
  my @hidden_variables  = ( qw(
203 210
      db status obsolete name contact email cp_name addr_street addr_zipcode
204
      addr_city addr_country business_id salesman_id
211
      addr_city addr_country business_id salesman_id insertdateto insertdatefrom
205 212
    ), "$form->{db}number",
206 213
    map({ "cvar_$_->{name}" } @searchable_custom_variables),
207 214
    map({'cvar_'. $_->{name} .'_qtyop'} grep({$_->{type} eq 'number'} @searchable_custom_variables)),
templates/webpages/ct/search.html
66 66
   </tr>
67 67
   [% END %]
68 68

  
69
   <tr>
70
    <th align="right">[% 'Insert Date' | $T8 %] [% 'From' | $T8 %]</th>
71
    <td>
72
      [% L.date_tag('insertdatefrom') %]
73
    </td>
74
    <th align="right">[% 'Bis' | $T8 %]</th>
75
    <td>
76
      [% L.date_tag('insertdateto') %]
77
    </td>
78
   </tr>
79

  
69 80
   [% CUSTOM_VARIABLES_FILTER_CODE %]
70 81

  
71 82
   <tr>
......
86 97

  
87 98
   <tr>
88 99
    <th align="right" nowrap>[% 'Include in Report' | $T8 %]</th>
89
    <td>
100
    <td colspan="5">
90 101
     <table border="0">
91 102
      <tr>
92 103
       <td>
......
172 183
        <input name="l_payment" id="l_payment" type="checkbox" class="checkbox" value="Y">
173 184
        <label for="l_payment">[% 'Payment Terms' | $T8 %]</label>
174 185
       </td>
186
       <td>
187
        <input name="l_insertdate" id="l_insertdate" class="checkbox" type="checkbox" value="Y">
188
        <label for="l_insertdate">[% 'Insert Date' | $T8 %]</label>
189
       </td>
175 190
      [% IF IS_CUSTOMER %]
176 191
      <td>
177 192
       <input name="l_salesman" id="l_salesman" type="checkbox" class="checkbox" value="Y">

Auch abrufbar als: Unified diff