From 452733263d1dfeb34e124b7367885f512590a4e1 Mon Sep 17 00:00:00 2001
From: aspangaro <alexandre.spangaro@gmail.com>
Date: Thu, 25 Jun 2015 06:37:26 +0200
Subject: [PATCH] Move ACCOUNTING_VAT_ACCOUNT to ACCOUNTING_VAT_SOLD_ACCOUNT

---
 htdocs/accountancy/journal/purchasesjournal.php | 2 +-
 htdocs/accountancy/journal/sellsjournal.php     | 2 +-
 htdocs/admin/compta.php                         | 2 +-
 htdocs/compta/journal/sellsjournal.php          | 2 +-
 htdocs/install/mysql/migration/3.7.0-3.8.0.sql  | 2 +-
 htdocs/langs/en_US/compta.lang                  | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php
index 0a000e01833..862ff92eb4b 100644
--- a/htdocs/accountancy/journal/purchasesjournal.php
+++ b/htdocs/accountancy/journal/purchasesjournal.php
@@ -112,7 +112,7 @@ if ($result) {
 	$num = $db->num_rows($result);
 	// les variables
 	$cptfour = (! empty($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER)) ? $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER : $langs->trans("CodeNotDef");
-	$cpttva = (! empty($conf->global->ACCOUNTING_VAT_ACCOUNT)) ? $conf->global->ACCOUNTING_VAT_ACCOUNT : $langs->trans("CodeNotDef");
+	$cpttva = (! empty($conf->global->ACCOUNTING_VAT_SOLD_ACCOUNT)) ? $conf->global->ACCOUNTING_VAT_SOLD_ACCOUNT : $langs->trans("CodeNotDef");
 
 	$tabfac = array ();
 	$tabht = array ();
diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php
index db9af17388a..83191f88bf4 100644
--- a/htdocs/accountancy/journal/sellsjournal.php
+++ b/htdocs/accountancy/journal/sellsjournal.php
@@ -136,7 +136,7 @@ if ($result) {
 			else
 				$compta_prod = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT)) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef");
 		}
-		$cpttva = (! empty($conf->global->ACCOUNTING_VAT_ACCOUNT)) ? $conf->global->ACCOUNTING_VAT_ACCOUNT : $langs->trans("CodeNotDef");
+		$cpttva = (! empty($conf->global->ACCOUNTING_VAT_SOLD_ACCOUNT)) ? $conf->global->ACCOUNTING_VAT_SOLD_ACCOUNT : $langs->trans("CodeNotDef");
 		$compta_tva = (! empty($obj->account_tva) ? $obj->account_tva : $cpttva);
 
 		// Situation invoices handling
diff --git a/htdocs/admin/compta.php b/htdocs/admin/compta.php
index 48cad667a51..6020cb7947e 100644
--- a/htdocs/admin/compta.php
+++ b/htdocs/admin/compta.php
@@ -44,7 +44,7 @@ $list = array(
     'ACCOUNTING_PRODUCT_SOLD_ACCOUNT',
     'ACCOUNTING_SERVICE_BUY_ACCOUNT',
     'ACCOUNTING_SERVICE_SOLD_ACCOUNT',
-    'ACCOUNTING_VAT_ACCOUNT',
+    'ACCOUNTING_VAT_SOLD_ACCOUNT',
     'ACCOUNTING_VAT_BUY_ACCOUNT',
     'ACCOUNTING_ACCOUNT_CUSTOMER',
     'ACCOUNTING_ACCOUNT_SUPPLIER'
diff --git a/htdocs/compta/journal/sellsjournal.php b/htdocs/compta/journal/sellsjournal.php
index 9fd0d411d8e..e2842f6dd1e 100644
--- a/htdocs/compta/journal/sellsjournal.php
+++ b/htdocs/compta/journal/sellsjournal.php
@@ -151,7 +151,7 @@ if ($result)
 			if($obj->product_type == 0) $compta_prod = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT)?$conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT:$langs->trans("CodeNotDef"));
 			else $compta_prod = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT)?$conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT:$langs->trans("CodeNotDef"));
 		}
-		$cpttva = (! empty($conf->global->ACCOUNTING_VAT_ACCOUNT)?$conf->global->ACCOUNTING_VAT_ACCOUNT:$langs->trans("CodeNotDef"));
+		$cpttva = (! empty($conf->global->ACCOUNTING_VAT_SOLD_ACCOUNT)?$conf->global->ACCOUNTING_VAT_SOLD_ACCOUNT:$langs->trans("CodeNotDef"));
 		$compta_tva = (! empty($obj->account_tva)?$obj->account_tva:$cpttva);
 
 		$account_localtax1=getLocalTaxesFromRate($obj->tva_tx, 1, $obj->thirdparty, $mysoc);
diff --git a/htdocs/install/mysql/migration/3.7.0-3.8.0.sql b/htdocs/install/mysql/migration/3.7.0-3.8.0.sql
index aa43d763e84..f10fc56af45 100755
--- a/htdocs/install/mysql/migration/3.7.0-3.8.0.sql
+++ b/htdocs/install/mysql/migration/3.7.0-3.8.0.sql
@@ -703,4 +703,4 @@ ALTER TABLE llx_holiday_logs ADD COLUMN fk_type integer NOT NULL DEFAULT 1;
 UPDATE llx_holiday_users SET fk_type = 1 WHERE fk_type IS NULL;
 UPDATE llx_holiday_logs SET fk_type = 1 WHERE fk_type IS NULL;
 
-
+UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_VAT_SOLD_ACCOUNT')__ WHERE __DECRYPT('name')__ = 'ACCOUNTING_VAT_ACCOUNT';
diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang
index fc32492b120..09858bc092f 100644
--- a/htdocs/langs/en_US/compta.lang
+++ b/htdocs/langs/en_US/compta.lang
@@ -198,7 +198,7 @@ CalculationRuleDescSupplier=according to supplier, choose appropriate method to
 TurnoverPerProductInCommitmentAccountingNotRelevant=Turnover report per product, when using a <b>cash accountancy</b> mode is not relevant. This report is only available when using <b>engagement accountancy</b> mode (see setup of accountancy module).
 CalculationMode=Calculation mode
 AccountancyJournal=Accountancy code journal
-ACCOUNTING_VAT_ACCOUNT=Default accountancy code for collecting VAT
+ACCOUNTING_VAT_SOLD_ACCOUNT=Default accountancy code for collecting VAT
 ACCOUNTING_VAT_BUY_ACCOUNT=Default accountancy code for paying VAT
 ACCOUNTING_ACCOUNT_CUSTOMER=Accountancy code by default for customer thirdparties
 ACCOUNTING_ACCOUNT_SUPPLIER=Accountancy code by default for supplier thirdparties
-- 
GitLab