Fix multicurrency (tags for odt)
This commit is contained in:
parent
e7e4252244
commit
9baeee893f
@ -320,34 +320,6 @@ abstract class CommonDocGenerator
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Define array with couple subtitution key => subtitution value
|
|
||||||
*
|
|
||||||
* @param Object $object Dolibarr Object
|
|
||||||
* @param Translate $outputlangs Language object for output
|
|
||||||
* @param boolean $recursive Want to fetch child array or child object
|
|
||||||
* @return array Array of substitution key->code
|
|
||||||
*/
|
|
||||||
function get_substitutionarray_each_var_object(&$object,$outputlangs,$recursive=true) {
|
|
||||||
$array_other = array();
|
|
||||||
if(!empty($object)) {
|
|
||||||
foreach($object as $key => $value) {
|
|
||||||
if(!empty($value)) {
|
|
||||||
if(!is_array($value) && !is_object($value)) {
|
|
||||||
$array_other['object_'.$key] = $value;
|
|
||||||
}
|
|
||||||
if(is_array($value) && $recursive){
|
|
||||||
$array_other['object_'.$key] = $this->get_substitutionarray_each_var_object($value,$outputlangs,false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $array_other;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Define array with couple substitution key => substitution value
|
* Define array with couple substitution key => substitution value
|
||||||
*
|
*
|
||||||
@ -410,6 +382,15 @@ abstract class CommonDocGenerator
|
|||||||
$array_key.'_total_ttc'=>price2num($object->total_ttc),
|
$array_key.'_total_ttc'=>price2num($object->total_ttc),
|
||||||
$array_key.'_total_discount_ht' => price2num($object->getTotalDiscount()),
|
$array_key.'_total_discount_ht' => price2num($object->getTotalDiscount()),
|
||||||
|
|
||||||
|
$array_key.'_multicurrency_code' => price2num($object->multicurrency_code),
|
||||||
|
$array_key.'_multicurrency_tx' => price2num($object->multicurrency_tx),
|
||||||
|
$array_key.'_multicurrency_total_ht' => price2num($object->multicurrency_total_ht),
|
||||||
|
$array_key.'_multicurrency_total_tva' => price2num($object->multicurrency_total_tva),
|
||||||
|
$array_key.'_multicurrency_total_ttc' => price2num($object->multicurrency_total_ttc),
|
||||||
|
$array_key.'_multicurrency_total_ht_locale' => price($object->multicurrency_total_ht, 0, $outputlangs),
|
||||||
|
$array_key.'_multicurrency_total_tva_locale' => price($object->multicurrency_total_tva, 0, $outputlangs),
|
||||||
|
$array_key.'_multicurrency_total_ttc_locale' => price($object->multicurrency_total_ttc, 0, $outputlangs),
|
||||||
|
|
||||||
$array_key.'_note_private'=>$object->note,
|
$array_key.'_note_private'=>$object->note,
|
||||||
$array_key.'_note_public'=>$object->note_public,
|
$array_key.'_note_public'=>$object->note_public,
|
||||||
$array_key.'_note'=>$object->note_public, // For backward compatibility
|
$array_key.'_note'=>$object->note_public, // For backward compatibility
|
||||||
@ -493,6 +474,16 @@ abstract class CommonDocGenerator
|
|||||||
'line_date_end'=>dol_print_date($line->date_end, 'day', 'tzuser'),
|
'line_date_end'=>dol_print_date($line->date_end, 'day', 'tzuser'),
|
||||||
'line_date_end_locale'=>dol_print_date($line->date_end, 'day', 'tzuser', $outputlangs),
|
'line_date_end_locale'=>dol_print_date($line->date_end, 'day', 'tzuser', $outputlangs),
|
||||||
'line_date_end_rfc'=>dol_print_date($line->date_end, 'dayrfc', 'tzuser'),
|
'line_date_end_rfc'=>dol_print_date($line->date_end, 'dayrfc', 'tzuser'),
|
||||||
|
|
||||||
|
'line_multicurrency_code' => price2num($line->multicurrency_code),
|
||||||
|
'line_multicurrency_subprice' => price2num($line->multicurrency_subprice),
|
||||||
|
'line_multicurrency_total_ht' => price2num($line->multicurrency_total_ht),
|
||||||
|
'line_multicurrency_total_tva' => price2num($line->multicurrency_total_tva),
|
||||||
|
'line_multicurrency_total_ttc' => price2num($line->multicurrency_total_ttc),
|
||||||
|
'line_multicurrency_subprice_locale' => price($line->multicurrency_subprice, 0, $outputlangs),
|
||||||
|
'line_multicurrency_total_ht_locale' => price($line->multicurrency_total_ht, 0, $outputlangs),
|
||||||
|
'line_multicurrency_total_tva_locale' => price($line->multicurrency_total_tva, 0, $outputlangs),
|
||||||
|
'line_multicurrency_total_ttc_locale' => price($line->multicurrency_total_ttc, 0, $outputlangs),
|
||||||
);
|
);
|
||||||
|
|
||||||
// Retrieve extrafields
|
// Retrieve extrafields
|
||||||
@ -601,6 +592,33 @@ abstract class CommonDocGenerator
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define array with couple subtitution key => subtitution value
|
||||||
|
*
|
||||||
|
* @param Object $object Dolibarr Object
|
||||||
|
* @param Translate $outputlangs Language object for output
|
||||||
|
* @param boolean $recursive Want to fetch child array or child object
|
||||||
|
* @return array Array of substitution key->code
|
||||||
|
*/
|
||||||
|
function get_substitutionarray_each_var_object(&$object,$outputlangs,$recursive=true) {
|
||||||
|
$array_other = array();
|
||||||
|
if(!empty($object)) {
|
||||||
|
foreach($object as $key => $value) {
|
||||||
|
if(!empty($value)) {
|
||||||
|
if(!is_array($value) && !is_object($value)) {
|
||||||
|
$array_other['object_'.$key] = $value;
|
||||||
|
}
|
||||||
|
if(is_array($value) && $recursive){
|
||||||
|
$array_other['object_'.$key] = $this->get_substitutionarray_each_var_object($value,$outputlangs,false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $array_other;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fill array with couple extrafield key => extrafield value
|
* Fill array with couple extrafield key => extrafield value
|
||||||
*
|
*
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user