Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
9df57875ce
@ -336,11 +336,9 @@ if ($nboftargetok) {
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/license.txt`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/PHPExcel/Shared/PDF`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/PHPExcel/Shared/PCLZip`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-2.33`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/freefont-20100919`;
|
||||
#$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-2.33`;
|
||||
#$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/freefont-20100919`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/utils`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/free*.ctg.z`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/free*.z`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/LICENSE.TXT`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/jstree`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/langs/*/html`;
|
||||
@ -652,7 +650,6 @@ if ($nboftargetok) {
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/rpm`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/zip`;
|
||||
# We remove embedded libraries or fonts
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/htdocs/includes/artichow/font`,
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/htdocs/includes/fonts`,
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/htdocs/includes/geoip`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/htdocs/includes/odtphp/zip/pclzip`;
|
||||
@ -767,7 +764,8 @@ if ($nboftargetok) {
|
||||
next;
|
||||
}
|
||||
|
||||
if ($target eq 'APS') {
|
||||
if ($target eq 'APS')
|
||||
{
|
||||
$NEWDESTI=$DESTI;
|
||||
if (-d $DESTI.'/package_aps') { $NEWDESTI=$DESTI.'/package_aps'; }
|
||||
|
||||
|
||||
@ -105,6 +105,7 @@ cui hai bisogno ed essere facile da usare.
|
||||
%{__cp} -pr scripts $RPM_BUILD_ROOT%{_datadir}/%{name}
|
||||
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/adodbtime
|
||||
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/nusoap
|
||||
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/fonts
|
||||
|
||||
# Lang
|
||||
for i in $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/langs/*_*
|
||||
|
||||
@ -102,6 +102,7 @@ cui hai bisogno ed essere facile da usare.
|
||||
%{__cp} -pr build/tgz/* $RPM_BUILD_ROOT%{_datadir}/%{name}/build/tgz
|
||||
%{__cp} -pr htdocs $RPM_BUILD_ROOT%{_datadir}/%{name}
|
||||
%{__cp} -pr scripts $RPM_BUILD_ROOT%{_datadir}/%{name}
|
||||
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/fonts
|
||||
|
||||
# Lang
|
||||
for i in $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/langs/*_*
|
||||
|
||||
@ -101,6 +101,7 @@ cui hai bisogno ed essere facile da usare.
|
||||
%{__cp} -pr build/tgz/* $RPM_BUILD_ROOT%{_datadir}/%{name}/build/tgz
|
||||
%{__cp} -pr htdocs $RPM_BUILD_ROOT%{_datadir}/%{name}
|
||||
%{__cp} -pr scripts $RPM_BUILD_ROOT%{_datadir}/%{name}
|
||||
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/fonts
|
||||
|
||||
# Lang
|
||||
for i in $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/langs/*_*
|
||||
|
||||
@ -41,12 +41,11 @@ class BoutiqueCommande
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $DB Database handler
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
function BoutiqueCommande($DB)
|
||||
function BoutiqueCommande($db)
|
||||
{
|
||||
$this->db = $DB;
|
||||
$this->id = $id;
|
||||
$this->db = $db;
|
||||
|
||||
$this->billing_adr = new Address();
|
||||
$this->delivry_adr = new Address();
|
||||
@ -107,7 +106,8 @@ class BoutiqueCommande
|
||||
if ( $result )
|
||||
{
|
||||
$num = $this->db->num_rows($result);
|
||||
|
||||
|
||||
$i=0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$array = $this->db->fetch_array($result);
|
||||
|
||||
@ -41,12 +41,11 @@ class Promotion
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $DB Database handler
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
function Promotion($DB)
|
||||
function Promotion($db)
|
||||
{
|
||||
$this->db = $DB;
|
||||
$this->id = $id;
|
||||
$this->db = $db;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -121,15 +121,18 @@ class Categorie
|
||||
/**
|
||||
* Add category into database
|
||||
*
|
||||
* @return int -1 : erreur SQL
|
||||
* -2 : nouvel ID inconnu
|
||||
* -3 : categorie invalide
|
||||
* @param User $user Object user
|
||||
* @return int -1 : erreur SQL
|
||||
* -2 : nouvel ID inconnu
|
||||
* -3 : categorie invalide
|
||||
*/
|
||||
function create()
|
||||
function create($user='')
|
||||
{
|
||||
global $conf,$langs;
|
||||
$langs->load('categories');
|
||||
|
||||
$error=0;
|
||||
|
||||
// Clean parameters
|
||||
if (empty($this->visible)) $this->visible=0;
|
||||
$this->parentId = ($this->id_mere) != "" ? intval($this->id_mere) : 0;
|
||||
@ -201,14 +204,17 @@ class Categorie
|
||||
/**
|
||||
* Update category
|
||||
*
|
||||
* @return int 1 : OK
|
||||
* -1 : SQL error
|
||||
* -2 : invalid category
|
||||
* @param User $user Object user
|
||||
* @return int 1 : OK
|
||||
* -1 : SQL error
|
||||
* -2 : invalid category
|
||||
*/
|
||||
function update()
|
||||
function update($user='')
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
$error=0;
|
||||
|
||||
// Clean parameters
|
||||
$this->label=trim($this->label);
|
||||
$this->description=trim($this->description);
|
||||
@ -879,12 +885,12 @@ class Categorie
|
||||
$sql.= " AND c.label='".$this->db->escape($this->label)."'";
|
||||
}
|
||||
dol_syslog("Categorie::already_exists sql=".$sql);
|
||||
$res = $this->db->query($sql);
|
||||
if ($res)
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
if($this->db->num_rows($resql) > 0) // Checking for empty resql
|
||||
if ($this->db->num_rows($resql) > 0) // Checking for empty resql
|
||||
{
|
||||
$obj = $this->db->fetch_array($res);
|
||||
$obj = $this->db->fetch_array($resql);
|
||||
/* If object called create, obj cannot have is id.
|
||||
* If object called update, he mustn't have the same label as an other category for this mother.
|
||||
* So if the result have the same id, update is not for label, and if result have an other one,
|
||||
|
||||
@ -381,7 +381,6 @@ class Propal extends CommonObject
|
||||
$this->line->subprice=$pu_ht;
|
||||
$this->line->rang=$rangtouse;
|
||||
$this->line->info_bits=$info_bits;
|
||||
$this->line->fk_remise_except=$fk_remise_except;
|
||||
$this->line->total_ht=$total_ht;
|
||||
$this->line->total_tva=$total_tva;
|
||||
$this->line->total_localtax1=$total_localtax1;
|
||||
@ -1149,6 +1148,7 @@ class Propal extends CommonObject
|
||||
{
|
||||
global $conf,$langs;
|
||||
|
||||
$error=0;
|
||||
$now=dol_now();
|
||||
|
||||
if ($user->rights->propale->valider)
|
||||
@ -1477,7 +1477,8 @@ class Propal extends CommonObject
|
||||
global $langs,$conf;
|
||||
|
||||
$this->statut = $statut;
|
||||
|
||||
$error=0;
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."propal";
|
||||
@ -2536,13 +2537,17 @@ class PropaleLigne
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Insert object line propal in database
|
||||
* \return int <0 if KO, >0 if OK
|
||||
* Insert object line propal in database
|
||||
*
|
||||
* @param int $notrigger 1=no trigger ran
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function insert($notrigger=0)
|
||||
{
|
||||
global $conf,$langs,$user;
|
||||
|
||||
$error=0;
|
||||
|
||||
dol_syslog("PropaleLigne::insert rang=".$this->rang);
|
||||
|
||||
// Clean parameters
|
||||
@ -2599,8 +2604,6 @@ class PropaleLigne
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$this->rang=$rangmax;
|
||||
|
||||
$this->rowid=$this->db->last_insert_id(MAIN_DB_PREFIX.'propaldet');
|
||||
if (! $notrigger)
|
||||
{
|
||||
@ -2632,6 +2635,7 @@ class PropaleLigne
|
||||
{
|
||||
global $conf,$langs,$user;
|
||||
|
||||
$error=0;
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."propaldet WHERE rowid = ".$this->rowid;
|
||||
@ -2667,6 +2671,8 @@ class PropaleLigne
|
||||
{
|
||||
global $conf,$langs,$user;
|
||||
|
||||
$error=0;
|
||||
|
||||
// Clean parameters
|
||||
if (empty($this->tva_tx)) $this->tva_tx=0;
|
||||
if (empty($this->localtax1_tx)) $this->localtax1_tx=0;
|
||||
|
||||
@ -99,15 +99,13 @@ class Commande extends CommonObject
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $DB Database handler
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
function Commande($DB)
|
||||
function Commande($db)
|
||||
{
|
||||
global $langs;
|
||||
$langs->load('orders');
|
||||
$this->db = $DB;
|
||||
$this->socid = $socid;
|
||||
$this->id = $commandeid;
|
||||
$this->db = $db;
|
||||
|
||||
$this->remise = 0;
|
||||
$this->remise_percent = 0;
|
||||
@ -447,9 +445,10 @@ class Commande extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* Close order
|
||||
* @param user Objet user that close
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* Close order
|
||||
*
|
||||
* @param user Objet user that close
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function cloture($user)
|
||||
{
|
||||
@ -501,13 +500,15 @@ class Commande extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Cancel an order
|
||||
* \return int <0 if KO, >0 if OK
|
||||
* \remarks If stock is decremented on order validation, we must reincrement it
|
||||
* Cancel an order
|
||||
* If stock is decremented on order validation, we must reincrement it
|
||||
*
|
||||
* @param int $idwarehouse Id warehouse to use for stock change.
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function cancel($user)
|
||||
function cancel($user, $idwarehouse=-1)
|
||||
{
|
||||
global $conf;
|
||||
global $conf,$langs;
|
||||
|
||||
$error=0;
|
||||
|
||||
@ -526,17 +527,20 @@ class Commande extends CommonObject
|
||||
// If stock is decremented on validate order, we must reincrement it
|
||||
if ($conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1)
|
||||
{
|
||||
require_once(DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php");
|
||||
$langs->load("agenda");
|
||||
|
||||
if ($this->lines[$i]->fk_product > 0)
|
||||
{
|
||||
$mouvP = new MouvementStock($this->db);
|
||||
// We increment stock of product (and sub-products)
|
||||
$entrepot_id = "1"; //Todo: ajouter possibilite de choisir l'entrepot
|
||||
$result=$mouvP->reception($user, $this->lines[$i]->fk_product, $entrepot_id, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("OrderCanceledInDolibarr",$this->ref));
|
||||
if ($result < 0) { $error++; }
|
||||
}
|
||||
require_once(DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php");
|
||||
$langs->load("agenda");
|
||||
|
||||
$num=count($this->lines);
|
||||
for ($i = 0; $i < $num; $i++)
|
||||
{
|
||||
if ($this->lines[$i]->fk_product > 0)
|
||||
{
|
||||
$mouvP = new MouvementStock($this->db);
|
||||
// We increment stock of product (and sub-products)
|
||||
$result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("OrderCanceledInDolibarr",$this->ref));
|
||||
if ($result < 0) { $error++; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
@ -604,7 +608,6 @@ class Commande extends CommonObject
|
||||
dol_syslog("Commande::create ".$this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
if (! $remise) $remise=0;
|
||||
if (! $this->fk_project) $this->fk_project = 0;
|
||||
|
||||
// $date_commande is deprecated
|
||||
@ -1299,14 +1302,14 @@ class Commande extends CommonObject
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_syslog('Commande::Fetch Error rowid='.$rowid.' numrows=0 sql='.$sql);
|
||||
$this->error='Order with id '.$rowid.' not found sql='.$sql;
|
||||
dol_syslog('Commande::Fetch Error rowid='.$id.' numrows=0 sql='.$sql);
|
||||
$this->error='Order with id '.$id.' not found sql='.$sql;
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_syslog('Commande::Fetch Error rowid='.$rowid.' Erreur dans fetch de la commande');
|
||||
dol_syslog('Commande::Fetch Error rowid='.$id.' Erreur dans fetch de la commande');
|
||||
$this->error=$this->db->error();
|
||||
return -1;
|
||||
}
|
||||
@ -2194,8 +2197,8 @@ class Commande extends CommonObject
|
||||
$qty=price2num($qty);
|
||||
$pu = price2num($pu);
|
||||
$txtva=price2num($txtva);
|
||||
$txlocaltax1=price2num($txtlocaltax1);
|
||||
$txlocaltax2=price2num($txtlocaltax2);
|
||||
$txlocaltax1=price2num($txlocaltax1);
|
||||
$txlocaltax2=price2num($txlocaltax2);
|
||||
|
||||
// Calcul du total TTC et de la TVA pour la ligne a partir de
|
||||
// qty, pu, remise_percent et txtva
|
||||
@ -2287,15 +2290,16 @@ class Commande extends CommonObject
|
||||
|
||||
/**
|
||||
* Delete the customer order
|
||||
* @param user User object
|
||||
* @return int <=0 if KO, >0 if OK
|
||||
*
|
||||
* @param User $user User object
|
||||
* @return int <=0 if KO, >0 if OK
|
||||
*/
|
||||
function delete($user)
|
||||
{
|
||||
global $conf, $langs;
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
|
||||
|
||||
$err = 0;
|
||||
$error = 0;
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
@ -2305,7 +2309,7 @@ class Commande extends CommonObject
|
||||
if (! $this->db->query($sql) )
|
||||
{
|
||||
dol_syslog("CustomerOrder::delete error", LOG_ERR);
|
||||
$err++;
|
||||
$error++;
|
||||
}
|
||||
|
||||
// Delete order
|
||||
@ -2314,7 +2318,7 @@ class Commande extends CommonObject
|
||||
if (! $this->db->query($sql) )
|
||||
{
|
||||
dol_syslog("CustomerOrder::delete error", LOG_ERR);
|
||||
$err++;
|
||||
$error++;
|
||||
}
|
||||
|
||||
// Delete linked object
|
||||
@ -2326,7 +2330,7 @@ class Commande extends CommonObject
|
||||
if (! $this->db->query($sql) )
|
||||
{
|
||||
dol_syslog("CustomerOrder::delete error", LOG_ERR);
|
||||
$err++;
|
||||
$error++;
|
||||
}
|
||||
|
||||
// Delete linked contacts
|
||||
@ -2334,7 +2338,7 @@ class Commande extends CommonObject
|
||||
if ($res < 0)
|
||||
{
|
||||
dol_syslog("CustomerOrder::delete error", LOG_ERR);
|
||||
$err++;
|
||||
$error++;
|
||||
}
|
||||
|
||||
// On efface le repertoire de pdf provisoire
|
||||
@ -2365,7 +2369,7 @@ class Commande extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
if ($err == 0)
|
||||
if ($error == 0)
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
|
||||
@ -2387,6 +2391,7 @@ class Commande extends CommonObject
|
||||
|
||||
/**
|
||||
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
|
||||
*
|
||||
* @param user Objet user
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
@ -2935,6 +2940,8 @@ class OrderLine
|
||||
{
|
||||
global $conf, $user, $langs;
|
||||
|
||||
$error=0;
|
||||
|
||||
$sql = 'DELETE FROM '.MAIN_DB_PREFIX."commandedet WHERE rowid='".$this->rowid."';";
|
||||
|
||||
dol_syslog("OrderLine::delete sql=".$sql);
|
||||
@ -2968,6 +2975,8 @@ class OrderLine
|
||||
{
|
||||
global $langs, $conf, $user;
|
||||
|
||||
$error=0;
|
||||
|
||||
dol_syslog("OrderLine::insert rang=".$this->rang);
|
||||
|
||||
// Clean parameters
|
||||
@ -3065,6 +3074,8 @@ class OrderLine
|
||||
{
|
||||
global $conf,$langs,$user;
|
||||
|
||||
$error=0;
|
||||
|
||||
// Clean parameters
|
||||
if (empty($this->tva_tx)) $this->tva_tx=0;
|
||||
if (empty($this->localtax1_tx)) $this->localtax1_tx=0;
|
||||
|
||||
@ -864,7 +864,6 @@ class Account extends CommonObject
|
||||
{
|
||||
$this->nbtodo++;
|
||||
if ($this->db->jdate($obj->datefin) < ($now - $conf->bank->rappro->warning_delay)) $this->nbtodolate++;
|
||||
if ($obj->rappro) $foundaccounttoconciliate++;
|
||||
}
|
||||
return $num;
|
||||
}
|
||||
|
||||
@ -182,8 +182,8 @@ class Don extends CommonObject
|
||||
$this->specimen=1;
|
||||
$this->nom = 'Doe';
|
||||
$this->prenom = 'John';
|
||||
$this->socid = $socids[$socid];
|
||||
$this->date = time();
|
||||
$this->socid = 1;
|
||||
$this->date = dol_now();
|
||||
$this->amount = 100;
|
||||
$this->public = 1;
|
||||
$this->societe = 'The Company';
|
||||
|
||||
@ -190,9 +190,10 @@ class FactureRec extends Facture
|
||||
|
||||
|
||||
/**
|
||||
* \brief Recupere l'objet facture et ses lignes de factures
|
||||
* \param rowid id de la facture a recuperer
|
||||
* \return int >0 si ok, <0 si ko
|
||||
* Recupere l'objet facture et ses lignes de factures
|
||||
*
|
||||
* @param int $rowid Id de la facture a recuperer
|
||||
* @return int >0 si ok, <0 si ko
|
||||
*/
|
||||
function fetch($rowid)
|
||||
{
|
||||
@ -209,7 +210,7 @@ class FactureRec extends Facture
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON el.fk_target = f.rowid AND el.targettype = 'facture'"; // TODO remplacer par une fonction
|
||||
$sql.= ' WHERE f.rowid='.$rowid;
|
||||
|
||||
dol_syslog("FactureRec::Fetch rowid=".$rowid.", societe_id=".$socid." sql=".$sql, LOG_DEBUG);
|
||||
dol_syslog("FactureRec::Fetch rowid=".$rowid." sql=".$sql, LOG_DEBUG);
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
@ -404,7 +405,9 @@ class FactureRec extends Facture
|
||||
|
||||
|
||||
/**
|
||||
* \brief Add a line to invoice
|
||||
* Add a line to invoice
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function addline($facid, $desc, $pu_ht, $qty, $txtva, $fk_product=0, $remise_percent=0, $price_base_type='HT', $info_bits=0, $fk_remise_except='', $pu_ttc=0, $type=0, $rang=-1, $special_code=0)
|
||||
{
|
||||
@ -420,7 +423,6 @@ class FactureRec extends Facture
|
||||
$remise_percent=price2num($remise_percent);
|
||||
$qty=price2num($qty);
|
||||
if (! $qty) $qty=1;
|
||||
if (! $ventil) $ventil=0;
|
||||
if (! $info_bits) $info_bits=0;
|
||||
$pu_ht=price2num($pu_ht);
|
||||
$pu_ttc=price2num($pu_ttc);
|
||||
|
||||
@ -1395,6 +1395,8 @@ class Facture extends CommonObject
|
||||
{
|
||||
global $conf,$langs;
|
||||
|
||||
$error=0;
|
||||
|
||||
dol_syslog(get_class($this)."::set_canceled rowid=".$this->id, LOG_DEBUG);
|
||||
|
||||
$this->db->begin();
|
||||
@ -1515,7 +1517,7 @@ class Facture extends CommonObject
|
||||
$result=$facreplaced->set_canceled($user,'replaced','');
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->error=$facreplaced->error." sql=".$sql;
|
||||
$this->error=$facreplaced->error;
|
||||
$this->db->rollback();
|
||||
return -13;
|
||||
}
|
||||
@ -3420,6 +3422,8 @@ class FactureLigne
|
||||
{
|
||||
global $langs,$user,$conf;
|
||||
|
||||
$error=0;
|
||||
|
||||
dol_syslog(get_class($this)."::Insert rang=".$this->rang, LOG_DEBUG);
|
||||
|
||||
// Clean parameters
|
||||
@ -3562,12 +3566,16 @@ class FactureLigne
|
||||
/**
|
||||
* Update line into database
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @param User $user User object
|
||||
* @param int $notrigger Disable triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function update()
|
||||
function update($user='',$notrigger=0)
|
||||
{
|
||||
global $user,$langs,$conf;
|
||||
|
||||
$error=0;
|
||||
|
||||
// Clean parameters
|
||||
$this->desc=trim($this->desc);
|
||||
if (empty($this->tva_tx)) $this->tva_tx=0;
|
||||
@ -3651,6 +3659,8 @@ class FactureLigne
|
||||
{
|
||||
global $conf,$langs,$user;
|
||||
|
||||
$error=0;
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."facturedet WHERE rowid = ".$this->rowid;
|
||||
|
||||
@ -63,6 +63,8 @@ class localtax extends CommonObject
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
$error=0;
|
||||
|
||||
// Clean parameters
|
||||
$this->amount=trim($this->amount);
|
||||
$this->label=trim($this->label);
|
||||
@ -128,6 +130,8 @@ class localtax extends CommonObject
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
$error=0;
|
||||
|
||||
// Clean parameters
|
||||
$this->amount=trim($this->amount);
|
||||
$this->label=trim($this->label);
|
||||
@ -245,6 +249,8 @@ class localtax extends CommonObject
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
$error=0;
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."localtax";
|
||||
$sql.= " WHERE rowid=".$this->id;
|
||||
|
||||
@ -493,7 +499,7 @@ class localtax extends CommonObject
|
||||
|
||||
$acc = new Account($this->db);
|
||||
$result=$acc->fetch($this->accountid);
|
||||
if ($result <= 0) dol_print_error($db);
|
||||
if ($result <= 0) dol_print_error($this->db);
|
||||
|
||||
$bank_line_id = $acc->addline($this->datep, $this->paymenttype, $this->label, -abs($this->amount), '', '', $user);
|
||||
|
||||
|
||||
@ -471,6 +471,7 @@ class RemiseCheque extends CommonObject
|
||||
|
||||
/**
|
||||
* Build document
|
||||
*
|
||||
* @param model Model name
|
||||
* @param outputlangs Object langs
|
||||
* @return int <0 if KO, >0 if OK
|
||||
@ -493,7 +494,7 @@ class RemiseCheque extends CommonObject
|
||||
require_once($dir.$file);
|
||||
|
||||
$classname='BordereauCheque'.ucfirst($model);
|
||||
$docmodel = new $classname($db);
|
||||
$docmodel = new $classname($this->db);
|
||||
|
||||
$sql = "SELECT b.banque, b.emetteur, b.amount, b.num_chq";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
|
||||
@ -535,14 +536,14 @@ class RemiseCheque extends CommonObject
|
||||
$result=$docmodel->write_file($conf->banque->dir_output.'/bordereau', $this->number, $outputlangs);
|
||||
if ($result > 0)
|
||||
{
|
||||
$outputlangs->charset_output=$sav_charset_output;
|
||||
//$outputlangs->charset_output=$sav_charset_output;
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$outputlangs->charset_output=$sav_charset_output;
|
||||
//$outputlangs->charset_output=$sav_charset_output;
|
||||
dol_syslog("Error");
|
||||
dol_print_error($db,$docmodel->error);
|
||||
dol_print_error($this->db,$docmodel->error);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -320,7 +320,7 @@ class BonPrelevement extends CommonObject
|
||||
{
|
||||
global $user,$conf;
|
||||
|
||||
$error == 0;
|
||||
$error = 0;
|
||||
|
||||
if ($this->db->begin())
|
||||
{
|
||||
@ -401,7 +401,7 @@ class BonPrelevement extends CommonObject
|
||||
{
|
||||
global $conf,$langs;
|
||||
|
||||
$error == 0;
|
||||
$error = 0;
|
||||
|
||||
if ($this->_fetched == 1)
|
||||
{
|
||||
@ -525,7 +525,8 @@ class BonPrelevement extends CommonObject
|
||||
{
|
||||
global $conf,$langs;
|
||||
|
||||
$error == 0;
|
||||
$error = 0;
|
||||
|
||||
dol_syslog("bon-prelevement::set_infotrans Start",LOG_INFO);
|
||||
if ($this->db->begin())
|
||||
{
|
||||
|
||||
@ -74,8 +74,9 @@ class Tva extends CommonObject
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
$error=0;
|
||||
|
||||
// Clean parameters
|
||||
|
||||
$this->amount=trim($this->amount);
|
||||
$this->label=trim($this->label);
|
||||
$this->note=trim($this->note);
|
||||
@ -83,14 +84,11 @@ class Tva extends CommonObject
|
||||
$this->fk_user_creat=trim($this->fk_user_creat);
|
||||
$this->fk_user_modif=trim($this->fk_user_modif);
|
||||
|
||||
|
||||
|
||||
// Check parameters
|
||||
// Put here code to add control on parameters values
|
||||
|
||||
// Insert request
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."tva(";
|
||||
|
||||
$sql.= "tms,";
|
||||
$sql.= "datep,";
|
||||
$sql.= "datev,";
|
||||
@ -148,8 +146,9 @@ class Tva extends CommonObject
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
$error=0;
|
||||
|
||||
// Clean parameters
|
||||
|
||||
$this->amount=trim($this->amount);
|
||||
$this->label=trim($this->label);
|
||||
$this->note=trim($this->note);
|
||||
@ -157,8 +156,6 @@ class Tva extends CommonObject
|
||||
$this->fk_user_creat=trim($this->fk_user_creat);
|
||||
$this->fk_user_modif=trim($this->fk_user_modif);
|
||||
|
||||
|
||||
|
||||
// Check parameters
|
||||
// Put here code to add control on parameters values
|
||||
|
||||
@ -275,6 +272,8 @@ class Tva extends CommonObject
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
$error=0;
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."tva";
|
||||
$sql.= " WHERE rowid=".$this->id;
|
||||
|
||||
@ -522,7 +521,7 @@ class Tva extends CommonObject
|
||||
|
||||
$acc = new Account($this->db);
|
||||
$result=$acc->fetch($this->accountid);
|
||||
if ($result <= 0) dol_print_error($db);
|
||||
if ($result <= 0) dol_print_error($this->db);
|
||||
|
||||
$bank_line_id = $acc->addline($this->datep, $this->paymenttype, $this->label, -abs($this->amount), '', '', $user);
|
||||
|
||||
|
||||
@ -2,8 +2,9 @@
|
||||
# Dolibarr example for conf.php file
|
||||
#
|
||||
# Do not edit this file without changing its name.
|
||||
# This file is used by Dolibarr setup process to create true Dolibarr
|
||||
# config file called "conf.php".
|
||||
# This file is an example of empty config file for Dolibarr than can be used to create "conf.php".
|
||||
#
|
||||
# Warning: Be sure to not add line feed or spaces after closing php tag.
|
||||
#
|
||||
|
||||
|
||||
|
||||
@ -92,10 +92,11 @@ abstract class ActionsContactCardCommon
|
||||
/**
|
||||
* Load data control
|
||||
*
|
||||
* @param int $id Id of object
|
||||
* @param string &$action Type of action
|
||||
* @param int $id Id of object
|
||||
* @return void
|
||||
*/
|
||||
function doActions(&$action)
|
||||
function doActions(&$action, $id)
|
||||
{
|
||||
global $conf, $user, $langs;
|
||||
|
||||
@ -397,11 +398,7 @@ abstract class ActionsContactCardCommon
|
||||
include_once(DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php');
|
||||
$login=dol_buildlogin($this->object->nom, $this->object->prenom);
|
||||
|
||||
$generated_password='';
|
||||
if (! $ldap_sid)
|
||||
{
|
||||
$generated_password=getRandomPassword('');
|
||||
}
|
||||
$generated_password=getRandomPassword('');
|
||||
$password=$generated_password;
|
||||
|
||||
// Create a form array
|
||||
|
||||
@ -867,13 +867,13 @@ class Contact extends CommonObject
|
||||
|
||||
$code=$this->civilite_id;
|
||||
return $langs->trans("Civility".$code)!="Civility".$code ? $langs->trans("Civility".$code) : '';
|
||||
if (empty($ret))
|
||||
/*if (empty($ret))
|
||||
{
|
||||
$ret=$code;
|
||||
$langs->getLabelFromKey($db,$reg[1],'c_civilite','code','civilite');
|
||||
$langs->getLabelFromKey($this->db,$reg[1],'c_civilite','code','civilite');
|
||||
//$ret=dol_getIdFromCode($this->db,$code,'c_civilite',
|
||||
}
|
||||
return $ret;
|
||||
return $ret;*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -145,6 +145,8 @@ class Contrat extends CommonObject
|
||||
{
|
||||
global $langs,$conf;
|
||||
|
||||
$error=0;
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."contratdet SET statut = 4,";
|
||||
@ -191,6 +193,8 @@ class Contrat extends CommonObject
|
||||
{
|
||||
global $langs,$conf;
|
||||
|
||||
$error=0;
|
||||
|
||||
// statut actif : 4
|
||||
|
||||
$this->db->begin();
|
||||
@ -225,11 +229,12 @@ class Contrat extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* \brief Close all lines of a contract
|
||||
* \param user Object User making action
|
||||
* \param langs Object Lang
|
||||
* \param conf Object Conf
|
||||
*
|
||||
* Close all lines of a contract
|
||||
*
|
||||
* @param user Object User making action
|
||||
* @param langs Object Lang
|
||||
* @param conf Object Conf
|
||||
* @return void
|
||||
*/
|
||||
function cloture($user,$langs='',$conf='')
|
||||
{
|
||||
@ -268,7 +273,7 @@ class Contrat extends CommonObject
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db,'Error in cloture function');
|
||||
dol_print_error($this->db,'Error in cloture function');
|
||||
$this->db->rollback();
|
||||
}
|
||||
}
|
||||
@ -282,6 +287,8 @@ class Contrat extends CommonObject
|
||||
*/
|
||||
function validate($user,$langs,$conf)
|
||||
{
|
||||
$error=0;
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."contrat SET statut = 1";
|
||||
$sql .= " WHERE rowid = ".$this->id . " AND statut = 0";
|
||||
|
||||
@ -835,7 +842,6 @@ class Contrat extends CommonObject
|
||||
$remise_percent=price2num($remise_percent);
|
||||
$qty=price2num($qty);
|
||||
if (! $qty) $qty=1;
|
||||
if (! $ventil) $ventil=0;
|
||||
if (! $info_bits) $info_bits=0;
|
||||
if (! $pu_ht) $pu_ht=0;
|
||||
if (! $pu_ttc) $pu_ttc=0;
|
||||
@ -883,7 +889,7 @@ class Contrat extends CommonObject
|
||||
$sql.= " price_ht, remise"; // TODO A virer
|
||||
if ($date_start > 0) { $sql.= ",date_ouverture_prevue"; }
|
||||
if ($date_end > 0) { $sql.= ",date_fin_validite"; }
|
||||
$sql.= ") VALUES ($this->id, '" . $this->db->escape($label) . "','" . $this->db->escape($desc) . "',";
|
||||
$sql.= ") VALUES ($this->id, '', '" . $this->db->escape($desc) . "',";
|
||||
$sql.= ($fk_product>0 ? $fk_product : "null").",";
|
||||
$sql.= " '".$qty."',";
|
||||
$sql.= " '".$txtva."',";
|
||||
@ -1031,6 +1037,8 @@ class Contrat extends CommonObject
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
$error=0;
|
||||
|
||||
if ($this->statut >= 0)
|
||||
{
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."contratdet";
|
||||
@ -1105,9 +1113,9 @@ class Contrat extends CommonObject
|
||||
$langs->load("contracts");
|
||||
if ($mode == 0)
|
||||
{
|
||||
if ($statut == 0) { return $langs->trans("ContractStatusDraft").$text; }
|
||||
if ($statut == 1) { return $langs->trans("ContractStatusValidated").$text; }
|
||||
if ($statut == 2) { return $langs->trans("ContractStatusClosed").$text; }
|
||||
if ($statut == 0) { return $langs->trans("ContractStatusDraft"); }
|
||||
if ($statut == 1) { return $langs->trans("ContractStatusValidated"); }
|
||||
if ($statut == 2) { return $langs->trans("ContractStatusClosed"); }
|
||||
}
|
||||
if ($mode == 1)
|
||||
{
|
||||
@ -1762,6 +1770,8 @@ class ContratLigne
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
$error=0;
|
||||
|
||||
// Clean parameters
|
||||
$this->fk_contrat=trim($this->fk_contrat);
|
||||
$this->fk_product=trim($this->fk_product);
|
||||
|
||||
@ -43,13 +43,15 @@ class box_external_rss extends ModeleBoxes {
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
function box_external_rss($DB,$param)
|
||||
function box_external_rss($db,$param)
|
||||
{
|
||||
global $langs;
|
||||
$langs->load("boxes");
|
||||
|
||||
$this->db=$DB;
|
||||
$this->db=$db;
|
||||
$this->param=$param;
|
||||
|
||||
$this->boxlabel=$langs->trans("BoxLastRssInfos");
|
||||
@ -80,7 +82,7 @@ class box_external_rss extends ModeleBoxes {
|
||||
// Get RSS feed
|
||||
$url=@constant("EXTERNAL_RSS_URLRSS_".$site);
|
||||
|
||||
$rssparser=new RssParser($db);
|
||||
$rssparser=new RssParser($this->db);
|
||||
$result = $rssparser->parser($url, $this->max, $cachedelay, $conf->externalrss->dir_temp);
|
||||
|
||||
// INFO on channel
|
||||
|
||||
@ -500,7 +500,8 @@ class CMailFile
|
||||
|
||||
if (@is_writeable($dolibarr_main_data_root)) // Avoid fatal error on fopen with open_basedir
|
||||
{
|
||||
$fp = fopen($dolibarr_main_data_root."/dolibarr_mail.log","w");
|
||||
$outputfile=$dolibarr_main_data_root."/dolibarr_mail.log";
|
||||
$fp = fopen($outputfile,"w");
|
||||
|
||||
if ($conf->global->MAIN_MAIL_SENDMODE == 'mail')
|
||||
{
|
||||
|
||||
@ -198,7 +198,8 @@ class CSMSFile
|
||||
|
||||
if (@is_writeable($dolibarr_main_data_root)) // Avoid fatal error on fopen with open_basedir
|
||||
{
|
||||
$fp = fopen($dolibarr_main_data_root."/dolibarr_sms.log","w");
|
||||
$outputfile=$dolibarr_main_data_root."/dolibarr_sms.log";
|
||||
$fp = fopen($outputfile,"w");
|
||||
|
||||
fputs($fp, $this->message);
|
||||
|
||||
@ -218,7 +219,8 @@ class CSMSFile
|
||||
|
||||
if (@is_writeable($dolibarr_main_data_root)) // Avoid fatal error on fopen with open_basedir
|
||||
{
|
||||
$fp = fopen($dolibarr_main_data_root."/dolibarr_sms.log","a+");
|
||||
$outputfile=$dolibarr_main_data_root."/dolibarr_sms.log";
|
||||
$fp = fopen($outputfile,"a+");
|
||||
|
||||
fputs($fp, "\nResult id=".$result);
|
||||
|
||||
|
||||
@ -68,7 +68,7 @@ class AntiVir
|
||||
$return_var=0;
|
||||
$safemode=ini_get("safe_mode");
|
||||
// Create a clean fullcommand
|
||||
dol_syslog("AntiVir::dol_avscan_file Run command=".$fullcommand." with safe_mode ".($safe_mode?"on":"off"));
|
||||
dol_syslog("AntiVir::dol_avscan_file Run command=".$fullcommand." with safe_mode ".($safemode?"on":"off"));
|
||||
// Run CLI command. If run of Windows, you can get return with echo %ERRORLEVEL%
|
||||
$lastline=exec($fullcommand, $output, $return_var);
|
||||
|
||||
|
||||
@ -81,6 +81,8 @@ abstract class CommonObject
|
||||
{
|
||||
global $user,$conf,$langs;
|
||||
|
||||
$error=0;
|
||||
|
||||
dol_syslog(get_class($this)."::add_contact $fk_socpeople, $type_contact, $source");
|
||||
|
||||
// Check parameters
|
||||
@ -200,6 +202,8 @@ abstract class CommonObject
|
||||
{
|
||||
global $user,$langs,$conf;
|
||||
|
||||
$error=0;
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."element_contact";
|
||||
$sql.= " WHERE rowid =".$rowid;
|
||||
|
||||
@ -348,7 +352,7 @@ abstract class CommonObject
|
||||
$sql.= " AND ec.fk_c_type_contact=tc.rowid";
|
||||
$sql.= " AND tc.element = '".$this->element."'";
|
||||
|
||||
dol_syslog(get_class($object)."::swapContactStatus sql=".$sql);
|
||||
dol_syslog(get_class($this)."::swapContactStatus sql=".$sql);
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
@ -2055,7 +2059,7 @@ abstract class CommonObject
|
||||
// Produit
|
||||
if ($line->fk_product > 0)
|
||||
{
|
||||
$product_static = new Product($db);
|
||||
$product_static = new Product($this->db);
|
||||
|
||||
$product_static->type=$line->fk_product_type;
|
||||
$product_static->id=$line->fk_product;
|
||||
@ -2164,7 +2168,7 @@ abstract class CommonObject
|
||||
|
||||
if (($line->info_bits & 2) == 2) // TODO Not sure this is used for source object
|
||||
{
|
||||
$discount=new DiscountAbsolute($db);
|
||||
$discount=new DiscountAbsolute($this->db);
|
||||
$discount->fk_soc = $this->socid;
|
||||
$this->tpl['label'].= $discount->getNomUrl(0,'discount');
|
||||
}
|
||||
|
||||
@ -208,7 +208,7 @@ class DiscountAbsolute
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
dol_print_error($this->db);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1036,7 +1036,7 @@ class Form
|
||||
if ($num)
|
||||
{
|
||||
$out.= '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'"'.($disabled?' disabled="disabled"':'').'>';
|
||||
if ($show_empty) $out.= '<option value="-1"'.($id==-1?' selected="selected"':'').'> </option>'."\n";
|
||||
if ($show_empty) $out.= '<option value="-1"'.($selected==-1?' selected="selected"':'').'> </option>'."\n";
|
||||
|
||||
$userstatic=new User($this->db);
|
||||
|
||||
@ -1364,6 +1364,8 @@ class Form
|
||||
function select_produits_fournisseurs($socid,$selected='',$htmlname='productid',$filtertype='',$filtre)
|
||||
{
|
||||
global $langs,$conf;
|
||||
global $price_level, $status, $finished;
|
||||
|
||||
if ($conf->global->PRODUIT_USE_SEARCH_TO_SELECT)
|
||||
{
|
||||
// mode=2 means suppliers products
|
||||
@ -1521,7 +1523,7 @@ class Form
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1610,7 +1612,7 @@ class Form
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3806,7 +3808,7 @@ class Form
|
||||
if ($num)
|
||||
{
|
||||
$out.= '<select class="flat" name="'.$htmlname.'"'.($disabled?' disabled="disabled"':'').'>';
|
||||
if ($show_empty) $out.= '<option value="-1"'.($id==-1?' selected="selected"':'').'> </option>'."\n";
|
||||
if ($show_empty) $out.= '<option value="-1"'.($selected==-1?' selected="selected"':'').'> </option>'."\n";
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
|
||||
@ -358,7 +358,7 @@ class FormFile
|
||||
|
||||
$headershown=1;
|
||||
|
||||
$form = new Form($db);
|
||||
$form = new Form($this->db);
|
||||
$buttonlabeltoshow=$buttonlabel;
|
||||
if (empty($buttonlabel)) $buttonlabel=$langs->trans('Generate');
|
||||
|
||||
@ -537,7 +537,7 @@ class FormFile
|
||||
{
|
||||
global $user, $conf, $langs;
|
||||
global $bc;
|
||||
global $sortfield, $sortorder;
|
||||
global $sortfield, $sortorder, $maxheightmini;
|
||||
|
||||
// Show list of existing files
|
||||
if (empty($useinecm)) print_titre($langs->trans("AttachedFiles"));
|
||||
|
||||
@ -223,7 +223,7 @@ class FormMail
|
||||
if (! empty($_SESSION["listofmimes"])) $listofmimes=explode(';',$_SESSION["listofmimes"]);
|
||||
|
||||
|
||||
$form=new Form($DB);
|
||||
$form=new Form($this->db);
|
||||
|
||||
$out.= "\n<!-- Debut form mail -->\n";
|
||||
if ($this->withform)
|
||||
|
||||
@ -47,16 +47,17 @@ class FormOrder
|
||||
|
||||
|
||||
/**
|
||||
* \brief Renvoie la liste des sources de commandes
|
||||
* \param selected Id de la source pre-selectionnee
|
||||
* \param htmlname Nom de la liste deroulante
|
||||
* \param addempty 0=liste sans valeur nulle, 1=ajoute valeur inconnue
|
||||
* \return array Tableau des sources de commandes
|
||||
* Renvoie la liste des sources de commandes
|
||||
*
|
||||
* @param selected Id de la source pre-selectionnee
|
||||
* @param htmlname Nom de la liste deroulante
|
||||
* @param addempty 0=liste sans valeur nulle, 1=ajoute valeur inconnue
|
||||
* @return array Tableau des sources de commandes
|
||||
*/
|
||||
function selectSourcesCommande($selected='',$htmlname='source_id',$addempty=0)
|
||||
{
|
||||
global $conf,$langs;
|
||||
print '<select class="flat" name="'.$htmlname.'" '.$htmloption.'>';
|
||||
print '<select class="flat" name="'.$htmlname.'">';
|
||||
if ($addempty) print '<option value="-1" selected="selected"> </option>';
|
||||
|
||||
// TODO Use a table called llx_c_input_reason
|
||||
|
||||
@ -311,7 +311,6 @@ class FormOther
|
||||
$moreforfilter.='>';
|
||||
$moreforfilter.=$obj_usr->firstname." ".$obj_usr->name." (".$obj_usr->login.')';
|
||||
$moreforfilter.='</option>';
|
||||
$i++;
|
||||
}
|
||||
$this->db->free($resql_usr);
|
||||
}
|
||||
|
||||
@ -633,8 +633,8 @@ class Ldap
|
||||
//Create file
|
||||
$result=create_exdir($conf->ldap->dir_temp);
|
||||
|
||||
$file=$conf->ldap->dir_temp.'/ldapinput.in';
|
||||
$fp=fopen($file,"w");
|
||||
$outputfile=$conf->ldap->dir_temp.'/ldapinput.in';
|
||||
$fp=fopen($outputfile,"w");
|
||||
if ($fp)
|
||||
{
|
||||
fputs($fp, $content);
|
||||
|
||||
@ -395,7 +395,7 @@ class Menubase
|
||||
//print 'name='.$tab[$x][3].' pere='.$pere." ".$tab[$x][6];
|
||||
|
||||
$this->newmenu->add((! preg_match("/^(http:\/\/|https:\/\/)/i",$tab[$x][2])) ? $tab[$x][2] : $tab[$x][2], $tab[$x][3], $rang -1, $tab[$x][4], $tab[$x][5], $tab[$x][8]);
|
||||
$this->recur($tab, $tab[$x][0], $rang +1, $lelfmenu);
|
||||
$this->recur($tab, $tab[$x][0], $rang +1, $leftmenu);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -184,7 +184,7 @@ class vCard
|
||||
$key = "ADR";
|
||||
if ($type!="") $key.= ";$type";
|
||||
$key.= ";CHARSET=".$this->encoding;
|
||||
$this->properties[$key] = encode($name).";".encode($extended).";".encode($street).";".encode($city).";".encode($region).";".encode($zip).";".encode($country);
|
||||
$this->properties[$key] = ";".encode($extended).";".encode($street).";".encode($city).";".encode($region).";".encode($zip).";".encode($country);
|
||||
|
||||
if ($this->properties["LABEL;$type;CHARSET=".$this->encoding] == "")
|
||||
{
|
||||
|
||||
@ -374,6 +374,7 @@ function actions_prepare_head($action)
|
||||
|
||||
/**
|
||||
* Define head array for tabs of agenda setup pages
|
||||
*
|
||||
* @return Array of head
|
||||
*/
|
||||
function calendars_prepare_head($param)
|
||||
@ -388,6 +389,8 @@ function calendars_prepare_head($param)
|
||||
$head[$h][2] = 'card';
|
||||
$h++;
|
||||
|
||||
$object=(object) array();
|
||||
|
||||
// Show more tabs from modules
|
||||
// Entries must be declared in modules descriptor with line
|
||||
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||
|
||||
@ -495,6 +495,8 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable
|
||||
global $conf, $user, $langs, $db;
|
||||
global $object;
|
||||
|
||||
$error=0;
|
||||
|
||||
$file_name = $dest_file;
|
||||
// If an upload error has been reported
|
||||
if ($uploaderrorcode)
|
||||
@ -606,8 +608,6 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable
|
||||
dol_syslog("Functions.lib::dol_move_uploaded_file Failed to move ".$src_file." to ".$file_name, LOG_ERR);
|
||||
return -3; // Unknown error
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -624,6 +624,8 @@ function dol_delete_file($file,$disableglob=0,$nophperrors=0,$notrigger=0,$objec
|
||||
{
|
||||
global $db, $conf, $user, $langs;
|
||||
|
||||
$error=0;
|
||||
|
||||
//print "x".$file." ".$disableglob;
|
||||
$ok=true;
|
||||
$file_osencoded=dol_osencode($file); // New filename encoded in OS filesystem encoding charset
|
||||
@ -1003,8 +1005,6 @@ function dol_convert_file($file,$ext='png')
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -3977,7 +3977,7 @@ function get_htmloutput_mesg($mesgstring='',$mesgarray='', $style='ok', $keepemb
|
||||
}
|
||||
|
||||
// If inline message with no format, we add it.
|
||||
if ((! empty($conf->global->MAIN_DISABLE_JQUERY_JNOTIFY) || $keepembedded) && ! preg_match('/<div class=".*">/i',$out))
|
||||
if ((empty($conf->use_javascript_ajax) || ! empty($conf->global->MAIN_DISABLE_JQUERY_JNOTIFY) || $keepembedded) && ! preg_match('/<div class=".*">/i',$out))
|
||||
{
|
||||
$divstart='<div class="'.$style.'">';
|
||||
$divend='</div>';
|
||||
@ -4007,7 +4007,7 @@ function get_htmloutput_mesg($mesgstring='',$mesgarray='', $style='ok', $keepemb
|
||||
|
||||
if ($out)
|
||||
{
|
||||
if (empty($conf->global->MAIN_DISABLE_JQUERY_JNOTIFY) && empty($keepembedded))
|
||||
if ($conf->use_javascript_ajax && empty($conf->global->MAIN_DISABLE_JQUERY_JNOTIFY) && empty($keepembedded))
|
||||
{
|
||||
$return = '<script type="text/javascript">
|
||||
jQuery(document).ready(function() {
|
||||
@ -4046,7 +4046,7 @@ function get_htmloutput_errors($mesgstring='', $mesgarray='', $keepembedded=0)
|
||||
/**
|
||||
* Print formated messages to output (Used to show messages on html output).
|
||||
*
|
||||
* @param string $mesgstring Message
|
||||
* @param string $mesgstring Message
|
||||
* @param array $mesgarray Messages array
|
||||
* @param string $style Which style to use ('ok', 'error')
|
||||
* @param int $keepembedded Set to 1 if message must be kept embedded into its html place (this disable jnotify)
|
||||
@ -4417,7 +4417,8 @@ function complete_head_from_modules($conf,$langs,$object,&$head,&$h,$type,$mode=
|
||||
function printCommonFooter($zone='private')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
global $micro_start_time;
|
||||
|
||||
if ($zone == 'private') print "\n".'<!-- Common footer for private page -->'."\n";
|
||||
else print "\n".'<!-- Common footer for public page -->'."\n";
|
||||
|
||||
|
||||
@ -675,7 +675,7 @@ function check_value($mask,$value)
|
||||
$maskrefclient_maskclientcode=$regClientRef[1];
|
||||
$maskrefclient_maskcounter=$regClientRef[2];
|
||||
$maskrefclient_maskoffset=0; //default value of maskrefclient_counter offset
|
||||
$maskrefclient_clientcode=substr($valueforccc,0,dol_strlen($maskrefclient_maskclientcode));//get n first characters of client code to form maskrefclient_clientcode
|
||||
$maskrefclient_clientcode=substr('',0,dol_strlen($maskrefclient_maskclientcode));//get n first characters of client code to form maskrefclient_clientcode
|
||||
$maskrefclient_clientcode=str_pad($maskrefclient_clientcode,dol_strlen($maskrefclient_maskclientcode),"#",STR_PAD_RIGHT);//padding maskrefclient_clientcode for having exactly n characters in maskrefclient_clientcode
|
||||
$maskrefclient_clientcode=dol_string_nospecial($maskrefclient_clientcode);//sanitize maskrefclient_clientcode for sql insert and sql select like
|
||||
if (dol_strlen($maskrefclient_maskcounter) > 0 && dol_strlen($maskrefclient_maskcounter) < 3) return 'CounterMustHaveMoreThan3Digits';
|
||||
@ -936,7 +936,7 @@ function dol_set_user_param($db, $conf, &$user, $tab)
|
||||
foreach ($tab as $key => $value)
|
||||
{
|
||||
// Set new parameters
|
||||
if ($value && (! $url || in_array($key,array('sortfield','sortorder','begin','page'))))
|
||||
if ($value)
|
||||
{
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."user_param(fk_user,entity,param,value)";
|
||||
$sql.= " VALUES (".$user->id.",".$conf->entity.",";
|
||||
|
||||
@ -23,6 +23,7 @@
|
||||
|
||||
/**
|
||||
* Return array head with list of tabs to view object informations
|
||||
*
|
||||
* @param object Member
|
||||
* @return array head
|
||||
*/
|
||||
|
||||
@ -809,6 +809,7 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl
|
||||
|
||||
if ($object->lines[$i]->date_start || $object->lines[$i]->date_end)
|
||||
{
|
||||
$format='day';
|
||||
// Show duration if exists
|
||||
if ($object->lines[$i]->date_start && $object->lines[$i]->date_end)
|
||||
{
|
||||
@ -1272,14 +1273,344 @@ function pdf_getTotalQty($object,$type='',$outputlangs,$hookmanager=false)
|
||||
function pdf_getCurrencySymbol(&$pdf, $currency_code)
|
||||
{
|
||||
switch ($currency_code) {
|
||||
case "ALL":
|
||||
$currency_sign = " ".$pdf->unichr(76).$pdf->unichr(101).$pdf->unichr(107);
|
||||
break;
|
||||
case "AFN":
|
||||
$currency_sign = " ".$pdf->unichr(1547);
|
||||
break;
|
||||
case "ARS":
|
||||
$currency_sign = " ".$pdf->unichr(36);
|
||||
break;
|
||||
case "AWG":
|
||||
$currency_sign = " ".$pdf->unichr(402);
|
||||
break;
|
||||
case "AUD":
|
||||
$currency_sign = " ".$pdf->unichr(36);
|
||||
break;
|
||||
case "AZN":
|
||||
$currency_sign = " ".$pdf->unichr(1084).$pdf->unichr(1072).$pdf->unichr(1085);
|
||||
break;
|
||||
case "BSD":
|
||||
$currency_sign = " ".$pdf->unichr(36);
|
||||
break;
|
||||
case "BBD":
|
||||
$currency_sign = " ".$pdf->unichr(36);
|
||||
break;
|
||||
case "BYR":
|
||||
$currency_sign = " ".$pdf->unichr(112).$pdf->unichr(46);
|
||||
break;
|
||||
case "BZD":
|
||||
$currency_sign = " ".$pdf->unichr(66).$pdf->unichr(90).$pdf->unichr(36);
|
||||
break;
|
||||
case "BMD":
|
||||
$currency_sign = " ".$pdf->unichr(36);
|
||||
break;
|
||||
case "BOB":
|
||||
$currency_sign = " ".$pdf->unichr(36).$pdf->unichr(98);
|
||||
break;
|
||||
case "BAM":
|
||||
$currency_sign = " ".$pdf->unichr(75).$pdf->unichr(77);
|
||||
break;
|
||||
case "BWP":
|
||||
$currency_sign = " ".$pdf->unichr(80);
|
||||
break;
|
||||
case "BGN":
|
||||
$currency_sign = " ".$pdf->unichr(1083).$pdf->unichr(1074);
|
||||
break;
|
||||
case "BRL":
|
||||
$currency_sign = " ".$pdf->unichr(82).$pdf->unichr(36);
|
||||
break;
|
||||
case "BND":
|
||||
$currency_sign = " ".$pdf->unichr(36);
|
||||
break;
|
||||
case "KHR":
|
||||
$currency_sign = " ".$pdf->unichr(6107);
|
||||
break;
|
||||
case "CAD":
|
||||
$currency_sign = " ".$pdf->unichr(36);
|
||||
break;
|
||||
case "KYD":
|
||||
$currency_sign = " ".$pdf->unichr(36);
|
||||
break;
|
||||
case "CLP":
|
||||
$currency_sign = " ".$pdf->unichr(36);
|
||||
break;
|
||||
case "CNY":
|
||||
$currency_sign = " ".$pdf->unichr(165);
|
||||
break;
|
||||
case "COP":
|
||||
$currency_sign = " ".$pdf->unichr(36);
|
||||
break;
|
||||
case "CRC":
|
||||
$currency_sign = " ".$pdf->unichr(8353);
|
||||
break;
|
||||
case "HRK":
|
||||
$currency_sign = " ".$pdf->unichr(107).$pdf->unichr(110);
|
||||
break;
|
||||
case "CUP":
|
||||
$currency_sign = " ".$pdf->unichr(8369);
|
||||
break;
|
||||
case "CZK":
|
||||
$currency_sign = " ".$pdf->unichr(75).$pdf->unichr(269);
|
||||
break;
|
||||
case "DKK":
|
||||
$currency_sign = " ".$pdf->unichr(107).$pdf->unichr(114);
|
||||
break;
|
||||
case "DOP":
|
||||
$currency_sign = " ".$pdf->unichr(82).$pdf->unichr(68).$pdf->unichr(36);
|
||||
break;
|
||||
case "XCD":
|
||||
$currency_sign = " ".$pdf->unichr(36);
|
||||
break;
|
||||
case "EGP":
|
||||
$currency_sign = " ".$pdf->unichr(163);
|
||||
break;
|
||||
case "SVC":
|
||||
$currency_sign = " ".$pdf->unichr(36);
|
||||
break;
|
||||
case "EEK":
|
||||
$currency_sign = " ".$pdf->unichr(107).$pdf->unichr(114);
|
||||
break;
|
||||
case "EUR":
|
||||
$currency_sign = " ".$pdf->unichr(8364);
|
||||
break;
|
||||
case "USD":
|
||||
$currency_sign = " ".utf8_encode('$');
|
||||
case "FKP":
|
||||
$currency_sign = " ".$pdf->unichr(163);
|
||||
break;
|
||||
case "FJD":
|
||||
$currency_sign = " ".$pdf->unichr(36);
|
||||
break;
|
||||
case "GHC":
|
||||
$currency_sign = " ".$pdf->unichr(162);
|
||||
break;
|
||||
case "GIP":
|
||||
$currency_sign = " ".$pdf->unichr(163);
|
||||
break;
|
||||
case "GTQ":
|
||||
$currency_sign = " ".$pdf->unichr(81);
|
||||
break;
|
||||
case "GGP":
|
||||
$currency_sign = " ".$pdf->unichr(163);
|
||||
break;
|
||||
case "GYD":
|
||||
$currency_sign = " ".$pdf->unichr(36);
|
||||
break;
|
||||
case "HNL":
|
||||
$currency_sign = " ".$pdf->unichr(76);
|
||||
break;
|
||||
case "HKD":
|
||||
$currency_sign = " ".$pdf->unichr(36);
|
||||
break;
|
||||
case "HUF":
|
||||
$currency_sign = " ".$pdf->unichr(70).$pdf->unichr(116);
|
||||
break;
|
||||
case "ISK":
|
||||
$currency_sign = " ".$pdf->unichr(107).$pdf->unichr(114);
|
||||
break;
|
||||
case "INR":
|
||||
$currency_sign = " ".$pdf->unichr(8377);
|
||||
break;
|
||||
case "IDR":
|
||||
$currency_sign = " ".$pdf->unichr(82).$pdf->unichr(112);
|
||||
break;
|
||||
case "IRR":
|
||||
$currency_sign = " ".$pdf->unichr(65020);
|
||||
break;
|
||||
case "IMP":
|
||||
$currency_sign = " ".$pdf->unichr(163);
|
||||
break;
|
||||
case "ILS":
|
||||
$currency_sign = " ".$pdf->unichr(8362);
|
||||
break;
|
||||
case "JMD":
|
||||
$currency_sign = " ".$pdf->unichr(74).$pdf->unichr(36);
|
||||
break;
|
||||
case "JPY":
|
||||
$currency_sign = " ".$pdf->unichr(165);
|
||||
break;
|
||||
case "JEP":
|
||||
$currency_sign = " ".$pdf->unichr(163);
|
||||
break;
|
||||
case "KZT":
|
||||
$currency_sign = " ".$pdf->unichr(1083).$pdf->unichr(1074);
|
||||
break;
|
||||
case "KPW":
|
||||
$currency_sign = " ".$pdf->unichr(8361);
|
||||
break;
|
||||
case "KRW":
|
||||
$currency_sign = " ".$pdf->unichr(8361);
|
||||
break;
|
||||
case "KGS":
|
||||
$currency_sign = " ".$pdf->unichr(1083).$pdf->unichr(1074);
|
||||
break;
|
||||
case "LAK":
|
||||
$currency_sign = " ".$pdf->unichr(8365);
|
||||
break;
|
||||
case "LVL":
|
||||
$currency_sign = " ".$pdf->unichr(76).$pdf->unichr(115);
|
||||
break;
|
||||
case "LBP":
|
||||
$currency_sign = " ".$pdf->unichr(163);
|
||||
break;
|
||||
case "LRD":
|
||||
$currency_sign = " ".$pdf->unichr(36);
|
||||
break;
|
||||
case "LTL":
|
||||
$currency_sign = " ".$pdf->unichr(76).$pdf->unichr(116);
|
||||
break;
|
||||
case "MKD":
|
||||
$currency_sign = " ".$pdf->unichr(1076).$pdf->unichr(1077).$pdf->unichr(1085);
|
||||
break;
|
||||
case "MYR":
|
||||
$currency_sign = " ".$pdf->unichr(82).$pdf->unichr(77);
|
||||
break;
|
||||
case "MUR":
|
||||
$currency_sign = " ".$pdf->unichr(8360);
|
||||
break;
|
||||
case "MXN":
|
||||
$currency_sign = " ".$pdf->unichr(36);
|
||||
break;
|
||||
case "MNT":
|
||||
$currency_sign = " ".$pdf->unichr(8366);
|
||||
break;
|
||||
case "MZN":
|
||||
$currency_sign = " ".$pdf->unichr(77).$pdf->unichr(84);
|
||||
break;
|
||||
case "NAD":
|
||||
$currency_sign = " ".$pdf->unichr(36);
|
||||
break;
|
||||
case "NPR":
|
||||
$currency_sign = " ".$pdf->unichr(8360);
|
||||
break;
|
||||
case "ANG":
|
||||
$currency_sign = " ".$pdf->unichr(402);
|
||||
break;
|
||||
case "NZD":
|
||||
$currency_sign = " ".$pdf->unichr(36);
|
||||
break;
|
||||
case "NIO":
|
||||
$currency_sign = " ".$pdf->unichr(67).$pdf->unichr(36);
|
||||
break;
|
||||
case "NGN":
|
||||
$currency_sign = " ".$pdf->unichr(8358);
|
||||
break;
|
||||
case "NOK":
|
||||
$currency_sign = " ".$pdf->unichr(107).$pdf->unichr(114);
|
||||
break;
|
||||
case "OMR":
|
||||
$currency_sign = " ".$pdf->unichr(65020);
|
||||
break;
|
||||
case "PKR":
|
||||
$currency_sign = " ".$pdf->unichr(8360);
|
||||
break;
|
||||
case "PAB":
|
||||
$currency_sign = " ".$pdf->unichr(66).$pdf->unichr(47).$pdf->unichr(46);
|
||||
break;
|
||||
case "PYG":
|
||||
$currency_sign = " ".$pdf->unichr(71).$pdf->unichr(115);
|
||||
break;
|
||||
case "PEN":
|
||||
$currency_sign = " ".$pdf->unichr(83).$pdf->unichr(47).$pdf->unichr(46);
|
||||
break;
|
||||
case "PHP":
|
||||
$currency_sign = " ".$pdf->unichr(8369);
|
||||
break;
|
||||
case "PLN":
|
||||
$currency_sign = " ".$pdf->unichr(122).$pdf->unichr(322);
|
||||
break;
|
||||
case "QAR":
|
||||
$currency_sign = " ".$pdf->unichr(65020);
|
||||
break;
|
||||
case "RON":
|
||||
$currency_sign = " ".$pdf->unichr(108).$pdf->unichr(101).$pdf->unichr(105);
|
||||
break;
|
||||
case "RUB":
|
||||
$currency_sign = " ".$pdf->unichr(1088).$pdf->unichr(1091).$pdf->unichr(1073);
|
||||
break;
|
||||
case "SHP":
|
||||
$currency_sign = " ".$pdf->unichr(163);
|
||||
break;
|
||||
case "SAR":
|
||||
$currency_sign = " ".$pdf->unichr(65020);
|
||||
break;
|
||||
case "RSD":
|
||||
$currency_sign = " ".$pdf->unichr(1044).$pdf->unichr(1080).$pdf->unichr(1085).$pdf->unichr(46);
|
||||
break;
|
||||
case "SCR":
|
||||
$currency_sign = " ".$pdf->unichr(8360);
|
||||
break;
|
||||
case "SGD":
|
||||
$currency_sign = " ".$pdf->unichr(36);
|
||||
break;
|
||||
case "SBD":
|
||||
$currency_sign = " ".$pdf->unichr(36);
|
||||
break;
|
||||
case "SOS":
|
||||
$currency_sign = " ".$pdf->unichr(83);
|
||||
break;
|
||||
case "ZAR":
|
||||
$currency_sign = " ".$pdf->unichr(82);
|
||||
break;
|
||||
case "LKR":
|
||||
$currency_sign = " ".$pdf->unichr(8360);
|
||||
break;
|
||||
case "SEK":
|
||||
$currency_sign = " ".$pdf->unichr(107).$pdf->unichr(114);
|
||||
break;
|
||||
case "CHF":
|
||||
$currency_sign = " ".$pdf->unichr(67).$pdf->unichr(72).$pdf->unichr(70);
|
||||
break;
|
||||
case "SRD":
|
||||
$currency_sign = " ".$pdf->unichr(36);
|
||||
break;
|
||||
case "SYP":
|
||||
$currency_sign = " ".$pdf->unichr(163);
|
||||
break;
|
||||
case "TWD":
|
||||
$currency_sign = " ".$pdf->unichr(78).$pdf->unichr(84).$pdf->unichr(36);
|
||||
break;
|
||||
case "THB":
|
||||
$currency_sign = " ".$pdf->unichr(3647);
|
||||
break;
|
||||
case "TTD":
|
||||
$currency_sign = " ".$pdf->unichr(84).$pdf->unichr(84).$pdf->unichr(36);
|
||||
break;
|
||||
case "TRY":
|
||||
$currency_sign = " ".$pdf->unichr(84).$pdf->unichr(76);
|
||||
break;
|
||||
case "TRL":
|
||||
$currency_sign = " ".$pdf->unichr(8356);
|
||||
break;
|
||||
case "TVD":
|
||||
$currency_sign = " ".$pdf->unichr(36);
|
||||
break;
|
||||
case "UAH":
|
||||
$currency_sign = " ".$pdf->unichr(8372);
|
||||
break;
|
||||
case "GBP":
|
||||
$currency_sign = " ".utf8_encode('£');
|
||||
$currency_sign = " ".$pdf->unichr(163);
|
||||
break;
|
||||
case "USD":
|
||||
$currency_sign = " ".$pdf->unichr(36);
|
||||
break;
|
||||
case "UYU":
|
||||
$currency_sign = " ".$pdf->unichr(36).$pdf->unichr(85);
|
||||
break;
|
||||
case "UZS":
|
||||
$currency_sign = " ".$pdf->unichr(1083).$pdf->unichr(1074);
|
||||
break;
|
||||
case "VEF":
|
||||
$currency_sign = " ".$pdf->unichr(66).$pdf->unichr(115);
|
||||
break;
|
||||
case "VND":
|
||||
$currency_sign = " ".$pdf->unichr(8363);
|
||||
break;
|
||||
case "YER":
|
||||
$currency_sign = " ".$pdf->unichr(65020);
|
||||
break;
|
||||
case "ZWD":
|
||||
$currency_sign = " ".$pdf->unichr(90).$pdf->unichr(36);
|
||||
break;
|
||||
default:
|
||||
$currency_sign = " ".$currency_code;
|
||||
|
||||
@ -265,13 +265,10 @@ function select_projects($socid=-1, $selected='', $htmlname='projectid')
|
||||
function PLinesb(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $mytask=0)
|
||||
{
|
||||
global $user, $bc, $langs;
|
||||
global $form;
|
||||
global $form, $projectstatic, $taskstatic;
|
||||
|
||||
$lastprojectid=0;
|
||||
|
||||
$projectstatic = new Project($db);
|
||||
$taskstatic = new Task($db);
|
||||
|
||||
$var=true;
|
||||
|
||||
$numlines=count($lines);
|
||||
@ -380,12 +377,10 @@ function PLinesb(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $
|
||||
function PLines(&$inc, $parent, &$lines, &$level, $var, $showproject, &$taskrole, $projectsListId='')
|
||||
{
|
||||
global $user, $bc, $langs;
|
||||
|
||||
global $projectstatic, $taskstatic;
|
||||
|
||||
$lastprojectid=0;
|
||||
|
||||
$projectstatic = new Project($db);
|
||||
$taskstatic = new Task($db);
|
||||
|
||||
$projectsArrayId=explode(',',$projectsListId);
|
||||
|
||||
$numlines=count($lines);
|
||||
|
||||
@ -36,7 +36,7 @@
|
||||
*/
|
||||
function report_header($nom,$variante='',$period,$periodlink,$description,$builddate,$exportlink='',$moreparam=array())
|
||||
{
|
||||
global $langs;
|
||||
global $langs, $hselected;
|
||||
|
||||
print "\n\n<!-- debut cartouche rapport -->\n";
|
||||
|
||||
|
||||
@ -131,8 +131,6 @@ function show_list_sending_receive($origin='commande',$origin_id,$filter='')
|
||||
|
||||
if ($num)
|
||||
{
|
||||
if ($somethingshown) print '<br>';
|
||||
|
||||
if ($filter) print_titre($langs->trans("OtherSendingsForSameOrder"));
|
||||
else print_titre($langs->trans("SendingsAndReceivingForSameOrder"));
|
||||
|
||||
@ -191,7 +189,7 @@ function show_list_sending_receive($origin='commande',$origin_id,$filter='')
|
||||
else
|
||||
{
|
||||
print "<td>";
|
||||
if ($type==1) $text = img_object($langs->trans('Service'),'service');
|
||||
if ($objp->fk_product_type==1) $text = img_object($langs->trans('Service'),'service');
|
||||
else $text = img_object($langs->trans('Product'),'product');
|
||||
print $text.' '.nl2br($objp->description);
|
||||
|
||||
|
||||
@ -84,9 +84,9 @@ function check_user_password_ldap($usertotest,$passwordtotest,$entitytotest)
|
||||
if ($ldapdebug)
|
||||
{
|
||||
dol_syslog("functions_ldap::check_user_password_ldap Server:".join(',',$ldap->server).", Port:".$ldap->serverPort.", Protocol:".$ldap->ldapProtocolVersion.", Type:".$ldap->serverType);
|
||||
dol_syslog("functions_ldap::check_user_password_ldap uid/samacountname=".$ldapuserattr.", dn=".$ladpdn.", Admin:".$ldap->searchUser.", Pass:".$ldap->searchPassword);
|
||||
dol_syslog("functions_ldap::check_user_password_ldap uid/samacountname=".$ldapuserattr.", dn=".$ldapdn.", Admin:".$ldap->searchUser.", Pass:".$ldap->searchPassword);
|
||||
print "DEBUG: Server:".join(',',$ldap->server).", Port:".$ldap->serverPort.", Protocol:".$ldap->ldapProtocolVersion.", Type:".$ldap->serverType."\n";
|
||||
print "DEBUG: uid/samacountname=".$ldapuserattr.", dn=".$ladpdn.", Admin:".$ldap->searchUser.", Pass:".$ldap->searchPassword."\n";
|
||||
print "DEBUG: uid/samacountname=".$ldapuserattr.", dn=".$ldapdn.", Admin:".$ldap->searchUser.", Pass:".$ldap->searchPassword."\n";
|
||||
}
|
||||
|
||||
$resultFetchLdapUser=0;
|
||||
|
||||
@ -204,7 +204,7 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after)
|
||||
print '<div class="menu_titre" id="menu_titre_logo"></div>';
|
||||
print '<div class="menu_top" id="menu_top_logo"></div>';
|
||||
print '<div class="menu_contenu" id="menu_contenu_logo">';
|
||||
print '<center><img title="'.$title.'" src="'.$urllogo.'"></center>'."\n";
|
||||
print '<center><img title="" src="'.$urllogo.'"></center>'."\n";
|
||||
print '</div>';
|
||||
print '<div class="menu_end" id="menu_end_logo"></div>';
|
||||
print '</div>'."\n";
|
||||
|
||||
@ -601,7 +601,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
|
||||
print '<div class="menu_titre" id="menu_titre_logo"></div>';
|
||||
print '<div class="menu_top" id="menu_top_logo"></div>';
|
||||
print '<div class="menu_contenu" id="menu_contenu_logo">';
|
||||
print '<center><img title="'.$title.'" src="'.$urllogo.'"></center>'."\n";
|
||||
print '<center><img title="" src="'.$urllogo.'"></center>'."\n";
|
||||
print '</div>';
|
||||
print '<div class="menu_end" id="menu_end_logo"></div>';
|
||||
print '</div>'."\n";
|
||||
|
||||
@ -167,7 +167,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
|
||||
|
||||
$pdf->Output($_file,'F');
|
||||
if (! empty($conf->global->MAIN_UMASK))
|
||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||
@chmod($_file, octdec($conf->global->MAIN_UMASK));
|
||||
|
||||
$outputlangs->charset_output=$sav_charset_output;
|
||||
return 1; // Pas d'erreur
|
||||
@ -359,7 +359,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
|
||||
// On positionne le debut du bas de page selon nbre de lignes de ce bas de page
|
||||
$nbofline=dol_nboflines_bis($line,0,$outputlangs->charset_output);
|
||||
//print 'e'.$line.'t'.dol_nboflines($line);exit;
|
||||
$posy=$marge_basse + ($nbofline*3) + ($line1?3:0) + ($line2?3:0);
|
||||
$posy=$marge_basse + ($nbofline*3);
|
||||
|
||||
if ($line) // Free text
|
||||
{
|
||||
@ -372,7 +372,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
|
||||
$pdf->line($marge_gauche, $page_hauteur-$posy, 200, $page_hauteur-$posy);
|
||||
$posy--;
|
||||
|
||||
if ($line1)
|
||||
/*if ($line1)
|
||||
{
|
||||
$pdf->SetXY($marge_gauche,-$posy);
|
||||
$pdf->MultiCell(200, 2, $line1, 0, 'C', 0);
|
||||
@ -383,7 +383,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
|
||||
$posy-=3;
|
||||
$pdf->SetXY($marge_gauche,-$posy);
|
||||
$pdf->MultiCell(200, 2, $line2, 0, 'C', 0);
|
||||
}
|
||||
}*/
|
||||
|
||||
// Show page nb only on iso languages (so default Helvetica font)
|
||||
if (pdf_getPDFFont($outputlangs) == 'Helvetica')
|
||||
|
||||
@ -48,7 +48,7 @@ class mod_commande_saphir extends ModeleNumRefCommandes
|
||||
|
||||
$langs->load("bills");
|
||||
|
||||
$form = new Form($db);
|
||||
$form = new Form($this->db);
|
||||
|
||||
$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
|
||||
$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
|
||||
@ -155,6 +155,8 @@ function commande_pdf_create($db, $object, $modele, $outputlangs, $hidedetails=0
|
||||
global $conf,$user,$langs;
|
||||
$langs->load("orders");
|
||||
|
||||
$error=0;
|
||||
|
||||
$dir = "/core/modules/commande/";
|
||||
$srctemplatepath='';
|
||||
$modelisok=0;
|
||||
|
||||
@ -43,7 +43,7 @@ class mod_contract_magre extends ModelNumRefContracts
|
||||
|
||||
$langs->load("bills");
|
||||
|
||||
$form = new Form($db);
|
||||
$form = new Form($this->db);
|
||||
|
||||
$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
|
||||
$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
|
||||
@ -177,7 +177,7 @@ function don_create($db, $id, $message, $modele, $outputlangs)
|
||||
|
||||
// we delete preview files
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
|
||||
dol_delete_preview($object);
|
||||
dol_delete_preview($obj);
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
|
||||
@ -43,7 +43,7 @@ class mod_expedition_ribera extends ModelNumRefExpedition
|
||||
|
||||
$langs->load("bills");
|
||||
|
||||
$form = new Form($db);
|
||||
$form = new Form($this->db);
|
||||
|
||||
$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
|
||||
$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
|
||||
@ -166,7 +166,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures
|
||||
$langs->load("companies");
|
||||
$langs->load("errors");
|
||||
|
||||
$form = new Form($db);
|
||||
$form = new Form($this->db);
|
||||
|
||||
$texte = $this->description.".<br>\n";
|
||||
$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
@ -266,11 +266,10 @@ class doc_generic_invoice_odt extends ModelePDFFactures
|
||||
{
|
||||
$id = $object;
|
||||
$object = new Facture($this->db);
|
||||
$object->fetch($id);
|
||||
|
||||
$result=$object->fetch($id);
|
||||
if ($result < 0)
|
||||
{
|
||||
dol_print_error($db,$object->error);
|
||||
dol_print_error($this->db,$object->error);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -46,7 +46,7 @@ class mod_facture_mercure extends ModeleNumRefFactures
|
||||
|
||||
$langs->load("bills");
|
||||
|
||||
$form = new Form($db);
|
||||
$form = new Form($this->db);
|
||||
|
||||
$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
|
||||
$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
|
||||
@ -149,6 +149,8 @@ function facture_pdf_create($db, $object, $message, $modele, $outputlangs, $hide
|
||||
|
||||
$langs->load("bills");
|
||||
|
||||
$error=0;
|
||||
|
||||
// Increase limit for PDF build
|
||||
$err=error_reporting();
|
||||
error_reporting(0);
|
||||
|
||||
@ -52,7 +52,7 @@ class mod_arctic extends ModeleNumRefFicheinter
|
||||
|
||||
$langs->load("bills");
|
||||
|
||||
$form = new Form($db);
|
||||
$form = new Form($this->db);
|
||||
|
||||
$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
|
||||
$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
|
||||
@ -45,7 +45,7 @@ class mod_livraison_saphir extends ModeleNumRefDeliveryOrder
|
||||
|
||||
$langs->load("bills");
|
||||
|
||||
$form = new Form($db);
|
||||
$form = new Form($this->db);
|
||||
|
||||
$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
|
||||
$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
|
||||
@ -234,7 +234,7 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
|
||||
$tab_height_in_current_page=$tab_height_newpage;
|
||||
}
|
||||
|
||||
if (($nexY+$nblineFollowDesc) > ($tab_top_in_current_page+$tab_height_in_current_page) && $i < ($nblignes - 1))
|
||||
if (($nexY+$nblineFollowDesc) > ($tab_top_in_current_page+$tab_height_in_current_page) && $i < ($nblines - 1))
|
||||
{
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
|
||||
@ -298,7 +298,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
$tab_top_in_current_page=$tab_top_newpage;
|
||||
$tab_height_in_current_page=$tab_height_newpage;
|
||||
}
|
||||
if (($nexY+$nblineFollowDesc) > ($tab_top_in_current_page+$tab_height_in_current_page) && $i < ($nblignes - 1))
|
||||
if (($nexY+$nblineFollowDesc) > ($tab_top_in_current_page+$tab_height_in_current_page) && $i < ($nblines - 1))
|
||||
{
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
@ -344,7 +344,8 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
// Check product remaining to be delivered
|
||||
// TODO doit etre modifie
|
||||
//$waitingDelivery = $object->getRemainingDelivered();
|
||||
|
||||
$waitingDelivery='';
|
||||
|
||||
if (is_array($waitingDelivery) & !empty($waitingDelivery))
|
||||
{
|
||||
$pdf->AddPage('P', 'A4');
|
||||
|
||||
@ -202,7 +202,7 @@ class mailing_framboise extends MailingTargets
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
|
||||
$s.='</select>';
|
||||
|
||||
@ -218,7 +218,7 @@ class mailing_thirdparties extends MailingTargets
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
|
||||
$s.='</select>';
|
||||
|
||||
@ -357,10 +357,11 @@ class pdf_standard {
|
||||
|
||||
|
||||
/**
|
||||
* \brief Function to build PDF on disk, then output on HTTP strem.
|
||||
* \param arrayofmembers Array of members informations
|
||||
* \param outputlangs Lang object for output language
|
||||
* \return int 1=ok, 0=ko
|
||||
* Function to build PDF on disk, then output on HTTP strem.
|
||||
*
|
||||
* @param arrayofmembers Array of members informations
|
||||
* @param outputlangs Lang object for output language
|
||||
* @return int 1=ok, 0=ko
|
||||
*/
|
||||
function write_file($arrayofmembers,$outputlangs)
|
||||
{
|
||||
@ -457,7 +458,7 @@ class pdf_standard {
|
||||
$filename='tmpcards.pdf';
|
||||
$type=dol_mimetype($filename);
|
||||
|
||||
if ($encoding) header('Content-Encoding: '.$encoding);
|
||||
//if ($encoding) header('Content-Encoding: '.$encoding);
|
||||
if ($type) header('Content-Type: '.$type);
|
||||
if ($attachment) header('Content-Disposition: attachment; filename="'.$filename.'"');
|
||||
else header('Content-Disposition: inline; filename="'.$filename.'"');
|
||||
|
||||
@ -144,7 +144,9 @@ class pdf_standardlabel {
|
||||
$logo=$conf->mycompany->dir_output.'/logos/'.$mysoc->logo;
|
||||
}
|
||||
}
|
||||
|
||||
// Define photo
|
||||
$photo='';
|
||||
|
||||
// Print lines
|
||||
if ($this->code == "CARD")
|
||||
{
|
||||
@ -436,7 +438,7 @@ class pdf_standardlabel {
|
||||
$filename='tmplabels.pdf';
|
||||
$type=dol_mimetype($filename);
|
||||
|
||||
if ($encoding) header('Content-Encoding: '.$encoding);
|
||||
//if ($encoding) header('Content-Encoding: '.$encoding);
|
||||
if ($type) header('Content-Type: '.$type);
|
||||
if ($attachment) header('Content-Disposition: attachment; filename="'.$filename.'"');
|
||||
else header('Content-Disposition: inline; filename="'.$filename.'"');
|
||||
|
||||
@ -132,6 +132,8 @@ class modComptabilite extends DolibarrModules
|
||||
// Nettoyage avant activation
|
||||
$this->remove();
|
||||
|
||||
$sql = array();
|
||||
|
||||
return $this->_init($sql);
|
||||
}
|
||||
|
||||
|
||||
@ -129,6 +129,8 @@ class modContrat extends DolibarrModules
|
||||
// Nettoyage avant activation
|
||||
$this->remove();
|
||||
|
||||
$sql = array();
|
||||
|
||||
return $this->_init($sql);
|
||||
}
|
||||
|
||||
|
||||
@ -111,6 +111,8 @@ class modMailing extends DolibarrModules
|
||||
// Permissions
|
||||
$this->remove();
|
||||
|
||||
$sql = array();
|
||||
|
||||
return $this->_init($sql);
|
||||
}
|
||||
|
||||
|
||||
@ -84,6 +84,8 @@ class modNotification extends DolibarrModules
|
||||
// Permissions
|
||||
$this->remove();
|
||||
|
||||
$sql = array();
|
||||
|
||||
return $this->_init($sql);
|
||||
}
|
||||
|
||||
|
||||
@ -149,6 +149,8 @@ class modTax extends DolibarrModules
|
||||
// Nettoyage avant activation
|
||||
$this->remove();
|
||||
|
||||
$sql = array();
|
||||
|
||||
return $this->_init($sql);
|
||||
}
|
||||
|
||||
|
||||
@ -147,7 +147,10 @@ class modWorkflow extends DolibarrModules
|
||||
*/
|
||||
function init()
|
||||
{
|
||||
//$result=$this->load_tables();
|
||||
// Permissions
|
||||
$this->remove();
|
||||
|
||||
$sql = array();
|
||||
|
||||
return $this->_init($sql);
|
||||
}
|
||||
|
||||
@ -47,7 +47,7 @@ class mod_project_universal extends ModeleNumRefProjects
|
||||
$langs->load("projects");
|
||||
$langs->load("admin");
|
||||
|
||||
$form = new Form($db);
|
||||
$form = new Form($this->db);
|
||||
|
||||
$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
|
||||
$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
|
||||
@ -48,7 +48,7 @@ class mod_propale_saphir extends ModeleNumRefPropales
|
||||
|
||||
$langs->load("bills");
|
||||
|
||||
$form = new Form($db);
|
||||
$form = new Form($this->db);
|
||||
|
||||
$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
|
||||
$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
|
||||
@ -128,7 +128,7 @@ abstract class ModeleNumRefPropales
|
||||
|
||||
|
||||
/**
|
||||
* Create a document onto disk accordign to template module.
|
||||
* Create a document onto disk according to template module.
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
* @param Object $object Object proposal
|
||||
@ -145,6 +145,8 @@ function propale_pdf_create($db, $object, $modele, $outputlangs, $hidedetails=0,
|
||||
global $conf,$user,$langs;
|
||||
$langs->load("propale");
|
||||
|
||||
$error=0;
|
||||
|
||||
$dir = "/core/modules/propale/";
|
||||
$srctemplatepath='';
|
||||
$modelisok=0;
|
||||
@ -181,7 +183,7 @@ function propale_pdf_create($db, $object, $modele, $outputlangs, $hidedetails=0,
|
||||
}
|
||||
|
||||
// Si model pas encore bon
|
||||
if (! $modelisok && is_array($liste))
|
||||
if (! $modelisok)
|
||||
{
|
||||
$liste=ModelePDFPropales::liste_modeles($db);
|
||||
$modele=key($liste); // Renvoie premiere valeur de cle trouve dans le tableau
|
||||
|
||||
@ -654,9 +654,9 @@ class pdf_propale_azur extends ModelePDFPropales
|
||||
{
|
||||
$index++;
|
||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalLT1".$mysoc->pays_code), $useborder, 'L', 1);
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalLT1".$mysoc->pays_code), 0, 'L', 1);
|
||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax1), $useborder, 'R', 1);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax1), 0, 'R', 1);
|
||||
}
|
||||
|
||||
// Total LocalTax2
|
||||
@ -664,9 +664,9 @@ class pdf_propale_azur extends ModelePDFPropales
|
||||
{
|
||||
$index++;
|
||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalLT2".$mysoc->pays_code), $useborder, 'L', 1);
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalLT2".$mysoc->pays_code), 0, 'L', 1);
|
||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2), $useborder, 'R', 1);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2), 0, 'R', 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@ -654,9 +654,9 @@ class pdf_propale_jaune extends ModelePDFPropales
|
||||
{
|
||||
$index++;
|
||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalLT1".$mysoc->pays_code), $useborder, 'L', 1);
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalLT1".$mysoc->pays_code), 0, 'L', 1);
|
||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax1), $useborder, 'R', 1);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax1), 0, 'R', 1);
|
||||
}
|
||||
|
||||
// Total LocalTax2
|
||||
@ -664,9 +664,9 @@ class pdf_propale_jaune extends ModelePDFPropales
|
||||
{
|
||||
$index++;
|
||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalLT2".$mysoc->pays_code), $useborder, 'L', 1);
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalLT2".$mysoc->pays_code), 0, 'L', 1);
|
||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2), $useborder, 'R', 1);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2), 0, 'R', 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@ -88,7 +88,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc
|
||||
$langs->load("companies");
|
||||
$langs->load("errors");
|
||||
|
||||
$form = new Form($db);
|
||||
$form = new Form($this->db);
|
||||
|
||||
$texte = $this->description.".<br>\n";
|
||||
$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
@ -187,11 +187,10 @@ class doc_generic_odt extends ModeleThirdPartyDoc
|
||||
{
|
||||
$id = $object;
|
||||
$object = new Societe($this->db);
|
||||
$object->fetch($id);
|
||||
|
||||
$result=$object->fetch($id);
|
||||
if ($result < 0)
|
||||
{
|
||||
dol_print_error($db,$object->error);
|
||||
dol_print_error($this->db,$object->error);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -72,7 +72,7 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode
|
||||
|
||||
$langs->load("companies");
|
||||
|
||||
$form = new Form($db);
|
||||
$form = new Form($this->db);
|
||||
|
||||
$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
|
||||
$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
|
||||
@ -61,7 +61,7 @@ class mod_codecompta_aquarium extends ModeleAccountancyCode
|
||||
|
||||
$langs->load("companies");
|
||||
|
||||
$form = new Form($db);
|
||||
$form = new Form($this->db);
|
||||
|
||||
$tooltip='';
|
||||
$texte = '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
|
||||
@ -355,6 +355,9 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
// Affiche zone totaux
|
||||
$posy=$this->_tableau_tot($pdf, $object, $deja_regle, $bottomlasttab, $outputlangs);
|
||||
|
||||
$amount_credit_notes_included=0;
|
||||
$amount_deposits_included=0;
|
||||
|
||||
if ($deja_regle || $amount_credit_notes_included || $amount_deposits_included)
|
||||
{
|
||||
$posy=$this->_tableau_versements($pdf, $object, $posy, $outputlangs);
|
||||
@ -423,6 +426,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
// Affichage des totaux de TVA par taux (conformement a reglementation)
|
||||
$pdf->SetFillColor(248,248,248);
|
||||
|
||||
$index=0;
|
||||
foreach( $this->tva as $tvakey => $tvaval )
|
||||
{
|
||||
if ($tvakey > 0) // On affiche pas taux 0
|
||||
@ -461,9 +465,9 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
{
|
||||
$index++;
|
||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalLT1".$mysoc->pays_code), $useborder, 'L', 1);
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalLT1".$mysoc->pays_code), 0, 'L', 1);
|
||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax1), $useborder, 'R', 1);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax1), 0, 'R', 1);
|
||||
}
|
||||
|
||||
// Total LocalTax2
|
||||
@ -471,9 +475,9 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
{
|
||||
$index++;
|
||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalLT2".$mysoc->pays_code), $useborder, 'L', 1);
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalLT2".$mysoc->pays_code), 0, 'L', 1);
|
||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2), $useborder, 'R', 1);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2), 0, 'R', 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@ -48,7 +48,7 @@ class mod_commande_fournisseur_orchidee extends ModeleNumRefSuppliersOrders
|
||||
$langs->load("bills");
|
||||
$langs->load("admin");
|
||||
|
||||
$form = new Form($db);
|
||||
$form = new Form($this->db);
|
||||
|
||||
$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
|
||||
$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
|
||||
@ -356,6 +356,8 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
// Affiche zone totaux
|
||||
$posy=$this->_tableau_tot($pdf, $object, $deja_regle, $bottomlasttab, $outputlangs);
|
||||
|
||||
$amount_credit_notes_included=0;
|
||||
$amount_deposits_included=0;
|
||||
if ($deja_regle || $amount_credit_notes_included || $amount_deposits_included)
|
||||
{
|
||||
$this->_tableau_versements($pdf, $object, $posy);
|
||||
@ -426,6 +428,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
// Affichage des totaux de TVA par taux (conformement a reglementation)
|
||||
$pdf->SetFillColor(248,248,248);
|
||||
|
||||
$index=0;
|
||||
foreach( $this->tva as $tvakey => $tvaval )
|
||||
{
|
||||
if ($tvakey > 0) // On affiche pas taux 0
|
||||
@ -465,9 +468,9 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
{
|
||||
$index++;
|
||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalLT1".$mysoc->pays_code), $useborder, 'L', 1);
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalLT1".$mysoc->pays_code), 0, 'L', 1);
|
||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax1), $useborder, 'R', 1);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax1), 0, 'R', 1);
|
||||
}
|
||||
|
||||
// Total LocalTax2
|
||||
@ -475,9 +478,9 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
{
|
||||
$index++;
|
||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalLT2".$mysoc->pays_code), $useborder, 'L', 1);
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalLT2".$mysoc->pays_code), 0, 'L', 1);
|
||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2), $useborder, 'R', 1);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2), 0, 'R', 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@ -70,6 +70,7 @@ class EcmDirectory // extends CommonObject
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
$error=0;
|
||||
$now=dol_now();
|
||||
|
||||
// Clean parameters
|
||||
@ -328,6 +329,8 @@ class EcmDirectory // extends CommonObject
|
||||
global $conf, $langs;
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
|
||||
|
||||
$error=0;
|
||||
|
||||
$relativepath=$this->getRelativePath(1); // Ex: dir1/dir2/dir3
|
||||
|
||||
dol_syslog("EcmDirectories::delete remove directory ".$relativepath);
|
||||
|
||||
@ -398,14 +398,14 @@ class Expedition extends CommonObject
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_syslog('Expedition::Fetch Error rowid='.$rowid.' numrows=0 sql='.$sql);
|
||||
$this->error='Delivery with id '.$rowid.' not found sql='.$sql;
|
||||
dol_syslog('Expedition::Fetch Error -2');
|
||||
$this->error='Delivery with id '.$id.' not found sql='.$sql;
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_syslog('Expedition::Fetch Error rowid='.$rowid.' Erreur dans fetch de l\'expedition');
|
||||
dol_syslog('Expedition::Fetch Error -1');
|
||||
$this->error=$this->db->error();
|
||||
return -1;
|
||||
}
|
||||
@ -768,8 +768,10 @@ class Expedition extends CommonObject
|
||||
function delete()
|
||||
{
|
||||
global $conf, $langs, $user;
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
|
||||
|
||||
$error=0;
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."expeditiondet";
|
||||
|
||||
@ -267,7 +267,7 @@ class Export
|
||||
$file = "export_".$model.".modules.php";
|
||||
$classname = "Export".$model;
|
||||
require_once($dir.$file);
|
||||
$objmodel = new $classname($db);
|
||||
$objmodel = new $classname($this->db);
|
||||
|
||||
if ($sqlquery) $sql = $sqlquery;
|
||||
else $sql=$this->build_sql($indice,$array_selected);
|
||||
|
||||
@ -309,7 +309,9 @@ class Fichinter extends CommonObject
|
||||
function setValid($user, $outputdir)
|
||||
{
|
||||
global $langs, $conf;
|
||||
|
||||
|
||||
$error=0;
|
||||
|
||||
if ($this->statut != 1)
|
||||
{
|
||||
$this->db->begin();
|
||||
@ -578,6 +580,7 @@ class Fichinter extends CommonObject
|
||||
if (! $this->db->query($sql) )
|
||||
{
|
||||
dol_syslog("Fichinter::delete error", LOG_ERR);
|
||||
$this->error=$this->db->lasterror();
|
||||
$error++;
|
||||
}
|
||||
|
||||
@ -589,7 +592,7 @@ class Fichinter extends CommonObject
|
||||
$error++;
|
||||
}
|
||||
|
||||
if ($err > 0)
|
||||
if ($error)
|
||||
{
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
|
||||
@ -706,6 +706,8 @@ class CommandeFournisseur extends Commande
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
$error=0;
|
||||
|
||||
dol_syslog("CommandeFournisseur::Refuse");
|
||||
$result = 0;
|
||||
if ($user->rights->fournisseur->commande->approuver)
|
||||
@ -750,6 +752,8 @@ class CommandeFournisseur extends Commande
|
||||
{
|
||||
global $langs,$conf;
|
||||
|
||||
$error=0;
|
||||
|
||||
//dol_syslog("CommandeFournisseur::Cancel");
|
||||
$result = 0;
|
||||
if ($user->rights->fournisseur->commande->commander)
|
||||
@ -847,7 +851,8 @@ class CommandeFournisseur extends Commande
|
||||
global $langs,$conf;
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
|
||||
$error=0;
|
||||
$now=dol_now();
|
||||
|
||||
/* On positionne en mode brouillon la commande */
|
||||
@ -919,6 +924,7 @@ class CommandeFournisseur extends Commande
|
||||
|
||||
/**
|
||||
* Add order line
|
||||
*
|
||||
* @param desc Description
|
||||
* @param pu_ht Unit price
|
||||
* @param qty Quantity
|
||||
@ -934,7 +940,7 @@ class CommandeFournisseur extends Commande
|
||||
* @param type Type of line (0=product, 1=service)
|
||||
* @return int <=0 if KO, >0 if OK
|
||||
*/
|
||||
function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $fk_prod_fourn_price=0, $fourn_ref='', $remise_percent=0, $price_base_type='HT', $pu_ttc=0, $type=0)
|
||||
function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $fk_prod_fourn_price=0, $fourn_ref='', $remise_percent=0, $price_base_type='HT', $pu_ttc=0, $type=0, $info_bits=0)
|
||||
{
|
||||
global $langs,$mysoc;
|
||||
|
||||
@ -1134,7 +1140,6 @@ class CommandeFournisseur extends Commande
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
if ($error == 0)
|
||||
@ -1188,13 +1193,14 @@ class CommandeFournisseur extends Commande
|
||||
/**
|
||||
* Delete an order
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @param User $user Object user
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function delete()
|
||||
function delete($user='')
|
||||
{
|
||||
global $langs,$conf;
|
||||
|
||||
$err = 0;
|
||||
$error = 0;
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
@ -1202,7 +1208,7 @@ class CommandeFournisseur extends Commande
|
||||
dol_syslog("FournisseurCommande::delete sql=".$sql, LOG_DEBUG);
|
||||
if (! $this->db->query($sql) )
|
||||
{
|
||||
$err++;
|
||||
$error++;
|
||||
}
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."commande_fournisseur WHERE rowid =".$this->id;
|
||||
@ -1211,15 +1217,15 @@ class CommandeFournisseur extends Commande
|
||||
{
|
||||
if ($this->db->affected_rows($resql) < 1)
|
||||
{
|
||||
$err++;
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$err++;
|
||||
$error++;
|
||||
}
|
||||
|
||||
if ($err == 0)
|
||||
if ($error == 0)
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
|
||||
@ -1630,10 +1636,10 @@ class CommandeFournisseur extends Commande
|
||||
$sql.= ",localtax1_tx='".price2num($txlocaltax1)."'";
|
||||
$sql.= ",localtax2_tx='".price2num($txlocaltax2)."'";
|
||||
$sql.= ",qty='".price2num($qty)."'";
|
||||
if ($date_end) { $sql.= ",date_start='$date_end'"; }
|
||||
/*if ($date_end) { $sql.= ",date_start='$date_end'"; }
|
||||
else { $sql.=',date_start=null'; }
|
||||
if ($date_end) { $sql.= ",date_end='$date_end'"; }
|
||||
else { $sql.=',date_end=null'; }
|
||||
else { $sql.=',date_end=null'; }*/
|
||||
$sql.= ",info_bits='".$info_bits."'";
|
||||
$sql.= ",total_ht='".price2num($total_ht)."'";
|
||||
$sql.= ",total_tva='".price2num($total_tva)."'";
|
||||
|
||||
@ -82,14 +82,11 @@ class FactureFournisseur extends Facture
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $DB Database handler
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
function FactureFournisseur($DB)
|
||||
function FactureFournisseur($db)
|
||||
{
|
||||
$this->db = $DB ;
|
||||
|
||||
$this->id = $facid;
|
||||
$this->socid = $socid;
|
||||
$this->db = $db;
|
||||
|
||||
$this->amount = 0;
|
||||
$this->remise = 0;
|
||||
@ -115,6 +112,7 @@ class FactureFournisseur extends Facture
|
||||
{
|
||||
global $langs,$conf;
|
||||
|
||||
$error=0;
|
||||
$now=dol_now();
|
||||
|
||||
// Clear parameters
|
||||
@ -255,6 +253,7 @@ class FactureFournisseur extends Facture
|
||||
function fetch($id='',$ref='')
|
||||
{
|
||||
global $langs;
|
||||
|
||||
$sql = "SELECT";
|
||||
$sql.= " t.rowid,";
|
||||
$sql.= " t.facnumber,";
|
||||
@ -356,8 +355,8 @@ class FactureFournisseur extends Facture
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error='Bill with id '.$rowid.' not found sql='.$sql;
|
||||
dol_syslog(get_class($this).'::Fetch rowid='.$rowid.' numrows=0 sql='.$sql);
|
||||
$this->error='Bill with id '.$id.' not found sql='.$sql;
|
||||
dol_syslog(get_class($this).'::Fetch rowid='.$id.' numrows=0 sql='.$sql);
|
||||
return -2;
|
||||
}
|
||||
|
||||
|
||||
@ -1231,7 +1231,7 @@ else
|
||||
array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse'),'idwarehouse','',1)));
|
||||
}
|
||||
|
||||
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateBill'), $langs->trans('ConfirmValidateBill', $object->ref), 'confirm_valid', $formquestion, 0, 1, 240);
|
||||
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateBill'), $langs->trans('ConfirmValidateBill', $object->ref), 'confirm_valid', $formquestion, 1, 1, 240);
|
||||
if ($ret == 'html') print '<br>';
|
||||
}
|
||||
|
||||
|
||||
@ -34,8 +34,9 @@ $langs->load('companies');
|
||||
$langs->load('bills');
|
||||
$langs->load('banks');
|
||||
|
||||
$facid=isset($_GET['facid'])?$_GET['facid']:$_POST['facid'];
|
||||
$action=isset($_GET['action'])?$_GET['action']:$_POST['action'];
|
||||
$facid=GETPOST('facid');
|
||||
$action=GETPOST('action');
|
||||
$socid=GETPOST('socid','int');
|
||||
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
@ -51,7 +52,6 @@ if (! $sortfield) $sortfield="p.rowid";
|
||||
$amounts = array();
|
||||
|
||||
// Security check
|
||||
$socid=0;
|
||||
if ($user->societe_id > 0)
|
||||
{
|
||||
$socid = $user->societe_id;
|
||||
@ -159,7 +159,7 @@ if ($action == 'add_paiement')
|
||||
}
|
||||
}
|
||||
if ($invoiceid > 0) $loc = DOL_URL_ROOT.'/fourn/facture/fiche.php?facid='.$invoiceid;
|
||||
else $loc = DOL_URL_ROOT.'/compta/paiement/fiche.php?id='.$paiement_id;
|
||||
else $loc = DOL_URL_ROOT.'/fourn/paiement/fiche.php?id='.$paiement_id;
|
||||
Header('Location: '.$loc);
|
||||
exit;
|
||||
}
|
||||
@ -170,6 +170,7 @@ if ($action == 'add_paiement')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
@ -208,7 +209,7 @@ if ($action == 'create' || $action == 'add_paiement')
|
||||
|
||||
print_fiche_titre($langs->trans('DoPayment'));
|
||||
|
||||
if ($mesg) dol_htmloutput_mesg($mesg);
|
||||
if ($mesg) dol_htmloutput_mesg($mesg);
|
||||
if ($errmsg) dol_htmloutput_errors($errmsg);
|
||||
|
||||
print '<form name="addpaiement" action="paiement.php" method="post">';
|
||||
@ -344,7 +345,7 @@ if ($action == 'create' || $action == 'add_paiement')
|
||||
}
|
||||
|
||||
/*
|
||||
* Affichage liste
|
||||
* Show list
|
||||
*/
|
||||
if (! $_GET['action'] && ! $_POST['action'])
|
||||
{
|
||||
@ -355,16 +356,16 @@ if (! $_GET['action'] && ! $_POST['action'])
|
||||
if (! $sortorder) $sortorder='DESC';
|
||||
if (! $sortfield) $sortfield='p.datep';
|
||||
|
||||
$sql = 'SELECT p.rowid, p.rowid as pid, p.datep as dp, p.amount as pamount,';
|
||||
$sql.= ' f.rowid as facid, f.rowid as ref, f.facnumber, f.amount,';
|
||||
$sql = 'SELECT p.rowid as pid, p.datep as dp, p.amount as pamount, p.num_paiement,';
|
||||
$sql.= ' s.rowid as socid, s.nom,';
|
||||
$sql.= ' c.libelle as paiement_type, p.num_paiement,';
|
||||
$sql.= ' ba.rowid as bid, ba.label';
|
||||
if (!$user->rights->societe->client->voir) $sql .= ", sc.fk_soc, sc.fk_user ";
|
||||
$sql.= ' c.libelle as paiement_type,';
|
||||
$sql.= ' ba.rowid as bid, ba.label,';
|
||||
if (!$user->rights->societe->client->voir) $sql .= ' sc.fk_soc, sc.fk_user,';
|
||||
$sql.= ' SUM(f.amount)';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'paiementfourn AS p';
|
||||
if (!$user->rights->societe->client->voir) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn AS pf ON p.rowid=pf.fk_paiementfourn';
|
||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'facture_fourn AS f ON f.rowid=pf.fk_facturefourn ';
|
||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'facture_fourn AS f ON f.rowid=pf.fk_facturefourn';
|
||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement AS c ON p.fk_paiement = c.id';
|
||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe AS s ON s.rowid = f.fk_soc';
|
||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON p.fk_bank = b.rowid';
|
||||
@ -378,26 +379,28 @@ if (! $_GET['action'] && ! $_POST['action'])
|
||||
// Search criteria
|
||||
if ($_REQUEST["search_ref"])
|
||||
{
|
||||
$sql .=" AND p.rowid=".$_REQUEST["search_ref"];
|
||||
$sql .= ' AND p.rowid='.$db->escape($_REQUEST["search_ref"]);
|
||||
}
|
||||
if ($_REQUEST["search_account"])
|
||||
{
|
||||
$sql .=" AND b.fk_account=".$_REQUEST["search_account"];
|
||||
$sql .= ' AND b.fk_account='.$db->escape($_REQUEST["search_account"]);
|
||||
}
|
||||
if ($_REQUEST["search_paymenttype"])
|
||||
{
|
||||
$sql .=" AND c.code='".$_REQUEST["search_paymenttype"]."'";
|
||||
$sql .= " AND c.code='".$db->escape($_REQUEST["search_paymenttype"])."'";
|
||||
}
|
||||
if ($_REQUEST["search_amount"])
|
||||
{
|
||||
$sql .=" AND p.amount=".price2num($_REQUEST["search_amount"]);
|
||||
$sql .= " AND p.amount=".price2num($_REQUEST["search_amount"]);
|
||||
}
|
||||
if ($_REQUEST["search_company"])
|
||||
{
|
||||
$sql .=" AND s.nom LIKE '%".$db->escape($_REQUEST["search_company"])."%'";
|
||||
$sql .= " AND s.nom LIKE '%".$db->escape($_REQUEST["search_company"])."%'";
|
||||
}
|
||||
$sql.= " GROUP BY p.rowid, p.datep, p.amount, p.num_paiement, s.rowid, s.nom, c.libelle, ba.rowid, ba.label";
|
||||
if (!$user->rights->societe->client->voir) $sql .= ", sc.fk_soc, sc.fk_user";
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
$sql.= $db->plimit($limit + 1 ,$offset);
|
||||
$sql.= $db->plimit($limit+1, $offset);
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
@ -413,8 +416,8 @@ if (! $_GET['action'] && ! $_POST['action'])
|
||||
|
||||
print_barre_liste($langs->trans('SupplierPayments'), $page, 'paiement.php',$paramlist,$sortfield,$sortorder,'',$num);
|
||||
|
||||
if ($mesg) print $mesg;
|
||||
if ($errmsg) print $errmsg;
|
||||
if ($mesg) dol_htmloutput_mesg($mesg);
|
||||
if ($errmsg) dol_htmloutput_errors($errmsg);
|
||||
|
||||
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
@ -49,7 +49,7 @@ $object = new PaiementFourn($db);
|
||||
if ($action == 'setnote' && $user->rights->fournisseur->facture->creer)
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
|
||||
$object->fetch($id);
|
||||
$result = $object->update_note(GETPOST('note'));
|
||||
if ($result > 0)
|
||||
@ -67,7 +67,7 @@ if ($action == 'setnote' && $user->rights->fournisseur->facture->creer)
|
||||
if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->fournisseur->facture->supprimer)
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
|
||||
$object->fetch($id);
|
||||
$result = $object->delete();
|
||||
if ($result > 0)
|
||||
@ -177,11 +177,13 @@ if ($result > 0)
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr>';
|
||||
print '<td valign="top" width="20%" colspan="2">'.$langs->trans('Ref').'</td><td colspan="3">'.$object->id.'</td></tr>';
|
||||
print '<td valign="top" width="20%" colspan="2">'.$langs->trans('Ref').'</td><td colspan="3">';
|
||||
print $form->showrefnav($object,'id','',1,'rowid','ref');
|
||||
print '</td></tr>';
|
||||
|
||||
// Date payment
|
||||
print '<tr><td valign="top" colspan="2">'.$form->editfieldkey("Date",'date',$object->date,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer).'</td><td colspan="3">';
|
||||
print $form->editfieldval("Date",'date',$object->date,'id',$object->id,$object->statut == 0 && $user->rights->fournisseur->facture->creer,'day');
|
||||
print $form->editfieldval("Date",'date',$object->date,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer,'day');
|
||||
print '</td></tr>';
|
||||
|
||||
// Payment mode
|
||||
@ -189,7 +191,7 @@ if ($result > 0)
|
||||
|
||||
// Payment numero
|
||||
print '<tr><td valign="top" colspan="2">'.$form->editfieldkey("Numero",'num',$object->numero,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer).'</td><td colspan="3">';
|
||||
print $form->editfieldval("Numero",'num',$object->numero,'id',$object->id,$object->statut == 0 && $user->rights->fournisseur->facture->creer,'string');
|
||||
print $form->editfieldval("Numero",'num',$object->numero,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer,'string');
|
||||
print '</td></tr>';
|
||||
|
||||
// Amount
|
||||
@ -202,7 +204,7 @@ if ($result > 0)
|
||||
|
||||
// Note
|
||||
print '<tr><td valign="top"" colspan="2">'.$form->editfieldkey("Note",'note',$object->note,$object,$user->rights->fournisseur->facture->creer).'</td><td colspan="3">';
|
||||
print $form->editfieldval("Note",'note',$object->note,'id',$object->id,$user->rights->fournisseur->facture->creer,'text');
|
||||
print $form->editfieldval("Note",'note',$object->note,$object,$user->rights->fournisseur->facture->creer,'text');
|
||||
print '</td></tr>';
|
||||
|
||||
// Bank account
|
||||
|
||||
BIN
htdocs/includes/tcpdf/fonts/freemono.ctg.z
Executable file
BIN
htdocs/includes/tcpdf/fonts/freemono.ctg.z
Executable file
Binary file not shown.
BIN
htdocs/includes/tcpdf/fonts/freemono.z
Executable file
BIN
htdocs/includes/tcpdf/fonts/freemono.z
Executable file
Binary file not shown.
BIN
htdocs/includes/tcpdf/fonts/freemonob.ctg.z
Executable file
BIN
htdocs/includes/tcpdf/fonts/freemonob.ctg.z
Executable file
Binary file not shown.
BIN
htdocs/includes/tcpdf/fonts/freemonob.z
Executable file
BIN
htdocs/includes/tcpdf/fonts/freemonob.z
Executable file
Binary file not shown.
BIN
htdocs/includes/tcpdf/fonts/freemonobi.ctg.z
Executable file
BIN
htdocs/includes/tcpdf/fonts/freemonobi.ctg.z
Executable file
Binary file not shown.
BIN
htdocs/includes/tcpdf/fonts/freemonobi.z
Executable file
BIN
htdocs/includes/tcpdf/fonts/freemonobi.z
Executable file
Binary file not shown.
BIN
htdocs/includes/tcpdf/fonts/freemonoi.ctg.z
Executable file
BIN
htdocs/includes/tcpdf/fonts/freemonoi.ctg.z
Executable file
Binary file not shown.
BIN
htdocs/includes/tcpdf/fonts/freemonoi.z
Executable file
BIN
htdocs/includes/tcpdf/fonts/freemonoi.z
Executable file
Binary file not shown.
@ -33,6 +33,10 @@ require_once(DOL_DOCUMENT_ROOT."/boxes.php");
|
||||
if (! isset($_GET["mainmenu"])) $_GET["mainmenu"]="home";
|
||||
|
||||
|
||||
include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php');
|
||||
$hookmanager=new HookManager($db);
|
||||
$hookmanager->callHooks(array('index'));
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@ -250,6 +254,11 @@ if ($user->societe_id == 0)
|
||||
}
|
||||
}
|
||||
|
||||
$object=(object) array();
|
||||
$parameters=array();
|
||||
$action='';
|
||||
$reshook=$hookmanager->executeHooks('addStatisticLine',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
print '</table>';
|
||||
}
|
||||
|
||||
|
||||
@ -1354,13 +1354,11 @@ function migrate_price_propal($db,$langs,$conf)
|
||||
else
|
||||
{
|
||||
print "Error id=".$propal->id;
|
||||
$err++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print "Error #3";
|
||||
$err++;
|
||||
}
|
||||
*/
|
||||
$i++;
|
||||
@ -1378,7 +1376,6 @@ function migrate_price_propal($db,$langs,$conf)
|
||||
else
|
||||
{
|
||||
print "Error #1 ".$db->error();
|
||||
$err++;
|
||||
|
||||
$db->rollback();
|
||||
}
|
||||
@ -1458,13 +1455,11 @@ function migrate_price_contrat($db,$langs,$conf)
|
||||
else
|
||||
{
|
||||
print "Error id=".$propal->id;
|
||||
$err++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print "Error #3";
|
||||
$err++;
|
||||
}
|
||||
*/
|
||||
$i++;
|
||||
@ -1482,7 +1477,6 @@ function migrate_price_contrat($db,$langs,$conf)
|
||||
else
|
||||
{
|
||||
print "Error #1 ".$db->error();
|
||||
$err++;
|
||||
|
||||
$db->rollback();
|
||||
}
|
||||
@ -1560,13 +1554,11 @@ function migrate_price_commande($db,$langs,$conf)
|
||||
else
|
||||
{
|
||||
print "Error id=".$commande->id;
|
||||
$err++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print "Error #3";
|
||||
$err++;
|
||||
}
|
||||
*/
|
||||
$i++;
|
||||
@ -1594,7 +1586,6 @@ function migrate_price_commande($db,$langs,$conf)
|
||||
else
|
||||
{
|
||||
print "Error #1 ".$db->error();
|
||||
$err++;
|
||||
|
||||
$db->rollback();
|
||||
}
|
||||
@ -1672,13 +1663,11 @@ function migrate_price_commande_fournisseur($db,$langs,$conf)
|
||||
else
|
||||
{
|
||||
print "Error id=".$commande->id;
|
||||
$err++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print "Error #3";
|
||||
$err++;
|
||||
}
|
||||
*/
|
||||
$i++;
|
||||
@ -1706,7 +1695,6 @@ function migrate_price_commande_fournisseur($db,$langs,$conf)
|
||||
else
|
||||
{
|
||||
print "Error #1 ".$db->error();
|
||||
$err++;
|
||||
|
||||
$db->rollback();
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user