Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 7e4b86b1

Von G. Richardson vor mehr als 13 Jahren hinzugefügt

  • ID 7e4b86b179adfce5575093004846b11a61eb65ac
  • Vorgänger e7c0b773
  • Nachfolger 027ddbda

VK Bericht um Filter nach Kundennummer erweitert

Kundennummer kann zusätzlich als Spalte ausgegeben werden.

Unterschiede anzeigen:

SL/VK.pm
51 51
  my @values;
52 52

  
53 53
  my $query =
54
    qq|SELECT cus.name,ar.invnumber,ar.id,ar.transdate,p.partnumber,i.parts_id,i.qty,i.price_factor,i.discount,i.description,i.lastcost,i.sellprice,i.marge_total,i.marge_percent,i.unit | .
54
    qq|SELECT cus.name,cus.customernumber,ar.invnumber,ar.id,ar.transdate,p.partnumber,i.parts_id,i.qty,i.price_factor,i.discount,i.description,i.lastcost,i.sellprice,i.marge_total,i.marge_percent,i.unit | .
55 55
    qq|FROM invoice i | .  
56 56
    qq|join ar on (i.trans_id = ar.id) | .
57 57
    qq|join parts p on (i.parts_id = p.id) | .
......
71 71
    $where .= " AND ar.customer_id = ?";
72 72
    push(@values, $form->{customer_id});
73 73
  };
74
  if ($form->{customernumber}) {
75
    $where .= qq| AND cus.customernumber = ? |;
76
    push(@values, $form->{customernumber});
77
  }
74 78
  if ($form->{partnumber}) {
75 79
    $where .= qq| AND (p.partnumber ILIKE ?)|;
76 80
    push(@values, '%' . $form->{partnumber} . '%');
bin/mozilla/vk.pl
125 125
  $form->{title} = $locale->text('Sales Report');
126 126

  
127 127
  @columns =
128
    qw(description invnumber partnumber parts_id transdate qty unit sellprice sellprice_total discount lastcost lastcost_total marge_total marge_percent);
128
    qw(description invnumber transdate customernumber partnumber transdate qty unit sellprice sellprice_total discount lastcost lastcost_total marge_total marge_percent);
129 129

  
130 130
  # hidden variables für pdf/csv export übergeben
131 131
  # einmal mit l_ um zu bestimmen welche Spalten ausgegeben werden sollen
132 132
  # einmal optionen für die Überschrift (z.B. transdatefrom, partnumber, ...)
133
  my @hidden_variables  = (qw(l_headers l_subtotal l_total transdatefrom transdateto decimalplaces customer customername customer_id department partnumber description project_id), "$form->{db}number", map { "l_$_" } @columns);
133
  my @hidden_variables  = (qw(l_headers l_subtotal l_total l_customernumber transdatefrom transdateto decimalplaces customer customername customer_id department partnumber description project_id customernumber), "$form->{db}number", map { "l_$_" } @columns);
134 134
  my @hidden_nondefault = grep({ $form->{$_} } @hidden_variables);
135 135
  # Variablen werden dann als Hidden Variable mitgegeben, z.B.
136 136
  # <input type="hidden" name="report_generator_hidden_transdateto" value="21.05.2010">
......
152 152
    'lastcost'                => { 'text' => $locale->text('Purchase price'), },
153 153
    'marge_total'             => { 'text' => $locale->text('Sales margin'), },
154 154
    'marge_percent'           => { 'text' => $locale->text('Sales margin %'), },
155
    'customernumber'          => { 'text' => $locale->text('Customer Number'), },
155 156
  );
156 157

  
157 158
  my %column_alignment = map { $_ => 'right' } qw(lastcost sellprice sellprice_total lastcost_total unit discount marge_total marge_percent qty);
......
167 168
  if ($form->{customer}) {
168 169
    push @options, $locale->text('Customer') . " : $form->{customername}";
169 170
  }
171
  if ($form->{customernumber}) {
172
    push @options, $locale->text('Customer Number') . " : $form->{customernumber}";
173
  }
170 174
  if ($form->{department}) {
171 175
    my ($department) = split /--/, $form->{department};
172 176
    push @options, $locale->text('Department') . " : $department";
......
335 339
        $name = 'name';
336 340
      };
337 341

  
338
      if ($form->{l_subtotal} eq 'Y' ) {
342
      if ($form->{l_subtotal} eq 'Y') {
339 343
        push @{ $row_set }, create_subtotal_row_invoice(\%subtotals2, \@columns, \%column_alignment, \@subtotal_columns, 'listsubsortsubtotal', $ar->{$name}) ;
340 344
        push @{ $row_set }, insert_empty_row();
341 345
      };
templates/webpages/vk/search_invoice.html
38 38
                 -%]
39 39
      </td>
40 40
     </tr>
41
      <tr>
42
       <th align="right" nowrap>[% 'Customer Number' | $T8 %]</th>
43
       <td><input name="customernumber" size="20"></td>
44
      </tr>
41 45
     <tr>
42 46
      <th align=right nowrap>[% 'Department' | $T8 %]</th>
43 47
      <td>
......
140 144
           <td align=right><input name="l_headers" class=checkbox type=checkbox value="Y" checked></td>
141 145
           <td nowrap>[% 'Headings' | $T8 %]</td>
142 146
          </tr>
147
          <tr>
148
           <td align=right><input name="l_customernumber" class=checkbox type=checkbox value=Y checked></td>
149
           <td nowrap>[% 'Customer Number' | $T8 %]</td>
150
          </tr>
143 151
          <tr>
144 152
            <th align="right" nowrap>[% 'Decimalplaces' | $T8 %]</th>
145 153
            <td colspan="4"><input name="decimalplaces" size="2" value="2"></td>

Auch abrufbar als: Unified diff