diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php
index a5169675f69..bbf4bc9ac2b 100755
--- a/htdocs/compta/tva/card.php
+++ b/htdocs/compta/tva/card.php
@@ -136,7 +136,7 @@ if ($action == 'reopen' && $user->rights->tax->charges->creer) {
}
}
-if ($action == 'add' && $cancel) {
+if ($action == 'add' && !$cancel) {
$error = 0;
$object->fk_account = GETPOST("accountid", 'int');
@@ -454,7 +454,7 @@ if ($action == 'create') {
// Comments
print '
| '.$langs->trans("Total").' | ';
print ' | '; // A total here has no sense
- //print ' | ';
+ print ' | ';
print ' | ';
if (!empty($conf->banque->enabled)) {
print ' | ';
diff --git a/htdocs/salaries/payments.php b/htdocs/salaries/payments.php
index 0ec83a55595..09c90854f22 100644
--- a/htdocs/salaries/payments.php
+++ b/htdocs/salaries/payments.php
@@ -75,6 +75,8 @@ $search_user = GETPOST('search_user', 'alpha');
$search_label = GETPOST('search_label', 'alpha');
$search_date_start = dol_mktime(0, 0, 0, GETPOST('search_date_startmonth', 'int'), GETPOST('search_date_startday', 'int'), GETPOST('search_date_startyear', 'int'));
$search_date_end = dol_mktime(23, 59, 59, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int'));
+$search_dateep_start = dol_mktime(0, 0, 0, GETPOST('search_dateep_startmonth', 'int'), GETPOST('search_dateep_startday', 'int'), GETPOST('search_dateep_startyear', 'int'));
+$search_dateep_end = dol_mktime(23, 59, 59, GETPOST('search_dateep_endmonth', 'int'), GETPOST('search_dateep_endday', 'int'), GETPOST('search_dateep_endyear', 'int'));
$search_amount = GETPOST('search_amount', 'alpha');
$search_account = GETPOST('search_account', 'int');
$search_fk_bank = GETPOST('search_fk_bank', 'int');
@@ -141,6 +143,8 @@ if (empty($reshook)) {
$search_label = "";
$search_date_start = '';
$search_date_end = '';
+ $search_dateep_start = '';
+ $search_dateep_end = '';
$search_amount = "";
$search_account = '';
$search_fk_bank = '';
@@ -184,7 +188,7 @@ $help_url = '';
$title = $langs->trans('SalariesPayments');
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.email, u.admin, u.salary as current_salary, u.fk_soc as fk_soc, u.statut as status,";
-$sql .= " s.rowid, s.fk_user, s.amount, s.salary, sal.rowid as id_salary, sal.label, s.datep as datep, b.datev as datev, s.fk_typepayment as type, s.num_payment, s.fk_bank,";
+$sql .= " s.rowid, s.fk_user, s.amount, s.salary, sal.rowid as id_salary, sal.label, s.datep as datep, sal.dateep, b.datev as datev, s.fk_typepayment as type, s.num_payment, s.fk_bank,";
$sql .= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.fk_accountancy_journal, ba.label as blabel, ba.iban_prefix as iban, ba.bic, ba.currency_code, ba.clos,";
$sql .= " pst.code as payment_code";
$sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as s";
@@ -204,6 +208,8 @@ if ($search_user) $sql .= natural_search(array('u.login', 'u.lastname', 'u.fir
if ($search_label) $sql .= natural_search(array('sal.label'), $search_label);
if ($search_date_start) $sql .= " AND s.datep >= '".$db->idate($search_date_start)."'";
if ($search_date_end) $sql .= " AND s.datep <= '".$db->idate($search_date_end)."'";
+if ($search_dateep_start) $sql .= " AND sal.dateep >= '".$db->idate($search_dateep_start)."'";
+if ($search_dateep_end) $sql .= " AND sal.dateep <= '".$db->idate($search_dateep_end)."'";
if ($search_amount) $sql .= natural_search("s.amount", $search_amount, 1);
if ($search_account > 0) $sql .= " AND b.fk_account=".((int) $search_account);
if ($search_fk_bank) $sql .= " AND s.fk_bank=".((int) $search_fk_bank);
@@ -259,7 +265,9 @@ if ($search_fk_bank) $param .= '&search_fk_bank='.urlencode($search_fk_bank);
if ($search_chq_number) $param .= '&search_chq_number='.urlencode($search_chq_number);
if ($search_account) $param .= '&search_account='.urlencode($search_account);
if ($search_date_start) $param .= '&search_date_startday='.urlencode(GETPOST('search_date_startday', 'int')).'&search_date_startmonth='.urlencode(GETPOST('search_date_startmonth', 'int')).'&search_date_startyear='.urlencode(GETPOST('search_date_startyear', 'int'));
+if ($search_dateep_start) $param .= '&search_dateep_startday='.urlencode(GETPOST('search_dateep_startday', 'int')).'&search_dateep_startmonth='.urlencode(GETPOST('search_dateep_startmonth', 'int')).'&search_dateep_startyear='.urlencode(GETPOST('search_dateep_startyear', 'int'));
if ($search_date_end) $param .= '&search_date_endday='.urlencode(GETPOST('search_date_endday', 'int')).'&search_date_endmonth='.urlencode(GETPOST('search_date_endmonth', 'int')).'&search_date_endyear='.urlencode(GETPOST('search_date_endyear', 'int'));
+if ($search_dateep_end) $param .= '&search_dateep_endday='.urlencode(GETPOST('search_dateep_endday', 'int')).'&search_dateep_endmonth='.urlencode(GETPOST('search_dateep_endmonth', 'int')).'&search_dateep_endyear='.urlencode(GETPOST('search_dateep_endyear', 'int'));
// Add $param from extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
@@ -308,6 +316,15 @@ print '';
+// Date end period
+print '';
+print ' ';
+print $form->selectDate($search_dateep_start ? $search_dateep_start : -1, 'search_dateep_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
+print ' ';
+print '';
+print $form->selectDate($search_dateep_end ? $search_dateep_end : -1, 'search_dateep_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
+print ' ';
+print ' | ';
// Date payment
print '';
print ' ';
@@ -318,8 +335,8 @@ print $form->selectDate($search_date_end ? $search_date_end : -1, 'search_date_e
print ' ';
print ' | ';
// Date value
-print '';
-print ' | ';
+/*print '';
+print ' | ';*/
// Employee
print '';
print '';
@@ -366,8 +383,9 @@ print ' |
';
print_liste_field_titre("RefPayment", $_SERVER["PHP_SELF"], "s.rowid", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre("Salary", $_SERVER["PHP_SELF"], "sal.rowid", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "s.label", "", $param, 'class="left"', $sortfield, $sortorder);
+print_liste_field_titre("PeriodEndDate", $_SERVER["PHP_SELF"], "sal.dateep", "", $param, '', $sortfield, $sortorder, 'center ');
print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "s.datep,s.rowid", "", $param, '', $sortfield, $sortorder, 'center ');
-print_liste_field_titre("DateValue", $_SERVER["PHP_SELF"], "b.datev,s.rowid", "", $param, '', $sortfield, $sortorder, 'center ');
+//print_liste_field_titre("DateValue", $_SERVER["PHP_SELF"], "b.datev,s.rowid", "", $param, '', $sortfield, $sortorder, 'center ');
print_liste_field_titre("Employee", $_SERVER["PHP_SELF"], "u.rowid", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre("PaymentMode", $_SERVER["PHP_SELF"], "pst.code", "", $param, 'class="left"', $sortfield, $sortorder);
print_liste_field_titre("Numero", $_SERVER["PHP_SELF"], "s.num_payment", "", $param, '', $sortfield, $sortorder, '', 'ChequeOrTransferNumber');
@@ -436,13 +454,17 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
print "| ".dol_trunc($obj->label, 40)." | \n";
if (!$i) $totalarray['nbfield']++;
+ // Date end period
+ print ''.dol_print_date($db->jdate($obj->dateep), 'day')." | \n";
+ if (!$i) $totalarray['nbfield']++;
+
// Date payment
print ''.dol_print_date($db->jdate($obj->datep), 'day')." | \n";
if (!$i) $totalarray['nbfield']++;
// Date value
- print ''.dol_print_date($db->jdate($obj->datev), 'day')." | \n";
- if (!$i) $totalarray['nbfield']++;
+ /*print ''.dol_print_date($db->jdate($obj->datev), 'day')." | \n";
+ if (!$i) $totalarray['nbfield']++;*/
// Employee
print "".$userstatic->getNomUrl(1)." | \n";