Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 3fcf64fc

Von Bernd Bleßmann vor etwa 11 Jahren hinzugefügt

  • ID 3fcf64fc989a816e02251ea66fdc2bb0552cd3bb
  • Vorgänger 9ed4151c
  • Nachfolger 30645d2c

Versandort und Steuersatz (Zone) im Auftragsbericht filter- und anzeigbar

Unterschiede anzeigen:

SL/OE.pm
88 88
    qq|  ex.$rate AS exchangerate, | .
89 89
    qq|  pr.projectnumber AS globalprojectnumber, | .
90 90
    qq|  e.name AS employee, s.name AS salesman, | .
91
    qq|  ct.${vc}number AS vcnumber, ct.country, ct.ustid, ct.business_id  | .
91
    qq|  ct.${vc}number AS vcnumber, ct.country, ct.ustid, ct.business_id,  | .
92
    qq|  tz.description AS taxzone | .
92 93
    $periodic_invoices_columns .
93 94
    qq|FROM oe o | .
94 95
    qq|JOIN $vc ct ON (o.${vc}_id = ct.id) | .
......
97 98
    qq|LEFT JOIN exchangerate ex ON (ex.currency_id = o.currency_id | .
98 99
    qq|  AND ex.transdate = o.transdate) | .
99 100
    qq|LEFT JOIN project pr ON (o.globalproject_id = pr.id) | .
101
    qq|LEFT JOIN tax_zones tz ON (o.taxzone_id = tz.id) | .
100 102
    qq|$periodic_invoices_joins | .
101 103
    qq|WHERE (o.quotation = ?) |;
102 104
  push(@values, $quotation);
......
192 194
    push(@values, conv_date($form->{reqdateto}));
193 195
  }
194 196

  
197
  if ($form->{shippingpoint}) {
198
    $query .= qq| AND o.shippingpoint ILIKE ?|;
199
    push(@values, '%' . $form->{shippingpoint} . '%');
200
  }
201

  
202
  if ($form->{taxzone_id} ne '') { # taxzone_id could be 0
203
    $query .= qq| AND tz.id = ?|;
204
    push(@values, $form->{taxzone_id});
205
  }
206

  
195 207
  if ($form->{transaction_description}) {
196 208
    $query .= qq| AND o.transaction_description ILIKE ?|;
197 209
    push(@values, '%' . $form->{transaction_description} . '%');
......
214 226
    "employee"                => "e.name",
215 227
    "salesman"                => "s.name",
216 228
    "shipvia"                 => "o.shipvia",
217
    "transaction_description" => "o.transaction_description"
229
    "transaction_description" => "o.transaction_description",
230
    "shippingpoint"           => "o.shippingpoint",
231
    "taxzone"                 => "tz.description",
218 232
  );
219 233
  if ($form->{sort} && grep($form->{sort}, keys(%allowed_sort_columns))) {
220 234
    $sortorder = $allowed_sort_columns{$form->{sort}} . " ${sortdir}";
bin/mozilla/oe.pl
48 48
use Data::Dumper;
49 49

  
50 50
use SL::DB::Customer;
51
use SL::DB::TaxZone;
51 52

  
52 53
require "bin/mozilla/io.pl";
53 54
require "bin/mozilla/arap.pl";
......
722 723
  $form->get_lists("projects"     => { "key" => "ALL_PROJECTS", "all" => 1 },
723 724
                   "departments"  => "ALL_DEPARTMENTS",
724 725
                   "$form->{vc}s" => "ALL_VC",
725
                   "business_types" => "ALL_BUSINESS_TYPES");
726
                   "taxzones"     => "ALL_TAXZONES",
727
                   "business_types" => "ALL_BUSINESS_TYPES",);
726 728
  $form->{ALL_EMPLOYEES} = SL::DB::Manager::Employee->get_all(query => [ deleted => 0 ]);
727 729

  
728 730
  # constants and subs for template
......
792 794
    "delivered",               "periodic_invoices",
793 795
    "marge_total",             "marge_percent",
794 796
    "vcnumber",                "ustid",
795
    "country",
797
    "country",                 "shippingpoint",
798
    "taxzone",
796 799
  );
797 800

  
798 801
  # only show checkboxes if gotten here via sales_order form.
......
831 834
  push @hidden_variables, "l_subtotal", $form->{vc}, qw(l_closed l_notdelivered open closed delivered notdelivered ordnumber quonumber
832 835
                                                        transaction_description transdatefrom transdateto type vc employee_id salesman_id
833 836
                                                        reqdatefrom reqdateto projectnumber project_id periodic_invoices_active periodic_invoices_inactive
834
                                                        business_id);
