66 public function cleanAmount(&$arrayrecord, $listfields, $record_key)
68 $value_trim = trim($arrayrecord[$record_key][
'val']);
69 return floatval($value_trim);
80 public function cleanValue(&$arrayrecord, $listfields, $record_key)
82 return trim($arrayrecord[$record_key][
'val']);
96 $field_index_list = array_flip($listfields);
97 if (isset($field_index_list[
'debit']) && isset($field_index_list[
'credit'])) {
98 $debit_index = $field_index_list[
'debit'];
99 $credit_index = $field_index_list[
'credit'];
101 $debit = floatval($arrayrecord[$debit_index][
'val']);
102 $credit = floatval($arrayrecord[$credit_index][
'val']);
103 if (!empty($debit)) {
109 return "'" . $this->
db->escape(abs($amount)) .
"'";
126 $field_index_list = array_flip($listfields);
127 if (isset($field_index_list[
'debit'])) {
128 $debit_index = $field_index_list[
'debit'];
130 $debit = floatval($arrayrecord[$debit_index][
'val']);
131 if (!empty($debit)) {
137 return "'" . $this->
db->escape($sens) .
"'";
Manage the different format accountancy import.
computeAmount(&$arrayrecord, $listfields, $record_key)
Compute amount.
cleanAmount(&$arrayrecord, $listfields, $record_key)
Clean amount.
cleanValue(&$arrayrecord, $listfields, $record_key)
Clean value with trim.
computeDirection(&$arrayrecord, $listfields, $record_key)
Compute direction.
__construct(DoliDB $db)
Constructor.
Class to manage Dolibarr database access.
$conf db
API class for accounts.