diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index abd7baa12f9..240a4624d44 100644 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -59,10 +59,18 @@ if ($_POST["cancel"] == $langs->trans("Cancel") && ! $id) exit; } +if ($action == 'setlib' && $user->rights->tax->charges->creer) +{ + $object->fetch($id); + $result = $object->setValueFrom('label', GETPOST('lib','alpha'), '', '', 'text', '', $user, 'TAX_MODIFY'); + if ($result < 0) + setEventMessages($object->error, $object->errors, 'errors'); +} + if ($action == 'setdatev' && $user->rights->tax->charges->creer) { $object->fetch($id); - $object->datev=dol_mktime(12,0,0,$_POST['datevmonth'],$_POST['datevday'],$_POST['datevyear']); + $object->datev=dol_mktime(12,0,0,GETPOST('datevmonth','int'),GETPOST('datevday','int'),GETPOST('datevyear','int')); $result=$object->update($user); if ($result < 0) dol_print_error($db,$object->error); @@ -309,6 +317,13 @@ if ($id) dol_fiche_head($head, 'card', $langs->trans("VATPayment"), -1, 'payment'); + $morehtmlref='
| '.$langs->trans("Label").' | '.$object->label.' | ||
| '.$langs->trans("Label").' | '.$object->label.' | ||
| '.$langs->trans("DatePayment").' | '; + print ' | '.$langs->trans("DatePayment").' | '; print dol_print_date($object->datep,'day'); print ' |
| '; print $form->editfieldkey($form->textwithpicto($langs->trans("PeriodEndDate"), $langs->trans("LastDayTaxIsRelatedTo")), 'datev', $object->datev, $object, $user->rights->tax->charges->creer, 'day'); print ' | ';
diff --git a/htdocs/compta/tva/document.php b/htdocs/compta/tva/document.php
index 9ffc2202b8a..04d65dfadf5 100644
--- a/htdocs/compta/tva/document.php
+++ b/htdocs/compta/tva/document.php
@@ -84,7 +84,7 @@ include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php';
if ($action == 'setlib' && $user->rights->tax->charges->creer)
{
$object->fetch($id);
- $result = $object->setValueFrom('libelle', GETPOST('lib'), '', '', 'text', '', $user, 'TAX_MODIFY');
+ $result = $object->setValueFrom('label', GETPOST('lib','alpha'), '', '', 'text', '', $user, 'TAX_MODIFY');
if ($result < 0)
setEventMessages($object->error, $object->errors, 'errors');
}
@@ -111,23 +111,8 @@ if ($object->id)
$morehtmlref=' ';
// Label of social contribution
- $morehtmlref.=$form->editfieldkey("Label", 'lib', $object->lib, $object, $user->rights->tax->charges->creer, 'string', '', 0, 1);
- $morehtmlref.=$form->editfieldval("Label", 'lib', $object->lib, $object, $user->rights->tax->charges->creer, 'string', '', null, null, '', 1);
- // Project
- if (! empty($conf->projet->enabled))
- {
- $langs->load("projects");
- $morehtmlref.=' ';
$linkback = '' . $langs->trans("BackToList") . '';
diff --git a/htdocs/compta/tva/info.php b/htdocs/compta/tva/info.php
index 6a3955403e7..24208aedf2a 100644
--- a/htdocs/compta/tva/info.php
+++ b/htdocs/compta/tva/info.php
@@ -37,10 +37,27 @@ $socid = GETPOST('socid','int');
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'tax', '', '', 'charges');
+$object = new Tva($db);
+
+
+
+/*
+ * Actions
+ */
+
+if ($action == 'setlib' && $user->rights->tax->charges->creer)
+{
+ $object->fetch($id);
+ $result = $object->setValueFrom('label', GETPOST('lib','alpha'), '', '', 'text', '', $user, 'TAX_MODIFY');
+ if ($result < 0)
+ setEventMessages($object->error, $object->errors, 'errors');
+}
+
/*
* View
*/
+
$title=$langs->trans("VAT") . " - " . $langs->trans("Info");
$help_url='';
llxHeader("",$title,$helpurl);
@@ -53,6 +70,12 @@ $head = vat_prepare_head($object);
dol_fiche_head($head, 'info', $langs->trans("VATPayment"), -1, 'payment');
+$morehtmlref=''.$langs->trans('Project') . ' : '; - if (! empty($object->fk_project)) { - $proj = new Project($db); - $proj->fetch($object->fk_project); - $morehtmlref.=''; - $morehtmlref.=$proj->ref; - $morehtmlref.=''; - } else { - $morehtmlref.=''; - } - } + $morehtmlref.=$form->editfieldkey("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', 0, 1); + $morehtmlref.=$form->editfieldval("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', null, null, '', 1); $morehtmlref.=' ';
+// Label of social contribution
+$morehtmlref.=$form->editfieldkey("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', 0, 1);
+$morehtmlref.=$form->editfieldval("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', null, null, '', 1);
+$morehtmlref.=' ';
+
$linkback = ''.$langs->trans("BackToList").'';
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', '');
|