Qual: Fix a ton of CheckStyle errors
This commit is contained in:
parent
d6a60c085a
commit
ed41e03589
@ -1,8 +1,8 @@
|
||||
<?php
|
||||
#
|
||||
# Take a look at conf.php.example file for an example of conf.php file
|
||||
# and explanations for all possibles parameters.
|
||||
#
|
||||
# This file will be filled by installer
|
||||
#
|
||||
//
|
||||
// Take a look at conf.php.example file for an example of conf.php file
|
||||
// and explanations for all possibles parameters.
|
||||
//
|
||||
// This file will be filled by installer
|
||||
//
|
||||
?>
|
||||
@ -75,7 +75,7 @@ class Facturation
|
||||
public function Facturation()
|
||||
{
|
||||
$this->raz();
|
||||
$this->raz_pers();
|
||||
$this->razPers();
|
||||
}
|
||||
|
||||
|
||||
@ -115,7 +115,7 @@ class Facturation
|
||||
|
||||
|
||||
// Define part of HT, VAT, TTC
|
||||
$resultarray=calcul_price_total($this->qte,$this->prix(),$this->remise_percent(),$vat_rate,0,0,0,'HT',0);
|
||||
$resultarray=calcul_price_total($this->qte,$this->prix(),$this->remisePercent(),$vat_rate,0,0,0,'HT',0);
|
||||
|
||||
// Calcul du total ht sans remise
|
||||
$total_ht = $resultarray[0];
|
||||
@ -123,14 +123,14 @@ class Facturation
|
||||
$total_ttc = $resultarray[2];
|
||||
|
||||
// Calcul du montant de la remise
|
||||
if ($this->remise_percent())
|
||||
if ($this->remisePercent())
|
||||
{
|
||||
$remise_percent = $this->remise_percent();
|
||||
$remise_percent = $this->remisePercent();
|
||||
} else {
|
||||
$remise_percent = 0;
|
||||
}
|
||||
$montant_remise_ht = ($resultarray[6] - $resultarray[0]);
|
||||
$this->montant_remise($montant_remise_ht);
|
||||
$this->montantRemise($montant_remise_ht);
|
||||
|
||||
$product = new Product($db);
|
||||
$product->fetch($this->id);
|
||||
@ -234,8 +234,8 @@ class Facturation
|
||||
$this->ref('RESET');
|
||||
$this->qte('RESET');
|
||||
$this->stock('RESET');
|
||||
$this->remise_percent('RESET');
|
||||
$this->montant_remise('RESET');
|
||||
$this->remisePercent('RESET');
|
||||
$this->montantRemise('RESET');
|
||||
$this->prix('RESET');
|
||||
$this->tva('RESET');
|
||||
}
|
||||
@ -245,13 +245,13 @@ class Facturation
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function raz_pers()
|
||||
private function razPers()
|
||||
{
|
||||
$this->num_facture('RESET');
|
||||
$this->numInvoice('RESET');
|
||||
$this->getSetPaymentMode('RESET');
|
||||
$this->montant_encaisse('RESET');
|
||||
$this->montant_rendu('RESET');
|
||||
$this->paiement_le('RESET');
|
||||
$this->montantEncaisse('RESET');
|
||||
$this->montantRendu('RESET');
|
||||
$this->paiementLe('RESET');
|
||||
|
||||
$this->prix_total_ht('RESET');
|
||||
$this->montant_tva('RESET');
|
||||
@ -368,7 +368,7 @@ class Facturation
|
||||
* @param string $aRemisePercent Discount
|
||||
* @return string Discount
|
||||
*/
|
||||
public function remise_percent($aRemisePercent=null)
|
||||
public function remisePercent($aRemisePercent=null)
|
||||
{
|
||||
|
||||
if ( !$aRemisePercent )
|
||||
@ -392,7 +392,7 @@ class Facturation
|
||||
* @param int $aMontantRemise Amount
|
||||
* @return string Amount
|
||||
*/
|
||||
public function montant_remise($aMontantRemise=null)
|
||||
public function montantRemise($aMontantRemise=null)
|
||||
{
|
||||
|
||||
if ( !$aMontantRemise ) {
|
||||
@ -467,7 +467,7 @@ class Facturation
|
||||
* @param string $aNumFacture Invoice ref
|
||||
* @return string Invoice ref
|
||||
*/
|
||||
public function num_facture( $aNumFacture=null )
|
||||
public function numInvoice( $aNumFacture=null )
|
||||
{
|
||||
|
||||
if ( !$aNumFacture ) {
|
||||
@ -516,7 +516,7 @@ class Facturation
|
||||
* @param int $aMontantEncaisse Amount
|
||||
* @return int Amount
|
||||
*/
|
||||
public function montant_encaisse( $aMontantEncaisse=null )
|
||||
public function montantEncaisse( $aMontantEncaisse=null )
|
||||
{
|
||||
|
||||
if ( !$aMontantEncaisse ) {
|
||||
@ -541,7 +541,7 @@ class Facturation
|
||||
* @param int $aMontantRendu Amount
|
||||
* @return int Amount
|
||||
*/
|
||||
public function montant_rendu( $aMontantRendu=null )
|
||||
public function montantRendu( $aMontantRendu=null )
|
||||
{
|
||||
|
||||
if ( !$aMontantRendu ) {
|
||||
@ -565,7 +565,7 @@ class Facturation
|
||||
* @param date $aPaiementLe Date
|
||||
* @return date Date
|
||||
*/
|
||||
public function paiement_le( $aPaiementLe=null )
|
||||
public function paiementLe( $aPaiementLe=null )
|
||||
{
|
||||
if ( !$aPaiementLe ) {
|
||||
|
||||
|
||||
@ -154,9 +154,9 @@ $tab_tva = $ret;
|
||||
|
||||
// Reinitialisation du mode de paiement, en cas de retour aux achats apres validation
|
||||
$obj_facturation->getSetPaymentMode('RESET');
|
||||
$obj_facturation->montant_encaisse('RESET');
|
||||
$obj_facturation->montant_rendu('RESET');
|
||||
$obj_facturation->paiement_le('RESET');
|
||||
$obj_facturation->montantEncaisse('RESET');
|
||||
$obj_facturation->montantRendu('RESET');
|
||||
$obj_facturation->paiementLe('RESET');
|
||||
|
||||
|
||||
// Affichage des templates
|
||||
|
||||
@ -36,7 +36,7 @@ switch ( $_GET['action'] )
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
|
||||
if ($conf->stock->enabled && !empty($conf_fkentrepot)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = ".$conf_fkentrepot;
|
||||
$sql.= " WHERE p.entity IN (".getEntity('product', 1).")";
|
||||
|
||||
|
||||
// Recuperation des donnees en fonction de la source (liste deroulante ou champ texte) ...
|
||||
if ( $_POST['hdnSource'] == 'LISTE' )
|
||||
{
|
||||
@ -138,7 +138,7 @@ switch ( $_GET['action'] )
|
||||
{
|
||||
$obj_facturation->qte($_POST['txtQte']);
|
||||
$obj_facturation->tva($_POST['selTva']);
|
||||
$obj_facturation->remise_percent($_POST['txtRemise']);
|
||||
$obj_facturation->remisePercent($_POST['txtRemise']);
|
||||
$obj_facturation->ajoutArticle();
|
||||
|
||||
}
|
||||
|
||||
@ -25,7 +25,7 @@ $langs->load("main");
|
||||
|
||||
<table class="table_resume">
|
||||
|
||||
<tr><td class="resume_label"><?php echo $langs->trans("Invoice"); ?></td><td><?php echo $obj_facturation->num_facture(); ?></td></tr>
|
||||
<tr><td class="resume_label"><?php echo $langs->trans("Invoice"); ?></td><td><?php echo $obj_facturation->numInvoice(); ?></td></tr>
|
||||
<tr><td class="resume_label"><?php echo $langs->trans("TotalHT"); ?></td><td><?php echo price2num($obj_facturation->prix_total_ht(),'MT').' '.$conf->currency; ?></td></tr>
|
||||
<?php
|
||||
// Affichage de la tva par taux
|
||||
@ -81,18 +81,18 @@ $langs->load("main");
|
||||
// Affichage des infos en fonction du mode de paiement
|
||||
if ( $obj_facturation->getsetPaymentMode() == 'DIF' ) {
|
||||
|
||||
echo ('<tr><td class="resume_label">'.$langs->trans("DateEcheance").'</td><td>'.$obj_facturation->paiement_le().'</td></tr>');
|
||||
echo ('<tr><td class="resume_label">'.$langs->trans("DateEcheance").'</td><td>'.$obj_facturation->paiementLe().'</td></tr>');
|
||||
|
||||
} else {
|
||||
|
||||
echo ('<tr><td class="resume_label">'.$langs->trans("Received").'</td><td>'.price2num($obj_facturation->montant_encaisse(),'MT').' '.$conf->currency.'</td></tr>');
|
||||
echo ('<tr><td class="resume_label">'.$langs->trans("Received").'</td><td>'.price2num($obj_facturation->montantEncaisse(),'MT').' '.$conf->currency.'</td></tr>');
|
||||
|
||||
}
|
||||
|
||||
// Affichage du montant rendu (reglement en especes)
|
||||
if ( $obj_facturation->montant_rendu() ) {
|
||||
if ( $obj_facturation->montantRendu() ) {
|
||||
|
||||
echo ('<tr><td class="resume_label">'.$langs->trans("Change").'</td><td>'.price2num($obj_facturation->montant_rendu(),'MT').' '.$conf->currency.'</td></tr>');
|
||||
echo ('<tr><td class="resume_label">'.$langs->trans("Change").'</td><td>'.price2num($obj_facturation->montantRendu(),'MT').' '.$conf->currency.'</td></tr>');
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -50,7 +50,7 @@ switch ($action)
|
||||
$invoice->type=0;
|
||||
$num=$invoice->getNextNumRef($company);
|
||||
|
||||
$obj_facturation->num_facture($num);
|
||||
$obj_facturation->numInvoice($num);
|
||||
|
||||
$obj_facturation->getSetPaymentMode($_POST['hdnChoix']);
|
||||
|
||||
@ -63,20 +63,20 @@ switch ($action)
|
||||
}
|
||||
|
||||
if ( $mode_reglement != 'DIF') {
|
||||
$obj_facturation->montant_encaisse($montant);
|
||||
$obj_facturation->montantEncaisse($montant);
|
||||
|
||||
//Determination de la somme rendue
|
||||
$total = $obj_facturation->prix_total_ttc();
|
||||
$encaisse = $obj_facturation->montant_encaisse();
|
||||
$encaisse = $obj_facturation->montantEncaisse();
|
||||
|
||||
$obj_facturation->montant_rendu($encaisse - $total);
|
||||
$obj_facturation->montantRendu($encaisse - $total);
|
||||
}
|
||||
else
|
||||
{
|
||||
//$txtDatePaiement=$_POST['txtDatePaiement'];
|
||||
$datePaiement=dol_mktime(0,0,0,$_POST['txtDatePaiementmonth'],$_POST['txtDatePaiementday'],$_POST['txtDatePaiementyear']);
|
||||
$txtDatePaiement=dol_print_date($datePaiement,'dayrfc');
|
||||
$obj_facturation->paiement_le($txtDatePaiement);
|
||||
$obj_facturation->paiementLe($txtDatePaiement);
|
||||
}
|
||||
|
||||
$redirection = 'affIndex.php?menu=validation';
|
||||
@ -115,8 +115,8 @@ switch ($action)
|
||||
$mode_reglement_id = dol_getIdFromCode($db,'LIQ','c_paiement');
|
||||
$cond_reglement_id = 0;
|
||||
$note .= $langs->trans("Cash")."\n";
|
||||
$note .= $langs->trans("Received").' : '.$obj_facturation->montant_encaisse()." ".$conf->currency."\n";
|
||||
$note .= $langs->trans("Rendu").' : '.$obj_facturation->montant_rendu()." ".$conf->currency."\n";
|
||||
$note .= $langs->trans("Received").' : '.$obj_facturation->montantEncaisse()." ".$conf->currency."\n";
|
||||
$note .= $langs->trans("Rendu").' : '.$obj_facturation->montantRendu()." ".$conf->currency."\n";
|
||||
$note .= "\n";
|
||||
$note .= '--------------------------------------'."\n\n";
|
||||
break;
|
||||
@ -209,10 +209,10 @@ switch ($action)
|
||||
// Si paiement differe ...
|
||||
if ( $obj_facturation->getSetPaymentMode() == 'DIF' )
|
||||
{
|
||||
$resultcreate=$invoice->create($user,0,dol_stringtotime($obj_facturation->paiement_le()));
|
||||
$resultcreate=$invoice->create($user,0,dol_stringtotime($obj_facturation->paiementLe()));
|
||||
if ($resultcreate > 0)
|
||||
{
|
||||
$resultvalid=$invoice->validate($user,$obj_facturation->num_facture());
|
||||
$resultvalid=$invoice->validate($user,$obj_facturation->numInvoice());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -226,7 +226,7 @@ switch ($action)
|
||||
$resultcreate=$invoice->create($user,0,0);
|
||||
if ($resultcreate > 0)
|
||||
{
|
||||
$resultvalid=$invoice->validate($user, $obj_facturation->num_facture(), (isset($_SESSION["CASHDESK_ID_WAREHOUSE"])?$_SESSION["CASHDESK_ID_WAREHOUSE"]:0));
|
||||
$resultvalid=$invoice->validate($user, $obj_facturation->numInvoice(), (isset($_SESSION["CASHDESK_ID_WAREHOUSE"])?$_SESSION["CASHDESK_ID_WAREHOUSE"]:0));
|
||||
|
||||
$id = $invoice->id;
|
||||
|
||||
@ -235,7 +235,7 @@ switch ($action)
|
||||
$payment->datepaye=$now;
|
||||
$payment->bank_account=$conf_fkaccount;
|
||||
$payment->amounts[$invoice->id]=$obj_facturation->prix_total_ttc();
|
||||
$payment->note=$langs->trans("Payment").' '.$langs->trans("Invoice").' '.$obj_facturation->num_facture();
|
||||
$payment->note=$langs->trans("Payment").' '.$langs->trans("Invoice").' '.$obj_facturation->numInvoice();
|
||||
$payment->paiementid=$invoice->mode_reglement_id;
|
||||
$payment->num_paiement='';
|
||||
|
||||
|
||||
@ -77,9 +77,10 @@ class Mailing extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Create an EMailing
|
||||
* \param user Object of user making creation
|
||||
* \return -1 if error, Id of created object if OK
|
||||
* Create an EMailing
|
||||
*
|
||||
* @param User $user Object of user making creation
|
||||
* @return int -1 if error, Id of created object if OK
|
||||
*/
|
||||
function create($user)
|
||||
{
|
||||
@ -133,9 +134,10 @@ class Mailing extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Update emailing record
|
||||
* \param user Object of user making change
|
||||
* \return < 0 if KO, > 0 if OK
|
||||
* Update emailing record
|
||||
*
|
||||
* @param User $user Object of user making change
|
||||
* @return int < 0 if KO, > 0 if OK
|
||||
*/
|
||||
function update($user)
|
||||
{
|
||||
@ -165,9 +167,10 @@ class Mailing extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Get object from database
|
||||
* \param rowid id du mailing
|
||||
* \return int
|
||||
* Get object from database
|
||||
*
|
||||
* @param int $rowid Id of emailing
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function fetch($rowid)
|
||||
{
|
||||
@ -227,9 +230,10 @@ class Mailing extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* \brief Load an object from its id and create a new one in database
|
||||
* \param fromid Id of object to clone
|
||||
* \return int New id of clone
|
||||
* Load an object from its id and create a new one in database
|
||||
*
|
||||
* @param int $fromid Id of object to clone
|
||||
* @return int New id of clone
|
||||
*/
|
||||
function createFromClone($fromid,$option1,$option2)
|
||||
{
|
||||
@ -303,9 +307,10 @@ class Mailing extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Validate emailing
|
||||
* \param user Objet user qui valide
|
||||
* \return int <0 if KO, >0 if OK
|
||||
* Validate emailing
|
||||
*
|
||||
* @param User $user Objet user qui valide
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function valid($user)
|
||||
{
|
||||
@ -328,9 +333,10 @@ class Mailing extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* \brief Delete emailing
|
||||
* \param rowid id du mailing a supprimer
|
||||
* \return int 1 en cas de succes
|
||||
* Delete emailing
|
||||
*
|
||||
* @param int $rowid id du mailing a supprimer
|
||||
* @return int 1 en cas de succes
|
||||
*/
|
||||
function delete($rowid)
|
||||
{
|
||||
@ -353,9 +359,10 @@ class Mailing extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* \brief Change status of each recipient
|
||||
* \param user Objet user qui valide
|
||||
* \return int <0 if KO, >0 if OK
|
||||
* Change status of each recipient
|
||||
*
|
||||
* @param User $user Objet user qui valide
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function reset_targets_status($user)
|
||||
{
|
||||
@ -379,9 +386,10 @@ class Mailing extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* \brief Retourne le libelle du statut d'un mailing (brouillon, validee, ...
|
||||
* \param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long
|
||||
* \return string Libelle
|
||||
* Retourne le libelle du statut d'un mailing (brouillon, validee, ...
|
||||
*
|
||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long
|
||||
* @return string Label
|
||||
*/
|
||||
function getLibStatut($mode=0)
|
||||
{
|
||||
@ -389,10 +397,11 @@ class Mailing extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Renvoi le libelle d'un statut donn<EFBFBD>
|
||||
* \param statut Id statut
|
||||
* \param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||
* \return string Libelle du statut
|
||||
* Renvoi le libelle d'un statut donne
|
||||
*
|
||||
* @param int $statut Id statut
|
||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||
* @return string Label
|
||||
*/
|
||||
function LibStatut($statut,$mode=0)
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -50,8 +50,9 @@ class Prospect extends Societe
|
||||
|
||||
|
||||
/**
|
||||
* \brief Charge indicateurs this->nb de tableau de bord
|
||||
* \return int <0 if KO, >0 if OK
|
||||
* Charge indicateurs this->nb de tableau de bord
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function load_state_board()
|
||||
{
|
||||
@ -92,9 +93,10 @@ class Prospect extends Societe
|
||||
|
||||
|
||||
/**
|
||||
* \brief Return status of prospect
|
||||
* \param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long
|
||||
* \return string Libelle
|
||||
* Return status of prospect
|
||||
*
|
||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long
|
||||
* @return string Libelle
|
||||
*/
|
||||
function getLibProspStatut($mode=0)
|
||||
{
|
||||
@ -102,10 +104,11 @@ class Prospect extends Societe
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Return label of a given status
|
||||
* \param statut Id statut
|
||||
* \param mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
|
||||
* \return string Libelle du statut
|
||||
* Return label of a given status
|
||||
*
|
||||
* @param int $statut Id statut
|
||||
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
|
||||
* @return string Libelle du statut
|
||||
*/
|
||||
function LibProspStatut($statut,$mode=0)
|
||||
{
|
||||
@ -141,8 +144,9 @@ class Prospect extends Societe
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Renvoi le libelle du niveau
|
||||
* \return string Libelle
|
||||
* Renvoi le libelle du niveau
|
||||
*
|
||||
* @return string Libelle
|
||||
*/
|
||||
function getLibLevel()
|
||||
{
|
||||
@ -150,9 +154,10 @@ class Prospect extends Societe
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Renvoi le libelle du niveau
|
||||
* \param fk_prospectlevel Prospect level
|
||||
* \return string Libelle du niveau
|
||||
* Renvoi le libelle du niveau
|
||||
*
|
||||
* @param int $fk_prospectlevel Prospect level
|
||||
* @return string Libelle du niveau
|
||||
*/
|
||||
function LibLevel($fk_prospectlevel)
|
||||
{
|
||||
|
||||
@ -510,6 +510,7 @@ class Commande extends CommonObject
|
||||
* Cancel an order
|
||||
* If stock is decremented on order validation, we must reincrement it
|
||||
*
|
||||
* @param User $user Object user
|
||||
* @param int $idwarehouse Id warehouse to use for stock change.
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
@ -588,7 +589,7 @@ class Commande extends CommonObject
|
||||
* Note that this->ref can be set or empty. If empty, we will use "(PROV)"
|
||||
*
|
||||
* @param User $user Objet user that make creation
|
||||
* @param int notrigger Disable all triggers
|
||||
* @param int $notrigger Disable all triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function create($user, $notrigger=0)
|
||||
@ -671,25 +672,25 @@ class Commande extends CommonObject
|
||||
}
|
||||
|
||||
$result = $this->addline(
|
||||
$this->id,
|
||||
$this->lines[$i]->desc,
|
||||
$this->lines[$i]->subprice,
|
||||
$this->lines[$i]->qty,
|
||||
$this->lines[$i]->tva_tx,
|
||||
$this->lines[$i]->localtax1_tx,
|
||||
$this->lines[$i]->localtax2_tx,
|
||||
$this->lines[$i]->fk_product,
|
||||
$this->lines[$i]->remise_percent,
|
||||
$this->lines[$i]->info_bits,
|
||||
$this->lines[$i]->fk_remise_except,
|
||||
'HT',
|
||||
0,
|
||||
$this->lines[$i]->date_start,
|
||||
$this->lines[$i]->date_end,
|
||||
$this->lines[$i]->product_type,
|
||||
$this->lines[$i]->rang,
|
||||
$this->lines[$i]->special_code,
|
||||
$fk_parent_line
|
||||
$this->id,
|
||||
$this->lines[$i]->desc,
|
||||
$this->lines[$i]->subprice,
|
||||
$this->lines[$i]->qty,
|
||||
$this->lines[$i]->tva_tx,
|
||||
$this->lines[$i]->localtax1_tx,
|
||||
$this->lines[$i]->localtax2_tx,
|
||||
$this->lines[$i]->fk_product,
|
||||
$this->lines[$i]->remise_percent,
|
||||
$this->lines[$i]->info_bits,
|
||||
$this->lines[$i]->fk_remise_except,
|
||||
'HT',
|
||||
0,
|
||||
$this->lines[$i]->date_start,
|
||||
$this->lines[$i]->date_end,
|
||||
$this->lines[$i]->product_type,
|
||||
$this->lines[$i]->rang,
|
||||
$this->lines[$i]->special_code,
|
||||
$fk_parent_line
|
||||
);
|
||||
if ($result < 0)
|
||||
{
|
||||
@ -711,7 +712,7 @@ class Commande extends CommonObject
|
||||
if ($this->id)
|
||||
{
|
||||
$this->ref="(PROV".$this->id.")";
|
||||
|
||||
|
||||
// Add object linked
|
||||
if (is_array($this->linked_objects) && ! empty($this->linked_objects))
|
||||
{
|
||||
@ -723,25 +724,25 @@ class Commande extends CommonObject
|
||||
dol_print_error($this->db);
|
||||
$error++;
|
||||
}
|
||||
|
||||
|
||||
// TODO mutualiser
|
||||
if ($origin == 'propal' && $origin_id)
|
||||
{
|
||||
// On recupere les differents contact interne et externe
|
||||
$prop = new Propal($this->db, $this->socid, $origin_id);
|
||||
|
||||
|
||||
// On recupere le commercial suivi propale
|
||||
$this->userid = $prop->getIdcontact('internal', 'SALESREPFOLL');
|
||||
|
||||
|
||||
if ($this->userid)
|
||||
{
|
||||
//On passe le commercial suivi propale en commercial suivi commande
|
||||
$this->add_contact($this->userid[0], 'SALESREPFOLL', 'internal');
|
||||
}
|
||||
|
||||
|
||||
// On recupere le contact client suivi propale
|
||||
$this->contactid = $prop->getIdcontact('external', 'CUSTOMER');
|
||||
|
||||
|
||||
if ($this->contactid)
|
||||
{
|
||||
//On passe le contact client suivi propale en contact client suivi commande
|
||||
@ -922,7 +923,7 @@ class Commande extends CommonObject
|
||||
|
||||
$this->origin = $object->element;
|
||||
$this->origin_id = $object->id;
|
||||
|
||||
|
||||
// Possibility to add external linked objects with hooks
|
||||
$this->linked_objects[$this->origin] = $this->origin_id;
|
||||
if (is_array($object->other_linked_objects) && ! empty($object->other_linked_objects))
|
||||
@ -985,6 +986,8 @@ class Commande extends CommonObject
|
||||
* @param timestamp $date_end End date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
|
||||
* @param int $type Type of line (0=product, 1=service)
|
||||
* @param int $rang Position of line
|
||||
* @param int $special_code Special code
|
||||
* @param int $fk_parent_line Parent line
|
||||
* @return int >0 if OK, <0 if KO
|
||||
*
|
||||
* @see add_product
|
||||
@ -1289,7 +1292,7 @@ class Commande extends CommonObject
|
||||
$this->date_livraison = $this->db->jdate($obj->date_livraison);
|
||||
$this->fk_delivery_address = $obj->fk_adresse_livraison;
|
||||
$this->propale_id = $obj->fk_source;
|
||||
|
||||
|
||||
$this->extraparams = (array) dol_json_decode($obj->extraparams, true);
|
||||
|
||||
$this->lines = array();
|
||||
@ -1571,6 +1574,8 @@ class Commande extends CommonObject
|
||||
/**
|
||||
* Returns a array with expeditions lines number
|
||||
*
|
||||
* @return int Nb of shipments
|
||||
*
|
||||
* TODO deprecated, move to Shipping class
|
||||
*/
|
||||
function nb_expedition()
|
||||
@ -2035,6 +2040,7 @@ class Commande extends CommonObject
|
||||
|
||||
/**
|
||||
* Set customer ref
|
||||
*
|
||||
* @param User $user User that make change
|
||||
* @param string $ref_client Customer ref
|
||||
* @return int <0 if KO, >0 if OK
|
||||
@ -2113,6 +2119,8 @@ class Commande extends CommonObject
|
||||
* @param timestamp $date_start Start date of the line
|
||||
* @param timestamp $date_end End date of the line
|
||||
* @param int $type Type of line (0=product, 1=service)
|
||||
* @param int $fk_parent_line Parent line id
|
||||
* @param int $skip_update_total Skip update of total
|
||||
* @return int < 0 if KO, > 0 if OK
|
||||
*/
|
||||
function updateline($rowid, $desc, $pu, $qty, $remise_percent=0, $txtva, $txlocaltax1=0,$txlocaltax2=0, $price_base_type='HT', $info_bits=0, $date_start='', $date_end='', $type=0, $fk_parent_line=0, $skip_update_total=0)
|
||||
@ -2244,7 +2252,7 @@ class Commande extends CommonObject
|
||||
$error = 0;
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
|
||||
if (! $error && ! $notrigger)
|
||||
{
|
||||
// Appel des triggers
|
||||
@ -2256,7 +2264,7 @@ class Commande extends CommonObject
|
||||
}
|
||||
// Fin appel triggers
|
||||
}
|
||||
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
// Delete order details
|
||||
@ -2267,7 +2275,7 @@ class Commande extends CommonObject
|
||||
dol_syslog(get_class($this)."::delete error", LOG_ERR);
|
||||
$error++;
|
||||
}
|
||||
|
||||
|
||||
// Delete order
|
||||
$sql = 'DELETE FROM '.MAIN_DB_PREFIX."commande WHERE rowid = ".$this->id;
|
||||
dol_syslog(get_class($this)."::delete sql=".$sql, LOG_DEBUG);
|
||||
@ -2276,15 +2284,15 @@ class Commande extends CommonObject
|
||||
dol_syslog(get_class($this)."::delete error", LOG_ERR);
|
||||
$error++;
|
||||
}
|
||||
|
||||
|
||||
// Delete linked object
|
||||
$res = $this->deleteObjectLinked();
|
||||
if ($res < 0) $error++;
|
||||
|
||||
|
||||
// Delete linked contacts
|
||||
$res = $this->delete_linked_contact();
|
||||
if ($res < 0) $error++;
|
||||
|
||||
|
||||
// On efface le repertoire de pdf provisoire
|
||||
$comref = dol_sanitizeFileName($this->ref);
|
||||
if ($conf->commande->dir_output)
|
||||
@ -2294,7 +2302,7 @@ class Commande extends CommonObject
|
||||
if (file_exists($file)) // We must delete all files before deleting directory
|
||||
{
|
||||
dol_delete_preview($this);
|
||||
|
||||
|
||||
if (!dol_delete_file($file))
|
||||
{
|
||||
$this->error=$langs->trans("ErrorCanNotDeleteFile",$file);
|
||||
@ -2313,7 +2321,7 @@ class Commande extends CommonObject
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
dol_syslog(get_class($this)."::delete $this->id by $user->id", LOG_DEBUG);
|
||||
@ -2421,7 +2429,7 @@ class Commande extends CommonObject
|
||||
if ($statut==3 && ! $facturee) return $langs->trans('StatusOrderToBill');
|
||||
if ($statut==3 && $facturee) return $langs->trans('StatusOrderProcessed');
|
||||
}
|
||||
if ($mode == 1)
|
||||
elseif ($mode == 1)
|
||||
{
|
||||
if ($statut==-1) return $langs->trans('StatusOrderCanceledShort');
|
||||
if ($statut==0) return $langs->trans('StatusOrderDraftShort');
|
||||
@ -2430,7 +2438,7 @@ class Commande extends CommonObject
|
||||
if ($statut==3 && ! $facturee) return $langs->trans('StatusOrderToBillShort');
|
||||
if ($statut==3 && $facturee) return $langs->trans('StatusOrderProcessed');
|
||||
}
|
||||
if ($mode == 2)
|
||||
elseif ($mode == 2)
|
||||
{
|
||||
if ($statut==-1) return img_picto($langs->trans('StatusOrderCanceled'),'statut5').' '.$langs->trans('StatusOrderCanceledShort');
|
||||
if ($statut==0) return img_picto($langs->trans('StatusOrderDraft'),'statut0').' '.$langs->trans('StatusOrderDraftShort');
|
||||
@ -2439,7 +2447,7 @@ class Commande extends CommonObject
|
||||
if ($statut==3 && ! $facturee) return img_picto($langs->trans('StatusOrderToBill'),'statut7').' '.$langs->trans('StatusOrderToBillShort');
|
||||
if ($statut==3 && $facturee) return img_picto($langs->trans('StatusOrderProcessed'),'statut6').' '.$langs->trans('StatusOrderProcessedShort');
|
||||
}
|
||||
if ($mode == 3)
|
||||
elseif ($mode == 3)
|
||||
{
|
||||
if ($statut==-1) return img_picto($langs->trans('StatusOrderCanceled'),'statut5');
|
||||
if ($statut==0) return img_picto($langs->trans('StatusOrderDraft'),'statut0');
|
||||
@ -2448,7 +2456,7 @@ class Commande extends CommonObject
|
||||
if ($statut==3 && ! $facturee) return img_picto($langs->trans('StatusOrderToBill'),'statut7');
|
||||
if ($statut==3 && $facturee) return img_picto($langs->trans('StatusOrderProcessed'),'statut6');
|
||||
}
|
||||
if ($mode == 4)
|
||||
elseif ($mode == 4)
|
||||
{
|
||||
if ($statut==-1) return img_picto($langs->trans('StatusOrderCanceled'),'statut5').' '.$langs->trans('StatusOrderCanceled');
|
||||
if ($statut==0) return img_picto($langs->trans('StatusOrderDraft'),'statut0').' '.$langs->trans('StatusOrderDraft');
|
||||
@ -2457,7 +2465,7 @@ class Commande extends CommonObject
|
||||
if ($statut==3 && ! $facturee) return img_picto($langs->trans('StatusOrderToBill'),'statut7').' '.$langs->trans('StatusOrderToBill');
|
||||
if ($statut==3 && $facturee) return img_picto($langs->trans('StatusOrderProcessed'),'statut6').' '.$langs->trans('StatusOrderProcessed');
|
||||
}
|
||||
if ($mode == 5)
|
||||
elseif ($mode == 5)
|
||||
{
|
||||
if ($statut==-1) return $langs->trans('StatusOrderCanceledShort').' '.img_picto($langs->trans('StatusOrderCanceled'),'statut5');
|
||||
if ($statut==0) return $langs->trans('StatusOrderDraftShort').' '.img_picto($langs->trans('StatusOrderDraft'),'statut0');
|
||||
@ -2505,7 +2513,8 @@ class Commande extends CommonObject
|
||||
/**
|
||||
* Charge les informations d'ordre info dans l'objet commande
|
||||
*
|
||||
* @param int $id Id of order
|
||||
* @param int $id Id of order
|
||||
* @return void
|
||||
*/
|
||||
function info($id)
|
||||
{
|
||||
@ -2820,7 +2829,8 @@ class OrderLine
|
||||
/**
|
||||
* Load line order
|
||||
*
|
||||
* @param rowid id line order
|
||||
* @param int $rowid Id line order
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function fetch($rowid)
|
||||
{
|
||||
|
||||
@ -51,11 +51,11 @@ class CommandeStats extends Stats
|
||||
* @param string $mode Option
|
||||
* @param int $userid Id user for filter
|
||||
*/
|
||||
function CommandeStats($DB, $socid=0, $mode, $userid=0)
|
||||
function CommandeStats($db, $socid, $mode, $userid=0)
|
||||
{
|
||||
global $user, $conf;
|
||||
|
||||
$this->db = $DB;
|
||||
$this->db = $db;
|
||||
|
||||
$this->socid = $socid;
|
||||
$this->userid = $userid;
|
||||
@ -88,7 +88,7 @@ class CommandeStats extends Stats
|
||||
|
||||
/**
|
||||
* Return orders number by month for a year
|
||||
*
|
||||
*
|
||||
* @param int $year year for stats
|
||||
* @return array array with number by month
|
||||
*/
|
||||
@ -110,7 +110,7 @@ class CommandeStats extends Stats
|
||||
|
||||
/**
|
||||
* Return orders number by year
|
||||
*
|
||||
*
|
||||
* @return array array with number by year
|
||||
*
|
||||
*/
|
||||
@ -175,7 +175,7 @@ class CommandeStats extends Stats
|
||||
|
||||
/**
|
||||
* Return nb, total and average
|
||||
*
|
||||
*
|
||||
* @return array Array of values
|
||||
*/
|
||||
function getAllByYear()
|
||||
|
||||
@ -28,6 +28,12 @@ if (!$user->rights->banque->lire)
|
||||
accessforbidden();
|
||||
|
||||
|
||||
/**
|
||||
* Get result of sql for field amount
|
||||
*
|
||||
* @param string $sql SQL string
|
||||
* @return int Amount
|
||||
*/
|
||||
function valeur($sql)
|
||||
{
|
||||
global $db;
|
||||
|
||||
@ -130,12 +130,12 @@ class Account extends CommonObject
|
||||
/**
|
||||
* Add a link between bank line record and its source
|
||||
*
|
||||
* @param line_id Id ecriture bancaire
|
||||
* @param url_id Id parametre url
|
||||
* @param url Url
|
||||
* @param label Link label
|
||||
* @param type Type of link ('payment', 'company', 'member', ...)
|
||||
* @return int <0 if KO, id line if OK
|
||||
* @param int $line_id Id ecriture bancaire
|
||||
* @param int $url_id Id parametre url
|
||||
* @param string $url Url
|
||||
* @param string $label Link label
|
||||
* @param string $type Type of link ('payment', 'company', 'member', ...)
|
||||
* @return int <0 if KO, id line if OK
|
||||
*/
|
||||
function add_url_line($line_id, $url_id, $url, $label, $type)
|
||||
{
|
||||
@ -171,10 +171,10 @@ class Account extends CommonObject
|
||||
* TODO Move this into AccountLine
|
||||
* Return array with links from llx_bank_url
|
||||
*
|
||||
* @param fk_bank To search using bank transaction id
|
||||
* @param url_id To search using link to
|
||||
* @param type To search using type
|
||||
* @return array Array of links
|
||||
* @param int $fk_bank To search using bank transaction id
|
||||
* @param int $url_id To search using link to
|
||||
* @param string $type To search using type
|
||||
* @return array Array of links
|
||||
*/
|
||||
function get_url($fk_bank='', $url_id='', $type='')
|
||||
{
|
||||
@ -227,18 +227,18 @@ class Account extends CommonObject
|
||||
/**
|
||||
* Add an entry into table ".MAIN_DB_PREFIX."bank
|
||||
*
|
||||
* @param $date Date operation
|
||||
* @param $oper 1,2,3,4... (deprecated) or TYP,VIR,PRE,LIQ,VAD,CB,CHQ...
|
||||
* @param $label Descripton
|
||||
* @param $amount Amount
|
||||
* @param $num_chq Numero cheque ou virement
|
||||
* @param $categorie Categorie optionnelle
|
||||
* @param $user User that create
|
||||
* @param $emetteur Name of cheque writer
|
||||
* @param $banque Bank of cheque writer
|
||||
* @return int Rowid of added entry, <0 if KO
|
||||
* @param timsestmap $date Date operation
|
||||
* @param string $oper 1,2,3,4... (deprecated) or TYP,VIR,PRE,LIQ,VAD,CB,CHQ...
|
||||
* @param string $label Descripton
|
||||
* @param float $amount Amount
|
||||
* @param string $num_chq Numero cheque ou virement
|
||||
* @param string $categorie Categorie optionnelle
|
||||
* @param User $user User that create
|
||||
* @param string $emetteur Name of cheque writer
|
||||
* @param string $banque Bank of cheque writer
|
||||
* @return int Rowid of added entry, <0 if KO
|
||||
*/
|
||||
function addline($date, $oper, $label, $amount, $num_chq='', $categorie='', $user, $emetteur='',$banque='')
|
||||
function addline($date, $oper, $label, $amount, $num_chq, $categorie, $user, $emetteur='',$banque='')
|
||||
{
|
||||
// Clean parameters
|
||||
$emetteur=trim($emetteur);
|
||||
@ -344,10 +344,10 @@ class Account extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* Create bank account into database
|
||||
* Create bank account into database
|
||||
*
|
||||
* @param user Object user making action
|
||||
* @return int < 0 if KO, > 0 if OK
|
||||
* @param User $user Object user making action
|
||||
* @return int < 0 if KO, > 0 if OK
|
||||
*/
|
||||
function create($user='')
|
||||
{
|
||||
@ -455,8 +455,8 @@ class Account extends CommonObject
|
||||
/**
|
||||
* Update bank account card
|
||||
*
|
||||
* @param user Object user making action
|
||||
* @return int <0 si ko, >0 si ok
|
||||
* @param User $user Object user making action
|
||||
* @return int <0 si ko, >0 si ok
|
||||
*/
|
||||
function update($user='')
|
||||
{
|
||||
@ -520,8 +520,8 @@ class Account extends CommonObject
|
||||
/**
|
||||
* Update BBAN (RIB) account fields
|
||||
*
|
||||
* @param user Object user making update
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @param User $user Object user making update
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function update_bban($user='')
|
||||
{
|
||||
@ -574,9 +574,10 @@ class Account extends CommonObject
|
||||
/**
|
||||
* Load a bank account into memory from database
|
||||
*
|
||||
* @param id Id of bank account to get
|
||||
* @param ref Ref of bank account to get
|
||||
* @param ref_ext External ref of bank account to get
|
||||
* @param int $id Id of bank account to get
|
||||
* @param string $ref Ref of bank account to get
|
||||
* @param string $ref_ext External ref of bank account to get
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function fetch($id,$ref='',$ref_ext='')
|
||||
{
|
||||
@ -697,8 +698,8 @@ class Account extends CommonObject
|
||||
/**
|
||||
* Retourne le libelle du statut d'une facture (brouillon, validee, abandonnee, payee)
|
||||
*
|
||||
* @param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long
|
||||
* @return string Libelle
|
||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long
|
||||
* @return string Libelle
|
||||
*/
|
||||
function getLibStatut($mode=0)
|
||||
{
|
||||
@ -706,10 +707,11 @@ class Account extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* Renvoi le libelle d'un statut donne
|
||||
* @param statut Id statut
|
||||
* @param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||
* @return string Libelle du statut
|
||||
* Renvoi le libelle d'un statut donne
|
||||
*
|
||||
* @param int $statut Id statut
|
||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||
* @return string Libelle du statut
|
||||
*/
|
||||
function LibStatut($statut,$mode=0)
|
||||
{
|
||||
@ -751,6 +753,7 @@ class Account extends CommonObject
|
||||
|
||||
/**
|
||||
* Renvoi si un compte peut etre supprimer ou non (sans mouvements)
|
||||
*
|
||||
* @return boolean vrai si peut etre supprime, faux sinon
|
||||
*/
|
||||
function can_be_deleted()
|
||||
@ -775,6 +778,8 @@ class Account extends CommonObject
|
||||
|
||||
/**
|
||||
* Return error
|
||||
*
|
||||
* @return string Error string
|
||||
*/
|
||||
function error()
|
||||
{
|
||||
@ -856,9 +861,10 @@ class Account extends CommonObject
|
||||
|
||||
/**
|
||||
* Renvoie nom clicable (avec eventuellement le picto)
|
||||
* @param withpicto Inclut le picto dans le lien
|
||||
* @param mode ''=Link to card, 'transactions'=Link to transactions card
|
||||
* @return string Chaine avec URL
|
||||
*
|
||||
* @param int $withpicto Inclut le picto dans le lien
|
||||
* @param string $mode ''=Link to card, 'transactions'=Link to transactions card
|
||||
* @return string Chaine avec URL
|
||||
*/
|
||||
function getNomUrl($withpicto=0, $mode='')
|
||||
{
|
||||
@ -888,6 +894,7 @@ class Account extends CommonObject
|
||||
|
||||
/**
|
||||
* Return if an account has valid information
|
||||
*
|
||||
* @return int 1 if correct, <=0 if wrong
|
||||
*/
|
||||
function verif()
|
||||
@ -913,7 +920,8 @@ class Account extends CommonObject
|
||||
|
||||
/**
|
||||
* Return account country code
|
||||
* @return String country code
|
||||
*
|
||||
* @return string country code
|
||||
*/
|
||||
function getCountryCode()
|
||||
{
|
||||
@ -948,6 +956,7 @@ class Account extends CommonObject
|
||||
|
||||
/**
|
||||
* Return if a bank account is defined with detailed information (bank code, desk code, number and key)
|
||||
*
|
||||
* @return int 0=Use only an account number
|
||||
* 1=Need Bank, Desk, Number and Key (France, Spain, ...)
|
||||
* 2=Neek Bank only (BSB for Australia)
|
||||
@ -989,8 +998,7 @@ class Account extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* \class AccountLine
|
||||
* \brief Class to manage bank transaction lines
|
||||
* Class to manage bank transaction lines
|
||||
*/
|
||||
class AccountLine extends CommonObject
|
||||
{
|
||||
@ -1032,10 +1040,11 @@ class AccountLine extends CommonObject
|
||||
|
||||
/**
|
||||
* Load into memory content of a bank transaction line
|
||||
* @param rowid Id of bank transaction to load
|
||||
* @param ref Ref of bank transaction to load
|
||||
* @param num External num to load (ex: num of transaction for paypal fee)
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*
|
||||
* @param int $rowid Id of bank transaction to load
|
||||
* @param string $ref Ref of bank transaction to load
|
||||
* @param string $num External num to load (ex: num of transaction for paypal fee)
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function fetch($rowid,$ref='',$num='')
|
||||
{
|
||||
@ -1104,8 +1113,8 @@ class AccountLine extends CommonObject
|
||||
/**
|
||||
* Delete transaction bank line record
|
||||
*
|
||||
* @param user User object that delete
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @param User $user User object that delete
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function delete($user=0)
|
||||
{
|
||||
@ -1153,8 +1162,8 @@ class AccountLine extends CommonObject
|
||||
/**
|
||||
* Delete bank line records
|
||||
*
|
||||
* @param user User object that delete
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @param User $user User object that delete
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function delete_urls($user=0)
|
||||
{
|
||||
@ -1190,9 +1199,9 @@ class AccountLine extends CommonObject
|
||||
/**
|
||||
* Update bank account record in database
|
||||
*
|
||||
* @param user Object user making update
|
||||
* @param notrigger 0=Disable all triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @param User $user Object user making update
|
||||
* @param int $notrigger 0=Disable all triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function update($user,$notrigger=0)
|
||||
{
|
||||
@ -1224,9 +1233,9 @@ class AccountLine extends CommonObject
|
||||
/**
|
||||
* Update conciliation field
|
||||
*
|
||||
* @param user Objet user making update
|
||||
* @param cat Category id
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @param User $user Objet user making update
|
||||
* @param int $cat Category id
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function update_conciliation($user,$cat)
|
||||
{
|
||||
@ -1274,8 +1283,8 @@ class AccountLine extends CommonObject
|
||||
/**
|
||||
* Increase/decrease value date of a rowid
|
||||
*
|
||||
* @param int $rowid
|
||||
* @param int sign 1 or -1
|
||||
* @param int $rowid Id of line
|
||||
* @param int $sign 1 or -1
|
||||
* @return int >0 if OK, 0 if KO
|
||||
*/
|
||||
function datev_change($rowid,$sign=1)
|
||||
@ -1335,7 +1344,8 @@ class AccountLine extends CommonObject
|
||||
/**
|
||||
* Charge les informations d'ordre info dans l'objet
|
||||
*
|
||||
* @param rowid Id of object
|
||||
* @param int $rowid Id of object
|
||||
* @return void
|
||||
*/
|
||||
function info($rowid)
|
||||
{
|
||||
@ -1380,10 +1390,10 @@ class AccountLine extends CommonObject
|
||||
/**
|
||||
* Renvoie nom clicable (avec eventuellement le picto)
|
||||
*
|
||||
* @param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
|
||||
* @param maxlen Longueur max libelle
|
||||
* @param option Option ('showall')
|
||||
* @return string Chaine avec URL
|
||||
* @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
|
||||
* @param int $maxlen Longueur max libelle
|
||||
* @param string $option Option ('showall')
|
||||
* @return string Chaine avec URL
|
||||
*/
|
||||
function getNomUrl($withpicto=0,$maxlen=0,$option='')
|
||||
{
|
||||
|
||||
@ -58,9 +58,9 @@ class BankCateg // extends CommonObject
|
||||
/**
|
||||
* Create in database
|
||||
*
|
||||
* @param user User that create
|
||||
* @param notrigger 0=launch triggers after, 1=disable triggers
|
||||
* @return int <0 if KO, Id of created object if OK
|
||||
* @param User $user User that create
|
||||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||
* @return int <0 if KO, Id of created object if OK
|
||||
*/
|
||||
function create($user, $notrigger=0)
|
||||
{
|
||||
@ -126,9 +126,10 @@ class BankCateg // extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* \brief Load object in memory from database
|
||||
* \param id id object
|
||||
* \return int <0 if KO, >0 if OK
|
||||
* Load object in memory from database
|
||||
*
|
||||
* @param int $id Id object
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function fetch($id)
|
||||
{
|
||||
@ -166,10 +167,11 @@ class BankCateg // extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* \brief Update database
|
||||
* \param user User that modify
|
||||
* \param notrigger 0=launch triggers after, 1=disable triggers
|
||||
* \return int <0 if KO, >0 if OK
|
||||
* Update database
|
||||
*
|
||||
* @param User $user User that modify
|
||||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function update($user=0, $notrigger=0)
|
||||
{
|
||||
@ -230,10 +232,11 @@ class BankCateg // extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* \brief Delete object in database
|
||||
* \param user User that delete
|
||||
* \param notrigger 0=launch triggers after, 1=disable triggers
|
||||
* \return int <0 if KO, >0 if OK
|
||||
* Delete object in database
|
||||
*
|
||||
* @param User $user User that delete
|
||||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function delete($user, $notrigger=0)
|
||||
{
|
||||
@ -287,9 +290,10 @@ class BankCateg // extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* \brief Load an object from its id and create a new one in database
|
||||
* \param fromid Id of object to clone
|
||||
* \return int New id of clone
|
||||
* Load an object from its id and create a new one in database
|
||||
*
|
||||
* @param int $fromid Id of object to clone
|
||||
* @return int New id of clone
|
||||
*/
|
||||
function createFromClone($fromid)
|
||||
{
|
||||
|
||||
@ -229,7 +229,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
|
||||
// Sort array
|
||||
if (! $error)
|
||||
{
|
||||
array_multisort ($tab_sqlobjOrder,$tab_sqlobj);
|
||||
array_multisort($tab_sqlobjOrder,$tab_sqlobj);
|
||||
|
||||
//Apply distinct filter
|
||||
foreach ($tab_sqlobj as $key=>$value) {
|
||||
|
||||
@ -108,9 +108,10 @@ class DeplacementStats extends Stats
|
||||
|
||||
|
||||
/**
|
||||
* \brief Renvoie le montant de facture par mois pour une annee donnee
|
||||
* \param year Year to scan
|
||||
* \return array Array of values
|
||||
* Renvoie le montant de facture par mois pour une annee donnee
|
||||
*
|
||||
* @param int $year Year to scan
|
||||
* @return array Array of values
|
||||
*/
|
||||
function getAmountByMonth($year)
|
||||
{
|
||||
@ -127,9 +128,10 @@ class DeplacementStats extends Stats
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Return average amount
|
||||
* \param year Year to scan
|
||||
* \return array Array of values
|
||||
* Return average amount
|
||||
*
|
||||
* @param int $year Year to scan
|
||||
* @return array Array of values
|
||||
*/
|
||||
function getAverageByMonth($year)
|
||||
{
|
||||
@ -144,8 +146,9 @@ class DeplacementStats extends Stats
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Return nb, total and average
|
||||
* \return array Array of values
|
||||
* Return nb, total and average
|
||||
*
|
||||
* @return array Array of values
|
||||
*/
|
||||
function getAllByYear()
|
||||
{
|
||||
|
||||
@ -2,17 +2,17 @@
|
||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
@ -178,7 +178,7 @@ else if ($action == 'update' && $user->rights->deplacement->creer)
|
||||
{
|
||||
$result = $object->fetch($id);
|
||||
|
||||
$object->date = dol_mktime(12, 0 , 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
|
||||
$object->date = dol_mktime(12, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
|
||||
$object->km = $_POST["km"];
|
||||
$object->type = $_POST["type"];
|
||||
$object->fk_user = $_POST["fk_user"];
|
||||
@ -494,9 +494,9 @@ else if ($id)
|
||||
|
||||
// Statut
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td>'.$object->getLibStatut(4).'</td></tr>';
|
||||
|
||||
|
||||
print "</table><br>";
|
||||
|
||||
|
||||
// Notes
|
||||
$blocname = 'notes';
|
||||
$title = $langs->trans('Notes');
|
||||
|
||||
@ -75,7 +75,7 @@ if (trim($search_ref) != '')
|
||||
$sql.= ' AND d.rowid LIKE \'%'.$db->escape(trim($search_ref)) . '%\'';
|
||||
}
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
$sql.= $db->plimit($limit + 1 ,$offset);
|
||||
$sql.= $db->plimit($limit + 1, $offset);
|
||||
|
||||
//print $sql;
|
||||
$resql=$db->query($sql);
|
||||
|
||||
@ -64,7 +64,7 @@ class localtax extends CommonObject
|
||||
global $conf, $langs;
|
||||
|
||||
$error=0;
|
||||
|
||||
|
||||
// Clean parameters
|
||||
$this->amount=trim($this->amount);
|
||||
$this->label=trim($this->label);
|
||||
@ -131,7 +131,7 @@ class localtax extends CommonObject
|
||||
global $conf, $langs;
|
||||
|
||||
$error=0;
|
||||
|
||||
|
||||
// Clean parameters
|
||||
$this->amount=trim($this->amount);
|
||||
$this->label=trim($this->label);
|
||||
@ -250,7 +250,7 @@ class localtax extends CommonObject
|
||||
global $conf, $langs;
|
||||
|
||||
$error=0;
|
||||
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."localtax";
|
||||
$sql.= " WHERE rowid=".$this->id;
|
||||
|
||||
@ -300,6 +300,8 @@ class localtax extends CommonObject
|
||||
/**
|
||||
* Hum la fonction s'appelle 'Solde' elle doit a mon avis calcluer le solde de localtax, non ?
|
||||
*
|
||||
* @param int $year Year
|
||||
* @return int ???
|
||||
*/
|
||||
function solde($year = 0)
|
||||
{
|
||||
@ -317,8 +319,9 @@ class localtax extends CommonObject
|
||||
/**
|
||||
* Total de la localtax des factures emises par la societe.
|
||||
*
|
||||
* @param int $year Year
|
||||
* @return int ???
|
||||
*/
|
||||
|
||||
function localtax_sum_collectee($year = 0)
|
||||
{
|
||||
|
||||
@ -357,8 +360,9 @@ class localtax extends CommonObject
|
||||
/**
|
||||
* localtax payed
|
||||
*
|
||||
* @param int $year Year
|
||||
* @return int ???
|
||||
*/
|
||||
|
||||
function localtax_sum_payee($year = 0)
|
||||
{
|
||||
|
||||
@ -398,8 +402,9 @@ class localtax extends CommonObject
|
||||
* localtax payed
|
||||
* Total de la localtax payed
|
||||
*
|
||||
* @param int $year Year
|
||||
* @return int ???
|
||||
*/
|
||||
|
||||
function localtax_sum_reglee($year = 0)
|
||||
{
|
||||
|
||||
|
||||
@ -71,7 +71,7 @@ if ($socid)
|
||||
}
|
||||
$sql.= " AND p.statut = 0";
|
||||
$sql.= " ORDER BY $sortfield $sortorder";
|
||||
$sql.= $db->plimit($limit +1 ,$offset);
|
||||
$sql.= $db->plimit($limit+1, $offset);
|
||||
$resql = $db->query($sql);
|
||||
|
||||
if ($resql)
|
||||
@ -96,7 +96,7 @@ if ($resql)
|
||||
$objp = $db->fetch_object($resql);
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td>'.'<a href="'.DOL_URL_ROOT.'/compta/paiement/fiche.php?id='.$objp->rowid.'">'.img_object($langs->trans("ShowPayment"),"payment").' '.$objp->rowid.'</a></td>';
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/compta/paiement/fiche.php?id='.$objp->rowid.'">'.img_object($langs->trans("ShowPayment"),"payment").' '.$objp->rowid.'</a></td>';
|
||||
print '<td width="80" align="center">'.dol_print_date($db->jdate($objp->dp),'day')."</td>\n";
|
||||
print "<td>$objp->paiement_type $objp->num_paiement</td>\n";
|
||||
print '<td align="right">'.price($objp->amount).'</td>';
|
||||
|
||||
@ -72,7 +72,7 @@ class RemiseCheque extends CommonObject
|
||||
$sql.= " WHERE bc.entity = ".$conf->entity;
|
||||
if ($id) $sql.= " AND bc.rowid = ".$id;
|
||||
if ($ref) $sql.= " AND bc.number = '".$this->db->escape($ref)."'";
|
||||
|
||||
|
||||
dol_syslog("RemiseCheque::fetch sql=".$sql, LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
@ -113,13 +113,13 @@ class RemiseCheque extends CommonObject
|
||||
/**
|
||||
* Create a receipt to send cheques
|
||||
*
|
||||
* @param user User making creation
|
||||
* @param account_id Bank account for cheque receipt
|
||||
* @param limit Limit number of cheque to this
|
||||
* @param toRemise array with cheques to remise
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @param User $user User making creation
|
||||
* @param int $account_id Bank account for cheque receipt
|
||||
* @param int $limit Limit number of cheque to this
|
||||
* @param array $toRemise array with cheques to remise
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function create($user, $account_id, $limit=40,$toRemise)
|
||||
function create($user, $account_id, $limit=40, $toRemise)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@ -271,7 +271,8 @@ class RemiseCheque extends CommonObject
|
||||
/**
|
||||
* Supprime la remise en base
|
||||
*
|
||||
* @param user utilisateur qui effectue l'operation
|
||||
* @param User $user Utilisateur qui effectue l'operation
|
||||
* @return void
|
||||
*/
|
||||
function delete($user='')
|
||||
{
|
||||
@ -326,8 +327,8 @@ class RemiseCheque extends CommonObject
|
||||
/**
|
||||
* Validate a receipt
|
||||
*
|
||||
* @param user User
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @param User $user User
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function validate($user)
|
||||
{
|
||||
@ -472,11 +473,11 @@ class RemiseCheque extends CommonObject
|
||||
/**
|
||||
* Build document
|
||||
*
|
||||
* @param model Model name
|
||||
* @param outputlangs Object langs
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @param string $model Model name
|
||||
* @param Tranlsate $outputlangs Object langs
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function generatePdf($model='blochet', $outputlangs)
|
||||
function generatePdf($model, $outputlangs)
|
||||
{
|
||||
global $langs,$conf;
|
||||
|
||||
@ -555,8 +556,9 @@ class RemiseCheque extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Mets a jour le montant total
|
||||
* \return int 0 en cas de succes
|
||||
* Mets a jour le montant total
|
||||
*
|
||||
* @return int 0 en cas de succes
|
||||
*/
|
||||
function updateAmount()
|
||||
{
|
||||
@ -614,9 +616,10 @@ class RemiseCheque extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Insere la remise en base
|
||||
* \param account_id Compte bancaire concerne
|
||||
* \return int
|
||||
* Insere la remise en base
|
||||
*
|
||||
* @param int $account_id Compte bancaire concerne
|
||||
* @return int
|
||||
*/
|
||||
function removeCheck($account_id)
|
||||
{
|
||||
@ -643,8 +646,9 @@ class RemiseCheque extends CommonObject
|
||||
return 0;
|
||||
}
|
||||
/**
|
||||
* \brief Charge les proprietes ref_previous et ref_next
|
||||
* \return int <0 si ko, 0 si ok
|
||||
* Charge les proprietes ref_previous et ref_next
|
||||
*
|
||||
* @return int <0 if KO, 0 if OK
|
||||
*/
|
||||
function load_previous_next_id()
|
||||
{
|
||||
@ -684,9 +688,10 @@ class RemiseCheque extends CommonObject
|
||||
|
||||
/**
|
||||
* Set the creation date
|
||||
* @param user Object user
|
||||
* @param date Date creation
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*
|
||||
* @param User $user Object user
|
||||
* @param timestamp $date Date creation
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function set_date($user, $date)
|
||||
{
|
||||
@ -719,9 +724,10 @@ class RemiseCheque extends CommonObject
|
||||
|
||||
/**
|
||||
* Renvoie nom clicable (avec eventuellement le picto)
|
||||
* @param withpicto Inclut le picto dans le lien
|
||||
* @param option Sur quoi pointe le lien
|
||||
* @return string Chaine avec URL
|
||||
*
|
||||
* @param int $withpicto Inclut le picto dans le lien
|
||||
* @param string $option Sur quoi pointe le lien
|
||||
* @return string Chaine avec URL
|
||||
*/
|
||||
function getNomUrl($withpicto=0,$option='')
|
||||
{
|
||||
@ -741,9 +747,10 @@ class RemiseCheque extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Retourne le libelle du statut d'une facture (brouillon, validee, abandonnee, payee)
|
||||
* \param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||
* \return string Libelle
|
||||
* Retourne le libelle du statut d'une facture (brouillon, validee, abandonnee, payee)
|
||||
*
|
||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||
* @return string Libelle
|
||||
*/
|
||||
function getLibStatut($mode=0)
|
||||
{
|
||||
@ -751,10 +758,11 @@ class RemiseCheque extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* Return label of a status
|
||||
* @param status Statut
|
||||
* @param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||
* @return string Libelle du statut
|
||||
* Return label of a status
|
||||
*
|
||||
* @param int $status Statut
|
||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||
* @return string Libelle du statut
|
||||
*/
|
||||
function LibStatut($status,$mode=0)
|
||||
{
|
||||
|
||||
@ -44,7 +44,7 @@ $accountstatic=new Account($db);
|
||||
|
||||
llxHeader('',$langs->trans("ChequesArea"));
|
||||
|
||||
print_fiche_titre($langs->trans("ChequesArea") );
|
||||
print_fiche_titre($langs->trans("ChequesArea"));
|
||||
|
||||
print '<table border="0" width="100%" class="notopnoleftnoright">';
|
||||
|
||||
|
||||
@ -66,7 +66,7 @@ if ($_GET["search_montant"])
|
||||
$sql.=" AND bc.amount=".price2num($_GET["search_montant"]);
|
||||
}
|
||||
$sql.= " ORDER BY $sortfield $sortorder";
|
||||
$sql.= $db->plimit($limit+1 ,$offset);
|
||||
$sql.= $db->plimit($limit+1, $offset);
|
||||
//print "$sql";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
|
||||
@ -32,14 +32,16 @@ $langs->load("categories");
|
||||
|
||||
/**
|
||||
* Replace the default llxHeader function
|
||||
* @param $head
|
||||
* @param $title
|
||||
* @param $help_url
|
||||
* @param $target
|
||||
* @param $disablejs
|
||||
* @param $disablehead
|
||||
* @param $arrayofjs
|
||||
* @param $arrayofcss
|
||||
*
|
||||
* @param string $head Optionnal head lines
|
||||
* @param string $title HTML title
|
||||
* @param string $help_url Link to online url help to show on left menu
|
||||
* @param string $target Force target on menu links
|
||||
* @param int $disablejs More content into html header
|
||||
* @param int $disablehead More content into html header
|
||||
* @param array $arrayofjs Array of complementary js files
|
||||
* @param array $arrayofcss Array of complementary css files
|
||||
* @return none
|
||||
*/
|
||||
function llxHeader($head = '', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='')
|
||||
{
|
||||
|
||||
@ -115,7 +115,7 @@ else
|
||||
if ($_REQUEST["search_company"]) $sql .=" AND s.nom LIKE '%".$db->escape($_REQUEST["search_company"])."%'";
|
||||
}
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
$sql.= $db->plimit($limit+1 ,$offset);
|
||||
$sql.= $db->plimit($limit+1, $offset);
|
||||
//print "$sql";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
|
||||
@ -75,7 +75,7 @@ class Tva extends CommonObject
|
||||
global $conf, $langs;
|
||||
|
||||
$error=0;
|
||||
|
||||
|
||||
// Clean parameters
|
||||
$this->amount=trim($this->amount);
|
||||
$this->label=trim($this->label);
|
||||
@ -147,7 +147,7 @@ class Tva extends CommonObject
|
||||
global $conf, $langs;
|
||||
|
||||
$error=0;
|
||||
|
||||
|
||||
// Clean parameters
|
||||
$this->amount=trim($this->amount);
|
||||
$this->label=trim($this->label);
|
||||
@ -273,7 +273,7 @@ class Tva extends CommonObject
|
||||
global $conf, $langs;
|
||||
|
||||
$error=0;
|
||||
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."tva";
|
||||
$sql.= " WHERE rowid=".$this->id;
|
||||
|
||||
@ -460,9 +460,10 @@ class Tva extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* \brief Ajoute un paiement de TVA
|
||||
* \param user Object user that insert
|
||||
* \return int <0 if KO, rowid in tva table if OK
|
||||
* Ajoute un paiement de TVA
|
||||
*
|
||||
* @param User $user Object user that insert
|
||||
* @return int <0 if KO, rowid in tva table if OK
|
||||
*/
|
||||
function addPayment($user)
|
||||
{
|
||||
@ -572,9 +573,10 @@ class Tva extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Mise a jour du lien entre le paiement tva et la ligne g<EFBFBD>n<EFBFBD>r<EFBFBD>e dans llx_bank
|
||||
* \param id_bank Id compte bancaire
|
||||
* \return int <0 if KO, >0 if OK
|
||||
* Mise a jour du lien entre le paiement tva et la ligne g<EFBFBD>n<EFBFBD>r<EFBFBD>e dans llx_bank
|
||||
*
|
||||
* @param int $id_bank Id compte bancaire
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function update_fk_bank($id_bank)
|
||||
{
|
||||
@ -594,11 +596,12 @@ class Tva extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
\brief Renvoie nom clicable (avec eventuellement le picto)
|
||||
\param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
|
||||
\param option Sur quoi pointe le lien
|
||||
\return string Chaine avec URL
|
||||
*/
|
||||
* Renvoie nom clicable (avec eventuellement le picto)
|
||||
*
|
||||
* @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
|
||||
* @param string $option Sur quoi pointe le lien
|
||||
* @return string Chaine avec URL
|
||||
*/
|
||||
function getNomUrl($withpicto=0,$option='')
|
||||
{
|
||||
global $langs;
|
||||
|
||||
@ -51,9 +51,10 @@ $result = restrictedArea($user, 'tax', '', '', 'charges');
|
||||
* to report the amounts for different VAT rates as different lines.
|
||||
* This function also accounts recurrent invoices.
|
||||
*
|
||||
* @param db Database handler
|
||||
* @param y Year
|
||||
* @param q Year quarter (1-4)
|
||||
* @param DoliDB $db Database handler
|
||||
* @param int $y Year
|
||||
* @param int $q Year quarter (1-4)
|
||||
* @return void
|
||||
*/
|
||||
function tva_coll($db,$y,$q)
|
||||
{
|
||||
@ -118,9 +119,10 @@ function tva_coll($db,$y,$q)
|
||||
* The function gets the VAT in split results, as the VAT declaration asks
|
||||
* to report the amounts for different VAT rates as different lines
|
||||
*
|
||||
* @param DoliDB $db Database handler object
|
||||
* @param int $y Year
|
||||
* @param int $q Year quarter (1-4)
|
||||
* @param DoliDB $db Database handler object
|
||||
* @param int $y Year
|
||||
* @param int $q Year quarter (1-4)
|
||||
* @return void
|
||||
*/
|
||||
function tva_paye($db, $y,$q)
|
||||
{
|
||||
@ -289,16 +291,16 @@ if ($conf->global->COMPTA_MODE == "CREANCES-DETTES")
|
||||
|
||||
$i++;
|
||||
}
|
||||
print '<tr class="liste_total">' .
|
||||
'<td align="right">'.$langs->trans("Total").':</td>' .
|
||||
'<td nowrap align="right">'.price($subtot_coll_total).'</td>' .
|
||||
'<td nowrap align="right">'.price($subtot_coll_vat).'</td>' .
|
||||
'<td></td>' .
|
||||
'<td nowrap align="right">'.price($subtot_paye_total).'</td>' .
|
||||
'<td nowrap align="right">'.price($subtot_paye_vat).'</td>' .
|
||||
'<td></td>' .
|
||||
'<td nowrap align="right"><b>'.price($total).'</b>' .
|
||||
'</td>';
|
||||
print '<tr class="liste_total">';
|
||||
print '<td align="right">'.$langs->trans("Total").':</td>';
|
||||
print '<td nowrap="nowrap" align="right">'.price($subtot_coll_total).'</td>';
|
||||
print '<td nowrap="nowrap" align="right">'.price($subtot_coll_vat).'</td>';
|
||||
print '<td></td>';
|
||||
print '<td nowrap="nowrap" align="right">'.price($subtot_paye_total).'</td>';
|
||||
print '<td nowrap="nowrap" align="right">'.price($subtot_paye_vat).'</td>';
|
||||
print '<td></td>';
|
||||
print '<td nowrap="nowrap" align="right"><b>'.price($total).'</b>';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
}
|
||||
|
||||
@ -70,8 +70,8 @@ abstract class ActionsContactCardCommon
|
||||
/**
|
||||
* Get object
|
||||
*
|
||||
* @param int Object id
|
||||
* @return object Object loaded
|
||||
* @param int $id Object id
|
||||
* @return object Object loaded
|
||||
*/
|
||||
function getObject($id)
|
||||
{
|
||||
@ -226,8 +226,8 @@ abstract class ActionsContactCardCommon
|
||||
/**
|
||||
* Set content of ->tpl array, to use into template
|
||||
*
|
||||
* @param string $action Type of action
|
||||
* @return string HTML output
|
||||
* @param string &$action Type of action
|
||||
* @return string HTML output
|
||||
*/
|
||||
function assign_values(&$action)
|
||||
{
|
||||
|
||||
@ -52,9 +52,12 @@ class ActionsContactCardDefault extends ActionsContactCardCommon
|
||||
$this->canvas = $canvas;
|
||||
$this->card = $card;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the title of card
|
||||
*
|
||||
* @param string $action Code action
|
||||
* @return string Title
|
||||
*/
|
||||
private function getTitle($action)
|
||||
{
|
||||
@ -65,21 +68,22 @@ class ActionsContactCardDefault extends ActionsContactCardCommon
|
||||
if ($action == 'view') $out.= (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contact") : $langs->trans("ContactAddress"));
|
||||
if ($action == 'edit') $out.= (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("EditContact") : $langs->trans("EditContactAddress"));
|
||||
if ($action == 'create') $out.= (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("NewContact") : $langs->trans("NewContactAddress"));
|
||||
|
||||
|
||||
return $out;
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign custom values for canvas
|
||||
*
|
||||
* @param string $action Type of action
|
||||
* @return void
|
||||
* @param string &$action Type of action
|
||||
* @param int $id Id
|
||||
* @return void
|
||||
*/
|
||||
function assign_values(&$action, $id)
|
||||
{
|
||||
global $conf, $db, $langs, $user;
|
||||
global $form;
|
||||
|
||||
|
||||
$ret = $this->getObject($id);
|
||||
|
||||
parent::assign_values($action);
|
||||
|
||||
@ -324,7 +324,7 @@ else
|
||||
|
||||
// Show tabs
|
||||
$head = contact_prepare_head($object);
|
||||
|
||||
|
||||
$title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses"));
|
||||
dol_fiche_head($head, 'card', $title, 0, 'contact');
|
||||
}
|
||||
@ -350,7 +350,7 @@ else
|
||||
$object->country_code = $tmparray['code'];
|
||||
$object->country = $tmparray['label'];
|
||||
}
|
||||
|
||||
|
||||
$title = $addcontact = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("AddContact") : $langs->trans("AddContactAddress"));
|
||||
print_fiche_titre($title);
|
||||
|
||||
@ -576,7 +576,7 @@ else
|
||||
print $formcompany->select_civility(isset($_POST["civilite_id"])?$_POST["civilite_id"]:$object->civilite_id);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("PostOrFunction" ).'</td><td colspan="3"><input name="poste" type="text" size="50" maxlength="80" value="'.(isset($_POST["poste"])?$_POST["poste"]:$object->poste).'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("PostOrFunction").'</td><td colspan="3"><input name="poste" type="text" size="50" maxlength="80" value="'.(isset($_POST["poste"])?$_POST["poste"]:$object->poste).'"></td></tr>';
|
||||
|
||||
// Address
|
||||
print '<tr><td>'.$langs->trans("Address").'</td><td colspan="3"><textarea class="flat" name="address" cols="70">'.(isset($_POST["address"])?$_POST["address"]:$object->address).'</textarea></td>';
|
||||
@ -762,7 +762,7 @@ else
|
||||
print '</td></tr>';
|
||||
|
||||
// Role
|
||||
print '<tr><td>'.$langs->trans("PostOrFunction" ).'</td><td colspan="3">'.$object->poste.'</td>';
|
||||
print '<tr><td>'.$langs->trans("PostOrFunction").'</td><td colspan="3">'.$object->poste.'</td>';
|
||||
|
||||
// Address
|
||||
print '<tr><td>'.$langs->trans("Address").'</td><td colspan="3">';
|
||||
|
||||
@ -61,9 +61,9 @@ class Contrat extends CommonObject
|
||||
var $note_public;
|
||||
|
||||
var $fk_projet;
|
||||
|
||||
|
||||
var $extraparams=array();
|
||||
|
||||
|
||||
var $lines=array();
|
||||
|
||||
|
||||
@ -128,12 +128,12 @@ class Contrat extends CommonObject
|
||||
/**
|
||||
* Activate a contract line
|
||||
*
|
||||
* @param user Objet User qui active le contrat
|
||||
* @param line_id Id de la ligne de detail a activer
|
||||
* @param date Date d'ouverture
|
||||
* @param date_end Date fin prevue
|
||||
* @param comment A comment typed by user
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @param User $user Objet User qui active le contrat
|
||||
* @param int $line_id Id de la ligne de detail a activer
|
||||
* @param timestamp $date Date d'ouverture
|
||||
* @param timestamp $date_end Date fin prevue
|
||||
* @param string $comment A comment typed by user
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function active_line($user, $line_id, $date, $date_end='', $comment='')
|
||||
{
|
||||
@ -178,11 +178,11 @@ class Contrat extends CommonObject
|
||||
/**
|
||||
* Close a contract line
|
||||
*
|
||||
* @param user Objet User qui active le contrat
|
||||
* @param line_id Id de la ligne de detail a activer
|
||||
* @param date_end Date fin
|
||||
* @param comment A comment typed by user
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @param User $user Objet User qui active le contrat
|
||||
* @param int $line_id Id de la ligne de detail a activer
|
||||
* @param timestamp $date_end Date fin
|
||||
* @param string $comment A comment typed by user
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function close_line($user, $line_id, $date_end, $comment='')
|
||||
{
|
||||
@ -276,10 +276,10 @@ class Contrat extends CommonObject
|
||||
/**
|
||||
* Validate a contract
|
||||
*
|
||||
* @param user Objet User
|
||||
* @param langs Environnement langue de l'utilisateur
|
||||
* @param conf Environnement de configuration lors de l'operation
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @param User $user Objet User
|
||||
* @param Translate $langs Environnement langue de l'utilisateur
|
||||
* @param Conf $conf Environnement de configuration lors de l'operation
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function validate($user,$langs,$conf)
|
||||
{
|
||||
@ -312,6 +312,7 @@ class Contrat extends CommonObject
|
||||
* Load a contract from database
|
||||
*
|
||||
* @param int $id Id of contract to load
|
||||
* @param string $ref Ref
|
||||
* @return int <0 if KO, id of contract if OK
|
||||
*/
|
||||
function fetch($id,$ref='')
|
||||
@ -353,7 +354,7 @@ class Contrat extends CommonObject
|
||||
|
||||
$this->socid = $result["fk_soc"];
|
||||
$this->fk_soc = $result["fk_soc"];
|
||||
|
||||
|
||||
$this->extraparams = (array) dol_json_decode($result["extraparams"], true);
|
||||
|
||||
$this->db->free($resql);
|
||||
@ -690,10 +691,10 @@ class Contrat extends CommonObject
|
||||
/**
|
||||
* Supprime l'objet de la base
|
||||
*
|
||||
* @param user Utilisateur qui supprime
|
||||
* @param langs Environnement langue de l'utilisateur
|
||||
* @param conf Environnement de configuration lors de l'operation
|
||||
* @return int < 0 si erreur, > 0 si ok
|
||||
* @param User $user Utilisateur qui supprime
|
||||
* @param Translate $langs Environnement langue de l'utilisateur
|
||||
* @param Conf $conf Environnement de configuration lors de l'operation
|
||||
* @return int < 0 si erreur, > 0 si ok
|
||||
*/
|
||||
function delete($user,$langs='',$conf='')
|
||||
{
|
||||
@ -810,22 +811,22 @@ class Contrat extends CommonObject
|
||||
/**
|
||||
* Ajoute une ligne de contrat en base
|
||||
*
|
||||
* @param desc Description de la ligne
|
||||
* @param pu_ht Prix unitaire HT
|
||||
* @param qty Quantite
|
||||
* @param txtva Taux tva
|
||||
* @param txlocaltax1 Local tax 1 rate
|
||||
* @param txlocaltax2 Local tax 2 rate
|
||||
* @param fk_product Id produit
|
||||
* @param remise_percent Pourcentage de remise de la ligne
|
||||
* @param date_start Date de debut prevue
|
||||
* @param date_end Date de fin prevue
|
||||
* @param price_base_type HT ou TTC
|
||||
* @param pu_ttc Prix unitaire TTC
|
||||
* @param info_bits Bits de type de lignes
|
||||
* @return int <0 si erreur, >0 si ok
|
||||
* @param string $desc Description de la ligne
|
||||
* @param float $pu_ht Prix unitaire HT
|
||||
* @param int $qty Quantite
|
||||
* @param float $txtva Taux tva
|
||||
* @param float $txlocaltax1 Local tax 1 rate
|
||||
* @param float $txlocaltax2 Local tax 2 rate
|
||||
* @param int $fk_product Id produit
|
||||
* @param float $remise_percent Pourcentage de remise de la ligne
|
||||
* @param timestamp $date_start Date de debut prevue
|
||||
* @param timestamp $date_end Date de fin prevue
|
||||
* @param float $price_base_type HT ou TTC
|
||||
* @param float $pu_ttc Prix unitaire TTC
|
||||
* @param int $info_bits Bits de type de lignes
|
||||
* @return int <0 si erreur, >0 si ok
|
||||
*/
|
||||
function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $date_start, $date_end, $price_base_type='HT', $pu_ttc=0, $info_bits=0)
|
||||
function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1, $txlocaltax2, $fk_product, $remise_percent, $date_start, $date_end, $price_base_type='HT', $pu_ttc=0, $info_bits=0)
|
||||
{
|
||||
global $user, $langs, $conf;
|
||||
|
||||
@ -936,21 +937,21 @@ class Contrat extends CommonObject
|
||||
/**
|
||||
* Mets a jour une ligne de contrat
|
||||
*
|
||||
* @param rowid Id de la ligne de facture
|
||||
* @param desc Description de la ligne
|
||||
* @param pu Prix unitaire
|
||||
* @param qty Quantite
|
||||
* @param remise_percent Pourcentage de remise de la ligne
|
||||
* @param date_start Date de debut prevue
|
||||
* @param date_end Date de fin prevue
|
||||
* @param tvatx Taux TVA
|
||||
* @param localtax1tx Local tax 1 rate
|
||||
* @param localtax2tx Local tax 2 rate
|
||||
* @param date_debut_reel Date de debut reelle
|
||||
* @param date_fin_reel Date de fin reelle
|
||||
* @return int < 0 si erreur, > 0 si ok
|
||||
* @param int $rowid Id de la ligne de facture
|
||||
* @param string $desc Description de la ligne
|
||||
* @param float $pu Prix unitaire
|
||||
* @param int $qty Quantite
|
||||
* @param float $remise_percent Pourcentage de remise de la ligne
|
||||
* @param timestamp $date_start Date de debut prevue
|
||||
* @param timestamp $date_end Date de fin prevue
|
||||
* @param float $tvatx Taux TVA
|
||||
* @param float $localtax1tx Local tax 1 rate
|
||||
* @param float $localtax2tx Local tax 2 rate
|
||||
* @param timestamp $date_debut_reel Date de debut reelle
|
||||
* @param timestamp $date_fin_reel Date de fin reelle
|
||||
* @return int < 0 si erreur, > 0 si ok
|
||||
*/
|
||||
function updateline($rowid, $desc, $pu, $qty, $remise_percent=0, $date_start='', $date_end='', $tvatx, $localtax1tx=0, $localtax2tx=0, $date_debut_reel='', $date_fin_reel='')
|
||||
function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $tvatx, $localtax1tx=0, $localtax2tx=0, $date_debut_reel='', $date_fin_reel='')
|
||||
{
|
||||
global $user, $conf, $langs;
|
||||
|
||||
@ -1026,9 +1027,9 @@ class Contrat extends CommonObject
|
||||
/**
|
||||
* Delete a contract line
|
||||
*
|
||||
* @param idline Id of line to delete
|
||||
* @param user User that delete
|
||||
* @return int >0 if OK, <0 if KO
|
||||
* @param int $idline Id of line to delete
|
||||
* @param User $user User that delete
|
||||
* @return int >0 if OK, <0 if KO
|
||||
*/
|
||||
function deleteline($idline,$user)
|
||||
{
|
||||
@ -1069,7 +1070,8 @@ class Contrat extends CommonObject
|
||||
/**
|
||||
* Update statut of contract according to services
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @param User $user Object user
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function update_statut($user)
|
||||
{
|
||||
@ -1092,8 +1094,8 @@ class Contrat extends CommonObject
|
||||
/**
|
||||
* Return label of a contract status
|
||||
*
|
||||
* @param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Long label of all services, 5=Libelle court + Picto, 6=Picto of all services
|
||||
* @return string Label
|
||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Long label of all services, 5=Libelle court + Picto, 6=Picto of all services
|
||||
* @return string Label
|
||||
*/
|
||||
function getLibStatut($mode)
|
||||
{
|
||||
@ -1103,9 +1105,9 @@ class Contrat extends CommonObject
|
||||
/**
|
||||
* Renvoi label of a given contrat status
|
||||
*
|
||||
* @param statut Status id
|
||||
* @param mode 0=Long label, 1=Short label, 2=Picto + Libelle court, 3=Picto, 4=Picto + Long label of all services, 5=Libelle court + Picto, 6=Picto of all services
|
||||
* @return string Label
|
||||
* @param int $statut Status id
|
||||
* @param int $mode 0=Long label, 1=Short label, 2=Picto + Libelle court, 3=Picto, 4=Picto + Long label of all services, 5=Libelle court + Picto, 6=Picto of all services
|
||||
* @return string Label
|
||||
*/
|
||||
function LibStatut($statut,$mode)
|
||||
{
|
||||
@ -1238,8 +1240,8 @@ class Contrat extends CommonObject
|
||||
/**
|
||||
* Return list of line rowid
|
||||
*
|
||||
* @param statut Status of lines to get
|
||||
* @return array Array of line's rowid
|
||||
* @param int $statut Status of lines to get
|
||||
* @return array Array of line's rowid
|
||||
*/
|
||||
function array_detail($statut=-1)
|
||||
{
|
||||
@ -1274,8 +1276,8 @@ class Contrat extends CommonObject
|
||||
/**
|
||||
* Return list of other contracts for same company than current contract
|
||||
*
|
||||
* @param option 'all' or 'others'
|
||||
* @return array Array of contracts id
|
||||
* @param string $option 'all' or 'others'
|
||||
* @return array Array of contracts id
|
||||
*/
|
||||
function getListOfContracts($option='all')
|
||||
{
|
||||
@ -1313,9 +1315,9 @@ class Contrat extends CommonObject
|
||||
/**
|
||||
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
|
||||
*
|
||||
* @param user Objet user
|
||||
* @param mode "inactive" pour services a activer, "expired" pour services expires
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @param User $user Objet user
|
||||
* @param string $mode "inactive" pour services a activer, "expired" pour services expires
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function load_board($user,$mode)
|
||||
{
|
||||
@ -1510,8 +1512,7 @@ class Contrat extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* \class ContratLigne
|
||||
* \brief Classe permettant la gestion des lignes de contrats
|
||||
* Classe permettant la gestion des lignes de contrats
|
||||
*/
|
||||
class ContratLigne
|
||||
{
|
||||
@ -1570,10 +1571,10 @@ class ContratLigne
|
||||
|
||||
|
||||
/**
|
||||
* Return label of this contract line status
|
||||
* Return label of this contract line status
|
||||
*
|
||||
* @param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||
* @return string Libelle
|
||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||
* @return string Libelle
|
||||
*/
|
||||
function getLibStatut($mode)
|
||||
{
|
||||
@ -1581,12 +1582,12 @@ class ContratLigne
|
||||
}
|
||||
|
||||
/**
|
||||
* Return label of a contract line status
|
||||
* Return label of a contract line status
|
||||
*
|
||||
* @param statut id statut
|
||||
* @param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||
* @param expired 0=Not expired, 1=Expired, -1=Both or unknown
|
||||
* @return string Libelle
|
||||
* @param int $statut Id statut
|
||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||
* @param int $expired 0=Not expired, 1=Expired, -1=Both or unknown
|
||||
* @return string Libelle
|
||||
*/
|
||||
function LibStatut($statut,$mode,$expired=-1)
|
||||
{
|
||||
@ -1645,8 +1646,9 @@ class ContratLigne
|
||||
/**
|
||||
* Renvoie nom clicable (avec eventuellement le picto)
|
||||
*
|
||||
* @param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
|
||||
* @return string Chaine avec URL
|
||||
* @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
|
||||
* @param int $maxlength Max length
|
||||
* @return string Chaine avec URL
|
||||
*/
|
||||
function getNomUrl($withpicto=0,$maxlength=0)
|
||||
{
|
||||
@ -1670,9 +1672,9 @@ class ContratLigne
|
||||
/**
|
||||
* Load object in memory from database
|
||||
*
|
||||
* @param id id object
|
||||
* @param ref Ref of contract
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @param int $id Id object
|
||||
* @param string $ref Ref of contract
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function fetch($id, $ref='')
|
||||
{
|
||||
|
||||
@ -85,7 +85,7 @@ if ($sall) $sql.= " AND (s.nom like '%".$db->escape($sall)."%' OR cd.
|
||||
$sql.= " GROUP BY c.rowid, c.ref, c.datec, c.date_contrat, c.statut,";
|
||||
$sql.= " s.nom, s.rowid";
|
||||
$sql.= " ORDER BY $sortfield $sortorder";
|
||||
$sql.= $db->plimit($conf->liste_limit + 1 ,$offset);
|
||||
$sql.= $db->plimit($conf->liste_limit + 1, $offset);
|
||||
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
|
||||
@ -101,7 +101,7 @@ $filter_date2=dol_mktime(0,0,0,$_REQUEST['op2month'],$_REQUEST['op2day'],$_REQUE
|
||||
if (! empty($_REQUEST['filter_op1']) && $_REQUEST['filter_op1'] != -1 && $filter_date1 != '') $sql.= " AND date_ouverture_prevue ".$_REQUEST['filter_op1']." ".$db->idate($filter_date1);
|
||||
if (! empty($_REQUEST['filter_op2']) && $_REQUEST['filter_op2'] != -1 && $filter_date2 != '') $sql.= " AND date_fin_validite ".$_REQUEST['filter_op2']." ".$db->idate($filter_date2);
|
||||
$sql .= $db->order($sortfield,$sortorder);
|
||||
$sql .= $db->plimit($limit + 1 ,$offset);
|
||||
$sql .= $db->plimit($limit + 1, $offset);
|
||||
|
||||
//print $sql;
|
||||
dol_syslog("contrat/services.php sql=".$sql);
|
||||
|
||||
@ -115,8 +115,14 @@ else
|
||||
|
||||
print '</body></html>'."\n";
|
||||
|
||||
|
||||
function xyzToUnixTimestamp($mysqldate){
|
||||
/**
|
||||
* Convert date to timestamp
|
||||
*
|
||||
* @param string $mysqldate Date YYYMMDD
|
||||
* @return timestamp Timestamp
|
||||
*/
|
||||
function xyzToUnixTimestamp($mysqldate)
|
||||
{
|
||||
$year=substr($mysqldate,0,4);
|
||||
$month=substr($mysqldate,4,2);
|
||||
$day=substr($mysqldate,6,2);
|
||||
@ -124,6 +130,14 @@ function xyzToUnixTimestamp($mysqldate){
|
||||
return $unixtimestamp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show box
|
||||
*
|
||||
* @param string $selectedDate Date YYYMMDD
|
||||
* @param int $month Month
|
||||
* @param int $year Year
|
||||
* @return void
|
||||
*/
|
||||
function displayBox($selectedDate,$month,$year)
|
||||
{
|
||||
global $langs,$conf;
|
||||
|
||||
@ -31,7 +31,6 @@
|
||||
/**
|
||||
* Return line description translated in outputlangs and encoded into UTF8
|
||||
*
|
||||
* @param Object $object Object
|
||||
* @param Line $line Current line number (0 = first line, 1 = second line, ...)
|
||||
* @param Translate $outputlangs Object langs for output
|
||||
* @param int $hideref Hide reference
|
||||
|
||||
@ -1463,8 +1463,8 @@ function isValidEmail($address)
|
||||
/**
|
||||
* Return true if phone number syntax is ok
|
||||
*
|
||||
* @param string $address phone (Ex: "0601010101")
|
||||
* @return boolean true if phone syntax is OK, false if KO or empty string
|
||||
* @param string $phone phone (Ex: "0601010101")
|
||||
* @return boolean true if phone syntax is OK, false if KO or empty string
|
||||
*/
|
||||
function isValidPhone($phone)
|
||||
{
|
||||
|
||||
@ -664,11 +664,14 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
|
||||
/**
|
||||
* Show linked objects for PDF generation
|
||||
*
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param object $object Object
|
||||
* @param Translate $outputlangs Object lang
|
||||
* @param int $curx X
|
||||
* @param int $cury Y
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param object $object Object
|
||||
* @param Translate $outputlangs Object lang
|
||||
* @param int $curx X
|
||||
* @param int $cury Y
|
||||
* @param int $align Align
|
||||
* @param string $default_font_size Font size
|
||||
* @param HookManager $hookmanager Hook manager object
|
||||
* @return void
|
||||
*/
|
||||
function pdf_writeLinkedObjects(&$pdf,$object,$outputlangs,$posx,$posy,$align,$default_font_size,$hookmanager=false)
|
||||
@ -682,7 +685,7 @@ function pdf_writeLinkedObjects(&$pdf,$object,$outputlangs,$posx,$posy,$align,$d
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetFont('','', $default_font_size - 2);
|
||||
$pdf->MultiCell(100, 3, $linkedobject["ref_title"].' : '.$linkedobject["ref_value"], '', $align);
|
||||
|
||||
|
||||
if (! empty($linkedobject["date_title"]) && ! empty($linkedobject["date_value"]))
|
||||
{
|
||||
$posy+=3;
|
||||
@ -691,7 +694,7 @@ function pdf_writeLinkedObjects(&$pdf,$object,$outputlangs,$posx,$posy,$align,$d
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $pdf->getY();
|
||||
}
|
||||
|
||||
@ -1292,13 +1295,13 @@ function pdf_getTotalQty($object,$type,$outputlangs,$hookmanager=false)
|
||||
function pdf_getCurrencySymbol(&$pdf, $currency_code)
|
||||
{
|
||||
global $db, $form;
|
||||
|
||||
|
||||
$currency_sign = '';
|
||||
|
||||
|
||||
if (! is_object($form)) $form = new Form($db);
|
||||
|
||||
|
||||
$form->load_cache_currencies();
|
||||
|
||||
|
||||
if (is_array($form->cache_currencies[$currency_code]['unicode']) && ! empty($form->cache_currencies[$currency_code]['unicode']))
|
||||
{
|
||||
foreach($form->cache_currencies[$currency_code]['unicode'] as $unicode)
|
||||
@ -1310,13 +1313,13 @@ function pdf_getCurrencySymbol(&$pdf, $currency_code)
|
||||
{
|
||||
$currency_sign = $currency_code;
|
||||
}
|
||||
|
||||
|
||||
return $currency_sign;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return linked objects
|
||||
*
|
||||
*
|
||||
* @param object $object Object
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @param HookManager $hookmanager Hook manager instance
|
||||
@ -1325,7 +1328,7 @@ function pdf_getCurrencySymbol(&$pdf, $currency_code)
|
||||
function pdf_getLinkedObjects($object,$outputlangs,$hookmanager=false)
|
||||
{
|
||||
$linkedobjects=array();
|
||||
|
||||
|
||||
$object->fetchObjectLinked();
|
||||
|
||||
foreach($object->linkedObjects as $objecttype => $objects)
|
||||
@ -1355,7 +1358,7 @@ function pdf_getLinkedObjects($object,$outputlangs,$hookmanager=false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// For add external linked objects
|
||||
if (is_object($hookmanager))
|
||||
{
|
||||
|
||||
@ -139,6 +139,7 @@ function product_prepare_head($object, $user)
|
||||
* Return array head with list of tabs to view object informations.
|
||||
*
|
||||
* @param Object $object Product
|
||||
* @param string $tab Tab id
|
||||
* @return array head array with tabs
|
||||
*/
|
||||
function product_admin_prepare_head($object, $tab)
|
||||
@ -171,10 +172,11 @@ function product_admin_prepare_head($object, $tab)
|
||||
|
||||
|
||||
/**
|
||||
* Show stats for company
|
||||
*
|
||||
* Enter description here ...
|
||||
* @param unknown_type $product
|
||||
* @param unknown_type $socid
|
||||
* @param Product $product Product object
|
||||
* @param int $socid Thirdparty id
|
||||
* @return void
|
||||
*/
|
||||
function show_stats_for_company($product,$socid)
|
||||
{
|
||||
|
||||
@ -266,6 +266,7 @@ function select_projects($socid=-1, $selected='', $htmlname='projectid', $maxlen
|
||||
* @param int $showproject Show project columns
|
||||
* @param int &$taskrole Array of roles of user for each tasks
|
||||
* @param int $projectsListId List of id of project allowed to user (separated with comma)
|
||||
* @return void
|
||||
*/
|
||||
function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$taskrole, $projectsListId='')
|
||||
{
|
||||
|
||||
@ -137,26 +137,56 @@ class SimpleOpenID
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* SetOpenIDServer
|
||||
*
|
||||
* @param string $a Server
|
||||
* @return void
|
||||
*/
|
||||
function SetOpenIDServer($a)
|
||||
{
|
||||
$this->URLs['openid_server'] = $a;
|
||||
}
|
||||
|
||||
/**
|
||||
* SetOpenIDServer
|
||||
*
|
||||
* @param string $a Server
|
||||
* @return void
|
||||
*/
|
||||
function SetTrustRoot($a)
|
||||
{
|
||||
$this->URLs['trust_root'] = $a;
|
||||
}
|
||||
|
||||
/**
|
||||
* SetOpenIDServer
|
||||
*
|
||||
* @param string $a Server
|
||||
* @return void
|
||||
*/
|
||||
function SetCancelURL($a)
|
||||
{
|
||||
$this->URLs['cancel'] = $a;
|
||||
}
|
||||
|
||||
/**
|
||||
* SetApprovedURL
|
||||
*
|
||||
* @param string $a Server
|
||||
* @return void
|
||||
*/
|
||||
function SetApprovedURL($a)
|
||||
{
|
||||
$this->URLs['approved'] = $a;
|
||||
}
|
||||
|
||||
/**
|
||||
* SetRequiredFields
|
||||
*
|
||||
* @param string $a Server
|
||||
* @return void
|
||||
*/
|
||||
function SetRequiredFields($a)
|
||||
{
|
||||
if (is_array($a)){
|
||||
@ -166,6 +196,12 @@ class SimpleOpenID
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* SetOptionalFields
|
||||
*
|
||||
* @param string $a Server
|
||||
* @return void
|
||||
*/
|
||||
function SetOptionalFields($a)
|
||||
{
|
||||
if (is_array($a)){
|
||||
@ -175,6 +211,12 @@ class SimpleOpenID
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* SetIdentity
|
||||
*
|
||||
* @param string $a Server
|
||||
* @return void
|
||||
*/
|
||||
function SetIdentity($a)
|
||||
{ // Set Identity URL
|
||||
if ((stripos($a, 'http://') === false)
|
||||
@ -197,17 +239,35 @@ class SimpleOpenID
|
||||
$this->openid_url_identity = $a;
|
||||
}
|
||||
|
||||
/**
|
||||
* GetIdentity
|
||||
*
|
||||
* @param string $a Server
|
||||
* @return void
|
||||
*/
|
||||
function GetIdentity()
|
||||
{ // Get Identity
|
||||
return $this->openid_url_identity;
|
||||
}
|
||||
|
||||
/**
|
||||
* SetOpenIDServer
|
||||
*
|
||||
* @param string $a Server
|
||||
* @return void
|
||||
*/
|
||||
function GetError()
|
||||
{
|
||||
$e = $this->error;
|
||||
return array('code'=>$e[0],'description'=>$e[1]);
|
||||
}
|
||||
|
||||
/**
|
||||
* ErrorStore
|
||||
*
|
||||
* @param string $a Server
|
||||
* @return void
|
||||
*/
|
||||
function ErrorStore($code, $desc = null)
|
||||
{
|
||||
$errs['OPENID_NOSERVERSFOUND'] = 'Cannot find OpenID Server TAG on Identity page.';
|
||||
@ -217,6 +277,12 @@ class SimpleOpenID
|
||||
$this->error = array($code,$desc);
|
||||
}
|
||||
|
||||
/**
|
||||
* IsError
|
||||
*
|
||||
* @param string $a Server
|
||||
* @return void
|
||||
*/
|
||||
function IsError()
|
||||
{
|
||||
if (count($this->error) > 0){
|
||||
@ -226,6 +292,12 @@ class SimpleOpenID
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* splitResponse
|
||||
*
|
||||
* @param string $a Server
|
||||
* @return void
|
||||
*/
|
||||
function splitResponse($response)
|
||||
{
|
||||
$r = array();
|
||||
@ -240,6 +312,12 @@ class SimpleOpenID
|
||||
return $r;
|
||||
}
|
||||
|
||||
/**
|
||||
* OpenID_Standarize
|
||||
*
|
||||
* @param string $a Server
|
||||
* @return void
|
||||
*/
|
||||
function OpenID_Standarize($openid_identity = null)
|
||||
{
|
||||
if ($openid_identity === null)
|
||||
@ -353,6 +431,12 @@ class SimpleOpenID
|
||||
return $servers[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* GetRedirectURL
|
||||
*
|
||||
* @param string $a Server
|
||||
* @return void
|
||||
*/
|
||||
function GetRedirectURL()
|
||||
{
|
||||
$params = array();
|
||||
@ -372,18 +456,33 @@ class SimpleOpenID
|
||||
return $this->URLs['openid_server'] . "?". $this->array2url($params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Redirect
|
||||
*
|
||||
* @param string $a Server
|
||||
* @return void
|
||||
*/
|
||||
function Redirect()
|
||||
{
|
||||
$redirect_to = $this->GetRedirectURL();
|
||||
if (headers_sent()){ // Use JavaScript to redirect if content has been previously sent (not recommended, but safe)
|
||||
if (headers_sent())
|
||||
{ // Use JavaScript to redirect if content has been previously sent (not recommended, but safe)
|
||||
echo '<script language="JavaScript" type="text/javascript">window.location=\'';
|
||||
echo $redirect_to;
|
||||
echo '\';</script>';
|
||||
}else{ // Default Header Redirect
|
||||
}
|
||||
else
|
||||
{ // Default Header Redirect
|
||||
header('Location: ' . $redirect_to);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ValidateWithServer
|
||||
*
|
||||
* @param string $a Server
|
||||
* @return void
|
||||
*/
|
||||
function ValidateWithServer()
|
||||
{
|
||||
$params = array(
|
||||
@ -405,14 +504,18 @@ class SimpleOpenID
|
||||
$params['openid.mode'] = "check_authentication";
|
||||
|
||||
$openid_server = $this->GetOpenIDServer();
|
||||
if ($openid_server == false){
|
||||
if ($openid_server == false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
$response = $this->CURL_Request($openid_server,'POST',$params);
|
||||
$data = $this->splitResponse($response);
|
||||
if ($data['is_valid'] == "true") {
|
||||
if ($data['is_valid'] == "true")
|
||||
{
|
||||
return true;
|
||||
}else{
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -39,7 +39,7 @@ class InterfaceLogevents
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
function InterfaceLogevents($db)
|
||||
@ -55,6 +55,7 @@ class InterfaceLogevents
|
||||
|
||||
/**
|
||||
* Return name of trigger file
|
||||
*
|
||||
* @return string Name of trigger file
|
||||
*/
|
||||
function getName()
|
||||
@ -64,6 +65,7 @@ class InterfaceLogevents
|
||||
|
||||
/**
|
||||
* Return description of trigger file
|
||||
*
|
||||
* @return string Description of trigger file
|
||||
*/
|
||||
function getDesc()
|
||||
@ -73,6 +75,7 @@ class InterfaceLogevents
|
||||
|
||||
/**
|
||||
* Return version of trigger file
|
||||
*
|
||||
* @return string Version of trigger file
|
||||
*/
|
||||
function getVersion()
|
||||
@ -89,6 +92,7 @@ class InterfaceLogevents
|
||||
/**
|
||||
* Function called when a Dolibarrr business event is done.
|
||||
* All functions "run_trigger" are triggered if file is inside directory htdocs/core/triggers
|
||||
*
|
||||
* @param action Code de l'evenement
|
||||
* @param object Objet concerne
|
||||
* @param user Objet user
|
||||
|
||||
@ -32,7 +32,7 @@ class InterfacePaypalWorkflow
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
function InterfacePaypalWorkflow($db)
|
||||
@ -48,8 +48,9 @@ class InterfacePaypalWorkflow
|
||||
|
||||
|
||||
/**
|
||||
* \brief Renvoi nom du lot de triggers
|
||||
* \return string Nom du lot de triggers
|
||||
* Renvoi nom du lot de triggers
|
||||
*
|
||||
* @return string Nom du lot de triggers
|
||||
*/
|
||||
function getName()
|
||||
{
|
||||
@ -57,8 +58,9 @@ class InterfacePaypalWorkflow
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Renvoi descriptif du lot de triggers
|
||||
* \return string Descriptif du lot de triggers
|
||||
* Renvoi descriptif du lot de triggers
|
||||
*
|
||||
* @return string Descriptif du lot de triggers
|
||||
*/
|
||||
function getDesc()
|
||||
{
|
||||
@ -66,8 +68,9 @@ class InterfacePaypalWorkflow
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Renvoi version du lot de triggers
|
||||
* \return string Version du lot de triggers
|
||||
* Renvoi version du lot de triggers
|
||||
*
|
||||
* @return string Version du lot de triggers
|
||||
*/
|
||||
function getVersion()
|
||||
{
|
||||
@ -88,7 +91,7 @@ class InterfacePaypalWorkflow
|
||||
* @param string $action Code de l'evenement
|
||||
* @param CommonObject $object Objet concerne
|
||||
* @param User $user Objet user
|
||||
* @param Translate $lang Objet lang
|
||||
* @param Translate $langs Objet lang
|
||||
* @param Conf $conf Objet conf
|
||||
* @return int <0 if fatal error, 0 si nothing done, >0 if ok
|
||||
*/
|
||||
|
||||
@ -34,7 +34,7 @@ class InterfaceWorkflowManager
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
function InterfaceWorkflowManager($db)
|
||||
@ -51,6 +51,7 @@ class InterfaceWorkflowManager
|
||||
|
||||
/**
|
||||
* Return name of trigger file
|
||||
*
|
||||
* @return string Name of trigger file
|
||||
*/
|
||||
function getName()
|
||||
@ -60,6 +61,7 @@ class InterfaceWorkflowManager
|
||||
|
||||
/**
|
||||
* Return description of trigger file
|
||||
*
|
||||
* @return string Description of trigger file
|
||||
*/
|
||||
function getDesc()
|
||||
@ -69,6 +71,7 @@ class InterfaceWorkflowManager
|
||||
|
||||
/**
|
||||
* Return version of trigger file
|
||||
*
|
||||
* @return string Version of trigger file
|
||||
*/
|
||||
function getVersion()
|
||||
|
||||
@ -40,7 +40,7 @@ class InterfaceActionsAuto
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
function InterfaceActionsAuto($db)
|
||||
@ -56,6 +56,7 @@ class InterfaceActionsAuto
|
||||
|
||||
/**
|
||||
* Return name of trigger file
|
||||
*
|
||||
* @return string Name of trigger file
|
||||
*/
|
||||
function getName()
|
||||
@ -65,6 +66,7 @@ class InterfaceActionsAuto
|
||||
|
||||
/**
|
||||
* Return description of trigger file
|
||||
*
|
||||
* @return string Description of trigger file
|
||||
*/
|
||||
function getDesc()
|
||||
@ -74,6 +76,7 @@ class InterfaceActionsAuto
|
||||
|
||||
/**
|
||||
* Return version of trigger file
|
||||
*
|
||||
* @return string Version of trigger file
|
||||
*/
|
||||
function getVersion()
|
||||
|
||||
@ -35,7 +35,7 @@ class InterfaceLdapsynchro
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
function InterfaceLdapsynchro($db)
|
||||
@ -51,6 +51,7 @@ class InterfaceLdapsynchro
|
||||
|
||||
/**
|
||||
* Return name of trigger file
|
||||
*
|
||||
* @return string Name of trigger file
|
||||
*/
|
||||
function getName()
|
||||
@ -60,6 +61,7 @@ class InterfaceLdapsynchro
|
||||
|
||||
/**
|
||||
* Return description of trigger file
|
||||
*
|
||||
* @return string Description of trigger file
|
||||
*/
|
||||
function getDesc()
|
||||
@ -69,6 +71,7 @@ class InterfaceLdapsynchro
|
||||
|
||||
/**
|
||||
* Return version of trigger file
|
||||
*
|
||||
* @return string Version of trigger file
|
||||
*/
|
||||
function getVersion()
|
||||
@ -85,6 +88,7 @@ class InterfaceLdapsynchro
|
||||
/**
|
||||
* Function called when a Dolibarrr business event is done.
|
||||
* All functions "run_trigger" are triggered if file is inside directory htdocs/core/triggers
|
||||
*
|
||||
* @param action Event code (COMPANY_CREATE, PROPAL_VALIDATE, ...)
|
||||
* @param object Object action is done on
|
||||
* @param user Object user
|
||||
@ -117,7 +121,7 @@ class InterfaceLdapsynchro
|
||||
$result=$ldap->add($dn,$info,$user);
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->error="ErrorLDAP"." ".$ldap->error;
|
||||
$this->error="ErrorLDAP ".$ldap->error;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
@ -148,7 +152,7 @@ class InterfaceLdapsynchro
|
||||
$result=$ldap->update($dn,$info,$user,$olddn);
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->error="ErrorLDAP"." ".$ldap->error;
|
||||
$this->error="ErrorLDAP ".$ldap->error;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
@ -179,7 +183,7 @@ class InterfaceLdapsynchro
|
||||
$result=$ldap->update($dn,$info,$user,$olddn);
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->error="ErrorLDAP"." ".$ldap->error;
|
||||
$this->error="ErrorLDAP ".$ldap->error;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
@ -202,7 +206,7 @@ class InterfaceLdapsynchro
|
||||
$result=$ldap->delete($dn,$info,$user);
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->error="ErrorLDAP"." ".$ldap->error;
|
||||
$this->error="ErrorLDAP ".$ldap->error;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
@ -226,7 +230,7 @@ class InterfaceLdapsynchro
|
||||
$result=$ldap->add($dn,$info,$user);
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->error="ErrorLDAP"." ".$ldap->error;
|
||||
$this->error="ErrorLDAP ".$ldap->error;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
@ -256,7 +260,7 @@ class InterfaceLdapsynchro
|
||||
$result=$ldap->update($dn,$info,$user,$olddn);
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->error="ErrorLDAP"." ".$ldap->error;
|
||||
$this->error="ErrorLDAP ".$ldap->error;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
@ -274,7 +278,7 @@ class InterfaceLdapsynchro
|
||||
$result=$ldap->delete($dn,$info,$user);
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->error="ErrorLDAP"." ".$ldap->error;
|
||||
$this->error="ErrorLDAP ".$ldap->error;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
@ -295,7 +299,7 @@ class InterfaceLdapsynchro
|
||||
$result=$ldap->add($dn,$info,$user);
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->error="ErrorLDAP"." ".$ldap->error;
|
||||
$this->error="ErrorLDAP ".$ldap->error;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
@ -326,7 +330,7 @@ class InterfaceLdapsynchro
|
||||
$result=$ldap->update($dn,$info,$user,$olddn);
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->error="ErrorLDAP"." ".$ldap->error;
|
||||
$this->error="ErrorLDAP ".$ldap->error;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
@ -345,7 +349,7 @@ class InterfaceLdapsynchro
|
||||
$result=$ldap->delete($dn,$info,$user);
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->error="ErrorLDAP"." ".$ldap->error;
|
||||
$this->error="ErrorLDAP ".$ldap->error;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
@ -366,7 +370,7 @@ class InterfaceLdapsynchro
|
||||
$result=$ldap->add($dn,$info,$user);
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->error="ErrorLDAP"." ".$ldap->error;
|
||||
$this->error="ErrorLDAP ".$ldap->error;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
@ -389,7 +393,7 @@ class InterfaceLdapsynchro
|
||||
$result=$ldap->update($dn,$info,$user,$olddn);
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->error="ErrorLDAP"." ".$ldap->error;
|
||||
$this->error="ErrorLDAP ".$ldap->error;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
@ -417,7 +421,7 @@ class InterfaceLdapsynchro
|
||||
$result=$ldap->update($dn,$info,$user,$olddn);
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->error="ErrorLDAP"." ".$ldap->error;
|
||||
$this->error="ErrorLDAP ".$ldap->error;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
@ -449,7 +453,7 @@ class InterfaceLdapsynchro
|
||||
$result=$ldap->update($dn,$info,$user,$olddn);
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->error="ErrorLDAP"." ".$ldap->error;
|
||||
$this->error="ErrorLDAP ".$ldap->error;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
@ -472,7 +476,7 @@ class InterfaceLdapsynchro
|
||||
$result=$ldap->update($dn,$info,$user,$olddn);
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->error="ErrorLDAP"." ".$ldap->error;
|
||||
$this->error="ErrorLDAP ".$ldap->error;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
@ -496,7 +500,7 @@ class InterfaceLdapsynchro
|
||||
$result=$ldap->update($dn,$info,$user,$olddn);
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->error="ErrorLDAP"." ".$ldap->error;
|
||||
$this->error="ErrorLDAP ".$ldap->error;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
@ -516,7 +520,7 @@ class InterfaceLdapsynchro
|
||||
$result=$ldap->delete($dn,$info,$user);
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->error="ErrorLDAP"." ".$ldap->error;
|
||||
$this->error="ErrorLDAP ".$ldap->error;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
@ -35,7 +35,7 @@ class InterfaceNotification
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
function InterfaceNotification($db)
|
||||
@ -51,6 +51,7 @@ class InterfaceNotification
|
||||
|
||||
/**
|
||||
* Return name of trigger file
|
||||
*
|
||||
* @return string Name of trigger file
|
||||
*/
|
||||
function getName()
|
||||
@ -60,6 +61,7 @@ class InterfaceNotification
|
||||
|
||||
/**
|
||||
* Return description of trigger file
|
||||
*
|
||||
* @return string Description of trigger file
|
||||
*/
|
||||
function getDesc()
|
||||
@ -69,6 +71,7 @@ class InterfaceNotification
|
||||
|
||||
/**
|
||||
* Return version of trigger file
|
||||
*
|
||||
* @return string Version of trigger file
|
||||
*/
|
||||
function getVersion()
|
||||
@ -85,6 +88,7 @@ class InterfaceNotification
|
||||
/**
|
||||
* Function called when a Dolibarrr business event is done.
|
||||
* All functions "run_trigger" are triggered if file is inside directory htdocs/core/triggers
|
||||
*
|
||||
* @param action Event code (COMPANY_CREATE, PROPAL_VALIDATE, ...)
|
||||
* @param object Object action is done on
|
||||
* @param user Object user
|
||||
@ -202,6 +206,7 @@ class InterfaceNotification
|
||||
|
||||
/**
|
||||
* Return list of events managed by notification module
|
||||
*
|
||||
* @return array Array of events managed by notification module
|
||||
*/
|
||||
function getListOfManagedEvents()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user