]> wagnertech.de Git - kivitendo-erp.git/commitdiff
Merge von 599-602,605,614,615 aus unstable: Preisgruppen Teil 1
authorStephan Köhler <s.koehler@linet-services.de>
Fri, 25 Nov 2005 12:52:34 +0000 (12:52 +0000)
committerStephan Köhler <s.koehler@linet-services.de>
Fri, 25 Nov 2005 12:52:34 +0000 (12:52 +0000)
--Preisgruppenerweiterung auf Basis von Andres Patch - Thanks
 -Preisgruppenverwaltung
 -Preiseingabe der Preisgruppen in Masken Waren,etc.
 -Auswahl der Preisgruppen in den Verkaufsmasken
 -Erweiterung Datenbankschema
 -Übersetzungen für Preisgruppen
 -Bugfix Preisgruppen, in der Warenmaske zeigte er eine Preisgruppe a
 "Gruppe 1" als "Gruppe" an
 -Anpassung locale
--Fehler bei negativen Umsaetzen behoben
--Fehler beim Speichern von Rechnungen und Angeboten/Auftraegen wenn keine Preisgruppen vorhanden
--Fehler bei Drucken und Buchen und Preisgruppen behoben, Preisgruppen Quelltext ein wenig modifiziert

33 files changed:
SL/CT.pm
SL/Form.pm
SL/IC.pm
SL/IS.pm
SL/OE.pm
SL/PE.pm
bin/mozilla/ct.pl
bin/mozilla/ic.pl
bin/mozilla/io.pl
bin/mozilla/ir.pl
bin/mozilla/is.pl
bin/mozilla/oe.pl
bin/mozilla/pe.pl
locale/de/all
locale/de/ap
locale/de/ar
locale/de/bp
locale/de/ca
locale/de/ct
locale/de/gl
locale/de/ic
locale/de/io
locale/de/ir
locale/de/is
locale/de/menu
locale/de/menunew
locale/de/oe
locale/de/pe
locale/de/rc
locale/de/rp
menu.ini
sql/Pg-upgrade-2.1.1-2.1.2.sql
sql/lx-office.sql

