New: Support tag total_vat_x.y for vat rate x.y into ODT templates
This commit is contained in:
parent
7b9fc49dea
commit
7260f39d21
@ -97,7 +97,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
|
|||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
return array(
|
$resarray=array(
|
||||||
'object_id'=>$object->id,
|
'object_id'=>$object->id,
|
||||||
'object_ref'=>$object->ref,
|
'object_ref'=>$object->ref,
|
||||||
'object_ref_ext'=>$object->ref_ext,
|
'object_ref_ext'=>$object->ref_ext,
|
||||||
@ -120,6 +120,15 @@ class doc_generic_order_odt extends ModelePDFCommandes
|
|||||||
'object_note_private'=>$object->note,
|
'object_note_private'=>$object->note,
|
||||||
'object_note'=>$object->note_public,
|
'object_note'=>$object->note_public,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Add vat by rates
|
||||||
|
foreach ($object->lines as $line)
|
||||||
|
{
|
||||||
|
if (empty($resarray['object_total_vat_'.$line->tva_tx])) $resarray['object_total_vat_'.$line->tva_tx]=0;
|
||||||
|
$resarray['object_total_vat_'.$line->tva_tx]+=$line->total_tva;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $resarray;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -105,7 +105,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures
|
|||||||
$sumpayed = $object->getSommePaiement();
|
$sumpayed = $object->getSommePaiement();
|
||||||
$alreadypayed=price($sumpayed,0,$outputlangs);
|
$alreadypayed=price($sumpayed,0,$outputlangs);
|
||||||
|
|
||||||
return array(
|
$resarray=array(
|
||||||
'object_id'=>$object->id,
|
'object_id'=>$object->id,
|
||||||
'object_ref'=>$object->ref,
|
'object_ref'=>$object->ref,
|
||||||
'object_ref_ext'=>$object->ref_ext,
|
'object_ref_ext'=>$object->ref_ext,
|
||||||
@ -132,6 +132,15 @@ class doc_generic_invoice_odt extends ModelePDFFactures
|
|||||||
'object_already_payed'=>$alreadypayed,
|
'object_already_payed'=>$alreadypayed,
|
||||||
'object_remain_to_pay'=>price($object->total_ttc - $sumpayed,0,$outputlangs)
|
'object_remain_to_pay'=>price($object->total_ttc - $sumpayed,0,$outputlangs)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Add vat by rates
|
||||||
|
foreach ($object->lines as $line)
|
||||||
|
{
|
||||||
|
if (empty($resarray['object_total_vat_'.$line->tva_tx])) $resarray['object_total_vat_'.$line->tva_tx]=0;
|
||||||
|
$resarray['object_total_vat_'.$line->tva_tx]+=$line->total_tva;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $resarray;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -97,7 +97,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales
|
|||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
return array(
|
$resarray=array(
|
||||||
'object_id'=>$object->id,
|
'object_id'=>$object->id,
|
||||||
'object_ref'=>$object->ref,
|
'object_ref'=>$object->ref,
|
||||||
'object_ref_ext'=>$object->ref_ext,
|
'object_ref_ext'=>$object->ref_ext,
|
||||||
@ -119,6 +119,15 @@ class doc_generic_proposal_odt extends ModelePDFPropales
|
|||||||
'object_note_private'=>$object->note,
|
'object_note_private'=>$object->note,
|
||||||
'object_note'=>$object->note_public,
|
'object_note'=>$object->note_public,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Add vat by rates
|
||||||
|
foreach ($object->lines as $line)
|
||||||
|
{
|
||||||
|
if (empty($resarray['object_total_vat_'.$line->tva_tx])) $resarray['object_total_vat_'.$line->tva_tx]=0;
|
||||||
|
$resarray['object_total_vat_'.$line->tva_tx]+=$line->total_tva;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $resarray;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user