Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision de284a1d

Von Bernd Bleßmann vor etwa 1 Jahr hinzugefügt

  • ID de284a1d2cf9d2d2283533b0aeead1f22de487f7
  • Vorgänger 0d8c4a65
  • Nachfolger a669a530

Lieferscheinbericht: Auftragsbestätigungsnummer anzeigen und filtern können

Unterschiede anzeigen:

SL/DO.pm
72 72

  
73 73
  my $vc = $form->{vc} eq "customer" ? "customer" : "vendor";
74 74

  
75
  my ($extra_selects, $extra_joins) = ('', '');
76

  
77
  $form->{l_order_confirmation_number} = 'Y' if $form->{order_confirmation_number};
78
  if ($form->{l_order_confirmation_number}) {
79
    $extra_selects = qq|, oe.ordnumber AS order_confirmation_number|;
80
    $extra_joins   = qq|LEFT JOIN record_links rl ON (rl.to_id = dord.id)
81
                        LEFT JOIN oe ON (oe.id = rl.from_id)|;
82
  }
83

  
75 84
  my $query =
76 85
    qq|SELECT dord.id, dord.donumber, dord.ordnumber, dord.cusordnumber,
77 86
         dord.transdate, dord.reqdate,
......
85 94
         dord.record_type,
86 95
         e.name AS employee,
87 96
         sm.name AS salesman
97
         $extra_selects
88 98
       FROM delivery_orders dord
89 99
       LEFT JOIN $vc ct ON (dord.${vc}_id = ct.id)
90 100
       LEFT JOIN contacts cp ON (dord.cp_id = cp.cp_id)
......
92 102
       LEFT JOIN employee sm ON (dord.salesman_id = sm.id)
93 103
       LEFT JOIN project pr ON (dord.globalproject_id = pr.id)
94 104
       LEFT JOIN department dep ON (dord.department_id = dep.id)
105
       $extra_joins
95 106
|;
96 107

  
108
  if ($form->{l_order_confirmation_number}) {
109
    push @where, qq|rl.to_table = 'delivery_orders' AND rl.from_table = 'oe' AND oe.record_type::text LIKE 'purchase_order_confirmation'|;
110
  }
111

  
97 112
  if ($form->{type} && is_valid_type($form->{type})) {
98 113
    push @where, 'dord.record_type = ?';
99 114
    push @values, $form->{type};
......
148 163
    push @values, like($form->{$item});
149 164
  }
150 165

  
166
  if ($form->{order_confirmation_number}) {
167
    push @where,  qq|oe.ordnumber ILIKE ?|;
168
    push @values, like($form->{order_confirmation_number});
169
  }
170

  
151 171
  if (($form->{open} || $form->{closed}) &&
152 172
      ($form->{open} ne $form->{closed})) {
153 173
    push @where, ($form->{open} ? "NOT " : "") . "COALESCE(dord.closed, FALSE)";
......
205 225
                             dord.cusordnumber
206 226
                             dord.oreqnumber
207 227
                             dord.vendor_confirmation_number
208
                             );
228
                             oe.ordnumber
229
                            );
209 230
    my $tmp_where = '';
210 231
    $tmp_where .= join ' OR ', map {"$_ ILIKE ?"} @fulltext_fields;
211 232
    push(@values, like($form->{fulltext})) for 1 .. (scalar @fulltext_fields);
......
292 313
    "department"              => "lower(dep.description)",
293 314
    "insertdate"              => "dord.itime",
294 315
    "vendor_confirmation_number" => "dord.vendor_confirmation_number",
316
    "order_confirmation_number"  => "order_confirmation_number",
295 317
  );
296 318

  
297 319
  my $sortdir   = !defined $form->{sortdir} ? 'ASC' : $form->{sortdir} ? 'ASC' : 'DESC';
bin/mozilla/do.pl
778 778
  my @columns = qw(
779 779
    ids                     transdate               reqdate
780 780
    id                      donumber
781
    ordnumber               customernumber          vendor_confirmation_number
781
    ordnumber               order_confirmation_number
782
    customernumber          vendor_confirmation_number
782 783
    cusordnumber
783 784
    name                    employee  salesman
784 785
    shipvia                 globalprojectnumber
......
801 802
                                          transaction_description transdatefrom transdateto reqdatefrom reqdateto
802 803
                                          type vc employee_id salesman_id project_id parts_partnumber parts_description
803 804
                                          insertdatefrom insertdateto business_id all department_id chargenumber full_text
804
                                          vendor_confirmation_number);
