Qual: Uniformisation du code. La fonction update_line pour les commandes et renommée updateline comme pour les entités cousines
This commit is contained in:
parent
f439283e15
commit
016b830240
@ -1566,7 +1566,7 @@ class Commande extends CommonObject
|
|||||||
* \param tva_tx Taux TVA
|
* \param tva_tx Taux TVA
|
||||||
* \return int < 0 si erreur, > 0 si ok
|
* \return int < 0 si erreur, > 0 si ok
|
||||||
*/
|
*/
|
||||||
function update_line($rowid, $desc, $pu, $qty, $remise_percent=0, $txtva)
|
function updateline($rowid, $desc, $pu, $qty, $remise_percent=0, $txtva)
|
||||||
{
|
{
|
||||||
dolibarr_syslog("Commande::UpdateLine $rowid, $desc, $pu, $qty, $remise_percent, $txtva");
|
dolibarr_syslog("Commande::UpdateLine $rowid, $desc, $pu, $qty, $remise_percent, $txtva");
|
||||||
include_once(DOL_DOCUMENT_ROOT.'/lib/price.lib.php');
|
include_once(DOL_DOCUMENT_ROOT.'/lib/price.lib.php');
|
||||||
|
|||||||
@ -313,7 +313,7 @@ if ($_POST['action'] == 'updateligne' && $user->rights->commande->creer && $_POS
|
|||||||
$commande = new Commande($db,'',$_POST['id']);
|
$commande = new Commande($db,'',$_POST['id']);
|
||||||
if (! $commande->fetch($_POST['id']) > 0) dolibarr_print_error($db);
|
if (! $commande->fetch($_POST['id']) > 0) dolibarr_print_error($db);
|
||||||
|
|
||||||
$result = $commande->update_line($_POST['elrowid'],
|
$result = $commande->updateline($_POST['elrowid'],
|
||||||
$_POST['eldesc'],
|
$_POST['eldesc'],
|
||||||
$_POST['pu'],
|
$_POST['pu'],
|
||||||
$_POST['qty'],
|
$_POST['qty'],
|
||||||
|
|||||||
@ -108,7 +108,7 @@ if ($_POST["action"] == 'updateligne' && $user->rights->commande->creer)
|
|||||||
$commande = new CommandeFournisseur($db,"",$_GET["id"]);
|
$commande = new CommandeFournisseur($db,"",$_GET["id"]);
|
||||||
if ($commande->fetch($_GET["id"]) )
|
if ($commande->fetch($_GET["id"]) )
|
||||||
{
|
{
|
||||||
$result = $commande->update_line($_POST["elrowid"],
|
$result = $commande->updateline($_POST["elrowid"],
|
||||||
$_POST["eldesc"],
|
$_POST["eldesc"],
|
||||||
$_POST["elprice"],
|
$_POST["elprice"],
|
||||||
$_POST["elqty"],
|
$_POST["elqty"],
|
||||||
|
|||||||
@ -322,7 +322,7 @@ class Propal extends CommonObject
|
|||||||
*/
|
*/
|
||||||
function updateline($rowid, $pu, $qty, $remise_percent=0, $txtva, $desc='')
|
function updateline($rowid, $pu, $qty, $remise_percent=0, $txtva, $desc='')
|
||||||
{
|
{
|
||||||
dolibarr_syslog("propal.class.php::updateligne $rowid, $pu, $qty, $remise_percent, $txtva, $desc");
|
dolibarr_syslog("propal.class.php::UpdateLine $rowid, $pu, $qty, $remise_percent, $txtva, $desc");
|
||||||
include_once(DOL_DOCUMENT_ROOT.'/lib/price.lib.php');
|
include_once(DOL_DOCUMENT_ROOT.'/lib/price.lib.php');
|
||||||
|
|
||||||
if ($this->statut == 0)
|
if ($this->statut == 0)
|
||||||
@ -377,7 +377,7 @@ class Propal extends CommonObject
|
|||||||
{
|
{
|
||||||
$this->error=$this->db->error();
|
$this->error=$this->db->error();
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
dolibarr_syslog("Propal::UpdateLigne Erreur sql=$sql, error=".$this->error);
|
dolibarr_syslog("Propal::UpdateLine Erreur sql=$sql, error=".$this->error);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user