diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index c766cc54907..7467aee23b3 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2004 Eric Seigne * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2005-2012 Regis Houssin @@ -389,7 +389,7 @@ if ($id > 0) print ''; print $form->editfieldkey("OutstandingBill",'OutstandingBill',$object->outstanding_limit,$object,$user->rights->societe->creer); print ''; - print price($form->editfieldval("OutstandingBill",'OutstandingBill',$object->outstanding_limit,$object,$user->rights->societe->creer)); + print $form->editfieldval("OutstandingBill",'OutstandingBill',$object->outstanding_limit,$object,$user->rights->societe->creer,'amount',price($object->outstanding_limit)); print ''; print ''; } diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 219887ebee5..c54d6242fce 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -2312,19 +2312,22 @@ if ($action == 'create') print ''; } - if ($soc->outstanding_limit) + // TODO This is nt a roperty of invoice so should not appears here but as a warning on thirdparty + /* + if ($soc->outstanding_limit) { $outstandigBills=$soc->get_OutstandingBill(); // Outstanding Bill print ''; print $langs->trans('OutstandingBill'); - print ''; + print ''; print price($outstandigBills); if ($outstandigBills > $soc->outstanding_limit) print img_warning($langs->trans("OutstandingBillReached")); print ' / '.price($soc->outstanding_limit); print ''; print ''; } + */ // Other attributes $parameters=array('objectsrc' => $objectsrc, 'colspan' => ' colspan="3"'); @@ -3042,7 +3045,7 @@ else if ($id > 0 || ! empty($ref)) $nbrows=8; $nbcols=2; if (! empty($conf->projet->enabled)) $nbrows++; if (! empty($conf->banque->enabled)) $nbcols++; - if (! empty($soc->outstandingbill)) $nbrows++; + //if (! empty($soc->outstandingbill)) $nbrows++; if($mysoc->localtax1_assuj=="1") $nbrows++; if($mysoc->localtax2_assuj=="1") $nbrows++; if ($selleruserevenustamp) $nbrows++; @@ -3314,18 +3317,23 @@ else if ($id > 0 || ! empty($ref)) } print ''; + // TODO This is nt a roperty of invoice so should not appears here but as a warning on thirdparty + /* if ($soc->outstandingbill) { + $outstandingBills=$soc->get_OutstandingBill(); // Outstanding Bill print ''; print $langs->trans('OutstandingBill'); - print ''; - print price($soc->get_OutstandingBill()).' / '; - print price($soc->outstandingbill); + print ''; + print price($outstandingBills); + if ($outstandigBills > $soc->outstanding_limit) print img_warning($langs->trans("OutstandingBillReached")); + print ' / '.price($soc->outstandingbill); print ''; print ''; } - + */ + // Amount print ''.$langs->trans('AmountHT').''; print ''.price($object->total_ht,1,'',1,-1,-1,$conf->currency).''; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 296ae741e1b..36c1f838810 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -121,8 +121,8 @@ class Form * @param string $value Value to show/edit * @param object $object Object * @param boolean $perm Permission to allow button to edit parameter - * @param string $typeofdata Type of data ('string' by default, 'email', 'numeric:99', 'text' or 'textarea:rows:cols', 'day' or 'datepicker', 'ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols', 'select:xxx'...) - * @param string $editvalue When in edit mode, use this value as $value instead of value + * @param string $typeofdata Type of data ('string' by default, 'amount', 'email', 'numeric:99', 'text' or 'textarea:rows:cols', 'day' or 'datepicker', 'ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols', 'select:xxx'...) + * @param string $editvalue When in edit mode, use this value as $value instead of value (for example, you can provide here a formated price instead of value) * @param object $extObject External object * @param string $success Success message * @param string $moreparam More param to add on a href URL @@ -134,6 +134,9 @@ class Form $ret=''; + // Check parameters + if (empty($typeofdata)) return 'ErrorBadParameter'; + // When option to edit inline is activated if (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && ! preg_match('/^select;|datehourpicker/',$typeofdata)) // FIXME add jquery timepicker { @@ -150,7 +153,7 @@ class Form $ret.=''; $ret.=''; $ret.='
'; - if (preg_match('/^(string|email|numeric)/',$typeofdata)) + if (preg_match('/^(string|email|numeric|amount)/',$typeofdata)) { $tmp=explode(':',$typeofdata); $ret.=''; @@ -193,6 +196,7 @@ class Form else { if ($typeofdata == 'email') $ret.=dol_print_email($value,0,0,0,0,1); + elseif ($typeofdata == 'amount') $ret.=price($value,'',$langs); elseif (preg_match('/^text/',$typeofdata) || preg_match('/^note/',$typeofdata)) $ret.=dol_htmlentitiesbr($value); elseif ($typeofdata == 'day' || $typeofdata == 'datepicker') $ret.=dol_print_date($value,'day'); elseif ($typeofdata == 'datehourpicker') $ret.=dol_print_date($value,'dayhour'); diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index 8159304f376..7c0366fb4a0 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -210,7 +210,8 @@ class DoliDBPgsql extends DoliDB // tinyint type conversion $line=preg_replace('/tinyint\(?[0-9]*\)?/','smallint',$line); - + $line=preg_replace('/tinyint/i','smallint',$line); + // nuke unsigned $line=preg_replace('/(int\w+|smallint)\s+unsigned/i','\\1',$line); @@ -875,7 +876,7 @@ class DoliDBPgsql extends DoliDB 42701=> 'DB_ERROR_COLUMN_ALREADY_EXISTS', '42710' => 'DB_ERROR_KEY_NAME_ALREADY_EXISTS', '23505' => 'DB_ERROR_RECORD_ALREADY_EXISTS', - '42704' => 'DB_ERROR_NO_INDEX_TO_DROP', + '42704' => 'DB_ERROR_NO_INDEX_TO_DROP', // May also be Type xxx does not exists '42601' => 'DB_ERROR_SYNTAX', '42P16' => 'DB_ERROR_PRIMARY_KEY_ALREADY_EXISTS', 1075 => 'DB_ERROR_CANT_DROP_PRIMARY_KEY', diff --git a/htdocs/install/mysql/migration/3.4.0-3.5.0.sql b/htdocs/install/mysql/migration/3.4.0-3.5.0.sql index 5fbd3dcc3f4..a091e7f089c 100755 --- a/htdocs/install/mysql/migration/3.4.0-3.5.0.sql +++ b/htdocs/install/mysql/migration/3.4.0-3.5.0.sql @@ -359,5 +359,5 @@ ALTER TABLE llx_societe ADD skype VARCHAR(255) AFTER email; ALTER TABLE llx_adherent ADD skype VARCHAR(255) AFTER email; -- multi-rib -ALTER TABLE llx_societe_rib ADD default_rib TINYINT NOT NULL DEFAULT 0 AFTER owner_address; +ALTER TABLE llx_societe_rib ADD default_rib smallint NOT NULL DEFAULT 0 AFTER owner_address; UPDATE llx_societe_rib SET default_rib = 1; diff --git a/htdocs/install/mysql/tables/llx_societe_rib.sql b/htdocs/install/mysql/tables/llx_societe_rib.sql index d928da868ed..1bedff6da4c 100644 --- a/htdocs/install/mysql/tables/llx_societe_rib.sql +++ b/htdocs/install/mysql/tables/llx_societe_rib.sql @@ -36,7 +36,7 @@ create table llx_societe_rib domiciliation varchar(255), proprio varchar(60), owner_address varchar(255), - default_rib tinyint NOT NULL DEFAULT 0, + default_rib smallint NOT NULL DEFAULT 0, import_key varchar(14) -- import key