Clean code
This commit is contained in:
parent
7c9bb10d6b
commit
33b9d492e2
@ -3842,10 +3842,10 @@ class Form
|
||||
/**
|
||||
* Output an HTML select vat rate
|
||||
*
|
||||
* @param string $htmlname Nom champ html
|
||||
* @param float $selectedrate Forcage du taux tva pre-selectionne. Mettre '' pour aucun forcage.
|
||||
* @param Societe $societe_vendeuse Objet societe vendeuse
|
||||
* @param Societe $societe_acheteuse Objet societe acheteuse
|
||||
* @param string $htmlname Name of html select field
|
||||
* @param float $selectedrate Force preselected vat rate. Use '' for no forcing.
|
||||
* @param Societe $societe_vendeuse Thirdparty seller
|
||||
* @param Societe $societe_acheteuse Thirdparty buyer
|
||||
* @param int $idprod Id product
|
||||
* @param int $info_bits Miscellaneous information on line (1 for NPR)
|
||||
* @param int $type ''=Unknown, 0=Product, 1=Service (Used if idprod not defined)
|
||||
@ -3863,9 +3863,6 @@ class Form
|
||||
global $langs,$conf,$mysoc;
|
||||
|
||||
$return='';
|
||||
$txtva=array();
|
||||
$libtva=array();
|
||||
$nprtva=array();
|
||||
|
||||
// Define defaultnpr and defaultttx
|
||||
$defaultnpr=($info_bits & 0x01);
|
||||
@ -4425,7 +4422,7 @@ class Form
|
||||
static function selectArrayAjax($url, $htmlname, $array, $id='', $show_empty=0, $key_in_label=0, $value_as_key=0, $moreparam='', $translate=0, $maxlen=0, $disabled=0, $sort='', $morecss='', $addjscombo=0)
|
||||
{
|
||||
$out = '';
|
||||
|
||||
|
||||
// Add code for jquery to use multiselect
|
||||
if ($addjscombo && empty($conf->dol_use_jmobile))
|
||||
{
|
||||
@ -4466,14 +4463,14 @@ class Form
|
||||
else
|
||||
{
|
||||
// TODO get values from ajax page to use a standard already completed array
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
$out.=self::selectarray('.'.$htmlname, $array, $id, $show_empty, $key_in_label, $value_as_key, '', $translate, $maxlen, $disabled, $sort, '', 0);
|
||||
|
||||
|
||||
return $out;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Show a multiselect form from an array.
|
||||
*
|
||||
@ -4568,7 +4565,7 @@ class Form
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Render list of categories linked to object with id $id and type $type
|
||||
*
|
||||
|
||||
@ -1292,7 +1292,7 @@ function migrate_price_facture($db,$langs,$conf)
|
||||
print '<b>'.$langs->trans('MigrationInvoice')."</b><br>\n";
|
||||
|
||||
// Liste des lignes facture non a jour
|
||||
$sql = "SELECT fd.rowid, fd.qty, fd.subprice, fd.remise_percent, fd.tva_tx as tva_taux, fd.total_ttc, fd.info_bits,";
|
||||
$sql = "SELECT fd.rowid, fd.qty, fd.subprice, fd.remise_percent, fd.tva_tx as vatrate, fd.total_ttc, fd.info_bits,";
|
||||
$sql.= " f.rowid as facid, f.remise_percent as remise_percent_global, f.total_ttc as total_ttc_f";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facturedet as fd, ".MAIN_DB_PREFIX."facture as f";
|
||||
$sql.= " WHERE fd.fk_facture = f.rowid";
|
||||
@ -1314,7 +1314,7 @@ function migrate_price_facture($db,$langs,$conf)
|
||||
$rowid = $obj->rowid;
|
||||
$qty = $obj->qty;
|
||||
$pu = $obj->subprice;
|
||||
$txtva = $obj->tva_taux;
|
||||
$vatrate = $obj->vatrate;
|
||||
$remise_percent = $obj->remise_percent;
|
||||
$remise_percent_global = $obj->remise_percent_global;
|
||||
$total_ttc_f = $obj->total_ttc_f;
|
||||
@ -1324,7 +1324,7 @@ function migrate_price_facture($db,$langs,$conf)
|
||||
$facligne= new FactureLigne($db);
|
||||
$facligne->fetch($rowid);
|
||||
|
||||
$result=calcul_price_total($qty,$pu,$remise_percent,$txtva, 0, 0,$remise_percent_global,'HT',$info_bits,0);
|
||||
$result=calcul_price_total($qty,$pu,$remise_percent,$vatrate, 0, 0,$remise_percent_global,'HT',$info_bits,0);
|
||||
$total_ht = $result[0];
|
||||
$total_tva = $result[1];
|
||||
$total_ttc = $result[2];
|
||||
@ -1333,7 +1333,7 @@ function migrate_price_facture($db,$langs,$conf)
|
||||
$facligne->total_tva = $total_tva;
|
||||
$facligne->total_ttc = $total_ttc;
|
||||
|
||||
dolibarr_install_syslog("upgrade2: Line $rowid: facid=$obj->facid pu=$pu qty=$qty tva_taux=$txtva remise_percent=$remise_percent remise_global=$remise_percent_global -> $total_ht, $total_tva, $total_ttc");
|
||||
dolibarr_install_syslog("upgrade2: Line $rowid: facid=$obj->facid pu=$pu qty=$qty vatrate=$vatrate remise_percent=$remise_percent remise_global=$remise_percent_global -> $total_ht, $total_tva, $total_ttc");
|
||||
print ". ";
|
||||
$facligne->update_total();
|
||||
|
||||
@ -1406,7 +1406,7 @@ function migrate_price_propal($db,$langs,$conf)
|
||||
print '<b>'.$langs->trans('MigrationProposal')."</b><br>\n";
|
||||
|
||||
// Liste des lignes propal non a jour
|
||||
$sql = "SELECT pd.rowid, pd.qty, pd.subprice, pd.remise_percent, pd.tva_tx as tva_taux, pd.info_bits,";
|
||||
$sql = "SELECT pd.rowid, pd.qty, pd.subprice, pd.remise_percent, pd.tva_tx as vatrate, pd.info_bits,";
|
||||
$sql.= " p.rowid as propalid, p.remise_percent as remise_percent_global";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."propaldet as pd, ".MAIN_DB_PREFIX."propal as p";
|
||||
$sql.= " WHERE pd.fk_propal = p.rowid";
|
||||
@ -1427,7 +1427,7 @@ function migrate_price_propal($db,$langs,$conf)
|
||||
$rowid = $obj->rowid;
|
||||
$qty = $obj->qty;
|
||||
$pu = $obj->subprice;
|
||||
$txtva = $obj->tva_taux;
|
||||
$vatrate = $obj->vatrate;
|
||||
$remise_percent = $obj->remise_percent;
|
||||
$remise_percent_global = $obj->remise_percent_global;
|
||||
$info_bits = $obj->info_bits;
|
||||
@ -1436,7 +1436,7 @@ function migrate_price_propal($db,$langs,$conf)
|
||||
$propalligne= new PropaleLigne($db);
|
||||
$propalligne->fetch($rowid);
|
||||
|
||||
$result=calcul_price_total($qty,$pu,$remise_percent,$txtva,0,0,$remise_percent_global,'HT',$info_bits,0);
|
||||
$result=calcul_price_total($qty,$pu,$remise_percent,$vatrate,0,0,$remise_percent_global,'HT',$info_bits,0);
|
||||
$total_ht = $result[0];
|
||||
$total_tva = $result[1];
|
||||
$total_ttc = $result[2];
|
||||
@ -1445,7 +1445,7 @@ function migrate_price_propal($db,$langs,$conf)
|
||||
$propalligne->total_tva = $total_tva;
|
||||
$propalligne->total_ttc = $total_ttc;
|
||||
|
||||
dolibarr_install_syslog("upgrade2: Line $rowid: propalid=$obj->rowid pu=$pu qty=$qty tva_taux=$txtva remise_percent=$remise_percent remise_global=$remise_percent_global -> $total_ht, $total_tva, $total_ttc");
|
||||
dolibarr_install_syslog("upgrade2: Line $rowid: propalid=$obj->rowid pu=$pu qty=$qty vatrate=$vatrate remise_percent=$remise_percent remise_global=$remise_percent_global -> $total_ht, $total_tva, $total_ttc");
|
||||
print ". ";
|
||||
$propalligne->update_total();
|
||||
|
||||
@ -1515,7 +1515,7 @@ function migrate_price_contrat($db,$langs,$conf)
|
||||
print '<b>'.$langs->trans('MigrationContract')."</b><br>\n";
|
||||
|
||||
// Liste des lignes contrat non a jour
|
||||
$sql = "SELECT cd.rowid, cd.qty, cd.subprice, cd.remise_percent, cd.tva_tx as tva_taux, cd.info_bits,";
|
||||
$sql = "SELECT cd.rowid, cd.qty, cd.subprice, cd.remise_percent, cd.tva_tx as vatrate, cd.info_bits,";
|
||||
$sql.= " c.rowid as contratid";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."contratdet as cd, ".MAIN_DB_PREFIX."contrat as c";
|
||||
$sql.= " WHERE cd.fk_contrat = c.rowid";
|
||||
@ -1536,7 +1536,7 @@ function migrate_price_contrat($db,$langs,$conf)
|
||||
$rowid = $obj->rowid;
|
||||
$qty = $obj->qty;
|
||||
$pu = $obj->subprice;
|
||||
$txtva = $obj->tva_taux;
|
||||
$vatrate = $obj->vatrate;
|
||||
$remise_percent = $obj->remise_percent;
|
||||
$info_bits = $obj->info_bits;
|
||||
|
||||
@ -1545,7 +1545,7 @@ function migrate_price_contrat($db,$langs,$conf)
|
||||
//$contratligne->fetch($rowid); Non requis car le update_total ne met a jour que chp redefinis
|
||||
$contratligne->id=$rowid;
|
||||
|
||||
$result=calcul_price_total($qty,$pu,$remise_percent,$txtva,0,0,0,'HT',$info_bits,0,$tmpmysoc);
|
||||
$result=calcul_price_total($qty,$pu,$remise_percent,$vatrate,0,0,0,'HT',$info_bits,0,$tmpmysoc);
|
||||
$total_ht = $result[0];
|
||||
$total_tva = $result[1];
|
||||
$total_ttc = $result[2];
|
||||
@ -1554,7 +1554,7 @@ function migrate_price_contrat($db,$langs,$conf)
|
||||
$contratligne->total_tva = $total_tva;
|
||||
$contratligne->total_ttc = $total_ttc;
|
||||
|
||||
dolibarr_install_syslog("upgrade2: Line $rowid: contratdetid=$obj->rowid pu=$pu qty=$qty tva_taux=$txtva remise_percent=$remise_percent -> $total_ht, $total_tva, $total_ttc");
|
||||
dolibarr_install_syslog("upgrade2: Line $rowid: contratdetid=$obj->rowid pu=$pu qty=$qty vatrate=$vatrate remise_percent=$remise_percent -> $total_ht, $total_tva, $total_ttc");
|
||||
print ". ";
|
||||
$contratligne->update_total();
|
||||
|
||||
@ -1600,7 +1600,7 @@ function migrate_price_commande($db,$langs,$conf)
|
||||
print '<b>'.$langs->trans('MigrationOrder')."</b><br>\n";
|
||||
|
||||
// Liste des lignes commande non a jour
|
||||
$sql = "SELECT cd.rowid, cd.qty, cd.subprice, cd.remise_percent, cd.tva_tx as tva_taux, cd.info_bits,";
|
||||
$sql = "SELECT cd.rowid, cd.qty, cd.subprice, cd.remise_percent, cd.tva_tx as vatrate, cd.info_bits,";
|
||||
$sql.= " c.rowid as commandeid, c.remise_percent as remise_percent_global";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."commandedet as cd, ".MAIN_DB_PREFIX."commande as c";
|
||||
$sql.= " WHERE cd.fk_commande = c.rowid";
|
||||
@ -1621,7 +1621,7 @@ function migrate_price_commande($db,$langs,$conf)
|
||||
$rowid = $obj->rowid;
|
||||
$qty = $obj->qty;
|
||||
$pu = $obj->subprice;
|
||||
$txtva = $obj->tva_taux;
|
||||
$vatrate = $obj->vatrate;
|
||||
$remise_percent = $obj->remise_percent;
|
||||
$remise_percent_global = $obj->remise_percent_global;
|
||||
$info_bits = $obj->info_bits;
|
||||
@ -1630,7 +1630,7 @@ function migrate_price_commande($db,$langs,$conf)
|
||||
$commandeligne= new OrderLine($db);
|
||||
$commandeligne->fetch($rowid);
|
||||
|
||||
$result=calcul_price_total($qty,$pu,$remise_percent,$txtva,0,0,$remise_percent_global,'HT',$info_bits,0);
|
||||
$result=calcul_price_total($qty,$pu,$remise_percent,$vatrate,0,0,$remise_percent_global,'HT',$info_bits,0);
|
||||
$total_ht = $result[0];
|
||||
$total_tva = $result[1];
|
||||
$total_ttc = $result[2];
|
||||
@ -1639,7 +1639,7 @@ function migrate_price_commande($db,$langs,$conf)
|
||||
$commandeligne->total_tva = $total_tva;
|
||||
$commandeligne->total_ttc = $total_ttc;
|
||||
|
||||
dolibarr_install_syslog("upgrade2: Line $rowid: commandeid=$obj->rowid pu=$pu qty=$qty tva_taux=$txtva remise_percent=$remise_percent remise_global=$remise_percent_global -> $total_ht, $total_tva, $total_ttc");
|
||||
dolibarr_install_syslog("upgrade2: Line $rowid: commandeid=$obj->rowid pu=$pu qty=$qty vatrate=$vatrate remise_percent=$remise_percent remise_global=$remise_percent_global -> $total_ht, $total_tva, $total_ttc");
|
||||
print ". ";
|
||||
$commandeligne->update_total();
|
||||
|
||||
@ -1714,7 +1714,7 @@ function migrate_price_commande_fournisseur($db,$langs,$conf)
|
||||
print '<b>'.$langs->trans('MigrationSupplierOrder')."</b><br>\n";
|
||||
|
||||
// Liste des lignes commande non a jour
|
||||
$sql = "SELECT cd.rowid, cd.qty, cd.subprice, cd.remise_percent, cd.tva_tx as tva_taux, cd.info_bits,";
|
||||
$sql = "SELECT cd.rowid, cd.qty, cd.subprice, cd.remise_percent, cd.tva_tx as vatrate, cd.info_bits,";
|
||||
$sql.= " c.rowid as commandeid, c.remise_percent as remise_percent_global";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as cd, ".MAIN_DB_PREFIX."commande_fournisseur as c";
|
||||
$sql.= " WHERE cd.fk_commande = c.rowid";
|
||||
@ -1735,7 +1735,7 @@ function migrate_price_commande_fournisseur($db,$langs,$conf)
|
||||
$rowid = $obj->rowid;
|
||||
$qty = $obj->qty;
|
||||
$pu = $obj->subprice;
|
||||
$txtva = $obj->tva_taux;
|
||||
$vatrate = $obj->vatrate;
|
||||
$remise_percent = $obj->remise_percent;
|
||||
$remise_percent_global = $obj->remise_percent_global;
|
||||
$info_bits = $obj->info_bits;
|
||||
@ -1744,7 +1744,7 @@ function migrate_price_commande_fournisseur($db,$langs,$conf)
|
||||
$commandeligne= new CommandeFournisseurLigne($db);
|
||||
$commandeligne->fetch($rowid);
|
||||
|
||||
$result=calcul_price_total($qty,$pu,$remise_percent,$txtva,0,0,$remise_percent_global,'HT',$info_bits,0);
|
||||
$result=calcul_price_total($qty,$pu,$remise_percent,$vatrate,0,0,$remise_percent_global,'HT',$info_bits,0);
|
||||
$total_ht = $result[0];
|
||||
$total_tva = $result[1];
|
||||
$total_ttc = $result[2];
|
||||
@ -1753,7 +1753,7 @@ function migrate_price_commande_fournisseur($db,$langs,$conf)
|
||||
$commandeligne->total_tva = $total_tva;
|
||||
$commandeligne->total_ttc = $total_ttc;
|
||||
|
||||
dolibarr_install_syslog("upgrade2: Line $rowid: commandeid=$obj->rowid pu=$pu qty=$qty tva_taux=$txtva remise_percent=$remise_percent remise_global=$remise_percent_global -> $total_ht, $total_tva, $total_ttc");
|
||||
dolibarr_install_syslog("upgrade2: Line $rowid: commandeid=$obj->rowid pu=$pu qty=$qty vatrate=$vatrate remise_percent=$remise_percent remise_global=$remise_percent_global -> $total_ht, $total_tva, $total_ttc");
|
||||
print ". ";
|
||||
$commandeligne->update_total();
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user