Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 5a618706

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

  • ID 5a618706a76c255d27288805c6fdd1f113f73183
  • Vorgänger c4a68243
  • Nachfolger 94a76a6d

orderitems um Attribut optional erweitert

Optionale orderitems werden nicht in den Belegsumme aufaddiert
Anpassung für Order-Controller und Druckvorlagen-System
Weitere Anwender-Details s.a. Changelog

Unterschiede anzeigen:

SL/OE.pm
1366 1366
       partnotes serialnumber reqdate sellprice sellprice_nofmt listprice listprice_nofmt netprice netprice_nofmt
1367 1367
       discount discount_nofmt p_discount discount_sub discount_sub_nofmt nodiscount_sub nodiscount_sub_nofmt
1368 1368
       linetotal linetotal_nofmt nodiscount_linetotal nodiscount_linetotal_nofmt tax_rate projectnumber projectdescription
1369
       price_factor price_factor_name partsgroup weight weight_nofmt lineweight lineweight_nofmt);
1369
       price_factor price_factor_name partsgroup weight weight_nofmt lineweight lineweight_nofmt optional);
1370 1370

  
1371 1371
  push @arrays, map { "ic_cvar_$_->{name}" } @{ $ic_cvar_configs };
1372 1372
  push @arrays, map { "project_cvar_$_->{name}" } @{ $project_cvar_configs };
......
1433 1433
      push @{ $form->{TEMPLATE_ARRAYS}->{price_factor} },      $price_factor->{formatted_factor};
1434 1434
      push @{ $form->{TEMPLATE_ARRAYS}->{price_factor_name} }, $price_factor->{description};
1435 1435
      push @{ $form->{TEMPLATE_ARRAYS}->{partsgroup} },        $form->{"partsgroup_$i"};
1436
      push @{ $form->{TEMPLATE_ARRAYS}->{optional} },          $form->{"optional_$i"};
1436 1437

  
1437 1438
      my $sellprice     = $form->parse_amount($myconfig, $form->{"sellprice_$i"});
1438 1439
      my ($dec)         = ($sellprice =~ /\.(\d+)/);
......
1472 1473
        $form->{non_separate_subtotal} += $linetotal;
1473 1474
      }
1474 1475

  
1475
      $form->{ordtotal}         += $linetotal;
1476
      $form->{ordtotal}         += $linetotal unless $form->{"optional_$i"};
1476 1477
      $form->{nodiscount_total} += $nodiscount_linetotal;
1477 1478
      $form->{discount_total}   += $discount;
1478 1479

  
......
1520 1521

  
1521 1522
      map { $taxrate += $form->{"${_}_rate"} } split(/ /, $form->{"taxaccounts_$i"});
1522 1523

  
1523
      if ($form->{taxincluded}) {
1524
      unless ($form->{"optional_$i"}) {
1525
        if ($form->{taxincluded}) {
1524 1526

  
1525
        # calculate tax
1526
        $taxamount = $linetotal * $taxrate / (1 + $taxrate);
1527
        $taxbase = $linetotal / (1 + $taxrate);
1528
      } else {
1529
        $taxamount = $linetotal * $taxrate;
1530
        $taxbase   = $linetotal;
1527
          # calculate tax
1528
          $taxamount = $linetotal * $taxrate / (1 + $taxrate);
1529
          $taxbase = $linetotal / (1 + $taxrate);
1530
        } else {
1531
          $taxamount = $linetotal * $taxrate;
1532
          $taxbase   = $linetotal;
1533
        }
1531 1534
      }
1532 1535

  
1533 1536
      if ($taxamount != 0) {

Auch abrufbar als: Unified diff