Umstellung der Kunden-Eigenschaft '"Steuer im Preis inbegriffen" als Default' auf...
authorThomas Heck <theck@linet-services.de>
Mon, 10 Sep 2012 15:12:06 +0000 (17:12 +0200)
committerThomas Heck <theck@linet-services.de>
Mon, 10 Sep 2012 15:12:06 +0000 (17:12 +0200)
Siehe Commit: 7bff84cbc6daa65a74b9f5c83415c98856eb30a1

SL/CT.pm
SL/DB/MetaSetup/Customer.pm
bin/mozilla/is.pl
bin/mozilla/oe.pl
sql/Pg-upgrade2/customer_add_taxincluded_checked_2.sql [new file with mode: 0644]
templates/webpages/ct/form_header.html

index 45745f4..fbdd4ba 100644 (file)
--- a/SL/CT.pm
+++ b/SL/CT.pm
@@ -363,7 +363,7 @@ sub save_customer {
     $form->{c_vendor_id},
     conv_i($form->{klass}),
     substr($form->{currency}, 0, 3),
-    $form->{taxincluded_checked},
+    $form->{taxincluded_checked} ne '' ? $form->{taxincluded_checked} : undef,
     $form->{id}
     );
   do_query( $form, $dbh, $query, @values );
index a1d1dec..51779f3 100644 (file)
@@ -54,7 +54,7 @@ __PACKAGE__->meta->setup(
     bic                 => { type => 'varchar', length => 100 },
     direct_debit        => { type => 'boolean', default => 'false' },
     curr                => { type => 'character', length => 3 },
-    taxincluded_checked => { type => 'varchar', length => 1 },
+    taxincluded_checked => { type => 'boolean' },
   ],
 
   primary_key_columns => [ 'id' ],
index 9d48cf2..20b497c 100644 (file)
@@ -408,13 +408,7 @@ sub form_footer {
   IS->get_customer(\%myconfig, \%$form) if $form->{type} =~ /sales_(order|quotation)/;
 
   if ( $form->{vc} eq 'customer' && !$form->{taxincluded_changed_by_user} ) {
-    if ( $form->{taxincluded_checked} eq 'y' ) {
-      $form->{taxincluded} = 1;
-    } elsif ( $form->{taxincluded_checked} eq 'n' ) {
-      $form->{taxincluded} = 0;
-    } else {
-      $form->{taxincluded} = $myconfig{taxincluded_checked};
-    }
+    $form->{taxincluded} = defined($form->{taxincluded_checked}) ? $form->{taxincluded_checked} : $myconfig{taxincluded_checked};
   }
 
   foreach my $item (@{ $form->{taxaccounts_array} }) {
index 72ad0d7..4eab4dc 100644 (file)
@@ -478,13 +478,7 @@ sub form_footer {
   IS->get_customer(\%myconfig, \%$form) if $form->{type} =~ /sales_(order|quotation)/;
 
   if ( $form->{vc} eq 'customer' && !$form->{taxincluded_changed_by_user} ) {
-    if ( $form->{taxincluded_checked} eq 'y' ) {
-      $form->{taxincluded} = 1;
-    } elsif ( $form->{taxincluded_checked} eq 'n' ) {
-      $form->{taxincluded} = 0;
-    } else {
-      $form->{taxincluded} = $myconfig{taxincluded_checked};
-    }
+    $form->{taxincluded} = defined($form->{taxincluded_checked}) ? $form->{taxincluded_checked} : $myconfig{taxincluded_checked};
   }
 
   if (!$form->{taxincluded}) {
diff --git a/sql/Pg-upgrade2/customer_add_taxincluded_checked_2.sql b/sql/Pg-upgrade2/customer_add_taxincluded_checked_2.sql
new file mode 100644 (file)
index 0000000..900eee0
--- /dev/null
@@ -0,0 +1,8 @@
+-- @tag: customer_add_taxincluded_checked_2
+-- @description: Datentype von taxincluded_checked ändern
+-- @encoding: utf-8
+-- @depends: customer_add_taxincluded_checked
+
+ALTER TABLE customer DROP COLUMN taxincluded_checked;
+
+ALTER TABLE customer ADD COLUMN taxincluded_checked boolean;
index d2e5c35..26e71b1 100644 (file)
 
      <tr>
       <td>[% 'taxincluded checked' | $T8 %]</td>
-      <td>[% L.select_tag('taxincluded_checked', [[undef, LxERP.t8('use user config')], ['y', LxERP.t8('Yes')], ['n', LxERP.t8('No')]], default = taxincluded_checked) %]</td>
+      <td>[% L.select_tag('taxincluded_checked', [[undef, LxERP.t8('use user config')], ['1', LxERP.t8('Yes')], ['0', LxERP.t8('No')]], default = taxincluded_checked) %]</td>
      </tr>
     </table>