Clean code

This commit is contained in:
Laurent Destailleur 2020-10-27 19:44:15 +01:00
parent ebdc1f7457
commit ec6c735d89
12 changed files with 17 additions and 25 deletions

View File

@ -928,7 +928,7 @@ class Contrat extends CommonObject
$this->nbofservices = count($this->lines);
$this->total_ttc = price2num($total_ttc); // TODO For the moment value is false as value is not stored in database for line linked to products
$this->total_vat = price2num($total_vat); // TODO For the moment value is false as value is not stored in database for line linked to products
$this->total_tva = price2num($total_vat); // TODO For the moment value is false as value is not stored in database for line linked to products
$this->total_ht = price2num($total_ht); // TODO For the moment value is false as value is not stored in database for line linked to products
return $this->lines;

View File

@ -320,7 +320,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
'__FROM_EMAIL__' => $this->emetteur->email,
'__TOTAL_TTC__' => $object->total_ttc,
'__TOTAL_HT__' => $object->total_ht,
'__TOTAL_VAT__' => $object->total_vat
'__TOTAL_VAT__' => $object->total_tva
);
complete_substitutions_array($substitutionarray, $langs, $object);
// Call the ODTSubstitution hook

View File

@ -320,7 +320,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
'__FROM_EMAIL__' => $this->emetteur->email,
'__TOTAL_TTC__' => $object->total_ttc,
'__TOTAL_HT__' => $object->total_ht,
'__TOTAL_VAT__' => $object->total_vat
'__TOTAL_VAT__' => $object->total_tva
);
complete_substitutions_array($substitutionarray, $langs, $object);
// Call the ODTSubstitution hook

View File

@ -348,7 +348,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales
'__FROM_EMAIL__' => $this->emetteur->email,
'__TOTAL_TTC__' => $object->total_ttc,
'__TOTAL_HT__' => $object->total_ht,
'__TOTAL_VAT__' => $object->total_vat
'__TOTAL_VAT__' => $object->total_tva
);
complete_substitutions_array($substitutionarray, $langs, $object);
// Call the ODTSubstitution hook

View File

@ -323,7 +323,7 @@ class doc_generic_stock_odt extends ModelePDFStock
'__FROM_EMAIL__' => $this->emetteur->email,
'__TOTAL_TTC__' => $object->total_ttc,
'__TOTAL_HT__' => $object->total_ht,
'__TOTAL_VAT__' => $object->total_vat
'__TOTAL_VAT__' => $object->total_tva
);
complete_substitutions_array($substitutionarray, $langs, $object);
// Call the ODTSubstitution hook

View File

@ -312,7 +312,7 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders
'__FROM_EMAIL__' => $this->issuer->email,
'__TOTAL_TTC__' => $object->total_ttc,
'__TOTAL_HT__' => $object->total_ht,
'__TOTAL_VAT__' => $object->total_vat
'__TOTAL_VAT__' => $object->total_tva
);
complete_substitutions_array($substitutionarray, $langs, $object);
// Call the ODTSubstitution hook

View File

@ -349,7 +349,7 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
'__FROM_EMAIL__' => $this->emetteur->email,
'__TOTAL_TTC__' => $object->total_ttc,
'__TOTAL_HT__' => $object->total_ht,
'__TOTAL_VAT__' => $object->total_vat
'__TOTAL_VAT__' => $object->total_tva
);
complete_substitutions_array($substitutionarray, $langs, $object);
// Call the ODTSubstitution hook

View File

@ -330,7 +330,7 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
'__FROM_EMAIL__' => $this->emetteur->email,
'__TOTAL_TTC__' => $object->total_ttc,
'__TOTAL_HT__' => $object->total_ht,
'__TOTAL_VAT__' => $object->total_vat
'__TOTAL_VAT__' => $object->total_tva
);
complete_substitutions_array($substitutionarray, $langs, $object);
// Call the ODTSubstitution hook

View File

@ -316,7 +316,7 @@ class doc_generic_myobject_odt extends ModelePDFMyObject
'__FROM_EMAIL__' => $this->emetteur->email,
'__TOTAL_TTC__' => $object->total_ttc,
'__TOTAL_HT__' => $object->total_ht,
'__TOTAL_VAT__' => $object->total_vat
'__TOTAL_VAT__' => $object->total_tva
);
complete_substitutions_array($substitutionarray, $langs, $object);
// Call the ODTSubstitution hook

View File

@ -388,6 +388,13 @@ class Product extends CommonObject
*/
public $price_autogen = 0;
/**
* Array with list of supplier prices of product
*
* @var array
*/
public $supplierprices;
public $fields = array(
'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'index'=>1, 'position'=>1, 'comment'=>'Id'),

View File

@ -316,7 +316,7 @@ class doc_generic_recruitmentjobposition_odt extends ModelePDFRecruitmentJobPosi
'__FROM_EMAIL__' => $this->emetteur->email,
'__TOTAL_TTC__' => $object->total_ttc,
'__TOTAL_HT__' => $object->total_ht,
'__TOTAL_VAT__' => $object->total_vat
'__TOTAL_VAT__' => $object->total_tva
);
complete_substitutions_array($substitutionarray, $langs, $object);
// Call the ODTSubstitution hook

View File

@ -714,21 +714,6 @@ function updateProductOrService($authentication, $product)
$newobject->customcode = $product['customcode'];
$newobject->canvas = $product['canvas'];
/*foreach($product['lines'] as $line)
{
$newline=new FactureLigne($db);
$newline->type=$line['type'];
$newline->desc=$line['desc'];
$newline->fk_product=$line['fk_product'];
$newline->total_ht=$line['total_net'];
$newline->total_vat=$line['total_vat'];
$newline->total_ttc=$line['total'];
$newline->vat=$line['vat_rate'];
$newline->qty=$line['qty'];
$newline->fk_product=$line['product_id'];
}*/
//var_dump($product['ref_ext']);
//var_dump($product['lines'][0]['type']);
$elementtype = 'product';