$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 );
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' ],
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} }) {
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}) {
--- /dev/null
+-- @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;
<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>