Merge remote-tracking branch 'origin/3.4' into develop

Conflicts:
	htdocs/cache.manifest
	htdocs/install/mysql/migration/3.3.0-3.4.0.sql
This commit is contained in:
Laurent Destailleur 2013-05-27 12:57:57 +02:00
commit b61ca887d5
5 changed files with 56 additions and 4 deletions

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

@ -378,4 +378,6 @@ 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

@ -21,6 +21,7 @@ create table llx_fichinterdet
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_fichinter integer,
fk_parent_line integer NULL,
date datetime, -- date de la ligne d'intervention
description text, -- description de la ligne d'intervention
duree integer, -- duree de la ligne d'intervention

View File

@ -79,7 +79,7 @@ CronHourStart= Start Hour and date of task
CronEvery= And execute task each
CronObject= Instance/Object to create
CronArgs=Parameters
CronSaveSucess=Save succefully
CronSaveSucess=Save succesfully
CronNote=Comment
CronFieldMandatory=Fields %s is mandatory
CronErrEndDateStartDt=End date cannot be before start date
@ -109,4 +109,4 @@ CronType=Task type
CronType_method=Call method of a Dolibarr Class
CronType_command=Shell command
CronMenu=Cron
CronCannotLoadClass=Cannot load class %s or object %s
CronCannotLoadClass=Cannot load class %s or object %s