diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php
index 73ed83daf82..1c426b63cc5 100644
--- a/htdocs/admin/dict.php
+++ b/htdocs/admin/dict.php
@@ -214,7 +214,7 @@ $tabsql[6] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.t
$tabsql[7] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.accountancy_code as accountancy_code, c.code as country_code, c.label as country, a.fk_pays as country_id, a.active FROM ".MAIN_DB_PREFIX."c_chargesociales AS a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_pays = c.rowid and c.active = 1";
$tabsql[8] = "SELECT t.id as rowid, t.code as code, t.libelle, t.fk_country as country_id, c.code as country_code, c.label as country, t.position, t.active FROM ".MAIN_DB_PREFIX."c_typent as t LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON t.fk_country=c.rowid";
$tabsql[9] = "SELECT c.code_iso as code, c.label, c.unicode, c.active FROM ".MAIN_DB_PREFIX."c_currencies AS c";
-$tabsql[10] = "SELECT t.rowid, t.entity, t.code, t.taux, t.localtax1_type, t.localtax1, t.localtax2_type, t.localtax2, c.label as country, c.code as country_code, t.fk_pays as country_id, t.recuperableonly, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c WHERE t.fk_pays = c.rowid AND t.entity = ".getEntity($tabname[10]);
+$tabsql[10] = "SELECT t.rowid, t.entity, t.type_vat, t.code, t.taux, t.localtax1_type, t.localtax1, t.localtax2_type, t.localtax2, c.label as country, c.code as country_code, t.fk_pays as country_id, t.recuperableonly, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c WHERE t.fk_pays = c.rowid AND t.entity = ".getEntity($tabname[10]);
$tabsql[11] = "SELECT t.rowid as rowid, t.element, t.source, t.code, t.libelle, t.position, t.active FROM ".MAIN_DB_PREFIX."c_type_contact AS t";
$tabsql[12] = "SELECT c.rowid as rowid, c.code, c.libelle, c.libelle_facture, c.deposit_percent, c.nbjour, c.type_cdr, c.decalage, c.active, c.sortorder, c.entity FROM ".MAIN_DB_PREFIX."c_payment_term AS c WHERE c.entity IN (".getEntity($tabname[12]).")";
$tabsql[13] = "SELECT c.id as rowid, c.code, c.libelle, c.type, c.active, c.entity FROM ".MAIN_DB_PREFIX."c_paiement AS c WHERE c.entity IN (".getEntity($tabname[13]).")";
@@ -308,7 +308,7 @@ $tabfield[6] = "code,libelle,type,color,position";
$tabfield[7] = "code,libelle,country,accountancy_code";
$tabfield[8] = "code,libelle,country_id,country".(getDolGlobalString('SOCIETE_SORT_ON_TYPEENT') ? ',position' : '');
$tabfield[9] = "code,label,unicode";
-$tabfield[10] = "country_id,country,code,taux,localtax1_type,localtax1,localtax2_type,localtax2,recuperableonly,accountancy_code_sell,accountancy_code_buy,note";
+$tabfield[10] = "country_id,country,type_vat,code,taux,localtax1_type,localtax1,localtax2_type,localtax2,recuperableonly,accountancy_code_sell,accountancy_code_buy,note";
$tabfield[11] = "element,source,code,libelle,position";
$tabfield[12] = "code,libelle,libelle_facture,deposit_percent,nbjour,type_cdr,decalage,sortorder";
$tabfield[13] = "code,libelle,type";
@@ -355,7 +355,7 @@ $tabfieldvalue[6] = "code,libelle,type,color,position";
$tabfieldvalue[7] = "code,libelle,country,accountancy_code";
$tabfieldvalue[8] = "code,libelle,country".(getDolGlobalString('SOCIETE_SORT_ON_TYPEENT') ? ',position' : '');
$tabfieldvalue[9] = "code,label,unicode";
-$tabfieldvalue[10] = "country,code,taux,localtax1_type,localtax1,localtax2_type,localtax2,recuperableonly,accountancy_code_sell,accountancy_code_buy,note";
+$tabfieldvalue[10] = "country,type_vat,code,taux,localtax1_type,localtax1,localtax2_type,localtax2,recuperableonly,accountancy_code_sell,accountancy_code_buy,note";
$tabfieldvalue[11] = "element,source,code,libelle,position";
$tabfieldvalue[12] = "code,libelle,libelle_facture,deposit_percent,nbjour,type_cdr,decalage,sortorder";
$tabfieldvalue[13] = "code,libelle,type";
@@ -402,7 +402,7 @@ $tabfieldinsert[6] = "code,libelle,type,color,position";
$tabfieldinsert[7] = "code,libelle,fk_pays,accountancy_code";
$tabfieldinsert[8] = "code,libelle,fk_country".(getDolGlobalString('SOCIETE_SORT_ON_TYPEENT') ? ',position' : '');
$tabfieldinsert[9] = "code_iso,label,unicode";
-$tabfieldinsert[10] = "fk_pays,code,taux,localtax1_type,localtax1,localtax2_type,localtax2,recuperableonly,accountancy_code_sell,accountancy_code_buy,note,entity";
+$tabfieldinsert[10] = "fk_pays,type_vat,code,taux,localtax1_type,localtax1,localtax2_type,localtax2,recuperableonly,accountancy_code_sell,accountancy_code_buy,note,entity";
$tabfieldinsert[11] = "element,source,code,libelle,position";
$tabfieldinsert[12] = "code,libelle,libelle_facture,deposit_percent,nbjour,type_cdr,decalage,sortorder,entity";
$tabfieldinsert[13] = "code,libelle,type,entity";
@@ -675,6 +675,13 @@ if ($id == 11) {
);
}
+// Define type_vatList (used for dictionary "llx_c_tva")
+$type_vatList = array(
+ "0" => $langs->trans("All"),
+ "1" => $langs->trans("Sell"),
+ "2" => $langs->trans("Buy")
+);
+
// Define localtax_typeList (used for dictionary "llx_c_tva")
$localtax_typeList = array(
"0" => $langs->trans("No"),
@@ -1346,6 +1353,325 @@ if ($id > 0) {
print "
\n";
}
+ // Form to add a new line
+ if ($tabname[$id]) {
+ $withentity = null;
+
+ $fieldlist = explode(',', $tabfield[$id]);
+
+ print '
| '; continue; + } // For region page, we do not show the country input + $valuetoshow = $langs->trans("Country"); + } + if ($value == 'recuperableonly') { + $valuetoshow = $langs->trans("NPR"); $class = "center"; + } + if ($value == 'nbjour') { + $valuetoshow = $langs->trans("NbOfDays"); + $class = 'right'; + } + if ($value == 'type_cdr') { + $valuetoshow = $langs->trans("AtEndOfMonth"); $class = "center"; + } + if ($value == 'decalage') { + $valuetoshow = $langs->trans("Offset"); + $class = 'right'; + } + if ($value == 'width' || $value == 'nx') { + $valuetoshow = $langs->trans("Width"); + } + if ($value == 'height' || $value == 'ny') { + $valuetoshow = $langs->trans("Height"); + } + if ($value == 'unit' || $value == 'metric') { + $valuetoshow = $langs->trans("MeasuringUnit"); + } + if ($value == 'region_id' || $value == 'country_id') { + $valuetoshow = ''; + } + if ($value == 'accountancy_code') { + $valuetoshow = $langs->trans("AccountancyCode"); + } + if ($value == 'accountancy_code_sell') { + $valuetoshow = $langs->trans("AccountancyCodeSell"); + } + if ($value == 'accountancy_code_buy') { + $valuetoshow = $langs->trans("AccountancyCodeBuy"); + } + if ($value == 'pcg_version' || $value == 'fk_pcg_version') { + $valuetoshow = $langs->trans("Pcg_version"); + } + if ($value == 'account_parent') { + $valuetoshow = $langs->trans("Accountparent"); + } + if ($value == 'pcg_type') { + $valuetoshow = $langs->trans("Pcg_type"); + } + if ($value == 'pcg_subtype') { + $valuetoshow = $langs->trans("Pcg_subtype"); + } + if ($value == 'sortorder') { + $valuetoshow = $langs->trans("SortOrder"); + $class = 'center'; + } + if ($value == 'short_label') { + $valuetoshow = $langs->trans("ShortLabel"); + } + if ($value == 'fk_parent') { + $valuetoshow = $langs->trans("ParentID"); $class = 'center'; + } + if ($value == 'range_account') { + $valuetoshow = $langs->trans("Range"); + } + if ($value == 'sens') { + $valuetoshow = $langs->trans("Sens"); + } + if ($value == 'category_type') { + $valuetoshow = $langs->trans("Calculated"); + } + if ($value == 'formula') { + $valuetoshow = $langs->trans("Formula"); + } + if ($value == 'paper_size') { + $valuetoshow = $langs->trans("PaperSize"); + } + if ($value == 'orientation') { + $valuetoshow = $langs->trans("Orientation"); + } + if ($value == 'leftmargin') { + $valuetoshow = $langs->trans("LeftMargin"); + } + if ($value == 'topmargin') { + $valuetoshow = $langs->trans("TopMargin"); + } + if ($value == 'spacex') { + $valuetoshow = $langs->trans("SpaceX"); + } + if ($value == 'spacey') { + $valuetoshow = $langs->trans("SpaceY"); + } + if ($value == 'font_size') { + $valuetoshow = $langs->trans("FontSize"); + } + if ($value == 'custom_x') { + $valuetoshow = $langs->trans("CustomX"); + } + if ($value == 'custom_y') { + $valuetoshow = $langs->trans("CustomY"); + } + if ($value == 'percent') { + $valuetoshow = $langs->trans("Percentage"); + } + if ($value == 'affect') { + $valuetoshow = $langs->trans("WithCounter"); + } + if ($value == 'delay') { + $valuetoshow = $langs->trans("NoticePeriod"); + } + if ($value == 'newbymonth') { + $valuetoshow = $langs->trans("NewByMonth"); + } + if ($value == 'fk_tva') { + $valuetoshow = $langs->trans("VAT"); + } + if ($value == 'range_ik') { + $valuetoshow = $langs->trans("RangeIk"); + } + if ($value == 'fk_c_exp_tax_cat') { + $valuetoshow = $langs->trans("CarCategory"); + } + if ($value == 'revenuestamp_type') { + $valuetoshow = $langs->trans('TypeOfRevenueStamp'); + } + if ($value == 'use_default') { + $valuetoshow = $langs->trans('Default'); $class = 'center'; + } + if ($value == 'unit_type') { + $valuetoshow = $langs->trans('TypeOfUnit'); + } + if ($value == 'public' && $tablib[$id] == 'TicketDictCategory') { + $valuetoshow = $langs->trans('TicketGroupIsPublic'); $class = 'center'; + } + if ($value == 'block_if_negative') { + $valuetoshow = $langs->trans('BlockHolidayIfNegative'); + } + if ($value == 'type_duration') { + $valuetoshow = $langs->trans('Unit'); + } + + if ($id == 2) { // Special case for state page + if ($value == 'region_id') { + $valuetoshow = ' '; $showfield = 1; + } + if ($value == 'region') { + $valuetoshow = $langs->trans("Country").'/'.$langs->trans("Region"); $showfield = 1; + } + } + + if ($valuetoshow != '') { + $tooltiphelp = (isset($tabcomplete[$tabname[$id]]['help'][$value]) ? $tabcomplete[$tabname[$id]]['help'][$value] : ''); + + $tdsoffields .= ' | '; + if ($tooltiphelp && preg_match('/^http(s*):/i', $tooltiphelp)) { + $tdsoffields .= ''.$valuetoshow.' '.img_help(1, $valuetoshow).''; + } elseif ($tooltiphelp) { + $tdsoffields .= $form->textwithpicto($valuetoshow, $tooltiphelp); + } else { + $tdsoffields .= $valuetoshow; + } + $tdsoffields .= ' | '; + } + } + + if ($id == 4) { + $tdsoffields .= ''; + $tdsoffields .= ' | '; + } + $tdsoffields .= ' | '; + $tdsoffields .= ''; + if (!is_null($withentity)) { + $tdsoffields .= ''; + } + $tdsoffields .= ' | '; + $tdsoffields .= ''; + $tdsoffields .= ' | '; + $tdsoffields .= ' |
|---|---|---|---|---|---|---|
| '; + print ' | '; + } + print ' | '; + if ($action != 'edit') { + print ''; + } else { + print ''; + } + print ' | '; + + print "||||