diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php b/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php index 7844bea0896..640fa657ffe 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php @@ -3,8 +3,8 @@ * Copyright (C) 2005 Laurent Destailleur * Copyright (C) 2013 Olivier Geffroy * Copyright (C) 2013 Florian Henry - * Copyright (C) 2013-2018 Alexandre Spangaro - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2013-2019 Alexandre Spangaro + * Copyright (C) 2018 Frédéric France * * 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 @@ -30,6 +30,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php'; require_once DOL_DOCUMENT_ROOT . '/accountancy/class/lettering.class.php'; +require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php'; require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; @@ -53,26 +54,31 @@ $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; if ($sortorder == "") - $sortorder = "DESC"; + $sortorder = "ASC"; if ($sortfield == "") $sortfield = "bk.doc_date"; -$search_year = GETPOST("search_year", 'int'); -$search_doc_type = GETPOST("search_doc_type", 'alpha'); +/* +$search_date_start = dol_mktime(0, 0, 0, GETPOST('date_startmonth', 'int'), GETPOST('date_startday', 'int'), GETPOST('date_startyear', 'int')); +$search_date_end = dol_mktime(0, 0, 0, GETPOST('date_endmonth', 'int'), GETPOST('date_endday', 'int'), GETPOST('date_endyear', 'int')); +//$search_doc_type = GETPOST("search_doc_type", 'alpha'); $search_doc_ref = GETPOST("search_doc_ref", 'alpha'); +*/ $lettering = GETPOST('lettering', 'alpha'); if (! empty($lettering)) { $action = $lettering; } -// Did we click on purge search criteria ? -// All tests are required to be compatible with all browsers -if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { - $search_year = ''; - $search_doc_type = ''; +/* +if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers +{ + $search_date_start = ''; + $search_date_end = ''; + //$search_doc_type = ''; $search_doc_ref = ''; } +*/ // Security check $socid = GETPOST("socid", 'int'); @@ -102,6 +108,7 @@ if ($action == 'lettering') { } } +/* if ($action == 'autolettrage') { $result = $lettering->letteringThirdparty($socid); @@ -111,9 +118,9 @@ if ($action == 'autolettrage') { $error++; } } +*/ - - /* +/* * View */ @@ -136,19 +143,17 @@ dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'n dol_fiche_end(); -print '
'; - $sql = "SELECT bk.rowid, bk.doc_date, bk.doc_type, bk.doc_ref, "; $sql .= " bk.subledger_account, bk.numero_compte , bk.label_compte, bk.debit, "; $sql .= " bk.credit, bk.montant , bk.sens , bk.code_journal , bk.piece_num, bk.lettering_code "; $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as bk"; $sql .= " WHERE (bk.subledger_account = '" . $object->code_compta . "' AND bk.numero_compte = '" . $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER . "' )"; -if (dol_strlen($search_year)) { - $date_start = dol_mktime(0, 0, 0, 1, 1, $search_year); - $date_end = dol_mktime(23, 59, 59, 12, 31, $search_year); - $sql .= " AND ( bk.doc_date BETWEEN '" . $db->idate($date_start) . "' AND '" . $db->idate($date_end) . "' )"; +/* +if (dol_strlen($search_date_start) || dol_strlen($search_date_end)) { + $sql .= " AND ( bk.doc_date BETWEEN '" . $db->idate($search_date_start) . "' AND '" . $db->idate($search_date_end) . "' )"; } +*/ $sql.= ' AND bk.entity IN ('.getEntity('accountingbookkeeping').')'; $sql .= $db->order($sortfield, $sortorder); @@ -190,83 +195,110 @@ if ($resql) { print '
'; print ''; - print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_companies', 0, '', '', $limit); + $letteringbutton = ''; + //$letteringbutton = '' . $langs->trans("Lettering") . ''; + + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_companies', 0, $letteringbutton, '', $limit); print ""; + + /* + print ''; + //print ''; + + // Date + print ''; + + // Piece + print ''; + + print ''; + print ''; + print ''; + */ + print ''; - print_liste_field_titre("Doctype", $_SERVER["PHP_SELF"], "bk.doc_type", "", $param, "", $sortfield, $sortorder); - print_liste_field_titre("Docdate", $_SERVER["PHP_SELF"], "bk.doc_date", "", $param, "", $sortfield, $sortorder); - print_liste_field_titre("Docref", $_SERVER["PHP_SELF"], "bk.doc_ref", "", $param, "", $sortfield, $sortorder); + //print_liste_field_titre("Doctype", $_SERVER["PHP_SELF"], "bk.doc_type", "", $param, "", $sortfield, $sortorder); + print_liste_field_titre("Docdate", $_SERVER["PHP_SELF"], "bk.doc_date", "", $param, "", $sortfield, $sortorder, 'center '); + print_liste_field_titre("Piece", $_SERVER["PHP_SELF"], "bk.doc_ref", "", $param, "", $sortfield, $sortorder); print_liste_field_titre("LabelAccount", $_SERVER["PHP_SELF"], "bk.label_compte", "", $param, "", $sortfield, $sortorder); print_liste_field_titre("Debit", $_SERVER["PHP_SELF"], "bk.debit", "", $param, "", $sortfield, $sortorder); print_liste_field_titre("Credit", $_SERVER["PHP_SELF"], "bk.credit", "", $param, "", $sortfield, $sortorder); print_liste_field_titre("Balancing", $_SERVER["PHP_SELF"], "", "", $param, "", $sortfield, $sortorder); - print_liste_field_titre("Codejournal", $_SERVER["PHP_SELF"], "bk.code_journal", "", $param, "", $sortfield, $sortorder); - print_liste_field_titre("LetteringCode", $_SERVER["PHP_SELF"], "bk.lettering_code", "", $param, "", $sortfield, $sortorder); + print_liste_field_titre("Codejournal", $_SERVER["PHP_SELF"], "bk.code_journal", "", $param, "", $sortfield, $sortorder, 'center '); + print_liste_field_titre("LetteringCode", $_SERVER["PHP_SELF"], "bk.lettering_code", "", $param, "", $sortfield, $sortorder, 'center '); + print_liste_field_titre("", "","",'','',"",$sortfield,$sortorder,'maxwidthsearch center '); print "\n"; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - $solde = 0; $tmp = ''; - while ( $obj = $db->fetch_object($resql) ) { + + while ( $obj = $db->fetch_object($resql) ) { if ($tmp != $obj->lettering_code || empty($tmp)) $tmp = $obj->lettering_code; /*if ($tmp != $obj->lettering_code || empty($obj->lettering_code))*/ $solde += ($obj->credit - $obj->debit); print ''; - if (empty($obj->lettering_code)) { - print '' . "\n"; - } else { - print '' . "\n"; - } - - print ''; + //print '' . "\n"; + print ''; print ''; print ''; print ''; print ''; print ''; - print ''; - if (empty($obj->lettering_code)) { - print ''; - } else - print ''; + // Journal + $accountingjournal = new AccountingJournal($db); + $result = $accountingjournal->fetch('',$obj->code_journal); + $journaltoshow = (($result > 0)?$accountingjournal->getNomUrl(0,0,0,'',0) : $obj->code_journal); + print ''; + + if (empty($obj->lettering_code)) { + print ''; + print '' . "\n"; + } else { + print ''; + print ''; + } print "\n"; } print ''; - print '' . "\n"; + print '' . "\n"; print ''; print ''; - print ''; + print ''; print "\n"; print ''; - print '' . "\n"; + print '' . "\n"; print ''; print ''; - print ''; + print ''; print "\n"; print "
'; + print '
'; + print $langs->trans('From') . ' '; + print $form->selectDate($search_date_start, 'date_creation_start', 0, 0, 1); + print '
'; + print '
'; + print $langs->trans('to') . ' '; + print $form->selectDate($search_date_end, 'date_creation_end', 0, 0, 1); + print '
'; + print '
 '; + $searchpicto = $form->showFilterButtons(); + print $searchpicto; + print '
 '; - $searchpicto = $form->showFilterButtons(); - print $searchpicto; - print '
