| ' . $langs->trans("AccountingCategory") . ' | '; print ''; $formaccounting->select_accounting_category($cat_id, 'account_category', 1, 0, 0, 1); print ''; print ' | |
| ' . $langs->trans("ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL") . ' | '; + if (! empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) { + print ''; + print img_picto($langs->trans("Activated"), 'switch_on'); + print ' | '; + } else { + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); + print ' | '; + } + print '
| ' . $langs->trans("BANK_DISABLE_DIRECT_INPUT") . ' | '; if (! empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) { diff --git a/htdocs/accountancy/admin/journals_list.php b/htdocs/accountancy/admin/journals_list.php index 971fdc20811..4a5e77a434b 100644 --- a/htdocs/accountancy/admin/journals_list.php +++ b/htdocs/accountancy/admin/journals_list.php @@ -30,9 +30,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php'; -$langs->load("admin"); -$langs->load("compta"); -$langs->load("accountancy"); +// Load translation files required by the page +$langs->loadLangs(array("admin","compta","accountancy")); $action=GETPOST('action','alpha')?GETPOST('action','alpha'):'view'; $confirm=GETPOST('confirm','alpha'); @@ -135,6 +134,7 @@ $elementList = array(); '3' => $langs->trans('AccountingJournalType3'), '4' => $langs->trans('AccountingJournalType4'), '5' => $langs->trans('AccountingJournalType5'), + '8' => $langs->trans('AccountingJournalType8'), '9' => $langs->trans('AccountingJournalType9') ); @@ -418,7 +418,6 @@ if ($id) if ($tabname[$id]) { $alabelisused=0; - $var=false; $fieldlist=explode(',',$tabfield[$id]); @@ -498,7 +497,6 @@ if ($id) { $num = $db->num_rows($resql); $i = 0; - $var=true; $param = '&id='.$id; if ($search_country_id > 0) $param.= '&search_country_id='.$search_country_id; @@ -603,6 +601,7 @@ if ($id) if (empty($reshook)) { + $langs->load("accountancy"); foreach ($fieldlist as $field => $value) { @@ -613,10 +612,12 @@ if ($id) $valuetoshow=$langs->trans('All'); } else if ($fieldlist[$field]=='nature' && $tabname[$id]==MAIN_DB_PREFIX.'accounting_journal') { - $langs->load("accountancy"); $key=$langs->trans("AccountingJournalType".strtoupper($obj->nature)); - $valuetoshow=($obj->nature && $key != "AccountingJournalType".strtoupper($obj->nature)?$key:$obj->{$fieldlist[$field]}); + $valuetoshow=($obj->nature && $key != "AccountingJournalType".strtoupper($langs->trans($obj->nature))?$key:$obj->{$fieldlist[$field]}); } + else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'accounting_journal') { + $valuetoshow=$langs->trans($obj->label); + } $class='tddict'; // Show value for field @@ -642,13 +643,7 @@ if ($id) // Active print ''; if ($canbedisabled) print ''.$actl[$obj->active].''; - else - { - if (in_array($obj->code, array('AC_OTH','AC_OTH_AUTO'))) print $langs->trans("AlwaysActive"); - else if (isset($obj->type) && in_array($obj->type, array('systemauto')) && empty($obj->active)) print $langs->trans("Deprecated"); - else if (isset($obj->type) && in_array($obj->type, array('system')) && ! empty($obj->active) && $obj->code != 'AC_OTH') print $langs->trans("UsedOnlyWithTypeOption"); - else print $langs->trans("AlwaysActive"); - } + else print $langs->trans("AlwaysActive"); print " | "; // Modify link diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index e07d0c24771..070e2f353c3 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -26,7 +26,6 @@ */ require '../../main.inc.php'; -// Class require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/report.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php'; @@ -35,12 +34,8 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php'; require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; -// Langs -$langs->load("companies"); -$langs->load("compta"); -$langs->load("main"); -$langs->load("accountancy"); -$langs->load("products"); +// Load translation files required by the page +$langs->loadLangs(array("companies","compta","accountancy","products")); // Security check if (empty($conf->accounting->enabled)) { @@ -261,7 +256,13 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } + $sql .= $db->plimit($limit + 1, $offset); dol_syslog("/accountancy/admin/productaccount.php:: sql=" . $sql, LOG_DEBUG); @@ -272,8 +273,8 @@ if ($result) $i = 0; $param=''; - if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; - if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage); + if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit); if ($search_ref > 0) $param.="&search_desc=".urlencode($search_ref); if ($search_label > 0) $param.="&search_desc=".urlencode($search_label); if ($search_desc > 0) $param.="&search_desc=".urlencode($search_desc); @@ -300,10 +301,10 @@ if ($result) print '|
| ' . $langs->trans('Options') . ' | ' . $langs->trans('Description') . ' | '; print "|
| ' . $langs->trans('OptionModeProductSell') . ' | '; + print '||
| ' . $langs->trans('OptionModeProductSell') . ' | '; print ''.$langs->trans('OptionModeProductSellDesc'); print " | |
| ' . $langs->trans('OptionModeProductBuy') . ' | '; + print '||
| ' . $langs->trans('OptionModeProductBuy') . ' | '; print ''.$langs->trans('OptionModeProductBuyDesc')." |
| ' . $langs->trans("Label") . ' | ' . $langs->trans("JanuaryMin") . ' | ' . $langs->trans("FebruaryMin") . ' | ' . $langs->trans("MarchMin") . ' | ' . $langs->trans("AprilMin") . ' | ' . $langs->trans("MayMin") . ' | ' . $langs->trans("JuneMin") . ' | ' . $langs->trans("JulyMin") . ' | ' . $langs->trans("AugustMin") . ' | ' . $langs->trans("SeptemberMin") . ' | ' . $langs->trans("OctoberMin") . ' | ' . $langs->trans("NovemberMin") . ' | ' . $langs->trans("DecemberMin") . ' | Total |
| ' . $langs->trans("Label") . ' | '; +print '' . $langs->trans("JanuaryMin") . ' | '; +print '' . $langs->trans("FebruaryMin") . ' | '; +print '' . $langs->trans("MarchMin") . ' | '; +print '' . $langs->trans("AprilMin") . ' | '; +print '' . $langs->trans("MayMin") . ' | '; +print '' . $langs->trans("JuneMin") . ' | '; +print '' . $langs->trans("JulyMin") . ' | '; +print '' . $langs->trans("AugustMin") . ' | '; +print '' . $langs->trans("SeptemberMin") . ' | '; +print '' . $langs->trans("OctoberMin") . ' | '; +print '' . $langs->trans("NovemberMin") . ' | '; +print '' . $langs->trans("DecemberMin") . ' | '; +print 'Total | '; +print '
| ' . length_accountg($row[0]) . ' | '; + print '|||||||||||||
| ' . length_accountg($row[0]) . ' | '; print '' . price($row[1]) . ' | '; print '' . price($row[2]) . ' | '; print '' . price($row[3]) . ' | '; @@ -133,4 +141,4 @@ if ($resql) { print "
| '; - print $langs->trans('Docref'); + print $langs->trans('Piece'); print ' | '; if ($action != 'editdocref') - print 'piece_num.'&mode='. $mode .'">'.img_edit($langs->transnoentitiesnoconv('Edit'),1).' | '; + print 'piece_num.'&mode='. $mode .'">'.img_edit($langs->transnoentitiesnoconv('Edit'),1).' | '; print '
| ' . $langs->trans("Doctype") . ' | '; - print '' . $book->doc_type . ' | '; + print '' . $object->doc_type . ' | '; print '
| ' . $langs->trans("DateCreation") . ' | '; print ''; - print $book->date_creation ? dol_print_date($book->date_creation, 'day') : ' '; + print $object->date_creation ? dol_print_date($object->date_creation, 'day') : ' '; print ' | '; print '|
| ' . $langs->trans("Status") . ' | '; print ''; - if (empty($book->validated)) { + if (empty($object->validated)) { print 'rowid . '&action=enable">'; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; @@ -536,11 +535,11 @@ if ($action == 'create') /* print ' | |
| ' . $langs->trans("Control") . ' | '; - if ($book->doc_type == 'customer_invoice') + if ($object->doc_type == 'customer_invoice') { $sqlmid = 'SELECT rowid as ref'; $sqlmid .= " FROM ".MAIN_DB_PREFIX."facture as fac"; - $sqlmid .= " WHERE fac.rowid=" . $book->fk_doc; + $sqlmid .= " WHERE fac.rowid=" . $object->fk_doc; dol_syslog("accountancy/bookkeeping/card.php::sqlmid=" . $sqlmid, LOG_DEBUG); $resultmid = $db->query($sqlmid); if ($resultmid) { @@ -563,24 +562,24 @@ if ($action == 'create') print '