Skip to content
Browse files

Merge branch 'develop' of git+ssh://git@github.com/Dolibarr/dolibarr.…

…git into develop
  • Loading branch information...
2 parents fb2cd3d + 646a0ea commit b2022b3b74c86fb4edb549ea50f221ce6628d762 Regis Houssin committed May 9, 2012
Showing with 17 additions and 22 deletions.
  1. +2 −3 htdocs/core/lib/functions.lib.php
  2. +2 −2 htdocs/fourn/commande/fiche.php
  3. +13 −17 htdocs/fourn/facture/fiche.php
View
5 htdocs/core/lib/functions.lib.php
@@ -2683,9 +2683,8 @@ function get_localtax($tva, $local, $societe_acheteuse="")
{
global $db, $conf, $mysoc;
- // TODO Can we uncomment this ?
- //if ($local == 1 && empty($conf->global->FACTURE_LOCAL_TAX1_OPTION)) return;
- //if ($local == 2 && empty($conf->global->FACTURE_LOCAL_TAX2_OPTION)) return;
+ if ($local == 1 && ! $mysoc->localtax1_assuj) return 0;
+ if ($local == 2 && ! $mysoc->localtax2_assuj) return 0;
$code_pays=$mysoc->pays_code;
View
4 htdocs/fourn/commande/fiche.php
@@ -198,8 +198,8 @@
$type = $productsupplier->type;
// Local Taxes
- $localtax1_tx= get_localtax($tva_tx, 1, $mysoc);
- $localtax2_tx= get_localtax($tva_tx, 2, $mysoc);
+ $localtax1_tx= get_localtax($tva_tx, 1, $object->thirdparty);
+ $localtax2_tx= get_localtax($tva_tx, 2, $object->thirdparty);
$result=$object->addline(
$desc,
View
30 htdocs/fourn/facture/fiche.php
@@ -2,9 +2,9 @@
/* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
- * Copyright (C) 2005 Marc Barilley <marc@ocebo.fr>
- * Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
- * Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
+ * Copyright (C) 2005 Marc Barilley <marc@ocebo.fr>
+ * Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
+ * Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -413,7 +413,7 @@
$pu=$_POST['puttc'];
$price_base_type='TTC';
}
-
+
if ($_POST['idprod'])
{
$prod = new Product($db);
@@ -422,21 +422,17 @@
if (trim($_POST['desc']) != trim($label)) $label=$_POST['desc'];
$type = $prod->type;
- $localtax1tx = $prod->localtax1_tx;
- $localtax2tx = $prod->localtax2_tx;
}
else
{
- if ($object->socid)
- {
- $societe=new Societe($db);
- $societe->fetch($object->socid);
- }
+
$label = $_POST['desc'];
$type = $_POST["type"]?$_POST["type"]:0;
- $localtax1tx= get_localtax($_POST['tauxtva'], 1, $mysoc);
- $localtax2tx= get_localtax($_POST['tauxtva'], 2, $mysoc);
+
}
+
+ $localtax1tx= get_localtax($_POST['tauxtva'], 1, $object->thirdparty);
+ $localtax2tx= get_localtax($_POST['tauxtva'], 2, $object->thirdparty);
$result=$object->updateline($_GET['lineid'], $label, $pu, $_POST['tauxtva'], $localtax1tx, $localtax2tx, $_POST['qty'], $_POST['idprod'], $price_base_type, 0, $type);
if ($result >= 0)
@@ -471,8 +467,8 @@
$tvatx=get_default_tva($object->thirdparty, $mysoc, $product->id, $_POST['idprodfournprice']);
- $localtax1tx= get_localtax($tvatx, 1, $mysoc);
- $localtax2tx= get_localtax($tvatx, 2, $mysoc);
+ $localtax1tx= get_localtax($tvatx, 1, $object->thirdparty);
+ $localtax2tx= get_localtax($tvatx, 2, $object->thirdparty);
$type = $product->type;
@@ -489,8 +485,8 @@
else
{
$tauxtva = price2num($_POST['tauxtva']);
- $localtax1tx= get_localtax($tauxtva, 1, $mysoc);
- $localtax2tx= get_localtax($tauxtva, 2, $mysoc);
+ $localtax1tx= get_localtax($tauxtva, 1, $object->thirdparty);
+ $localtax2tx= get_localtax($tauxtva, 2, $object->thirdparty);
if (! $_POST['dp_desc'])
{

0 comments on commit b2022b3

Please sign in to comment.
Something went wrong with that request. Please try again.