New: Add a first version of a Paybox module
This commit is contained in:
parent
ba55fd2695
commit
9fe83ec7e6
@ -26,6 +26,8 @@
|
||||
require("./pre.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php");
|
||||
|
||||
$service='PayBox';
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->load("paybox");
|
||||
|
||||
@ -132,9 +134,14 @@ $regex=DOL_URL_ROOT.'$';
|
||||
$firstpart=eregi_replace($regex,'',$firstpart);
|
||||
//print $firstpart.DOL_URL_ROOT.'/public/paybox/newpayment.php?amount=order&ref=<i>orderref</i>&tag=<i>ATAGOFYOURCHOICE</i>'."<br>\n";
|
||||
//print $firstpart.DOL_URL_ROOT.'/public/paybox/newpayment.php?amount=invoice&ref=<i>invoiceref</i>&tag=<i>ATAGOFYOURCHOICE</i>'."<br>\n";
|
||||
print $firstpart.DOL_URL_ROOT.'/public/paybox/newpayment.php?amount=contractline&ref=<i>contractlineref</i>&tag=<i>ATAGOFYOURCHOICE</i>'."<br>\n";
|
||||
print $firstpart.DOL_URL_ROOT.'/public/paybox/newpayment.php?amount=<i>9.99</i>&tag=<i>ATAGOFYOURCHOICE</i>'."<br>\n";
|
||||
|
||||
print '<br>';
|
||||
print $langs->trans("ToOfferALinkForOnlinePaymentOnContractLine",$service).':<br>';
|
||||
print $firstpart.DOL_URL_ROOT.'/public/paybox/newpayment.php?amount=contractline&ref=<i>contractlineref</i>'."<br>\n";
|
||||
print '<br>';
|
||||
print $langs->trans("ToOfferALinkForOnlinePaymentOnFreeAmount",$service).':<br>';
|
||||
print $firstpart.DOL_URL_ROOT.'/public/paybox/newpayment.php?amount=<i>9.99</i>&tag=<i>yourfreetag</i>'."<br>\n";
|
||||
print '<br>';
|
||||
print $langs->trans("YouCanAddTagOnUrl");
|
||||
|
||||
$db->close();
|
||||
|
||||
|
||||
@ -863,7 +863,7 @@ if (($_POST['action'] == 'addligne' || $_POST['action'] == 'addligne_predef') &&
|
||||
$tva_tx = get_default_tva($mysoc,$fac->client,$prod->tva_tx);
|
||||
$tva_npr = get_default_npr($mysoc,$fac->client,$prod->tva_tx);
|
||||
|
||||
// On defini prix unitaire
|
||||
// We define price for product
|
||||
if ($conf->global->PRODUIT_MULTIPRICES)
|
||||
{
|
||||
$pu_ht = $prod->multiprices[$fac->client->price_level];
|
||||
@ -2987,7 +2987,7 @@ else
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Emettre paiement
|
||||
if ($fac->type != 2 && $fac->statut == 1 && $fac->paye == 0 && $user->rights->facture->paiement)
|
||||
{
|
||||
|
||||
@ -245,11 +245,11 @@ class Contrat extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* \brief Chargement depuis la base des donnees du contrat
|
||||
* \param id Id du contrat a charger
|
||||
* \return int <0 si ko, id du contrat charge si ok
|
||||
* \brief Load a contract from database
|
||||
* \param id Id of contract to load
|
||||
* \return int <0 if KO, id of contract if OK
|
||||
*/
|
||||
function fetch($id)
|
||||
function fetch($id,$ref='')
|
||||
{
|
||||
$sql = "SELECT rowid, statut, ref, fk_soc, mise_en_service as datemise,";
|
||||
$sql.= " fk_user_mise_en_service, date_contrat as datecontrat,";
|
||||
@ -257,9 +257,11 @@ class Contrat extends CommonObject
|
||||
$sql.= " fk_projet,";
|
||||
$sql.= " fk_commercial_signature, fk_commercial_suivi,";
|
||||
$sql.= " note, note_public";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."contrat WHERE rowid = ".$id;
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."contrat";
|
||||
if ($ref) $sql.= " WHERE ref='".$ref."'";
|
||||
else $sql.= " WHERE rowid=".$id;
|
||||
|
||||
dolibarr_syslog("Contrat::fetch sql=".$sql);
|
||||
dol_syslog("Contrat::fetch sql=".$sql, LOG_DEBUG);
|
||||
$resql = $this->db->query($sql) ;
|
||||
if ($resql)
|
||||
{
|
||||
@ -289,8 +291,9 @@ class Contrat extends CommonObject
|
||||
|
||||
$this->fk_projet = $result["fk_projet"];
|
||||
|
||||
$this->socid = $result["fk_soc"];
|
||||
$this->societe->fetch($result["fk_soc"]); // TODO A virer car la societe doit etre charg<72> par appel de fetch_client()
|
||||
$this->socid = $result["fk_soc"];
|
||||
$this->fk_soc = $result["fk_soc"];
|
||||
$this->societe->fetch($result["fk_soc"]); // TODO A virer car la societe doit etre charge par appel de fetch_client()
|
||||
|
||||
$this->db->free($resql);
|
||||
|
||||
@ -298,14 +301,14 @@ class Contrat extends CommonObject
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_syslog("Contrat::Fetch Erreur contrat non trouve");
|
||||
dol_syslog("Contrat::Fetch Erreur contrat non trouve");
|
||||
$this->error="Contrat non trouve";
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_syslog("Contrat::Fetch Erreur lecture contrat");
|
||||
dol_syslog("Contrat::Fetch Erreur lecture contrat");
|
||||
$this->error=$this->db->error();
|
||||
return -1;
|
||||
}
|
||||
@ -340,7 +343,7 @@ class Contrat extends CommonObject
|
||||
$sql.= " WHERE d.fk_contrat = ".$this->id ." AND d.fk_product = p.rowid";
|
||||
$sql.= " ORDER by d.rowid ASC";
|
||||
|
||||
dolibarr_syslog("Contrat::fetch_lignes sql=".$sql);
|
||||
dol_syslog("Contrat::fetch_lignes sql=".$sql);
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
@ -390,8 +393,8 @@ class Contrat extends CommonObject
|
||||
$ligne->date_fin_prevue = $this->db->jdate($objp->date_fin_validite);
|
||||
$ligne->date_fin_reel = $this->db->jdate($objp->date_cloture);
|
||||
$this->lignes[] = $ligne;
|
||||
//dolibarr_syslog("1 ".$ligne->desc);
|
||||
//dolibarr_syslog("2 ".$ligne->product_desc);
|
||||
//dol_syslog("1 ".$ligne->desc);
|
||||
//dol_syslog("2 ".$ligne->product_desc);
|
||||
|
||||
if ($ligne->statut == 0) $this->nbofserviceswait++;
|
||||
if ($ligne->statut == 4 && (empty($ligne->date_fin_prevue) || $ligne->date_fin_prevue >= $now)) $this->nbofservicesopened++;
|
||||
@ -404,7 +407,7 @@ class Contrat extends CommonObject
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_syslog("Contrat::Fetch Erreur lecture des lignes de contrats liees aux produits");
|
||||
dol_syslog("Contrat::Fetch Erreur lecture des lignes de contrats liees aux produits");
|
||||
return -3;
|
||||
}
|
||||
|
||||
@ -481,7 +484,7 @@ class Contrat extends CommonObject
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_syslog("Contrat::Fetch Erreur lecture des lignes de contrat non li<6C>es aux produits");
|
||||
dol_syslog("Contrat::Fetch Erreur lecture des lignes de contrat non li<6C>es aux produits");
|
||||
$this->error=$this->db->error();
|
||||
return -2;
|
||||
}
|
||||
@ -561,7 +564,7 @@ class Contrat extends CommonObject
|
||||
else
|
||||
{
|
||||
$this->error=$interface->error;
|
||||
dolibarr_syslog("Contrat::create - 30 - ".$this->error);
|
||||
dol_syslog("Contrat::create - 30 - ".$this->error);
|
||||
|
||||
$this->db->rollback();
|
||||
return -3;
|
||||
@ -570,7 +573,7 @@ class Contrat extends CommonObject
|
||||
else
|
||||
{
|
||||
$this->error="Failed to add contact";
|
||||
dolibarr_syslog("Contrat::create - 20 - ".$this->error);
|
||||
dol_syslog("Contrat::create - 20 - ".$this->error);
|
||||
|
||||
$this->db->rollback();
|
||||
return -2;
|
||||
@ -579,7 +582,7 @@ class Contrat extends CommonObject
|
||||
else
|
||||
{
|
||||
$this->error=$langs->trans("UnknownError: ".$this->db->error()." - sql=".$sql);
|
||||
dolibarr_syslog("Contrat::create - 10 - ".$this->error);
|
||||
dol_syslog("Contrat::create - 10 - ".$this->error);
|
||||
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
@ -617,7 +620,7 @@ class Contrat extends CommonObject
|
||||
$sql.= " AND tc.element='".$this->element."'";
|
||||
$sql.= " AND ec.element_id=".$this->id;
|
||||
|
||||
dolibarr_syslog("Contrat::delete element_contact sql=".$sql,LOG_DEBUG);
|
||||
dol_syslog("Contrat::delete element_contact sql=".$sql,LOG_DEBUG);
|
||||
$resql=$this->db->query($sql);
|
||||
if (! $resql)
|
||||
{
|
||||
@ -638,7 +641,7 @@ class Contrat extends CommonObject
|
||||
$sql= "DELETE FROM ".MAIN_DB_PREFIX."element_contact ";
|
||||
$sql.= " WHERE ".MAIN_DB_PREFIX."element_contact.rowid IN (".implode(",",$tab_resql).")";
|
||||
|
||||
dolibarr_syslog("Contrat::delete element_contact sql=".$sql,LOG_DEBUG);
|
||||
dol_syslog("Contrat::delete element_contact sql=".$sql,LOG_DEBUG);
|
||||
$resql=$this->db->query($sql);
|
||||
if (! $resql)
|
||||
{
|
||||
@ -660,7 +663,7 @@ class Contrat extends CommonObject
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."contratdet_log as cdl, ".MAIN_DB_PREFIX."contratdet as cd";
|
||||
$sql.= " WHERE cdl.fk_contratdet=cd.rowid AND cd.fk_contrat=".$this->id;
|
||||
|
||||
dolibarr_syslog("Contrat::delete contratdet_log sql=".$sql, LOG_DEBUG);
|
||||
dol_syslog("Contrat::delete contratdet_log sql=".$sql, LOG_DEBUG);
|
||||
$resql=$this->db->query($sql);
|
||||
if (! $resql)
|
||||
{
|
||||
@ -681,7 +684,7 @@ class Contrat extends CommonObject
|
||||
$sql= "DELETE FROM ".MAIN_DB_PREFIX."contratdet_log ";
|
||||
$sql.= " WHERE ".MAIN_DB_PREFIX."contratdet_log.rowid IN (".implode(",",$tab_resql).")";
|
||||
|
||||
dolibarr_syslog("Contrat::delete contratdet_log sql=".$sql, LOG_DEBUG);
|
||||
dol_syslog("Contrat::delete contratdet_log sql=".$sql, LOG_DEBUG);
|
||||
$resql=$this->db->query($sql);
|
||||
if (! $resql)
|
||||
{
|
||||
@ -697,7 +700,7 @@ class Contrat extends CommonObject
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."contratdet";
|
||||
$sql.= " WHERE fk_contrat=".$this->id;
|
||||
|
||||
dolibarr_syslog("Contrat::delete contratdet sql=".$sql, LOG_DEBUG);
|
||||
dol_syslog("Contrat::delete contratdet sql=".$sql, LOG_DEBUG);
|
||||
$resql=$this->db->query($sql);
|
||||
if (! $resql)
|
||||
{
|
||||
@ -712,7 +715,7 @@ class Contrat extends CommonObject
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."contrat";
|
||||
$sql.= " WHERE rowid=".$this->id;
|
||||
|
||||
dolibarr_syslog("Contrat::delete contrat sql=".$sql);
|
||||
dol_syslog("Contrat::delete contrat sql=".$sql);
|
||||
$resql=$this->db->query($sql);
|
||||
if (! $resql)
|
||||
{
|
||||
@ -736,7 +739,7 @@ class Contrat extends CommonObject
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->error();
|
||||
dolibarr_syslog("Contrat::delete ERROR ".$this->error);
|
||||
dol_syslog("Contrat::delete ERROR ".$this->error);
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
@ -762,7 +765,7 @@ class Contrat extends CommonObject
|
||||
{
|
||||
global $langs, $conf;
|
||||
|
||||
dolibarr_syslog("Contrat::addline $desc, $pu_ht, $qty, $txtva, $fk_product, $remise_percent, $date_start, $date_end, $price_base_type, $pu_ttc, $info_bits");
|
||||
dol_syslog("Contrat::addline $desc, $pu_ht, $qty, $txtva, $fk_product, $remise_percent, $date_start, $date_end, $price_base_type, $pu_ttc, $info_bits");
|
||||
|
||||
if ($this->statut == 0 || ($this->statut == 1 && $conf->global->CONTRAT_EDITWHENVALIDATED))
|
||||
{
|
||||
@ -829,7 +832,7 @@ class Contrat extends CommonObject
|
||||
if ($date_end > 0) { $sql.= ",".$this->db->idate($date_end); }
|
||||
$sql.= ")";
|
||||
|
||||
dolibarr_syslog("Contrat::addline sql=".$sql);
|
||||
dol_syslog("Contrat::addline sql=".$sql);
|
||||
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
@ -842,7 +845,7 @@ class Contrat extends CommonObject
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_syslog("Error sql=$sql, error=".$this->error,LOG_ERR);
|
||||
dol_syslog("Error sql=$sql, error=".$this->error,LOG_ERR);
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
@ -851,13 +854,13 @@ class Contrat extends CommonObject
|
||||
{
|
||||
$this->db->rollback();
|
||||
$this->error=$this->db->error()." sql=".$sql;
|
||||
dolibarr_syslog("Contrat::addline ".$this->error,LOG_ERR);
|
||||
dol_syslog("Contrat::addline ".$this->error,LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_syslog("Contrat::addline ErrorTryToAddLineOnValidatedContract", LOG_ERR);
|
||||
dol_syslog("Contrat::addline ErrorTryToAddLineOnValidatedContract", LOG_ERR);
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
@ -898,7 +901,7 @@ class Contrat extends CommonObject
|
||||
$remise_percent=0;
|
||||
}
|
||||
|
||||
dolibarr_syslog("Contrat::UpdateLine $rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $date_debut_reel, $date_fin_reel, $tvatx");
|
||||
dol_syslog("Contrat::UpdateLine $rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $date_debut_reel, $date_fin_reel, $tvatx");
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
@ -920,7 +923,7 @@ class Contrat extends CommonObject
|
||||
else { $sql.=",date_cloture=null"; }
|
||||
$sql .= " WHERE rowid = ".$rowid;
|
||||
|
||||
dolibarr_syslog("Contrat::UpdateLine sql=".$sql);
|
||||
dol_syslog("Contrat::UpdateLine sql=".$sql);
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
@ -933,7 +936,7 @@ class Contrat extends CommonObject
|
||||
else
|
||||
{
|
||||
$this->db->rollback();
|
||||
dolibarr_syslog("Contrat::UpdateLigne Erreur -2");
|
||||
dol_syslog("Contrat::UpdateLigne Erreur -2");
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
@ -941,7 +944,7 @@ class Contrat extends CommonObject
|
||||
{
|
||||
$this->db->rollback();
|
||||
$this->error=$this->db->error();
|
||||
dolibarr_syslog("Contrat::UpdateLigne Erreur -1");
|
||||
dol_syslog("Contrat::UpdateLigne Erreur -1");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@ -962,12 +965,12 @@ class Contrat extends CommonObject
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."contratdet";
|
||||
$sql.= " WHERE rowid=".$idline;
|
||||
|
||||
dolibarr_syslog("Contratdet::delete sql=".$sql);
|
||||
dol_syslog("Contratdet::delete sql=".$sql);
|
||||
$resql = $this->db->query($sql);
|
||||
if (! $resql)
|
||||
{
|
||||
$this->error="Error ".$this->db->lasterror();
|
||||
dolibarr_syslog("Contratdet::delete ".$this->error, LOG_ERR);
|
||||
dol_syslog("Contratdet::delete ".$this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -1160,7 +1163,7 @@ class Contrat extends CommonObject
|
||||
$sql.= " WHERE fk_contrat =".$this->id;
|
||||
if ($statut >= 0) $sql.= " AND statut = '$statut'";
|
||||
|
||||
dolibarr_syslog("Contrat::array_detail() sql=".$sql,LOG_DEBUG);
|
||||
dol_syslog("Contrat::array_detail() sql=".$sql,LOG_DEBUG);
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
@ -1195,7 +1198,7 @@ class Contrat extends CommonObject
|
||||
$sql.= " WHERE fk_soc =".$this->socid;
|
||||
if ($option == 'others') $sql.= " AND c.rowid != ".$this->id;
|
||||
|
||||
dolibarr_syslog("Contrat::getOtherContracts() sql=".$sql,LOG_DEBUG);
|
||||
dol_syslog("Contrat::getOtherContracts() sql=".$sql,LOG_DEBUG);
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
@ -1486,7 +1489,7 @@ class ContratLigne
|
||||
function fetch($id, $ref='')
|
||||
{
|
||||
global $langs,$user;
|
||||
|
||||
|
||||
$sql = "SELECT";
|
||||
$sql.= " t.rowid,";
|
||||
|
||||
@ -1520,7 +1523,7 @@ class ContratLigne
|
||||
if ($id) $sql.= " WHERE t.rowid = ".$id;
|
||||
if ($ref) $sql.= " WHERE t.rowid = '".$ref."'";
|
||||
|
||||
dolibarr_syslog("Contratdet::fetch sql=".$sql, LOG_DEBUG);
|
||||
dol_syslog("Contratdet::fetch sql=".$sql, LOG_DEBUG);
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
@ -1530,7 +1533,7 @@ class ContratLigne
|
||||
|
||||
$this->id = $obj->rowid;
|
||||
$this->ref = $obj->rowid;
|
||||
|
||||
|
||||
$this->tms = $obj->tms;
|
||||
$this->fk_contrat = $obj->fk_contrat;
|
||||
$this->fk_product = $obj->fk_product;
|
||||
@ -1566,7 +1569,7 @@ class ContratLigne
|
||||
else
|
||||
{
|
||||
$this->error="Error ".$this->db->lasterror();
|
||||
dolibarr_syslog("ContratLigne::fetch ".$this->error, LOG_ERR);
|
||||
dol_syslog("ContratLigne::fetch ".$this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@ -1636,7 +1639,7 @@ class ContratLigne
|
||||
$sql.= " commentaire='".addslashes($this->commentaire)."'";
|
||||
$sql.= " WHERE rowid=".$this->id;
|
||||
|
||||
dolibarr_syslog("ContratLigne::update sql=".$sql, LOG_DEBUG);
|
||||
dol_syslog("ContratLigne::update sql=".$sql, LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
@ -1647,7 +1650,7 @@ class ContratLigne
|
||||
else
|
||||
{
|
||||
$this->error="Error ".$this->db->lasterror();
|
||||
dolibarr_syslog("ContratLigne::update ".$this->error, LOG_ERR);
|
||||
dol_syslog("ContratLigne::update ".$this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -1681,7 +1684,7 @@ class ContratLigne
|
||||
$sql.= ",total_ttc=".price2num($this->total_ttc,'MT')."";
|
||||
$sql.= " WHERE rowid = ".$this->rowid;
|
||||
|
||||
dolibarr_syslog("ContratLigne::update_total sql=".$sql);
|
||||
dol_syslog("ContratLigne::update_total sql=".$sql);
|
||||
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
@ -1692,7 +1695,7 @@ class ContratLigne
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->error();
|
||||
dolibarr_syslog("ContratLigne::update_total Error ".$this->error);
|
||||
dol_syslog("ContratLigne::update_total Error ".$this->error, LOG_ERR);
|
||||
$this->db->rollback();
|
||||
return -2;
|
||||
}
|
||||
|
||||
@ -608,10 +608,11 @@ else
|
||||
$now=gmmktime();
|
||||
|
||||
$id = $_GET["id"];
|
||||
if ($id > 0)
|
||||
$ref= $_GET['ref'];
|
||||
if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
$contrat = new Contrat($db);
|
||||
$result=$contrat->fetch($id);
|
||||
$result=$contrat->fetch($_GET['id'],$_GET['ref']);
|
||||
if ($result > 0) $result=$contrat->fetch_lignes();
|
||||
if ($result < 0)
|
||||
{
|
||||
@ -683,7 +684,7 @@ else
|
||||
|
||||
// Ref du contrat
|
||||
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">';
|
||||
print $contrat->ref;
|
||||
print $html->showrefnav($contrat,'ref','',1,'ref','ref','');
|
||||
print "</td></tr>";
|
||||
|
||||
// Customer
|
||||
|
||||
@ -75,6 +75,7 @@ CloseAllContracts=Close all contracts
|
||||
MoveToAnotherContract=Move service into another contract.
|
||||
ConfirmMoveToAnotherContract=I choosed new target contract and confirm I want to move this service into this contract.
|
||||
ConfirmMoveToAnotherContractQuestion=Choose in which existing contract (of same third party), you want to move this service to ?
|
||||
PaymentRenewContractId=Renew contract line (number %s)
|
||||
##### Types de contacts #####
|
||||
TypeContact_contrat_internal_SALESREPSIGN=Sales representative signing contract
|
||||
TypeContact_contrat_internal_SALESREPFOLL=Sales representative following-up contract
|
||||
|
||||
@ -190,9 +190,11 @@ DateRealShort=Date real.
|
||||
DateBuild=Report build date
|
||||
DurationYear=year
|
||||
DurationMonth=month
|
||||
DurationWeek=week
|
||||
DurationDay=day
|
||||
DurationYears=years
|
||||
DurationMonths=months
|
||||
DurationWeeks=weeks
|
||||
DurationDays=days
|
||||
Year=Year
|
||||
Month=Month
|
||||
|
||||
@ -13,4 +13,7 @@ PaymentCode=Payment code
|
||||
PayBoxDoPayment=Go on payment
|
||||
YouWillBeRedirectedOnPayBox=You will be redirected on secured Paybox page to input you credit card informations
|
||||
PleaseBePatient=Please, be patient
|
||||
Continue=Next
|
||||
Continue=Next
|
||||
ToOfferALinkForOnlinePaymentOnContractLine=URL to offer an %s online payment user interface for a contract line
|
||||
ToOfferALinkForOnlinePaymentOnFreeAmount=URL to offer an %s online payment user interface for a free amount
|
||||
YouCanAddTagOnUrl=You can also add url parameter <b>&tag=<i>value</i></b> to any of those URL to add your own tag to the payment comment code.
|
||||
|
||||
@ -75,6 +75,7 @@ CloseAllContracts=Tout clôturer
|
||||
MoveToAnotherContract=Déplacer le service vers un autre contrat de ce tiers.
|
||||
ConfirmMoveToAnotherContract=J'ai choisi le contrat cible et confirme le déplacement du service dans ce contrat.
|
||||
ConfirmMoveToAnotherContractQuestion=Choisissez vers quel autre contrat de ce même tiers, vous voulez déplacer ce service ?
|
||||
PaymentRenewContractId=Renouvellement service (numéro %s)
|
||||
##### Types de contacts #####
|
||||
TypeContact_contrat_internal_SALESREPSIGN=Commercial signataire du contrat
|
||||
TypeContact_contrat_internal_SALESREPFOLL=Commercial suivi du contrat
|
||||
|
||||
@ -10,7 +10,11 @@ ToComplete=A compléter
|
||||
YourEMail=Email de confirmation du paiement
|
||||
Creditor=Bénéficiaire
|
||||
PaymentCode=Code de paiement
|
||||
PayBoxDoPayment=Poursuivre le paiement
|
||||
PayBoxDoPayment=Poursuivre le paiement par carte
|
||||
YouWillBeRedirectedOnPayBox=Vous serez redirigé vers la page sécurisée Paybox de saisie de votre carte bancaire
|
||||
PleaseBePatient=Merci de patientez quelques secondes
|
||||
Continue=Continuer
|
||||
Continue=Continuer
|
||||
ToOfferALinkForOnlinePaymentOnContractLine=URL offrant une interface de paiement en ligne %s sur la base du montant d'une ligne de contrat
|
||||
ToOfferALinkForOnlinePaymentOnFreeAmount=URL offrant une interface de paiement en ligne %s pour un montant libre
|
||||
YouCanAddTagOnUrl=Vous pouvez de plus ajouter le paramètre url <b>&tag=<i>value</i></b> à n'importe quelle de ces URL pour voir votre propre tag au code commentaire de paiement.
|
||||
|
||||
@ -68,7 +68,7 @@ function llxFooterPayBox()
|
||||
* \brief Create a redirect form to paybox form
|
||||
* \return int 1 if OK, -1 if ERROR
|
||||
*/
|
||||
function print_paybox_redirect($PRICE,$EMAIL,$urlok,$urlko,$DOLSTRING,$ID=0)
|
||||
function print_paybox_redirect($PRICE,$EMAIL,$urlok,$urlko,$TAG,$ID=0)
|
||||
{
|
||||
global $conf, $langs, $db;
|
||||
|
||||
@ -112,24 +112,24 @@ function print_paybox_redirect($PRICE,$EMAIL,$urlok,$urlko,$DOLSTRING,$ID=0)
|
||||
|
||||
dol_syslog("Paypal.lib::print_paybox_redirect PRICE: ".$PRICE, LOG_DEBUG);
|
||||
|
||||
$langsiso=new Translate('',$conf);
|
||||
$langsiso=$langs;
|
||||
$langsiso->charset_output='ISO-8859-1';
|
||||
|
||||
// Definition des parametres vente produit pour paybox
|
||||
$IBS_CMD=$DOLSTRING;
|
||||
$IBS_CMD=$TAG;
|
||||
$IBS_TOTAL=$PRICE*100; # En centimes
|
||||
|
||||
$IBS_MODE=1; # Mode formulaire
|
||||
|
||||
$IBS_PORTEUR=$EMAIL;
|
||||
$IBS_RETOUR="montant:M;ref:R;auto:A;trans:T"; # Format des param<EFBFBD>tres du get de validation en reponse (url a definir sous paybox)
|
||||
$IBS_TXT="<center><b>".$langs->trans("YouWillBeRedirectedOnPayBox")."</b><br><i>".$langs->trans("PleaseBePatient")."...</i><br></center>";
|
||||
$IBS_RETOUR="montant:M;ref:R;auto:A;trans:T"; # Format des parametres du get de validation en reponse (url a definir sous paybox)
|
||||
$IBS_TXT="<center><b>".$langsiso->trans("YouWillBeRedirectedOnPayBox")."</b><br><i>".$langsiso->trans("PleaseBePatient")."...</i><br></center>";
|
||||
$IBS_EFFECTUE=$urlok;
|
||||
$IBS_ANNULE=$urlko;
|
||||
$IBS_REFUSE=$urlko;
|
||||
$IBS_BOUTPI=$langs->trans("Continue");
|
||||
$IBS_BOUTPI=$langsiso->trans("Continue");
|
||||
$IBS_BKGD="#FFFFFF";
|
||||
$IBS_WAIT="4000";
|
||||
|
||||
$IBS_LANG="ENG";
|
||||
if (eregi('^FR',$langs->defaultlang)) $IBS_LANG="FRA";
|
||||
$IBS_LANG="ENG"; if (eregi('^FR',$langs->defaultlang)) $IBS_LANG="FRA";
|
||||
|
||||
dol_syslog("Soumission Paybox", LOG_DEBUG);
|
||||
dol_syslog("IBS_MODE: $IBS_MODE", LOG_DEBUG);
|
||||
@ -147,31 +147,43 @@ function print_paybox_redirect($PRICE,$EMAIL,$urlok,$urlko,$DOLSTRING,$ID=0)
|
||||
dol_syslog("IBS_WAIT: $IBS_WAIT", LOG_DEBUG);
|
||||
dol_syslog("IBS_LANG: $IBS_LANG", LOG_DEBUG);
|
||||
|
||||
print '<html><body>';
|
||||
header("Content-type: text/html; charset=".$conf->character_set_client);
|
||||
|
||||
print '<html>'."\n";
|
||||
print '<head>'."\n";
|
||||
print "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=".$conf->character_set_client."\">\n";
|
||||
print '</head>'."\n";
|
||||
print '<body>'."\n";
|
||||
print "\n";
|
||||
print '<form action="'.$URLPAYBOX.'" NAME="Submit" method="POST">';
|
||||
print '<input type="hidden" name="IBS_MODE" value="'.$IBS_MODE.'">';
|
||||
print '<input type="hidden" name="IBS_SITE" value="'.$IBS_SITE.'">';
|
||||
print '<input type="hidden" name="IBS_RANG" value="'.$IBS_RANG.'">';
|
||||
print '<input type="hidden" name="IBS_TOTAL" value="'.$IBS_TOTAL.'">';
|
||||
print '<input type="hidden" name="IBS_DEVISE" value="'.$IBS_DEVISE.'">';
|
||||
print '<input type="hidden" name="IBS_CMD" value="'.$IBS_CMD.'">';
|
||||
print '<input type="hidden" name="IBS_PORTEUR" value="'.$IBS_PORTEUR.'">';
|
||||
print '<input type="hidden" name="IBS_RETOUR" value="'.$IBS_RETOUR.'">';
|
||||
print '<input type="hidden" name="IBS_EFFECTUE" value="'.$IBS_EFFECTUE.'">';
|
||||
print '<input type="hidden" name="IBS_ANNULE" value="'.$IBS_ANNULE.'">';
|
||||
print '<input type="hidden" name="IBS_REFUSE" value="'.$IBS_REFUSE.'">';
|
||||
print '<input type="hidden" name="IBS_TXT" value="'.$IBS_TXT.'">';
|
||||
print '<input type="hidden" name="IBS_BKGD" value="'.$IBS_BKGD.'">';
|
||||
print '<input type="hidden" name="IBS_WAIT" value="'.$IBS_WAIT.'">';
|
||||
print '<input type="hidden" name="IBS_LANG" value="'.$IBS_LANG.'">';
|
||||
print '</form>';
|
||||
|
||||
// Formulaire pour module Paybox v1 (IBS_xxx)
|
||||
print '<form action="'.$URLPAYBOX.'" NAME="Submit" method="POST">'."\n";
|
||||
print '<input type="hidden" name="IBS_MODE" value="'.$IBS_MODE.'">'."\n";
|
||||
print '<input type="hidden" name="IBS_SITE" value="'.$IBS_SITE.'">'."\n";
|
||||
print '<input type="hidden" name="IBS_RANG" value="'.$IBS_RANG.'">'."\n";
|
||||
print '<input type="hidden" name="IBS_TOTAL" value="'.$IBS_TOTAL.'">'."\n";
|
||||
print '<input type="hidden" name="IBS_DEVISE" value="'.$IBS_DEVISE.'">'."\n";
|
||||
print '<input type="hidden" name="IBS_CMD" value="'.$IBS_CMD.'">'."\n";
|
||||
print '<input type="hidden" name="IBS_PORTEUR" value="'.$IBS_PORTEUR.'">'."\n";
|
||||
print '<input type="hidden" name="IBS_RETOUR" value="'.$IBS_RETOUR.'">'."\n";
|
||||
print '<input type="hidden" name="IBS_EFFECTUE" value="'.$IBS_EFFECTUE.'">'."\n";
|
||||
print '<input type="hidden" name="IBS_ANNULE" value="'.$IBS_ANNULE.'">'."\n";
|
||||
print '<input type="hidden" name="IBS_REFUSE" value="'.$IBS_REFUSE.'">'."\n";
|
||||
print '<input type="hidden" name="IBS_TXT" value="'.$IBS_TXT.'">'."\n";
|
||||
print '<input type="hidden" name="IBS_BKGD" value="'.$IBS_BKGD.'">'."\n";
|
||||
print '<input type="hidden" name="IBS_WAIT" value="'.$IBS_WAIT.'">'."\n";
|
||||
print '<input type="hidden" name="IBS_LANG" value="'.$IBS_LANG.'">'."\n";
|
||||
print '</form>'."\n";
|
||||
|
||||
// Formulaire pour module Paybox v2 (PBX_xxx)
|
||||
|
||||
|
||||
print "\n";
|
||||
print '<script type="text/javascript" language="javascript">';
|
||||
print ' document.Submit.submit();';
|
||||
print '</script>';
|
||||
print '<script type="text/javascript" language="javascript">'."\n";
|
||||
// print ' document.Submit.submit();'."\n";
|
||||
print '</script>'."\n";
|
||||
print "\n";
|
||||
print '</body></html>';
|
||||
print '</body></html>'."\n";
|
||||
print "\n";
|
||||
|
||||
return;
|
||||
|
||||
@ -28,6 +28,7 @@
|
||||
require("../../master.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/paybox/paybox.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/product.class.php");
|
||||
|
||||
$langcode=(empty($_GET["lang"])?'auto':$_GET["lang"]);
|
||||
$langs->setDefaultLang($langcode);
|
||||
@ -136,49 +137,16 @@ print '<tr class="liste_total"><td align="left" colspan="2">'.$langs->trans("Thi
|
||||
|
||||
$found=false;
|
||||
$var=false;
|
||||
if (is_numeric($_REQUEST["amount"]))
|
||||
{
|
||||
$found=true;
|
||||
$tag=$_REQUEST["tag"];
|
||||
|
||||
// Creditor
|
||||
$var=!$var;
|
||||
print '<tr><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Creditor");
|
||||
print '</td><td class="CTableRow'.($var?'1':'2').'"><b>'.$mysoc->nom.'</b></td></tr>'."\n";
|
||||
// Amount
|
||||
$var=!$var;
|
||||
print '<tr><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Amount");
|
||||
if (empty($amount)) print ' ('.$langs->trans("ToComplete").')';
|
||||
print '</td><td class="CTableRow'.($var?'1':'2').'">';
|
||||
if (empty($amount) || ! is_numeric($amount)) print '<input class="flat" size=8 type="text" name="newamount" value="'.$_REQUEST["newamount"].'">';
|
||||
else {
|
||||
print '<b>'.price($amount).'</b>';
|
||||
print '<input type="hidden" name="newamount" value="'.$amount.'">';
|
||||
}
|
||||
print '</td></tr>'."\n";
|
||||
// Currency
|
||||
$var=!$var;
|
||||
print '<tr><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Currency");
|
||||
print '</td><td class="CTableRow'.($var?'1':'2').'"><b>EUR</b></td></tr>'."\n";
|
||||
// Tag
|
||||
$var=!$var;
|
||||
print '<tr><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("PaymentCode");
|
||||
print '</td><td class="CTableRow'.($var?'1':'2').'"><b>'.$tag.'</b></td></tr>'."\n";
|
||||
// EMail
|
||||
$var=!$var;
|
||||
print '<tr><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("YourEMail");
|
||||
print ' ('.$langs->trans("ToComplete").')';
|
||||
print '</td><td class="CTableRow'.($var?'1':'2').'"><input class="flat" type="text" name="EMAIL" size="48" value="'.$_REQUEST["EMAIL"].'"></td></tr>'."\n";
|
||||
}
|
||||
|
||||
if ($_REQUEST["amount"] == 'contractline')
|
||||
{
|
||||
$found=true;
|
||||
$langs->load("contracts");
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT."/contrat/contrat.class.php");
|
||||
|
||||
$contractline=new ContratLigne($db);
|
||||
$result=$contractline->fetch('',$_GET["ref"]);
|
||||
$result=$contractline->fetch('',$_REQUEST["ref"]);
|
||||
if ($result < 0)
|
||||
{
|
||||
$mesg=$contractline->error;
|
||||
@ -189,7 +157,11 @@ if ($_REQUEST["amount"] == 'contractline')
|
||||
{
|
||||
$contract=new Contrat($db);
|
||||
$result=$contract->fetch($contractline->fk_contrat);
|
||||
if ($result < 0)
|
||||
if ($result > 0)
|
||||
{
|
||||
$result=$contract->fetch_client($contract->socid);
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg=$contract->error;
|
||||
}
|
||||
@ -199,31 +171,100 @@ if ($_REQUEST["amount"] == 'contractline')
|
||||
$mesg='ErrorRecordNotFound';
|
||||
}
|
||||
}
|
||||
|
||||
$amount=$contractline->total_ttc;
|
||||
if ($contractline->fk_product)
|
||||
{
|
||||
$product=new Product($db);
|
||||
$result=$product->fetch($contractline->fk_product);
|
||||
|
||||
// We define price for product (TODO Put this in a method in product class)
|
||||
if ($conf->global->PRODUIT_MULTIPRICES)
|
||||
{
|
||||
$pu_ht = $product->multiprices[$contract->client->price_level];
|
||||
$pu_ttc = $product->multiprices_ttc[$contract->client->price_level];
|
||||
$price_base_type = $product->multiprices_base_type[$contract->client->price_level];
|
||||
}
|
||||
else
|
||||
{
|
||||
$pu_ht = $product->price;
|
||||
$pu_ttc = $product->price_ttc;
|
||||
$price_base_type = $product->price_base_type;
|
||||
}
|
||||
|
||||
$amount=$pu_ttc;
|
||||
if (empty($amount))
|
||||
{
|
||||
dolibarr_print_error('','ErrorNoPriceDefinedForThisProduct');
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
$tag='';
|
||||
if (! empty($_REQUEST["tag"])) $tag=$_REQUEST["tag"].'-';
|
||||
$tag.='thirdparty='.$contract->socid.'-contractref='.$contract->ref.'-contractlineref='.$contractline->ref;
|
||||
$tag='CLR='.$contractline->ref.'.CR='.$contract->ref.'.TPID='.$contract->client->id.'.TP='.strtr($contract->client->nom,"-"," ");
|
||||
if (! empty($_REQUEST["tag"])) $tag.='.TAG='.$_REQUEST["tag"];
|
||||
$tag=dol_string_unaccent($tag);
|
||||
|
||||
$qty=1;
|
||||
if (isset($_REQUEST["qty"])) $qty=$_REQUEST["qty"];
|
||||
|
||||
// Object
|
||||
$var=!$var;
|
||||
$text=$langs->trans("PaymentRenewContractId",$contractline->ref,$contract->id);
|
||||
if ($contractline->description) $text.='<br>'.dol_htmlentitiesbr($contractline->description);
|
||||
print '<tr><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Designation");
|
||||
print '</td><td class="CTableRow'.($var?'1':'2').'"><b>'.$text.'</b></td></tr>'."\n";
|
||||
// Quantity
|
||||
$var=!$var;
|
||||
print '<tr><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Quantity");
|
||||
print '</td><td class="CTableRow'.($var?'1':'2').'"><b>';
|
||||
print $qty;
|
||||
print '<input type="hidden" name="newqty" value="'.$qty.'">';
|
||||
print '</b></td></tr>'."\n";
|
||||
|
||||
// Creditor
|
||||
$var=!$var;
|
||||
print '<tr><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Creditor");
|
||||
print '</td><td class="CTableRow'.($var?'1':'2').'"><b>'.$mysoc->nom.'</b></td></tr>'."\n";
|
||||
|
||||
// Debitor
|
||||
$var=!$var;
|
||||
print '<tr><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("ThirdParty");
|
||||
print '</td><td class="CTableRow'.($var?'1':'2').'"><b>'.$contract->client->nom.'</b>';
|
||||
|
||||
// Object
|
||||
$var=!$var;
|
||||
$text='<b>'.$langs->trans("PaymentRenewContractId",$contract->ref,$contractline->ref).'</b>';
|
||||
if ($contractline->fk_product)
|
||||
{
|
||||
$text.='<br>'.$product->ref.($product->libelle?' - '.$product->libelle:'');
|
||||
}
|
||||
if ($contractline->description) $text.='<br>'.dol_htmlentitiesbr($contractline->description);
|
||||
//if ($contractline->date_fin_validite) {
|
||||
// $text.='<br>'.$langs->trans("DateEndPlanned").': ';
|
||||
// $text.=dolibarr_print_date($contractline->date_fin_validite);
|
||||
//}
|
||||
print '<tr><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Designation");
|
||||
print '</td><td class="CTableRow'.($var?'1':'2').'">'.$text;
|
||||
print '<input type="hidden" name="ref" value="'.$contractline->ref.'">';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Quantity
|
||||
$var=!$var;
|
||||
print '<tr><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Quantity");
|
||||
print '</td><td class="CTableRow'.($var?'1':'2').'"><b>'.$qty.'</b>';
|
||||
if ($contractline->fk_product)
|
||||
{
|
||||
if ($product->duration_value > 0)
|
||||
{
|
||||
// TODO Put this in a global method
|
||||
if ($product->duration_value > 1)
|
||||
{
|
||||
$dur=array("h"=>$langs->trans("Hours"),"d"=>$langs->trans("DurationDays"),"w"=>$langs->trans("DurationWeeks"),"m"=>$langs->trans("DurationMonths"),"y"=>$langs->trans("DurationYears"));
|
||||
}
|
||||
else
|
||||
{
|
||||
$dur=array("h"=>$langs->trans("Hour"),"d"=>$langs->trans("DurationDay"),"w"=>$langs->trans("DurationWeek"),"m"=>$langs->trans("DurationMonth"),"y"=>$langs->trans("DurationYear"));
|
||||
}
|
||||
$duration=' ('.$product->duration_value.' '.$dur[$product->duration_unit];
|
||||
print $duration;
|
||||
if ($contractline->date_fin_validite)
|
||||
{
|
||||
$dateactend = dol_time_plus_duree ($contractline->date_fin_validite, $product->duration_value, $product->duration_unit);
|
||||
print ', '.$langs->trans("DateEndPlanned").': '.dolibarr_print_date($contractline->date_fin_validite);
|
||||
}
|
||||
print ')';
|
||||
}
|
||||
}
|
||||
print '<input type="hidden" name="newqty" value="'.$qty.'">';
|
||||
print '</b></td></tr>'."\n";
|
||||
|
||||
// Amount
|
||||
$var=!$var;
|
||||
print '<tr><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Amount");
|
||||
@ -235,14 +276,19 @@ if ($_REQUEST["amount"] == 'contractline')
|
||||
print '<input type="hidden" name="newamount" value="'.$amount.'">';
|
||||
}
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Currency
|
||||
$var=!$var;
|
||||
print '<tr><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Currency");
|
||||
print '</td><td class="CTableRow'.($var?'1':'2').'"><b>EUR</b></td></tr>'."\n";
|
||||
|
||||
// Tag
|
||||
$var=!$var;
|
||||
print '<tr><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("PaymentCode");
|
||||
print '</td><td class="CTableRow'.($var?'1':'2').'"><b>'.$tag.'</b></td></tr>'."\n";
|
||||
print '</td><td class="CTableRow'.($var?'1':'2').'"><b>'.$tag.'</b>';
|
||||
print '<input type="hidden" name="tag" value="'.$tag.'">';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// EMail
|
||||
$var=!$var;
|
||||
print '<tr><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("YourEMail");
|
||||
@ -251,14 +297,57 @@ if ($_REQUEST["amount"] == 'contractline')
|
||||
|
||||
}
|
||||
|
||||
if (is_numeric($_REQUEST["amount"]))
|
||||
{
|
||||
$found=true;
|
||||
$tag=$_REQUEST["tag"];
|
||||
|
||||
// Creditor
|
||||
$var=!$var;
|
||||
print '<tr><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Creditor");
|
||||
print '</td><td class="CTableRow'.($var?'1':'2').'"><b>'.$mysoc->nom.'</b></td></tr>'."\n";
|
||||
|
||||
// Amount
|
||||
$var=!$var;
|
||||
print '<tr><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Amount");
|
||||
if (empty($amount)) print ' ('.$langs->trans("ToComplete").')';
|
||||
print '</td><td class="CTableRow'.($var?'1':'2').'">';
|
||||
if (empty($amount) || ! is_numeric($amount)) print '<input class="flat" size=8 type="text" name="newamount" value="'.$_REQUEST["newamount"].'">';
|
||||
else {
|
||||
print '<b>'.price($amount).'</b>';
|
||||
print '<input type="hidden" name="newamount" value="'.$amount.'">';
|
||||
}
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Currency
|
||||
$var=!$var;
|
||||
print '<tr><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Currency");
|
||||
print '</td><td class="CTableRow'.($var?'1':'2').'"><b>EUR</b></td></tr>'."\n";
|
||||
|
||||
// Tag
|
||||
$var=!$var;
|
||||
print '<tr><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("PaymentCode");
|
||||
print '</td><td class="CTableRow'.($var?'1':'2').'"><b>'.$tag.'</b>';
|
||||
print '<input type="hidden" name="tag" value="'.$tag.'">';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// EMail
|
||||
$var=!$var;
|
||||
print '<tr><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("YourEMail");
|
||||
print ' ('.$langs->trans("ToComplete").')';
|
||||
print '</td><td class="CTableRow'.($var?'1':'2').'"><input class="flat" type="text" name="EMAIL" size="48" value="'.$_REQUEST["EMAIL"].'"></td></tr>'."\n";
|
||||
}
|
||||
|
||||
|
||||
if (! $found && ! $mesg) $mesg=$langs->trans("ErrorBadParameters");
|
||||
|
||||
if ($mesg) print '<tr><td align="center" colspan="2"><br><div class="warning">'.$mesg.'</div></td></tr>';
|
||||
|
||||
print '<tr><td align="center" colspan="2"><br><input class="none" type="submit" name="dopayment" value="'.$langs->trans("PayBoxDoPayment").'"></td></tr>';
|
||||
print '<tr><td align="center" colspan="2">'.$langs->trans("YouWillBeRedirectedOnPayBox").'...</td></tr>';
|
||||
|
||||
if ($found)
|
||||
{
|
||||
print '<tr><td align="center" colspan="2"><br><input class="none" type="submit" name="dopayment" value="'.$langs->trans("PayBoxDoPayment").'"></td></tr>';
|
||||
//print '<tr><td align="center" colspan="2">'.$langs->trans("YouWillBeRedirectedOnPayBox").'...</td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</td></tr>';
|
||||
|
||||
@ -499,7 +499,7 @@ class Societe extends CommonObject
|
||||
}
|
||||
|
||||
$sql = 'SELECT s.rowid, s.nom, s.address,'.$this->db->pdate('s.datec').' as dc, s.prefix_comm';
|
||||
if($conf->global->PRODUIT_MULTIPRICES) $sql .= ', s.price_level';
|
||||
$sql .= ', s.price_level';
|
||||
$sql .= ','. $this->db->pdate('s.tms').' as date_update';
|
||||
$sql .= ', s.tel, s.fax, s.email, s.url, s.cp, s.ville, s.note, s.client, s.fournisseur';
|
||||
$sql .= ', s.siren, s.siret, s.ape, s.idprof4';
|
||||
@ -524,6 +524,7 @@ class Societe extends CommonObject
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON s.fk_departement = d.rowid';
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_typent as te ON s.fk_typent = te.id';
|
||||
$sql .= ' WHERE s.rowid = '.$socid;
|
||||
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
@ -770,7 +771,7 @@ class Societe extends CommonObject
|
||||
$this->error .= $this->db->lasterror();
|
||||
dolibarr_syslog("Societe::Delete erreur -1 ".$this->error);
|
||||
}
|
||||
|
||||
|
||||
// Remove ban
|
||||
$sql = "DELETE from ".MAIN_DB_PREFIX."societe_rib";
|
||||
$sql.= " WHERE fk_soc = " . $id;
|
||||
@ -1954,7 +1955,7 @@ class Societe extends CommonObject
|
||||
|
||||
print '<input type="text" name="'.$htmlname.'" size="'.($formlength+1).'" maxlength="'.$formlength.'" value="'.$selected.'">';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Cree en base un utilisateur depuis l'objet adherent
|
||||
* \param member Objet adherent source
|
||||
@ -1978,8 +1979,8 @@ class Societe extends CommonObject
|
||||
$this->ville=$member->ville;
|
||||
$this->pays_code=$member->pays_code;
|
||||
$this->pays_id=$member->pays_id;
|
||||
$this->tel=$member->phone; // Prof phone
|
||||
|
||||
$this->tel=$member->phone; // Prof phone
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
// Cree et positionne $this->id
|
||||
@ -1989,7 +1990,7 @@ class Societe extends CommonObject
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent";
|
||||
$sql.= " SET fk_soc=".$this->id;
|
||||
$sql.= " WHERE rowid=".$member->id;
|
||||
|
||||
|
||||
dolibarr_syslog("Societe::create_from_member sql=".$sql, LOG_DEBUG);
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
@ -2015,7 +2016,7 @@ class Societe extends CommonObject
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user