Fix: POS use HT even when multiprice enabled.
This commit is contained in:
parent
96ddd99664
commit
e8e91e4823
@ -144,15 +144,14 @@ class Facturation {
|
||||
$newcartarray[$i]['price']=$product->price;
|
||||
$newcartarray[$i]['price_ttc']=$product->price_ttc;
|
||||
|
||||
/** add Ditto for MultiPrix*/
|
||||
if ($conf->global->PRODUIT_MULTIPRICES)
|
||||
{
|
||||
if(isset($product->multiprices[$societe->price_level]))
|
||||
if (isset($product->multiprices[$societe->price_level]))
|
||||
{
|
||||
$newcartarray[$i]['price'] = $product->multiprices_ttc[$societe->price_level];
|
||||
$newcartarray[$i]['price'] = $product->multiprices[$societe->price_level];
|
||||
$newcartarray[$i]['price_ttc'] = $product->multiprices_ttc[$societe->price_level];
|
||||
}
|
||||
}
|
||||
/** end add Ditto */
|
||||
|
||||
$newcartarray[$i]['fk_article']=$this->id;
|
||||
$newcartarray[$i]['qte']=$this->qte();
|
||||
|
||||
@ -77,7 +77,8 @@ switch ( $_GET['action'] )
|
||||
|
||||
if(isset($product->multiprices[$societe->price_level]))
|
||||
{
|
||||
$ret['price'] = $product->multiprices_ttc[$societe->price_level];
|
||||
$ret['price'] = $product->multiprices[$societe->price_level];
|
||||
$ret['price_ttc'] = $product->multiprices_ttc[$societe->price_level];
|
||||
// $product->multiprices_min[$societe->price_level];
|
||||
// $product->multiprices_min_ttc[$societe->price_level];
|
||||
// $product->multiprices_base_type[$societe->price_level];
|
||||
|
||||
@ -142,6 +142,10 @@ switch ($action)
|
||||
$user->fetch($_SESSION['uid']);
|
||||
$user->getrights();
|
||||
|
||||
$thirdpartyid = $_SESSION['CASHDESK_ID_THIRDPARTY'];
|
||||
$societe = new Societe($db);
|
||||
$societe->fetch($thirdpartyid);
|
||||
|
||||
$invoice=new Facture($db);
|
||||
|
||||
// Get content of cart
|
||||
@ -152,13 +156,17 @@ switch ($action)
|
||||
for ($i=0;$i < $tab_liste_size;$i++)
|
||||
{
|
||||
// Recuperation de l'article
|
||||
$res = $db->query('SELECT label, tva_tx, price FROM '.MAIN_DB_PREFIX.'product WHERE rowid = '.$tab_liste[$i]['fk_article']);
|
||||
$ret=array();
|
||||
$tab = $db->fetch_array($res);
|
||||
foreach ( $tab as $cle => $valeur )
|
||||
{
|
||||
$ret[$cle] = $valeur;
|
||||
}
|
||||
$product = new Product($db);
|
||||
$product->fetch($tab_liste[$i]['fk_article']);
|
||||
$ret=array('label'=>$product->label,'tva_tx'=>$product->tva_tx,'price'=>$product->price);
|
||||
|
||||
if ($conf->global->PRODUIT_MULTIPRICES)
|
||||
{
|
||||
if (isset($product->multiprices[$societe->price_level]))
|
||||
{
|
||||
$ret['price'] = $product->multiprices[$societe->price_level];
|
||||
}
|
||||
}
|
||||
$tab_article = $ret;
|
||||
|
||||
$res = $db->query('SELECT taux FROM '.MAIN_DB_PREFIX.'c_tva WHERE rowid = '.$tab_liste[$i]['fk_tva']);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user