Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 3bdd3642

Von Sven Schöling vor fast 13 Jahren hinzugefügt

  • ID 3bdd3642c42ea17756c46e8a5dabd1cf375c29a3
  • Vorgänger 750e2f1a
  • Nachfolger db8722a4

Nachtrag zu fef43fa: Zwischensumme muss nun über soldtotal aggregieren.

Unterschiede anzeigen:

bin/mozilla/ic.pl
1171 1171
  }
1172 1172

  
1173 1173
  if ($form->{l_linetotal}) {
1174
    $form->{l_onhand} = "Y";
1174
    $form->{l_qty} = "Y";
1175 1175
    $form->{l_linetotalsellprice} = "Y" if $form->{l_sellprice};
1176 1176
    $form->{l_linetotallastcost}  = $form->{searchitems} eq 'assembly' && !$form->{bom} ? "" : 'Y' if  $form->{l_lastcost};
1177 1177
    $form->{l_linetotallistprice} = "Y" if $form->{l_listprice};
......
1191 1191
        || $form->{ordered}
1192 1192
        || $form->{rfq}
1193 1193
        || $form->{quoted}) {
1194
      $form->{l_onhand} = "Y";
1194
#      $form->{l_onhand} = "Y";
1195 1195
    } else {
1196 1196
      $form->{l_linetotalsellprice} = "";
1197 1197
      $form->{l_linetotallastcost}  = "";
......
1290 1290
    $ref->{lastcost}      *= $ref->{exchangerate} / $ref->{price_factor};
1291 1291

  
1292 1292
    # use this for assemblies
1293
    my $onhand = $ref->{onhand};
1293
    my $soldtotal = $ref->{soldtotal};
1294 1294

  
1295 1295
    if ($ref->{assemblyitem}) {
1296 1296
      $row->{partnumber}{align}   = 'right';
1297
      $row->{onhand}{data}        = 0;
1298
      $onhand                     = 0 if ($form->{sold});
1297
      $row->{soldtotal}{data}     = 0;
1298
      $soldtotal                  = 0 if ($form->{sold});
1299 1299
    }
1300 1300

  
1301 1301
    my $edit_link               = build_std_url('action=edit', 'id=' . E($ref->{id}), 'callback');
......
1313 1313

  
1314 1314
    if (!$ref->{assemblyitem}) {
1315 1315
      foreach my $col (@subtotal_columns) {
1316
        $totals{$col}    += $onhand * $ref->{$col};
1317
        $subtotals{$col} += $onhand * $ref->{$col};
1316
        $totals{$col}    += $soldtotal * $ref->{$col};
1317
        $subtotals{$col} += $soldtotal * $ref->{$col};
1318 1318
      }
1319 1319

  
1320
      $subtotals{onhand} += $onhand;
1320
      $subtotals{soldtotal} += $soldtotal;
1321 1321
    }
1322 1322

  
1323 1323
    # set module stuff
......
1348 1348
      my $row = { map { $_ => { 'class' => 'listsubtotal', } } @columns };
1349 1349

  
1350 1350
      if (($form->{searchitems} ne 'assembly') || !$form->{bom}) {
1351
        $row->{onhand}->{data} = $form->format_amount(\%myconfig, $subtotals{onhand});
1351
        $row->{soldtotal}->{data} = $form->format_amount(\%myconfig, $subtotals{soldtotal});
1352 1352
      }
1353 1353

  
1354 1354
      map { $row->{"linetotal$_"}->{data} = $form->format_amount(\%myconfig, $subtotals{$_}, 2) } @subtotal_columns;
1355
      map { $subtotals{$_} = 0 } ('onhand', @subtotal_columns);
1355
      map { $subtotals{$_} = 0 } ('soldtotal', @subtotal_columns);
1356 1356

  
1357 1357
      $report->add_data($row);
1358 1358

  

Auch abrufbar als: Unified diff