|
@@ -223,7 +223,7 @@ $tabsql[24] = "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFI
|
|
|
$tabsql[25] = "SELECT rowid as rowid, code, label, active, module FROM ".MAIN_DB_PREFIX."c_type_container as t WHERE t.entity = ".getEntity($tabname[25]);
|
|
|
//$tabsql[26]= "SELECT rowid as rowid, code, label, short_label, active FROM ".MAIN_DB_PREFIX."c_units";
|
|
|
$tabsql[27] = "SELECT id as rowid, code, libelle, picto, active FROM ".MAIN_DB_PREFIX."c_stcomm";
|
|
|
-$tabsql[28] = "SELECT h.rowid as rowid, h.code, h.label, h.affect, h.delay, h.newbymonth, h.fk_country as country_id, c.code as country_code, c.label as country, h.active FROM ".MAIN_DB_PREFIX."c_holiday_types as h LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON h.fk_country=c.rowid";
|
|
|
+$tabsql[28] = "SELECT h.rowid as rowid, h.code, h.label, h.affect, h.delay, h.newbymonth, h.fk_country as country_id, c.code as country_code, c.label as country, h.block_if_negative, h.active FROM ".MAIN_DB_PREFIX."c_holiday_types as h LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON h.fk_country=c.rowid";
|
|
|
$tabsql[29] = "SELECT rowid as rowid, code, label, percent, position, active FROM ".MAIN_DB_PREFIX."c_lead_status";
|
|
|
$tabsql[30] = "SELECT rowid, code, name, paper_size, orientation, metric, leftmargin, topmargin, nx, ny, spacex, spacey, width, height, font_size, custom_x, custom_y, active FROM ".MAIN_DB_PREFIX."c_format_cards";
|
|
|
//$tabsql[31]= "SELECT s.rowid as rowid, pcg_version, s.label, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s";
|
|
@@ -315,7 +315,7 @@ $tabfield[24] = "code,label";
|
|
|
$tabfield[25] = "code,label";
|
|
|
//$tabfield[26]= "code,label,short_label";
|
|
|
$tabfield[27] = "code,libelle,picto";
|
|
|
-$tabfield[28] = "code,label,affect,delay,newbymonth,country_id,country";
|
|
|
+$tabfield[28] = "code,label,affect,delay,newbymonth,country_id,country,block_if_negative";
|
|
|
$tabfield[29] = "code,label,percent,position";
|
|
|
$tabfield[30] = "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
|
|
|
//$tabfield[31]= "pcg_version,label";
|
|
@@ -361,7 +361,7 @@ $tabfieldvalue[24] = "code,label";
|
|
|
$tabfieldvalue[25] = "code,label";
|
|
|
//$tabfieldvalue[26]= "code,label,short_label";
|
|
|
$tabfieldvalue[27] = "code,libelle,picto";
|
|
|
-$tabfieldvalue[28] = "code,label,affect,delay,newbymonth,country";
|
|
|
+$tabfieldvalue[28] = "code,label,affect,delay,newbymonth,country,block_if_negative";
|
|
|
$tabfieldvalue[29] = "code,label,percent,position";
|
|
|
$tabfieldvalue[30] = "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
|
|
|
//$tabfieldvalue[31]= "pcg_version,label";
|
|
@@ -407,7 +407,7 @@ $tabfieldinsert[24] = "code,label";
|
|
|
$tabfieldinsert[25] = "code,label";
|
|
|
//$tabfieldinsert[26]= "code,label,short_label";
|
|
|
$tabfieldinsert[27] = "code,libelle,picto";
|
|
|
-$tabfieldinsert[28] = "code,label,affect,delay,newbymonth,fk_country";
|
|
|
+$tabfieldinsert[28] = "code,label,affect,delay,newbymonth,fk_country,block_if_negative";
|
|
|
$tabfieldinsert[29] = "code,label,percent,position";
|
|
|
$tabfieldinsert[30] = "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
|
|
|
//$tabfieldinsert[31]= "pcg_version,label";
|
|
@@ -1418,6 +1418,9 @@ if ($id) {
|
|
|
if ($value == 'public' && $tablib[$id] == 'TicketDictCategory') {
|
|
|
$valuetoshow = $langs->trans('TicketGroupIsPublic'); $class = 'center';
|
|
|
}
|
|
|
+ if ($value == 'block_if_negative') {
|
|
|
+ $valuetoshow = $langs->trans('BlockHolidayIfNegative');
|
|
|
+ }
|
|
|
|
|
|
if ($id == 2) { // Special case for state page
|
|
|
if ($value == 'region_id') {
|
|
@@ -1764,6 +1767,9 @@ if ($id) {
|
|
|
if ($value == 'public' && $tablib[$id] == 'TicketDictCategory') {
|
|
|
$valuetoshow = $langs->trans('TicketGroupIsPublic'); $cssprefix = 'center ';
|
|
|
}
|
|
|
+ if ($value == 'block_if_negative') {
|
|
|
+ $valuetoshow = $langs->trans('BlockHolidayIfNegative');
|
|
|
+ }
|
|
|
|
|
|
if ($value == 'region_id' || $value == 'country_id') {
|
|
|
$showfield = 0;
|
|
@@ -1981,8 +1987,9 @@ if ($id) {
|
|
|
}
|
|
|
}
|
|
|
} elseif ($value == 'fk_c_exp_tax_cat') {
|
|
|
- $valuetoshow = getDictionaryValue(MAIN_DB_PREFIX.'c_exp_tax_cat', 'label', $valuetoshow);
|
|
|
- $valuetoshow = $langs->trans($valuetoshow);
|
|
|
+ $tmpid = $valuetoshow;
|
|
|
+ $valuetoshow = getDictionaryValue(MAIN_DB_PREFIX.'c_exp_tax_cat', 'label', $tmpid);
|
|
|
+ $valuetoshow = $langs->trans($valuetoshow ? $valuetoshow : $tmpid);
|
|
|
} elseif ($tabname[$id] == MAIN_DB_PREFIX.'c_exp_tax_cat') {
|
|
|
$valuetoshow = $langs->trans($valuetoshow);
|
|
|
} elseif ($value == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_units') {
|
|
@@ -1997,6 +2004,8 @@ if ($id) {
|
|
|
} elseif ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_productbatch_qcstatus') {
|
|
|
$langs->load("productbatch");
|
|
|
$valuetoshow = $langs->trans($obj->{$value});
|
|
|
+ } elseif ($value == 'block_if_negative') {
|
|
|
+ $valuetoshow = yn($obj->{$value});
|
|
|
}
|
|
|
$class .= ($class ? ' ' : '').'tddict';
|
|
|
if ($value == 'note' && $id == 10) {
|
|
@@ -2379,6 +2388,10 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
|
|
|
print '<td>';
|
|
|
print $form->selectExpenseRanges($obj->fk_range);
|
|
|
print '</td>';
|
|
|
+ } elseif ($value == 'block_if_negative') {
|
|
|
+ print '<td>';
|
|
|
+ print $form->selectyesno("block_if_negative", (!empty($obj->{$value}) ? $obj->{$value}:''), 1);
|
|
|
+ print '</td>';
|
|
|
} else {
|
|
|
$fieldValue = isset($obj->{$value}) ? $obj->{$value}: '';
|
|
|
|