From dbb5d3d386a6a351678afe25da02ca282cfedc61 Mon Sep 17 00:00:00 2001
From: aspangaro <alexandre.spangaro@gmail.com>
Date: Wed, 8 Jul 2015 21:47:45 +0200
Subject: [PATCH] Fix #3166 : An accounting account can be alphanumeric (Need
 for EBP)

---
 htdocs/accountancy/admin/card.php | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php
index 8840df9c432..092122a653d 100644
--- a/htdocs/accountancy/admin/card.php
+++ b/htdocs/accountancy/admin/card.php
@@ -39,6 +39,7 @@ $mesg = '';
 $action = GETPOST('action');
 $id = GETPOST('id', 'int');
 $rowid = GETPOST('rowid', 'int');
+$cancel = GETPOST('cancel');
 
 // Security check
 if (!$user->admin)
@@ -49,7 +50,7 @@ $accounting = new AccountingAccount($db);
 // Action
 if ($action == 'add')
 {
-	if (! GETPOST('cancel', 'alpha')) {
+	if (! $cancel) {
 		$sql = 'SELECT pcg_version FROM ' . MAIN_DB_PREFIX . 'accounting_system WHERE rowid=' . $conf->global->CHARTOFACCOUNTS;
 
 		dol_syslog('accountancy/admin/card.php:: $sql=' . $sql);
@@ -59,7 +60,7 @@ if ($action == 'add')
 		$accounting->fk_pcg_version = $obj->pcg_version;
 		$accounting->pcg_type = GETPOST('pcg_type');
 		$accounting->pcg_subtype = GETPOST('pcg_subtype');
-		$accounting->account_number = GETPOST('account_number', 'int');
+		$accounting->account_number = GETPOST('account_number');
 		$accounting->account_parent = GETPOST('account_parent', 'int');
 		$accounting->label = GETPOST('label', 'alpha');
 		$accounting->active = 1;
@@ -94,7 +95,7 @@ else if ($action == 'edit')
 		$accounting->fk_pcg_version = $obj->pcg_version;
 		$accounting->pcg_type = GETPOST('pcg_type');
 		$accounting->pcg_subtype = GETPOST('pcg_subtype');
-		$accounting->account_number = GETPOST('account_number', 'int');
+		$accounting->account_number = GETPOST('account_number');
 		$accounting->account_parent = GETPOST('account_parent', 'int');
 		$accounting->label = GETPOST('label', 'alpha');
 
-- 
GitLab