Fix warnings
This commit is contained in:
parent
25e4791497
commit
832db82fce
@ -935,9 +935,9 @@ class FactureRec extends CommonInvoice
|
||||
$sql .= ", ".price2num($txtva);
|
||||
$sql .= ", '".$this->db->escape($vat_src_code)."'";
|
||||
$sql .= ", ".price2num($txlocaltax1);
|
||||
$sql .= ", '".$this->db->escape($localtaxes_type[0])."'";
|
||||
$sql .= ", '".$this->db->escape(isset($localtaxes_type[0]) ? $localtaxes_type[0] : '')."'";
|
||||
$sql .= ", ".price2num($txlocaltax2);
|
||||
$sql .= ", '".$this->db->escape($localtaxes_type[2])."'";
|
||||
$sql .= ", '".$this->db->escape(isset($localtaxes_type[2]) ? $localtaxes_type[2] : '')."'";
|
||||
$sql .= ", ".(!empty($fk_product) ? "'".$this->db->escape($fk_product)."'" : "null");
|
||||
$sql .= ", ".$product_type;
|
||||
$sql .= ", ".price2num($remise_percent);
|
||||
|
||||
@ -5216,7 +5216,7 @@ function getLocalTaxesFromRate($vatrate, $local, $buyer, $seller, $firstparamisi
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -104,7 +104,7 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt
|
||||
//var_dump($seller->country_id);exit;
|
||||
}
|
||||
if (empty($localtaxes_array) || !is_array($localtaxes_array)) {
|
||||
dol_syslog("Price.lib::calcul_price_total Warning: function is called with parameter localtaxes_array that is missing", LOG_WARNING);
|
||||
dol_syslog("Price.lib::calcul_price_total Warning: function is called with parameter localtaxes_array that is missing or empty", LOG_WARNING);
|
||||
}
|
||||
if (!is_numeric($txtva)) {
|
||||
dol_syslog("Price.lib::calcul_price_total Warning: function was called with a parameter vat rate that is not a real numeric value. There is surely a bug.", LOG_ERR);
|
||||
|
||||
@ -534,8 +534,8 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
&& (!empty($localtax1_rate) || !empty($localtax2_rate))) // and there is local tax
|
||||
{
|
||||
$localtaxtmp_array = getLocalTaxesFromRate($vatrate, 0, $object->thirdparty, $mysoc);
|
||||
$localtax1_type = $localtaxtmp_array[0];
|
||||
$localtax2_type = $localtaxtmp_array[2];
|
||||
$localtax1_type = isset($localtaxtmp_array[0]) ? $localtaxtmp_array[0] : '';
|
||||
$localtax2_type = isset($localtaxtmp_array[2]) ? $localtaxtmp_array[2] : '';
|
||||
}
|
||||
|
||||
// retrieve global local tax
|
||||
|
||||
@ -758,8 +758,8 @@ class pdf_eratosthene extends ModelePDFCommandes
|
||||
&& (!empty($localtax1_rate) || !empty($localtax2_rate))) // and there is local tax
|
||||
{
|
||||
$localtaxtmp_array = getLocalTaxesFromRate($vatrate, 0, $object->thirdparty, $mysoc);
|
||||
$localtax1_type = $localtaxtmp_array[0];
|
||||
$localtax2_type = $localtaxtmp_array[2];
|
||||
$localtax1_type = isset($localtaxtmp_array[0]) ? $localtaxtmp_array[0] : '';
|
||||
$localtax2_type = isset($localtaxtmp_array[2]) ? $localtaxtmp_array[2] : '';
|
||||
}
|
||||
|
||||
// retrieve global local tax
|
||||
|
||||
@ -658,8 +658,8 @@ class pdf_crabe extends ModelePDFFactures
|
||||
&& (!empty($localtax1_rate) || !empty($localtax2_rate))) // and there is local tax
|
||||
{
|
||||
$localtaxtmp_array = getLocalTaxesFromRate($vatrate, 0, $object->thirdparty, $mysoc);
|
||||
$localtax1_type = $localtaxtmp_array[0];
|
||||
$localtax2_type = $localtaxtmp_array[2];
|
||||
$localtax1_type = isset($localtaxtmp_array[0]) ? $localtaxtmp_array[0] : '';
|
||||
$localtax2_type = isset($localtaxtmp_array[2]) ? $localtaxtmp_array[2] : '';
|
||||
}
|
||||
|
||||
// retrieve global local tax
|
||||
|
||||
@ -816,8 +816,8 @@ class pdf_sponge extends ModelePDFFactures
|
||||
&& (!empty($localtax1_rate) || !empty($localtax2_rate))) // and there is local tax
|
||||
{
|
||||
$localtaxtmp_array = getLocalTaxesFromRate($vatrate, 0, $object->thirdparty, $mysoc);
|
||||
$localtax1_type = $localtaxtmp_array[0];
|
||||
$localtax2_type = $localtaxtmp_array[2];
|
||||
$localtax1_type = isset($localtaxtmp_array[0]) ? $localtaxtmp_array[0] : '';
|
||||
$localtax2_type = isset($localtaxtmp_array[2]) ? $localtaxtmp_array[2] : '';
|
||||
}
|
||||
|
||||
// retrieve global local tax
|
||||
|
||||
@ -470,8 +470,8 @@ class pdf_standard extends ModelePDFProduct
|
||||
&& (! empty($localtax1_rate) || ! empty($localtax2_rate))) // and there is local tax
|
||||
{
|
||||
$localtaxtmp_array=getLocalTaxesFromRate($vatrate,0,$object->thirdparty,$mysoc);
|
||||
$localtax1_type = $localtaxtmp_array[0];
|
||||
$localtax2_type = $localtaxtmp_array[2];
|
||||
$localtax1_type = isset($localtaxtmp_array[0]) ? $localtaxtmp_array[0] : '';
|
||||
$localtax2_type = isset($localtaxtmp_array[2]) ? $localtaxtmp_array[2] : '';
|
||||
}
|
||||
|
||||
// retrieve global local tax
|
||||
|
||||
@ -626,8 +626,8 @@ class pdf_azur extends ModelePDFPropales
|
||||
&& (!empty($localtax1_rate) || !empty($localtax2_rate))) // and there is local tax
|
||||
{
|
||||
$localtaxtmp_array = getLocalTaxesFromRate($vatrate, 0, $object->thirdparty, $mysoc);
|
||||
$localtax1_type = $localtaxtmp_array[0];
|
||||
$localtax2_type = $localtaxtmp_array[2];
|
||||
$localtax1_type = isset($localtaxtmp_array[0]) ? $localtaxtmp_array[0] : '';
|
||||
$localtax2_type = isset($localtaxtmp_array[2]) ? $localtaxtmp_array[2] : '';
|
||||
}
|
||||
|
||||
// retrieve global local tax
|
||||
|
||||
@ -773,8 +773,8 @@ class pdf_cyan extends ModelePDFPropales
|
||||
&& (!empty($localtax1_rate) || !empty($localtax2_rate))) // and there is local tax
|
||||
{
|
||||
$localtaxtmp_array = getLocalTaxesFromRate($vatrate, 0, $object->thirdparty, $mysoc);
|
||||
$localtax1_type = $localtaxtmp_array[0];
|
||||
$localtax2_type = $localtaxtmp_array[2];
|
||||
$localtax1_type = isset($localtaxtmp_array[0]) ? $localtaxtmp_array[0] : '';
|
||||
$localtax2_type = isset($localtaxtmp_array[2]) ? $localtaxtmp_array[2] : '';
|
||||
}
|
||||
|
||||
// retrieve global local tax
|
||||
|
||||
@ -688,8 +688,8 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
||||
&& (!empty($localtax1_rate) || !empty($localtax2_rate))) // and there is local tax
|
||||
{
|
||||
$localtaxtmp_array = getLocalTaxesFromRate($vatrate, 0, $mysoc, $object->thirdparty);
|
||||
$localtax1_type = $localtaxtmp_array[0];
|
||||
$localtax2_type = $localtaxtmp_array[2];
|
||||
$localtax1_type = isset($localtaxtmp_array[0]) ? $localtaxtmp_array[0] : '';
|
||||
$localtax2_type = isset($localtaxtmp_array[2]) ? $localtaxtmp_array[2] : '';
|
||||
}
|
||||
|
||||
// retrieve global local tax
|
||||
|
||||
@ -570,8 +570,8 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
&& (!empty($localtax1_rate) || !empty($localtax2_rate))) // and there is local tax
|
||||
{
|
||||
$localtaxtmp_array = getLocalTaxesFromRate($vatrate, 0, $mysoc, $object->thirdparty);
|
||||
$localtax1_type = $localtaxtmp_array[0];
|
||||
$localtax2_type = $localtaxtmp_array[2];
|
||||
$localtax1_type = isset($localtaxtmp_array[0]) ? $localtaxtmp_array[0] : '';
|
||||
$localtax2_type = isset($localtaxtmp_array[2]) ? $localtaxtmp_array[2] : '';
|
||||
}
|
||||
|
||||
// retrieve global local tax
|
||||
|
||||
@ -582,8 +582,8 @@ class pdf_aurore extends ModelePDFSupplierProposal
|
||||
if ((!isset($localtax1_type) || $localtax1_type == '' || !isset($localtax2_type) || $localtax2_type == '') // if tax type not defined
|
||||
&& (!empty($localtax1_rate) || !empty($localtax2_rate))) { // and there is local tax
|
||||
$localtaxtmp_array = getLocalTaxesFromRate($vatrate, 0, $object->thirdparty, $mysoc);
|
||||
$localtax1_type = $localtaxtmp_array[0];
|
||||
$localtax2_type = $localtaxtmp_array[2];
|
||||
$localtax1_type = isset($localtaxtmp_array[0]) ? $localtaxtmp_array[0] : '';
|
||||
$localtax2_type = isset($localtaxtmp_array[2]) ? $localtaxtmp_array[2] : '';
|
||||
}
|
||||
|
||||
// retrieve global local tax
|
||||
|
||||
@ -686,8 +686,8 @@ class pdf_standard_myobject extends ModelePDFMyObject
|
||||
&& (!empty($localtax1_rate) || !empty($localtax2_rate))) // and there is local tax
|
||||
{
|
||||
$localtaxtmp_array = getLocalTaxesFromRate($vatrate, 0, $object->thirdparty, $mysoc);
|
||||
$localtax1_type = $localtaxtmp_array[0];
|
||||
$localtax2_type = $localtaxtmp_array[2];
|
||||
$localtax1_type = isset($localtaxtmp_array[0]) ? $localtaxtmp_array[0] : '';
|
||||
$localtax2_type = isset($localtaxtmp_array[2]) ? $localtaxtmp_array[2] : '';
|
||||
}
|
||||
|
||||
// retrieve global local tax
|
||||
|
||||
@ -499,7 +499,15 @@ class SupplierProposal extends CommonObject
|
||||
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.
|
||||
|
||||
$localtaxes_type = getLocalTaxesFromRate($txtva, 0, $this->thirdparty, $mysoc);
|
||||
$txtva = preg_replace('/\s*\(.*\)/', '', $txtva); // Remove code into vatrate.
|
||||
|
||||
// Clean vat code
|
||||
$reg = array();
|
||||
$vat_src_code = '';
|
||||
if (preg_match('/\((.*)\)/', $txtva, $reg))
|
||||
{
|
||||
$vat_src_code = $reg[1];
|
||||
$txtva = preg_replace('/\s*\(.*\)/', '', $txtva); // Remove code into vatrate.
|
||||
}
|
||||
|
||||
if (!empty($conf->multicurrency->enabled) && $pu_ht_devise > 0) {
|
||||
$pu = 0;
|
||||
@ -544,6 +552,8 @@ class SupplierProposal extends CommonObject
|
||||
$this->line->label = $label;
|
||||
$this->line->desc = $desc;
|
||||
$this->line->qty = $qty;
|
||||
|
||||
$this->line->vat_src_code = $vat_src_code;
|
||||
$this->line->tva_tx = $txtva;
|
||||
$this->line->localtax1_tx = ($total_localtax1 ? $localtaxes_type[1] : 0);
|
||||
$this->line->localtax2_tx = ($total_localtax2 ? $localtaxes_type[3] : 0);
|
||||
@ -2736,6 +2746,8 @@ class SupplierProposalLine extends CommonObjectLine
|
||||
|
||||
public $qty;
|
||||
public $tva_tx;
|
||||
public $vat_src_code;
|
||||
|
||||
public $subprice;
|
||||
public $remise_percent;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user