Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision b2f44e3d

Von Moritz Bunkus vor mehr als 15 Jahren hinzugefügt

  • ID b2f44e3d98cbbd622b1497c23602eb79e71a3c64
  • Vorgänger 11e2bd11
  • Nachfolger 24baeb62

Das Definieren, Erstellen und Bearbeiten von benutzerdefinierten Variablen bei Waren, Dienstleistungen und Erzeugnissen implementiert.

Unterschiede anzeigen:

bin/mozilla/ic.pl
36 36
use List::MoreUtils qw(any);
37 37

  
38 38
use SL::AM;
39
use SL::CVar;
39 40
use SL::IC;
40 41
use SL::ReportGenerator;
41 42

  
......
105 106

  
106 107
  $form->{jsscript} = 1;
107 108

  
109
  $form->{CUSTOM_VARIABLES}                  = CVar->get_configs('module' => 'IC');
110
  ($form->{CUSTOM_VARIABLES_FILTER_CODE},
111
   $form->{CUSTOM_VARIABLES_INCLUSION_CODE}) = CVar->render_search_options('variables'      => $form->{CUSTOM_VARIABLES},
112
                                                                           'include_prefix' => 'l_',
113
                                                                           'include_value'  => 'Y');
114

  
108 115
  $form->header;
109 116

  
110 117
  print $form->parse_html_template('ic/search', { %is_xyz,
......
1010 1017

  
1011 1018
  my ($revers, $lastsort, $description);
1012 1019

  
1020
  my $cvar_configs = CVar->get_configs('module' => 'IC');
1021

  
1013 1022
  $form->{title} = (ucfirst $form->{searchitems}) . "s";
1014 1023
  $form->{title} =~ s/ys$/ies/;
1015 1024
  $form->{title} = $locale->text($form->{title});
......
1151 1160
    qw(partnumber description partsgroup bin onhand rop unit listprice linetotallistprice sellprice linetotalsellprice lastcost linetotallastcost
1152 1161
       priceupdate weight image drawing microfiche invnumber ordnumber quonumber name serialnumber soldtotal deliverydate);
1153 1162

  
1163
  my @includeable_custom_variables = grep { $_->{includeable} } @{ $cvar_configs };
1164
  my @searchable_custom_variables  = grep { $_->{searchable} }  @{ $cvar_configs };
1165
  my %column_defs_cvars            = map { +"cvar_$_->{name}" => { 'text' => $_->{description} } } @includeable_custom_variables;
1166

  
1167
  push @columns, map { "cvar_$_->{name}" } @includeable_custom_variables;
1168

  
1154 1169
  my %column_defs = (
1155 1170
    'bin'                => { 'text' => $locale->text('Bin'), },
1156 1171
    'deliverydate'       => { 'text' => $locale->text('deliverydate'), },
......
1177 1192
    'soldtotal'          => { 'text' => $locale->text('soldtotal'), },
1178 1193
    'unit'               => { 'text' => $locale->text('Unit'), },
1179 1194
    'weight'             => { 'text' => $locale->text('Weight'), },
1195
    %column_defs_cvars,
1180 1196
  );
1181 1197

  
1182 1198
  map { $column_defs{$_}->{visible} = $form->{"l_$_"} ? 1 : 0 } @columns;
1183 1199
  map { $column_defs{$_}->{align}   = 'right' } qw(onhand sellprice listprice lastcost linetotalsellprice linetotallastcost linetotallistprice rop weight soldtotal);
1184 1200

  
1185
  my @hidden_variables = (qw(l_subtotal l_linetotal searchitems itemstatus bom), @itemstatus_keys, @callback_keys, map { "l_$_" } @columns);
1201
  my @hidden_variables = (qw(l_subtotal l_linetotal searchitems itemstatus bom), @itemstatus_keys, @callback_keys, @searchable_custom_variables, map { "l_$_" } @columns);
1186 1202
  my $callback         = build_std_url('action=generate_report', grep { $form->{$_} } @hidden_variables);
1187 1203

  
1188 1204
  my @sort_full        = qw(partnumber description onhand soldtotal deliverydate);
......
1219 1235

  
1220 1236
  $report->set_sort_indicator($form->{sort}, $form->{revers} ? 0 : 1);
1221 1237

  
1238
  CVar->add_custom_variables_to_report('module'         => 'IC',
1239
                                       'trans_id_field' => 'id',
1240
                                       'configs'        => $cvar_configs,
1241
                                       'column_defs'    => \%column_defs,
1242
                                       'data'           => $form->{parts});
1243

  
1222 1244
  my @subtotal_columns = qw(sellprice listprice lastcost);
1223 1245
  my %subtotals = map { $_ => 0 } ('onhand', @subtotal_columns);
1224 1246
  my %totals    = map { $_ => 0 } @subtotal_columns;
......
1514 1536

  
1515 1537
  $form->{fokus} = "ic.partnumber";
1516 1538

  
1539
  $form->{CUSTOM_VARIABLES} = CVar->get_custom_variables('module' => 'IC', 'trans_id' => $form->{id});
1540

  
1541
  CVar->render_inputs('variables' => $form->{CUSTOM_VARIABLES}) if (scalar @{ $form->{CUSTOM_VARIABLES} });
1542

  
1517 1543
  $form->header;
1518 1544
  #print $form->parse_html_template('ic/form_header', { ALL_PRICE_FACTORS => $form->{ALL_PRICE_FACTORS},
1519 1545
  #                                                     ALL_UNITS         => $form->{ALL_UNITS},

Auch abrufbar als: Unified diff