Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 8470071b

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

  • ID 8470071b1eea86117e6cece01bb5952c29a0cbc6
  • Vorgänger f7d51d3e
  • Nachfolger de90e717

Preisgruppen in all_parts Lieferanten

(Implementierung grösstenteils von Geoffrey, leicht modifiziert von mir)

Unterschiede anzeigen:

SL/IC.pm
1121 1121
    $form->{parts} = \@assemblies;
1122 1122
  }
1123 1123

  
1124
  if ($form->{l_pricegroups} ) {
1125
    my $query = <<SQL;
1126
       SELECT parts_id, price, pricegroup_id
1127
       FROM prices
1128
       WHERE parts_id = ?
1129
SQL
1130

  
1131
    my $sth = prepare_query($form, $dbh, $query);
1132

  
1133
    foreach my $part (@{ $form->{parts} }) {
1134
      do_statement($form, $sth, $query, conv_i($part->{id}));
1135

  
1136
      while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
1137
        $part->{"pricegroup_$ref->{pricegroup_id}"} = $ref->{price};
1138
      }
1139
      $sth->finish;
1140
    }
1141
  };
1142

  
1143

  
1124 1144
  $main::lxdebug->leave_sub();
1125 1145

  
1126 1146
  return wantarray ? @{ $form->{parts} } : $form->{parts};
bin/mozilla/ic.pl
1010 1010
#  bought sold onorder ordered rfq quoted
1011 1011
#  l_partnumber l_description l_serialnumber l_unit l_listprice l_sellprice l_lastcost
1012 1012
#  l_linetotal l_priceupdate l_bin l_rop l_weight l_image l_drawing l_microfiche
1013
#  l_partsgroup l_subtotal l_soldtotal l_deliverydate
1013
#  l_partsgroup l_subtotal l_soldtotal l_deliverydate l_pricegroups
1014 1014
#
1015 1015
# hiddens:
1016 1016
#  nextsub revers lastsort sort ndxs_counter
......
1220 1220
    transdate name serialnumber deliverydate ean projectnumber projectdescription
1221 1221
  );
1222 1222

  
1223
  my $pricegroups = SL::DB::Manager::Pricegroup->get_all(sort => 'id');
1224
  my @pricegroup_columns;
1225
  my %column_defs_pricegroups;
1226
  if ($form->{l_pricegroups}) {
1227
    @pricegroup_columns      = map { "pricegroup_" . $_->id } @{ $pricegroups };
1228
    %column_defs_pricegroups = map {
1229
      "pricegroup_" . $_->id => {
1230
        text    => $::locale->text('Pricegroup') . ' ' . $_->pricegroup,
1231
        visible => 1,
1232
      },
1233
    }  @{ $pricegroups };
1234
  }
1235
  push @columns, @pricegroup_columns;
1236

  
1223 1237
  my @includeable_custom_variables = grep { $_->{includeable} } @{ $cvar_configs };
1224 1238
  my @searchable_custom_variables  = grep { $_->{searchable} }  @{ $cvar_configs };
1225 1239
  my %column_defs_cvars            = map { +"cvar_$_->{name}" => { 'text' => $_->{description} } } @includeable_custom_variables;
1226 1240

  
1227 1241
  push @columns, map { "cvar_$_->{name}" } @includeable_custom_variables;
1228 1242

  
1229
  %column_defs = (%column_defs,%column_defs_cvars); # nochmal die cvars als überschrift hinzufügen
1230
    map { $column_defs{$_}->{visible} = $form->{"l_$_"} ? 1 : 0 } @columns;
1231
  map { $column_defs{$_}->{align}   = 'right' } qw(onhand sellprice listprice lastcost linetotalsellprice linetotallastcost linetotallistprice rop weight soldtotal);
1243
  %column_defs = (%column_defs, %column_defs_cvars, %column_defs_pricegroups);
1244
  map { $column_defs{$_}->{visible} ||= $form->{"l_$_"} ? 1 : 0 } @columns;
1245
  map { $column_defs{$_}->{align}   = 'right' } qw(onhand sellprice listprice lastcost linetotalsellprice linetotallastcost linetotallistprice rop weight soldtotal), @pricegroup_columns;
1232 1246

  
1233
  my @hidden_variables = (qw(l_subtotal l_linetotal searchitems itemstatus bom), @itemstatus_keys, @callback_keys,
1247
  my @hidden_variables = (qw(l_subtotal l_linetotal searchitems itemstatus bom l_pricegroups), @itemstatus_keys, @callback_keys,
1234 1248
                              map({ "cvar_$_->{name}" } @searchable_custom_variables), map { "l_$_" } @columns);
1249

  
1235 1250
  my $callback         = build_std_url('action=generate_report', grep { $form->{$_} } @hidden_variables);
1236 1251

  
1237 1252
  my @sort_full        = qw(partnumber description onhand soldtotal deliverydate);
......
1319 1334
      $row->{$_}{data}            = $form->format_amount(\%myconfig, $ref->{$_}, -2);
1320 1335
      $row->{"linetotal$_"}{data} = $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{$_}, 2);
1321 1336
    }
1337
    foreach ( @pricegroup_columns ) {
1338
      $row->{$_}{data}            = $form->format_amount(\%myconfig, $ref->{"$_"}, -2);
1339
    };
1340

  
1322 1341

  
1323 1342
    map { $row->{$_}{data} = $form->format_amount(\%myconfig, $ref->{$_}); } qw(onhand rop weight soldtotal);
1324 1343

  
templates/webpages/ic/search.html
281 281
           <input name="l_projectdescription" id="l_projectdescription" class="checkbox" type="checkbox" value="Y">
282 282
           <label for="l_projectdescription">[% 'Project Description' | $T8 %]</label>
283 283
          </td>
284
          <td>
285
           <input name="l_pricegroups" id="l_pricegroups" class="checkbox" type="checkbox" value="Y" checked>
286
           <label for="l_pricegroups">[% 'Pricegroups' | $T8 %]</label>
287
          </td>
284 288
         </tr>
285 289

  
286 290
         [% CUSTOM_VARIABLES_INCLUSION_CODE %]

Auch abrufbar als: Unified diff