diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php
index 17bcd80757c..01581f7e626 100644
--- a/htdocs/compta/tva/card.php
+++ b/htdocs/compta/tva/card.php
@@ -27,6 +27,7 @@
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/vat.lib.php';
$langs->load("compta");
$langs->load("banks");
@@ -38,7 +39,7 @@ $refund=GETPOST("refund","int");
if (empty($refund)) $refund=0;
// Security check
-$socid = isset($_GET["socid"])?$_GET["socid"]:'';
+$socid = GETPOST('socid','int');
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'tax', '', '', 'charges');
@@ -179,8 +180,9 @@ if ($action == 'delete')
/*
* View
*/
-
-llxHeader();
+$title=$langs->trans("VAT") . " - " . $langs->trans("Card");
+$help_url='';
+llxHeader("",$title,$helpurl);
$form = new Form($db);
@@ -305,11 +307,7 @@ if ($action == 'create')
if ($id)
{
- $h = 0;
- $head[$h][0] = DOL_URL_ROOT.'/compta/tva/card.php?id='.$object->id;
- $head[$h][1] = $langs->trans('Card');
- $head[$h][2] = 'card';
- $h++;
+ $head=vat_prepare_head($object);
dol_fiche_head($head, 'card', $langs->trans("VATPayment"), 0, 'payment');
diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php
index eb4ee3a2408..3c45ec77a89 100644
--- a/htdocs/compta/tva/class/tva.class.php
+++ b/htdocs/compta/tva/class/tva.class.php
@@ -671,4 +671,52 @@ class Tva extends CommonObject
return $result;
}
+ /**
+ * Informations of vat payment object
+ *
+ * @param int $id Id of vat payment
+ * @return int <0 if KO, >0 if OK
+ */
+ function info($id)
+ {
+ $sql = "SELECT t.rowid, t.tms as datec, t.fk_user_creat";
+ $sql.= " FROM ".MAIN_DB_PREFIX."tva as t";
+ $sql.= " WHERE t.rowid = ".$id;
+
+ dol_syslog(get_class($this)."::info", LOG_DEBUG);
+ $result=$this->db->query($sql);
+ if ($result)
+ {
+ if ($this->db->num_rows($result))
+ {
+ $obj = $this->db->fetch_object($result);
+
+ $this->id = $obj->rowid;
+
+ if ($obj->fk_user_creat) {
+ $cuser = new User($this->db);
+ $cuser->fetch($obj->fk_user_creat);
+ $this->user_creation = $cuser;
+ }
+
+ if ($obj->fk_user_modif) {
+ $muser = new User($this->db);
+ $muser->fetch($obj->fk_user_modif);
+ $this->user_modification = $muser;
+ }
+
+ $this->date_creation = $this->db->jdate($obj->datec);
+ $this->date_modification = $this->db->jdate($obj->datec);
+ $this->import_key = $obj->import_key;
+ }
+
+ $this->db->free($result);
+
+ }
+ else
+ {
+ dol_print_error($this->db);
+ }
+ }
+
}
diff --git a/htdocs/compta/tva/info.php b/htdocs/compta/tva/info.php
new file mode 100644
index 00000000000..f85ab9fc2b0
--- /dev/null
+++ b/htdocs/compta/tva/info.php
@@ -0,0 +1,64 @@
+
+ *
+ * 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
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
| '; +dol_print_object_info($object); +print ' |