'; - print img_edit(); - print ' ' . $obj->doc_type . '' . $obj->doc_type . '' . dol_print_date($db->jdate($obj->doc_date), 'day') . '' . $obj->doc_type . '' . dol_print_date($db->jdate($obj->doc_date), 'day') . '' . $obj->doc_ref . '' . $obj->label_compte . '' . price($obj->debit) . '' . price($obj->credit) . '' . price(round($solde, 2)) . '' . $obj->code_journal . '' . $obj->lettering_code . '' . $journaltoshow . ''; + print img_edit(); + print '' . $obj->lettering_code . '
'.$langs->trans("Total").':'.$langs->trans("Total").':' . price($debit) . '' . price($credit) . '
'.$langs->trans("Balancing").':'.$langs->trans("Balancing").': ' . price($credit - $debit) . '
"; - print ''; - //print '' . $langs->trans('AccountancyAutoLettering') . ''; + print '
'."\n"; + print $letteringbutton; + print '
'; + print "
"; $db->free($resql); } else { diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php b/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php index 9b8d7b684e5..e73e27efaeb 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php @@ -3,8 +3,8 @@ * Copyright (C) 2005 Laurent Destailleur * Copyright (C) 2013 Olivier Geffroy * Copyright (C) 2013 Florian Henry - * Copyright (C) 2013-2018 Alexandre Spangaro - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2013-2019 Alexandre Spangaro + * Copyright (C) 2018 Frédéric France * * 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 @@ -30,6 +30,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php'; require_once DOL_DOCUMENT_ROOT . '/accountancy/class/lettering.class.php'; +require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php'; require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; @@ -53,27 +54,31 @@ $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; if ($sortorder == "") - $sortorder = "DESC"; + $sortorder = "ASC"; if ($sortfield == "") $sortfield = "bk.doc_date"; -$search_year = GETPOST("search_year", 'int'); -$search_doc_type = GETPOST("search_doc_type", 'alpha'); -$search_doc_ref = GETPOST("search_doc_ref", 'alpha'); +/* +$search_date_start = dol_mktime(0, 0, 0, GETPOST('date_startmonth', 'int'), GETPOST('date_startday', 'int'), GETPOST('date_startyear', 'int')); +$search_date_end = dol_mktime(0, 0, 0, GETPOST('date_endmonth', 'int'), GETPOST('date_endday', 'int'), GETPOST('date_endyear', 'int')); +//$search_doc_type = GETPOST("search_doc_type",'alpha'); +$search_doc_ref = GETPOST("search_doc_ref",'alpha'); +*/ $lettering = GETPOST('lettering', 'alpha'); if (!empty($lettering)) { $action=$lettering; } -// Did we click on purge search criteria ? -// All tests are required to be compatible with all browsers -if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) +/* +if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers { - $search_year=''; - $search_doc_type=''; + $search_date_start = ''; + $search_date_end = ''; + //$search_doc_type=''; $search_doc_ref=''; } +*/ // Security check @@ -103,6 +108,7 @@ if ($action == 'lettering') { } } +/* if ($action == 'autolettrage') { $result = $lettering->letteringThirdparty($socid); @@ -112,7 +118,7 @@ if ($action == 'autolettrage') { $error++; } } - +*/ /* * View @@ -142,10 +148,8 @@ $sql .= " bk.subledger_account, bk.numero_compte , bk.label_compte, bk.debit, "; $sql .= " bk.credit, bk.montant , bk.sens , bk.code_journal , bk.piece_num, bk.lettering_code "; $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as bk"; $sql .= " WHERE (bk.subledger_account = '" . $object->code_compta_fournisseur . "' AND bk.numero_compte = '" . $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER . "' )"; -if (dol_strlen($search_year)) { - $date_start = dol_mktime(0, 0, 0, 1, 1, $search_year); - $date_end = dol_mktime(23, 59, 59, 12, 31, $search_year); - $sql .= " AND ( bk.doc_date BETWEEN '".$db->idate($date_start)."' AND '".$db->idate($date_end)."' )"; +if (dol_strlen($search_date_start) || dol_strlen($search_date_end)) { + $sql .= " AND (bk.doc_date BETWEEN '".$db->idate($search_date_start)."' AND '".$db->idate($search_date_end)."' )"; } $sql.= ' AND bk.entity IN ('.getEntity('accountingbookkeeping').')'; $sql.= $db->order($sortfield, $sortorder); @@ -190,32 +194,52 @@ if ($resql) { print '
'; print ''; - print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_companies', 0, '', '', $limit); + $letteringbutton = ''; + + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_companies', 0, $letteringbutton, '', $limit); print ""; + + /* + print ''; + //print ''; + + // Date + print ''; + + // Piece + print ''; + + print ''; + print ''; + print ''; + */ + print ''; - print_liste_field_titre("Doctype", $_SERVER["PHP_SELF"], "bk.doc_type", "", $param, "", $sortfield, $sortorder); - print_liste_field_titre("Docdate", $_SERVER["PHP_SELF"], "bk.doc_date", "", $param, "", $sortfield, $sortorder); - print_liste_field_titre("Docref", $_SERVER["PHP_SELF"], "bk.doc_ref", "", $param, "", $sortfield, $sortorder); + //print_liste_field_titre("Doctype", $_SERVER["PHP_SELF"], "bk.doc_type", "", $param, "", $sortfield, $sortorder); + print_liste_field_titre("Docdate", $_SERVER["PHP_SELF"], "bk.doc_date", "", $param, "", $sortfield, $sortorder, 'center '); + print_liste_field_titre("Piece", $_SERVER["PHP_SELF"], "bk.doc_ref", "", $param, "", $sortfield, $sortorder); print_liste_field_titre("LabelAccount", $_SERVER["PHP_SELF"], "bk.label_compte", "", $param, "", $sortfield, $sortorder); print_liste_field_titre("Debit", $_SERVER["PHP_SELF"], "bk.debit", "", $param, "", $sortfield, $sortorder); print_liste_field_titre("Credit", $_SERVER["PHP_SELF"], "bk.credit", "", $param, "", $sortfield, $sortorder); print_liste_field_titre("Balancing", $_SERVER["PHP_SELF"], "", "", $param, "", $sortfield, $sortorder); - print_liste_field_titre("Codejournal", $_SERVER["PHP_SELF"], "bk.code_journal", "", $param, "", $sortfield, $sortorder); - print_liste_field_titre("LetteringCode", $_SERVER["PHP_SELF"], "bk.lettering_code", "", $param, "", $sortfield, $sortorder); + print_liste_field_titre("Codejournal", $_SERVER["PHP_SELF"], "bk.code_journal", "", $param, "", $sortfield, $sortorder, 'center '); + print_liste_field_titre("LetteringCode", $_SERVER["PHP_SELF"], "bk.lettering_code", "", $param, "", $sortfield, $sortorder, 'center '); + print_liste_field_titre("", "","",'','',"",$sortfield,$sortorder,'maxwidthsearch center '); print "\n"; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - $solde = 0; $tmp = ''; while ($obj = $db->fetch_object($resql)) { @@ -225,48 +249,53 @@ if ($resql) { print ''; - if (empty($obj->lettering_code)) { - print '' . "\n"; - } else { - print '' . "\n"; - } - - print ''; + //print '' . "\n"; + print ''; print ''; print ''; print ''; print ''; print ''; - print ''; + + // Journal + $accountingjournal = new AccountingJournal($db); + $result = $accountingjournal->fetch('',$obj->code_journal); + $journaltoshow = (($result > 0)?$accountingjournal->getNomUrl(0,0,0,'',0) : $obj->code_journal); + print ''; if (empty($obj->lettering_code)) { print ''; - } else - print ''; + print '' . "\n"; + } else { + print ''; + print ''; + } print "\n"; } print ''; - print '' . "\n"; + print '' . "\n"; print ''; print ''; - print ''; + print ''; print "\n"; print ''; - print '' . "\n"; + print '' . "\n"; print ''; print ''; - print ''; + print ''; print "\n"; print "
'; + print '
'; + print $langs->trans('From') . ' '; + print $form->selectDate($search_date_start, 'date_creation_start', 0, 0, 1); + print '
'; + print '
'; + print $langs->trans('to') . ' '; + print $form->selectDate($search_date_end, 'date_creation_end', 0, 0, 1); + print '
'; + print '
 '; + $searchpicto = $form->showFilterButtons(); + print $searchpicto; + print '
 '; - $searchpicto=$form->showFilterButtons(); - print $searchpicto; - print '
'; - print img_edit(); - print ' ' . $obj->doc_type . '' . $obj->doc_type . '' . dol_print_date($db->jdate($obj->doc_date), 'day') . '' . $obj->doc_type . '' . dol_print_date($db->jdate($obj->doc_date), 'day') . '' . $obj->doc_ref . '' . $obj->label_compte . '' . price($obj->debit) . '' . price($obj->credit) . '' . price(round($solde, 2)) . '' . $obj->code_journal . '' . $journaltoshow . '' . $obj->lettering_code . ''; + print img_edit(); + print '' . $obj->lettering_code . '
'.$langs->trans("Total").':'.$langs->trans("Total").':' . price($debit) . '' . price($credit) . '
'.$langs->trans("Balancing").':'.$langs->trans("Balancing").': ' . price($credit - $debit) . '
"; - print ''; - //print ''.$langs->trans('AccountancyAutoLettering').''; + print '
'."\n"; + print $letteringbutton; + print '
'; + print "
"; $db->free($resql); } else { diff --git a/htdocs/accountancy/class/lettering.class.php b/htdocs/accountancy/class/lettering.class.php index 5050327298b..555e1a244a6 100644 --- a/htdocs/accountancy/class/lettering.class.php +++ b/htdocs/accountancy/class/lettering.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2013 Olivier Geffroy - * Copyright (C) 2013-2018 Alexandre Spangaro + * Copyright (C) 2013-2019 Alexandre Spangaro * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -66,13 +66,13 @@ class Lettering extends BookKeeping $sql .= " , bk.sens , bk.code_journal , bk.piece_num, bk.date_lettering, bu.url_id , bu.type "; $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as bk"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "bank_url as bu ON(bk.fk_doc = bu.fk_bank AND bu.type IN ('payment', 'payment_supplier') ) "; - $sql .= " WHERE ( "; + $sql .= " WHERE ( "; if (! empty($object->code_compta)) - $sql .= " bk.subledger_account = '" . $object->code_compta . "' "; + $sql .= " bk.subledger_account = '" . $object->code_compta . "' "; if (! empty($object->code_compta) && ! empty($object->code_compta_fournisseur)) - $sql .= " OR "; + $sql .= " OR "; if (! empty($object->code_compta_fournisseur)) - $sql .= " bk.subledger_account = '" . $object->code_compta_fournisseur . "' "; + $sql .= " bk.subledger_account = '" . $object->code_compta_fournisseur . "' "; $sql .= " ) AND (bk.date_lettering ='' OR bk.date_lettering IS NULL) "; $sql .= " AND (bk.lettering_code != '' OR bk.lettering_code IS NULL) "; @@ -128,15 +128,15 @@ class Lettering extends BookKeeping $sql .= " AND facf.entity = ".$conf->entity; $sql .= " AND ( "; if (! empty($object->code_compta)) { - $sql .= " bk.subledger_account = '" . $object->code_compta . "' "; + $sql .= " bk.subledger_account = '" . $object->code_compta . "' "; } if (! empty($object->code_compta) && ! empty($object->code_compta_fournisseur)) { - $sql .= " OR "; + $sql .= " OR "; } if (! empty($object->code_compta_fournisseur)) { - $sql .= " bk.subledger_account = '" . $object->code_compta_fournisseur . "' "; + $sql .= " bk.subledger_account = '" . $object->code_compta_fournisseur . "' "; } - $sql .= " ) "; + $sql .= ") "; $resql2 = $this->db->query($sql); if ($resql2) { @@ -253,7 +253,7 @@ class Lettering extends BookKeeping $error++; } - $sql = "SELECT SUM(ABS(debit)) as deb, SUM(ABS(credit)) as cred FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping WHERE "; + $sql = "SELECT SUM(ABS(debit)) as deb, SUM(ABS(credit)) as cred FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping WHERE "; $sql .= " rowid IN (" . implode(',', $ids) . ") "; $result = $this->db->query($sql); if ($result) { diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index ae4fde1876b..ab5803a086a 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -652,6 +652,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) if ($fieldnamekey == 'sortorder') $fieldnamekey = 'SortOrder'; if ($fieldnamekey == 'category_type') $fieldnamekey = 'Calculated'; if ($fieldnamekey == 'revenuestamp_type') $fieldnamekey = 'TypeOfRevenueStamp'; + if ($fieldnamekey == 'use_default') $fieldnamekey = 'UseByDefault'; setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)), null, 'errors'); } @@ -1053,11 +1054,12 @@ if ($id) continue; } - // Determine le nom du champ par rapport aux noms possibles - // dans les dictionnaires de donnees + // Define field friedly name from its technical name $valuetoshow=ucfirst($fieldlist[$field]); // Par defaut $valuetoshow=$langs->trans($valuetoshow); // try to translate $class=''; + + if ($fieldlist[$field]=='pos') { $valuetoshow=$langs->trans("Position"); $class='width100'; } if ($fieldlist[$field]=='source') { $valuetoshow=$langs->trans("Contact"); } if ($fieldlist[$field]=='price') { $valuetoshow=$langs->trans("PriceUHT"); } if ($fieldlist[$field]=='taux') { @@ -1125,6 +1127,7 @@ if ($id) if ($fieldlist[$field]=='range_ik') { $valuetoshow=$langs->trans("RangeIk"); } if ($fieldlist[$field]=='fk_c_exp_tax_cat') { $valuetoshow=$langs->trans("CarCategory"); } if ($fieldlist[$field]=='revenuestamp_type') { $valuetoshow=$langs->trans('TypeOfRevenueStamp'); } + if ($fieldlist[$field]=='use_default') { $valuetoshow=$langs->trans('Default'); } if ($id == 2) // Special cas for state page { @@ -1197,8 +1200,10 @@ if ($id) print ''; + print '
'; + print '
'; print ''; print ''; @@ -1221,7 +1226,7 @@ if ($id) print '
'; print ''; - // Title line with search boxes + // Title line with search input fields print ''; $filterfound=0; foreach ($fieldlist as $field => $value) @@ -1276,17 +1281,12 @@ if ($id) // dans les dictionnaires de donnees $showfield=1; // By defaut $align="left"; + $cssprefix=''; $sortable=1; - $valuetoshow=''; - /* - $tmparray=getLabelOfField($fieldlist[$field]); - $showfield=$tmp['showfield']; - $valuetoshow=$tmp['valuetoshow']; - $align=$tmp['align']; - $sortable=$tmp['sortable']; - */ $valuetoshow=ucfirst($fieldlist[$field]); // By defaut $valuetoshow=$langs->trans($valuetoshow); // try to translate + + // Special cases if ($fieldlist[$field]=='source') { $valuetoshow=$langs->trans("Contact"); } if ($fieldlist[$field]=='price') { $valuetoshow=$langs->trans("PriceUHT"); } if ($fieldlist[$field]=='taux') { @@ -1304,10 +1304,7 @@ if ($id) if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); } if ($fieldlist[$field]=='position') { $align='right'; } if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { $valuetoshow=$langs->trans("Label"); } - if ($fieldlist[$field]=='libelle_facture') { - //$valuetoshow=$form->textwithtooltip($langs->trans("LabelOnDocuments"), $langs->trans("LabelUsedByDefault"),2,1,img_help(1,'')); - $valuetoshow=$langs->trans("LabelOnDocuments"); - } + if ($fieldlist[$field]=='libelle_facture') { $valuetoshow=$langs->trans("LabelOnDocuments"); } if ($fieldlist[$field]=='country') { $valuetoshow=$langs->trans("Country"); } if ($fieldlist[$field]=='recuperableonly') { $valuetoshow=$langs->trans("NPR"); $align="center"; } if ($fieldlist[$field]=='nbjour') { $valuetoshow=$langs->trans("NbOfDays"); } @@ -1316,7 +1313,6 @@ if ($id) if ($fieldlist[$field]=='width' || $fieldlist[$field]=='nx') { $valuetoshow=$langs->trans("Width"); } if ($fieldlist[$field]=='height' || $fieldlist[$field]=='ny') { $valuetoshow=$langs->trans("Height"); } if ($fieldlist[$field]=='unit' || $fieldlist[$field]=='metric') { $valuetoshow=$langs->trans("MeasuringUnit"); } - if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') { $showfield=0; } if ($fieldlist[$field]=='accountancy_code'){ $valuetoshow=$langs->trans("AccountancyCode"); } if ($fieldlist[$field]=='accountancy_code_sell'){ $valuetoshow=$langs->trans("AccountancyCodeSell"); $sortable=0; } if ($fieldlist[$field]=='accountancy_code_buy'){ $valuetoshow=$langs->trans("AccountancyCodeBuy"); $sortable=0; } @@ -1347,11 +1343,14 @@ if ($id) if ($fieldlist[$field]=='range_ik') { $valuetoshow=$langs->trans("RangeIk"); } if ($fieldlist[$field]=='fk_c_exp_tax_cat') { $valuetoshow=$langs->trans("CarCategory"); } if ($fieldlist[$field]=='revenuestamp_type') { $valuetoshow=$langs->trans('TypeOfRevenueStamp'); } + if ($fieldlist[$field]=='use_default') { $valuetoshow=$langs->trans('Default'); } - // Affiche nom du champ + if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') { $showfield=0; } + + // Show field title if ($showfield) { - print getTitleFieldOfList($valuetoshow, 0, $_SERVER["PHP_SELF"], ($sortable?$fieldlist[$field]:''), ($page?'page='.$page.'&':''), $param, "align=".$align, $sortfield, $sortorder); + print getTitleFieldOfList($valuetoshow, 0, $_SERVER["PHP_SELF"], ($sortable?$fieldlist[$field]:''), ($page?'page='.$page.'&':''), $param, "align=".$align, $sortfield, $sortorder, $cssprefix); } } // Favorite - Only activated on country dictionary @@ -1806,7 +1805,6 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') if (in_array('region_id', $fieldlist)) { print ''; continue; } // For state page, we do not show the country input (we link to region, not country) @@ -1912,7 +1910,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') print ''; } elseif ($fieldlist[$field] == 'code' && isset($obj->{$fieldlist[$field]})) { - print ''; + print ''; } elseif ($fieldlist[$field]=='unit') { print ''; + if (! $i) $totalarray['nbfield']++; } // Extra fields diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 9bd2d022ace..316983a5d0a 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -1939,7 +1939,7 @@ class Contrat extends CommonObject if ($user->rights->contrat->lire) { $label = ''.$langs->trans("ShowContract").''; - $label .= '
'.$langs->trans('Ref').': '.$this->ref; + $label .= '
'.$langs->trans('Ref').': '.($this->ref?$this->ref:$this->id); $label .= '
'.$langs->trans('RefCustomer').': '.($this->ref_customer ? $this->ref_customer : $this->ref_client); $label .= '
'.$langs->trans('RefSupplier').': '.$this->ref_supplier; if (!empty($this->total_ht)) { @@ -1971,7 +1971,7 @@ class Contrat extends CommonObject $result .= $linkstart; if ($withpicto) $result.=img_object(($notooltip?'':$label), $this->picto, ($notooltip?(($withpicto != 2) ? 'class="paddingright"' : ''):'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip?0:1); - if ($withpicto != 2) $result.= $this->ref; + if ($withpicto != 2) $result.= ($this->ref?$this->ref:$this->id); $result .= $linkend; return $result; diff --git a/htdocs/core/modules/modTicket.class.php b/htdocs/core/modules/modTicket.class.php index 5aef264a11e..871bc94670d 100644 --- a/htdocs/core/modules/modTicket.class.php +++ b/htdocs/core/modules/modTicket.class.php @@ -120,15 +120,16 @@ class modTicket extends DolibarrModules } $this->dictionaries = array( 'langs' => 'ticket', - 'tabname' => array(MAIN_DB_PREFIX . "c_ticket_type", MAIN_DB_PREFIX . "c_ticket_category", MAIN_DB_PREFIX . "c_ticket_severity"), - 'tablib' => array("TicketDictType", "TicketDictCategory", "TicketDictSeverity"), - 'tabsql' => array('SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM ' . MAIN_DB_PREFIX . 'c_ticket_type as f', 'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM ' . MAIN_DB_PREFIX . 'c_ticket_category as f', 'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM ' . MAIN_DB_PREFIX . 'c_ticket_severity as f'), + 'tabname' => array(MAIN_DB_PREFIX . "c_ticket_type", MAIN_DB_PREFIX . "c_ticket_severity", MAIN_DB_PREFIX . "c_ticket_category"), + 'tablib' => array("TicketDictType", "TicketDictSeverity", "TicketDictCategory"), + 'tabsql' => array('SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM ' . MAIN_DB_PREFIX . 'c_ticket_type as f', 'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM ' . MAIN_DB_PREFIX . 'c_ticket_severity as f', 'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM ' . MAIN_DB_PREFIX . 'c_ticket_category as f'), 'tabsqlsort' => array("pos ASC", "pos ASC", "pos ASC"), 'tabfield' => array("pos,code,label,use_default", "pos,code,label,use_default", "pos,code,label,use_default"), 'tabfieldvalue' => array("pos,code,label,use_default", "pos,code,label,use_default", "pos,code,label,use_default"), 'tabfieldinsert' => array("pos,code,label,use_default", "pos,code,label,use_default", "pos,code,label,use_default"), 'tabrowid' => array("rowid", "rowid", "rowid"), 'tabcond' => array($conf->ticket->enabled, $conf->ticket->enabled, $conf->ticket->enabled), + 'tabhelp' => array(array('code'=>$langs->trans("EnterAnyCode"), 'use_default'=>$langs->trans("Enter0or1")), array('code'=>$langs->trans("EnterAnyCode"), 'use_default'=>$langs->trans("Enter0or1")), array('code'=>$langs->trans("EnterAnyCode"), 'use_default'=>$langs->trans("Enter0or1"))), ); // Boxes diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 5c47aa41f40..f7a1c800443 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2789,7 +2789,7 @@ else } else { - print ''; + print ''; } /* diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index 30d97cc6e3e..a2195784bef 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -177,6 +177,7 @@ LabelAccount=Label account LabelOperation=Label operation Sens=Sens LetteringCode=Lettering code +Lettering=Lettering Codejournal=Journal JournalLabel=Journal label NumPiece=Piece number
'; - //print join(',',$fieldlist); print ''; @@ -1972,12 +1970,8 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') $classtd=''; $class=''; if ($fieldlist[$field]=='code') $classtd='width100'; - if ($fieldlist[$field]=='affect') $class='maxwidth50'; - if ($fieldlist[$field]=='delay') $class='maxwidth50'; - if ($fieldlist[$field]=='position') $class='maxwidth50'; - if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') $class='quatrevingtpercent'; - if ($fieldlist[$field]=='tracking') $class='quatrevingtpercent'; - if ($fieldlist[$field]=='sortorder' || $fieldlist[$field]=='sens' || $fieldlist[$field]=='category_type') $class='maxwidth50'; + if (in_array($fieldlist[$field], array('pos', 'use_default', 'affect', 'delay', 'position', 'sortorder', 'sens', 'category_type'))) $class='maxwidth50'; + if (in_array($fieldlist[$field], array('libelle', 'label', 'tracking'))) $class='quatrevingtpercent'; print ''; $transfound=0; if (in_array($fieldlist[$field], array('label','libelle'))) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index a253b1e2eb1..24c53d26526 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -968,6 +968,7 @@ if ($resql) print ' '; } print '
'.$langs->trans("None").'
'.$langs->trans("None").'