Conflicts:
	htdocs/install/mysql/migration/3.3.0-3.4.0.sql

Change-Id: I1754b68e9acdf1c7e6024afe95d9ded8e0726b41
This commit is contained in:
Florian Henry 2013-05-25 20:58:02 +02:00
commit 557756058f
8 changed files with 66 additions and 11 deletions

View File

@ -392,7 +392,7 @@ class Adherent extends CommonObject
$nbrowsaffected=0;
$error=0;
dol_syslog(get_class($this)."::update notrigger=".$notrigger.", nosyncuser=".$nosyncuser.", nosyncuserpass=".$nosyncuserpass.", email=".$this->email);
dol_syslog(get_class($this)."::update notrigger=".$notrigger.", nosyncuser=".$nosyncuser.", nosyncuserpass=".$nosyncuserpass." nosyncthirdparty=".$nosyncthirdparty.", email=".$this->email);
// Clean parameters
$this->lastname=trim($this->lastname)?trim($this->lastname):trim($this->lastname);
@ -1013,7 +1013,7 @@ class Adherent extends CommonObject
{
global $langs;
$sql = "SELECT d.rowid, d.civilite, d.firstname, d.lastname, d.societe as company, d.fk_soc, d.statut, d.public, d.address, d.zip, d.town, d.note,";
$sql = "SELECT d.rowid, d.ref_ext, d.civilite, d.firstname, d.lastname, d.societe as company, d.fk_soc, d.statut, d.public, d.address, d.zip, d.town, d.note,";
$sql.= " d.email, d.phone, d.phone_perso, d.phone_mobile, d.login, d.pass,";
$sql.= " d.photo, d.fk_adherent_type, d.morphy, d.entity,";
$sql.= " d.datec as datec,";
@ -1050,6 +1050,7 @@ class Adherent extends CommonObject
$this->entity = $obj->entity;
$this->ref = $obj->rowid;
$this->id = $obj->rowid;
$this->ref_ext = $obj->ref_ext;
$this->civilite_id = $obj->civilite;
$this->firstname = $obj->firstname;
$this->lastname = $obj->lastname;

View File

@ -432,7 +432,7 @@ else if ($action == 'addline' && $user->rights->contrat->creer)
}
$desc = $prod->description;
$desc.= $prod->description && GETPOST('desc') ? "\n" : "";
$desc.= $prod->description && GETPOST('np_desc') ? "\n" : "";
$desc.= GETPOST('np_desc');
}
else

View File

@ -659,7 +659,7 @@ class FactureFournisseur extends CommonInvoice
}
}
}
// Remove extrafields
if ((! $error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used
{
@ -855,6 +855,45 @@ class FactureFournisseur extends CommonInvoice
}
}
if (! $error)
{
$this->oldref = '';
// Rename directory if dir was a temporary ref
if (preg_match('/^[\(]?PROV/i', $this->ref))
{
// On renomme repertoire facture ($this->ref = ancienne ref, $num = nouvelle ref)
// afin de ne pas perdre les fichiers attaches
$facref = dol_sanitizeFileName($this->ref);
$snumfa = dol_sanitizeFileName($num);
$dirsource = $conf->fournisseur->facture->dir_output.'/'.get_exdir($this->id,2).$facref;
$dirdest = $conf->fournisseur->facture->dir_output.'/'.get_exdir($this->id,2).$snumfa;
if (file_exists($dirsource))
{
dol_syslog(get_class($this)."::validate rename dir ".$dirsource." into ".$dirdest);
if (@rename($dirsource, $dirdest))
{
$this->oldref = $facref;
dol_syslog("Rename ok");
// Suppression ancien fichier PDF dans nouveau rep
dol_delete_file($conf->fournisseur->facture->dir_output.'/'.get_exdir($this->id,2).$snumfa.'/'.$facref.'*.*');
}
}
}
}
// Set new ref and define current statut
if (! $error)
{
$this->ref = $num;
$this->statut=1;
//$this->date_validation=$now; this is stored into log table
}
// Triggers call
if (! $error)
{
// Appel des triggers

View File

@ -114,8 +114,18 @@ elseif ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->fourni
$object->fetch($id);
$object->fetch_thirdparty();
$qualified_for_stock_change=0;
if (empty($conf->global->STOCK_SUPPORTS_SERVICES))
{
$qualified_for_stock_change=$object->hasProductsOrServices(2);
}
else
{
$qualified_for_stock_change=$object->hasProductsOrServices(1);
}
// Check parameters
if (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) && $object->hasProductsOrServices(1))
if (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) && $qualified_for_stock_change)
{
$langs->load("stocks");
if (! $idwarehouse || $idwarehouse == -1)

View File

@ -256,6 +256,7 @@ CREATE TABLE llx_printer_ipp
) ENGINE=innodb;
ALTER TABLE llx_socpeople ADD COLUMN ref_ext varchar(128) after entity;
ALTER TABLE llx_adherent MODIFY COLUMN ref_ext varchar(128);
create table llx_commande_extrafields
(
@ -377,4 +378,7 @@ ALTER TABLE llx_facture_fourn_extrafields ADD INDEX idx_facture_fourn_extrafield
ALTER TABLE llx_user_clicktodial ADD COLUMN url varchar(255) AFTER fk_user;
ALTER TABLE llx_fichinterdet ADD COLUMN fk_parent_line integer NULL AFTER fk_fichinter;
ALTER TABLE llx_societe_address CHANGE COLUMN tel phone varchar(20);

View File

@ -28,7 +28,7 @@ create table llx_adherent
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1 NOT NULL, -- multi company id
ref_ext varchar(30), -- reference into an external system (not used by dolibarr)
ref_ext varchar(128), -- reference into an external system (not used by dolibarr)
civilite varchar(6),
lastname varchar(50),

View File

@ -1,6 +1,6 @@
-- ========================================================================
-- Copyright (C) 2000-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2005-2010 Houssin Regis <regis.houssin@capnetworks.com>
-- Copyright (C) 2005-2013 Houssin Regis <regis.houssin@capnetworks.com>
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
@ -29,7 +29,7 @@ create table llx_societe_address
zip varchar(10), -- zipcode
town varchar(50), -- town
fk_pays integer DEFAULT 0, --
tel varchar(20), -- phone number
phone varchar(20), -- phone number
fax varchar(20), -- fax number
note text, --
fk_user_creat integer,

View File

@ -588,13 +588,14 @@ class Societe extends CommonObject
if ($result > 0)
{
$lmember->firstname=$this->firstname;
$lmember->lastname=$this->lastname;
$lmember->societe=$this->name;
//$lmember->firstname=$this->firstname?$this->firstname:$lmember->firstname; // We keep firstname and lastname of member unchanged
//$lmember->lastname=$this->lastname?$this->lastname:$lmember->lastname; // We keep firstname and lastname of member unchanged
$lmember->address=$this->address;
$lmember->email=$this->email;
$lmember->phone=$this->phone;
$result=$lmember->update($user,0,1,1); // Use nosync to 1 to avoid cyclic updates
$result=$lmember->update($user,0,1,1,1); // Use nosync to 1 to avoid cyclic updates
if ($result < 0)
{
$this->error=$lmember->error;