Merge branch '3.5' of git@github.com:Dolibarr/dolibarr.git into 3.5

This commit is contained in:
Laurent Destailleur 2014-05-21 19:45:28 +02:00
commit b146dcad31
20 changed files with 43 additions and 40 deletions

View File

@ -26,6 +26,7 @@ Fix: [ bug #1381 ] PHP Warning when listing stock transactions page.
Fix: [ bug #1367 ] "Show invoice" link after a POS sell throws an error.
Fix: TCPDF error file not found in member card generation.
Fix: [ bug #1380 ] Customer invoices are not grouped in company results report.
Fix: [ bug #1393 ] PHP Warning when creating a supplier invoice.
***** ChangeLog for 3.5.2 compared to 3.5.1 *****
Fix: Can't add user for a task.

View File

@ -57,7 +57,7 @@ if ($action == 'add')
$db->begin();
// Initialize distinctfkuser with all already existing values of fk_user (user that use a personalized view of boxes for pos)
// Initialize distinct fkuser with all already existing values of fk_user (user that use a personalized view of boxes for page "pos")
$distinctfkuser=array();
if (! $error)
{
@ -85,14 +85,31 @@ if ($action == 'add')
}
}
$distinctfkuser['0']='0'; // Add entry for fk_user = 0. We must use string as key and val
foreach($distinctfkuser as $fk_user)
{
if (! $error && $fk_user != 0) // We will add fk_user = 0 later.
if (! $error && $fk_user != '')
{
$nbboxonleft=$nbboxonright=0;
$sql = "SELECT box_order FROM ".MAIN_DB_PREFIX."boxes WHERE position = ".GETPOST("pos","alpha")." AND fk_user = ".$fk_user." AND entity = ".$conf->entity;
dol_syslog("boxes.php activate box sql=".$sql);
$resql = $db->query($sql);
if ($resql)
{
while($obj = $db->fetch_object($resql))
{
$boxorder=$obj->box_order;
if (preg_match('/A/',$boxorder)) $nbboxonleft++;
if (preg_match('/B/',$boxorder)) $nbboxonright++;
}
}
else dol_print_error($db);
$sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes (";
$sql.= "box_id, position, box_order, fk_user, entity";
$sql.= ") values (";
$sql.= GETPOST("boxid","int").", ".GETPOST("pos","alpha").", 'A01', ".$fk_user.", ".$conf->entity;
$sql.= GETPOST("boxid","int").", ".GETPOST("pos","alpha").", '".(($nbboxonleft > $nbboxonright) ? 'B01' : 'A01')."', ".$fk_user.", ".$conf->entity;
$sql.= ")";
dol_syslog("boxes.php activate box sql=".$sql);
@ -105,24 +122,6 @@ if ($action == 'add')
}
}
// If value 0 was not included, we add it.
if (! $error)
{
$sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes (";
$sql.= "box_id, position, box_order, fk_user, entity";
$sql.= ") values (";
$sql.= GETPOST("boxid","int").", ".GETPOST("pos","alpha").", 'A01', 0, ".$conf->entity;
$sql.= ")";
dol_syslog("boxes.php activate box sql=".$sql);
$resql = $db->query($sql);
if (! $resql)
{
$errmesg=$db->lasterror();
$error++;
}
}
if (! $error)
{
header("Location: boxes.php");

View File

@ -2516,7 +2516,7 @@ class Commande extends CommonOrder
$this->nbtodo=$this->nbtodolate=0;
$clause = " WHERE";
$sql = "SELECT c.rowid, c.date_creation as datec, c.fk_statut";
$sql = "SELECT c.rowid, c.date_creation as datec, c.date_livraison as delivery_date, c.fk_statut";
$sql.= " FROM ".MAIN_DB_PREFIX."commande as c";
if (!$user->rights->societe->client->voir && !$user->societe_id)
{
@ -2535,7 +2535,9 @@ class Commande extends CommonOrder
while ($obj=$this->db->fetch_object($resql))
{
$this->nbtodo++;
if ($obj->fk_statut != 3 && $this->db->jdate($obj->datec) < ($now - $conf->commande->client->warning_delay)) $this->nbtodolate++;
$date_to_test = empty($obj->delivery_date) ? $obj->datec : $obj->delivery_date;
if ($obj->fk_statut != 3 && $this->db->jdate($date_to_test) < ($now - $conf->commande->client->warning_delay)) $this->nbtodolate++;
}
return 1;
}

View File

@ -203,8 +203,8 @@ class Expedition extends CommonObject
$sql.= ") VALUES (";
$sql.= "'(PROV)'";
$sql.= ", ".$conf->entity;
$sql.= ", ".($this->ref_customer?"'".$this->ref_customer."'":"null");
$sql.= ", ".($this->ref_int?"'".$this->ref_int."'":"null");
$sql.= ", ".($this->ref_customer?"'".$this->db->escape($this->ref_customer)."'":"null");
$sql.= ", ".($this->ref_int?"'".$this->db->escape($this->ref_int)."'":"null");
$sql.= ", '".$this->db->idate($now)."'";
$sql.= ", ".$user->id;
$sql.= ", ".($this->date_expedition>0?"'".$this->db->idate($this->date_expedition)."'":"null");

View File

@ -461,6 +461,7 @@ elseif ($action == 'add' && $user->rights->fournisseur->facture->creer)
$db->commit();
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs;
$result=supplier_invoice_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result <= 0)
{

View File

@ -336,4 +336,4 @@ class CategorieTest extends PHPUnit_Framework_TestCase
}
}
?>
?>

View File

@ -233,4 +233,4 @@ class CompanyBankAccountTest extends PHPUnit_Framework_TestCase
}
}
?>
?>

View File

@ -297,4 +297,4 @@ class CoreTest extends PHPUnit_Framework_TestCase
$this->assertEquals($result,$expectedresult);
}
}
?>
?>

View File

@ -199,4 +199,4 @@ class DateLibTzFranceTest extends PHPUnit_Framework_TestCase
}
}
?>
?>

View File

@ -265,4 +265,4 @@ class ExportTest extends PHPUnit_Framework_TestCase
return true;
}
}
?>
?>

View File

@ -329,4 +329,4 @@ class FactureTest extends PHPUnit_Framework_TestCase
return $retAr;
}
}
?>
?>

View File

@ -333,4 +333,4 @@ class FactureTestRounding extends PHPUnit_Framework_TestCase
}
}
?>
?>

View File

@ -134,4 +134,4 @@ class ImportTest extends PHPUnit_Framework_TestCase
}
}
?>
?>

View File

@ -170,4 +170,4 @@ class JsonLibTest extends PHPUnit_Framework_TestCase
}
}
?>
?>

View File

@ -146,4 +146,4 @@ class ModulesTest extends PHPUnit_Framework_TestCase
}
}
?>
?>

View File

@ -287,4 +287,4 @@ class PropalTest extends PHPUnit_Framework_TestCase
}
}
?>
?>

View File

@ -176,4 +176,4 @@ class WebservicesInvoicesTest extends PHPUnit_Framework_TestCase
}
}
?>
?>

View File

@ -175,4 +175,4 @@ class WebservicesOrdersTest extends PHPUnit_Framework_TestCase
}
}
?>
?>

View File

@ -176,4 +176,4 @@ class WebservicesOtherTest extends PHPUnit_Framework_TestCase
}
}
?>
?>

View File

@ -176,4 +176,4 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase
}
}
?>
?>