837
                                                        business_id shippingpoint taxzone_id);
835 838

  
836
  my $href = build_std_url('action=orders', grep { $form->{$_} } @hidden_variables);
839
  my   @keys_for_url = grep { $form->{$_} } @hidden_variables;
840
  push @keys_for_url, 'taxzone_id' if $form->{taxzone_id} ne ''; # taxzone_id could be 0
841

  
842
  my $href = build_std_url('action=orders', @keys_for_url);
837 843

  
838 844
  my %column_defs = (
839 845
    'ids'                     => { 'text' => '', },
......
861 867
    'country'                 => { 'text' => $locale->text('Country'), },
862 868
    'ustid'                   => { 'text' => $locale->text('USt-IdNr.'), },
863 869
    'periodic_invoices'       => { 'text' => $locale->text('Per. Inv.'), },
870
    'shippingpoint'           => { 'text' => $locale->text('Shipping Point'), },
871
    'taxzone'                 => { 'text' => $locale->text('Steuersatz'), },
864 872
  );
865 873

  
866
  foreach my $name (qw(id transdate reqdate quonumber ordnumber name employee salesman shipvia transaction_description)) {
874
  foreach my $name (qw(id transdate reqdate quonumber ordnumber name employee salesman shipvia transaction_description shippingpoint taxzone)) {
867 875
    my $sortdir                 = $form->{sort} eq $name ? 1 - $form->{sortdir} : $form->{sortdir};
868 876
    $column_defs{$name}->{link} = $href . "&sort=$name&sortdir=$sortdir";
869 877
  }
......
888 896
  push @options, $locale->text('Order Number')            . " : $form->{ordnumber}"                       if $form->{ordnumber};
889 897
  push @options, $locale->text('Notes')                   . " : $form->{notes}"                           if $form->{notes};
890 898
  push @options, $locale->text('Transaction description') . " : $form->{transaction_description}"         if $form->{transaction_description};
899
  push @options, $locale->text('Shipping Point')          . " : $form->{shippingpoint}"                   if $form->{shippingpoint};
891 900
  if ( $form->{transdatefrom} or $form->{transdateto} ) {
892 901
    push @options, $locale->text('Order Date');
893 902
    push @options, $locale->text('From') . " " . $locale->date(\%myconfig, $form->{transdatefrom}, 1)     if $form->{transdatefrom};
......
908 917
    my $vc_type_label = $form->{vc} eq 'customer' ? $locale->text('Customer type') : $locale->text('Vendor type');
909 918
    push @options, $vc_type_label . " : " . SL::DB::Business->new(id => $form->{business_id})->load->description;
910 919
  }
920
  if ($form->{taxzone_id} ne '') { # taxzone_id could be 0
921
    push @options, $locale->text('Steuersatz') . " : " . SL::DB::TaxZone->new(id => $form->{taxzone_id})->load->description;
922
  }
911 923

  
912 924
  $report->set_options('top_info_text'        => join("\n", @options),
913 925
                       'raw_top_info_text'    => $form->parse_html_template('oe/orders_top'),
templates/webpages/oe/search.html
61 61
     <th align="right">[% 'Salesman' | $T8 %]</th>
62 62
     <td>[% L.select_tag('salesman_id', ALL_EMPLOYEES, title_key='safe_name', with_empty=1, style='width:250px') %]</td>
63 63
    </tr>
64
    <tr>
65
     <th align="right">[% 'Steuersatz' | $T8 %]</th>
66
     <td>[% L.select_tag('taxzone_id', ALL_TAXZONES, with_empty=1, title_key='description', style='width: 250px') %]</td>
67
    </tr>
68
    <tr>
69
     <th align="right">[% 'Shipping Point' | $T8 %]</th>
70
     <td colspan="3">[% L.input_tag('shippingpoint', '', style='width:250px') %]</td>
71
    </tr>
64 72
    <tr>
65 73
     <th align="right">[% 'Transaction description' | $T8 %]</th>
66 74
     <td colspan="3"><input name="transaction_description" style="width: 250px"></td>
......
183 191
         <input name="l_customernumber" id="l_customernumber" class="checkbox" type="checkbox" value="Y">
184 192
         <label for="l_customernumber">[% 'Customer Number' | $T8 %]</label>
185 193
        </td>
194
        <td>[%- L.checkbox_tag('l_taxzone',       label => LxERP.t8('Steuersatz'))     %]</td>
195
        <td>[%- L.checkbox_tag('l_shippingpoint', label => LxERP.t8('Shipping Point')) %]</td>
186 196
       </tr>
187 197
       <tr>
188 198
        <td>

Auch abrufbar als: Unified diff