FIX Accountancy - Clean virtual zero on the import
This commit is contained in:
parent
6f12812329
commit
f95b5be971
@ -624,7 +624,11 @@ class ImportCsv extends ModeleImports
|
|||||||
} elseif ($objimport->array_import_convertvalue[0][$val]['rule'] == 'numeric') {
|
} elseif ($objimport->array_import_convertvalue[0][$val]['rule'] == 'numeric') {
|
||||||
$newval = price2num($newval);
|
$newval = price2num($newval);
|
||||||
} elseif ($objimport->array_import_convertvalue[0][$val]['rule'] == 'accountingaccount') {
|
} elseif ($objimport->array_import_convertvalue[0][$val]['rule'] == 'accountingaccount') {
|
||||||
$newval = rtrim($newval, "0");
|
if (empty($conf->global->ACCOUNTING_MANAGE_ZERO)) {
|
||||||
|
$newval = rtrim(trim($newval), "0");
|
||||||
|
} else {
|
||||||
|
$newval = trim($newval);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//print 'Val to use as insert is '.$newval.'<br>';
|
//print 'Val to use as insert is '.$newval.'<br>';
|
||||||
|
|||||||
@ -665,7 +665,11 @@ class ImportXlsx extends ModeleImports
|
|||||||
} elseif ($objimport->array_import_convertvalue[0][$val]['rule'] == 'numeric') {
|
} elseif ($objimport->array_import_convertvalue[0][$val]['rule'] == 'numeric') {
|
||||||
$newval = price2num($newval);
|
$newval = price2num($newval);
|
||||||
} elseif ($objimport->array_import_convertvalue[0][$val]['rule'] == 'accountingaccount') {
|
} elseif ($objimport->array_import_convertvalue[0][$val]['rule'] == 'accountingaccount') {
|
||||||
$newval = rtrim($newval, "0");
|
if (empty($conf->global->ACCOUNTING_MANAGE_ZERO)) {
|
||||||
|
$newval = rtrim(trim($newval), "0");
|
||||||
|
} else {
|
||||||
|
$newval = trim($newval);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//print 'Val to use as insert is '.$newval.'<br>';
|
//print 'Val to use as insert is '.$newval.'<br>';
|
||||||
|
|||||||
@ -297,9 +297,9 @@ class modAccounting extends DolibarrModules
|
|||||||
);
|
);
|
||||||
$this->import_fieldshidden_array[$r] = array('b.doc_type'=>'const-import_from_external', 'b.fk_doc'=>'const-0', 'b.fk_docdet'=>'const-0', 'b.fk_user_author'=>'user->id', 'b.date_creation'=>'const-'.dol_print_date(dol_now(), 'standard')); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent)
|
$this->import_fieldshidden_array[$r] = array('b.doc_type'=>'const-import_from_external', 'b.fk_doc'=>'const-0', 'b.fk_docdet'=>'const-0', 'b.fk_user_author'=>'user->id', 'b.date_creation'=>'const-'.dol_print_date(dol_now(), 'standard')); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent)
|
||||||
$this->import_regex_array[$r] = array('b.doc_date'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$');
|
$this->import_regex_array[$r] = array('b.doc_date'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$');
|
||||||
$this->import_convertvalue_array[$r]=array(
|
$this->import_convertvalue_array[$r] = array(
|
||||||
'b.numero_compte'=>array('rule'=>'accountingaccount'),
|
'b.numero_compte' => array('rule' => 'accountingaccount'),
|
||||||
'b.subledger_account'=>array('rule'=>'accountingaccount')
|
'b.subledger_account' => array('rule' => 'accountingaccount')
|
||||||
);
|
);
|
||||||
$this->import_examplevalues_array[$r] = array(
|
$this->import_examplevalues_array[$r] = array(
|
||||||
'b.piece_num'=>'123 (!!! use next value not already used)',
|
'b.piece_num'=>'123 (!!! use next value not already used)',
|
||||||
|
|||||||
@ -572,7 +572,13 @@ class modProduct extends DolibarrModules
|
|||||||
'class' => 'CProductNature',
|
'class' => 'CProductNature',
|
||||||
'method' => 'fetch',
|
'method' => 'fetch',
|
||||||
'dict' => 'DictionaryProductNature'
|
'dict' => 'DictionaryProductNature'
|
||||||
),
|
),
|
||||||
|
'p.accountancy_code_sell'=>array('rule'=>'accountingaccount'),
|
||||||
|
'p.accountancy_code_sell_intra'=>array('rule'=>'accountingaccount'),
|
||||||
|
'p.accountancy_code_sell_export'=>array('rule'=>'accountingaccount'),
|
||||||
|
'p.accountancy_code_buy'=>array('rule'=>'accountingaccount'),
|
||||||
|
'p.accountancy_code_buy_intra'=>array('rule'=>'accountingaccount'),
|
||||||
|
'p.accountancy_code_buy_export'=>array('rule'=>'accountingaccount'),
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->import_regex_array[$r] = array(
|
$this->import_regex_array[$r] = array(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user