Gestion des numeros speciaux
This commit is contained in:
parent
efe13991ab
commit
ca69908420
@ -43,7 +43,7 @@ class CommunicationTelephonique {
|
|||||||
* Calcul le coût de la communication
|
* Calcul le coût de la communication
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function cout($tarif_achat, $tarif_vente, $ligne)
|
function cout($tarif_achat, $tarif_vente, $ligne, $_db)
|
||||||
{
|
{
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
@ -66,15 +66,15 @@ class CommunicationTelephonique {
|
|||||||
|
|
||||||
$this->remise = $ligne->remise;
|
$this->remise = $ligne->remise;
|
||||||
}
|
}
|
||||||
elseif (substr($this->numero,0,4) == substr($objp->client,0,4) ) /* Tarif Local */
|
/* Tarif Local */
|
||||||
|
/*
|
||||||
|
elseif (substr($this->numero,0,4) == substr($objp->client,0,4) )
|
||||||
{
|
{
|
||||||
$dureenat += $objp->duree;
|
$dureenat += $objp->duree;
|
||||||
$nbnat++;
|
$nbnat++;
|
||||||
|
|
||||||
$num = "0033999".substr($this->numero, 1);
|
$num = "0033999".substr($this->numero, 1);
|
||||||
|
|
||||||
$this->remise = $ligne->remise;
|
$this->remise = $ligne->remise;
|
||||||
}
|
}*/
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$dureenat += $objp->duree;
|
$dureenat += $objp->duree;
|
||||||
@ -89,7 +89,17 @@ class CommunicationTelephonique {
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
/* Numéros spéciaux */
|
||||||
|
if (substr($num,4,1) == 8)
|
||||||
|
{
|
||||||
|
$this->remise = 0;
|
||||||
|
$this->cout_temp_vente = 0;
|
||||||
|
$this->tarif_libelle_vente = "Numéros spéciaux";
|
||||||
|
$this->cout_fixe_vente = ereg_replace(",",".", $this->montant);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Fin Numéros spéciaux */
|
||||||
if (! $tarif_achat->cout($num, $this->cout_temp_achat, $this->cout_fixe_achat, $tarif_libelle_achat))
|
if (! $tarif_achat->cout($num, $this->cout_temp_achat, $this->cout_fixe_achat, $tarif_libelle_achat))
|
||||||
{
|
{
|
||||||
print "3- Tarif achat manquant pour $num\n";
|
print "3- Tarif achat manquant pour $num\n";
|
||||||
@ -103,7 +113,27 @@ class CommunicationTelephonique {
|
|||||||
dolibarr_syslog("CommunicationTelephonique::Cout Tarif vente manquant pour $num");
|
dolibarr_syslog("CommunicationTelephonique::Cout Tarif vente manquant pour $num");
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
/* Specification VoIP */
|
||||||
|
if ($ligne->techno == 'voip')
|
||||||
|
{
|
||||||
|
if (substr($num,4,1) < 6)
|
||||||
|
{
|
||||||
|
$lignedest = new LigneTel($_db);
|
||||||
|
|
||||||
|
if ($lignedest->fetch("0".substr($num, -9)) == 1)
|
||||||
|
{
|
||||||
|
if ($lignedest->techno == 'voip' && ($ligne->client_comm_id == $lignedest->client_comm_id))
|
||||||
|
{
|
||||||
|
$this->remise = 0;
|
||||||
|
$this->cout_fixe_vente = 0;
|
||||||
|
$this->cout_temp_vente = 0;
|
||||||
|
$this->tarif_libelle_vente = "Appel Interne VoIP";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* Fin VoIP */
|
||||||
|
|
||||||
$this->cout_achat = ( ($this->duree * $this->cout_temp_achat / 60) + $this->cout_fixe_achat);
|
$this->cout_achat = ( ($this->duree * $this->cout_temp_achat / 60) + $this->cout_fixe_achat);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user