From 19265179caa24ce4ce647085fc0c9e9812de7852 Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Wed, 31 Mar 2021 10:11:51 +0200 Subject: [PATCH 1/3] FIX : last uniformizations --- htdocs/compta/tva/payments.php | 8 ++++++-- htdocs/salaries/payments.php | 34 ++++++++++++++++++++++++++++------ 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/htdocs/compta/tva/payments.php b/htdocs/compta/tva/payments.php index 3ebb9a335fc..134f840d196 100644 --- a/htdocs/compta/tva/payments.php +++ b/htdocs/compta/tva/payments.php @@ -121,6 +121,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) { print ''; print_liste_field_titre("RefPayment", $_SERVER["PHP_SELF"], "ptva.rowid", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("VATDeclaration", $_SERVER["PHP_SELF"], "tva.rowid", "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "tva.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("PeriodEndDate", $_SERVER["PHP_SELF"], "tva.datev", "", $param, 'width="140px"', $sortfield, $sortorder); print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "ptva.datep", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre("PaymentMode", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder); @@ -184,7 +185,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) { // Ref payment print ''.$payment_vat_static->getNomUrl(1)."\n"; - // Label + // VAT print ''; $tva->id = $obj->rowid; $tva->ref = $obj->rowid; @@ -192,6 +193,9 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) { print $tva->getNomUrl(1, '20'); print ''; + // Label + print ''.$obj->label.''; + // Date $date = $obj->datev; print ''.dol_print_date($date, 'day').''; @@ -243,7 +247,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) { } 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..a6442614d1b 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"; From 508dc337495dd807f19880ca675428948f28730f Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 31 Mar 2021 08:16:02 +0000 Subject: [PATCH 2/3] Fixing style errors. --- htdocs/salaries/payments.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/salaries/payments.php b/htdocs/salaries/payments.php index a6442614d1b..09c90854f22 100644 --- a/htdocs/salaries/payments.php +++ b/htdocs/salaries/payments.php @@ -144,7 +144,7 @@ if (empty($reshook)) { $search_date_start = ''; $search_date_end = ''; $search_dateep_start = ''; - $search_dateep_end = ''; + $search_dateep_end = ''; $search_amount = ""; $search_account = ''; $search_fk_bank = ''; @@ -456,7 +456,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { // Date end period print ''.dol_print_date($db->jdate($obj->dateep), 'day')."\n"; - if (!$i) $totalarray['nbfield']++; + if (!$i) $totalarray['nbfield']++; // Date payment print ''.dol_print_date($db->jdate($obj->datep), 'day')."\n"; From c27c52331ab74e678e371b1ae1ffaf86337ac5a8 Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Wed, 31 Mar 2021 10:34:21 +0200 Subject: [PATCH 3/3] FIX : default value --- htdocs/compta/tva/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 ''; print ''.$langs->trans("Comments").''; - print ''; + print ''; print ''; // Other attributes