mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-06 17:13:03 +01:00
ability to define margin rate on quotes, orders, invoices
more to come : same on edit, user permissions
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2012-2013 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
*
|
||||
@@ -666,9 +666,16 @@ else if ($action == 'addline' && $user->rights->commande->creer)
|
||||
$price_base_type = $prod->price_base_type;
|
||||
}
|
||||
|
||||
// if price ht is forced (ie: calculated by margin rate and cost price)
|
||||
if (!empty($price_ht))
|
||||
{
|
||||
$pu_ht = price2num($price_ht, 'MU');
|
||||
$pu_ttc = price2num($pu_ht * (1 + ($tva_tx/100)), 'MU');
|
||||
}
|
||||
|
||||
// On reevalue prix selon taux tva car taux tva transaction peut etre different
|
||||
// de ceux du produit par defaut (par exemple si pays different entre vendeur et acheteur).
|
||||
if ($tva_tx != $prod->tva_tx)
|
||||
elseif ($tva_tx != $prod->tva_tx)
|
||||
{
|
||||
if ($price_base_type != 'HT')
|
||||
{
|
||||
@@ -806,6 +813,8 @@ else if ($action == 'addline' && $user->rights->commande->creer)
|
||||
unset($_POST['product_desc']);
|
||||
unset($_POST['fournprice']);
|
||||
unset($_POST['buying_price']);
|
||||
unset($_POST['np_marginRate']);
|
||||
unset($_POST['np_markRate']);
|
||||
|
||||
// old method
|
||||
unset($_POST['np_desc']);
|
||||
|
||||
Reference in New Issue
Block a user