Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision d919a7dc

Von Jan Büren vor mehr als 3 Jahren hinzugefügt

  • ID d919a7dcc958edf6c7cd2546690347ea9c157f6e
  • Vorgänger 31caad01
  • Nachfolger 94955cef

all_parts Erzeugnis EK als separate Spalte im Bericht

Problem: Bei der Mischauswahl von Waren und Erzeugnissen in
dem Bericht erscheinen dann Waren mit dem EK des Erzeugnisses, der
ggf. 0 sein kann. Das irritiert stark, deswegen lieber eine extra
Spalte für den Erzeugnis-Fall spendieren und den EK bei Waren als
Spalte so lassen.

Unterschiede anzeigen:

SL/IC.pm
272 272
    insertdate         => 'itime::DATE',
273 273
  );
274 274

  
275
  if ($form->{l_assembly} && $form->{l_lastcost}) {
276
    @simple_l_switches = grep { $_ ne 'lastcost' } @simple_l_switches;
277 275
  }
278 276

  
279 277
  my $make_token_builder = sub {
......
402 400
        FROM assembly a_lc
403 401
        LEFT JOIN parts p_lc            ON (a_lc.parts_id        = p_lc.id)
404 402
        LEFT JOIN price_factors pfac_lc ON (p_lc.price_factor_id = pfac_lc.id)
405
        WHERE (a_lc.id = p.id)) AS lastcost|;
403
        WHERE (a_lc.id = p.id)) AS assembly_lastcost|;
406 404
  $table_prefix{$q_assembly_lastcost} = ' ';
407 405

  
408 406
  # special case makemodel search
bin/mozilla/ic.pl
177 177
    'insertdate'         => { 'text' => $locale->text('Insert Date'), },
178 178
    'invnumber'          => { 'text' => $locale->text('Invoice Number'), },
179 179
    'lastcost'           => { 'text' => $locale->text('Last Cost'), },
180
    'assembly_lastcost'  => { 'text' => $locale->text('Assembly Last Cost'), },
180 181
    'linetotallastcost'  => { 'text' => $locale->text('Extended'), },
181 182
    'linetotallistprice' => { 'text' => $locale->text('Extended'), },
182 183
    'linetotalsellprice' => { 'text' => $locale->text('Extended'), },
......
321 322
    $column_defs{sellprice}{text} = $locale->text('Price');
322 323
    $form->{l_lastcost} = ""
323 324
  }
325
  $form->{l_assembly_lastcost} = "Y" if $form->{l_assembly} && $form->{l_lastcost};
324 326

  
325 327
  if ($form->{description}) {
326 328
    $description = $form->{description};
......
388 390
  my @columns = qw(
389 391
    partnumber type_and_classific description notes partsgroup warehouse bin
390 392
    make model onhand rop soldtotal unit listprice
391
    linetotallistprice sellprice linetotalsellprice lastcost linetotallastcost
393
    linetotallistprice sellprice linetotalsellprice lastcost assembly_lastcost linetotallastcost
392 394
    priceupdate weight image drawing microfiche invnumber ordnumber quonumber
393 395
    transdate name serialnumber deliverydate ean projectnumber projectdescription
394 396
    insertdate shop
......
416 418

  
417 419
  %column_defs = (%column_defs, %column_defs_cvars, %column_defs_pricegroups);
418 420
  map { $column_defs{$_}->{visible} ||= $form->{"l_$_"} ? 1 : 0 } @columns;
419
  map { $column_defs{$_}->{align}   = 'right' } qw(onhand sellprice listprice lastcost linetotalsellprice linetotallastcost linetotallistprice rop weight soldtotal shop), @pricegroup_columns;
421
  map { $column_defs{$_}->{align}   = 'right' } qw(onhand sellprice listprice lastcost assembly_lastcost linetotalsellprice linetotallastcost linetotallistprice rop weight soldtotal shop), @pricegroup_columns;
420 422

  
421 423
  my @hidden_variables = (
422 424
    qw(l_subtotal l_linetotal searchitems itemstatus bom l_pricegroups insertdatefrom insertdateto),
......
501 503
    $ref->{sellprice}     *= $ref->{exchangerate} / $ref->{price_factor};
502 504
    $ref->{listprice}     *= $ref->{exchangerate} / $ref->{price_factor};
503 505
    $ref->{lastcost}      *= $ref->{exchangerate} / $ref->{price_factor};
506
    $ref->{assembly_lastcost} *= $ref->{exchangerate} / $ref->{price_factor};
504 507

  
505 508
    # use this for assemblies
506 509
    my $soldtotal = $bsooqr_mode ? $ref->{soldtotal} : $ref->{onhand};
......
515 518
    $row->{partnumber}->{link}  = $edit_link;
516 519
    $row->{description}->{link} = $edit_link;
517 520

  
518
    foreach (qw(sellprice listprice lastcost)) {
521
    foreach (qw(sellprice listprice lastcost assembly_lastcost)) {
519 522
      $row->{$_}{data}            = $form->format_amount(\%myconfig, $ref->{$_}, 2);
520 523
      $row->{"linetotal$_"}{data} = $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{$_}, 2);
521 524
    }

Auch abrufbar als: Unified diff