Skip to content

Commit

Permalink
Fix: Miscellaneous fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Nov 16, 2013
1 parent c5230ea commit 5b243ab
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 16 deletions.
4 changes: 2 additions & 2 deletions htdocs/comm/fiche.php
@@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
Expand Down Expand Up @@ -389,7 +389,7 @@
print '<td>';
print $form->editfieldkey("OutstandingBill",'OutstandingBill',$object->outstanding_limit,$object,$user->rights->societe->creer);
print '</td><td colspan="3">';
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 '</td>';
print '</tr>';
}
Expand Down
22 changes: 15 additions & 7 deletions htdocs/compta/facture.php
Expand Up @@ -2312,19 +2312,22 @@
print '</td></tr>';
}

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 '<tr><td>';
print $langs->trans('OutstandingBill');
print '</td><td align=right>';
print '</td><td align="right" colspan="2">';
print price($outstandigBills);
if ($outstandigBills > $soc->outstanding_limit) print img_warning($langs->trans("OutstandingBillReached"));
print ' / '.price($soc->outstanding_limit);
print '</td>';
print '</tr>';
}
*/

// Other attributes
$parameters=array('objectsrc' => $objectsrc, 'colspan' => ' colspan="3"');
Expand Down Expand Up @@ -3042,7 +3045,7 @@
$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++;
Expand Down Expand Up @@ -3314,18 +3317,23 @@
}
print '</td></tr>';

// 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 '<tr><td>';
print $langs->trans('OutstandingBill');
print '</td><td align=right>';
print price($soc->get_OutstandingBill()).' / ';
print price($soc->outstandingbill);
print '</td><td align="right">';
print price($outstandingBills);
if ($outstandigBills > $soc->outstanding_limit) print img_warning($langs->trans("OutstandingBillReached"));
print ' / '.price($soc->outstandingbill);
print '</td>';
print '</tr>';
}

*/

// Amount
print '<tr><td>'.$langs->trans('AmountHT').'</td>';
print '<td align="right" colspan="3" nowrap>'.price($object->total_ht,1,'',1,-1,-1,$conf->currency).'</td></tr>';
Expand Down
10 changes: 7 additions & 3 deletions htdocs/core/class/html.form.class.php
Expand Up @@ -121,8 +121,8 @@ function editfieldkey($text, $htmlname, $preselected, $object, $perm, $typeofdat
* @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
Expand All @@ -134,6 +134,9 @@ function editfieldval($text, $htmlname, $value, $object, $perm, $typeofdata='str

$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
{
Expand All @@ -150,7 +153,7 @@ function editfieldval($text, $htmlname, $value, $object, $perm, $typeofdata='str
$ret.='<input type="hidden" name="id" value="'.$object->id.'">';
$ret.='<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
$ret.='<tr><td>';
if (preg_match('/^(string|email|numeric)/',$typeofdata))
if (preg_match('/^(string|email|numeric|amount)/',$typeofdata))
{
$tmp=explode(':',$typeofdata);
$ret.='<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($editvalue?$editvalue:$value).'"'.($tmp[1]?' size="'.$tmp[1].'"':'').'>';
Expand Down Expand Up @@ -193,6 +196,7 @@ function editfieldval($text, $htmlname, $value, $object, $perm, $typeofdata='str
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');
Expand Down
5 changes: 3 additions & 2 deletions htdocs/core/db/pgsql.class.php
Expand Up @@ -210,7 +210,8 @@ static function convertSQLFromMysql($line,$type='auto',$unescapeslashquot=0)

// 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);

Expand Down Expand Up @@ -875,7 +876,7 @@ function errno()
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',
Expand Down
2 changes: 1 addition & 1 deletion htdocs/install/mysql/migration/3.4.0-3.5.0.sql
Expand Up @@ -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;
2 changes: 1 addition & 1 deletion htdocs/install/mysql/tables/llx_societe_rib.sql
Expand Up @@ -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


Expand Down

0 comments on commit 5b243ab

Please sign in to comment.