Merge branch 'master' of lx-office.linet-services.de:lx-office-erp
authorMoritz Bunkus <m.bunkus@linet-services.de>
Mon, 7 Mar 2011 12:23:26 +0000 (13:23 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Mon, 7 Mar 2011 12:23:26 +0000 (13:23 +0100)
DEBIAN/DEBIAN/postinst
SL/IR.pm
SL/IS.pm
bin/mozilla/is.pl
doc/changelog
sql/Pg-upgrade2/ar_add_invnumber_for_credit_note.sql [new file with mode: 0644]
templates/German-credit_note.tex
templates/webpages/is/form_header.html

index 5604cd9..a681b98 100755 (executable)
@@ -78,17 +78,14 @@ config_postgresql_sql_routines() {
 
 set_lx_office_erp_web_admin_password() {
 
-       if ! [ -f /etc/lx-office-erp/lx_office.conf ] ; then
-               cp /etc/lx-office-erp/lx_office.conf.default /etc/lx-office-erp/lx_office.conf
-       fi
        db_get lx-office-erp/admin-password
        ADMINPASSWORD="$RET"
 
-       cat /etc/lx-office-erp/lx_office.conf | \
-       sed --expression "s/admin_password = /admin_password = $ADMINPASSWORD/g" \
+       cat /etc/lx-office-erp/authentication.pl | \
+       sed --expression "s/{admin_password} = /{admin_password} = '$ADMINPASSWORD';#/g" \
        > /tmp/1.txt
 
-       mv /tmp/1.txt /etc/lx-office-erp/lx_office.conf
+       mv /tmp/1.txt /etc/lx-office-erp/authentication.pl
 
 }
 
@@ -97,13 +94,13 @@ set_lx_office_erp_authentication_db_user_password() {
        db_get lx-office-erp/lx-office-erp-user-postgresql-password
        PASSWORD="$RET"
 
-       cat /etc/lx-office-erp/lx_office.conf | \
-       sed --expression "s/^password = /password = $PASSWORD/g" \
+       cat /etc/lx-office-erp/authentication.pl | \
+       sed --expression "s/'password' => /'password' => '$PASSWORD', #/g" \
        > /tmp/1.txt
 
        cat /tmp/1.txt | \
        sed --expression "s/^user = postgres/user = lxoffice/g" \
-       >  /etc/lx-office-erp/lx_office.conf
+       >  /etc/lx-office-erp/authentication.pl
 
 }
 
@@ -111,9 +108,12 @@ set_lx_office_erp_authentication_db_user_password() {
 set_user_rights() {
        chown -R www-data:www-data /usr/lib/lx-office-erp/users
        chown -R www-data:www-data /usr/lib/lx-office-erp/templates
-       chown www-data:www-data /etc/lx-office-erp/lx_office.conf
+       chown www-data:www-data /etc/lx-office-erp/lx-erp.conf
+       chown www-data:www-data /etc/lx-office-erp/authentication.pl
+       chown www-data:www-data /etc/lx-office-erp/console.conf
        chown www-data:www-data /usr/lib/lx-office-erp/menu.ini
-       chmod 0600 /etc/lx-office-erp/lx_office.conf
+       chmod 0600 /etc/lx-office-erp/lx-erp.conf
+       chmod 0600 /etc/lx-office-erp/authentication.pl
 }
 
 disable_ipv6_on_lo_interface() {
@@ -142,20 +142,23 @@ mk_new_menu() {
 }
 
 mk_new_config() {
-    if ! [ -f /etc/lx-office-erp/lx_office.conf ] ; then
-        cp /etc/lx-office-erp/lx_office.conf.default /etc/lx-office-erp/lx_office.conf
+    if ! [ -f /etc/lx-office-erp/lx-erp.conf ] ; then
+        cp /etc/lx-office-erp/lx-erp.conf.default /etc/lx-office-erp/lx-erp.conf
+    fi
+    if ! [ -f /etc/lx-office-erp/authentication.pl ] ; then
+       cp /etc/lx-office-erp/authentication.pl.default /etc/lx-office-erp/authentication.pl
+    fi
+    if ! [ -f /etc/lx-office-erp/console.conf ] ; then
+        cp /etc/lx-office-erp/console.conf.default /etc/lx-office-erp/console.conf
     fi
 }
 
 mk_links() {
-    if ! [ -f /usr/lib/lx-office-erp/config/lx_office.conf ] ; then
-        ln -s /etc/lx-office-erp/lx_office.conf /usr/lib/lx-office-erp/config/lx_office.conf
-    fi;
-    if ! [ -f /usr/lib/lx-office-erp/config/lx_office.conf.default ] ; then
-        ln -s /etc/lx-office-erp/lx_office.conf.default /usr/lib/lx-office-erp/config/lx_office.conf.default
+    if ! [ -f /usr/lib/lx-office-erp/config/lx-erp.conf ] ; then
+        ln -s /etc/lx-office-erp/lx-erp.conf /usr/lib/lx-office-erp/config/lx-erp.conf
     fi;
-    if [ -e /etc/lx-office-erp/authentication.pl ] ; then
-       rm /etc/lx-office-erp/authentication.pl
+    if ! [ -f /usr/lib/lx-office-erp/config/authentication.pl ] ; then
+        ln -s /etc/lx-office-erp/authentication.pl /usr/lib/lx-office-erp/config/authentication.pl
     fi
     if [ -e /etc/apache2 ] ; then
         if ! [ -f /etc/apache2/conf.d/lx-office-erp.apache2.conf ] ; then
index 850d6ad..8392177 100644 (file)
--- a/SL/IR.pm
+++ b/SL/IR.pm
@@ -527,7 +527,14 @@ sub post_invoice {
 
   # set values which could be empty
   my $taxzone_id         = $form->{taxzone_id} * 1;
-  $form->{department_id} = (split /--/, $form->{department})[1];
+
+  # Seit neuestem wird die department_id schon übergeben UND $form->department nicht mehr
+  # korrekt zusammengebaut. Sehr wahrscheinlich beim Umstieg auf T8 kaputt gegangen
+  # Ich lass den Code von 2005 erstmal noch stehen ;-) jb 03-2011
+  # copy & paste von IS.pm
+  if (!$form->{department_id}){
+    $form->{department_id} = (split /--/, $form->{department})[1];
+  }
   $form->{invnumber}     = $form->{id} unless $form->{invnumber};
 
   $taxzone_id = 0 if (3 < $taxzone_id) || (0 > $taxzone_id);
index d91a36b..a940355 100644 (file)
--- a/SL/IS.pm
+++ b/SL/IS.pm
@@ -529,8 +529,12 @@ sub post_invoice {
   }
 
   $form->{defaultcurrency} = $form->get_default_currency($myconfig);
-
-  ($null, $form->{department_id}) = split(/--/, $form->{department});
+  # Seit neuestem wird die department_id schon übergeben UND $form->department nicht mehr
+  # korrekt zusammengebaut. Sehr wahrscheinlich beim Umstieg auf T8 kaputt gegangen
+  # Ich lass den Code von 2005 erstmal noch stehen ;-) jb 03-2011
+  if (!$form->{department_id}){
+    ($null, $form->{department_id}) = split(/--/, $form->{department});
+  }
 
   my $all_units = AM->retrieve_units($myconfig, $form);
 
@@ -1005,7 +1009,7 @@ sub post_invoice {
                 cp_id       = ?, marge_total   = ?, marge_percent = ?,
                 globalproject_id               = ?, delivery_customer_id             = ?,
                 transaction_description        = ?, delivery_vendor_id               = ?,
-                donumber    = ?
+                donumber    = ?, invnumber_for_credit_note = ?
               WHERE id = ?|;
   @values = (          $form->{"invnumber"},           $form->{"ordnumber"},             $form->{"quonumber"},          $form->{"cusordnumber"},
              conv_date($form->{"invdate"}),  conv_date($form->{"orddate"}),    conv_date($form->{"quodate"}),    conv_i($form->{"customer_id"}),
@@ -1018,7 +1022,7 @@ sub post_invoice {
                 conv_i($form->{"cp_id"}),            1 * $form->{marge_total} ,      1 * $form->{marge_percent},
                 conv_i($form->{"globalproject_id"}),                              conv_i($form->{"delivery_customer_id"}),
                        $form->{transaction_description},                          conv_i($form->{"delivery_vendor_id"}),
-                       $form->{"donumber"}, #das entsprechende feld lieferscheinnummer aus der html-form 12.02.09 jb
+                       $form->{"donumber"}, $form->{"invnumber_for_credit_note"},
                 conv_i($form->{"id"}));
   do_query($form, $dbh, $query, @values);
 
@@ -1448,9 +1452,9 @@ sub retrieve_invoice {
            a.duedate, a.taxincluded, a.curr AS currency, a.shipto_id, a.cp_id,
            a.employee_id, a.salesman_id, a.payment_id,
            a.language_id, a.delivery_customer_id, a.delivery_vendor_id, a.type,
-           a.transaction_description,
+           a.transaction_description, a.donumber, a.invnumber_for_credit_note,
            a.marge_total, a.marge_percent,
-           e.name AS employee, a.donumber
+           e.name AS employee
          FROM ar a
          LEFT JOIN employee e ON (e.id = a.employee_id)
          WHERE a.id = ?|;
index 51c7def..e1076ef 100644 (file)
@@ -915,7 +915,8 @@ sub credit_note {
   $form->{title}  = $locale->text('Add Credit Note');
   $form->{script} = 'is.pl';
 
-
+  # Bei Gutschriften bezug zur Rechnungsnummer
+  $form->{invnumber_for_credit_note} = $form->{invnumber};
   # bo creates the id, reset it
   map { delete $form->{$_} }
     qw(id invnumber subject message cc bcc printed emailed queued);
index 520aa27..d7cd59e 100644 (file)
   - Beim Laden von Rechnungsentwürfen, das Fälligkeits- und Rechnungsdatum duch
     das Tagesdatum ersetzen
 
+  - Bei Verkaufsgutschriften zusätzlich noch die Rechnungsnummer mitnehmen, damit der Bezug klarer ist.
+
+  Liste gefixter Bugs aus dem Bugtracker:
+
+  - Bugfix 1613: Status teilweise
+
 
 2011-02-02 - Release 2.6.2
 
diff --git a/sql/Pg-upgrade2/ar_add_invnumber_for_credit_note.sql b/sql/Pg-upgrade2/ar_add_invnumber_for_credit_note.sql
new file mode 100644 (file)
index 0000000..0eaeade
--- /dev/null
@@ -0,0 +1,5 @@
+-- @tag: ar_add_invnumber_for_credit_note
+-- @description: Die Rechnungsnummer wird bei Gutschriften bisher nicht uebernommen. Das aendert sich mit diesem Update. Hierfuer muss allerdings die Rechnungstabelle ar um einen entsprechenden Eintrag erweitert werden. (invnumber_for_credit_note in ar)
+-- @depends: delivery_orders
+alter table ar add column invnumber_for_credit_note text;
+
index 8236f37..61cd7f3 100644 (file)
@@ -43,6 +43,7 @@
   \rightline{\LARGE\textbf{\textit{Gutschrift}}} \vspace*{0.2cm}
   \rightline{\large\textbf{\textit{Nr. <%invnumber%>% \vspace*{0.2cm}
   }}}
+  für Rechnung: \hfill <%invnumber_for_credit_note%>
 
   Gutschriftdatum:\hfill <%invdate%>
 
index a6c2197..c84e5d4 100644 (file)
           <th align="right" nowrap>[% 'Credit Note Number' | $T8 %]</th>
           <td colspan="3"><input size='11' name="invnumber" value="[% HTML.escape(invnumber) %]"></td>
         </tr>
+        <tr>
+          <th align="right" nowrap>[% 'Invoice Number' | $T8 %]</th>
+          <td colspan="3"><input size='11' name="invnumber_for_credit_note" value="[% HTML.escape(invnumber_for_credit_note) %]"></td>
+        </tr>
         <tr>
           <th align="right">[% 'Credit Note Date' | $T8 %]</th>
           <td nowrap>