Merge branch 'master' of vc.linet-services.de:public/lx-office-erp
authorThomas Heck <theck@linet-services.de>
Thu, 30 Aug 2012 11:52:32 +0000 (13:52 +0200)
committerThomas Heck <theck@linet-services.de>
Thu, 30 Aug 2012 11:52:32 +0000 (13:52 +0200)
bin/mozilla/is.pl
sql/Pg-upgrade2/contacts_add_street_and_zipcode_and_city.pl [new file with mode: 0644]
t/form/format_amount.t
templates/webpages/do/form_header.html

index 66aa4b8..aefa545 100644 (file)
@@ -729,7 +729,7 @@ sub post {
   ($form->{AR_paid})   = split /--/, $form->{AR_paid};
   $form->{storno}    ||= 0;
 
-  $form->{label} = $locale->text('Invoice');
+  $form->{label} = $form->{type} eq 'credit_note' ? $locale->text('Credit Note') : $locale->text('Invoice');
 
   $form->{id} = 0 if $form->{postasnew};
 
@@ -748,7 +748,7 @@ sub post {
   remove_draft() if $form->{remove_draft};
 
   if(!exists $form->{addition}) {
-    $form->{snumbers} = qq|invnumber_| . $form->{invnumber};
+    $form->{snumbers} =  'invnumber' .'_'. $form->{invnumber}; # ($form->{type} eq 'credit_note' ? 'cnnumber' : 'invnumber') .'_'. $form->{invnumber};
     $form->{addition} = $form->{print_and_post} ? "PRINTED AND POSTED" :
                         $form->{storno}         ? "STORNO"             :
                                                   "POSTED";
@@ -985,7 +985,7 @@ sub yes {
   if (IS->delete_invoice(\%myconfig, \%$form)) {
     # saving the history
     if(!exists $form->{addition}) {
-    $form->{snumbers} = qq|invnumber_| . $form->{invnumber};
+      $form->{snumbers} = 'invnumber' .'_'. $form->{invnumber}; # ($form->{type} eq 'credit_note' ? 'cnnumber' : 'invnumber') .'_'. $form->{invnumber};
       $form->{addition} = "DELETED";
       $form->save_history;
     }
diff --git a/sql/Pg-upgrade2/contacts_add_street_and_zipcode_and_city.pl b/sql/Pg-upgrade2/contacts_add_street_and_zipcode_and_city.pl
new file mode 100644 (file)
index 0000000..f1dde25
--- /dev/null
@@ -0,0 +1,24 @@
+# @tag: contacts_add_street_and_zipcode_and_city
+# @description: Spalten hinzuf&uuml;gen.
+# @depends: release_2_7_0
+# @charset: utf-8
+
+use utf8;
+use strict;
+
+my @queries = (
+  'ALTER TABLE contacts ADD COLUMN cp_street text;',
+  'ALTER TABLE contacts ADD COLUMN cp_zipcode text;',
+  'ALTER TABLE contacts ADD COLUMN cp_city text;',
+);
+
+foreach my $query (@queries) {
+  if ( $dbh->do($query) ) {
+    next;
+  }
+
+  $dbh->rollback();
+  $dbh->begin_work();
+}
+
+return 1;
index 2c6e90d..a5a4306 100644 (file)
@@ -24,20 +24,20 @@ my $config = {};
 
 $config->{numberformat} = '1.000,00';
 
-is($form->format_amount($config, '1e1', 2), '10,00', 'blaa');
-is($form->format_amount($config, 1000, 2), '1.000,00', 'blaa');
-is($form->format_amount($config, 1000.1234, 2), '1.000,12', 'blaa');
-is($form->format_amount($config, 1000000000.1234, 2), '1.000.000.000,12', 'blaa');
-is($form->format_amount($config, -1000000000.1234, 2), '-1.000.000.000,12', 'blaa');
+is($form->format_amount($config, '1e1', 2), '10,00', 'format 1e1 (numberformat: 1.000,00)');
+is($form->format_amount($config, 1000, 2), '1.000,00', 'format 1000 (numberformat: 1.000,00)');
+is($form->format_amount($config, 1000.1234, 2), '1.000,12', 'format 1000.1234 (numberformat: 1.000,00)');
+is($form->format_amount($config, 1000000000.1234, 2), '1.000.000.000,12', 'format 1000000000.1234 (numberformat: 1.000,00)');
+is($form->format_amount($config, -1000000000.1234, 2), '-1.000.000.000,12', 'format -1000000000.1234 (numberformat: 1.000,00)');
 
 
 $config->{numberformat} = '1,000.00';
 
-is($form->format_amount($config, '1e1', 2), '10.00', 'blaa');
-is($form->format_amount($config, 1000, 2), '1,000.00', 'blaa');
-is($form->format_amount($config, 1000.1234, 2), '1,000.12', 'blaa');
-is($form->format_amount($config, 1000000000.1234, 2), '1,000,000,000.12', 'blaa');
-is($form->format_amount($config, -1000000000.1234, 2), '-1,000,000,000.12', 'blaa');
+is($form->format_amount($config, '1e1', 2), '10,00', 'format 1e1 (numberformat: 1,000.00)');
+is($form->format_amount($config, 1000, 2), '1.000,00', 'format 1000 (numberformat: 1,000.00)');
+is($form->format_amount($config, 1000.1234, 2), '1.000,12', 'format 1000.1234 (numberformat: 1,000.00)');
+is($form->format_amount($config, 1000000000.1234, 2), '1.000.000.000,12', 'format 1000000000.1234 (numberformat: 1,000.00)');
+is($form->format_amount($config, -1000000000.1234, 2), '-1.000.000.000,12', 'format -1000000000.1234 (numberformat: 1,000.00)');
 
 done_testing;
 
index 891ee38..2f29a95 100644 (file)
        <tr>
         <th align="right" nowrap>[% 'Department' | $T8 %]</th>
         <td colspan="3">
-         [% L.select_tag('department_id', L.options_for_select(ALL_DEPARTMENTS, default=department_id, title="description", with_empty=1), style='width: 250px', disabled => delivered )%]
+          [% IF ( delivered ) %]
+            [% L.hidden_tag('department_id', department_id) %]
+          [% END %]
+          [% L.select_tag('department_id', L.options_for_select(ALL_DEPARTMENTS, default=department_id, title="description", with_empty=1), style='width: 250px', disabled => delivered )%]
        </td>
        </tr>
        [%- END %]