]> wagnertech.de Git - mfinanz.git/blobdiff - SL/IS.pm
Mehr als eine SelfTest-Modul prüfen
[mfinanz.git] / SL / IS.pm
index 81869860339374ded4a76ef2f9d9cb4dbf81a36a..8700c4831b0363a207807804058db429c57a29d7 100644 (file)
--- a/SL/IS.pm
+++ b/SL/IS.pm
@@ -25,7 +25,8 @@
 # GNU General Public License for more details.
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1335, USA.
 #======================================================================
 #
 # Inventory invoicing module
@@ -149,7 +150,6 @@ sub invoice_details {
   # so that they can be sorted in later
   my %prepared_template_arrays = IC->prepare_parts_for_printing(myconfig => $myconfig, form => $form);
   my @prepared_arrays          = keys %prepared_template_arrays;
-  my @separate_totals          = qw(non_separate_subtotal);
 
   my $ic_cvar_configs = CVar->get_configs(module => 'IC');
   my $project_cvar_configs = CVar->get_configs(module => 'Projects');
@@ -333,17 +333,6 @@ sub invoice_details {
       push @{ $form->{TEMPLATE_ARRAYS}->{discount_nofmt} }, ($discount != 0) ? $discount * -1 : '';
       push @{ $form->{TEMPLATE_ARRAYS}->{p_discount} },     $form->{"discount_$i"};
 
-      if ( $prepared_template_arrays{separate}[$i - 1]  ) {
-        my $pabbr = $prepared_template_arrays{separate}[$i - 1];
-        if ( ! $form->{"separate_${pabbr}_subtotal"} ) {
-            push @separate_totals , "separate_${pabbr}_subtotal";
-            $form->{"separate_${pabbr}_subtotal"} = 0;
-        }
-        $form->{"separate_${pabbr}_subtotal"} += $linetotal;
-      } else {
-        $form->{non_separate_subtotal} += $linetotal;
-      }
-
       $form->{total}            += $linetotal;
       $form->{nodiscount_total} += $nodiscount_linetotal;
       $form->{discount_total}   += $discount;
@@ -551,7 +540,6 @@ sub invoice_details {
   $form->{delivery_term}->description_long($form->{delivery_term}->translated_attribute('description_long', $form->{language_id})) if $form->{delivery_term} && $form->{language_id};
 
   $form->{username} = $myconfig->{name};
-  $form->{$_} = $form->format_amount($myconfig, $form->{$_}, 2) for @separate_totals;
 
   $main::lxdebug->leave_sub();
 }
@@ -2016,7 +2004,6 @@ sub _retrieve_invoice {
            i.project_id, i.serialnumber, i.pricegroup_id, i.ordnumber, i.donumber, i.transdate, i.cusordnumber, i.subtotal, i.lastcost,
            i.price_factor_id, i.price_factor, i.marge_price_factor, i.active_price_source, i.active_discount_source,
            p.partnumber, p.part_type, p.notes AS partnotes, p.formel, p.listprice,
-           p.classification_id,
            pr.projectnumber, pg.partsgroup, prg.pricegroup
 
          FROM invoice i
@@ -2314,7 +2301,6 @@ sub retrieve_item {
          p.id, p.partnumber, p.description, p.sellprice,
          p.listprice, p.part_type, p.lastcost,
          p.ean, p.notes,
-         p.classification_id,
 
          c1.accno AS inventory_accno,
          c1.new_chart_id AS inventory_new_chart,
@@ -2334,7 +2320,7 @@ sub retrieve_item {
          p.price_factor_id, p.weight,
 
          pfac.factor AS price_factor,
-         pt.used_for_sale AS used_for_sale,
+
          pg.partsgroup
 
        FROM parts p
@@ -2351,7 +2337,6 @@ sub retrieve_item {
            FROM taxzone_charts tc
            WHERE tc.buchungsgruppen_id = p.buchungsgruppen_id and tc.taxzone_id = ${taxzone_id}) = c3.id)
        LEFT JOIN partsgroup pg ON (pg.id = p.partsgroup_id)
-       LEFT JOIN parts_classifications pt ON (pt.id = p.classification_id)
        LEFT JOIN price_factors pfac ON (pfac.id = p.price_factor_id)
        WHERE $where|;
   my $sth = prepare_execute_query($form, $dbh, $query, @values);
@@ -2369,7 +2354,6 @@ sub retrieve_item {
                                    LIMIT 1| ] );
   map { push @{ $_ }, prepare_query($form, $dbh, $_->[0]) } @translation_queries;
 
-  my $has_wrong_pclass = 0;
   while (my $ref = $sth->fetchrow_hashref('NAME_lc')) {
 
     if ($mm_by_id{$ref->{id}}) {
@@ -2381,12 +2365,6 @@ sub retrieve_item {
       push @{ $ref->{matches} ||= [] }, $::locale->text('EAN') . ': ' . $ref->{ean};
     }
 
-    $ref->{type_and_classific} = $::request->presenter->type_abbreviation($ref->{part_type}).
-                                 $::request->presenter->classification_abbreviation($ref->{classification_id});
-    if (! $ref->{used_for_sale} ) {
-        $has_wrong_pclass = 1;
-        next;
-    }
     # In der Buchungsgruppe ist immer ein Bestandskonto verknuepft, auch wenn
     # es sich um eine Dienstleistung handelt. Bei Dienstleistungen muss das
     # Buchungskonto also aus dem Ergebnis rausgenommen werden.
@@ -2470,15 +2448,15 @@ sub retrieve_item {
   $sth->finish;
   $_->[1]->finish for @translation_queries;
 
-  $form->{is_wrong_pclass} = $has_wrong_pclass;
   foreach my $item (@{ $form->{item_list} }) {
     my $custom_variables = CVar->get_custom_variables(module   => 'IC',
                                                       trans_id => $item->{id},
                                                       dbh      => $dbh,
                                                      );
-    $form->{is_wrong_pclass} = 0; # one correct type
+
     map { $item->{"ic_cvar_" . $_->{name} } = $_->{value} } @{ $custom_variables };
   }
+
   $main::lxdebug->leave_sub();
 }