Local Taxes: Works in Invoices.

Contracts: Patch to invoicing with the new invoices changes.
Trad: Orders: Tab Compta.
This commit is contained in:
Juanjo Menent
2010-06-21 16:49:41 +00:00
parent 8c06f2aa15
commit ca124a1476
8 changed files with 129 additions and 28 deletions

View File

@@ -2487,14 +2487,16 @@ function price2num($amount,$rounding='',$alreadysqlnb=0)
function get_localtax($tva, $local, $societe_acheteuse="")
{
global $db, $conf, $mysoc;
$code_pays=$mysoc->pays_code;
if (is_object($societe_acheteuse))
{
if ($code_pays!=$societe_acheteuse->pays_code) return 0;
if ($local==1 && !$societe_acheteuse->localtax1_assuj) return 0;
elseif ($local==2 && !$societe_acheteuse->localtax2_assuj) return 0;
}
$code_pays=$mysoc->pays_code;
// Search local taxes
$sql = "SELECT t.localtax1, t.localtax2";
$sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p";