805
                                          vendor_confirmation_number order_confirmation_number);
805 806

  
806 807
  my $href = build_std_url('action=orders', grep { $form->{$_} } @hidden_variables);
807 808

  
......
826 827
    'insertdate'              => { 'text' => $locale->text('Insert Date'), },
827 828
    'items'                   => { 'text' => $locale->text('Positions'), },
828 829
    'vendor_confirmation_number' => { 'text' => $locale->text('Vendor Confirmation Number'), },
830
    'order_confirmation_number'  => { 'text' => $locale->text('Order Confirmation Number'), },
829 831
  );
830 832

  
831
  foreach my $name (qw(id transdate reqdate donumber ordnumber name employee salesman shipvia transaction_description department insertdate vendor_confirmation_number)) {
833
  foreach my $name (qw(id transdate reqdate donumber ordnumber name employee salesman shipvia transaction_description department insertdate vendor_confirmation_number order_confirmation_number)) {
832 834
    my $sortdir                 = $form->{sort} eq $name ? 1 - $form->{sortdir} : $form->{sortdir};
833 835
    $column_defs{$name}->{link} = $href . "&sort=$name&sortdir=$sortdir";
834 836
  }
......
864 866
  if ($form->{ordnumber}) {
865 867
    push @options, $locale->text('Order Number') . " : $form->{ordnumber}";
866 868
  }
869
  if ($form->{order_confirmation_number}) {
870
    push @options, $locale->text('Order Confirmation Number') . " : $form->{order_confirmation_number}";
871
  }
867 872
  if ($form->{vendor_confirmation_number}) {
868 873
    push @options, $locale->text('Vendor Confirmation Number') . " : $form->{vendor_confirmation_number}";
869 874
  }
templates/design40_webpages/do/search.html
83 83
      </td>
84 84
    </tr>
85 85
    [%- IF type == "purchase_delivery_order" %]
86
    <tr>
87
      <th>[% 'Order Confirmation Number' | $T8 %]</th>
88
      <td> <input type="text" name="order_confirmation_number" class="fixed_width wi-mediumsmall">
89
      </td>
90
    </tr>
86 91
    <tr>
87 92
      <th>[% 'Vendor Confirmation Number' | $T8 %]</th>
88 93
      <td> <input type="text" name="vendor_confirmation_number" class="fixed_width wi-mediumsmall">
......
179 184
      <label for="l_ordnumber">[% 'Order Number' | $T8 %]</label>
180 185
    </div>
181 186
    [%- IF type == "purchase_delivery_order" %]
187
    <div>
188
      <input name="l_order_confirmation_number" id="l_order_confirmation_number" type="checkbox" value="Y" checked>
189
      <label for="l_order_confirmation_number">[% 'Order Confirmation Number' | $T8 %]</label>
190
    </div>
182 191
    <div>
183 192
      <input name="l_vendor_confirmation_number" id="l_vendor_confirmation_number" type="checkbox" value="Y" checked>
184 193
      <label for="l_vendor_confirmation_number">[% 'Vendor Confirmation Number' | $T8 %]</label>
templates/webpages/do/search.html
42 42
    </tr>
43 43

  
44 44
    [%- IF type == "purchase_delivery_order" %]
45
    <tr>
46
     <th align="right">[% 'Order Confirmation Number' | $T8 %]</th>
47
     <td colspan="3"><input name="order_confirmation_number" class="fixed_width"></td>
48
    </tr>
49

  
45 50
    <tr>
46 51
     <th align="right">[% 'Vendor Confirmation Number' | $T8 %]</th>
47 52
     <td colspan="3"><input name="vendor_confirmation_number" class="fixed_width"></td>
......
185 190
        </td>
186 191

  
187 192
        [%- IF type == "purchase_delivery_order" %]
193
        <td>
194
         <input name="l_order_confirmation_number" id="l_order_confirmation_number" class="checkbox" type="checkbox" value="Y" checked>
195
         <label for="l_order_confirmation_number">[% 'Order Confirmation Number' | $T8 %]</label>
196
        </td>
188 197
        <td>
189 198
         <input name="l_vendor_confirmation_number" id="l_vendor_confirmation_number" class="checkbox" type="checkbox" value="Y" checked>
190 199
         <label for="l_vendor_confirmation_number">[% 'Vendor Confirmation Number' | $T8 %]</label>

Auch abrufbar als: Unified diff