index c6f55da3b00701a633e0f548ea8fa47076869939..1db023b986af0f3b27bd7079363cd316ccd1709b 100644 (file)
--- a/SL/CT.pm
+++ b/SL/CT.pm
@@ -221,16 +221,21 @@ sub save_customer {
 
   my ($self, $myconfig, $form) = @_;
 
 
   my ($self, $myconfig, $form) = @_;
 
+  # set pricegroup to default
+  if ($form->{klass}) { }
+  else { $form->{klass} = 0; }
+
   # connect to database
   my $dbh = $form->dbconnect($myconfig);
 ##LINET
   # connect to database
   my $dbh = $form->dbconnect($myconfig);
 ##LINET
-  map({ $form->{"cp_${_}"} = $form->{"selected_cp_${_}"}
-          if ($form->{"selected_cp_${_}"});
+  map({
+      $form->{"cp_${_}"} = $form->{"selected_cp_${_}"}
+        if ($form->{"selected_cp_${_}"});
   } qw(title greeting));
   } qw(title greeting));
-
+#
   # escape '
   map { $form->{$_} =~ s/\'/\'\'/g }
   # escape '
   map { $form->{$_} =~ s/\'/\'\'/g }
-    qw(customernumber name street zipcode city country homepage contact notes cp_title cp_greeting language);
+    qw(customernumber name street zipcode city country homepage contact notes cp_title cp_greeting language pricegroup);
 ##/LINET
   # assign value discount, terms, creditlimit
   $form->{discount} = $form->parse_amount($myconfig, $form->{discount});
 ##/LINET
   # assign value discount, terms, creditlimit
   $form->{discount} = $form->parse_amount($myconfig, $form->{discount});
@@ -314,7 +319,8 @@ sub save_customer {
               username = '$form->{username}',
               salesman_id = '$form->{salesman_id}',
               user_password = '$form->{user_password}',
               username = '$form->{username}',
               salesman_id = '$form->{salesman_id}',
               user_password = '$form->{user_password}',
-              c_vendor_id = '$form->{c_vendor_id}'
+              c_vendor_id = '$form->{c_vendor_id}',
+              klass = '$form->{klass}'
              WHERE id = $form->{id}|;
   $dbh->do($query) || $form->dberror($query);
 
              WHERE id = $form->{id}|;
   $dbh->do($query) || $form->dberror($query);
 
@@ -362,8 +368,9 @@ sub save_vendor {
   # connect to database
   my $dbh = $form->dbconnect($myconfig);
 ##LINET
   # connect to database
   my $dbh = $form->dbconnect($myconfig);
 ##LINET
-  map({ $form->{"cp_${_}"} = $form->{"selected_cp_${_}"}
-          if ($form->{"selected_cp_${_}"});
+  map({
+      $form->{"cp_${_}"} = $form->{"selected_cp_${_}"}
+        if ($form->{"selected_cp_${_}"});
   } qw(title greeting));
 
   # escape '
   } qw(title greeting));
 
   # escape '
index d6cbc0b7c792f266c9401957c02349a48aad4c87..21508383067ac8023d3f6d64fec8cb82a5374ea3 100644 (file)
@@ -382,8 +382,8 @@ function fokus(){document.$self->{fokus}.focus();}
       $jsscript = qq|
         <style type="text/css">\@import url(js/jscalendar/calendar-win2k-1.css);</style>
         <script type="text/javascript" src="js/jscalendar/calendar.js"></script>
       $jsscript = qq|
         <style type="text/css">\@import url(js/jscalendar/calendar-win2k-1.css);</style>
         <script type="text/javascript" src="js/jscalendar/calendar.js"></script>
-        <script type="text/javascript" src="js/jscalendar/lang/calendar-de.js"></script>
-        <script type="text/javascript" src="js/jscalendar/calendar-setup.js"></script>
+        <script type="text/javascript" src="js/jscalendar/lang/calendar-de.js"></script>
+        <script type="text/javascript" src="js/jscalendar/calendar-setup.js"></script>
         $self->{javascript}
        |;
     }
         $self->{javascript}
        |;
     }
@@ -450,25 +450,25 @@ sub write_trigger {
 
   $trigger_1 = qq|
        Calendar.setup(
 
   $trigger_1 = qq|
        Calendar.setup(
-       {
-         inputField  : "$inputField_1",
-         ifFormat    :"$ifFormat",
-         align    : "$align_1",     
-         button      : "$button_1"
-       }
-       );
+      {
+      inputField : "$inputField_1",
+      ifFormat :"$ifFormat",
+      align : "$align_1", 
+      button : "$button_1"
+      }
+      );
        |;
 
   if ($qty == 2) {
     $trigger_2 = qq|
        Calendar.setup(
        {
        |;
 
   if ($qty == 2) {
     $trigger_2 = qq|
        Calendar.setup(
        {
-         inputField  : "$inputField_2",
-         ifFormat    :"$ifFormat",
-         align    : "$align_2",     
-         button      : "$button_2"
-       }
-       );
+      inputField : "$inputField_2",
+      ifFormat :"$ifFormat",
+      align : "$align_2", 
+      button : "$button_2"
+      }
+      );
         |;
   }
   $jsscript = qq|
         |;
   }
   $jsscript = qq|
@@ -2120,6 +2120,38 @@ sub get_partsgroup {
 }
 
 
 }
 
 
+sub get_pricegroup {
+  $main::lxdebug->enter_sub();
+
+  my ($self, $myconfig, $p) = @_;
+
+  my $dbh = $self->dbconnect($myconfig);
+
+  my $query = qq|SELECT p.id, p.pricegroup
+                 FROM pricegroup p|;
+
+  $query .= qq|
+                ORDER BY pricegroup|;
+
+  if ($p->{all}) {
+    $query = qq|SELECT id, pricegroup FROM pricegroup
+                ORDER BY pricegroup|;
+  }
+
+  my $sth = $dbh->prepare($query);
+  $sth->execute || $self->dberror($query);
+
+  $self->{all_pricegroup} = ();
+  while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+    push @{ $self->{all_pricegroup} }, $ref;
+  }
+  $sth->finish;
+  $dbh->disconnect;
+
+  $main::lxdebug->leave_sub();
+}
+
+
 sub audittrail {
   my ($self, $dbh, $myconfig, $audittrail) = @_;
   
 sub audittrail {
   my ($self, $dbh, $myconfig, $audittrail) = @_;
   
index 48c799675850c49ba7a830b537e0ceec94f77d3d..2a75da20e0e8d2aabb9ded9152b58b9f77a34834 100644 (file)
--- a/SL/IC.pm
+++ b/SL/IC.pm
@@ -33,7 +33,7 @@
 #======================================================================
 
 package IC;
 #======================================================================
 
 package IC;
-
+use Data::Dumper;
 sub get_part {
   $main::lxdebug->enter_sub();
 
 sub get_part {
   $main::lxdebug->enter_sub();
 
@@ -101,6 +101,76 @@ sub get_part {
   $form->{amount}{IC_expense} = $form->{expense_accno};
   $form->{amount}{IC_cogs}    = $form->{expense_accno};
 
   $form->{amount}{IC_expense} = $form->{expense_accno};
   $form->{amount}{IC_cogs}    = $form->{expense_accno};
 
+  # get prices
+  $query =
+    qq|SELECT p.parts_id, p.pricegroup_id, p.price, (SELECT pg.pricegroup FROM pricegroup pg WHERE pg.id=p.pricegroup_id) AS pricegroup FROM prices p
+              WHERE parts_id = $form->{id}
+              ORDER by pricegroup|;
+
+  $sth = $dbh->prepare($query);
+  $sth->execute || $form->dberror($query);
+
+  @pricegroups          = ();
+  @pricegroups_not_used = ();
+
+  #for pricegroups
+  my $i = 1;
+  while (
+         ($form->{"klass_$i"}, $form->{"pricegroup_id_$i"},
+          $form->{"price_$i"}, $form->{"pricegroup_$i"})
+         = $sth->fetchrow_array
+    ) {
+    $form->{"price_$i"} = $form->round_amount($form->{"price_$i"}, 5);
+    $form->{"price_$i"} =
+      $form->format_amount($myconfig, $form->{"price_$i"}, 5);
+    push @pricegroups, $form->{"pricegroup_id_$i"};
+    $i++;
+  }
+
+  $sth->finish;
+
+  # get pricegroups
+  $query = qq|SELECT p.id, p.pricegroup FROM pricegroup p|;
+
+  $pkq = $dbh->prepare($query);
+  $pkq->execute || $form->dberror($query);
+  while ($pkr = $pkq->fetchrow_hashref(NAME_lc)) {
+    push @{ $form->{PRICEGROUPS} }, $pkr;
+  }
+  $pkq->finish;
+
+  #find not used pricegroups
+  while ($tmp = pop @{ $form->{PRICEGROUPS} }) {
+    my $insert = 0;
+    foreach $item (@pricegroups) {
+      if ($item eq $tmp->{id}) {
+
+        #drop
+        $insert = 1;
+      }
+    }
+    if ($insert == 0) {
+      push @pricegroups_not_used, $tmp;
+    }
+  }
+
+  # if not used pricegroups are avaible
+  if (@pricegroups_not_used) {
+
+    foreach $name (@pricegroups_not_used) {
+      $form->{"klass_$i"} = "$name->{id}";
+      $form->{"price_$i"} = $form->round_amount($form->{sellprice}, 5);
+      $form->{"price_$i"} =
+        $form->format_amount($myconfig, $form->{"price_$i"}, 5);
+      $form->{"pricegroup_id_$i"} = "$name->{id}";
+      $form->{"pricegroup_$i"}    = "$name->{pricegroup}\n";
+      $i++;
+    }
+  }
+
+  #correct rows
+  $form->{price_rows} = $i - 1;
+
   unless ($form->{item} eq 'service') {
 
     # get makes
   unless ($form->{item} eq 'service') {
 
     # get makes
@@ -161,6 +231,52 @@ sub get_part {
   $main::lxdebug->leave_sub();
 }
 
   $main::lxdebug->leave_sub();
 }
 
+sub get_pricegroups {
+  $main::lxdebug->enter_sub();
+
+  my ($self, $myconfig, $form) = @_;
+  my $dbh = $form->dbconnect($myconfig);
+  my $i = 1;
+  my @pricegroups_not_used = ();
+
+  # get pricegroups
+  my $query = qq|SELECT p.id, p.pricegroup FROM pricegroup p|;
+
+  my $pkq = $dbh->prepare($query);
+  $pkq->execute || $form->dberror($query);
+  while ($pkr = $pkq->fetchrow_hashref(NAME_lc)) {
+    push @{ $form->{PRICEGROUPS} }, $pkr;
+  }
+  $pkq->finish;
+
+  #find not used pricegroups
+  while ($tmp = pop @{ $form->{PRICEGROUPS} }) {
+    push @pricegroups_not_used, $tmp;
+  }
+
+  # if not used pricegroups are avaible
+  if (@pricegroups_not_used) {
+
+    foreach $name (@pricegroups_not_used) {
+      $form->{"klass_$i"} = "$name->{id}";
+      $form->{"price_$i"} = $form->round_amount($form->{sellprice}, 5);
+      $form->{"price_$i"} =
+        $form->format_amount($myconfig, $form->{"price_$i"}, 5);
+      $form->{"pricegroup_id_$i"} = "$name->{id}";
+      $form->{"pricegroup_$i"}    = "$name->{pricegroup}\n";
+      $i++;
+    }
+  }
+
+  #correct rows
+  $form->{price_rows} = $i - 1;
+
+  $dbh->disconnect;
+
+  $main::lxdebug->leave_sub();
+}
+
+
 sub save {
   $main::lxdebug->enter_sub();
 
 sub save {
   $main::lxdebug->enter_sub();
 
@@ -332,6 +448,29 @@ sub save {
              WHERE id = $form->{id}|;
   $dbh->do($query) || $form->dberror($query);
 
              WHERE id = $form->{id}|;
   $dbh->do($query) || $form->dberror($query);
 
+  # delete price records
+  $query = qq|DELETE FROM prices
+              WHERE parts_id = $form->{id}|;
+  $dbh->do($query) || $form->dberror($query);
+
+  # insert price records only if different to sellprice
+  for my $i (1 .. $form->{price_rows}) {
+    if ($form->{"price_$i"} eq "0") {
+       $form->{"price_$i"} = $form->{sellprice};
+    }
+    if ((   $form->{"price_$i"} 
+        || $form->{"klass_$i"}
+        || $form->{"pricegroup_id_$i"}) and $form->{"price_$i"} != $form->{sellprice}) {
+      $klass = $form->parse_amount($myconfig, $form->{"klass_$i"});
+      $price = $form->parse_amount($myconfig, $form->{"price_$i"});
+      $pricegroup_id =
+        $form->parse_amount($myconfig, $form->{"pricegroup_id_$i"});
+      $query = qq|INSERT INTO prices (parts_id, pricegroup_id, price)
+                  VALUES($form->{id},$pricegroup_id,$price)|;
+      $dbh->do($query) || $form->dberror($query);
+    }
+  }
+
   # insert makemodel records
   unless ($form->{item} eq 'service') {
     for my $i (1 .. $form->{makemodel_rows}) {
   # insert makemodel records
   unless ($form->{item} eq 'service') {
     for my $i (1 .. $form->{makemodel_rows}) {
index eac4440ae513329182f29f1d103c84bfe8d4179d..540c874e5a7f2f77d908ed6afe120de7485e73b8 100644 (file)
--- a/SL/IS.pm
+++ b/SL/IS.pm
@@ -34,6 +34,8 @@
 
 package IS;
 
 
 package IS;
 
+use Data::Dumper;
+
 sub invoice_details {
   $main::lxdebug->enter_sub();
 
 sub invoice_details {
   $main::lxdebug->enter_sub();
 
@@ -365,7 +367,7 @@ sub customer_details {
 
 sub post_invoice {
   $main::lxdebug->enter_sub();
 
 sub post_invoice {
   $main::lxdebug->enter_sub();
-
+print STDERR "IS.pm-post_invoice\n";
   my ($self, $myconfig, $form) = @_;
 
   # connect to database, turn off autocommit
   my ($self, $myconfig, $form) = @_;
 
   # connect to database, turn off autocommit
@@ -549,16 +551,22 @@ sub post_invoice {
         ? qq|'$form->{"deliverydate_$i"}'|
         : "NULL";
 
         ? qq|'$form->{"deliverydate_$i"}'|
         : "NULL";
 
+
+      # get pricegroup_id and save ist
+      ($null, my $pricegroup_id) = split /--/, $form->{"sellprice_drag_$i"};
+      $pricegroup_id *= 1;
+
       # save detail record in invoice table
       $query = qq|INSERT INTO invoice (trans_id, parts_id, description, qty,
                   sellprice, fxsellprice, discount, allocated, assemblyitem,
       # save detail record in invoice table
       $query = qq|INSERT INTO invoice (trans_id, parts_id, description, qty,
                   sellprice, fxsellprice, discount, allocated, assemblyitem,
-                 unit, deliverydate, project_id, serialnumber)
+                 unit, deliverydate, project_id, serialnumber, pricegroup_id)
                  VALUES ($form->{id}, $form->{"id_$i"},
                  '$form->{"description_$i"}', $form->{"qty_$i"},
                  $form->{"sellprice_$i"}, $fxsellprice,
                  $form->{"discount_$i"}, $allocated, 'f',
                  '$form->{"unit_$i"}', $deliverydate, (SELECT id from project where projectnumber = '$project_id'),
                  VALUES ($form->{id}, $form->{"id_$i"},
                  '$form->{"description_$i"}', $form->{"qty_$i"},
                  $form->{"sellprice_$i"}, $fxsellprice,
                  $form->{"discount_$i"}, $allocated, 'f',
                  '$form->{"unit_$i"}', $deliverydate, (SELECT id from project where projectnumber = '$project_id'),
-                 '$form->{"serialnumber_$i"}')|;
+                 '$form->{"serialnumber_$i"}',
+      '$pricegroup_id')|;
       $dbh->do($query) || $form->dberror($query);
 
       if ($form->{lizenzen}) {
       $dbh->do($query) || $form->dberror($query);
 
       if ($form->{lizenzen}) {
@@ -1105,7 +1113,7 @@ sub delete_invoice {
 
 sub retrieve_invoice {
   $main::lxdebug->enter_sub();
 
 sub retrieve_invoice {
   $main::lxdebug->enter_sub();
-
+print STDERR "IS.pm-retrieve_invoice\n";
   my ($self, $myconfig, $form) = @_;
 
   # connect to database
   my ($self, $myconfig, $form) = @_;
 
   # connect to database
@@ -1211,7 +1219,7 @@ sub retrieve_invoice {
                i.discount, i.parts_id AS id, i.unit, i.deliverydate,
                i.project_id, pr.projectnumber, i.serialnumber,
                p.partnumber, p.assembly, p.bin, p.notes AS partnotes, i.id AS invoice_pos,
                i.discount, i.parts_id AS id, i.unit, i.deliverydate,
                i.project_id, pr.projectnumber, i.serialnumber,
                p.partnumber, p.assembly, p.bin, p.notes AS partnotes, i.id AS invoice_pos,
-               pg.partsgroup
+               pg.partsgroup, i.pricegroup_id, (SELECT pricegroup FROM pricegroup WHERE id=i.pricegroup_id) as pricegroup
                FROM invoice i
                JOIN parts p ON (i.parts_id = p.id)
                LEFT JOIN project pr ON (i.project_id = pr.id)
                FROM invoice i
                JOIN parts p ON (i.parts_id = p.id)
                LEFT JOIN project pr ON (i.project_id = pr.id)
@@ -1306,7 +1314,7 @@ sub get_customer {
                  c.email, c.cc, c.bcc, c.language,
                 c.street, c.zipcode, c.city, c.country,
                 $duedate + c.terms AS duedate, c.notes AS intnotes,
                  c.email, c.cc, c.bcc, c.language,
                 c.street, c.zipcode, c.city, c.country,
                 $duedate + c.terms AS duedate, c.notes AS intnotes,
-                b.discount AS tradediscount, b.description AS business
+                b.discount AS tradediscount, b.description AS business, c.klass as customer_klass
                  FROM customer c
                 LEFT JOIN business b ON (b.id = c.business_id)
                 WHERE c.id = $form->{customer_id}|;
                  FROM customer c
                 LEFT JOIN business b ON (b.id = c.business_id)
                 WHERE c.id = $form->{customer_id}|;
@@ -1513,7 +1521,6 @@ sub retrieve_item {
         $stw->finish;
       }
     }
         $stw->finish;
       }
     }
-
   }
   $sth->finish;
   $dbh->disconnect;
   }
   $sth->finish;
   $dbh->disconnect;
@@ -1521,6 +1528,154 @@ sub retrieve_item {
   $main::lxdebug->leave_sub();
 }
 
   $main::lxdebug->leave_sub();
 }
 
+##########################
+# get pricegroups from database
+# build up selected pricegroup
+# if an exchange rate - change price 
+# for each part
+#
+sub get_pricegroups_for_parts {
+print STDERR "IS.pm - get_pricegroups_for_parts\n";
+  $main::lxdebug->enter_sub();
+
+  my ($self, $myconfig, $form) = @_;
+
+  my $dbh = $form->dbconnect($myconfig);
+
+  my $i  = 1;
+  my $id = 0;
+
+  while (($form->{"id_$i"}) or ($form->{"new_id_$i"})) {
+
+    $id = $form->{"id_$i"};
+
+    if (!($form->{"id_$i"}) and $form->{"new_id_$i"}) {
+
+      $id = $form->{"new_id_$i"};
+    }
+
+    ($price, $selectedpricegroup_id) = split /--/, $form->{"sellprice_drag_$i"};
+#  print (STDERR "sellprice_drag_$i", Dumper($form->{"sellprice_drag_$i"}));
+
+    $pricegroup_old = $form->{"pricegroup_old_$i"};
+#  print (STDERR "pricegroup_old_i-$i", Dumper($pricegroup_old));
+
+    $price_new = $form->{"price_new_$i"};
+
+    $price_old = $form->{"price_old_$i"};
+
+    $query = qq|SELECT pricegroup_id, (SELECT p.sellprice from parts p where p.id = $id) as default_sellprice,(SELECT pg.pricegroup FROM pricegroup pg WHERE id=pricegroup_id) AS pricegroup, price, '' AS selected FROM prices WHERE parts_id = $id UNION SELECT 0 as pricegroup_id,(SELECT sellprice FROM parts WHERE id=$id) as default_sellprice,'' as pricegroup, (SELECT DISTINCT sellprice from parts where id=$id) as price, 'selected' AS selected from prices ORDER BY pricegroup|;
+
+    $pkq = $dbh->prepare($query);
+    $pkq->execute || $form->dberror($query);
+    while ($pkr = $pkq->fetchrow_hashref(NAME_lc)) {
+#       push @{ $form->{PRICES}{$id} }, $pkr;
+        push @{ $form->{PRICES}{$i} }, $pkr;
+        $pkr->{id} = $id;
+        $pkr->{selected}  = '';
+
+    # if there is an exchange rate change price
+      if (($form->{exchangerate} * 1) != 0) {
+# print STDERR "WECHSELKURS?-$form->{exchangerate}\n";
+        $pkr->{price} /= $form->{exchangerate};
+      }
+      $pkr->{price} = $form->format_amount($myconfig,$pkr->{price},5);
+
+
+      if ($selectedpricegroup_id eq undef) {
+        if ($pkr->{pricegroup_id} eq $form->{customer_klass}) {
+print STDERR "   INIT ROW \n";
+#print (STDERR "   PREIS", Dumper($pkr->{price}));
+          $pkr->{selected}  = ' selected';
+          $last->{selected} = '';
+# print (STDERR "   SELLPRICE", Dumper($form->{"sellprice_$i"}));
+
+        # no customer pricesgroup set 
+          if ($pkr->{price} == $pkr->{default_sellprice}) {
+print (STDERR "   PREIS IST DEFAULT-SELLPRICE", Dumper($form->{"sellprice_$i"}));
+           $pkr->{price} = $form->{"sellprice_$i"};
+
+#  if ($form->{tradediscount}){
+#  print (STDERR "TRADE--", Dumper($pkr->{price}));
+#               $pkr->{price} =$pkr->{price} * (1 - $form->{tradediscount});
+#               $pkr->{price} = $form->format_amount($myconfig,$pkr->{price},5);
+#  print (STDERR "TRADE--", Dumper($pkr->{price}));
+#  }
+
+          } else {
+print STDERR "   PREIS IST NICHT NULL\n";
+             $form->{"sellprice_$i"} = $pkr->{price};
+          }
+# print (STDERR "           PRICE", Dumper($pkr->{price}));
+
+        } else {
+print STDERR "   INIT ROW but what\n";
+print (STDERR "   PREIS -", Dumper($pkr->{price}), "Default", Dumper($pkr->{default_sellprice}));
+          if ($pkr->{price} == $pkr->{default_sellprice}) {
+print (STDERR "   PREIS IST DEFAULT-", Dumper($form->{"sellprice_$i"}));
+            $pkr->{price} = $form->{"sellprice_$i"};
+            $pkr->{selected}                    = ' selected';
+          }
+        }
+      }
+      if ($selectedpricegroup_id or $selectedpricegroup_id == 0){
+        if ($selectedpricegroup_id ne $pricegroup_old) {
+          if ($pkr->{pricegroup_id} eq $selectedpricegroup_id) {
+            if ($price_new != $form->{"sellprice_$i"}) {
+print STDERR "   MANUELLEN PREIS WÄHLEN\n";
+            } else {
+print STDERR "   UPDATE CHANGE PRICEGROUP\n";
+              $pkr->{selected}                    = ' selected';
+              $last->{selected}                   = '';
+#$form->{"pricegroup_old_$i"} = $pkr->{$pricegroup_id};
+            }
+          }
+        } else { 
+          if (($price_new != $form->{"sellprice_$i"}) and ($price_new ne 0)) {
+            if ($pkr->{pricegroup_id} == 0) {
+print STDERR "   UPDATE CHANGE PRICEGROUP with price manuelly\n";
+print (STDERR "  SELLPRICE??? ---", Dumper($form->{"sellprice_$i"}));
+print (STDERR "  NEWPRICE??? ---", Dumper($price_new));
+              $pkr->{price} = $form->{"sellprice_$i"};
+              $pkr->{selected}                    = ' selected';
+              $last->{selected}                   = '';
+       #$form->{"sellprice_$i"} = $form->format_amount($myconfig, $price_new, 2);
+# print (STDERR "----5555---", Dumper($pkr));
+            }
+          } else {
+            if ($pkr->{pricegroup_id} eq $selectedpricegroup_id) {
+print STDERR "   UPDATE NO CHANGE\n";
+              $pkr->{selected}                    = ' selected';
+              $last->{selected}                   = '';
+print STDERR "  DEFAULTPRICE??? ---$pkr->{default_sellprice}\n";
+print (STDERR "  SELLPRICE??? ---", Dumper($form->{"sellprice_$i"}));
+# print (STDERR "  HIER DER SELLPRICE DEFAULT??? ---", Dumper($form));
+print STDERR "  NEWPRICE??? ---$price_new_\n";
+              if (($pkr->{pricegroup_id} == 0) and ($pkr->{price} == $form->{"sellprice_$i"})) {
+print (STDERR "  UPDATE NO CHANGE BUT PRICE MANUELLY SET", Dumper($pkr->{price}));
+                # $pkr->{price}                         = $form->{"sellprice_$i"};
+              } else {
+                $pkr->{price} = $form->{"sellprice_$i"};
+              }
+#print (STDERR "   FEHLER", Dumper($form->{"sellprice_$i"}));
+            }
+          }
+        }
+      }
+    }
+    $i++;
+
+    $pkq->finish;
+  }
+
+  $dbh->disconnect;
+
+#        print (STDERR "TEST", Dumper($form->{PRICES}));
+# print (STDERR "TEST id_$i", Dumper($form->{"id_$i"}));
+  $main::lxdebug->leave_sub();
+}
+
 sub webdav_folder {
   $main::lxdebug->enter_sub();
 
 sub webdav_folder {
   $main::lxdebug->enter_sub();
 
index b39c8e94f147036af8d92febc2a744ab03704acf..d5d1aa7ba6f82d9eff518927ee0d614106571a34 100644 (file)
--- a/SL/OE.pm
+++ b/SL/OE.pm
@@ -311,11 +311,15 @@ sub save {
       $reqdate =
         ($form->{"reqdate_$i"}) ? qq|'$form->{"reqdate_$i"}'| : "NULL";
 
       $reqdate =
         ($form->{"reqdate_$i"}) ? qq|'$form->{"reqdate_$i"}'| : "NULL";
 
+      # get pricegroup_id and save ist
+      ($null, my $pricegroup_id) = split /--/, $form->{"sellprice_drag_$i"};
+      $pricegroup_id *= 1;
+
       # save detail record in orderitems table
       $query = qq|INSERT INTO orderitems (|;
       $query .= "id, " if $form->{"orderitems_id_$i"};
       $query .= qq|trans_id, parts_id, description, qty, sellprice, discount,
       # save detail record in orderitems table
       $query = qq|INSERT INTO orderitems (|;
       $query .= "id, " if $form->{"orderitems_id_$i"};
       $query .= qq|trans_id, parts_id, description, qty, sellprice, discount,
-                  unit, reqdate, project_id, serialnumber, ship)
+                  unit, reqdate, project_id, serialnumber, ship, pricegroup_id)
                    VALUES (|;
       $query .= qq|$form->{"orderitems_id_$i"},|
         if $form->{"orderitems_id_$i"};
                    VALUES (|;
       $query .= qq|$form->{"orderitems_id_$i"},|
         if $form->{"orderitems_id_$i"};
@@ -323,7 +327,8 @@ sub save {
                   '$form->{"description_$i"}', $form->{"qty_$i"},
                   $fxsellprice, $form->{"discount_$i"},
                   '$form->{"unit_$i"}', $reqdate, (SELECT id from project where projectnumber = '$project_id'),
                   '$form->{"description_$i"}', $form->{"qty_$i"},
                   $fxsellprice, $form->{"discount_$i"},
                   '$form->{"unit_$i"}', $reqdate, (SELECT id from project where projectnumber = '$project_id'),
-                  '$form->{"serialnumber_$i"}', $form->{"ship_$i"})|;
+                  '$form->{"serialnumber_$i"}', $form->{"ship_$i"},
+       '$pricegroup_id')|;
       $dbh->do($query) || $form->dberror($query);
 
       $form->{"sellprice_$i"} = $fxsellprice;
       $dbh->do($query) || $form->dberror($query);
 
       $form->{"sellprice_$i"} = $fxsellprice;
@@ -631,7 +636,7 @@ sub retrieve {
                o.sellprice, o.parts_id AS id, o.unit, o.discount, p.bin, p.notes AS partnotes,
                 o.reqdate, o.project_id, o.serialnumber, o.ship,
                pr.projectnumber,
                o.sellprice, o.parts_id AS id, o.unit, o.discount, p.bin, p.notes AS partnotes,
                 o.reqdate, o.project_id, o.serialnumber, o.ship,
                pr.projectnumber,
-               pg.partsgroup
+               pg.partsgroup, o.pricegroup_id, (SELECT pricegroup FROM pricegroup WHERE id=o.pricegroup_id) as pricegroup
                FROM orderitems o
                JOIN parts p ON (o.parts_id = p.id)
                LEFT JOIN chart c1 ON (p.inventory_accno_id = c1.id)
                FROM orderitems o
                JOIN parts p ON (o.parts_id = p.id)
                LEFT JOIN chart c1 ON (p.inventory_accno_id = c1.id)
index 9c17b524fb9ca8f65d31061be1bcfb37d71bef8a..1532e79cee9d4041f3cbaab362c8716ecdb19822 100644 (file)
--- a/SL/PE.pm
+++ b/SL/PE.pm
@@ -35,6 +35,8 @@
 
 package PE;
 
 
 package PE;
 
+use Data::Dumper;
+
 sub projects {
   $main::lxdebug->enter_sub();
 
 sub projects {
   $main::lxdebug->enter_sub();
 
@@ -290,5 +292,133 @@ sub delete_tuple {
   $main::lxdebug->leave_sub();
 }
 
   $main::lxdebug->leave_sub();
 }
 
+##########################
+# get pricegroups from database
+#
+sub pricegroups {
+  $main::lxdebug->enter_sub();
+
+  my ($self, $myconfig, $form) = @_;
+
+  my $var;
+
+  # connect to database
+  my $dbh = $form->dbconnect($myconfig);
+
+  my $sortorder = ($form->{sort}) ? $form->{sort} : "pricegroup";
+
+  my $query = qq|SELECT g.id, g.pricegroup
+                 FROM pricegroup g|;
+
+  my $where = "1 = 1";
+
+  if ($form->{pricegroup}) {
+    $var = $form->like(lc $form->{pricegroup});
+    $where .= " AND lower(g.pricegroup) LIKE '$var'";
+  }
+  $query .= qq|
+               WHERE $where
+              ORDER BY $sortorder|;
+
+  if ($form->{status} eq 'orphaned') {
+    $query = qq|SELECT pg.*
+                FROM pricegroup pg
+                LEFT JOIN prices p ON (p.pricegroup_id = pg.id)
+               WHERE $where
+                EXCEPT
+                SELECT pg.*
+               FROM pricegroup pg
+               JOIN prices p ON (p.pricegroup_id = pg.id)
+               WHERE $where
+               ORDER BY $sortorder|;
+  }
+print STDERR "asdfasdf-$query\n";
+
+  $sth = $dbh->prepare($query);
+  $sth->execute || $form->dberror($query);
+
+  my $i = 0;
+  while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+    push @{ $form->{item_list} }, $ref;
+    $i++;
+  }
+
+  $sth->finish;
+  $dbh->disconnect;
+
+  $main::lxdebug->leave_sub();
+
+  return $i;
+}
+########################
+# save pricegruop to database
+#
+sub save_pricegroup {
+  $main::lxdebug->enter_sub();
+
+  my ($self, $myconfig, $form) = @_;
+
+  # connect to database
+  my $dbh = $form->dbconnect($myconfig);
+
+  map { $form->{$_} =~ s/\'/\'\'/g } (pricegroup);
+
+  $form->{discount} /= 100;
+
+  if ($form->{id}) {
+    $query = qq|UPDATE pricegroup SET
+                pricegroup = '$form->{pricegroup}'
+               WHERE id = $form->{id}|;
+  } else {
+    $query = qq|INSERT INTO pricegroup
+                (pricegroup)
+                VALUES ('$form->{pricegroup}')|;
+  }
+  $dbh->do($query) || $form->dberror($query);
+
+  $dbh->disconnect;
+
+  $main::lxdebug->leave_sub();
+}
+############################
+# get one pricegroup from database
+#
+sub get_pricegroup {
+  $main::lxdebug->enter_sub();
+print STDERR "PE.pm-get_pricegroup\n";
+  my ($self, $myconfig, $form) = @_;
+
+  # connect to database
+  my $dbh = $form->dbconnect($myconfig);
+
+  my $query = qq|SELECT p.id, p.pricegroup
+                 FROM pricegroup p
+                WHERE p.id = $form->{id}|;
+  my $sth = $dbh->prepare($query);
+  $sth->execute || $form->dberror($query);
+
+  my $ref = $sth->fetchrow_hashref(NAME_lc);
+
+  map { $form->{$_} = $ref->{$_} } keys %$ref;
+
+  $sth->finish;
+
+  # check if it is orphaned
+  $query = qq|SELECT count(*)
+              FROM prices p
+             WHERE p.pricegroup_id = $form->{id}|;
+  $sth = $dbh->prepare($query);
+  $sth->execute || $form->dberror($query);
+
+  ($form->{orphaned}) = $sth->fetchrow_array;
+  $form->{orphaned} = !$form->{orphaned};
+
+  $sth->finish;
+
+  $dbh->disconnect;
+#print (STDERR "   ", Dumper($form));
+  $main::lxdebug->leave_sub();
+}
+
 1;
 
 1;
 
index 18171b5d1ca9662ffbe91cd912bafe5d3e42ffd4..c1bd16e2106096c2ffbf554b6427ef3195cc2c93 100644 (file)
@@ -69,8 +69,7 @@ sub search {
   if ($form->{db} eq 'vendor') {
     $gifi = qq|
                <td><input name="l_gifi_accno" type=checkbox class=checkbox value=Y> |
   if ($form->{db} eq 'vendor') {
     $gifi = qq|
                <td><input name="l_gifi_accno" type=checkbox class=checkbox value=Y> |
-      . $locale->text('GIFI')
-      . qq|</td>
+      . $locale->text('GIFI') . qq|</td>
 |;
   }
 
 |;
   }
 
@@ -112,8 +111,7 @@ sub search {
          <td><input name=status class=radio type=radio value=all checked>&nbsp;|
     . $locale->text('All') . qq|
          <input name=status class=radio type=radio value=orphaned>&nbsp;|
          <td><input name=status class=radio type=radio value=all checked>&nbsp;|
     . $locale->text('All') . qq|
          <input name=status class=radio type=radio value=orphaned>&nbsp;|
-    . $locale->text('Orphaned')
-    . qq|</td>
+    . $locale->text('Orphaned') . qq|</td>
        </tr>
        <tr>
          <th align=right nowrap>| . $locale->text('Include in Report') . qq|</th>
        </tr>
        <tr>
          <th align=right nowrap>| . $locale->text('Include in Report') . qq|</th>
@@ -121,54 +119,40 @@ sub search {
            <table>
              <tr>
                <td><input name="l_id" type=checkbox class=checkbox value=Y> |
            <table>
              <tr>
                <td><input name="l_id" type=checkbox class=checkbox value=Y> |
-    . $locale->text('ID')
-    . qq|</td>
+    . $locale->text('ID') . qq|</td>
                <td><input name="l_$form->{db}number" type=checkbox class=checkbox value=Y> |
                <td><input name="l_$form->{db}number" type=checkbox class=checkbox value=Y> |
-    . $locale->text($label . ' Number')
-    . qq|</td>
+    . $locale->text($label . ' Number') . qq|</td>
                <td><input name="l_name" type=checkbox class=checkbox value=Y checked> |
                <td><input name="l_name" type=checkbox class=checkbox value=Y checked> |
-    . $locale->text('Company Name')
-    . qq|</td>
+    . $locale->text('Company Name') . qq|</td>
                <td><input name="l_address" type=checkbox class=checkbox value=Y> |
                <td><input name="l_address" type=checkbox class=checkbox value=Y> |
-    . $locale->text('Address')
-    . qq|</td>
+    . $locale->text('Address') . qq|</td>
              </tr>
              <tr>
                <td><input name="l_contact" type=checkbox class=checkbox value=Y checked> |
              </tr>
              <tr>
                <td><input name="l_contact" type=checkbox class=checkbox value=Y checked> |
-    . $locale->text('Contact')
-    . qq|</td>
+    . $locale->text('Contact') . qq|</td>
                <td><input name="l_phone" type=checkbox class=checkbox value=Y checked> |
                <td><input name="l_phone" type=checkbox class=checkbox value=Y checked> |
-    . $locale->text('Phone')
-    . qq|</td>
+    . $locale->text('Phone') . qq|</td>
                <td><input name="l_fax" type=checkbox class=checkbox value=Y> |
                <td><input name="l_fax" type=checkbox class=checkbox value=Y> |
-    . $locale->text('Fax')
-    . qq|</td>
+    . $locale->text('Fax') . qq|</td>
                <td><input name="l_email" type=checkbox class=checkbox value=Y checked> |
                <td><input name="l_email" type=checkbox class=checkbox value=Y checked> |
-    . $locale->text('E-mail')
-    . qq|</td>
+    . $locale->text('E-mail') . qq|</td>
              </tr>
              <tr>
                <td><input name="l_taxnumber" type=checkbox class=checkbox value=Y> |
              </tr>
              <tr>
                <td><input name="l_taxnumber" type=checkbox class=checkbox value=Y> |
-    . $locale->text('Tax Number')
-    . qq|</td>
+    . $locale->text('Tax Number') . qq|</td>
                $gifi
                <td><input name="l_sic_code" type=checkbox class=checkbox value=Y> |
                $gifi
                <td><input name="l_sic_code" type=checkbox class=checkbox value=Y> |
-    . $locale->text('SIC')
-    . qq|</td>
+    . $locale->text('SIC') . qq|</td>
                <td><input name="l_business" type=checkbox class=checkbox value=Y> |
                <td><input name="l_business" type=checkbox class=checkbox value=Y> |
-    . $locale->text('Type of Business')
-    . qq|</td>
+    . $locale->text('Type of Business') . qq|</td>
              </tr>
              <tr>
                <td><input name="l_invnumber" type=checkbox class=checkbox value=Y> |
              </tr>
              <tr>
                <td><input name="l_invnumber" type=checkbox class=checkbox value=Y> |
-    . $locale->text('Invoices')
-    . qq|</td>
+    . $locale->text('Invoices') . qq|</td>
                <td><input name="l_ordnumber" type=checkbox class=checkbox value=Y> |
                <td><input name="l_ordnumber" type=checkbox class=checkbox value=Y> |
-    . $locale->text('Orders')
-    . qq|</td>
+    . $locale->text('Orders') . qq|</td>
                <td><input name="l_quonumber" type=checkbox class=checkbox value=Y> |
                <td><input name="l_quonumber" type=checkbox class=checkbox value=Y> |
-    . $locale->text('Quotations')
-    . qq|</td>
+    . $locale->text('Quotations') . qq|</td>
              </tr>
            </table>
          </td>
              </tr>
            </table>
          </td>
@@ -363,7 +347,6 @@ sub list_names {
 
     if ($ref->{id} eq $sameid) {
       map { $column_data{$_} = "<td>&nbsp;</td>" } @column_index;
 
     if ($ref->{id} eq $sameid) {
       map { $column_data{$_} = "<td>&nbsp;</td>" } @column_index;
-      map { $column_data{$_} = "<td>$ref->{$_}&nbsp;</td>" } (invnumber, ordnumber, quonumber);
     } else {
       map { $column_data{$_} = "<td>$ref->{$_}&nbsp;</td>" } @column_index;
 
     } else {
       map { $column_data{$_} = "<td>$ref->{$_}&nbsp;</td>" } @column_index;
 
@@ -529,10 +512,10 @@ sub form_header {
   </tr>
 |;
   }
   </tr>
 |;
   }
-
   $form->{selectbusiness} = qq|<option>\n|;
   map {
   $form->{selectbusiness} = qq|<option>\n|;
   map {
-    $form->{selectbusiness} .= qq|<option value=$_->{id}>$_->{description}\n|
+    $form->{selectbusiness} .=
+      qq|<option value=$_->{id}>$_->{description}\n|
   } @{ $form->{all_business} };
   if ($form->{business_save}) {
     $form->{selectbusiness} = $form->{business_save};
   } @{ $form->{all_business} };
   if ($form->{business_save}) {
     $form->{selectbusiness} = $form->{business_save};
@@ -596,10 +579,42 @@ sub form_header {
 
   $select_greeting =
     qq|&nbsp;<select name=selected_cp_greeting><option></option>|;
 
   $select_greeting =
     qq|&nbsp;<select name=selected_cp_greeting><option></option>|;
-  map({ $select_greeting .= qq|<option>$_</option>|; } @{ $form->{GREETINGS} });
+  map(
+     { $select_greeting .= qq|<option>$_</option>|; } @{ $form->{GREETINGS} });
   $select_greeting .= qq|</select>|;
 ## /LINET
 
   $select_greeting .= qq|</select>|;
 ## /LINET
 
+  if ($form->{db} eq 'customer') {
+  #get pricegroup and form it
+  $form->get_pricegroup(\%myconfig, { all => 1 });
+
+  $form->{pricegroup}    = "$form->{klass}";
+  $form->{pricegroup_id} = "$form->{klass}";
+
+  if (@{ $form->{all_pricegroup} }) {
+
+    $form->{selectpricegroup} = qq|<option>\n|;
+    map {
+      $form->{selectpricegroup} .=
+        qq|<option value="$_->{id}">$_->{pricegroup}\n|
+    } @{ $form->{all_pricegroup} };
+  }
+
+  if ($form->{selectpricegroup}) {
+    $form->{selectpricegroup} = $form->unescape($form->{selectpricegroup});
+
+    $pricegroup =
+      qq|<input type=hidden name=selectpricegroup value="|
+      . $form->escape($form->{selectpricegroup}, 1) . qq|">|;
+
+    $form->{selectpricegroup} =~
+      s/(<option value="\Q$form->{klass}\E")/$1 selected/;
+
+    $pricegroup .= qq|<select name=klass>$form->{selectpricegroup}</select>|;
+
+    $group = $locale->text('Hola');
+  }
+ }
   # $locale->text('Customer Number')
   # $locale->text('Vendor Number')
   $form->{fokus} = "ct.name";
   # $locale->text('Customer Number')
   # $locale->text('Vendor Number')
   $form->{fokus} = "ct.name";
@@ -618,11 +633,9 @@ sub form_header {
       <table width=100%>
        <tr class=listheading>
          <th class=listheading colspan=2 width=50%>|
       <table width=100%>
        <tr class=listheading>
          <th class=listheading colspan=2 width=50%>|
-    . $locale->text('Billing Address')
-    . qq|</th>
+    . $locale->text('Billing Address') . qq|</th>
          <th class=listheading width=50%>|
          <th class=listheading width=50%>|
-    . $locale->text('Shipping Address')
-    . qq|</th>
+    . $locale->text('Shipping Address') . qq|</th>
        </tr>
        <tr height="5"></tr>
         $business_salesman
        </tr>
        <tr height="5"></tr>
         $business_salesman
@@ -649,9 +662,7 @@ sub form_header {
        </tr>
        <tr>
          <th align=right nowrap>|
        </tr>
        <tr>
          <th align=right nowrap>|
-    . $locale->text('Zipcode') . "/"
-    . $locale->text('City')
-    . qq|</th>
+    . $locale->text('Zipcode') . "/" . $locale->text('City') . qq|</th>
          <td><input name=zipcode size=5 tabindex=5 maxlength=10 value="$form->{zipcode}">
           <input name=city size=30 tabindex=6 maxlength=75 value="$form->{city}"></td>
          <td><input name=shiptozipcode size=5 maxlength=10 value="$form->{shiptozipcode}">
          <td><input name=zipcode size=5 tabindex=5 maxlength=10 value="$form->{zipcode}">
           <input name=city size=30 tabindex=6 maxlength=75 value="$form->{city}"></td>
          <td><input name=shiptozipcode size=5 maxlength=10 value="$form->{shiptozipcode}">
@@ -695,8 +706,7 @@ sub form_header {
                 <table>
                 <tr>
                  <th align=right nowrap>|
                 <table>
                 <tr>
                  <th align=right nowrap>|
-    . $locale->text('Contact Person')
-    . qq|</th>
+    . $locale->text('Contact Person') . qq|</th>
                 </tr>
                 <tr>
                   <th></th>
                 </tr>
                 <tr>
                   <th></th>
@@ -710,8 +720,7 @@ sub form_header {
                 <tr>
                   <th></th>
                   <th align=left nowrap>|
                 <tr>
                   <th></th>
                   <th align=left nowrap>|
-    . $locale->text('Given Name')
-    . qq|</th>
+    . $locale->text('Given Name') . qq|</th>
                   <td><input name=cp_givenname size=30 maxlength=40 value="$form->{cp_givenname}"></td>
                  <th align=left nowrap>| . $locale->text('Name') . qq|</th>
                   <td><input name=cp_name size=30 maxlength=40 value="$form->{cp_name}"></td>
                   <td><input name=cp_givenname size=30 maxlength=40 value="$form->{cp_givenname}"></td>
                  <th align=left nowrap>| . $locale->text('Name') . qq|</th>
                   <td><input name=cp_name size=30 maxlength=40 value="$form->{cp_name}"></td>
@@ -747,8 +756,7 @@ sub form_header {
          <td><input name=creditlimit tabindex=13 size=9 value="$form->{creditlimit}"></td>
          <th align=right>| . $locale->text('Terms: Net') . qq|</th>
          <td><input name=terms tabindex=14 size=2 value="$form->{terms}">|
          <td><input name=creditlimit tabindex=13 size=9 value="$form->{creditlimit}"></td>
          <th align=right>| . $locale->text('Terms: Net') . qq|</th>
          <td><input name=terms tabindex=14 size=2 value="$form->{terms}">|
-    . $locale->text('days')
-    . qq|</td>
+    . $locale->text('days') . qq|</td>
          <th align=right>| . $locale->text('Discount') . qq|</th>
          <td><input name=discount tabindex=15 size=4 value="$form->{discount}">
          %</td>
          <th align=right>| . $locale->text('Discount') . qq|</th>
          <td><input name=discount tabindex=15 size=4 value="$form->{discount}">
          %</td>
@@ -773,7 +781,12 @@ sub form_header {
          <th align=right>| . $locale->text('Language') . qq|</th>
          <td><select name=language tabindex=23>$lang
                           </select></td>|;
          <th align=right>| . $locale->text('Language') . qq|</th>
          <td><select name=language tabindex=23>$lang
                           </select></td>|;
+if ($form->{db} eq 'customer'){
 
 
+print qq|
+          <th align=right>| . $locale->text('Preisklasse') . qq|</th>
+          <td>$pricegroup</td>|;
+}
   print qq|        </tr>
         <tr>
           <td align=right>| . $locale->text('Obsolete') . qq|</td>
   print qq|        </tr>
         <tr>
           <td align=right>| . $locale->text('Obsolete') . qq|</td>
@@ -835,6 +848,8 @@ sub form_footer {
 <input type=hidden name=callback value="$form->{callback}">
 <input type=hidden name=db value=$form->{db}>
 
 <input type=hidden name=callback value="$form->{callback}">
 <input type=hidden name=db value=$form->{db}>
 
+
+
 <br>
 $update_button
 <input class=submit type=submit name=action accesskey="s" value="|
 <br>
 $update_button
 <input class=submit type=submit name=action accesskey="s" value="|
index 6d49eab28470e98fb81eb0a15f6a0610b2c1cdc6..0e7fdf533149cf957f77d1017a8f158cd9273ad0 100644 (file)
@@ -32,6 +32,7 @@
 #======================================================================
 
 use SL::IC;
 #======================================================================
 
 use SL::IC;
+#use SL::PE;
 
 require "$form->{path}/io.pl";
 
 
 require "$form->{path}/io.pl";
 
@@ -50,7 +51,7 @@ sub add {
 
   $form->{unit} =
     ($form->{item} eq 'service') ? $locale->text('hr') : $locale->text('ea');
 
   $form->{unit} =
     ($form->{item} eq 'service') ? $locale->text('hr') : $locale->text('ea');
-
+  IC->get_pricegroups(\%myconfig, \%$form);
   &link_part;
   &display_form;
 
   &link_part;
   &display_form;
 
@@ -84,14 +85,12 @@ sub search {
     $button1 = qq|
        <td><input name=transdatefrom id=transdatefrom size=11 title="$myconfig{dateformat}"></td>
        <td><input type=button name=transdatefrom id="trigger1" value=|
     $button1 = qq|
        <td><input name=transdatefrom id=transdatefrom size=11 title="$myconfig{dateformat}"></td>
        <td><input type=button name=transdatefrom id="trigger1" value=|
-      . $locale->text('button')
-      . qq|></td>
+      . $locale->text('button') . qq|></td>
       |;
     $button2 = qq|
        <td><input name=transdateto id=transdateto size=11 title="$myconfig{dateformat}"></td>
        <td><input type=button name=transdateto name=transdateto id="trigger2" value=|
       |;
     $button2 = qq|
        <td><input name=transdateto id=transdateto size=11 title="$myconfig{dateformat}"></td>
        <td><input type=button name=transdateto name=transdateto id="trigger2" value=|
-      . $locale->text('button')
-      . qq|></td>
+      . $locale->text('button') . qq|></td>
      |;
 
     #write Trigger
      |;
 
     #write Trigger
@@ -132,8 +131,7 @@ sub search {
 
     $l_serialnumber = qq|
         <td><input name=l_serialnumber class=checkbox type=checkbox value=Y>&nbsp;|
 
     $l_serialnumber = qq|
         <td><input name=l_serialnumber class=checkbox type=checkbox value=Y>&nbsp;|
-      . $locale->text('Serial Number')
-      . qq|</td>
+      . $locale->text('Serial Number') . qq|</td>
 |;
 
   }
 |;
 
   }
@@ -272,8 +270,7 @@ sub search {
         </tr>
         <tr>
           <th align=right nowrap>|
         </tr>
         <tr>
           <th align=right nowrap>|
-    . $locale->text('Part Description')
-    . qq|</th>
+    . $locale->text('Part Description') . qq|</th>
           <td colspan=3><input name=description size=40></td>
         </tr>
        <tr>
           <td colspan=3><input name=description size=40></td>
         </tr>
        <tr>
@@ -310,71 +307,53 @@ sub search {
        </tr>
        <tr>
           <th align=right nowrap>|
        </tr>
        <tr>
           <th align=right nowrap>|
-    . $locale->text('Include in Report')
-    . qq|</th>
+    . $locale->text('Include in Report') . qq|</th>
           <td colspan=3>
             <table>
               <tr>
                 <td><input name=l_partnumber class=checkbox type=checkbox value=Y checked>&nbsp;|
           <td colspan=3>
             <table>
               <tr>
                 <td><input name=l_partnumber class=checkbox type=checkbox value=Y checked>&nbsp;|
-    . $locale->text('Part Number')
-    . qq|</td>
+    . $locale->text('Part Number') . qq|</td>
                <td><input name=l_description class=checkbox type=checkbox value=Y checked>&nbsp;|
                <td><input name=l_description class=checkbox type=checkbox value=Y checked>&nbsp;|
-    . $locale->text('Part Description')
-    . qq|</td>
+    . $locale->text('Part Description') . qq|</td>
                $l_serialnumber
                <td><input name=l_unit class=checkbox type=checkbox value=Y checked>&nbsp;|
                $l_serialnumber
                <td><input name=l_unit class=checkbox type=checkbox value=Y checked>&nbsp;|
-    . $locale->text('Unit of measure')
-    . qq|</td>
+    . $locale->text('Unit of measure') . qq|</td>
              </tr>
              <tr>
                 <td><input name=l_listprice class=checkbox type=checkbox value=Y>&nbsp;|
              </tr>
              <tr>
                 <td><input name=l_listprice class=checkbox type=checkbox value=Y>&nbsp;|
-    . $locale->text('List Price')
-    . qq|</td>
+    . $locale->text('List Price') . qq|</td>
                <td><input name=l_sellprice class=checkbox type=checkbox value=Y checked>&nbsp;|
                <td><input name=l_sellprice class=checkbox type=checkbox value=Y checked>&nbsp;|
-    . $locale->text('Sell Price')
-    . qq|</td>
+    . $locale->text('Sell Price') . qq|</td>
                <td><input name=l_lastcost class=checkbox type=checkbox value=Y>&nbsp;|
                <td><input name=l_lastcost class=checkbox type=checkbox value=Y>&nbsp;|
-    . $locale->text('Last Cost')
-    . qq|</td>
+    . $locale->text('Last Cost') . qq|</td>
                <td><input name=l_linetotal class=checkbox type=checkbox value=Y checked>&nbsp;|
                <td><input name=l_linetotal class=checkbox type=checkbox value=Y checked>&nbsp;|
-    . $locale->text('Line Total')
-    . qq|</td>
+    . $locale->text('Line Total') . qq|</td>
              </tr>
              <tr>
                 <td><input name=l_priceupdate class=checkbox type=checkbox value=Y>&nbsp;|
              </tr>
              <tr>
                 <td><input name=l_priceupdate class=checkbox type=checkbox value=Y>&nbsp;|
-    . $locale->text('Updated')
-    . qq|</td>
+    . $locale->text('Updated') . qq|</td>
                <td><input name=l_bin class=checkbox type=checkbox value=Y>&nbsp;|
                <td><input name=l_bin class=checkbox type=checkbox value=Y>&nbsp;|
-    . $locale->text('Bin')
-    . qq|</td>
+    . $locale->text('Bin') . qq|</td>
                <td><input name=l_rop class=checkbox type=checkbox value=Y>&nbsp;|
                <td><input name=l_rop class=checkbox type=checkbox value=Y>&nbsp;|
-    . $locale->text('ROP')
-    . qq|</td>
+    . $locale->text('ROP') . qq|</td>
                <td><input name=l_weight class=checkbox type=checkbox value=Y>&nbsp;|
                <td><input name=l_weight class=checkbox type=checkbox value=Y>&nbsp;|
-    . $locale->text('Weight')
-    . qq|</td>
+    . $locale->text('Weight') . qq|</td>
               </tr>
              <tr>
                 <td><input name=l_image class=checkbox type=checkbox value=Y>&nbsp;|
               </tr>
              <tr>
                 <td><input name=l_image class=checkbox type=checkbox value=Y>&nbsp;|
-    . $locale->text('Image')
-    . qq|</td>
+    . $locale->text('Image') . qq|</td>
                <td><input name=l_drawing class=checkbox type=checkbox value=Y>&nbsp;|
                <td><input name=l_drawing class=checkbox type=checkbox value=Y>&nbsp;|
-    . $locale->text('Drawing')
-    . qq|</td>
+    . $locale->text('Drawing') . qq|</td>
                <td><input name=l_microfiche class=checkbox type=checkbox value=Y>&nbsp;|
                <td><input name=l_microfiche class=checkbox type=checkbox value=Y>&nbsp;|
-    . $locale->text('Microfiche')
-    . qq|</td>
+    . $locale->text('Microfiche') . qq|</td>
                <td><input name=l_partsgroup class=checkbox type=checkbox value=Y>&nbsp;|
                <td><input name=l_partsgroup class=checkbox type=checkbox value=Y>&nbsp;|
-    . $locale->text('Group')
-    . qq|</td>
+    . $locale->text('Group') . qq|</td>
               </tr>
              <tr>
                 <td><input name=l_subtotal class=checkbox type=checkbox value=Y>&nbsp;|
               </tr>
              <tr>
                 <td><input name=l_subtotal class=checkbox type=checkbox value=Y>&nbsp;|
-    . $locale->text('Subtotal')
-    . qq|</td>
+    . $locale->text('Subtotal') . qq|</td>
                <td><input name=l_soldtotal class=checkbox type=checkbox value=Y>&nbsp;|
                <td><input name=l_soldtotal class=checkbox type=checkbox value=Y>&nbsp;|
-    . $locale->text('soldtotal')
-    . qq|</td>
+    . $locale->text('soldtotal') . qq|</td>
              </tr>
             </table>
           </td>
              </tr>
             </table>
           </td>
@@ -433,11 +412,9 @@ sub choice {
       <table>
        <tr class=listheading>
          <th class=listheading nowrap>|
       <table>
        <tr class=listheading>
          <th class=listheading nowrap>|
-    . $locale->text('Part Number')
-    . qq|</th>
+    . $locale->text('Part Number') . qq|</th>
          <th class=listheading nowrap>|
          <th class=listheading nowrap>|
-    . $locale->text('Part Description')
-    . qq|</th>
+    . $locale->text('Part Description') . qq|</th>
         </tr>
         <tr valign=top>
          <td><input type=text name=partnumber size=20 value=></td>
         </tr>
         <tr valign=top>
          <td><input type=text name=partnumber size=20 value=></td>
@@ -858,10 +835,9 @@ sub addtop100 {
     $option   .= $locale->text('soldtotal') . qq| : $form->{soldtotal}<br>|;
   }
 
     $option   .= $locale->text('soldtotal') . qq| : $form->{soldtotal}<br>|;
   }
 
-  @columns =
-    $form->sort_columns(
+  @columns = $form->sort_columns(
     qw(number partnumber description partsgroup bin onhand rop unit listprice linetotallistprice sellprice linetotalsellprice lastcost linetotallastcost priceupdate weight image drawing microfiche invnumber ordnumber quonumber name serialnumber soldtotal)
     qw(number partnumber description partsgroup bin onhand rop unit listprice linetotallistprice sellprice linetotalsellprice lastcost linetotallastcost priceupdate weight image drawing microfiche invnumber ordnumber quonumber name serialnumber soldtotal)
-    );
+  );
 
   if ($form->{l_linetotal}) {
     $form->{l_onhand} = "Y";
 
   if ($form->{l_linetotal}) {
     $form->{l_onhand} = "Y";
@@ -1441,10 +1417,9 @@ sub generate_report {
     $option   .= $locale->text('soldtotal') . qq| : $form->{soldtotal}<br>|;
   }
 
     $option   .= $locale->text('soldtotal') . qq| : $form->{soldtotal}<br>|;
   }
 
-  @columns =
-    $form->sort_columns(
+  @columns = $form->sort_columns(
     qw(partnumber description partsgroup bin onhand rop unit listprice linetotallistprice sellprice linetotalsellprice lastcost linetotallastcost priceupdate weight image drawing microfiche invnumber ordnumber quonumber name serialnumber soldtotal)
     qw(partnumber description partsgroup bin onhand rop unit listprice linetotallistprice sellprice linetotalsellprice lastcost linetotallastcost priceupdate weight image drawing microfiche invnumber ordnumber quonumber name serialnumber soldtotal)
-    );
+  );
 
   if ($form->{l_linetotal}) {
     $form->{l_onhand} = "Y";
 
   if ($form->{l_linetotal}) {
     $form->{l_onhand} = "Y";
@@ -1921,7 +1896,9 @@ sub link_part {
   delete $form->{amount};
 
   $form->get_partsgroup(\%myconfig, { all => 1 });
   delete $form->{amount};
 
   $form->get_partsgroup(\%myconfig, { all => 1 });
+
   $form->{partsgroup} = "$form->{partsgroup}--$form->{partsgroup_id}";
   $form->{partsgroup} = "$form->{partsgroup}--$form->{partsgroup_id}";
+
   if (@{ $form->{all_partsgroup} }) {
     $form->{selectpartsgroup} = qq|<option>\n|;
     map {
   if (@{ $form->{all_partsgroup} }) {
     $form->{selectpartsgroup} = qq|<option>\n|;
     map {
@@ -2018,6 +1995,7 @@ sub form_header {
       }
     }
   }
       }
     }
   }
+
   if ($form->{selectpartsgroup}) {
     $form->{selectpartsgroup} = $form->unescape($form->{selectpartsgroup});
     $partsgroup =
   if ($form->{selectpartsgroup}) {
     $form->{selectpartsgroup} = $form->unescape($form->{selectpartsgroup});
     $partsgroup =
@@ -2044,8 +2022,7 @@ sub form_header {
   $lastcost = qq|
              <tr>
                 <th align="right" nowrap="true">|
   $lastcost = qq|
              <tr>
                 <th align="right" nowrap="true">|
-    . $locale->text('Last Cost')
-    . qq|</th>
+    . $locale->text('Last Cost') . qq|</th>
                 <td><input name=lastcost size=11 value=$form->{lastcost}></td>
               </tr>
 |;
                 <td><input name=lastcost size=11 value=$form->{lastcost}></td>
               </tr>
 |;
@@ -2153,8 +2130,7 @@ sub form_header {
              <tr>
                <th align="right" nowrap>| . $locale->text('On Hand') . qq|</th>
                <th align=left nowrap class="plus$n">&nbsp;|
              <tr>
                <th align="right" nowrap>| . $locale->text('On Hand') . qq|</th>
                <th align=left nowrap class="plus$n">&nbsp;|
-      . $form->format_amount(\%myconfig, $form->{onhand})
-      . qq|</th>
+      . $form->format_amount(\%myconfig, $form->{onhand}) . qq|</th>
              </tr>
 |;
 
              </tr>
 |;
 
@@ -2183,14 +2159,12 @@ sub form_header {
     $vegv = qq|
              <tr>
                <th align="right" nowrap="true">|
     $vegv = qq|
              <tr>
                <th align="right" nowrap="true">|
-      . $locale->text('Verrechnungseinheit')
-      . qq|</th>
+      . $locale->text('Verrechnungseinheit') . qq|</th>
                <td><input name=ve size=10 value=$form->{ve}></td>
              </tr>
               <tr>
                <th align="right" nowrap="true">|
                <td><input name=ve size=10 value=$form->{ve}></td>
              </tr>
               <tr>
                <th align="right" nowrap="true">|
-      . $locale->text('Geschäftsvolumen')
-      . qq|</th>
+      . $locale->text('Geschäftsvolumen') . qq|</th>
                <td><input name=gv size=10 value=$form->{gv}></td>
              </tr>
 |;
                <td><input name=gv size=10 value=$form->{gv}></td>
              </tr>
 |;
@@ -2227,8 +2201,7 @@ sub form_header {
   $obsolete .= qq|
               <tr>
                 <th align=right nowrap>|
   $obsolete .= qq|
               <tr>
                 <th align=right nowrap>|
-    . $locale->text('Shopartikel')
-    . qq|</th>
+    . $locale->text('Shopartikel') . qq|</th>
                 <td><input class=checkbox type=checkbox name=shop value=1 $shopok></td>
              </tr>
 |;
                 <td><input class=checkbox type=checkbox name=shop value=1 $shopok></td>
              </tr>
 |;
@@ -2249,8 +2222,7 @@ sub form_header {
     $button1 = qq|
        <td width="13"><input name=priceupdate id=priceupdate size=11  title="$myconfig{dateformat}" value="$form->{priceupdate}"></td>
        <td width="4" align="left"><input type=button name=priceupdate id="trigger1" value=|
     $button1 = qq|
        <td width="13"><input name=priceupdate id=priceupdate size=11  title="$myconfig{dateformat}" value="$form->{priceupdate}"></td>
        <td width="4" align="left"><input type=button name=priceupdate id="trigger1" value=|
-      . $locale->text('button')
-      . qq|></td>
+      . $locale->text('button') . qq|></td>
       |;
 
     #write Trigger
       |;
 
     #write Trigger
@@ -2314,8 +2286,7 @@ sub form_header {
             <table width="100%" height="100%">
               <tr class="listheading">
                 <th class="listheading" align="center" colspan=2>|
             <table width="100%" height="100%">
               <tr class="listheading">
                 <th class="listheading" align="center" colspan=2>|
-    . $locale->text('Link Accounts')
-    . qq|</th>
+    . $locale->text('Link Accounts') . qq|</th>
               </tr>
               $linkaccounts
               <tr>
               </tr>
               $linkaccounts
               <tr>
@@ -2332,8 +2303,7 @@ sub form_header {
            <table width="100%">
              <tr>
                 <th align="right" nowrap="true">|
            <table width="100%">
              <tr>
                 <th align="right" nowrap="true">|
-    . $locale->text('Updated')
-    . qq|</th>
+    . $locale->text('Updated') . qq|</th>
                 $button1
               </tr>
              <tr>
                 $button1
               </tr>
              <tr>
@@ -2378,11 +2348,9 @@ sub form_footer {
             <table width="100%">
               <tr>
                 <th colspan=2 align=right>|
             <table width="100%">
               <tr>
                 <th colspan=2 align=right>|
-      . $locale->text('Total')
-      . qq|&nbsp;</th>
+      . $locale->text('Total') . qq|&nbsp;</th>
                 <th align=right>|
                 <th align=right>|
-      . $form->format_amount(\%myconfig, $form->{assemblytotal}, 2)
-      . qq|</th>
+      . $form->format_amount(\%myconfig, $form->{assemblytotal}, 2) . qq|</th>
               </tr>
             </table>
           </td>
               </tr>
             </table>
           </td>
@@ -2415,6 +2383,9 @@ sub form_footer {
     |;
   }
 
     |;
   }
 
+  print qq|
+     <input type=hidden name=price_rows value=$form->{price_rows}>|;
+
   print qq|
       <input class=submit type=submit name=action value="|
     . $locale->text('Save') . qq|">|;
   print qq|
       <input class=submit type=submit name=action value="|
     . $locale->text('Save') . qq|">|;
@@ -2718,7 +2689,6 @@ sub update {
   if ($form->{item} eq 'service') {
     map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) }
       qw(sellprice listprice);
   if ($form->{item} eq 'service') {
     map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) }
       qw(sellprice listprice);
-
     &form_header;
     &form_footer;
   }
     &form_header;
     &form_footer;
   }
@@ -2898,15 +2868,13 @@ sub stock_assembly {
       <table>
         <tr>
           <th align="right" nowrap="true">|
       <table>
         <tr>
           <th align="right" nowrap="true">|
-    . $locale->text('Part Number')
-    . qq|</th>
+    . $locale->text('Part Number') . qq|</th>
           <td><input name=partnumber size=20></td>
           <td>&nbsp;</td>
         </tr>
         <tr>
           <th align="right" nowrap="true">|
           <td><input name=partnumber size=20></td>
           <td>&nbsp;</td>
         </tr>
         <tr>
           <th align="right" nowrap="true">|
-    . $locale->text('Part Description')
-    . qq|</th>
+    . $locale->text('Part Description') . qq|</th>
           <td><input name=description size=40></td>
         </tr>
       </table>
           <td><input name=description size=40></td>
         </tr>
       </table>
@@ -3053,4 +3021,37 @@ sub restock_assemblies {
   $lxdebug->leave_sub();
 }
 
   $lxdebug->leave_sub();
 }
 
+sub price_row {
+  $lxdebug->enter_sub();
+
+  my ($numrows) = @_;
+
+  print qq|
+  <tr>
+    <td>
+      <table width=100%>
+        <tr>
+          <th class="listheading">| . $locale->text('Preisklasse') . qq|</th>
+          <th class="listheading">| . $locale->text('Preis') . qq|</th>
+        </tr>
+|;
+  for $i (1 .. $numrows) {
+    print qq|
+        <tr>
+          <td width=50%><input type=hidden name="pricegroup_$i" size=30  value=$form->{"pricegroup_$i"}>$form->{"pricegroup_$i"}</td>
+          <td width=50%><input name="price_$i" size=11 value="$form->{"price_$i"}"></td>
+          <input type=hidden name="pricegroup_id_$i" value="$form->{"pricegroup_id_$i"}">
+        </tr>
+|;
+  }
+
+  print qq|
+      </table>
+    </td>
+  </tr>
+|;
+
+  $lxdebug->leave_sub();
+}
+
 sub continue { &{ $form->{nextsub} } }
 sub continue { &{ $form->{nextsub} } }
index 2a47a624916e882e6f4705eafa0129c28afde6c9..8cbe24456b01ed759d01cfd565466397b70ee880 100644 (file)
@@ -72,6 +72,8 @@ if (-f "$form->{path}/$form->{login}_io.pl") {
 # $locale->text('Oct')
 # $locale->text('Nov')
 # $locale->text('Dec')
 # $locale->text('Oct')
 # $locale->text('Nov')
 # $locale->text('Dec')
+use SL::IS;
+use SL::PE;
 use Data::Dumper;
 ########################################
 # Eintrag fuer Version 2.2.0 geaendert #
 use Data::Dumper;
 ########################################
 # Eintrag fuer Version 2.2.0 geaendert #
@@ -80,7 +82,7 @@ use Data::Dumper;
 sub display_row {
   $lxdebug->enter_sub();
   my $numrows = shift;
 sub display_row {
   $lxdebug->enter_sub();
   my $numrows = shift;
-
+print STDERR "io.pl-display_row\n";
   if ($lizenzen && $form->{vc} eq "customer") {
     if ($form->{type} =~ /sales_order/) {
       @column_index = (runningnumber, partnumber, description, ship, qty);
   if ($lizenzen && $form->{vc} eq "customer") {
     if ($form->{type} =~ /sales_order/) {
       @column_index = (runningnumber, partnumber, description, ship, qty);
@@ -99,7 +101,14 @@ sub display_row {
   }
 ############## ENDE Neueintrag ##################
 
   }
 ############## ENDE Neueintrag ##################
 
-  push @column_index, qw(unit sellprice);
+  push @column_index, qw(unit);
+
+  #for pricegroups column
+  if ($form->{type} =~ (/sales_quotation/) or (($form->{level} =~ /Sales/) and ($form->{type} =~ /invoice/)) or (($form->{level} eq undef) and ($form->{type} =~ /invoice/)) or ($form->{type} =~ /sales_order/)) {
+    push @column_index, qw(sellprice_drag);
+  }
+
+  push @column_index, qw(sellprice);
 
   if ($form->{vc} eq 'customer') {
     push @column_index, qw(discount);
 
   if ($form->{vc} eq 'customer') {
     push @column_index, qw(discount);
@@ -153,9 +162,13 @@ sub display_row {
     . $locale->text('Project')
     . qq|</th>|;
   $column_data{sellprice} =
     . $locale->text('Project')
     . qq|</th>|;
   $column_data{sellprice} =
-      qq|<th align=left nowrap width=10 class=listheading>|
+      qq|<th align=left nowrap width=15 class=listheading>|
     . $locale->text('Price')
     . qq|</th>|;
     . $locale->text('Price')
     . qq|</th>|;
+  $column_data{sellprice_drag} =
+      qq|<th align=left nowrap width=15 class=listheading>|
+    . $locale->text('Pricegroup')
+    . qq|</th>|;
   $column_data{discount} =
       qq|<th align=left class=listheading>|
     . $locale->text('Discount')
   $column_data{discount} =
       qq|<th align=left class=listheading>|
     . $locale->text('Discount')
@@ -201,7 +214,7 @@ sub display_row {
     map {
       $form->{"${_}_$i"} =
         $form->parse_amount(\%myconfig, $form->{"${_}_$i"})
     map {
       $form->{"${_}_$i"} =
         $form->parse_amount(\%myconfig, $form->{"${_}_$i"})
-    } qw(qty ship discount sellprice);
+    } qw(qty ship discount sellprice price_new price_old);
 
     ($dec) = ($form->{"sellprice_$i"} =~ /\.(\d+)/);
     $dec           = length $dec;
 
     ($dec) = ($form->{"sellprice_$i"} =~ /\.(\d+)/);
     $dec           = length $dec;
@@ -211,6 +224,7 @@ sub display_row {
       $form->round_amount(
                         $form->{"sellprice_$i"} * $form->{"discount_$i"} / 100,
                         $decimalplaces);
       $form->round_amount(
                         $form->{"sellprice_$i"} * $form->{"discount_$i"} / 100,
                         $decimalplaces);
+
     $linetotal =
       $form->round_amount($form->{"sellprice_$i"} - $discount, $decimalplaces);
     $linetotal = $form->round_amount($linetotal * $form->{"qty_$i"}, 2);
     $linetotal =
       $form->round_amount($form->{"sellprice_$i"} - $discount, $decimalplaces);
     $linetotal = $form->round_amount($linetotal * $form->{"qty_$i"}, 2);
@@ -239,20 +253,57 @@ sub display_row {
     }
 
     $column_data{qty} =
     }
 
     $column_data{qty} =
-        qq|<td align=right><input name="qty_$i" size=5 value=|
-      . $form->format_amount(\%myconfig, $form->{"qty_$i"})
-      . qq|></td>|;
+        qq|<td align=right><input name="qty_$i" size=5 value=|.$form->format_amount(\%myconfig, $form->{"qty_$i"},0).qq|></td>|;
     $column_data{ship} =
         qq|<td align=right><input name="ship_$i" size=5 value=|
       . $form->format_amount(\%myconfig, $form->{"ship_$i"})
       . qq|></td>|;
     $column_data{unit} =
       qq|<td><input name="unit_$i" size=5 value="$form->{"unit_$i"}"></td>|;
     $column_data{ship} =
         qq|<td align=right><input name="ship_$i" size=5 value=|
       . $form->format_amount(\%myconfig, $form->{"ship_$i"})
       . qq|></td>|;
     $column_data{unit} =
       qq|<td><input name="unit_$i" size=5 value="$form->{"unit_$i"}"></td>|;
-    $column_data{sellprice} =
-      qq|<td align=right><input name="sellprice_$i" size=9 value=|
-      . $form->format_amount(\%myconfig, $form->{"sellprice_$i"},
-                             $decimalplaces)
-      . qq|></td>|;
+
+
+
+ #print (STDERR "io.pl---111-i-$i", Dumper($form->{PRICES}));
+    # build in dragdrop for pricesgroups
+    if ($form->{"prices_$i"}) {
+ print STDERR " YES  prices\n";
+      $price_tmp = $form->format_amount(\%myconfig, $form->{"price_new_$i"}, 2);
+
+      $column_data{sellprice_drag} =
+        qq|<td align=right><select name="sellprice_drag_$i">$form->{"prices_$i"}</select></td>|;
+      $column_data{sellprice} =
+        qq|<td><input name="sellprice_$i" size=5 value=$price_tmp></td>|;
+    } else {
+      print STDERR " NO prices\n";
+      # for last row and report
+      # set pricegroup dragdrop from report menu
+      if ($form->{"sellprice_$i"} != 0) {
+print STDERR "   HIER NOCH FÜR RECHNUNGSAUFRUFE\n";
+print (STDERR "sellprice_$i   ", Dumper($form->{"sellprice_$i"}), " pricegroup_id_$i ", Dumper($form->{"pricegroup_id_$i"}));
+        $prices =
+             qq|<option value="$form->{"sellprice_$i"}--$form->{"pricegroup_id_$i"}" selected>$form->{"pricegroup_$i"}</option>\n|;
+
+        $form->{"pricegroup_old_$i"} = $form->{"pricegroup_id_$i"};
+
+        $column_data{sellprice_drag} =
+          qq|<td align=right><select name="sellprice_drag_$i">$prices</select></td>|;
+
+        }else {
+          # for last row
+          $column_data{sellprice_drag} =
+            qq|<td align=right><input name="sellprice_$i" size=9 value=|
+              . $form->format_amount(\%myconfig, $form->{"prices_$i"},
+                               $decimalplaces)
+            . qq|></td>|;
+          }
+
+      $column_data{sellprice} =
+        qq|<td><input name="sellprice_$i" size=5 value=|
+        . $form->format_amount(\%myconfig, $form->{"sellprice_$i"},
+                               $decimalplaces)
+        . qq|></td>|;
+    }
+#print (STDERR "io.pl---555-i-$i", Dumper($form->{"price_old_$i"}));
     $column_data{discount} =
         qq|<td align=right><input name="discount_$i" size=3 value=|
       . $form->format_amount(\%myconfig, $form->{"discount_$i"})
     $column_data{discount} =
         qq|<td align=right><input name="discount_$i" size=3 value=|
       . $form->format_amount(\%myconfig, $form->{"discount_$i"})
@@ -289,6 +340,10 @@ sub display_row {
 <input type=hidden name="orderitems_id_$i" value=$form->{"orderitems_id_$i"}>
 <input type=hidden name="bo_$i" value=$form->{"bo_$i"}>
 
 <input type=hidden name="orderitems_id_$i" value=$form->{"orderitems_id_$i"}>
 <input type=hidden name="bo_$i" value=$form->{"bo_$i"}>
 
+<input type=hidden name="pricegroup_old_$i" value=$form->{"pricegroup_old_$i"}>
+<input type=hidden name="price_old_$i" value=$form->{"price_old_$i"}>
+<input type=hidden name="price_new_$i" value=|.$form->format_amount(\%myconfig,$form->{"price_new_$i"}).qq|>
+
 <input type=hidden name="id_$i" value=$form->{"id_$i"}>
 <input type=hidden name="inventory_accno_$i" value=$form->{"inventory_accno_$i"}>
 <input type=hidden name="bin_$i" value="$form->{"bin_$i"}">
 <input type=hidden name="id_$i" value=$form->{"id_$i"}>
 <input type=hidden name="inventory_accno_$i" value=$form->{"inventory_accno_$i"}>
 <input type=hidden name="bin_$i" value="$form->{"bin_$i"}">
@@ -357,9 +412,51 @@ sub display_row {
   $lxdebug->leave_sub();
 }
 
   $lxdebug->leave_sub();
 }
 
-sub select_item {
+##################################################
+# build html-code for pricegroups in variable $form->{prices_$j}
+
+sub set_pricegroup {
+  my $rowcount = shift;
   $lxdebug->enter_sub();
   $lxdebug->enter_sub();
+  for $j (1 .. $rowcount) {
+
+    my $pricegroup_old = $form->{"pricegroup_old_$i"};
+    if ($form->{PRICES}{ $j }) {
+      $len    = 0;
+      $prices = '';
+      $price = 0;
+      foreach $item (@{ $form->{PRICES}{ $j } }) {
+# print STDERR "-VOR   PREIS--$item->{price}--PREISGRUOP-$item->{pricegroup_id}\n";
+        $price         = $form->round_amount($myconfig, $item->{price},5);
+        $price         = $form->format_amount($myconfig, $item->{price},2);
+        $price         = $item->{price};
+# print STDERR "-NACH PREIS--$price--PREISGRUOP-$item->{pricegroup_id}\n";
+        $pricegroup_id = $item->{pricegroup_id};
+        $pricegroup    = $item->{pricegroup};
+        # build dragdrop for pricegroups
+        $prices .=
+             qq|<option value="$price--$pricegroup_id"$item->{selected}>$pricegroup</option>\n|;
+
+        $len += 1;
+# print STDERR "prices---$prices\n";
+        # set new selectedpricegroup_id and prices for "Preis"
+        if ($item->{selected}) {
+          $form->{"pricegroup_old_$j"} = $pricegroup_id;
+          $form->{"price_new_$j"} = $price;
+           $form->{"sellprice_$j"} = $price;
+        }
+        if ($len >= 1) {
+          $form->{"prices_$j"} = $prices;
+        }
+      }
+    }
+  }
+  $lxdebug->leave_sub();
+}
 
 
+sub select_item {
+  $lxdebug->enter_sub();
+print STDERR "io.pl-select_item\n";
   @column_index = qw(ndx partnumber description onhand sellprice);
 
   $column_data{ndx}        = qq|<th>&nbsp;</th>|;
   @column_index = qw(ndx partnumber description onhand sellprice);
 
   $column_data{ndx}        = qq|<th>&nbsp;</th>|;
@@ -411,10 +508,11 @@ sub select_item {
     }
 
     map { $ref->{$_} =~ s/\"/&quot;/g } qw(partnumber description unit);
     }
 
     map { $ref->{$_} =~ s/\"/&quot;/g } qw(partnumber description unit);
-
+#sk tradediscount
+print STDERR "TRADEDISCOUNT $ref->{sellprice}\n";
     $ref->{sellprice} =
       $form->round_amount($ref->{sellprice} * (1 - $form->{tradediscount}), 2);
     $ref->{sellprice} =
       $form->round_amount($ref->{sellprice} * (1 - $form->{tradediscount}), 2);
-
+print STDERR "TRADEDISCOUNT $ref->{sellprice}\n";
     $column_data{ndx} =
       qq|<td><input name=ndx class=radio type=radio value=$i $checked></td>|;
     $column_data{partnumber} =
     $column_data{ndx} =
       qq|<td><input name=ndx class=radio type=radio value=$i $checked></td>|;
     $column_data{partnumber} =
@@ -496,7 +594,7 @@ sub select_item {
 
 sub item_selected {
   $lxdebug->enter_sub();
 
 sub item_selected {
   $lxdebug->enter_sub();
-
+print STDERR "io.pl-item_selected\n";
   # replace the last row with the checked row
   $i = $form->{rowcount};
   $i = $form->{assembly_rows} if ($form->{item} eq 'assembly');
   # replace the last row with the checked row
   $i = $form->{rowcount};
   $i = $form->{assembly_rows} if ($form->{item} eq 'assembly');
@@ -504,6 +602,10 @@ sub item_selected {
   # index for new item
   $j = $form->{ndx};
 
   # index for new item
   $j = $form->{ndx};
 
+  #sk
+  #($form->{"sellprice_$i"},$form->{"$pricegroup_old_$i"}) = split /--/, $form->{"sellprice_$i"};
+  #$form->{"sellprice_$i"} = $form->{"sellprice_$i"};
+
   # if there was a price entered, override it
   $sellprice = $form->parse_amount(\%myconfig, $form->{"sellprice_$i"});
 
   # if there was a price entered, override it
   $sellprice = $form->parse_amount(\%myconfig, $form->{"sellprice_$i"});
 
@@ -563,6 +665,12 @@ sub item_selected {
       $form->format_amount(\%myconfig, $form->{"${_}_$i"}, $decimalplaces)
   } qw(sellprice listprice) if $form->{item} ne 'assembly';
 
       $form->format_amount(\%myconfig, $form->{"${_}_$i"}, $decimalplaces)
   } qw(sellprice listprice) if $form->{item} ne 'assembly';
 
+  # get pricegroups for parts
+  IS->get_pricegroups_for_parts(\%myconfig, \%$form);
+
+  # build up html code for prices_$i
+  set_pricegroup();
+
   &display_form;
 
   $lxdebug->leave_sub();
   &display_form;
 
   $lxdebug->leave_sub();
@@ -666,6 +774,12 @@ sub display_form {
     $form->{second_run} = 1;
     $form->{action}     = "display_form";
     $form->{rowcount}--;
     $form->{second_run} = 1;
     $form->{action}     = "display_form";
     $form->{rowcount}--;
+    my $rowcount =  $form->{rowcount};
+    # get pricegroups for parts
+    IS->get_pricegroups_for_parts(\%myconfig, \%$form, "new");
+    # build up html code for prices_$i
+    set_pricegroup($rowcount);
+  
 
     $form->{resubmit} = 1;
 
 
     $form->{resubmit} = 1;
 
@@ -676,10 +790,21 @@ sub display_form {
   $subroutine = "display_row";
 
   if ($form->{item} eq 'part') {
   $subroutine = "display_row";
 
   if ($form->{item} eq 'part') {
+    #set preisgruppenanzahl
+    $numrows    = $form->{price_rows};
+    $subroutine = "price_row";
+
+    &{$subroutine}($numrows);
+
     $numrows    = ++$form->{makemodel_rows};
     $subroutine = "makemodel_row";
   }
   if ($form->{item} eq 'assembly') {
     $numrows    = ++$form->{makemodel_rows};
     $subroutine = "makemodel_row";
   }
   if ($form->{item} eq 'assembly') {
+    $numrows    = ++$form->{price_rows};
+    $subroutine = "price_row";
+
+    &{$subroutine}($numrows);
+
     $numrows    = ++$form->{makemodel_rows};
     $subroutine = "makemodel_row";
 
     $numrows    = ++$form->{makemodel_rows};
     $subroutine = "makemodel_row";
 
@@ -690,6 +815,11 @@ sub display_form {
     $subroutine = "assembly_row";
   }
   if ($form->{item} eq 'service') {
     $subroutine = "assembly_row";
   }
   if ($form->{item} eq 'service') {
+    $numrows    = ++$form->{price_rows};
+    $subroutine = "price_row";
+
+    &{$subroutine}($numrows);
+
     $numrows = 0;
   }
 
     $numrows = 0;
   }
 
@@ -698,16 +828,12 @@ sub display_form {
 
   &form_footer;
 
 
   &form_footer;
 
-  #   if ($form->{print_and_post}) {
-  #     &display_form;
-  #   }
-
   $lxdebug->leave_sub();
 }
 
 sub check_form {
   $lxdebug->enter_sub();
   $lxdebug->leave_sub();
 }
 
 sub check_form {
   $lxdebug->enter_sub();
-
+print STDERR "io.pl-check_form\n";
   my @a     = ();
   my $count = 0;
   my @flds  = (
   my @a     = ();
   my $count = 0;
   my @flds  = (
@@ -752,6 +878,8 @@ sub check_form {
 
         map { $a[$j]->{$_} = $form->{"${_}_$i"} } @flds;
 
 
         map { $a[$j]->{$_} = $form->{"${_}_$i"} } @flds;
 
+        #($form->{"sellprice_$i"},$form->{"$pricegroup_old_$i"}) = split /--/, $form->{"sellprice_$i"};
+
         $form->{sellprice} += ($form->{"qty_$i"} * $form->{"sellprice_$i"});
         $form->{weight}    += ($form->{"qty_$i"} * $form->{"weight_$i"});
         $count++;
         $form->{sellprice} += ($form->{"qty_$i"} * $form->{"sellprice_$i"});
         $form->{weight}    += ($form->{"qty_$i"} * $form->{"weight_$i"});
         $count++;
@@ -808,6 +936,18 @@ sub check_form {
 
     }
   }
 
     }
   }
+  
+  #sk 
+  # if pricegroups
+  if ($form->{type} =~ (/sales_quotation/) or (($form->{level} =~ /Sales/) and ($form->{type} =~ /invoice/)) or (($form->{level} eq undef) and ($form->{type} =~ /invoice/)) or ($form->{type} =~ /sales_order/)) {
+  
+  # get pricegroups for parts
+  IS->get_pricegroups_for_parts(\%myconfig, \%$form);
+
+  # build up html code for prices_$i
+  set_pricegroup();
+  }
 
   &display_form;
 
 
   &display_form;
 
@@ -829,6 +969,8 @@ sub invoicetotal {
     $discount  = $form->parse_amount(\%myconfig, $form->{"discount_$i"});
     $qty       = $form->parse_amount(\%myconfig, $form->{"qty_$i"});
 
     $discount  = $form->parse_amount(\%myconfig, $form->{"discount_$i"});
     $qty       = $form->parse_amount(\%myconfig, $form->{"qty_$i"});
 
+    #($form->{"sellprice_$i"}, $form->{"$pricegroup_old_$i"}) = split /--/, $form->{"sellprice_$i"};
+
     $amount = $sellprice * (1 - $discount / 100) * $qty;
     map { $form->{"${_}_base"} += $amount }
       (split / /, $form->{"taxaccounts_$i"});
     $amount = $sellprice * (1 - $discount / 100) * $qty;
     map { $form->{"${_}_base"} += $amount }
       (split / /, $form->{"taxaccounts_$i"});
@@ -852,7 +994,7 @@ sub invoicetotal {
 
 sub validate_items {
   $lxdebug->enter_sub();
 
 sub validate_items {
   $lxdebug->enter_sub();
-
+print STDERR "io.pl-validate_items\n";
   # check if items are valid
   if ($form->{rowcount} == 1) {
     &update;
   # check if items are valid
   if ($form->{rowcount} == 1) {
     &update;
@@ -869,7 +1011,9 @@ sub validate_items {
 
 sub order {
   $lxdebug->enter_sub();
 
 sub order {
   $lxdebug->enter_sub();
-
+  if ($form->{second_run}) {
+    $form->{print_and_post} = 0;
+  }
   $form->{ordnumber} = $form->{invnumber};
 
   map { delete $form->{$_} } qw(id printed emailed queued);
   $form->{ordnumber} = $form->{invnumber};
 
   map { delete $form->{$_} } qw(id printed emailed queued);
@@ -922,7 +1066,9 @@ sub order {
 
 sub quotation {
   $lxdebug->enter_sub();
 
 sub quotation {
   $lxdebug->enter_sub();
-
+  if ($form->{second_run}) {
+    $form->{print_and_post} = 0;
+  }
   map { delete $form->{$_} } qw(id printed emailed queued);
 
   if ($form->{script} eq 'ir.pl' || $form->{type} eq 'purchase_order') {
   map { delete $form->{$_} } qw(id printed emailed queued);
 
   if ($form->{script} eq 'ir.pl' || $form->{type} eq 'purchase_order') {
@@ -974,7 +1120,10 @@ sub quotation {
 
 sub e_mail {
   $lxdebug->enter_sub();
 
 sub e_mail {
   $lxdebug->enter_sub();
-
+  if ($form->{second_run}) {
+    $form->{print_and_post} = 0;
+    $form->{resubmit} = 0;
+  }
   if ($myconfig{role} eq 'admin') {
     $bcc = qq|
          <th align=right nowrap=true>| . $locale->text('Bcc') . qq|</th>
   if ($myconfig{role} eq 'admin') {
     $bcc = qq|
          <th align=right nowrap=true>| . $locale->text('Bcc') . qq|</th>
@@ -1086,7 +1235,7 @@ sub send_email {
 
 sub print_options {
   $lxdebug->enter_sub();
 
 sub print_options {
   $lxdebug->enter_sub();
-
+print STDERR "io.pl-print_options\n";
   $form->{sendmode} = "attachment";
   $form->{copies}   = 3 unless $form->{copies};
 
   $form->{sendmode} = "attachment";
   $form->{copies}   = 3 unless $form->{copies};
 
@@ -1243,7 +1392,9 @@ sub print_options {
 
 sub print {
   $lxdebug->enter_sub();
 
 sub print {
   $lxdebug->enter_sub();
-
+  if ($form->{second_run}) {
+    $form->{print_and_post} = 0;
+  }
   # if this goes to the printer pass through
   if ($form->{media} eq 'printer' || $form->{media} eq 'queue') {
     $form->error($locale->text('Select postscript or PDF!'))
   # if this goes to the printer pass through
   if ($form->{media} eq 'printer' || $form->{media} eq 'queue') {
     $form->error($locale->text('Select postscript or PDF!'))
@@ -1264,7 +1415,6 @@ sub print_form {
 
   $inv = "inv";
   $due = "due";
 
   $inv = "inv";
   $due = "due";
-
   $numberfld = "invnumber";
 
   $display_form =
   $numberfld = "invnumber";
 
   $display_form =
@@ -1356,7 +1506,16 @@ sub print_form {
   if (!$form->{"${inv}number"} && !$form->{preview}) {
     $form->{"${inv}number"} = $form->update_defaults(\%myconfig, $numberfld);
     if ($form->{media} ne 'email') {
   if (!$form->{"${inv}number"} && !$form->{preview}) {
     $form->{"${inv}number"} = $form->update_defaults(\%myconfig, $numberfld);
     if ($form->{media} ne 'email') {
+        $i = $form->{rowcount};
+        # get pricegroups for parts
+        IS->get_pricegroups_for_parts(\%myconfig, \%$form);
+
+        # build up html code for prices_$i
+        set_pricegroup();
+
       $form->{rowcount}--;
       $form->{rowcount}--;
+
       &{"$display_form"};
       exit;
     }
       &{"$display_form"};
       exit;
     }
@@ -1552,7 +1711,7 @@ sub print_form {
 
 sub customer_details {
   $lxdebug->enter_sub();
 
 sub customer_details {
   $lxdebug->enter_sub();
-
+print STDERR "io.pl-customer_details\n";
   IS->customer_details(\%myconfig, \%$form);
   $lxdebug->leave_sub();
 }
   IS->customer_details(\%myconfig, \%$form);
   $lxdebug->leave_sub();
 }
@@ -1578,23 +1737,32 @@ sub post_as_new {
 
 sub ship_to {
   $lxdebug->enter_sub();
 
 sub ship_to {
   $lxdebug->enter_sub();
+  if ($form->{second_run}) {
+    $form->{print_and_post} = 0;
+  }
 
   $title = $form->{title};
   $form->{title} = $locale->text('Ship to');
 
   map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) }
     qw(exchangerate creditlimit creditremaining);
 
   $title = $form->{title};
   $form->{title} = $locale->text('Ship to');
 
   map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) }
     qw(exchangerate creditlimit creditremaining);
-  $form_id = $form->{id};
+
 
   # get details for name
   &{"$form->{vc}_details"};
 
   # get details for name
   &{"$form->{vc}_details"};
-  $form->{id} = $form_id;
 
   $number =
     ($form->{vc} eq 'customer')
     ? $locale->text('Customer Number')
     : $locale->text('Vendor Number');
 
 
   $number =
     ($form->{vc} eq 'customer')
     ? $locale->text('Customer Number')
     : $locale->text('Vendor Number');
 
+  $i = $form->{rowcount};
+  # get pricegroups for parts
+  IS->get_pricegroups_for_parts(\%myconfig, \%$form);
+
+  # build up html code for prices_$i
+  set_pricegroup();
+
   $nextsub = ($form->{display_form}) ? $form->{display_form} : "display_form";
 
   $form->{rowcount}--;
   $nextsub = ($form->{display_form}) ? $form->{display_form} : "display_form";
 
   $form->{rowcount}--;
index a684593e7f0871e68e9a2c26353552c3bd699a95..caa8a0e6d511c2dbd70931afccb2d7adbbb583b9 100644 (file)
@@ -43,7 +43,7 @@ require "$form->{path}/arap.pl";
 
 sub add {
   $lxdebug->enter_sub();
 
 sub add {
   $lxdebug->enter_sub();
-
+print STDERR "ir.pl-add\n";
   $form->{title} = $locale->text('Add Vendor Invoice');
 
   &invoice_links;
   $form->{title} = $locale->text('Add Vendor Invoice');
 
   &invoice_links;
@@ -67,7 +67,7 @@ sub edit {
 
 sub invoice_links {
   $lxdebug->enter_sub();
 
 sub invoice_links {
   $lxdebug->enter_sub();
-
+print STDERR "ir.pl-invoice_links\n";
   # create links
   $form->{webdav} = $webdav;
 
   # create links
   $form->{webdav} = $webdav;
 
@@ -160,7 +160,7 @@ sub invoice_links {
 
 sub prepare_invoice {
   $lxdebug->enter_sub();
 
 sub prepare_invoice {
   $lxdebug->enter_sub();
-
+print STDERR "ir.pl-prepare_invoice\n";
   if ($form->{id}) {
 
     map { $form->{$_} =~ s/\"/&quot;/g } qw(invnumber ordnumber quonumber);
   if ($form->{id}) {
 
     map { $form->{$_} =~ s/\"/&quot;/g } qw(invnumber ordnumber quonumber);
@@ -188,7 +188,7 @@ sub prepare_invoice {
 
 sub form_header {
   $lxdebug->enter_sub();
 
 sub form_header {
   $lxdebug->enter_sub();
-
+print STDERR "ir.pl-form_header\n";
   # set option selected
   foreach $item (qw(AP vendor currency department contact)) {
     $form->{"select$item"} =~ s/ selected//;
   # set option selected
   foreach $item (qw(AP vendor currency department contact)) {
     $form->{"select$item"} =~ s/ selected//;
@@ -304,6 +304,7 @@ sub form_header {
 <input type=hidden name=title value="$form->{title}">
 <input type=hidden name=vc value="vendor">
 <input type=hidden name=type value=$form->{type}>
 <input type=hidden name=title value="$form->{title}">
 <input type=hidden name=vc value="vendor">
 <input type=hidden name=type value=$form->{type}>
+<input type=hidden name=level value=$form->{level}>
 
 <input type=hidden name=creditlimit value=$form->{creditlimit}>
 <input type=hidden name=creditremaining value=$form->{creditremaining}>
 
 <input type=hidden name=creditlimit value=$form->{creditlimit}>
 <input type=hidden name=creditremaining value=$form->{creditremaining}>
@@ -416,7 +417,7 @@ $jsscript
 
 sub form_footer {
   $lxdebug->enter_sub();
 
 sub form_footer {
   $lxdebug->enter_sub();
-
+print STDERR "ir.pl-form_footer\n";
   $form->{invtotal} = $form->{invsubtotal};
 
   if (($rows = $form->numtextrows($form->{notes}, 25, 8)) < 2) {
   $form->{invtotal} = $form->{invsubtotal};
 
   if (($rows = $form->numtextrows($form->{notes}, 25, 8)) < 2) {
index 4e6a066dbe5c4690375c13161416b374c53719a3..53230d2b4a12faca54e55d17342b0831397fe252 100644 (file)
@@ -33,6 +33,7 @@
 
 use SL::IS;
 use SL::PE;
 
 use SL::IS;
 use SL::PE;
+use Data::Dumper;
 
 require "$form->{path}/io.pl";
 require "$form->{path}/arap.pl";
 
 require "$form->{path}/io.pl";
 require "$form->{path}/arap.pl";
@@ -66,7 +67,7 @@ sub add {
 
 sub edit {
   $lxdebug->enter_sub();
 
 sub edit {
   $lxdebug->enter_sub();
-
+print STDERR "is.pl-edit\n";
   $form->{title} = $locale->text('Edit Sales Invoice');
 
   if ($myconfig{acs} =~ "AR--Add Sales Invoice" || $myconfig{acs} =~ "AR--AR")
   $form->{title} = $locale->text('Edit Sales Invoice');
 
   if ($myconfig{acs} =~ "AR--Add Sales Invoice" || $myconfig{acs} =~ "AR--AR")
@@ -83,7 +84,7 @@ sub edit {
 
 sub invoice_links {
   $lxdebug->enter_sub();
 
 sub invoice_links {
   $lxdebug->enter_sub();
-
+print STDERR "is.pl-invoice_links\n";
   $form->{vc} = 'customer';
 
   # create links
   $form->{vc} = 'customer';
 
   # create links
@@ -183,7 +184,7 @@ sub invoice_links {
 
 sub prepare_invoice {
   $lxdebug->enter_sub();
 
 sub prepare_invoice {
   $lxdebug->enter_sub();
-
+print STDERR "is.pl-prepare_invoice\n";
   $form->{type}     = "invoice";
   $form->{formname} = "invoice";
   $form->{format}   = "html";
   $form->{type}     = "invoice";
   $form->{formname} = "invoice";
   $form->{format}   = "html";
@@ -194,12 +195,14 @@ sub prepare_invoice {
     map { $form->{$_} =~ s/\"/&quot;/g }
       qw(invnumber ordnumber quonumber shippingpoint shipvia notes intnotes);
 
     map { $form->{$_} =~ s/\"/&quot;/g }
       qw(invnumber ordnumber quonumber shippingpoint shipvia notes intnotes);
 
+#     # get pricegroups for parts
+#     IS->get_pricegroups_for_parts(\%myconfig, \%$form);
+
     foreach $ref (@{ $form->{invoice_details} }) {
       $i++;
       map { $form->{"${_}_$i"} = $ref->{$_} } keys %{$ref};
       $form->{"discount_$i"} =
         $form->format_amount(\%myconfig, $form->{"discount_$i"} * 100);
     foreach $ref (@{ $form->{invoice_details} }) {
       $i++;
       map { $form->{"${_}_$i"} = $ref->{$_} } keys %{$ref};
       $form->{"discount_$i"} =
         $form->format_amount(\%myconfig, $form->{"discount_$i"} * 100);
-
       ($dec) = ($form->{"sellprice_$i"} =~ /\.(\d+)/);
       $dec           = length $dec;
       $decimalplaces = ($dec > 2) ? $dec : 2;
       ($dec) = ($form->{"sellprice_$i"} =~ /\.(\d+)/);
       $dec           = length $dec;
       $decimalplaces = ($dec > 2) ? $dec : 2;
@@ -212,6 +215,7 @@ sub prepare_invoice {
       map { $form->{"${_}_$i"} =~ s/\"/&quot;/g }
         qw(partnumber description unit partnotes);
       $form->{rowcount} = $i;
       map { $form->{"${_}_$i"} =~ s/\"/&quot;/g }
         qw(partnumber description unit partnotes);
       $form->{rowcount} = $i;
+
     }
   }
   $lxdebug->leave_sub();
     }
   }
   $lxdebug->leave_sub();
@@ -219,7 +223,7 @@ sub prepare_invoice {
 
 sub form_header {
   $lxdebug->enter_sub();
 
 sub form_header {
   $lxdebug->enter_sub();
-
+print STDERR "is.pl-form_header\n";
   # set option selected
   foreach $item (qw(AR customer currency department employee contact)) {
     $form->{"select$item"} =~ s/ selected//;
   # set option selected
   foreach $item (qw(AR customer currency department employee contact)) {
     $form->{"select$item"} =~ s/ selected//;
@@ -389,6 +393,7 @@ sub form_header {
              <tr>
                <th align=right nowrap>| . $locale->text('Customer') . qq|</th>
                <td colspan=3>$customer</td>
              <tr>
                <th align=right nowrap>| . $locale->text('Customer') . qq|</th>
                <td colspan=3>$customer</td>
+    <input type=hidden name=customer_klass value=$form->{customer_klass}>
                <input type=hidden name=customer_id value=$form->{customer_id}>
                <input type=hidden name=oldcustomer value="$form->{oldcustomer}">
                 <th align=richt nowrap>|
                <input type=hidden name=customer_id value=$form->{customer_id}>
                <input type=hidden name=oldcustomer value="$form->{oldcustomer}">
                 <th align=richt nowrap>|
@@ -514,7 +519,7 @@ $jsscript
 
 sub form_footer {
   $lxdebug->enter_sub();
 
 sub form_footer {
   $lxdebug->enter_sub();
-
+print STDERR "is.pl-form_footer\n";
   $form->{invtotal} = $form->{invsubtotal};
 
   if (($rows = $form->numtextrows($form->{notes}, 26, 8)) < 2) {
   $form->{invtotal} = $form->{invsubtotal};
 
   if (($rows = $form->numtextrows($form->{notes}, 26, 8)) < 2) {
@@ -855,7 +860,9 @@ sub update {
 
   map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) }
     qw(exchangerate creditlimit creditremaining);
 
   map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) }
     qw(exchangerate creditlimit creditremaining);
-
+  if ($form->{second_run}) {
+    $form->{print_and_post} = 0;
+  }
   &check_name(customer);
 
   &check_project;
   &check_name(customer);
 
   &check_project;
@@ -916,7 +923,7 @@ sub update {
       } else {
 
         $sellprice = $form->format_amount(\%myconfig, $form->{"sellprice_$i"});
       } else {
 
         $sellprice = $form->format_amount(\%myconfig, $form->{"sellprice_$i"});
-
+#print STDERR " SELLPRICE-111- $sellprice\n";
         map { $form->{item_list}[$i]{$_} =~ s/\"/&quot;/g }
           qw(partnumber description unit);
         map { $form->{"${_}_$i"} = $form->{item_list}[0]{$_} }
         map { $form->{item_list}[$i]{$_} =~ s/\"/&quot;/g }
           qw(partnumber description unit);
         map { $form->{"${_}_$i"} = $form->{item_list}[0]{$_} }
@@ -973,6 +980,11 @@ sub update {
           }
         }
 
           }
         }
 
+        # get pricegroups for parts
+        IS->get_pricegroups_for_parts(\%myconfig, \%$form, "new");
+
+        # build up html code for prices_$i
+        &set_pricegroup($i);
       }
 
       &display_form;
       }
 
       &display_form;
@@ -1003,7 +1015,6 @@ sub update {
 
 sub post {
   $lxdebug->enter_sub();
 
 sub post {
   $lxdebug->enter_sub();
-
   $form->isblank("invdate",  $locale->text('Invoice Date missing!'));
   $form->isblank("customer", $locale->text('Customer missing!'));
 
   $form->isblank("invdate",  $locale->text('Invoice Date missing!'));
   $form->isblank("customer", $locale->text('Customer missing!'));
 
@@ -1012,6 +1023,9 @@ sub post {
     &update;
     exit;
   }
     &update;
     exit;
   }
+  if ($form->{second_run}) {
+    $form->{print_and_post} = 0;
+  }
 
   &validate_items;
 
 
   &validate_items;
 
@@ -1072,6 +1086,7 @@ sub print_and_post {
   $print_post             = 1;
   $form->{print_and_post} = 1;
   &post();
   $print_post             = 1;
   $form->{print_and_post} = 1;
   &post();
+
   &display_form();
   $lxdebug->leave_sub();
 
   &display_form();
   $lxdebug->leave_sub();
 
@@ -1092,7 +1107,9 @@ sub preview {
 
 sub delete {
   $lxdebug->enter_sub();
 
 sub delete {
   $lxdebug->enter_sub();
-
+  if ($form->{second_run}) {
+    $form->{print_and_post} = 0;
+  }
   $form->header;
 
   print qq|
   $form->header;
 
   print qq|
index 44bfbd49d68c39a6202ace05b5db9867d8e71f30..dbcc5fdf78e4da04a044914e027d99bba8c2078b 100644 (file)
@@ -241,14 +241,12 @@ sub form_header {
     $button1 = qq|
        <td><input name=transdate id=transdate size=11 title="$myconfig{dateformat}" value=$form->{transdate}></td>
        <td><input type=button name=transdate id="trigger1" value=|
     $button1 = qq|
        <td><input name=transdate id=transdate size=11 title="$myconfig{dateformat}" value=$form->{transdate}></td>
        <td><input type=button name=transdate id="trigger1" value=|
-      . $locale->text('button')
-      . qq|></td>
+      . $locale->text('button') . qq|></td>
       |;
     $button2 = qq|
        <td width="13"><input name=reqdate id=reqdate size=11 title="$myconfig{dateformat}" value=$form->{reqdate}></td>
        <td width="4"><input type=button name=reqdate name=reqdate id="trigger2" value=|
       |;
     $button2 = qq|
        <td width="13"><input name=reqdate id=reqdate size=11 title="$myconfig{dateformat}" value=$form->{reqdate}></td>
        <td width="4"><input type=button name=reqdate name=reqdate id="trigger2" value=|
-      . $locale->text('button')
-      . qq|></td>
+      . $locale->text('button') . qq|></td>
      |;
 
     #write Trigger
      |;
 
     #write Trigger
@@ -272,11 +270,9 @@ sub form_header {
          <table>
            <tr>
              <th nowrap><input name=closed type=radio class=radio value=0 $checkedopen> |
          <table>
            <tr>
              <th nowrap><input name=closed type=radio class=radio value=0 $checkedopen> |
-      . $locale->text('Open')
-      . qq|</th>
+      . $locale->text('Open') . qq|</th>
              <th nowrap><input name=closed type=radio class=radio value=1 $checkedclosed> |
              <th nowrap><input name=closed type=radio class=radio value=1 $checkedclosed> |
-      . $locale->text('Closed')
-      . qq|</th>
+      . $locale->text('Closed') . qq|</th>
            </tr>
          </table>
        </td>
            </tr>
          </table>
        </td>
@@ -345,8 +341,7 @@ sub form_header {
                     <tr>
                      <th align=right nowrap>| . $locale->text('Terms: Net') . qq|</th>
                      <td nowrap><input name=terms size="3" maxlength="3" value=$form->{terms}> |
                     <tr>
                      <th align=right nowrap>| . $locale->text('Terms: Net') . qq|</th>
                      <td nowrap><input name=terms size="3" maxlength="3" value=$form->{terms}> |
-    . $locale->text('days')
-    . qq|</td>
+    . $locale->text('days') . qq|</td>
                     </tr>
 |;
 
                     </tr>
 |;
 
@@ -371,14 +366,12 @@ sub form_header {
              </tr>
              <tr>
                <th width=70% align=right nowrap>|
              </tr>
              <tr>
                <th width=70% align=right nowrap>|
-      . $locale->text('Quotation Number')
-      . qq|</th>
+      . $locale->text('Quotation Number') . qq|</th>
                 <td><input name=quonumber size=11 value="$form->{quonumber}"></td>
              </tr>
               <tr>
                <th width=70% align=right nowrap>|
                 <td><input name=quonumber size=11 value="$form->{quonumber}"></td>
              </tr>
               <tr>
                <th width=70% align=right nowrap>|
-      . $locale->text('Customer Order Number')
-      . qq|</th>
+      . $locale->text('Customer Order Number') . qq|</th>
                 <td><input name=cusordnumber size=11 value="$form->{cusordnumber}"></td>
              </tr>
              <tr>
                 <td><input name=cusordnumber size=11 value="$form->{cusordnumber}"></td>
              </tr>
              <tr>
@@ -419,8 +412,7 @@ sub form_header {
       $ordnumber = qq|
              <tr>
                <th width=70% align=right nowrap>|
       $ordnumber = qq|
              <tr>
                <th width=70% align=right nowrap>|
-        . $locale->text('Quotation Number')
-        . qq|</th>
+        . $locale->text('Quotation Number') . qq|</th>
                <td><input name=quonumber size=11 value="$form->{quonumber}"></td>
                <input type=hidden name=ordnumber value="$form->{ordnumber}">
              </tr>
                <td><input name=quonumber size=11 value="$form->{quonumber}"></td>
                <input type=hidden name=ordnumber value="$form->{ordnumber}">
              </tr>
@@ -471,6 +463,7 @@ sub form_header {
   if ($form->{type} eq 'sales_order') {
     if ($form->{selectemployee}) {
       $employee = qq|
   if ($form->{type} eq 'sales_order') {
     if ($form->{selectemployee}) {
       $employee = qq|
+    <input type=hidden name=customer_klass value=$form->{customer_klass}>
              <tr>
                <th align=right nowrap>| . $locale->text('Salesperson') . qq|</th>
                <td colspan=2><select name=employee>$form->{selectemployee}</select></td>
              <tr>
                <th align=right nowrap>| . $locale->text('Salesperson') . qq|</th>
                <td colspan=2><select name=employee>$form->{selectemployee}</select></td>
@@ -481,6 +474,7 @@ sub form_header {
     }
   } else {
     $employee = qq|
     }
   } else {
     $employee = qq|
+    <input type=hidden name=customer_klass value=$form->{customer_klass}>
              <tr>
                <th align=right nowrap>| . $locale->text('Employee') . qq|</th>
                <td colspan=2><select name=employee>$form->{selectemployee}</select></td>
              <tr>
                <th align=right nowrap>| . $locale->text('Employee') . qq|</th>
                <td colspan=2><select name=employee>$form->{selectemployee}</select></td>
@@ -537,8 +531,7 @@ sub form_header {
                <input type=hidden name=$form->{vc}_id value=$form->{"$form->{vc}_id"}>
                <input type=hidden name="old$form->{vc}" value="$form->{"old$form->{vc}"}">
                 <th align=richt nowrap>|
                <input type=hidden name=$form->{vc}_id value=$form->{"$form->{vc}_id"}>
                <input type=hidden name="old$form->{vc}" value="$form->{"old$form->{vc}"}">
                 <th align=richt nowrap>|
-    . $locale->text('Contact Person')
-    . qq|</th>
+    . $locale->text('Contact Person') . qq|</th>
                 <td colspan=3>$contact</td>
              </tr>
              $creditremaining
                 <td colspan=3>$contact</td>
              </tr>
              $creditremaining
@@ -633,8 +626,7 @@ sub form_footer {
   if ($form->{taxaccounts}) {
     $taxincluded = qq|
              <input name=taxincluded class=checkbox type=checkbox value=1 $form->{taxincluded}> <b>|
   if ($form->{taxaccounts}) {
     $taxincluded = qq|
              <input name=taxincluded class=checkbox type=checkbox value=1 $form->{taxincluded}> <b>|
-      . $locale->text('Tax Included')
-      . qq|</b><br><br>
+      . $locale->text('Tax Included') . qq|</b><br><br>
 |;
   }
 
 |;
   }
 
@@ -888,7 +880,9 @@ sub update {
                     \%myconfig, $form->{currency}, $form->{transdate}, $buysell
                     )));
 
                     \%myconfig, $form->{currency}, $form->{transdate}, $buysell
                     )));
 
-  my $i = $form->{rowcount};
+  # for pricegroups
+  $i = $form->{rowcount};
+
   $exchangerate = ($form->{exchangerate}) ? $form->{exchangerate} : 1;
 
   if (   ($form->{"partnumber_$i"} eq "")
   $exchangerate = ($form->{exchangerate}) ? $form->{exchangerate} : 1;
 
   if (   ($form->{"partnumber_$i"} eq "")
@@ -940,6 +934,7 @@ sub update {
           $form->{"sellprice_$i"} = $sellprice;
         } else {
 
           $form->{"sellprice_$i"} = $sellprice;
         } else {
 
+          $form->{"sellprice_$i"} *= (1 - $form->{tradediscount});
           # if there is an exchange rate adjust sellprice
           $form->{"sellprice_$i"} /= $exchangerate;
         }
           # if there is an exchange rate adjust sellprice
           $form->{"sellprice_$i"} /= $exchangerate;
         }
@@ -961,6 +956,12 @@ sub update {
                                $decimalplaces);
         $form->{"qty_$i"} =
           $form->format_amount(\%myconfig, $form->{"qty_$i"});
                                $decimalplaces);
         $form->{"qty_$i"} =
           $form->format_amount(\%myconfig, $form->{"qty_$i"});
+
+        # get pricegroups for parts
+        IS->get_pricegroups_for_parts(\%myconfig, \%$form);
+
+        # build up html code for prices_$i
+        &set_pricegroup($i);
       }
 
       &display_form;
       }
 
       &display_form;
@@ -1046,7 +1047,8 @@ sub search {
       $form->{warehouse}       = qq|$form->{warehouse}--$form->{warehouse_id}|;
 
       map {
       $form->{warehouse}       = qq|$form->{warehouse}--$form->{warehouse_id}|;
 
       map {
-        $form->{selectwarehouse} .= "<option>$_->{description}--$_->{id}\n"
+        $form->{selectwarehouse} .=
+          "<option>$_->{description}--$_->{id}\n"
       } (@{ $form->{all_warehouses} });
 
       $warehouse = qq|
       } (@{ $form->{all_warehouses} });
 
       $warehouse = qq|
@@ -1099,11 +1101,9 @@ sub search {
     $openclosed = qq|
              <tr>
                <td><input name="open" class=checkbox type=checkbox value=1 checked> |
     $openclosed = qq|
              <tr>
                <td><input name="open" class=checkbox type=checkbox value=1 checked> |
-      . $locale->text('Open')
-      . qq|</td>
+      . $locale->text('Open') . qq|</td>
                <td><input name="closed" class=checkbox type=checkbox value=1 $form->{closed}> |
                <td><input name="closed" class=checkbox type=checkbox value=1 $form->{closed}> |
-      . $locale->text('Closed')
-      . qq|</td>
+      . $locale->text('Closed') . qq|</td>
              </tr>
 |;
   } else {
              </tr>
 |;
   } else {
@@ -1122,14 +1122,12 @@ sub search {
     $button1 = qq|
        <td><input name=transdatefrom id=transdatefrom size=11 title="$myconfig{dateformat}">
        <input type=button name=transdatefrom id="trigger3" value=|
     $button1 = qq|
        <td><input name=transdatefrom id=transdatefrom size=11 title="$myconfig{dateformat}">
        <input type=button name=transdatefrom id="trigger3" value=|
-      . $locale->text('button')
-      . qq|></td>
+      . $locale->text('button') . qq|></td>
       |;
     $button2 = qq|
        <td><input name=transdateto id=transdateto size=11 title="$myconfig{dateformat}">
        <input type=button name=transdateto name=transdateto id="trigger4" value=|
       |;
     $button2 = qq|
        <td><input name=transdateto id=transdateto size=11 title="$myconfig{dateformat}">
        <input type=button name=transdateto name=transdateto id="trigger4" value=|
-      . $locale->text('button')
-      . qq|></td>
+      . $locale->text('button') . qq|></td>
      |;
 
     #write Trigger
      |;
 
     #write Trigger
@@ -1187,34 +1185,27 @@ sub search {
                | . $locale->text('ID') . qq|</td>
                <td><input name="l_$ordnumber" class=checkbox type=checkbox value=Y checked> $ordlabel</td>
                <td><input name="l_transdate" class=checkbox type=checkbox value=Y checked> |
                | . $locale->text('ID') . qq|</td>
                <td><input name="l_$ordnumber" class=checkbox type=checkbox value=Y checked> $ordlabel</td>
                <td><input name="l_transdate" class=checkbox type=checkbox value=Y checked> |
-    . $locale->text('Date')
-    . qq|</td>
+    . $locale->text('Date') . qq|</td>
                <td><input name="l_reqdate" class=checkbox type=checkbox value=Y checked> |
                <td><input name="l_reqdate" class=checkbox type=checkbox value=Y checked> |
-    . $locale->text('Required by')
-    . qq|</td>
+    . $locale->text('Required by') . qq|</td>
              </tr>
              <tr>
                <td><input name="l_name" class=checkbox type=checkbox value=Y checked> $vclabel</td>
                <td><input name="l_employee" class=checkbox type=checkbox value=Y checked> $employee</td>
                <td><input name="l_shipvia" class=checkbox type=checkbox value=Y> |
              </tr>
              <tr>
                <td><input name="l_name" class=checkbox type=checkbox value=Y checked> $vclabel</td>
                <td><input name="l_employee" class=checkbox type=checkbox value=Y checked> $employee</td>
                <td><input name="l_shipvia" class=checkbox type=checkbox value=Y> |
-    . $locale->text('Ship via')
-    . qq|</td>
+    . $locale->text('Ship via') . qq|</td>
              </tr>
              <tr>
                <td><input name="l_netamount" class=checkbox type=checkbox value=Y> |
              </tr>
              <tr>
                <td><input name="l_netamount" class=checkbox type=checkbox value=Y> |
-    . $locale->text('Amount')
-    . qq|</td>
+    . $locale->text('Amount') . qq|</td>
                <td><input name="l_tax" class=checkbox type=checkbox value=Y> |
                <td><input name="l_tax" class=checkbox type=checkbox value=Y> |
-    . $locale->text('Tax')
-    . qq|</td>
+    . $locale->text('Tax') . qq|</td>
                <td><input name="l_amount" class=checkbox type=checkbox value=Y checked> |
                <td><input name="l_amount" class=checkbox type=checkbox value=Y checked> |
-    . $locale->text('Total')
-    . qq|</td>
+    . $locale->text('Total') . qq|</td>
              </tr>
              <tr>
                <td><input name="l_subtotal" class=checkbox type=checkbox value=Y> |
              </tr>
              <tr>
                <td><input name="l_subtotal" class=checkbox type=checkbox value=Y> |
-    . $locale->text('Subtotal')
-    . qq|</td>
+    . $locale->text('Subtotal') . qq|</td>
              </tr>
            </table>
           </td>
              </tr>
            </table>
           </td>
@@ -2119,7 +2110,8 @@ sub ship_receive {
 
     # undo formatting from prepare_order
     map {
 
     # undo formatting from prepare_order
     map {
-      $form->{"${_}_$i"} = $form->parse_amount(\%myconfig, $form->{"${_}_$i"})
+      $form->{"${_}_$i"} =
+        $form->parse_amount(\%myconfig, $form->{"${_}_$i"})
     } qw(qty ship);
     $n = ($form->{"qty_$i"} -= $form->{"ship_$i"});
     if (abs($n) > 0
     } qw(qty ship);
     $n = ($form->{"qty_$i"} -= $form->{"ship_$i"});
     if (abs($n) > 0
index 201e96b225e356bcf944418044b47f569dffdd1c..0fd351dbe409545ab85fad472b27a769e0a3368a 100644 (file)
@@ -65,7 +65,9 @@ sub edit {
   if ($form->{type} eq 'partsgroup') {
     PE->get_partsgroup(\%myconfig, \%$form);
   }
   if ($form->{type} eq 'partsgroup') {
     PE->get_partsgroup(\%myconfig, \%$form);
   }
-
+  if ($form->{type} eq 'pricegroup') {
+    PE->get_pricegroup(\%myconfig, \%$form);
+  }
   &{"form_$form->{type}_header"};
   &{"form_$form->{type}_footer"};
 
   &{"form_$form->{type}_header"};
   &{"form_$form->{type}_footer"};
 
@@ -106,6 +108,21 @@ sub search {
 
   }
 
 
   }
 
+  # for pricesgroups
+  if ($form->{type} eq 'pricegroup') {
+    $report        = "pricegroup_report";
+    $sort          = 'pricegroup';
+    $form->{title} = $locale->text('Pricegroup');
+
+    $number = qq|
+       <tr>
+         <th align=right width=1%>| . $locale->text('Pricegroup') . qq|</th>
+         <td><input name=pricegroup size=20></td>
+       </tr>
+|;
+
+  }
+
   $form->header;
 
   print qq|
   $form->header;
 
   print qq|
@@ -130,8 +147,7 @@ sub search {
          <td><input name=status class=radio type=radio value=all checked>&nbsp;|
     . $locale->text('All') . qq|
          <input name=status class=radio type=radio value=orphaned>&nbsp;|
          <td><input name=status class=radio type=radio value=all checked>&nbsp;|
     . $locale->text('All') . qq|
          <input name=status class=radio type=radio value=orphaned>&nbsp;|
-    . $locale->text('Orphaned')
-    . qq|</td>
+    . $locale->text('Orphaned') . qq|</td>
        </tr>
       </table>
     </td>
        </tr>
       </table>
     </td>
@@ -397,6 +413,13 @@ sub save {
     $form->redirect($locale->text('Group saved!'));
   }
 
     $form->redirect($locale->text('Group saved!'));
   }
 
+  # choice pricegroup and save
+  if ($form->{type} eq 'pricegroup') {
+    $form->isblank("pricegroup", $locale->text('Pricegroup missing!'));
+    PE->save_pricegroup(\%myconfig, \%$form);
+    $form->redirect($locale->text('Pricegroup saved!'));
+  }
+
   $lxdebug->leave_sub();
 }
 
   $lxdebug->leave_sub();
 }
 
@@ -411,6 +434,9 @@ sub delete {
   if ($form->{type} eq 'partsgroup') {
     $form->redirect($locale->text('Group deleted!'));
   }
   if ($form->{type} eq 'partsgroup') {
     $form->redirect($locale->text('Group deleted!'));
   }
+  if ($form->{type} eq 'pricegroup') {
+    $form->redirect($locale->text('Pricegroup deleted!'));
+  }
 
   $lxdebug->leave_sub();
 }
 
   $lxdebug->leave_sub();
 }
@@ -611,3 +637,208 @@ sub form_partsgroup_footer {
 
   $lxdebug->leave_sub();
 }
 
   $lxdebug->leave_sub();
 }
+
+#################################
+# get pricesgroups and build up html-code
+#
+sub pricegroup_report {
+  $lxdebug->enter_sub();
+
+  map { $form->{$_} = $form->unescape($form->{$_}) } (pricegroup);
+  PE->pricegroups(\%myconfig, \%$form);
+
+  $callback =
+    "$form->{script}?action=pricegroup_report&type=$form->{type}&path=$form->{path}&login=$form->{login}&password=$form->{password}&status=$form->{status}";
+
+  if ($form->{status} eq 'all') {
+    $option = $locale->text('All');
+  }
+  if ($form->{status} eq 'orphaned') {
+    $option .= $locale->text('Orphaned');
+  }
+  if ($form->{pricegroup}) {
+    $callback .= "&pricegroup=$form->{pricegroup}";
+    $option   .=
+      "\n<br>" . $locale->text('Pricegroup') . " : $form->{pricegroup}";
+  }
+
+  @column_index = $form->sort_columns(qw(pricegroup));
+
+  $column_header{pricegroup} =
+      qq|<th class=listheading width=90%>|
+    . $locale->text('Pricegroup')
+    . qq|</th>|;
+
+  $form->{title} = $locale->text('Pricegroup');
+
+  $form->header;
+
+  print qq|
+<body>
+
+<table width=100%>
+  <tr>
+    <th class=listtop>$form->{title}</th>
+  </tr>
+  <tr height="5"></tr>
+  <tr>
+    <td>$option</td>
+  </tr>
+  <tr>
+    <td>
+      <table width=100%>
+       <tr class=listheading>
+|;
+
+  map { print "$column_header{$_}\n" } @column_index;
+
+  print qq|
+        </tr>
+|;
+
+  # escape callback
+  $form->{callback} = $callback;
+
+  # escape callback for href
+  $callback = $form->escape($callback);
+
+  foreach $ref (@{ $form->{item_list} }) {
+
+    $i++;
+    $i %= 2;
+
+    print qq|
+        <tr valign=top class=listrow$i>
+|;
+    $column_data{pricegroup} =
+      qq|<td><a href=$form->{script}?action=edit&type=$form->{type}&status=$form->{status}&id=$ref->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{pricegroup}</td>|;
+
+    map { print "$column_data{$_}\n" } @column_index;
+
+    print "
+        </tr>
+";
+  }
+
+  print qq|
+      </table>
+    </td>
+  </tr>
+  <tr>
+    <td><hr size=3 noshade></td>
+  </tr>
+</table>
+
+<br>
+<form method=post action=$form->{script}>
+
+<input name=callback type=hidden value="$form->{callback}">
+
+<input type=hidden name=type value=$form->{type}>
+
+<input type=hidden name=path value=$form->{path}>
+<input type=hidden name=login value=$form->{login}>
+<input type=hidden name=password value=$form->{password}>
+
+<input class=submit type=submit name=action value="|
+    . $locale->text('Add') . qq|">|;
+
+  if ($form->{menubar}) {
+    require "$form->{path}/menu.pl";
+    &menubar;
+  }
+
+  print qq|
+  </form>
+
+</body>
+</html>
+|;
+
+  $lxdebug->leave_sub();
+}
+
+#######################
+#build up pricegroup_header
+#
+sub form_pricegroup_header {
+  $lxdebug->enter_sub();
+
+  # $locale->text('Add Pricegroup')
+  # $locale->text('Edit Pricegroup')
+
+  $form->{title} = $locale->text("$form->{title} Pricegroup");
+
+  $form->{pricegroup} =~ s/\"/&quot;/g;
+
+  $form->header;
+
+  print qq|
+<body>
+
+<form method=post action=$form->{script}>
+
+<input type=hidden name=id value=$form->{id}>
+<input type=hidden name=type value=$form->{type}>
+
+<table width=100%>
+  <tr>
+    <th class=listtop>$form->{title}</th>
+  </tr>
+  <tr height="5"></tr>
+  <tr>
+    <td>
+      <table width=100%>
+       <tr>
+         <th align=right>| . $locale->text('Preisgruppe') . qq|</th>
+          <td><input name=pricegroup size=30 value="$form->{pricegroup}"></td>
+       </tr>
+      </table>
+    </td>
+  </tr>
+  <tr>
+    <td colspan=2><hr size=3 noshade></td>
+  </tr>
+</table>
+|;
+
+  $lxdebug->leave_sub();
+}
+######################
+#build up pricegroup_footer
+#
+sub form_pricegroup_footer {
+  $lxdebug->enter_sub();
+
+  print qq|
+
+<input name=callback type=hidden value="$form->{callback}">
+
+<input type=hidden name=path value=$form->{path}>
+<input type=hidden name=login value=$form->{login}>
+<input type=hidden name=password value=$form->{password}>
+
+<br><input type=submit class=submit name=action value="|
+    . $locale->text('Save') . qq|">
+|;
+
+  if ($form->{id} && $form->{orphaned}) {
+    print qq|
+<input type=submit class=submit name=action value="|
+      . $locale->text('Delete') . qq|">|;
+  }
+
+  if ($form->{menubar}) {
+    require "$form->{path}/menu.pl";
+    &menubar;
+  }
+
+  print qq|
+</form>
+
+</body>
+</html>
+|;
+
+  $lxdebug->leave_sub();
+}
index beb266a2e72fc16984e3589682c65c8d6adf7f66..29b475d3d6b1041e9af8007348dae7fcb10409eb 100644 (file)
@@ -47,6 +47,7 @@ $self{texts} = {
   'Add Group'                   => 'Warengruppe erfassen',
   'Add License'                 => 'Lizenz erfassen',
   'Add Part'                    => 'Ware erfassen',
   'Add Group'                   => 'Warengruppe erfassen',
   'Add License'                 => 'Lizenz erfassen',
   'Add Part'                    => 'Ware erfassen',
+  'Add Pricegroup'              => 'Preisgruppe erfassen',
   'Add Project'                 => 'Projekt erfassen',
   'Add Purchase Order'          => 'Lieferantenauftrag erfassen',
   'Add Quotation'               => 'Angebot erfassen',
   'Add Project'                 => 'Projekt erfassen',
   'Add Purchase Order'          => 'Lieferantenauftrag erfassen',
   'Add Quotation'               => 'Angebot erfassen',
@@ -122,7 +123,7 @@ $self{texts} = {
   'Bitte das Bundesland UND die Stadt bzw. den Einzugsbereich Ihres zuständigen Finanzamts auswählen.' => 'Bitte das Bundesland UND die Stadt bzw. den Einzugsbereich Ihres zuständigen Finanzamts auswählen.',
   'Bitte eine Steuernummer angeben' => 'Bitte eine Steuernummer angeben',
   'Books are open'              => 'Die Bücher sind geöffnet.',
   'Bitte das Bundesland UND die Stadt bzw. den Einzugsbereich Ihres zuständigen Finanzamts auswählen.' => 'Bitte das Bundesland UND die Stadt bzw. den Einzugsbereich Ihres zuständigen Finanzamts auswählen.',
   'Bitte eine Steuernummer angeben' => 'Bitte eine Steuernummer angeben',
   'Books are open'              => 'Die Bücher sind geöffnet.',
-  'Bought'                      => 'gekauft',
+  'Bought'                      => 'Gekauft',
   'Buchungsdatum'               => 'Buchungsdatum',
   'Buchungsjournal'             => 'Buchungsjournal',
   'Business'                    => 'Firma',
   'Buchungsdatum'               => 'Buchungsdatum',
   'Buchungsjournal'             => 'Buchungsjournal',
   'Business'                    => 'Firma',
@@ -288,6 +289,7 @@ $self{texts} = {
   'Edit Group'                  => 'Warengruppe editieren',
   'Edit Part'                   => 'Ware bearbeiten',
   'Edit Preferences for'        => 'Benutzereinstellungen für',
   'Edit Group'                  => 'Warengruppe editieren',
   'Edit Part'                   => 'Ware bearbeiten',
   'Edit Preferences for'        => 'Benutzereinstellungen für',
+  'Edit Pricegroup'             => 'Preisgruppe bearbeiten',
   'Edit Project'                => 'Projekt bearbeiten',
   'Edit Purchase Order'         => 'Lieferantenaufrag bearbeiten',
   'Edit Quotation'              => 'Angebot bearbeiten',
   'Edit Project'                => 'Projekt bearbeiten',
   'Edit Purchase Order'         => 'Lieferantenaufrag bearbeiten',
   'Edit Quotation'              => 'Angebot bearbeiten',
@@ -335,7 +337,7 @@ $self{texts} = {
   'Foreign Exchange Gain'       => 'Wechselkurserträge',
   'Foreign Exchange Loss'       => 'Wechselkursaufwendungen',
   'Free report period'          => 'Freier Zeitraum',
   'Foreign Exchange Gain'       => 'Wechselkurserträge',
   'Foreign Exchange Loss'       => 'Wechselkursaufwendungen',
   'Free report period'          => 'Freier Zeitraum',
-  'From'                        => 'von',
+  'From'                        => 'Von',
   'GIFI'                        => 'GIFI',
   'GIFI deleted!'               => 'GIFI gelöscht!',
   'GIFI missing!'               => 'GIFI fehlt!',
   'GIFI'                        => 'GIFI',
   'GIFI deleted!'               => 'GIFI gelöscht!',
   'GIFI missing!'               => 'GIFI fehlt!',
@@ -357,6 +359,7 @@ $self{texts} = {
   'Help'                        => 'Hilfe',
   'Hier den Berechnungszeitraum auswählen...' => 'Hier den Berechnungszeitraum auswählen...',
   'Hinweise'                    => 'Hinweise',
   'Help'                        => 'Hilfe',
   'Hier den Berechnungszeitraum auswählen...' => 'Hier den Berechnungszeitraum auswählen...',
   'Hinweise'                    => 'Hinweise',
+  'Hola'                        => '',
   'Homepage'                    => 'Homepage',
   'Host'                        => 'Datenbankcomputer',
   'Hostname missing!'           => 'Computername fehlt!',
   'Homepage'                    => 'Homepage',
   'Host'                        => 'Datenbankcomputer',
   'Hostname missing!'           => 'Computername fehlt!',
@@ -496,7 +499,7 @@ $self{texts} = {
   'Oct'                         => 'Okt',
   'October'                     => 'Oktober',
   'On Hand'                     => 'Auf Lager',
   'Oct'                         => 'Okt',
   'October'                     => 'Oktober',
   'On Hand'                     => 'Auf Lager',
-  'On Order'                    => 'ist bestellt',
+  'On Order'                    => 'Ist bestellt',
   'Open'                        => 'Offen',
   'Oracle Database Administration' => 'Oracle Datenbankadministration',
   'Order'                       => 'Auftrag',
   'Open'                        => 'Offen',
   'Oracle Database Administration' => 'Oracle Datenbankadministration',
   'Order'                       => 'Auftrag',
@@ -507,7 +510,7 @@ $self{texts} = {
   'Order deleted!'              => 'Auftrag gelöscht!',
   'Ordered'                     => 'Vom Kunde bestellt',
   'Orders'                      => 'Aufträge',
   'Order deleted!'              => 'Auftrag gelöscht!',
   'Ordered'                     => 'Vom Kunde bestellt',
   'Orders'                      => 'Aufträge',
-  'Orphaned'                    => 'nie benutzt',
+  'Orphaned'                    => 'Nie benutzt',
   'Out of balance!'             => 'Summen stimmen nicht berein!',
   'Own Product'                 => 'eigenes Produkt',
   'PDF'                         => 'PDF',
   'Out of balance!'             => 'Summen stimmen nicht berein!',
   'Own Product'                 => 'eigenes Produkt',
   'PDF'                         => 'PDF',
@@ -545,8 +548,16 @@ $self{texts} = {
   'Postscript'                  => 'Postscript',
   'Preferences'                 => 'Benutzereinstellungen',
   'Preferences saved!'          => 'Einstellungen gespeichert!',
   'Postscript'                  => 'Postscript',
   'Preferences'                 => 'Benutzereinstellungen',
   'Preferences saved!'          => 'Einstellungen gespeichert!',
+  'Preis'                       => 'Preis',
+  'Preisgruppe'                 => 'Preisgruppe',
+  'Preisklasse'                 => 'Preisgruppe',
   'Prepayment'                  => 'Vorauszahlung',
   'Price'                       => 'Preis',
   'Prepayment'                  => 'Vorauszahlung',
   'Price'                       => 'Preis',
+  'Pricegroup'                  => 'Preisgruppe',
+  'Pricegroup deleted!'         => 'Preisgruppe gelöscht!',
+  'Pricegroup missing!'         => 'Preisgruppe fehlt!',
+  'Pricegroup saved!'           => 'Preisgruppe gespeichert!',
+  'Pricegroups'                 => 'Preisgruppen',
   'Print'                       => 'Drucken',
   'Printed'                     => 'gedruckt.',
   'Printer'                     => 'Drucker',
   'Print'                       => 'Drucken',
   'Printed'                     => 'gedruckt.',
   'Printer'                     => 'Drucker',
@@ -656,7 +667,7 @@ $self{texts} = {
   'Short'                       => 'kurz',
   'Show'                        => 'Zeigen',
   'Signature'                   => 'Unterschrift',
   'Short'                       => 'kurz',
   'Show'                        => 'Zeigen',
   'Signature'                   => 'Unterschrift',
-  'Sold'                        => 'verkauft',
+  'Sold'                        => 'Verkauft',
   'Soll- und Habenkonto sind gleich!' => 'Soll- und Habenkonto sind gleich!',
   'Source'                      => 'Beleg',
   'Split Credit'                => 'Haben splitten',
   'Soll- und Habenkonto sind gleich!' => 'Soll- und Habenkonto sind gleich!',
   'Source'                      => 'Beleg',
   'Split Credit'                => 'Haben splitten',
@@ -682,7 +693,7 @@ $self{texts} = {
   'Subtotal'                    => 'Zwischensumme',
   'Supervisor'                  => 'Supervisor',
   'System'                      => 'System',
   'Subtotal'                    => 'Zwischensumme',
   'Supervisor'                  => 'Supervisor',
   'System'                      => 'System',
-  'TOP100'                      => 'TOP100',
+  'TOP100'                      => 'Top 100',
   'Tax'                         => 'Steuer',
   'Tax Accounts'                => 'Steuerkonto',
   'Tax Included'                => 'Steuer im Preis inbegriffen',
   'Tax'                         => 'Steuer',
   'Tax Accounts'                => 'Steuerkonto',
   'Tax Included'                => 'Steuer im Preis inbegriffen',
@@ -785,7 +796,7 @@ $self{texts} = {
   'debug'                       => 'Debug',
   'does not exist'              => 'existiert nicht',
   'done'                        => 'erledigt',
   'debug'                       => 'Debug',
   'does not exist'              => 'existiert nicht',
   'done'                        => 'erledigt',
-  'ea'                          => 'Stk',
+  'ea'                          => 'St.',
   'emailed to'                  => 'gemailt an',
   'for Period'                  => 'für den Zeitraum',
   'hr'                          => 'Stunde',
   'emailed to'                  => 'gemailt an',
   'for Period'                  => 'für den Zeitraum',
   'hr'                          => 'Stunde',
@@ -802,7 +813,7 @@ $self{texts} = {
   'saved!'                      => 'gespeichert',
   'sent'                        => 'gesendet',
   'sent to printer'             => 'an Drucker geschickt',
   'saved!'                      => 'gespeichert',
   'sent'                        => 'gesendet',
   'sent to printer'             => 'an Drucker geschickt',
-  'soldtotal'                   => 'verkaufte Anzahl',
+  'soldtotal'                   => 'Verkaufte Anzahl',
   'successfully created!'       => 'wurde erfolgreich erstellt',
   'successfully deleted!'       => 'wurde erfolgreich gelöscht',
   'test'                        => 'test',
   'successfully created!'       => 'wurde erfolgreich erstellt',
   'successfully deleted!'       => 'wurde erfolgreich gelöscht',
   'test'                        => 'test',
index de7f2c069b016492710ac57570e4a141a3e32943..79e946796d3ef0d6d828946beb0899100eb970b0 100644 (file)
@@ -41,7 +41,7 @@ $self{texts} = {
   'Exchangerate missing!'       => 'Es fehlt der Wechselkurs!',
   'Feb'                         => 'Feb',
   'February'                    => 'Februar',
   'Exchangerate missing!'       => 'Es fehlt der Wechselkurs!',
   'Feb'                         => 'Feb',
   'February'                    => 'Februar',
-  'From'                        => 'von',
+  'From'                        => 'Von',
   'ID'                          => 'Buchungsnummer',
   'Include in Report'           => 'In Bericht aufnehmen',
   'Invoice'                     => 'Rechnung',
   'ID'                          => 'Buchungsnummer',
   'Include in Report'           => 'In Bericht aufnehmen',
   'Invoice'                     => 'Rechnung',
index f55ef722fa5e3a552d242449ec923a48155614c2..1d23b485986ed1628f21a400380ce097f7c8814f 100644 (file)
@@ -41,7 +41,7 @@ $self{texts} = {
   'Exchangerate missing!'       => 'Es fehlt der Wechselkurs!',
   'Feb'                         => 'Feb',
   'February'                    => 'Februar',
   'Exchangerate missing!'       => 'Es fehlt der Wechselkurs!',
   'Feb'                         => 'Feb',
   'February'                    => 'Februar',
-  'From'                        => 'von',
+  'From'                        => 'Von',
   'ID'                          => 'Buchungsnummer',
   'Include in Report'           => 'In Bericht aufnehmen',
   'Incoming Payments'           => 'Zahlungseingänge',
   'ID'                          => 'Buchungsnummer',
   'Include in Report'           => 'In Bericht aufnehmen',
   'Incoming Payments'           => 'Zahlungseingänge',
index 5a1fbc85d6313257a9f0f22f4ca12c56230aa9c9..de4888fae7201a5308c76218f10838e2fd4facaf 100644 (file)
@@ -9,7 +9,7 @@ $self{texts} = {
   'Continue'                    => 'Weiter',
   'Customer'                    => 'Kunde',
   'Date'                        => 'Datum',
   'Continue'                    => 'Weiter',
   'Customer'                    => 'Kunde',
   'Date'                        => 'Datum',
-  'From'                        => 'von',
+  'From'                        => 'Von',
   'Invoice'                     => 'Rechnung',
   'Invoice Number'              => 'Rechnungsnummer',
   'Marked entries printed!'     => 'Markierte Einträge wurden gedruckt!',
   'Invoice'                     => 'Rechnung',
   'Invoice Number'              => 'Rechnungsnummer',
   'Marked entries printed!'     => 'Markierte Einträge wurden gedruckt!',
index ea90459db082914d506786c45949550f7924eda4..e0482e0375af8b8973d9c6bdcc4c4c277be000bc 100644 (file)
@@ -15,7 +15,7 @@ $self{texts} = {
   'Description'                 => 'Beschreibung',
   'Feb'                         => 'Feb',
   'February'                    => 'Februar',
   'Description'                 => 'Beschreibung',
   'Feb'                         => 'Feb',
   'February'                    => 'Februar',
-  'From'                        => 'von',
+  'From'                        => 'Von',
   'GIFI'                        => 'GIFI',
   'Include in Report'           => 'In Bericht aufnehmen',
   'Jan'                         => 'Jan',
   'GIFI'                        => 'GIFI',
   'Include in Report'           => 'In Bericht aufnehmen',
   'Jan'                         => 'Jan',
index f83cc9ae829523c6da20011130c06baab077e4f1..5d7dbf5777be7ace43c67fef0b101e13d06c1dbe 100644 (file)
@@ -15,7 +15,6 @@ $self{texts} = {
   'Cannot delete customer!'     => 'Kunde kann nicht gelöscht werden!',
   'Cannot delete vendor!'       => 'Lieferant kann nicht gelöscht werden!',
   'Cc'                          => 'Cc',
   'Cannot delete customer!'     => 'Kunde kann nicht gelöscht werden!',
   'Cannot delete vendor!'       => 'Lieferant kann nicht gelöscht werden!',
   'Cc'                          => 'Cc',
-  'City'                        => 'Stadt',
   'Company Name'                => 'Firmenname',
   'Contact'                     => 'Kontakt',
   'Contact Person'              => 'Ansprechpartner',
   'Company Name'                => 'Firmenname',
   'Contact'                     => 'Kontakt',
   'Contact Person'              => 'Ansprechpartner',
@@ -36,6 +35,7 @@ $self{texts} = {
   'GIFI'                        => 'GIFI',
   'Given Name'                  => 'Vorname',
   'Greeting'                    => 'Anrede',
   'GIFI'                        => 'GIFI',
   'Given Name'                  => 'Vorname',
   'Greeting'                    => 'Anrede',
+  'Hola'                        => 'Hola',
   'Homepage'                    => 'Homepage',
   'ID'                          => 'Buchungsnummer',
   'Include in Report'           => 'In Bericht aufnehmen',
   'Homepage'                    => 'Homepage',
   'ID'                          => 'Buchungsnummer',
   'Include in Report'           => 'In Bericht aufnehmen',
@@ -51,11 +51,12 @@ $self{texts} = {
   'Obsolete'                    => 'Ungültig',
   'Order'                       => 'Auftrag',
   'Orders'                      => 'Aufträge',
   'Obsolete'                    => 'Ungültig',
   'Order'                       => 'Auftrag',
   'Orders'                      => 'Aufträge',
-  'Orphaned'                    => 'nie benutzt',
+  'Orphaned'                    => 'Nie benutzt',
   'Password'                    => 'Passwort',
   'Phone'                       => 'Telefon',
   'Phone1'                      => 'Telefon 1 ',
   'Phone2'                      => 'Telefon 2',
   'Password'                    => 'Passwort',
   'Phone'                       => 'Telefon',
   'Phone1'                      => 'Telefon 1 ',
   'Phone2'                      => 'Telefon 2',
+  'Preisklasse'                 => 'Preisgruppe',
   'Quotation'                   => 'Angebot',
   'Quotations'                  => 'Angebote',
   'SIC'                         => 'SIC',
   'Quotation'                   => 'Angebot',
   'Quotations'                  => 'Angebote',
   'SIC'                         => 'SIC',
index 1cdbe714386ccc2f5d5642abe046599627e46b03..0966b7559d910d354710efa987320e8c8b8d0f60 100644 (file)
@@ -49,7 +49,7 @@ $self{texts} = {
   'Expense'                     => 'Aufwandskonto',
   'Feb'                         => 'Feb',
   'February'                    => 'Februar',
   'Expense'                     => 'Aufwandskonto',
   'Feb'                         => 'Feb',
   'February'                    => 'Februar',
-  'From'                        => 'von',
+  'From'                        => 'Von',
   'GIFI'                        => 'GIFI',
   'GL Transaction'              => 'Dialogbuchung',
   'General Ledger'              => 'Finanzbuchhaltung',
   'GIFI'                        => 'GIFI',
   'GL Transaction'              => 'Dialogbuchung',
   'General Ledger'              => 'Finanzbuchhaltung',
index 31937beec307f24c949c2c31a2e113be3775ef1f..837b9c3db52bac703272470d938b089bd270d499 100644 (file)
@@ -25,7 +25,7 @@ $self{texts} = {
   'Billing Address'             => 'Rechnungsadresse',
   'Bin'                         => 'Lagerplatz',
   'Bin List'                    => 'Lagerliste',
   'Billing Address'             => 'Rechnungsadresse',
   'Bin'                         => 'Lagerplatz',
   'Bin List'                    => 'Lagerliste',
-  'Bought'                      => 'gekauft',
+  'Bought'                      => 'Gekauft',
   'COGS'                        => 'Umsatzkosten',
   'Cannot delete item!'         => 'Artikel kann nicht gelöscht werden!',
   'Cannot stock assemblies!'    => 'Erzeugnisse können nicht ins Lager!',
   'COGS'                        => 'Umsatzkosten',
   'Cannot delete item!'         => 'Artikel kann nicht gelöscht werden!',
   'Cannot stock assemblies!'    => 'Erzeugnisse können nicht ins Lager!',
@@ -56,7 +56,7 @@ $self{texts} = {
   'Fax'                         => 'Fax',
   'Feb'                         => 'Feb',
   'February'                    => 'Februar',
   'Fax'                         => 'Fax',
   'Feb'                         => 'Feb',
   'February'                    => 'Februar',
-  'From'                        => 'von',
+  'From'                        => 'Von',
   'Geschäftsvolumen'            => 'Geschäftsvolumen',
   'Group'                       => 'Warengruppe',
   'Group Items'                 => 'Waren gruppieren',
   'Geschäftsvolumen'            => 'Geschäftsvolumen',
   'Group'                       => 'Warengruppe',
   'Group Items'                 => 'Waren gruppieren',
@@ -103,12 +103,12 @@ $self{texts} = {
   'Oct'                         => 'Okt',
   'October'                     => 'Oktober',
   'On Hand'                     => 'Auf Lager',
   'Oct'                         => 'Okt',
   'October'                     => 'Oktober',
   'On Hand'                     => 'Auf Lager',
-  'On Order'                    => 'ist bestellt',
+  'On Order'                    => 'Ist bestellt',
   'Order Date missing!'         => 'Auftragsdatum fehlt!',
   'Order Number'                => 'Auftragsnummer',
   'Order Number missing!'       => 'Auftragsnummer fehlt!',
   'Ordered'                     => 'Vom Kunde bestellt',
   'Order Date missing!'         => 'Auftragsdatum fehlt!',
   'Order Number'                => 'Auftragsnummer',
   'Order Number missing!'       => 'Auftragsnummer fehlt!',
   'Ordered'                     => 'Vom Kunde bestellt',
-  'Orphaned'                    => 'nie benutzt',
+  'Orphaned'                    => 'Nie benutzt',
   'PDF'                         => 'PDF',
   'Packing List'                => 'Verpackungsliste',
   'Packing List Date missing!'  => 'Datum für Verpackungsliste fehlt!',
   'PDF'                         => 'PDF',
   'Packing List'                => 'Verpackungsliste',
   'Packing List Date missing!'  => 'Datum für Verpackungsliste fehlt!',
@@ -122,7 +122,10 @@ $self{texts} = {
   'Phone'                       => 'Telefon',
   'Pick List'                   => 'Sammelliste',
   'Postscript'                  => 'Postscript',
   'Phone'                       => 'Telefon',
   'Pick List'                   => 'Sammelliste',
   'Postscript'                  => 'Postscript',
+  'Preis'                       => 'Preis',
+  'Preisklasse'                 => 'Preisgruppe',
   'Price'                       => 'Preis',
   'Price'                       => 'Preis',
+  'Pricegroup'                  => 'Preisgruppe',
   'Printed'                     => 'gedruckt.',
   'Printer'                     => 'Drucker',
   'Project'                     => 'Projekt',
   'Printed'                     => 'gedruckt.',
   'Printer'                     => 'Drucker',
   'Project'                     => 'Projekt',
@@ -157,13 +160,13 @@ $self{texts} = {
   'Shipping Address'            => 'Lieferadresse',
   'Shopartikel'                 => 'Shopartikel',
   'Short'                       => 'kurz',
   'Shipping Address'            => 'Lieferadresse',
   'Shopartikel'                 => 'Shopartikel',
   'Short'                       => 'kurz',
-  'Sold'                        => 'verkauft',
+  'Sold'                        => 'Verkauft',
   'Stock'                       => 'einlagern',
   'Stock Assembly'              => 'Erzeugnis einlagern',
   'Street'                      => 'Straße',
   'Subject'                     => 'Betreff',
   'Subtotal'                    => 'Zwischensumme',
   'Stock'                       => 'einlagern',
   'Stock Assembly'              => 'Erzeugnis einlagern',
   'Street'                      => 'Straße',
   'Subject'                     => 'Betreff',
   'Subtotal'                    => 'Zwischensumme',
-  'TOP100'                      => 'TOP100',
+  'TOP100'                      => 'Top 100',
   'To'                          => 'An',
   'Top 100'                     => 'Top 100',
   'Top 100 hinzufuegen'         => 'Top 100 hinzufügen',
   'To'                          => 'An',
   'Top 100'                     => 'Top 100',
   'Top 100 hinzufuegen'         => 'Top 100 hinzufügen',
@@ -187,7 +190,7 @@ $self{texts} = {
   'number'                      => 'Nummer',
   'sent'                        => 'gesendet',
   'sent to printer'             => 'an Drucker geschickt',
   'number'                      => 'Nummer',
   'sent'                        => 'gesendet',
   'sent to printer'             => 'an Drucker geschickt',
-  'soldtotal'                   => 'verkaufte Anzahl',
+  'soldtotal'                   => 'Verkaufte Anzahl',
 };
 
 $self{subs} = {
 };
 
 $self{subs} = {
@@ -219,6 +222,7 @@ $self{subs} = {
   'order'                       => 'order',
   'parts_subtotal'              => 'parts_subtotal',
   'post_as_new'                 => 'post_as_new',
   'order'                       => 'order',
   'parts_subtotal'              => 'parts_subtotal',
   'post_as_new'                 => 'post_as_new',
+  'price_row'                   => 'price_row',
   'print'                       => 'print',
   'print_form'                  => 'print_form',
   'print_options'               => 'print_options',
   'print'                       => 'print',
   'print_form'                  => 'print_form',
   'print_options'               => 'print_options',
@@ -230,6 +234,7 @@ $self{subs} = {
   'section_menu'                => 'section_menu',
   'select_item'                 => 'select_item',
   'send_email'                  => 'send_email',
   'section_menu'                => 'section_menu',
   'select_item'                 => 'select_item',
   'send_email'                  => 'send_email',
+  'set_pricegroup'              => 'set_pricegroup',
   'ship_to'                     => 'ship_to',
   'stock_assembly'              => 'stock_assembly',
   'top100'                      => 'top100',
   'ship_to'                     => 'ship_to',
   'stock_assembly'              => 'stock_assembly',
   'top100'                      => 'top100',
@@ -247,7 +252,7 @@ $self{subs} = {
   'dienstleistung_bearbeiten'   => 'edit_service',
   'speichern'                   => 'save',
   'als_neu_speichern'           => 'save_as_new',
   'dienstleistung_bearbeiten'   => 'edit_service',
   'speichern'                   => 'save',
   'als_neu_speichern'           => 'save_as_new',
-  'top100'                      => 'top100',
+  'top_100'                     => 'top100',
   'erneuern'                    => 'update',
   'auswählen'                   => 'choice',
   'auflisten'                   => 'list',
   'erneuern'                    => 'update',
   'auswählen'                   => 'choice',
   'auflisten'                   => 'list',
index 733b4da9d528fcf83758b42eadba68c5c4ba4545..1647c374798170048f48e404c76dab28cc5f7bcd 100644 (file)
@@ -71,6 +71,7 @@ $self{texts} = {
   'Pick List'                   => 'Sammelliste',
   'Postscript'                  => 'Postscript',
   'Price'                       => 'Preis',
   'Pick List'                   => 'Sammelliste',
   'Postscript'                  => 'Postscript',
   'Price'                       => 'Preis',
+  'Pricegroup'                  => 'Preisgruppe',
   'Printed'                     => 'gedruckt.',
   'Printer'                     => 'Drucker',
   'Project'                     => 'Projekt',
   'Printed'                     => 'gedruckt.',
   'Printer'                     => 'Drucker',
   'Project'                     => 'Projekt',
@@ -123,6 +124,7 @@ $self{subs} = {
   'quotation'                   => 'quotation',
   'select_item'                 => 'select_item',
   'send_email'                  => 'send_email',
   'quotation'                   => 'quotation',
   'select_item'                 => 'select_item',
   'send_email'                  => 'send_email',
+  'set_pricegroup'              => 'set_pricegroup',
   'ship_to'                     => 'ship_to',
   'validate_items'              => 'validate_items',
   'vendor_details'              => 'vendor_details',
   'ship_to'                     => 'ship_to',
   'validate_items'              => 'validate_items',
   'vendor_details'              => 'vendor_details',
index 9711484f161e7f93fc22d03ea9fa4b02d6d3be79..4b0fc584e20f761b61b65676661b2e35f3f8d7ec 100644 (file)
@@ -108,6 +108,7 @@ $self{texts} = {
   'Post as new'                 => 'Neu buchen',
   'Postscript'                  => 'Postscript',
   'Price'                       => 'Preis',
   'Post as new'                 => 'Neu buchen',
   'Postscript'                  => 'Postscript',
   'Price'                       => 'Preis',
+  'Pricegroup'                  => 'Preisgruppe',
   'Printed'                     => 'gedruckt.',
   'Printer'                     => 'Drucker',
   'Project'                     => 'Projekt',
   'Printed'                     => 'gedruckt.',
   'Printer'                     => 'Drucker',
   'Project'                     => 'Projekt',
@@ -152,7 +153,7 @@ $self{texts} = {
   'Yes'                         => 'Ja',
   'Zipcode'                     => 'PLZ',
   'button'                      => '?',
   'Yes'                         => 'Ja',
   'Zipcode'                     => 'PLZ',
   'button'                      => '?',
-  'ea'                          => 'Stk',
+  'ea'                          => 'St.',
   'emailed to'                  => 'gemailt an',
   'posted!'                     => 'gebucht',
   'sent'                        => 'gesendet',
   'emailed to'                  => 'gemailt an',
   'posted!'                     => 'gebucht',
   'sent'                        => 'gesendet',
@@ -200,6 +201,7 @@ $self{subs} = {
   'select_name'                 => 'select_name',
   'select_project'              => 'select_project',
   'send_email'                  => 'send_email',
   'select_name'                 => 'select_name',
   'select_project'              => 'select_project',
   'send_email'                  => 'send_email',
+  'set_pricegroup'              => 'set_pricegroup',
   'ship_to'                     => 'ship_to',
   'update'                      => 'update',
   'validate_items'              => 'validate_items',
   'ship_to'                     => 'ship_to',
   'update'                      => 'update',
   'validate_items'              => 'validate_items',
index b4b541bbbbcecabb610ec0c0d17ca83b26c5cdc2..10de9ccd77f272e0cdf9f9cb5b61bc8a0d0f5d67 100644 (file)
@@ -112,6 +112,7 @@ $self{texts} = {
   'Post as new'                 => 'Neu buchen',
   'Postscript'                  => 'Postscript',
   'Price'                       => 'Preis',
   'Post as new'                 => 'Neu buchen',
   'Postscript'                  => 'Postscript',
   'Price'                       => 'Preis',
+  'Pricegroup'                  => 'Preisgruppe',
   'Print'                       => 'Drucken',
   'Printed'                     => 'gedruckt.',
   'Printer'                     => 'Drucker',
   'Print'                       => 'Drucken',
   'Printed'                     => 'gedruckt.',
   'Printer'                     => 'Drucker',
@@ -160,7 +161,7 @@ $self{texts} = {
   'Yes'                         => 'Ja',
   'Zipcode'                     => 'PLZ',
   'button'                      => '?',
   'Yes'                         => 'Ja',
   'Zipcode'                     => 'PLZ',
   'button'                      => '?',
-  'ea'                          => 'Stk',
+  'ea'                          => 'St.',
   'emailed to'                  => 'gemailt an',
   'posted!'                     => 'gebucht',
   'sent'                        => 'gesendet',
   'emailed to'                  => 'gemailt an',
   'posted!'                     => 'gebucht',
   'sent'                        => 'gesendet',
@@ -208,6 +209,7 @@ $self{subs} = {
   'select_name'                 => 'select_name',
   'select_project'              => 'select_project',
   'send_email'                  => 'send_email',
   'select_name'                 => 'select_name',
   'select_project'              => 'select_project',
   'send_email'                  => 'send_email',
+  'set_pricegroup'              => 'set_pricegroup',
   'ship_to'                     => 'ship_to',
   'update'                      => 'update',
   'validate_items'              => 'validate_items',
   'ship_to'                     => 'ship_to',
   'update'                      => 'update',
   'validate_items'              => 'validate_items',
index 618426199e54507dcfccc487f9e6e4f5596e4e9a..0c8e0aa306f1bebb8ecdffa6baa9667946452d76 100644 (file)
@@ -14,6 +14,7 @@ $self{texts} = {
   'Add Group'                   => 'Warengruppe erfassen',
   'Add License'                 => 'Lizenz erfassen',
   'Add Part'                    => 'Ware erfassen',
   'Add Group'                   => 'Warengruppe erfassen',
   'Add License'                 => 'Lizenz erfassen',
   'Add Part'                    => 'Ware erfassen',
+  'Add Pricegroup'              => 'Preisgruppe erfassen',
   'Add Project'                 => 'Projekt erfassen',
   'Add Purchase Order'          => 'Lieferantenauftrag erfassen',
   'Add Quotation'               => 'Angebot erfassen',
   'Add Project'                 => 'Projekt erfassen',
   'Add Purchase Order'          => 'Lieferantenauftrag erfassen',
   'Add Quotation'               => 'Angebot erfassen',
@@ -59,6 +60,7 @@ $self{texts} = {
   'Payment'                     => 'Zahlungsausgang',
   'Payments'                    => 'Zahlungsausgänge',
   'Preferences'                 => 'Benutzereinstellungen',
   'Payment'                     => 'Zahlungsausgang',
   'Payments'                    => 'Zahlungsausgänge',
   'Preferences'                 => 'Benutzereinstellungen',
+  'Pricegroups'                 => 'Preisgruppen',
   'Programm'                    => 'Programm',
   'Projects'                    => 'Projekte',
   'Projecttransactions'         => 'Projektbuchungen',
   'Programm'                    => 'Programm',
   'Projects'                    => 'Projekte',
   'Projecttransactions'         => 'Projektbuchungen',
index 45874d800778630e7b4d4db397e1be0eb706c37b..e30f06bba25b7da45612b4ae66825266bd7ab667 100644 (file)
@@ -13,6 +13,7 @@ $self{texts} = {
   'Add Group'                   => 'Warengruppe erfassen',
   'Add License'                 => 'Lizenz erfassen',
   'Add Part'                    => 'Ware erfassen',
   'Add Group'                   => 'Warengruppe erfassen',
   'Add License'                 => 'Lizenz erfassen',
   'Add Part'                    => 'Ware erfassen',
+  'Add Pricegroup'              => 'Preisgruppe erfassen',
   'Add Project'                 => 'Projekt erfassen',
   'Add Purchase Order'          => 'Lieferantenauftrag erfassen',
   'Add Quotation'               => 'Angebot erfassen',
   'Add Project'                 => 'Projekt erfassen',
   'Add Purchase Order'          => 'Lieferantenauftrag erfassen',
   'Add Quotation'               => 'Angebot erfassen',
@@ -58,6 +59,7 @@ $self{texts} = {
   'Payment'                     => 'Zahlungsausgang',
   'Payments'                    => 'Zahlungsausgänge',
   'Preferences'                 => 'Benutzereinstellungen',
   'Payment'                     => 'Zahlungsausgang',
   'Payments'                    => 'Zahlungsausgänge',
   'Preferences'                 => 'Benutzereinstellungen',
+  'Pricegroups'                 => 'Preisgruppen',
   'Programm'                    => 'Programm',
   'Projects'                    => 'Projekte',
   'Projecttransactions'         => 'Projektbuchungen',
   'Programm'                    => 'Programm',
   'Projects'                    => 'Projekte',
   'Projecttransactions'         => 'Projektbuchungen',
index fe47cc9e00e853a27adbb458c45229c596304783..364475217fecc38a6dc3b8c13f35fce9c6354780 100644 (file)
@@ -76,7 +76,7 @@ $self{texts} = {
   'Fax'                         => 'Fax',
   'Feb'                         => 'Feb',
   'February'                    => 'Februar',
   'Fax'                         => 'Fax',
   'Feb'                         => 'Feb',
   'February'                    => 'Februar',
-  'From'                        => 'von',
+  'From'                        => 'Von',
   'Group'                       => 'Warengruppe',
   'Group Items'                 => 'Waren gruppieren',
   'ID'                          => 'Buchungsnummer',
   'Group'                       => 'Warengruppe',
   'Group Items'                 => 'Waren gruppieren',
   'ID'                          => 'Buchungsnummer',
@@ -130,6 +130,7 @@ $self{texts} = {
   'Pick List'                   => 'Sammelliste',
   'Postscript'                  => 'Postscript',
   'Price'                       => 'Preis',
   'Pick List'                   => 'Sammelliste',
   'Postscript'                  => 'Postscript',
   'Price'                       => 'Preis',
+  'Pricegroup'                  => 'Preisgruppe',
   'Print'                       => 'Drucken',
   'Printed'                     => 'gedruckt.',
   'Printer'                     => 'Drucker',
   'Print'                       => 'Drucken',
   'Printed'                     => 'gedruckt.',
   'Printer'                     => 'Drucker',
@@ -201,7 +202,7 @@ $self{texts} = {
   'Zipcode'                     => 'PLZ',
   'button'                      => '?',
   'days'                        => 'Tage',
   'Zipcode'                     => 'PLZ',
   'button'                      => '?',
   'days'                        => 'Tage',
-  'ea'                          => 'Stk',
+  'ea'                          => 'St.',
   'emailed to'                  => 'gemailt an',
   'saved!'                      => 'gespeichert',
   'sent'                        => 'gesendet',
   'emailed to'                  => 'gemailt an',
   'saved!'                      => 'gespeichert',
   'sent'                        => 'gesendet',
@@ -263,6 +264,7 @@ $self{subs} = {
   'select_name'                 => 'select_name',
   'select_project'              => 'select_project',
   'send_email'                  => 'send_email',
   'select_name'                 => 'select_name',
   'select_project'              => 'select_project',
   'send_email'                  => 'send_email',
+  'set_pricegroup'              => 'set_pricegroup',
   'ship_receive'                => 'ship_receive',
   'ship_to'                     => 'ship_to',
   'subtotal'                    => 'subtotal',
   'ship_receive'                => 'ship_receive',
   'ship_to'                     => 'ship_to',
   'subtotal'                    => 'subtotal',
index 6d86eb66f7c3cd850e046d6f9c5682cf599be566..d1544d1ad431e8a376239129707bd231b7199427 100644 (file)
@@ -2,12 +2,14 @@ $self{texts} = {
   'Accounting Menu'             => 'Kontoverwaltung',
   'Add'                         => 'Erfassen',
   'Add Group'                   => 'Warengruppe erfassen',
   'Accounting Menu'             => 'Kontoverwaltung',
   'Add'                         => 'Erfassen',
   'Add Group'                   => 'Warengruppe erfassen',
+  'Add Pricegroup'              => 'Preisgruppe erfassen',
   'Add Project'                 => 'Projekt erfassen',
   'All'                         => 'Alle',
   'Continue'                    => 'Weiter',
   'Delete'                      => 'Löschen',
   'Description'                 => 'Beschreibung',
   'Edit Group'                  => 'Warengruppe editieren',
   'Add Project'                 => 'Projekt erfassen',
   'All'                         => 'Alle',
   'Continue'                    => 'Weiter',
   'Delete'                      => 'Löschen',
   'Description'                 => 'Beschreibung',
   'Edit Group'                  => 'Warengruppe editieren',
+  'Edit Pricegroup'             => 'Preisgruppe bearbeiten',
   'Edit Project'                => 'Projekt bearbeiten',
   'Group'                       => 'Warengruppe',
   'Group deleted!'              => 'Warengruppe gelöscht!',
   'Edit Project'                => 'Projekt bearbeiten',
   'Group'                       => 'Warengruppe',
   'Group deleted!'              => 'Warengruppe gelöscht!',
@@ -15,7 +17,12 @@ $self{texts} = {
   'Group saved!'                => 'Warengruppe gespeichert!',
   'Groups'                      => 'Warengruppen',
   'Number'                      => 'Nummer',
   'Group saved!'                => 'Warengruppe gespeichert!',
   'Groups'                      => 'Warengruppen',
   'Number'                      => 'Nummer',
-  'Orphaned'                    => 'nie benutzt',
+  'Orphaned'                    => 'Nie benutzt',
+  'Preisgruppe'                 => 'Preisgruppe',
+  'Pricegroup'                  => 'Preisgruppe',
+  'Pricegroup deleted!'         => 'Preisgruppe gelöscht!',
+  'Pricegroup missing!'         => 'Preisgruppe fehlt!',
+  'Pricegroup saved!'           => 'Preisgruppe gespeichert!',
   'Project'                     => 'Projekt',
   'Project Number missing!'     => 'Projektnummer fehlt!',
   'Project deleted!'            => 'Projekt gelöscht!',
   'Project'                     => 'Projekt',
   'Project Number missing!'     => 'Projektnummer fehlt!',
   'Project deleted!'            => 'Projekt gelöscht!',
@@ -33,9 +40,12 @@ $self{subs} = {
   'edit'                        => 'edit',
   'form_partsgroup_footer'      => 'form_partsgroup_footer',
   'form_partsgroup_header'      => 'form_partsgroup_header',
   'edit'                        => 'edit',
   'form_partsgroup_footer'      => 'form_partsgroup_footer',
   'form_partsgroup_header'      => 'form_partsgroup_header',
+  'form_pricegroup_footer'      => 'form_pricegroup_footer',
+  'form_pricegroup_header'      => 'form_pricegroup_header',
   'form_project_footer'         => 'form_project_footer',
   'form_project_header'         => 'form_project_header',
   'partsgroup_report'           => 'partsgroup_report',
   'form_project_footer'         => 'form_project_footer',
   'form_project_header'         => 'form_project_header',
   'partsgroup_report'           => 'partsgroup_report',
+  'pricegroup_report'           => 'pricegroup_report',
   'project_report'              => 'project_report',
   'save'                        => 'save',
   'search'                      => 'search',
   'project_report'              => 'project_report',
   'save'                        => 'save',
   'search'                      => 'search',
index f91257990bda2af58d73c0e30aad66d2c26a319c..ba8295867d3aaff9f793d10027a9aa23cc1e01a9 100644 (file)
@@ -11,7 +11,7 @@ $self{texts} = {
   'Difference'                  => 'Differenz',
   'Done'                        => 'Fertig',
   'Exchangerate Difference'     => 'Wechselkursunterschied',
   'Difference'                  => 'Differenz',
   'Done'                        => 'Fertig',
   'Exchangerate Difference'     => 'Wechselkursunterschied',
-  'From'                        => 'von',
+  'From'                        => 'Von',
   'Increase'                    => 'Erhöhen',
   'Out of balance!'             => 'Summen stimmen nicht berein!',
   'Payment'                     => 'Zahlungsausgang',
   'Increase'                    => 'Erhöhen',
   'Out of balance!'             => 'Summen stimmen nicht berein!',
   'Payment'                     => 'Zahlungsausgang',
index 664fbbf7212ff3d38a5a6ec7b62306ddaa84cc7f..4d5d530825e185a920c41a3855f2e17e526398c8 100644 (file)
@@ -41,7 +41,7 @@ $self{texts} = {
   'Feb'                         => 'Feb',
   'February'                    => 'Februar',
   'Free report period'          => 'Freier Zeitraum',
   'Feb'                         => 'Feb',
   'February'                    => 'Februar',
   'Free report period'          => 'Freier Zeitraum',
-  'From'                        => 'von',
+  'From'                        => 'Von',
   'GIFI'                        => 'GIFI',
   'HTML'                        => 'HTML',
   'Heading'                     => 'Überschrift',
   'GIFI'                        => 'GIFI',
   'HTML'                        => 'HTML',
   'Heading'                     => 'Überschrift',
index 18401fccb27d74d79041c3b008b4011b7fdcf0e9..ddeda11776ea3d0a3f30047b0e384bc4c8c3d74c 100644 (file)
--- a/menu.ini
+++ b/menu.ini
@@ -35,6 +35,12 @@ module=pe.pl
 action=add
 type=project
 
 action=add
 type=project
 
+#sk
+[Master Data--Add Pricegroup]
+module=pe.pl
+action=add
+type=pricegroup
+
 [Master Data--Add License]
 module=licenses.pl
 action=add
 [Master Data--Add License]
 module=licenses.pl
 action=add
@@ -76,7 +82,6 @@ module=pe.pl
 action=search
 type=partsgroup
 
 action=search
 type=partsgroup
 
-
 [Master Data--Reports--Projects]
 module=pe.pl
 action=search
 [Master Data--Reports--Projects]
 module=pe.pl
 action=search
@@ -91,6 +96,12 @@ report=projects
 module=licenses.pl
 action=search
 
 module=licenses.pl
 action=search
 
+#sk
+[Master Data--Reports--Pricegroups]
+module=pe.pl
+action=search
+type=pricegroup
+
 
 [AR]
 
 
 [AR]
 
index 8973fd09eff2b8483a74e1f7c0df344e24f6475d..6cfb12be777294f75ea807aab0f339f794625001 100644 (file)
@@ -197,6 +197,27 @@ CREATE TABLE audittrail (
   employee_id int
 );
 
   employee_id int
 );
 
+-- pricegroups
+
+CREATE TABLE "pricegroup" (
+  "id" integer DEFAULT nextval('id'::text),
+  "pricegroup" text not null,
+  PRIMARY KEY (id)
+);
+
+CREATE TABLE "prices" (
+  "parts_id" integer REFERENCES parts(id),
+  "pricegroup_id" integer REFERENCES pricegroup(id),
+  "price" numeric(15,5)
+);
+
+ALTER TABLE customer ADD column klass integer;
+ALTER TABLE customer ALTER column klass set default 0;
+
+-- 
+ALTER TABLE invoice ADD column pricegroup_id integer;
+ALTER TABLE orderitems ADD column pricegroup_id integer;
+
 update defaults set version = '2.1.2', audittrail = 't';
 --
 
 update defaults set version = '2.1.2', audittrail = 't';
 --
 
index 6ccc09931eb6dd9aa9636d786c0a1087ad4ac316..4b1606c7f4278d8d9aa36a6e91d27488ac04dc04 100644 (file)
@@ -160,7 +160,8 @@ CREATE TABLE "invoice" (
        "deliverydate" date,
        "serialnumber" text,
         "itime" timestamp DEFAULT now(),
        "deliverydate" date,
        "serialnumber" text,
         "itime" timestamp DEFAULT now(),
-        "mtime" timestamp
+        "mtime" timestamp,
+        "pricegroup_id" integer
 );
 
 CREATE TABLE "vendor" (
 );
 
 CREATE TABLE "vendor" (
@@ -241,7 +242,8 @@ CREATE TABLE "customer" (
         "username" varchar(50),
         "user_password" varchar(12),
         "salesman_id" integer,
         "username" varchar(50),
         "user_password" varchar(12),
         "salesman_id" integer,
-        "c_vendor_id" text
+        "c_vendor_id" text,
+        "klass" integer DEFAULT 0
         
 );
 
         
 );
 
@@ -394,7 +396,8 @@ CREATE TABLE "orderitems" (
        "serialnumber" text,
        "id" integer DEFAULT nextval('orderitemsid'::text) PRIMARY KEY,
         "itime" timestamp DEFAULT now(),
        "serialnumber" text,
        "id" integer DEFAULT nextval('orderitemsid'::text) PRIMARY KEY,
         "itime" timestamp DEFAULT now(),
-        "mtime" timestamp
+        "mtime" timestamp,
+        "pricegroup_id" integer
 );
 
 CREATE TABLE "exchangerate" (
 );
 
 CREATE TABLE "exchangerate" (
@@ -551,6 +554,22 @@ CREATE TABLE "licenseinvoice" (
   license_id integer
 );
 
   license_id integer
 );
 
+-- Preisgruppenverwaltung
+CREATE TABLE "pricegroup" (
+  "id" integer DEFAULT nextval('id'::text),
+  "pricegroup" text not null,
+  PRIMARY KEY (id)
+);
+--Preisverwaltung der Preisgruppen
+CREATE TABLE "prices" (
+  "parts_id" integer REFERENCES parts(id),
+  "pricegroup_id" integer REFERENCES pricegroup(id),
+  "price" numeric(15,5)
+);
+
+
+
+
 -- Table of tax authoritys
 -- for module ustva
 -- Lx office
 -- Table of tax authoritys
 -- for module ustva
 -- Lx office