Qual: Ckeckstyle
This commit is contained in:
parent
c92dbe7e61
commit
6a5218b9b2
@ -66,10 +66,7 @@ if ($action == 'add_paiement' || ($action == 'confirm_paiement' && $confirm=='ye
|
|||||||
{
|
{
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
$datepaye = dol_mktime(12, 0 , 0,
|
$datepaye = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
|
||||||
$_POST['remonth'],
|
|
||||||
$_POST['reday'],
|
|
||||||
$_POST['reyear']);
|
|
||||||
$paiement_id = 0;
|
$paiement_id = 0;
|
||||||
|
|
||||||
// Verifie si des paiements sont superieurs au montant facture
|
// Verifie si des paiements sont superieurs au montant facture
|
||||||
@ -634,7 +631,7 @@ if (! GETPOST('action'))
|
|||||||
}
|
}
|
||||||
|
|
||||||
$sql .= ' ORDER BY '.$sortfield.' '.$sortorder;
|
$sql .= ' ORDER BY '.$sortfield.' '.$sortorder;
|
||||||
$sql .= $db->plimit($limit +1 ,$offset);
|
$sql .= $db->plimit($limit+1, $offset);
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
|
|
||||||
if ($resql)
|
if ($resql)
|
||||||
|
|||||||
@ -54,15 +54,15 @@ class BonPrelevement extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param DoliDB $DB Database handler
|
* @param DoliDB $db Database handler
|
||||||
* @param string $filename Filename of withdraw receipt
|
* @param string $filename Filename of withdraw receipt
|
||||||
*/
|
*/
|
||||||
function BonPrelevement($DB, $filename='')
|
function BonPrelevement($db, $filename='')
|
||||||
{
|
{
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
$this->db = $DB;
|
$this->db = $db;
|
||||||
|
|
||||||
$this->filename=$filename;
|
$this->filename=$filename;
|
||||||
|
|
||||||
@ -526,7 +526,7 @@ class BonPrelevement extends CommonObject
|
|||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
dol_syslog("bon-prelevement::set_infotrans Start",LOG_INFO);
|
dol_syslog("bon-prelevement::set_infotrans Start",LOG_INFO);
|
||||||
if ($this->db->begin())
|
if ($this->db->begin())
|
||||||
{
|
{
|
||||||
@ -1209,14 +1209,14 @@ class BonPrelevement extends CommonObject
|
|||||||
$obj = $this->db->fetch_object($resql);
|
$obj = $this->db->fetch_object($resql);
|
||||||
|
|
||||||
$esaeb19->agregaRecibo(
|
$esaeb19->agregaRecibo(
|
||||||
$idOrdenante,
|
$idOrdenante,
|
||||||
"idcliente".$i+1,
|
"idcliente".$i+1,
|
||||||
$obj->client_nom,
|
$obj->client_nom,
|
||||||
$obj->code_banque,
|
$obj->code_banque,
|
||||||
$obj->code_guichet,
|
$obj->code_guichet,
|
||||||
$obj->cle_rib,
|
$obj->cle_rib,
|
||||||
$obj->number,
|
$obj->number,
|
||||||
$obj->amount,
|
$obj->amount,
|
||||||
"Fra.".$obj->facnumber." ".$obj->amount
|
"Fra.".$obj->facnumber." ".$obj->amount
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -1303,16 +1303,7 @@ class BonPrelevement extends CommonObject
|
|||||||
{
|
{
|
||||||
$row = $this->db->fetch_row($resql);
|
$row = $this->db->fetch_row($resql);
|
||||||
|
|
||||||
$this->EnregDestinataire(
|
$this->EnregDestinataire($row[0],$row[1],$row[2],$row[3],$row[4],$row[5],$row[6],$row[7]);
|
||||||
$row[0],
|
|
||||||
$row[1],
|
|
||||||
$row[2],
|
|
||||||
$row[3],
|
|
||||||
$row[4],
|
|
||||||
$row[5],
|
|
||||||
$row[6],
|
|
||||||
$row[7]
|
|
||||||
);
|
|
||||||
|
|
||||||
$this->total = $this->total + $row[5];
|
$this->total = $this->total + $row[5];
|
||||||
|
|
||||||
|
|||||||
@ -39,15 +39,16 @@ class LignePrelevement
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Constructeur de la classe
|
* Constructor
|
||||||
* \param DB Handler acces base de donnees
|
*
|
||||||
* \param user Objet user
|
* @param DoliDb $db Database handler
|
||||||
|
* @param User $user Objet user
|
||||||
*/
|
*/
|
||||||
function LignePrelevement($DB, $user)
|
function LignePrelevement($db, $user)
|
||||||
{
|
{
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
|
|
||||||
$this->db = $DB ;
|
$this->db = $db;
|
||||||
$this->user = $user;
|
$this->user = $user;
|
||||||
|
|
||||||
// List of language codes for status
|
// List of language codes for status
|
||||||
@ -59,8 +60,10 @@ class LignePrelevement
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Recupere l'objet prelevement
|
* Recupere l'objet prelevement
|
||||||
* \param rowid id de la facture a recuperer
|
*
|
||||||
|
* @param int $rowid id de la facture a recuperer
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
function fetch($rowid)
|
function fetch($rowid)
|
||||||
{
|
{
|
||||||
@ -110,8 +113,9 @@ class LignePrelevement
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return status label of object
|
* Return status label of object
|
||||||
* @param mode 0=Label, 1=Picto + label, 2=Picto, 3=Label + Picto
|
*
|
||||||
* @return string Label
|
* @param int $mode 0=Label, 1=Picto + label, 2=Picto, 3=Label + Picto
|
||||||
|
* @return string Label
|
||||||
*/
|
*/
|
||||||
function getLibStatut($mode=0)
|
function getLibStatut($mode=0)
|
||||||
{
|
{
|
||||||
@ -120,9 +124,10 @@ class LignePrelevement
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return status label for a status
|
* Return status label for a status
|
||||||
* @param statut id statut
|
*
|
||||||
* @param mode 0=Label, 1=Picto + label, 2=Picto, 3=Label + Picto
|
* @param int $statut id statut
|
||||||
* @return string Label
|
* @param int $mode 0=Label, 1=Picto + label, 2=Picto, 3=Label + Picto
|
||||||
|
* @return string Label
|
||||||
*/
|
*/
|
||||||
function LibStatut($statut,$mode=0)
|
function LibStatut($statut,$mode=0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -36,20 +36,21 @@ class RejetPrelevement
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class constructor
|
* Constructor
|
||||||
* @param DB Database Handler access
|
*
|
||||||
* @param user User
|
* @param DoliDb $db Database handler
|
||||||
|
* @param User $user Objet user
|
||||||
*/
|
*/
|
||||||
function RejetPrelevement($DB, $user)
|
function RejetPrelevement($db, $user)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
$this->db = $DB ;
|
$this->db = $db;
|
||||||
$this->user = $user;
|
$this->user = $user;
|
||||||
|
|
||||||
$this->motifs = array();
|
$this->motifs = array();
|
||||||
$this->facturer = array();
|
$this->facturer = array();
|
||||||
|
|
||||||
$this->motifs[0] = $langs->trans("StatusMotif0");
|
$this->motifs[0] = $langs->trans("StatusMotif0");
|
||||||
$this->motifs[1] = $langs->trans("StatusMotif1");
|
$this->motifs[1] = $langs->trans("StatusMotif1");
|
||||||
$this->motifs[2] = $langs->trans("StatusMotif2");
|
$this->motifs[2] = $langs->trans("StatusMotif2");
|
||||||
@ -59,16 +60,27 @@ class RejetPrelevement
|
|||||||
$this->motifs[6] = $langs->trans("StatusMotif6");
|
$this->motifs[6] = $langs->trans("StatusMotif6");
|
||||||
$this->motifs[7] = $langs->trans("StatusMotif7");
|
$this->motifs[7] = $langs->trans("StatusMotif7");
|
||||||
$this->motifs[8] = $langs->trans("StatusMotif8");
|
$this->motifs[8] = $langs->trans("StatusMotif8");
|
||||||
|
|
||||||
$this->facturer[0]=$langs->trans("NoInvoiceRefused");
|
$this->facturer[0]=$langs->trans("NoInvoiceRefused");
|
||||||
$this->facturer[1]=$langs->trans("InvoiceRefused");
|
$this->facturer[1]=$langs->trans("InvoiceRefused");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create
|
||||||
|
*
|
||||||
|
* @param User $user User object
|
||||||
|
* @param int $id Id
|
||||||
|
* @param string $motif Motif
|
||||||
|
* @param timestamp $date_rejet Date rejet
|
||||||
|
* @param int $bonid Bon id
|
||||||
|
* @param int $facturation Facturation
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
function create($user, $id, $motif, $date_rejet, $bonid, $facturation=0)
|
function create($user, $id, $motif, $date_rejet, $bonid, $facturation=0)
|
||||||
{
|
{
|
||||||
global $langs,$conf;
|
global $langs,$conf;
|
||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
$this->id = $id;
|
$this->id = $id;
|
||||||
$this->bon_id = $bonid;
|
$this->bon_id = $bonid;
|
||||||
@ -115,7 +127,7 @@ class RejetPrelevement
|
|||||||
dol_syslog("RejetPrelevement::create Erreur 5");
|
dol_syslog("RejetPrelevement::create Erreur 5");
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$num=count($facs);
|
$num=count($facs);
|
||||||
for ($i = 0; $i < $num; $i++)
|
for ($i = 0; $i < $num; $i++)
|
||||||
{
|
{
|
||||||
@ -126,12 +138,12 @@ class RejetPrelevement
|
|||||||
$pai = new Paiement($this->db);
|
$pai = new Paiement($this->db);
|
||||||
|
|
||||||
$pai->amounts = array();
|
$pai->amounts = array();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We replace the comma with a point otherwise some
|
* We replace the comma with a point otherwise some
|
||||||
* PHP installs sends only the part integer negative
|
* PHP installs sends only the part integer negative
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$pai->amounts[$facs[$i]] = price2num($fac->total_ttc * -1);
|
$pai->amounts[$facs[$i]] = price2num($fac->total_ttc * -1);
|
||||||
$pai->datepaye = $date_rejet;
|
$pai->datepaye = $date_rejet;
|
||||||
$pai->paiementid = 3; // type of payment: withdrawal
|
$pai->paiementid = 3; // type of payment: withdrawal
|
||||||
@ -150,14 +162,14 @@ class RejetPrelevement
|
|||||||
dol_syslog("RejetPrelevement::Create AddPaymentToBan Error");
|
dol_syslog("RejetPrelevement::Create AddPaymentToBan Error");
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Payment validation
|
// Payment validation
|
||||||
if ($pai->valide() < 0)
|
if ($pai->valide() < 0)
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
dol_syslog("RejetPrelevement::Create Error payment validation");
|
dol_syslog("RejetPrelevement::Create Error payment validation");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
//Tag invoice as unpaid
|
//Tag invoice as unpaid
|
||||||
dol_syslog("RejetPrelevement::Create set_unpaid fac ".$fac->ref);
|
dol_syslog("RejetPrelevement::Create set_unpaid fac ".$fac->ref);
|
||||||
@ -181,8 +193,10 @@ class RejetPrelevement
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Envoi mail
|
* Envoi mail
|
||||||
* @param fac Invoice object
|
*
|
||||||
|
* @param Facture $fac Invoice object
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
function _send_email($fac)
|
function _send_email($fac)
|
||||||
{
|
{
|
||||||
@ -232,12 +246,10 @@ class RejetPrelevement
|
|||||||
$socname = $soc->nom;
|
$socname = $soc->nom;
|
||||||
$amount = price($fac->total_ttc);
|
$amount = price($fac->total_ttc);
|
||||||
$userinfo = $this->user->getFullName($langs);
|
$userinfo = $this->user->getFullName($langs);
|
||||||
|
|
||||||
$message = $langs->trans("InfoRejectMessage",$facref,$socname, $amount, $userinfo);
|
$message = $langs->trans("InfoRejectMessage",$facref,$socname, $amount, $userinfo);
|
||||||
|
|
||||||
$mailfile = new CMailFile($subject,$sendto,$from,$message,
|
$mailfile = new CMailFile($subject,$sendto,$from,$message,$arr_file,$arr_mime,$arr_name,'', '', 0, $msgishtml,$this->user->email);
|
||||||
$arr_file,$arr_mime,$arr_name,
|
|
||||||
'', '', 0, $msgishtml,$this->user->email);
|
|
||||||
|
|
||||||
$result=$mailfile->sendfile();
|
$result=$mailfile->sendfile();
|
||||||
if ($result)
|
if ($result)
|
||||||
@ -257,13 +269,15 @@ class RejetPrelevement
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve the list of invoices
|
* Retrieve the list of invoices
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
function _get_list_factures()
|
function _get_list_factures()
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$arr = array();
|
$arr = array();
|
||||||
|
|
||||||
//Returns all invoices of a withdrawal
|
//Returns all invoices of a withdrawal
|
||||||
$sql = "SELECT f.rowid as facid";
|
$sql = "SELECT f.rowid as facid";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."prelevement_facture as pf";
|
$sql.= " FROM ".MAIN_DB_PREFIX."prelevement_facture as pf";
|
||||||
@ -300,7 +314,9 @@ class RejetPrelevement
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve withdrawal object
|
* Retrieve withdrawal object
|
||||||
* @param rowid id of invoice to retrieve
|
*
|
||||||
|
* @param int $rowid id of invoice to retrieve
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
function fetch($rowid)
|
function fetch($rowid)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -182,7 +182,7 @@ class RssParser
|
|||||||
}
|
}
|
||||||
|
|
||||||
xml_set_object($xmlparser, $this);
|
xml_set_object($xmlparser, $this);
|
||||||
xml_set_element_handler($xmlparser, 'feed_start_element', 'feed_end_element' );
|
xml_set_element_handler($xmlparser, 'feed_start_element', 'feed_end_element');
|
||||||
xml_set_character_data_handler($xmlparser, 'feed_cdata');
|
xml_set_character_data_handler($xmlparser, 'feed_cdata');
|
||||||
$status = xml_parse($xmlparser, $str);
|
$status = xml_parse($xmlparser, $str);
|
||||||
xml_parser_free($xmlparser);
|
xml_parser_free($xmlparser);
|
||||||
@ -371,9 +371,10 @@ class RssParser
|
|||||||
/**
|
/**
|
||||||
* Triggered when opened tag is found
|
* Triggered when opened tag is found
|
||||||
*
|
*
|
||||||
* @param $p
|
* @param string $p
|
||||||
* @param $element Tag
|
* @param string $element Tag
|
||||||
* @param $attrs Attributes of tags
|
* @param array &$attrs Attributes of tags
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
function feed_start_element($p, $element, &$attrs)
|
function feed_start_element($p, $element, &$attrs)
|
||||||
{
|
{
|
||||||
@ -382,7 +383,7 @@ class RssParser
|
|||||||
|
|
||||||
// check for a namespace, and split if found
|
// check for a namespace, and split if found
|
||||||
$ns = false;
|
$ns = false;
|
||||||
if ( strpos( $element, ':' ) ) {
|
if (strpos($element, ':' )) {
|
||||||
list($ns, $el) = explode(':', $element, 2);
|
list($ns, $el) = explode(':', $element, 2);
|
||||||
}
|
}
|
||||||
if ( $ns and $ns != 'rdf' ) {
|
if ( $ns and $ns != 'rdf' ) {
|
||||||
@ -455,10 +456,7 @@ class RssParser
|
|||||||
elseif ($this->_format == 'atom' and $this->incontent )
|
elseif ($this->_format == 'atom' and $this->incontent )
|
||||||
{
|
{
|
||||||
// if tags are inlined, then flatten
|
// if tags are inlined, then flatten
|
||||||
$attrs_str = join(' ',
|
$attrs_str = join(' ', array_map('map_attrs', array_keys($attrs), array_values($attrs)));
|
||||||
array_map('map_attrs',
|
|
||||||
array_keys($attrs),
|
|
||||||
array_values($attrs) ) );
|
|
||||||
|
|
||||||
$this->append_content("<$element $attrs_str>" );
|
$this->append_content("<$element $attrs_str>" );
|
||||||
|
|
||||||
@ -491,8 +489,9 @@ class RssParser
|
|||||||
/**
|
/**
|
||||||
* Triggered when CDATA is found
|
* Triggered when CDATA is found
|
||||||
*
|
*
|
||||||
* @param $p
|
* @param string $p
|
||||||
* @param $text Tag
|
* @param string $text Tag
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
function feed_cdata($p, $text)
|
function feed_cdata($p, $text)
|
||||||
{
|
{
|
||||||
@ -509,8 +508,9 @@ class RssParser
|
|||||||
/**
|
/**
|
||||||
* Triggered when closed tag is found
|
* Triggered when closed tag is found
|
||||||
*
|
*
|
||||||
* @param $p
|
* @param string $p
|
||||||
* @param $el Tag
|
* @param string $el Tag
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
function feed_end_element($p, $el)
|
function feed_end_element($p, $el)
|
||||||
{
|
{
|
||||||
@ -562,8 +562,9 @@ class RssParser
|
|||||||
/**
|
/**
|
||||||
* To concat 2 string with no warning if an operand is not defined
|
* To concat 2 string with no warning if an operand is not defined
|
||||||
*
|
*
|
||||||
* @param $str1
|
* @param string &$str1 Str1
|
||||||
* @param $str2
|
* @param string $str2 Str2
|
||||||
|
* @return string String cancatenated
|
||||||
*/
|
*/
|
||||||
function concat(&$str1, $str2="")
|
function concat(&$str1, $str2="")
|
||||||
{
|
{
|
||||||
@ -574,6 +575,10 @@ class RssParser
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Enter description here ...
|
||||||
|
*
|
||||||
|
* @param string $text Text
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
function append_content($text)
|
function append_content($text)
|
||||||
{
|
{
|
||||||
@ -587,6 +592,10 @@ class RssParser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* smart append - field and namespace aware
|
* smart append - field and namespace aware
|
||||||
|
*
|
||||||
|
* @param string $el El
|
||||||
|
* @param string $text Text
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
function append($el, $text)
|
function append($el, $text)
|
||||||
{
|
{
|
||||||
@ -596,30 +605,30 @@ class RssParser
|
|||||||
if ( $this->current_namespace )
|
if ( $this->current_namespace )
|
||||||
{
|
{
|
||||||
if ( $this->initem ) {
|
if ( $this->initem ) {
|
||||||
$this->concat( $this->current_item[ $this->current_namespace ][ $el ], $text);
|
$this->concat($this->current_item[ $this->current_namespace ][ $el ], $text);
|
||||||
}
|
}
|
||||||
elseif ($this->inchannel) {
|
elseif ($this->inchannel) {
|
||||||
$this->concat( $this->channel[ $this->current_namespace][ $el ], $text);
|
$this->concat($this->channel[ $this->current_namespace][ $el ], $text);
|
||||||
}
|
}
|
||||||
elseif ($this->intextinput) {
|
elseif ($this->intextinput) {
|
||||||
$this->concat( $this->textinput[ $this->current_namespace][ $el ], $text);
|
$this->concat($this->textinput[ $this->current_namespace][ $el ], $text);
|
||||||
}
|
}
|
||||||
elseif ($this->inimage) {
|
elseif ($this->inimage) {
|
||||||
$this->concat( $this->image[ $this->current_namespace ][ $el ], $text);
|
$this->concat($this->image[ $this->current_namespace ][ $el ], $text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if ( $this->initem ) {
|
if ( $this->initem ) {
|
||||||
$this->concat( $this->current_item[ $el ], $text);
|
$this->concat($this->current_item[ $el ], $text);
|
||||||
}
|
}
|
||||||
elseif ($this->intextinput) {
|
elseif ($this->intextinput) {
|
||||||
$this->concat( $this->textinput[ $el ], $text);
|
$this->concat($this->textinput[ $el ], $text);
|
||||||
}
|
}
|
||||||
elseif ($this->inimage) {
|
elseif ($this->inimage) {
|
||||||
$this->concat( $this->image[ $el ], $text);
|
$this->concat($this->image[ $el ], $text);
|
||||||
}
|
}
|
||||||
elseif ($this->inchannel) {
|
elseif ($this->inchannel) {
|
||||||
$this->concat( $this->channel[ $el ], $text);
|
$this->concat($this->channel[ $el ], $text);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -630,6 +639,9 @@ class RssParser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Function to convert an XML object into an array
|
* Function to convert an XML object into an array
|
||||||
|
*
|
||||||
|
* @param string $xml Xml
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
function xml2php($xml)
|
function xml2php($xml)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user