New: Gestion des escomptes
This commit is contained in:
parent
1e06a25231
commit
b2f911181b
@ -838,23 +838,6 @@ class Commande extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->user_author_id)
|
||||
{
|
||||
$sql = "SELECT name, firstname";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."user";
|
||||
$sql.= " WHERE rowid = ".$this->user_author_id;
|
||||
|
||||
$resqluser = $this->db->query($sql);
|
||||
|
||||
if ($resqluser)
|
||||
{
|
||||
$obju = $this->db->fetch_object($resqluser);
|
||||
$this->user_author_name = $obju->name;
|
||||
$this->user_author_firstname = $obju->firstname;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$this->lignes = $this->fetch_lignes();
|
||||
|
||||
/*
|
||||
|
||||
@ -949,7 +949,7 @@ else
|
||||
$author->fetch();
|
||||
|
||||
$head = commande_prepare_head($commande);
|
||||
dolibarr_fiche_head($head, 'order', $langs->trans("CustomerOrder"));
|
||||
dolibarr_fiche_head($head, 'order', $langs->trans("CustomerOrder"));
|
||||
|
||||
/*
|
||||
* Confirmation de la suppression de la commande
|
||||
|
||||
@ -81,6 +81,7 @@ if ($_GET["id"] > 0)
|
||||
{
|
||||
$soc = new Societe($db);
|
||||
$soc->fetch($commande->socidp);
|
||||
|
||||
$author = new User($db);
|
||||
$author->id = $commande->user_author_id;
|
||||
$author->fetch();
|
||||
|
||||
@ -224,6 +224,28 @@ if ($_POST['action'] == 'confirm_payed' && $_POST['confirm'] == 'yes' && $user->
|
||||
$fac->fetch($_GET['facid']);
|
||||
$result = $fac->set_payed($user);
|
||||
}
|
||||
if ($_POST['action'] == 'confirm_payed_partially' && $_POST['confirm'] == 'yes' && $user->rights->facture->paiement)
|
||||
{
|
||||
$fac = new Facture($db);
|
||||
$fac->fetch($_GET['facid']);
|
||||
$close_code=$_POST["close_code"];
|
||||
$close_note=$_POST["close_note"];
|
||||
if ($close_code)
|
||||
{
|
||||
if ($close_code == 'other' && ! $close_note)
|
||||
{
|
||||
$msg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->trans("Comment")).'</div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $fac->set_payed($user,$close_code,$close_note);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$msg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->trans("Reason")).'</div>';
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Insertion facture
|
||||
@ -284,7 +306,7 @@ if ($_POST['action'] == 'add')
|
||||
else
|
||||
{
|
||||
$_GET["action"]='create';
|
||||
$mesg='<div class="error">'.$facture->error.'</div>';
|
||||
$msg='<div class="error">'.$facture->error.'</div>';
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -582,7 +604,7 @@ if ($_POST['action'] == 'confirm_canceled' && $_POST['confirm'] == 'yes')
|
||||
if ($user->rights->facture->supprimer)
|
||||
{
|
||||
$fac = new Facture($db);
|
||||
$fac->fetch($_GET['facid']);
|
||||
$fac->fetch($_GET['facid']);
|
||||
$result = $fac->set_canceled($user);
|
||||
}
|
||||
}
|
||||
@ -838,7 +860,7 @@ if ($_GET['action'] == 'create')
|
||||
{
|
||||
print_titre($langs->trans('NewBill'));
|
||||
|
||||
if ($mesg) print $mesg;
|
||||
if ($msg) print $msg;
|
||||
|
||||
$soc = new Societe($db);
|
||||
|
||||
@ -1416,6 +1438,10 @@ else
|
||||
$soc = new Societe($db, $fac->socidp);
|
||||
$soc->fetch($fac->socidp);
|
||||
$absolute_discount=$soc->getCurrentDiscount();
|
||||
|
||||
$totalpaye = $fac->getSommePaiement();
|
||||
$resteapayer = $fac->total_ttc - $totalpaye;
|
||||
if ($fac->paye) $resteapayer=0;
|
||||
|
||||
$author = new User($db);
|
||||
if ($fac->user_author)
|
||||
@ -1470,14 +1496,26 @@ else
|
||||
/*
|
||||
* Confirmation du classement payé
|
||||
*/
|
||||
if ($_GET['action'] == 'payed')
|
||||
if ($_GET['action'] == 'payed' && $resteapayer <= 0)
|
||||
{
|
||||
$html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id,$langs->trans('ClassifyPayed'),$langs->trans('ConfirmClassifyPayedBill',$fac->ref),'confirm_payed');
|
||||
print '<br />';
|
||||
}
|
||||
if ($_GET['action'] == 'payed' && $resteapayer > 0)
|
||||
{
|
||||
// Crée un tableau formulaire
|
||||
$formquestion=array(
|
||||
'text' => $langs->trans("ConfirmClassifyPayedPartiallyQuestion"),
|
||||
array('type' => 'radio', 'name' => 'close_code', 'label' => $langs->trans("Reason"), 'values' => array('escompte' => $langs->trans("ConfirmClassifyPayedPartiallyReasonEscompte",$resteapayer,$langs->trans("Currency".$conf->monnaie)), 'other' => $langs->trans("ConfirmClassifyPayedPartiallyReasonOther"))),
|
||||
array('type' => 'text', 'name' => 'close_note', 'label' => $langs->trans("Comment"), 'value' => '', 'size' => '70')
|
||||
);
|
||||
// Paiement incomplet. On demande si motif = escompte ou autre
|
||||
$html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id,$langs->trans('ClassifyPayed'),$langs->trans('ConfirmClassifyPayedPartially',$fac->ref),'confirm_payed_partially',$formquestion);
|
||||
print '<br />';
|
||||
}
|
||||
|
||||
/*
|
||||
* Confirmation du classement abandonn
|
||||
* Confirmation du classement abandonne
|
||||
*/
|
||||
if ($_GET['action'] == 'canceled')
|
||||
{
|
||||
@ -1563,8 +1601,6 @@ else
|
||||
/*
|
||||
* Liste des paiements
|
||||
*/
|
||||
$totalpaye = 0;
|
||||
|
||||
$sql = 'SELECT '.$db->pdate('datep').' as dp, pf.amount,';
|
||||
$sql.= ' c.libelle as paiement_type, p.num_paiement, p.rowid';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'paiement as p, '.MAIN_DB_PREFIX.'c_paiement as c, '.MAIN_DB_PREFIX.'paiement_facture as pf';
|
||||
@ -1588,19 +1624,19 @@ else
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>';
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/paiement/fiche.php?id='.$objp->rowid.'">'.img_object($langs->trans('ShowPayment'),'payment').' ';
|
||||
print dolibarr_print_date($objp->dp).'</td>';
|
||||
print dolibarr_print_date($objp->dp).'</a></td>';
|
||||
print '<td>'.$objp->paiement_type.' '.$objp->num_paiement.'</td>';
|
||||
print '<td align="right">'.price($objp->amount).'</td><td>'.$langs->trans('Currency'.$conf->monnaie).'</td>';
|
||||
print '</tr>';
|
||||
$totalpaye += $objp->amount;
|
||||
$i++;
|
||||
}
|
||||
|
||||
print '<tr><td colspan="2" align="right">'.$langs->trans('AlreadyPayed').' :</td><td align="right"><b>'.price($totalpaye).'</b></td><td>'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>';
|
||||
print '<tr><td colspan="2" align="right">'.$langs->trans("Billed").' :</td><td align="right" style="border: 1px solid;">'.price($fac->total_ttc).'</td><td>'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>';
|
||||
|
||||
$resteapayer = $fac->total_ttc - $totalpaye;
|
||||
|
||||
if ($fac->close_code == 'escompte')
|
||||
{
|
||||
print '<tr><td colspan="2" align="right">'.$langs->trans("EscompteOffered").' :</td><td align="right">'.price($fac->total_ttc - $totalpaye).'</td><td>'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>';
|
||||
}
|
||||
print '<tr><td colspan="2" align="right">'.$langs->trans('RemainderToPay').' :</td>';
|
||||
print '<td align="right" style="border: 1px solid;" bgcolor="#f0f0f0"><b>'.price($resteapayer).'</b></td><td>'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>';
|
||||
|
||||
@ -2248,7 +2284,7 @@ else
|
||||
}
|
||||
|
||||
// Envoyer une relance
|
||||
if ($fac->statut == 1 && price($resteapayer) > 0 && $user->rights->facture->envoyer)
|
||||
if ($fac->statut == 1 && $resteapayer > 0 && $user->rights->facture->envoyer)
|
||||
{
|
||||
print ' <a class="butAction" href="'.$_SERVER['PHP_SELF'].'?facid='.$fac->id.'&action=prerelance">'.$langs->trans('SendRemindByMail').'</a>';
|
||||
}
|
||||
@ -2261,18 +2297,18 @@ else
|
||||
|
||||
// Classer 'payé'
|
||||
if ($fac->statut == 1 && $fac->paye == 0 && $user->rights->facture->paiement
|
||||
&& price($resteapayer) <= 0)
|
||||
&& $resteapayer <= 0)
|
||||
{
|
||||
print ' <a class="butAction" href="'.$_SERVER['PHP_SELF'].'?facid='.$fac->id.'&action=payed">'.$langs->trans('ClassifyPayed').'</a>';
|
||||
}
|
||||
|
||||
// Classer 'fermée' (possible si validée et pas encore classer payée)
|
||||
if ($fac->statut == 1 && $fac->paye == 0 && $user->rights->facture->paiement
|
||||
&& price($resteapayer) > 0)
|
||||
// Classer 'fermée' (possible si validée et pas encore classée payée)
|
||||
if ($fac->statut == 1 && $fac->paye == 0 && $resteapayer > 0
|
||||
&& $user->rights->facture->paiement)
|
||||
{
|
||||
if ($totalpaye > 0)
|
||||
{
|
||||
print ' <a class="butAction" href="'.$_SERVER['PHP_SELF'].'?facid='.$fac->id.'&action=canceled">'.$langs->trans('ClassifyPayedPartially').'</a>';
|
||||
print ' <a class="butAction" href="'.$_SERVER['PHP_SELF'].'?facid='.$fac->id.'&action=payed">'.$langs->trans('ClassifyPayedPartially').'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -147,6 +147,7 @@ class Conf
|
||||
|
||||
// Module externalrss
|
||||
$this->externalrss->enabled=defined("MAIN_MODULE_EXTERNALRSS")?MAIN_MODULE_EXTERNALRSS:0;
|
||||
$this->externalrss->dir_temp=DOL_DATA_ROOT."/rss/temp";
|
||||
|
||||
// Module commande client
|
||||
$this->commande->enabled=defined("MAIN_MODULE_COMMANDE")?MAIN_MODULE_COMMANDE:0;
|
||||
|
||||
@ -89,6 +89,7 @@ if ($_GET["id"] > 0)
|
||||
|
||||
$soc = new Societe($db);
|
||||
$soc->fetch($commande->socidp);
|
||||
|
||||
$author = new User($db);
|
||||
$author->id = $commande->user_author_id;
|
||||
$author->fetch();
|
||||
|
||||
@ -191,6 +191,7 @@ if ($_GET["action"] == 'create')
|
||||
{
|
||||
$soc = new Societe($db);
|
||||
$soc->fetch($commande->socidp);
|
||||
|
||||
$author = new User($db);
|
||||
$author->id = $commande->user_author_id;
|
||||
$author->fetch();
|
||||
|
||||
@ -63,6 +63,8 @@ class Facture extends CommonObject
|
||||
var $note_public;
|
||||
var $statut;
|
||||
var $paye; // 1 si facture payée COMPLETEMENT, 0 sinon
|
||||
var $close_code; // Si mis a paye sans paiement complet, code qui justifie
|
||||
var $close_note; // Commentaire si mis a paye sans paiement complet
|
||||
var $propalid;
|
||||
var $projetid;
|
||||
var $date_lim_reglement;
|
||||
@ -312,7 +314,7 @@ class Facture extends CommonObject
|
||||
$sql = 'SELECT f.fk_soc,f.facnumber,f.amount,f.tva,f.total,f.total_ttc,f.remise_percent,f.remise_absolue,f.remise';
|
||||
$sql .= ','.$this->db->pdate('f.datef').' as df, f.fk_projet';
|
||||
$sql .= ','.$this->db->pdate('f.date_lim_reglement').' as dlr';
|
||||
$sql .= ', f.note, f.note_public, f.paye, f.fk_statut, f.fk_user_author, f.model_pdf';
|
||||
$sql .= ', f.note, f.note_public, f.fk_statut, f.paye, f.close_code, f.close_note, f.fk_user_author, f.model_pdf';
|
||||
$sql .= ', f.fk_mode_reglement, f.ref_client, p.code as mode_reglement_code, p.libelle as mode_reglement_libelle';
|
||||
$sql .= ', f.fk_cond_reglement, c.code as cond_reglement_code, c.libelle as cond_reglement_libelle, c.libelle_facture as cond_reglement_libelle_facture';
|
||||
$sql .= ', cf.fk_commande';
|
||||
@ -346,6 +348,8 @@ class Facture extends CommonObject
|
||||
$this->total_tva = $obj->tva;
|
||||
$this->total_ttc = $obj->total_ttc;
|
||||
$this->paye = $obj->paye;
|
||||
$this->close_code = $obj->close_code;
|
||||
$this->close_note = $obj->close_note;
|
||||
$this->socidp = $obj->fk_soc;
|
||||
$this->statut = $obj->fk_statut;
|
||||
$this->date_lim_reglement = $obj->dlr;
|
||||
@ -365,36 +369,20 @@ class Facture extends CommonObject
|
||||
$this->lignes = array();
|
||||
|
||||
|
||||
if ($this->user_author)
|
||||
{
|
||||
$sql = "SELECT name, firstname";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."user";
|
||||
$sql.= " WHERE rowid = ".$this->user_author;
|
||||
|
||||
$resqluser = $this->db->query($sql);
|
||||
|
||||
if ($resqluser)
|
||||
{
|
||||
$obju = $this->db->fetch_object($resqluser);
|
||||
$this->user_author_name = $obju->name;
|
||||
$this->user_author_firstname = $obju->firstname;
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->commande_id)
|
||||
{
|
||||
$sql = "SELECT ref";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."commande";
|
||||
$sql.= " WHERE rowid = ".$this->commande_id;
|
||||
|
||||
$resqlcomm = $this->db->query($sql);
|
||||
|
||||
if ($resqlcomm)
|
||||
{
|
||||
$objc = $this->db->fetch_object($resqlcomm);
|
||||
$this->commande_ref = $objc->ref;
|
||||
}
|
||||
}
|
||||
if ($this->commande_id)
|
||||
{
|
||||
$sql = "SELECT ref";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."commande";
|
||||
$sql.= " WHERE rowid = ".$this->commande_id;
|
||||
|
||||
$resqlcomm = $this->db->query($sql);
|
||||
|
||||
if ($resqlcomm)
|
||||
{
|
||||
$objc = $this->db->fetch_object($resqlcomm);
|
||||
$this->commande_ref = $objc->ref;
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->statut == 0)
|
||||
{
|
||||
@ -725,17 +713,23 @@ class Facture extends CommonObject
|
||||
/**
|
||||
* \brief Tag la facture comme payée complètement + appel trigger BILL_PAYED
|
||||
* \param user Objet utilisateur qui modifie
|
||||
* \param close_code Code renseigné si on classe à payée alors que paiement incomplet
|
||||
* Les valeurs possibles sont: escompte, other
|
||||
* \param close_note Commentaire renseigné si on classe à payée alors que paiement incomplet
|
||||
* \return int <0 si ok, >0 si ok
|
||||
*/
|
||||
function set_payed($user)
|
||||
function set_payed($user,$close_code='',$close_note='')
|
||||
{
|
||||
global $conf,$langs;
|
||||
|
||||
dolibarr_syslog("Facture.class.php::set_payed rowid=".$this->id);
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'facture';
|
||||
$sql.= ' SET paye=1 WHERE rowid = '.$this->id ;
|
||||
$resql = $this->db->query($sql);
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'facture SET';
|
||||
$sql.= ' paye=1';
|
||||
if ($close_code) $sql.= ", close_code='".addslashes($close_code)."'";
|
||||
if ($close_note) $sql.= ", close_note='".addslashes($close_note)."'";
|
||||
$sql.= ' WHERE rowid = '.$this->id;
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$this->use_webcal=($conf->global->PHPWEBCALENDAR_BILLSTATUS=='always'?1:0);
|
||||
@ -1488,16 +1482,19 @@ class Facture extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Renvoie la sommes des paiements deja effectués
|
||||
* \remarks Utilisé entre autre par certains modèles de factures
|
||||
* \brief Renvoie la sommes des paiements deja effectués
|
||||
* \return Montant deja versé, <0 si ko
|
||||
*/
|
||||
function getSommePaiement()
|
||||
{
|
||||
$sql = 'SELECT sum(amount) FROM '.MAIN_DB_PREFIX.'paiement_facture WHERE fk_facture = '.$this->id;
|
||||
if ($this->db->query($sql))
|
||||
$sql = 'SELECT sum(amount) as amount';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'paiement_facture';
|
||||
$sql.= ' WHERE fk_facture = '.$this->id;
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$row = $this->db->fetch_row(0);
|
||||
return $row[0];
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
return $obj->amount;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -53,15 +53,15 @@ if ($_GET["id"] > 0)
|
||||
{
|
||||
$soc->fetch($commande->socidp);
|
||||
|
||||
$author = new User($db);
|
||||
$author->id = $commande->user_author_id;
|
||||
$author->fetch();
|
||||
|
||||
$addons[0][0] = DOL_URL_ROOT.'/fourn/fiche.php?socid='.$soc->id;
|
||||
$addons[0][1] = $soc->nom;
|
||||
|
||||
llxHeader('',$langs->trans("History"),"CommandeFournisseur",$addons);
|
||||
|
||||
$author = new User($db);
|
||||
$author->id = $commande->user_author_id;
|
||||
$author->fetch();
|
||||
|
||||
$h = 0;
|
||||
$head[$h][0] = DOL_URL_ROOT.'/fourn/commande/fiche.php?id='.$commande->id;
|
||||
$head[$h][1] = $langs->trans("OrderCard");
|
||||
|
||||
@ -74,6 +74,7 @@ if ($_GET["id"] > 0)
|
||||
{
|
||||
$soc = new Societe($db);
|
||||
$soc->fetch($commande->socidp);
|
||||
|
||||
$author = new User($db);
|
||||
$author->id = $commande->user_author_id;
|
||||
$author->fetch();
|
||||
|
||||
@ -483,7 +483,7 @@ class CommandeFournisseur extends Commande
|
||||
{
|
||||
require_once (DOL_DOCUMENT_ROOT."/lib/CMailFile.class.php");
|
||||
|
||||
$cc = new user($this->db, $this->user_author_id);
|
||||
$cc = new User($this->db, $this->user_author_id);
|
||||
$cc->fetch();
|
||||
|
||||
$sendto = $cc->email;
|
||||
|
||||
@ -1487,28 +1487,60 @@ class Form
|
||||
|
||||
/**
|
||||
* \brief Affiche formulaire de demande de confirmation
|
||||
* \param page page
|
||||
* \param title title
|
||||
* \param question question
|
||||
* \param action action
|
||||
* \param page page
|
||||
* \param title title
|
||||
* \param question question
|
||||
* \param action action
|
||||
* \param formquestion an array with forms compementary inputs
|
||||
*/
|
||||
|
||||
function form_confirm($page, $title, $question, $action)
|
||||
function form_confirm($page, $title, $question, $action, $formquestion='')
|
||||
{
|
||||
global $langs;
|
||||
|
||||
print '<form method="post" action="'.$page.'">';
|
||||
print '<form method="post" action="'.$page.'" class="notoptoleftroright">';
|
||||
print '<input type="hidden" name="action" value="'.$action.'">';
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<table width="100%" class="valid">';
|
||||
|
||||
// Ligne titre
|
||||
print '<tr><td class="validtitle" colspan="3">'.$title.'</td></tr>';
|
||||
print '<tr class="validtitre"><td class="validtitre" colspan="3">'.img_picto('','recent').' '.$title.'</td></tr>';
|
||||
|
||||
// Ligne formulaire
|
||||
if ($formquestion)
|
||||
{
|
||||
print '<tr class="valid"><td class="valid" colspan="3">';
|
||||
print '<table class="notopnoleftnoright" width="100%">';
|
||||
print '<tr><td colspan="2">'.$formquestion['text'].'</td></tr>';
|
||||
foreach ($formquestion as $key => $input)
|
||||
{
|
||||
if ($input['type'] == 'text') print '<tr><td>'.$input['label'].'</td><td><input type="text" class="flat" name="'.$input['name'].'" size="'.$input['size'].'" value="'.$input['value'].'"></td></tr>';
|
||||
if ($input['type'] == 'radio')
|
||||
{
|
||||
$i=0;
|
||||
foreach($input['values'] as $selkey => $selval)
|
||||
{
|
||||
print '<tr>';
|
||||
if ($i==0) print '<td>'.$input['label'].'</td>';
|
||||
else print '<td> </td>';
|
||||
print '<td><input type="radio" class="flat" name="'.$input['name'].'" value="'.$selkey.'"> '.$selval.'</td></tr>';
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Ligne message
|
||||
print '<tr><td class="valid">'.$question.'</td><td class="valid">';
|
||||
print '<tr class="valid"><td class="valid">'.$question.'</td>';
|
||||
print '<td class="valid">';
|
||||
$this->selectyesno("confirm","no");
|
||||
print "</td>\n";
|
||||
print '</td>';
|
||||
print '<td class="valid" align="center"><input class="button" type="submit" value="'.$langs->trans("Confirm").'"></td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print "</form>\n";
|
||||
}
|
||||
|
||||
|
||||
@ -83,13 +83,11 @@ class DolibarrModules
|
||||
// Créé les répertoires
|
||||
if (is_array($this->dirs))
|
||||
{
|
||||
foreach ($this->dirs as $key => $value)
|
||||
foreach ($this->dirs as $key => $dir)
|
||||
{
|
||||
$dir = $value;
|
||||
if ($dir && ! file_exists($dir))
|
||||
{
|
||||
umask(0);
|
||||
if (! @mkdir($dir, 0755))
|
||||
if (create_exdir($dir) < 0)
|
||||
{
|
||||
$this->error = $langs->trans("ErrorCanNotCreateDir",$dir);
|
||||
dolibarr_syslog("DolibarrModules::_init error");
|
||||
@ -106,7 +104,7 @@ class DolibarrModules
|
||||
$result=$this->db->query($sql);
|
||||
if (! $result)
|
||||
{
|
||||
dolibarr_syslog("Error sql=".$sql." - ".$this->db->error());
|
||||
dolibarr_syslog("DolibarrModules.class::init Error sql=".$sql." - ".$this->db->error());
|
||||
$err++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -42,7 +42,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
{
|
||||
var $emetteur; // Objet societe qui emet
|
||||
|
||||
|
||||
|
||||
/**
|
||||
\brief Constructeur
|
||||
\param db Handler accès base de donnée
|
||||
@ -51,6 +51,8 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
{
|
||||
global $conf,$langs,$mysoc;
|
||||
|
||||
$langs->load("main");
|
||||
$langs->load("bills");
|
||||
$this->db = $db;
|
||||
$this->name = "einstein";
|
||||
$this->description = "Modèle de commandes complet (logo...)";
|
||||
@ -64,14 +66,15 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
$this->marge_droite=10;
|
||||
$this->marge_haute=10;
|
||||
$this->marge_basse=10;
|
||||
|
||||
$this->option_logo = 1; // Affiche logo FAC_PDF_LOGO
|
||||
|
||||
$this->option_logo = 1; // Affiche logo
|
||||
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION
|
||||
$this->option_modereg = 1; // Gere choix mode règlement FACTURE_CHQ_NUMBER, FACTURE_RIB_NUMBER
|
||||
$this->option_modereg = 1; // Affiche mode règlement
|
||||
$this->option_condreg = 1; // Affiche conditions règlement
|
||||
$this->option_codeproduitservice = 1; // Affiche code produit-service
|
||||
$this->option_multilang = 1; // Dispo en plusieurs langues
|
||||
|
||||
if (defined("FACTURE_TVAOPTION") && FACTURE_TVAOPTION == 'franchise')
|
||||
if (defined("FACTURE_TVAOPTION") && FACTURE_TVAOPTION == 'franchise')
|
||||
$this->franchise=1;
|
||||
|
||||
// Recupere emmetteur
|
||||
@ -85,7 +88,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
$this->posxqty=151;
|
||||
$this->posxdiscount=162;
|
||||
$this->postotalht=177;
|
||||
|
||||
|
||||
$this->tva=array();
|
||||
$this->atleastoneratenotnull=0;
|
||||
$this->atleastonediscount=0;
|
||||
@ -95,14 +98,14 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
\brief Renvoi dernière erreur
|
||||
\return string Dernière erreur
|
||||
*/
|
||||
function pdferror()
|
||||
function pdferror()
|
||||
{
|
||||
return $this->error;
|
||||
}
|
||||
|
||||
/**
|
||||
\brief Fonction générant la commande sur le disque
|
||||
\param id Id de la commande à générer
|
||||
\param com Objet commande à générer
|
||||
\return int 1=ok, 0=ko
|
||||
*/
|
||||
function write_pdf_file($com,$outputlangs='')
|
||||
@ -115,19 +118,20 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
$outputlangs->load("bills");
|
||||
$outputlangs->load("products");
|
||||
$outputlangs->load("orders");
|
||||
|
||||
|
||||
$outputlangs->setPhpLang();
|
||||
|
||||
// Définition de l'objet $com (pour compatibilite ascendante)
|
||||
if (! is_object($com))
|
||||
{
|
||||
$id = $com;
|
||||
$com = new Commande($this->db,"",$id);
|
||||
$ret=$com->fetch($id);
|
||||
}
|
||||
|
||||
if ($conf->commande->dir_output)
|
||||
{
|
||||
{
|
||||
// Définition de l'objet $com (pour compatibilite ascendante)
|
||||
if (! is_object($com))
|
||||
{
|
||||
$id = $com;
|
||||
$com = new Commande($this->db,"",$id);
|
||||
$ret=$com->fetch($id);
|
||||
}
|
||||
$deja_regle = "";
|
||||
|
||||
// Définition de $dir et $file
|
||||
if ($com->specimen)
|
||||
{
|
||||
@ -140,7 +144,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
$dir = $conf->commande->dir_output . "/" . $comref;
|
||||
$file = $dir . "/" . $comref . ".pdf";
|
||||
}
|
||||
|
||||
|
||||
if (! file_exists($dir))
|
||||
{
|
||||
if (create_exdir($dir) < 0)
|
||||
@ -149,9 +153,10 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (file_exists($dir))
|
||||
{
|
||||
$nblignes = sizeof($com->lignes);
|
||||
// Initialisation document vierge
|
||||
$pdf=new FPDF('P','mm',$this->format);
|
||||
$pdf->Open();
|
||||
@ -168,7 +173,6 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
|
||||
// Positionne $this->atleastonediscount si on a au moins une remise
|
||||
$nblignes = sizeof($com->lignes);
|
||||
for ($i = 0 ; $i < $nblignes ; $i++)
|
||||
{
|
||||
if ($com->lignes[$i]->remise_percent)
|
||||
@ -177,13 +181,37 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
}
|
||||
}
|
||||
|
||||
// Tete de page
|
||||
$this->_pagehead($pdf, $com, 1, $outputlangs);
|
||||
|
||||
$pagenb = 1;
|
||||
$tab_top = 90;
|
||||
$tab_top_newpage = 50;
|
||||
$tab_height = 110;
|
||||
$tab_height_newpage = 170;
|
||||
$tab_height_newpage = 180;
|
||||
|
||||
// Affiche notes
|
||||
if ($com->note_public)
|
||||
{
|
||||
$tab_top = 88;
|
||||
|
||||
$pdf->SetFont('Arial','', 9); // Dans boucle pour gérer multi-page
|
||||
$pdf->SetXY ($this->posxdesc-1, $tab_top);
|
||||
$pdf->MultiCell(190, 3, $com->note_public, 0, 'J');
|
||||
$nexY = $pdf->GetY();
|
||||
$height_note=$nexY-$tab_top;
|
||||
|
||||
// Rect prend une longueur en 3eme param
|
||||
$pdf->SetDrawColor(192,192,192);
|
||||
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1);
|
||||
|
||||
$tab_height = $tab_height - $height_note;
|
||||
$tab_top = $nexY+6;
|
||||
}
|
||||
else
|
||||
{
|
||||
$height_note=0;
|
||||
}
|
||||
|
||||
$iniY = $tab_top + 8;
|
||||
$curY = $tab_top + 8;
|
||||
@ -205,23 +233,31 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
if ($com->lignes[$i]->fk_product)
|
||||
{
|
||||
$prodser = new Product($this->db);
|
||||
|
||||
$prodser->fetch($com->lignes[$i]->fk_product);
|
||||
|
||||
// On ajoute la ref
|
||||
if ($prodser->ref)
|
||||
{
|
||||
$libelleproduitservice=$outputlangs->trans("Product")." ".$prodser->ref." - ".$libelleproduitservice;
|
||||
{
|
||||
$prefix_prodserv = "";
|
||||
if($prodser->type == 0)
|
||||
$prefix_prodserv = $outputlangs->trans("Product")." ";
|
||||
if($prodser->type == 1)
|
||||
$prefix_prodserv = $outputlangs->trans("Service")." ";
|
||||
|
||||
$libelleproduitservice=$prefix_prodserv.$prodser->ref." - ".$libelleproduitservice;
|
||||
}
|
||||
|
||||
// Ajoute description du produit
|
||||
if ($conf->global->FORM_ADD_PROD_DESC && !$conf->global->PRODUIT_CHANGE_PROD_DESC)
|
||||
// Ajoute description du produit
|
||||
if ($conf->global->FORM_ADD_PROD_DESC && !$conf->global->PRODUIT_CHANGE_PROD_DESC)
|
||||
{
|
||||
if ($com->lignes[$i]->product_desc&&$com->lignes[$i]->product_desc!=$fac->lignes[$i]->libelle&&$com->lignes[$i]->product_desc!=$com->lignes[$i]->desc)
|
||||
if ($com->lignes[$i]->product_desc&&$com->lignes[$i]->product_desc!=$com->lignes[$i]->libelle&&$com->lignes[$i]->product_desc!=$com->lignes[$i]->desc)
|
||||
{
|
||||
if ($libelleproduitservice) $libelleproduitservice.="\n";
|
||||
$libelleproduitservice.=$com->lignes[$i]->product_desc;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($com->lignes[$i]->date_start && $com->lignes[$i]->date_end)
|
||||
{
|
||||
// Affichage durée si il y en a une
|
||||
@ -274,8 +310,8 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
|
||||
$nexY+=2; // Passe espace entre les lignes
|
||||
|
||||
if ($nexY > 200 && $i < ($nblignes - 1))
|
||||
{
|
||||
if ($nexY > ($tab_top+$tab_height) && $i < ($nblignes - 1))
|
||||
{
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top, $tab_height + 20, $nexY, $outputlangs);
|
||||
@ -284,149 +320,47 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top_newpage, $tab_height_newpage, $nexY, $outputlangs);
|
||||
}
|
||||
|
||||
$this->_pagefoot($pdf,$outputlangs);
|
||||
|
||||
|
||||
$this->_pagefoot($pdf,$outputlangs);
|
||||
|
||||
// Nouvelle page
|
||||
$pdf->AddPage();
|
||||
$pagenb++;
|
||||
$this->_pagehead($pdf, $com, 0, $outputlangs);
|
||||
|
||||
|
||||
$nexY = $tab_top_newpage + 8;
|
||||
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->SetFont('Arial','', 10);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Affiche cadre tableau
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs);
|
||||
$bottomlasttab=$tab_top + $tab_height + 1;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top_newpage, $tab_height, $nexY, $outputlangs);
|
||||
$bottomlasttab=$tab_top_newpage + $tab_height + 1;
|
||||
}
|
||||
|
||||
$deja_regle = "";
|
||||
|
||||
// Affiche zone infos
|
||||
$posy=$this->_tableau_tot($pdf, $com, $deja_regle, $bottomlasttab, $outputlangs);
|
||||
|
||||
if ($deja_regle) {
|
||||
$this->_tableau_versements($pdf, $fac, $posy, $outputlangs);
|
||||
// Affiche zone totaux
|
||||
$posy=$this->_tableau_tot($pdf, $com, $deja_regle, $bottomlasttab, $outputlangs);
|
||||
|
||||
// Affiche zone versements
|
||||
if ($deja_regle) {
|
||||
$posy=$this->_tableau_versements($pdf, $com, $posy, $outputlangs);
|
||||
}
|
||||
|
||||
/*
|
||||
* Mode de règlement
|
||||
*/
|
||||
if ((! defined("FACTURE_CHQ_NUMBER") || ! FACTURE_CHQ_NUMBER) && (! defined("FACTURE_RIB_NUMBER") || ! FACTURE_RIB_NUMBER))
|
||||
{
|
||||
$pdf->SetXY ($this->marge_gauche, 228);
|
||||
$pdf->SetTextColor(200,0,0);
|
||||
$pdf->SetFont('Arial','B',8);
|
||||
$pdf->MultiCell(90, 3, $outputlangs->trans("ErrorNoPaiementModeConfigured"),0,'L',0);
|
||||
$pdf->MultiCell(90, 3, $outputlangs->trans("ErrorCreateBankAccount"),0,'L',0);
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Propose mode règlement par CHQ
|
||||
*/
|
||||
/*
|
||||
if (defined("FACTURE_CHQ_NUMBER"))
|
||||
{
|
||||
if (FACTURE_CHQ_NUMBER > 0)
|
||||
{
|
||||
$account = new Account($this->db);
|
||||
$account->fetch(FACTURE_CHQ_NUMBER);
|
||||
|
||||
$pdf->SetXY ($this->marge_gauche, 227);
|
||||
$pdf->SetFont('Arial','B',8);
|
||||
$pdf->MultiCell(90, 3, "Règlement par chèque à l'ordre de ".$account->proprio." envoyé à:",0,'L',0);
|
||||
$pdf->SetXY ($this->marge_gauche, 231);
|
||||
$pdf->SetFont('Arial','',8);
|
||||
$pdf->MultiCell(80, 3, $account->adresse_proprio, 0, 'L', 0);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
* Propose mode règlement par RIB
|
||||
*/
|
||||
/*
|
||||
if (defined("FACTURE_RIB_NUMBER"))
|
||||
{
|
||||
if (FACTURE_RIB_NUMBER > 0)
|
||||
{
|
||||
$account = new Account($this->db);
|
||||
$account->fetch(FACTURE_RIB_NUMBER);
|
||||
|
||||
$this->marges['g']=$this->marge_gauche;
|
||||
|
||||
$cury=242;
|
||||
$pdf->SetXY ($this->marges['g'], $cury);
|
||||
$pdf->SetFont('Arial','B',8);
|
||||
$pdf->MultiCell(90, 3, "Règlement par virement sur le compte bancaire suivant:", 0, 'L', 0);
|
||||
$cury+=4;
|
||||
$pdf->SetFont('Arial','B',6);
|
||||
$pdf->line($this->marges['g']+1, $cury, $this->marges['g']+1, $cury+10 );
|
||||
$pdf->SetXY ($this->marges['g'], $cury);
|
||||
$pdf->MultiCell(18, 3, "Code banque", 0, 'C', 0);
|
||||
$pdf->line($this->marges['g']+18, $cury, $this->marges['g']+18, $cury+10 );
|
||||
$pdf->SetXY ($this->marges['g']+18, $cury);
|
||||
$pdf->MultiCell(18, 3, "Code guichet", 0, 'C', 0);
|
||||
$pdf->line($this->marges['g']+36, $cury, $this->marges['g']+36, $cury+10 );
|
||||
$pdf->SetXY ($this->marges['g']+36, $cury);
|
||||
$pdf->MultiCell(24, 3, "Numéro compte", 0, 'C', 0);
|
||||
$pdf->line($this->marges['g']+60, $cury, $this->marges['g']+60, $cury+10 );
|
||||
$pdf->SetXY ($this->marges['g']+60, $cury);
|
||||
$pdf->MultiCell(13, 3, "Clé RIB", 0, 'C', 0);
|
||||
$pdf->line($this->marges['g']+73, $cury, $this->marges['g']+73, $cury+10 );
|
||||
|
||||
$pdf->SetFont('Arial','',8);
|
||||
$pdf->SetXY ($this->marges['g'], $cury+5);
|
||||
$pdf->MultiCell(18, 3, $account->code_banque, 0, 'C', 0);
|
||||
$pdf->SetXY ($this->marges['g']+18, $cury+5);
|
||||
$pdf->MultiCell(18, 3, $account->code_guichet, 0, 'C', 0);
|
||||
$pdf->SetXY ($this->marges['g']+36, $cury+5);
|
||||
$pdf->MultiCell(24, 3, $account->number, 0, 'C', 0);
|
||||
$pdf->SetXY ($this->marges['g']+60, $cury+5);
|
||||
$pdf->MultiCell(13, 3, $account->cle_rib, 0, 'C', 0);
|
||||
|
||||
$pdf->SetXY ($this->marges['g'], $cury+12);
|
||||
$pdf->MultiCell(90, 3, "Domiciliation : " . $account->domiciliation, 0, 'L', 0);
|
||||
$pdf->SetXY ($this->marges['g'], $cury+22);
|
||||
$pdf->MultiCell(90, 3, "Prefix IBAN : " . $account->iban_prefix, 0, 'L', 0);
|
||||
$pdf->SetXY ($this->marges['g'], $cury+25);
|
||||
$pdf->MultiCell(90, 3, "BIC : " . $account->bic, 0, 'L', 0);
|
||||
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
* Conditions de règlements
|
||||
*/
|
||||
/* Pour l'instant les conditions de règlement ne sont pas gérées sur les propales */
|
||||
/*
|
||||
$pdf->SetFont('Arial','B',10);
|
||||
$pdf->SetXY($this->marge_gauche, 217);
|
||||
$titre = "Conditions de réglement:";
|
||||
$pdf->MultiCell(80, 5, $titre, 0, 'L');
|
||||
$pdf->SetFont('Arial','',10);
|
||||
$pdf->SetXY(54, 217);
|
||||
$pdf->MultiCell(80, 5, $prop->cond_reglement_facture,0,'L');
|
||||
*/
|
||||
|
||||
/*
|
||||
* Pied de page
|
||||
*/
|
||||
// Pied de page
|
||||
$this->_pagefoot($pdf,$outputlangs);
|
||||
$pdf->AliasNbPages();
|
||||
|
||||
|
||||
$pdf->Close();
|
||||
|
||||
$pdf->Output($file);
|
||||
@ -436,22 +370,184 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$langs->trans("ErrorCanNotCreateDir",$dir);
|
||||
$this->error=$outputlangs->trans("ErrorCanNotCreateDir",$dir);
|
||||
$langs->setPhpLang(); // On restaure langue session
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$langs->trans("ErrorConstantNotDefined","COMMANDE_OUTPUTDIR");
|
||||
$this->error=$outputlangs->trans("ErrorConstantNotDefined","COMMANDE_OUTPUTDIR");
|
||||
$langs->setPhpLang(); // On restaure langue session
|
||||
return 0;
|
||||
}
|
||||
$this->error=$langs->trans("ErrorUnknown");
|
||||
$this->error=$outputlangs->trans("ErrorUnknown");
|
||||
$langs->setPhpLang(); // On restaure langue session
|
||||
return 0; // Erreur par defaut
|
||||
}
|
||||
|
||||
/*
|
||||
* \brief Affiche tableau des versement
|
||||
* \param pdf objet PDF
|
||||
* \param com objet commande
|
||||
*/
|
||||
function _tableau_versements(&$pdf, $com, $posy, $outputlangs)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* \brief Affiche infos divers
|
||||
* \param pdf Objet PDF
|
||||
* \param com Objet commande
|
||||
* \param posy Position depart
|
||||
* \param outputlangs Objet langs
|
||||
* \return y Position pour suite
|
||||
*/
|
||||
function _tableau_info(&$pdf, $com, $posy, $outputlangs)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$pdf->SetFont('Arial','', 9);
|
||||
|
||||
/*
|
||||
* Affiche la mention TVA non applicable selon option
|
||||
*/
|
||||
if ($this->franchise == 1)
|
||||
{
|
||||
$pdf->SetFont('Arial','B',8);
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->trans("VATIsNotUsedForInvoice"), 0, 'L', 0);
|
||||
|
||||
$posy=$pdf->GetY()+4;
|
||||
}
|
||||
|
||||
/*
|
||||
* Conditions de règlements
|
||||
*/
|
||||
if ($com->cond_reglement_code || $com->cond_reglement)
|
||||
{
|
||||
$pdf->SetFont('Arial','B',8);
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
$titre = $outputlangs->trans("PaymentConditions").':';
|
||||
$pdf->MultiCell(80, 5, $titre, 0, 'L');
|
||||
|
||||
$pdf->SetFont('Arial','',8);
|
||||
$pdf->SetXY(50, $posy);
|
||||
$lib_condition_paiement=$outputlangs->trans("PaymentCondition".$com->cond_reglement_code)!=('PaymentCondition'.$com->cond_reglement_code)?$outputlangs->trans("PaymentCondition".$com->cond_reglement_code):$com->cond_reglement;
|
||||
$pdf->MultiCell(80, 5, $lib_condition_paiement,0,'L');
|
||||
|
||||
$posy=$pdf->GetY()+3;
|
||||
}
|
||||
|
||||
/*
|
||||
* Mode de règlement
|
||||
*/
|
||||
if (! $conf->global->FACTURE_CHQ_NUMBER && ! $conf->global->FACTURE_RIB_NUMBER)
|
||||
{
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
$pdf->SetTextColor(200,0,0);
|
||||
$pdf->SetFont('Arial','B',8);
|
||||
$pdf->MultiCell(90, 3, $outputlangs->trans("ErrorNoPaiementModeConfigured"),0,'L',0);
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
|
||||
$posy=$pdf->GetY()+1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Propose mode règlement par CHQ
|
||||
*/
|
||||
if ($conf->global->FACTURE_CHQ_NUMBER)
|
||||
{
|
||||
if ($conf->global->FACTURE_CHQ_NUMBER > 0)
|
||||
{
|
||||
$account = new Account($this->db);
|
||||
$account->fetch($conf->global->FACTURE_CHQ_NUMBER);
|
||||
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
$pdf->SetFont('Arial','B',8);
|
||||
$pdf->MultiCell(90, 3, $outputlangs->trans('PaymentByChequeOrderedTo',$account->proprio).':',0,'L',0);
|
||||
$posy=$pdf->GetY()+1;
|
||||
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
$pdf->SetFont('Arial','',8);
|
||||
$pdf->MultiCell(80, 3, $account->adresse_proprio, 0, 'L', 0);
|
||||
|
||||
$posy=$pdf->GetY()+2;
|
||||
}
|
||||
if ($conf->global->FACTURE_CHQ_NUMBER == -1)
|
||||
{
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
$pdf->SetFont('Arial','B',8);
|
||||
$pdf->MultiCell(90, 3, $outputlangs->trans('PaymentByChequeOrderedToShort').' '.$this->emetteur->nom.' '.$outputlangs->trans('SendTo').':',0,'L',0);
|
||||
$posy=$pdf->GetY()+1;
|
||||
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
$pdf->SetFont('Arial','',8);
|
||||
$pdf->MultiCell(80, 6, $this->emetteur->adresse_full, 0, 'L', 0);
|
||||
|
||||
$posy=$pdf->GetY()+2;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Propose mode règlement par RIB
|
||||
*/
|
||||
if ($conf->global->FACTURE_RIB_NUMBER)
|
||||
{
|
||||
if ($conf->global->FACTURE_RIB_NUMBER)
|
||||
{
|
||||
$account = new Account($this->db);
|
||||
$account->fetch($conf->global->FACTURE_RIB_NUMBER);
|
||||
|
||||
$this->marges['g']=$this->marge_gauche;
|
||||
|
||||
$cury=$posy;
|
||||
$pdf->SetXY ($this->marges['g'], $cury);
|
||||
$pdf->SetFont('Arial','B',8);
|
||||
$pdf->MultiCell(90, 3, $outputlangs->trans('PaymentByTransferOnThisBankAccount').':', 0, 'L', 0);
|
||||
$cury+=4;
|
||||
$pdf->SetFont('Arial','B',6);
|
||||
$pdf->line($this->marges['g']+1, $cury, $this->marges['g']+1, $cury+10 );
|
||||
$pdf->SetXY ($this->marges['g'], $cury);
|
||||
$pdf->MultiCell(18, 3, $outputlangs->trans("BankCode"), 0, 'C', 0);
|
||||
$pdf->line($this->marges['g']+18, $cury, $this->marges['g']+18, $cury+10 );
|
||||
$pdf->SetXY ($this->marges['g']+18, $cury);
|
||||
$pdf->MultiCell(18, 3, $outputlangs->trans("DeskCode"), 0, 'C', 0);
|
||||
$pdf->line($this->marges['g']+36, $cury, $this->marges['g']+36, $cury+10 );
|
||||
$pdf->SetXY ($this->marges['g']+36, $cury);
|
||||
$pdf->MultiCell(24, 3, $outputlangs->trans("BankAccountNumber"), 0, 'C', 0);
|
||||
$pdf->line($this->marges['g']+60, $cury, $this->marges['g']+60, $cury+10 );
|
||||
$pdf->SetXY ($this->marges['g']+60, $cury);
|
||||
$pdf->MultiCell(13, 3, $outputlangs->trans("BankAccountNumberKey"), 0, 'C', 0);
|
||||
$pdf->line($this->marges['g']+73, $cury, $this->marges['g']+73, $cury+10 );
|
||||
|
||||
$pdf->SetFont('Arial','',8);
|
||||
$pdf->SetXY ($this->marges['g'], $cury+5);
|
||||
$pdf->MultiCell(18, 3, $account->code_banque, 0, 'C', 0);
|
||||
$pdf->SetXY ($this->marges['g']+18, $cury+5);
|
||||
$pdf->MultiCell(18, 3, $account->code_guichet, 0, 'C', 0);
|
||||
$pdf->SetXY ($this->marges['g']+36, $cury+5);
|
||||
$pdf->MultiCell(24, 3, $account->number, 0, 'C', 0);
|
||||
$pdf->SetXY ($this->marges['g']+60, $cury+5);
|
||||
$pdf->MultiCell(13, 3, $account->cle_rib, 0, 'C', 0);
|
||||
|
||||
$pdf->SetXY ($this->marges['g'], $cury+12);
|
||||
$pdf->MultiCell(90, 3, $outputlangs->trans("Residence").' : ' . $account->domiciliation, 0, 'L', 0);
|
||||
$pdf->SetXY ($this->marges['g'], $cury+22);
|
||||
$pdf->MultiCell(90, 3, $outputlangs->trans("IbanPrefix").' : ' . $account->iban_prefix, 0, 'L', 0);
|
||||
$pdf->SetXY ($this->marges['g'], $cury+25);
|
||||
$pdf->MultiCell(90, 3, $outputlangs->trans("BIC").' : ' . $account->bic, 0, 'L', 0);
|
||||
|
||||
$posy=$pdf->GetY()+2;
|
||||
}
|
||||
}
|
||||
|
||||
return $posy;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* \brief Affiche le total à payer
|
||||
* \param pdf Objet PDF
|
||||
@ -461,21 +557,11 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
*/
|
||||
function _tableau_tot(&$pdf, $com, $deja_regle, $posy, $outputlangs)
|
||||
{
|
||||
$outputlangs->load("main");
|
||||
$outputlangs->load("bills");
|
||||
|
||||
$tab2_top = $posy;
|
||||
$tab2_hl = 5;
|
||||
$tab2_height = $tab2_hl * 4;
|
||||
$pdf->SetFont('Arial','', 9);
|
||||
|
||||
// Affiche la mention TVA non applicable selon option
|
||||
$pdf->SetXY ($this->marge_gauche, $tab2_top + 0);
|
||||
if ($this->franchise==1)
|
||||
{
|
||||
$pdf->MultiCell(100, $tab2_hl, "* TVA non applicable art-293B du CGI", 0, 'L', 0);
|
||||
}
|
||||
|
||||
// Tableau total
|
||||
$lltot = 200; $col1x = 120; $col2x = 182; $largcol2 = $lltot - $col2x;
|
||||
|
||||
@ -497,7 +583,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, "-".$com->remise_percent."%", 0, 'R', 1);
|
||||
|
||||
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * 2);
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, "Total HT après remise", 0, 'L', 1);
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->trans("WithDiscountTotalHT"), 0, 'L', 1);
|
||||
|
||||
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * 2);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($com->total_ht), 0, 'R', 0);
|
||||
@ -516,14 +602,14 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
if ($tvakey) // On affiche pas taux 0
|
||||
{
|
||||
$this->atleastoneratenotnull++;
|
||||
|
||||
|
||||
$index++;
|
||||
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
|
||||
$tvacompl = ( (float)$tvakey < 0 ) ? " (".$outputlangs->trans("NonPercuRecuperable").")" : '' ;
|
||||
$tvacompl = ( (float)$tvakey < 0 ) ? " (".$outputlangs->trans("NonPercuRecuperable").")" : '' ;
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->trans("TotalVAT").' '.abs($tvakey).'%'.$tvacompl, 0, 'L', 1);
|
||||
|
||||
|
||||
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval * abs((float)$tvakey) / 100 ), 0, 'R', 1);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval * (float)$tvakey / 100 ), 0, 'R', 1);
|
||||
}
|
||||
}
|
||||
if (! $this->atleastoneratenotnull)
|
||||
@ -531,13 +617,13 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
$index++;
|
||||
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->trans("TotalVAT"), 0, 'L', 1);
|
||||
|
||||
|
||||
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($com->total_tva), 0, 'R', 1);
|
||||
}
|
||||
|
||||
|
||||
$useborder=0;
|
||||
|
||||
|
||||
$index++;
|
||||
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
@ -546,31 +632,34 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
|
||||
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($com->total_ttc), $useborder, 'R', 1);
|
||||
$pdf->SetFont('Arial','', 9);
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
|
||||
if ($deja_regle > 0)
|
||||
{
|
||||
$index++;
|
||||
|
||||
|
||||
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->trans("AlreadyPayed"), 0, 'L', 0);
|
||||
|
||||
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle), 0, 'R', 0);
|
||||
|
||||
|
||||
|
||||
$index++;
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
//$pdf->SetFont('Arial','B', 9);
|
||||
$pdf->SetFillColor(224,224,224);
|
||||
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->trans("RemainderToPay"), $useborder, 'L', 1);
|
||||
|
||||
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($com->total_ttc - $deja_regle), $useborder, 'R', 1);
|
||||
|
||||
// Fin
|
||||
$pdf->SetFont('Arial','', 9);
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
}
|
||||
|
||||
|
||||
$index++;
|
||||
return ($tab2_top + ($tab2_hl * $index));
|
||||
}
|
||||
@ -582,9 +671,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs)
|
||||
{
|
||||
global $conf;
|
||||
$outputlangs->load("main");
|
||||
$outputlangs->load("bills");
|
||||
|
||||
|
||||
// Montants exprimés en (en tab_top - 1)
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->SetFont('Arial','',8);
|
||||
@ -596,9 +683,9 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
// Rect prend une longueur en 3eme param
|
||||
$pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height);
|
||||
// line prend une position y en 3eme param
|
||||
$pdf->line($this->marge_gauche, $tab_top+6, $this->page_largeur-$this->marge_droite, $tab_top+6);
|
||||
$pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5);
|
||||
|
||||
$pdf->SetFont('Arial','',10);
|
||||
$pdf->SetFont('Arial','',9);
|
||||
|
||||
$pdf->SetXY ($this->posxdesc-1, $tab_top+2);
|
||||
$pdf->MultiCell(108,2, $outputlangs->trans("Designation"),'','L');
|
||||
@ -680,19 +767,25 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
$pdf->MultiCell(100, 4, $outputlangs->trans("Order"), '' , 'R');
|
||||
|
||||
$pdf->SetFont('Arial','B',12);
|
||||
|
||||
|
||||
$posy+=6;
|
||||
$pdf->SetXY(100,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell(100, 4, $outputlangs->trans("Ref")." : " . $com->ref, '', 'R');
|
||||
|
||||
$pdf->SetFont('Arial','',12);
|
||||
|
||||
$pdf->SetFont('Arial','',10);
|
||||
|
||||
$posy+=6;
|
||||
$pdf->SetXY(100,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell(100, 4, $outputlangs->trans("OrderDate")." : " . dolibarr_print_date($com->date,"%d %b %Y"), '', 'R');
|
||||
$pdf->MultiCell(100, 3, $outputlangs->trans("OrderDate")." : " . dolibarr_print_date($com->date,"%d %b %Y"), '', 'R');
|
||||
|
||||
/*
|
||||
$posy+=5;
|
||||
$pdf->SetXY(100,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->trans("DateEcheance")." : " . dolibarr_print_date($fac->date_lim_reglement,"%d %b %Y"), '', 'R');
|
||||
*/
|
||||
|
||||
if ($showadress)
|
||||
{
|
||||
@ -703,21 +796,21 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
$pdf->SetFont('Arial','',8);
|
||||
$pdf->SetXY($this->marge_gauche,$posy-5);
|
||||
$pdf->MultiCell(66,5, $outputlangs->trans("BillFrom").":");
|
||||
|
||||
|
||||
|
||||
|
||||
$pdf->SetXY($this->marge_gauche,$posy);
|
||||
$pdf->SetFillColor(230,230,230);
|
||||
$pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1);
|
||||
|
||||
|
||||
|
||||
|
||||
$pdf->SetXY($this->marge_gauche+2,$posy+3);
|
||||
|
||||
|
||||
// Nom emetteur
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->SetFont('Arial','B',11);
|
||||
if (defined("FAC_PDF_SOCIETE_NOM") && FAC_PDF_SOCIETE_NOM) $pdf->MultiCell(80, 4, FAC_PDF_SOCIETE_NOM, 0, 'L');
|
||||
else $pdf->MultiCell(80, 4, $this->emetteur->nom, 0, 'L');
|
||||
|
||||
|
||||
// Caractéristiques emetteur
|
||||
$carac_emetteur = '';
|
||||
if (defined("FAC_PDF_ADRESSE") && FAC_PDF_ADRESSE) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).FAC_PDF_ADRESSE;
|
||||
@ -738,31 +831,27 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
// Web
|
||||
if (defined("FAC_PDF_WWW") && FAC_PDF_WWW) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->trans("Web").": ".FAC_PDF_WWW;
|
||||
elseif ($this->emetteur->url) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->trans("Web").": ".$this->emetteur->url;
|
||||
|
||||
|
||||
$pdf->SetFont('Arial','',9);
|
||||
$pdf->SetXY($this->marge_gauche+2,$posy+8);
|
||||
$pdf->MultiCell(80,4, $carac_emetteur);
|
||||
|
||||
|
||||
// Client destinataire
|
||||
$posy=42;
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->SetFont('Arial','',8);
|
||||
$pdf->SetXY(102,$posy-5);
|
||||
$pdf->MultiCell(80,5, $outputlangs->trans("BillTo").":");
|
||||
//
|
||||
$client = new Societe($this->db);
|
||||
$client->fetch($com->socidp);
|
||||
$com->client = $client;
|
||||
//
|
||||
|
||||
$com->fetch_client();
|
||||
|
||||
// Cadre client destinataire
|
||||
$pdf->rect(100, $posy, 100, $hautcadre);
|
||||
|
||||
|
||||
// Nom client
|
||||
$pdf->SetXY(102,$posy+3);
|
||||
$pdf->SetFont('Arial','B',11);
|
||||
$pdf->MultiCell(106,4, $com->client->nom, 0, 'L');
|
||||
|
||||
|
||||
// Caractéristiques client
|
||||
$carac_client=$com->client->adresse;
|
||||
$carac_client.="\n".$com->client->cp . " " . $com->client->ville."\n";
|
||||
@ -781,12 +870,9 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
function _pagefoot(&$pdf,$outputlangs)
|
||||
{
|
||||
global $conf;
|
||||
$outputlangs->load("main");
|
||||
$outputlangs->load("bills");
|
||||
$outputlangs->load("companies");
|
||||
|
||||
|
||||
$html=new Form($this->db);
|
||||
|
||||
|
||||
// Premiere ligne d'info réglementaires
|
||||
$ligne1="";
|
||||
if ($this->emetteur->forme_juridique_code)
|
||||
@ -810,7 +896,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
$ligne2="";
|
||||
if ($this->emetteur->profid3)
|
||||
{
|
||||
$ligne2.=($ligne1?" - ":"").$outputlangs->transcountry("ProfId3",$this->emetteur->pays_code).": ".$this->emetteur->profid3;
|
||||
$ligne2.=($ligne2?" - ":"").$outputlangs->transcountry("ProfId3",$this->emetteur->pays_code).": ".$this->emetteur->profid3;
|
||||
}
|
||||
if ($this->emetteur->profid4)
|
||||
{
|
||||
@ -830,7 +916,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
$pdf->SetY(-$posy);
|
||||
$pdf->line($this->marge_gauche, $this->page_hauteur-$posy, 200, $this->page_hauteur-$posy);
|
||||
$posy--;
|
||||
|
||||
|
||||
if ($ligne1)
|
||||
{
|
||||
$pdf->SetXY($this->marge_gauche,-$posy);
|
||||
@ -843,7 +929,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
$pdf->SetXY($this->marge_gauche,-$posy);
|
||||
$pdf->MultiCell(200, 2, $ligne2, 0, 'C', 0);
|
||||
}
|
||||
|
||||
|
||||
$pdf->SetXY(-20,-$posy);
|
||||
$pdf->MultiCell(10, 2, $pdf->PageNo().'/{nb}', 0, 'R', 0);
|
||||
}
|
||||
@ -857,7 +943,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
function _dol_htmlentities($stringtoencode,$isstringalreadyhtml)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
|
||||
if ($isstringalreadyhtml) return $stringtoencode;
|
||||
if ($conf->fckeditor->enabled) return htmlentities($stringtoencode);
|
||||
return $stringtoencode;
|
||||
|
||||
@ -73,6 +73,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$this->option_condreg = 1; // Affiche conditions règlement
|
||||
$this->option_codeproduitservice = 1; // Affiche code produit-service
|
||||
$this->option_multilang = 1; // Dispo en plusieurs langues
|
||||
$this->option_escompte = 1; // Affiche si il y a eu escompte
|
||||
|
||||
if (defined("FACTURE_TVAOPTION") && FACTURE_TVAOPTION == 'franchise')
|
||||
$this->franchise=1;
|
||||
@ -109,9 +110,9 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$outputlangs->load("companies");
|
||||
$outputlangs->load("bills");
|
||||
$outputlangs->load("products");
|
||||
|
||||
|
||||
$outputlangs->setPhpLang();
|
||||
|
||||
|
||||
if ($conf->facture->dir_output)
|
||||
{
|
||||
// Définition de l'objet $fac (pour compatibilite ascendante)
|
||||
@ -121,6 +122,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$fac = new Facture($this->db,"",$id);
|
||||
$ret=$fac->fetch($id);
|
||||
}
|
||||
$deja_regle = $fac->getSommePaiement();
|
||||
|
||||
// Définition de $dir et $file
|
||||
if ($fac->specimen)
|
||||
@ -172,9 +174,9 @@ class pdf_crabe extends ModelePDFFactures
|
||||
}
|
||||
}
|
||||
|
||||
// Tete de page
|
||||
$this->_pagehead($pdf, $fac, 1, $outputlangs);
|
||||
|
||||
// Affiches lignes
|
||||
$pagenb = 1;
|
||||
$tab_top = 90;
|
||||
$tab_top_newpage = 50;
|
||||
@ -224,10 +226,12 @@ class pdf_crabe extends ModelePDFFactures
|
||||
if ($fac->lignes[$i]->produit_id)
|
||||
{
|
||||
$prodser = new Product($this->db);
|
||||
|
||||
$prodser->fetch($fac->lignes[$i]->produit_id);
|
||||
if ($prodser->ref) {
|
||||
$prefix_prodserv = "";
|
||||
|
||||
// On ajoute la ref
|
||||
if ($prodser->ref)
|
||||
{
|
||||
$prefix_prodserv = "";
|
||||
if($prodser->type == 0)
|
||||
$prefix_prodserv = $outputlangs->trans("Product")." ";
|
||||
if($prodser->type == 1)
|
||||
@ -236,8 +240,8 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$libelleproduitservice=$prefix_prodserv.$prodser->ref." - ".$libelleproduitservice;
|
||||
}
|
||||
|
||||
// Ajoute description du produit
|
||||
if ($conf->global->FORM_ADD_PROD_DESC && !$conf->global->PRODUIT_CHANGE_PROD_DESC)
|
||||
// Ajoute description du produit
|
||||
if ($conf->global->FORM_ADD_PROD_DESC && !$conf->global->PRODUIT_CHANGE_PROD_DESC)
|
||||
{
|
||||
if ($fac->lignes[$i]->product_desc&&$fac->lignes[$i]->product_desc!=$fac->lignes[$i]->libelle&&$fac->lignes[$i]->product_desc!=$fac->lignes[$i]->desc)
|
||||
{
|
||||
@ -308,8 +312,8 @@ class pdf_crabe extends ModelePDFFactures
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top_newpage, $tab_height_newpage, $nexY, $outputlangs);
|
||||
}
|
||||
|
||||
$this->_pagefoot($pdf,$outputlangs);
|
||||
|
||||
$this->_pagefoot($pdf,$outputlangs);
|
||||
|
||||
// Nouvelle page
|
||||
$pdf->AddPage();
|
||||
@ -322,6 +326,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Affiche cadre tableau
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
@ -334,124 +339,18 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$bottomlasttab=$tab_top_newpage + $tab_height + 1;
|
||||
}
|
||||
|
||||
$deja_regle = $fac->getSommePaiement();
|
||||
// Affiche zone infos
|
||||
$posy=$this->_tableau_info($pdf, $fac, $bottomlasttab, $outputlangs);
|
||||
|
||||
// Affiche zone totaux
|
||||
$posy=$this->_tableau_tot($pdf, $fac, $deja_regle, $bottomlasttab, $outputlangs);
|
||||
|
||||
// Affiche zone versements
|
||||
if ($deja_regle) {
|
||||
$this->_tableau_versements($pdf, $fac, $posy, $outputlangs);
|
||||
$posy=$this->_tableau_versements($pdf, $fac, $posy, $outputlangs);
|
||||
}
|
||||
|
||||
/*
|
||||
* Mode de règlement
|
||||
*/
|
||||
if (! $conf->global->FACTURE_CHQ_NUMBER && ! $conf->global->FACTURE_RIB_NUMBER)
|
||||
{
|
||||
$pdf->SetXY($this->marge_gauche, 228);
|
||||
$pdf->SetTextColor(200,0,0);
|
||||
$pdf->SetFont('Arial','B',8);
|
||||
$pdf->MultiCell(90, 3, $outputlangs->trans("ErrorNoPaiementModeConfigured"),0,'L',0);
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Propose mode règlement par CHQ
|
||||
*/
|
||||
if ($conf->global->FACTURE_CHQ_NUMBER)
|
||||
{
|
||||
if ($conf->global->FACTURE_CHQ_NUMBER > 0)
|
||||
{
|
||||
$account = new Account($this->db);
|
||||
$account->fetch($conf->global->FACTURE_CHQ_NUMBER);
|
||||
|
||||
$pdf->SetXY($this->marge_gauche, 227);
|
||||
$pdf->SetFont('Arial','B',8);
|
||||
$pdf->MultiCell(90, 3, $outputlangs->trans('PaymentByChequeOrderedTo',$account->proprio).':',0,'L',0);
|
||||
$pdf->SetXY($this->marge_gauche, 231);
|
||||
$pdf->SetFont('Arial','',8);
|
||||
$pdf->MultiCell(80, 3, $account->adresse_proprio, 0, 'L', 0);
|
||||
}
|
||||
if ($conf->global->FACTURE_CHQ_NUMBER == -1)
|
||||
{
|
||||
$pdf->SetXY($this->marge_gauche, 227);
|
||||
$pdf->SetFont('Arial','B',8);
|
||||
$pdf->MultiCell(90, 3, $outputlangs->trans('PaymentByChequeOrderedToShort').' '.$this->emetteur->nom.' '.$outputlangs->trans('SendTo').':',0,'L',0);
|
||||
$pdf->SetXY($this->marge_gauche, 231);
|
||||
$pdf->SetFont('Arial','',8);
|
||||
$pdf->MultiCell(80, 3, $this->emetteur->adresse_full, 0, 'L', 0);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Propose mode règlement par RIB
|
||||
*/
|
||||
if ($conf->global->FACTURE_RIB_NUMBER)
|
||||
{
|
||||
if ($conf->global->FACTURE_RIB_NUMBER)
|
||||
{
|
||||
$account = new Account($this->db);
|
||||
$account->fetch($conf->global->FACTURE_RIB_NUMBER);
|
||||
|
||||
$this->marges['g']=$this->marge_gauche;
|
||||
|
||||
$cury=242;
|
||||
$pdf->SetXY ($this->marges['g'], $cury);
|
||||
$pdf->SetFont('Arial','B',8);
|
||||
$pdf->MultiCell(90, 3, $outputlangs->trans('PaymentByTransferOnThisBankAccount').':', 0, 'L', 0);
|
||||
$cury+=4;
|
||||
$pdf->SetFont('Arial','B',6);
|
||||
$pdf->line($this->marges['g']+1, $cury, $this->marges['g']+1, $cury+10 );
|
||||
$pdf->SetXY ($this->marges['g'], $cury);
|
||||
$pdf->MultiCell(18, 3, $outputlangs->trans("BankCode"), 0, 'C', 0);
|
||||
$pdf->line($this->marges['g']+18, $cury, $this->marges['g']+18, $cury+10 );
|
||||
$pdf->SetXY ($this->marges['g']+18, $cury);
|
||||
$pdf->MultiCell(18, 3, $outputlangs->trans("DeskCode"), 0, 'C', 0);
|
||||
$pdf->line($this->marges['g']+36, $cury, $this->marges['g']+36, $cury+10 );
|
||||
$pdf->SetXY ($this->marges['g']+36, $cury);
|
||||
$pdf->MultiCell(24, 3, $outputlangs->trans("BankAccountNumber"), 0, 'C', 0);
|
||||
$pdf->line($this->marges['g']+60, $cury, $this->marges['g']+60, $cury+10 );
|
||||
$pdf->SetXY ($this->marges['g']+60, $cury);
|
||||
$pdf->MultiCell(13, 3, $outputlangs->trans("BankAccountNumberKey"), 0, 'C', 0);
|
||||
$pdf->line($this->marges['g']+73, $cury, $this->marges['g']+73, $cury+10 );
|
||||
|
||||
$pdf->SetFont('Arial','',8);
|
||||
$pdf->SetXY ($this->marges['g'], $cury+5);
|
||||
$pdf->MultiCell(18, 3, $account->code_banque, 0, 'C', 0);
|
||||
$pdf->SetXY ($this->marges['g']+18, $cury+5);
|
||||
$pdf->MultiCell(18, 3, $account->code_guichet, 0, 'C', 0);
|
||||
$pdf->SetXY ($this->marges['g']+36, $cury+5);
|
||||
$pdf->MultiCell(24, 3, $account->number, 0, 'C', 0);
|
||||
$pdf->SetXY ($this->marges['g']+60, $cury+5);
|
||||
$pdf->MultiCell(13, 3, $account->cle_rib, 0, 'C', 0);
|
||||
|
||||
$pdf->SetXY ($this->marges['g'], $cury+12);
|
||||
$pdf->MultiCell(90, 3, $outputlangs->trans("Residence").' : ' . $account->domiciliation, 0, 'L', 0);
|
||||
$pdf->SetXY ($this->marges['g'], $cury+22);
|
||||
$pdf->MultiCell(90, 3, $outputlangs->trans("IbanPrefix").' : ' . $account->iban_prefix, 0, 'L', 0);
|
||||
$pdf->SetXY ($this->marges['g'], $cury+25);
|
||||
$pdf->MultiCell(90, 3, $outputlangs->trans("BIC").' : ' . $account->bic, 0, 'L', 0);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Conditions de règlements
|
||||
*/
|
||||
if ($fac->cond_reglement_code || $fac->cond_reglement)
|
||||
{
|
||||
$pdf->SetFont('Arial','B',8);
|
||||
$pdf->SetXY($this->marge_gauche, 217);
|
||||
$titre = $outputlangs->trans("PaymentConditions").':';
|
||||
$pdf->MultiCell(80, 5, $titre, 0, 'L');
|
||||
$pdf->SetFont('Arial','',8);
|
||||
$pdf->SetXY(50, 217);
|
||||
$lib_condition_paiement=$outputlangs->trans("PaymentCondition".$fac->cond_reglement_code)!=('PaymentCondition'.$fac->cond_reglement_code)?$outputlangs->trans("PaymentCondition".$fac->cond_reglement_code):$fac->cond_reglement;
|
||||
$pdf->MultiCell(80, 5, $lib_condition_paiement,0,'L');
|
||||
}
|
||||
|
||||
/*
|
||||
* Pied de page
|
||||
*/
|
||||
// Pied de page
|
||||
$this->_pagefoot($pdf,$outputlangs);
|
||||
$pdf->AliasNbPages();
|
||||
|
||||
@ -474,7 +373,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$this->error=$outputlangs->trans("ErrorConstantNotDefined","FAC_OUTPUTDIR");
|
||||
$langs->setPhpLang(); // On restaure langue session
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
$this->error=$outputlangs->trans("ErrorUnknown");
|
||||
$langs->setPhpLang(); // On restaure langue session
|
||||
return 0; // Erreur par defaut
|
||||
@ -487,7 +386,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
* \param fac objet facture
|
||||
*/
|
||||
function _tableau_versements(&$pdf, $fac, $posy, $outputlangs)
|
||||
{
|
||||
{
|
||||
$tab3_posx = 120;
|
||||
$tab3_top = $posy + 8;
|
||||
$tab3_width = 80;
|
||||
@ -567,12 +466,166 @@ class pdf_crabe extends ModelePDFFactures
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* \brief Affiche infos divers
|
||||
* \param pdf Objet PDF
|
||||
* \param fac Objet facture
|
||||
* \param posy Position depart
|
||||
* \param outputlangs Objet langs
|
||||
* \return y Position pour suite
|
||||
*/
|
||||
function _tableau_info(&$pdf, $fac, $posy, $outputlangs)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$pdf->SetFont('Arial','', 9);
|
||||
|
||||
/*
|
||||
* Affiche la mention TVA non applicable selon option
|
||||
*/
|
||||
if ($this->franchise == 1)
|
||||
{
|
||||
$pdf->SetFont('Arial','B',8);
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->trans("VATIsNotUsedForInvoice"), 0, 'L', 0);
|
||||
|
||||
$posy=$pdf->GetY()+4;
|
||||
}
|
||||
|
||||
/*
|
||||
* Conditions de règlements
|
||||
*/
|
||||
if ($fac->cond_reglement_code || $fac->cond_reglement)
|
||||
{
|
||||
$pdf->SetFont('Arial','B',8);
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
$titre = $outputlangs->trans("PaymentConditions").':';
|
||||
$pdf->MultiCell(80, 5, $titre, 0, 'L');
|
||||
|
||||
$pdf->SetFont('Arial','',8);
|
||||
$pdf->SetXY(50, $posy);
|
||||
$lib_condition_paiement=$outputlangs->trans("PaymentCondition".$fac->cond_reglement_code)!=('PaymentCondition'.$fac->cond_reglement_code)?$outputlangs->trans("PaymentCondition".$fac->cond_reglement_code):$fac->cond_reglement;
|
||||
$pdf->MultiCell(80, 5, $lib_condition_paiement,0,'L');
|
||||
|
||||
$posy=$pdf->GetY()+3;
|
||||
}
|
||||
|
||||
/*
|
||||
* Mode de règlement
|
||||
*/
|
||||
if (! $conf->global->FACTURE_CHQ_NUMBER && ! $conf->global->FACTURE_RIB_NUMBER)
|
||||
{
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
$pdf->SetTextColor(200,0,0);
|
||||
$pdf->SetFont('Arial','B',8);
|
||||
$pdf->MultiCell(90, 3, $outputlangs->trans("ErrorNoPaiementModeConfigured"),0,'L',0);
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
|
||||
$posy=$pdf->GetY()+1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Propose mode règlement par CHQ
|
||||
*/
|
||||
if ($conf->global->FACTURE_CHQ_NUMBER)
|
||||
{
|
||||
if ($conf->global->FACTURE_CHQ_NUMBER > 0)
|
||||
{
|
||||
$account = new Account($this->db);
|
||||
$account->fetch($conf->global->FACTURE_CHQ_NUMBER);
|
||||
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
$pdf->SetFont('Arial','B',8);
|
||||
$pdf->MultiCell(90, 3, $outputlangs->trans('PaymentByChequeOrderedTo',$account->proprio).':',0,'L',0);
|
||||
$posy=$pdf->GetY()+1;
|
||||
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
$pdf->SetFont('Arial','',8);
|
||||
$pdf->MultiCell(80, 3, $account->adresse_proprio, 0, 'L', 0);
|
||||
|
||||
$posy=$pdf->GetY()+2;
|
||||
}
|
||||
if ($conf->global->FACTURE_CHQ_NUMBER == -1)
|
||||
{
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
$pdf->SetFont('Arial','B',8);
|
||||
$pdf->MultiCell(90, 3, $outputlangs->trans('PaymentByChequeOrderedToShort').' '.$this->emetteur->nom.' '.$outputlangs->trans('SendTo').':',0,'L',0);
|
||||
$posy=$pdf->GetY()+1;
|
||||
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
$pdf->SetFont('Arial','',8);
|
||||
$pdf->MultiCell(80, 6, $this->emetteur->adresse_full, 0, 'L', 0);
|
||||
|
||||
$posy=$pdf->GetY()+2;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Propose mode règlement par RIB
|
||||
*/
|
||||
if ($conf->global->FACTURE_RIB_NUMBER)
|
||||
{
|
||||
if ($conf->global->FACTURE_RIB_NUMBER)
|
||||
{
|
||||
$account = new Account($this->db);
|
||||
$account->fetch($conf->global->FACTURE_RIB_NUMBER);
|
||||
|
||||
$this->marges['g']=$this->marge_gauche;
|
||||
|
||||
$cury=$posy;
|
||||
$pdf->SetXY ($this->marges['g'], $cury);
|
||||
$pdf->SetFont('Arial','B',8);
|
||||
$pdf->MultiCell(90, 3, $outputlangs->trans('PaymentByTransferOnThisBankAccount').':', 0, 'L', 0);
|
||||
$cury+=4;
|
||||
$pdf->SetFont('Arial','B',6);
|
||||
$pdf->line($this->marges['g']+1, $cury, $this->marges['g']+1, $cury+10 );
|
||||
$pdf->SetXY ($this->marges['g'], $cury);
|
||||
$pdf->MultiCell(18, 3, $outputlangs->trans("BankCode"), 0, 'C', 0);
|
||||
$pdf->line($this->marges['g']+18, $cury, $this->marges['g']+18, $cury+10 );
|
||||
$pdf->SetXY ($this->marges['g']+18, $cury);
|
||||
$pdf->MultiCell(18, 3, $outputlangs->trans("DeskCode"), 0, 'C', 0);
|
||||
$pdf->line($this->marges['g']+36, $cury, $this->marges['g']+36, $cury+10 );
|
||||
$pdf->SetXY ($this->marges['g']+36, $cury);
|
||||
$pdf->MultiCell(24, 3, $outputlangs->trans("BankAccountNumber"), 0, 'C', 0);
|
||||
$pdf->line($this->marges['g']+60, $cury, $this->marges['g']+60, $cury+10 );
|
||||
$pdf->SetXY ($this->marges['g']+60, $cury);
|
||||
$pdf->MultiCell(13, 3, $outputlangs->trans("BankAccountNumberKey"), 0, 'C', 0);
|
||||
$pdf->line($this->marges['g']+73, $cury, $this->marges['g']+73, $cury+10 );
|
||||
|
||||
$pdf->SetFont('Arial','',8);
|
||||
$pdf->SetXY ($this->marges['g'], $cury+5);
|
||||
$pdf->MultiCell(18, 3, $account->code_banque, 0, 'C', 0);
|
||||
$pdf->SetXY ($this->marges['g']+18, $cury+5);
|
||||
$pdf->MultiCell(18, 3, $account->code_guichet, 0, 'C', 0);
|
||||
$pdf->SetXY ($this->marges['g']+36, $cury+5);
|
||||
$pdf->MultiCell(24, 3, $account->number, 0, 'C', 0);
|
||||
$pdf->SetXY ($this->marges['g']+60, $cury+5);
|
||||
$pdf->MultiCell(13, 3, $account->cle_rib, 0, 'C', 0);
|
||||
|
||||
$pdf->SetXY ($this->marges['g'], $cury+12);
|
||||
$pdf->MultiCell(90, 3, $outputlangs->trans("Residence").' : ' . $account->domiciliation, 0, 'L', 0);
|
||||
$pdf->SetXY ($this->marges['g'], $cury+22);
|
||||
$pdf->MultiCell(90, 3, $outputlangs->trans("IbanPrefix").' : ' . $account->iban_prefix, 0, 'L', 0);
|
||||
$pdf->SetXY ($this->marges['g'], $cury+25);
|
||||
$pdf->MultiCell(90, 3, $outputlangs->trans("BIC").' : ' . $account->bic, 0, 'L', 0);
|
||||
|
||||
$posy=$pdf->GetY()+2;
|
||||
}
|
||||
}
|
||||
|
||||
return $posy;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* \brief Affiche le total à payer
|
||||
* \param pdf Objet PDF
|
||||
* \param fac Objet facture
|
||||
* \param deja_regle Montant deja regle
|
||||
* \return y Position pour suite
|
||||
* \brief Affiche le total à payer
|
||||
* \param pdf Objet PDF
|
||||
* \param fac Objet facture
|
||||
* \param deja_regle Montant deja regle
|
||||
* \param posy Position depart
|
||||
* \param outputlangs Objet langs
|
||||
* \return y Position pour suite
|
||||
*/
|
||||
function _tableau_tot(&$pdf, $fac, $deja_regle, $posy, $outputlangs)
|
||||
{
|
||||
@ -581,13 +634,6 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$tab2_height = $tab2_hl * 4;
|
||||
$pdf->SetFont('Arial','', 9);
|
||||
|
||||
// Affiche la mention TVA non applicable selon option
|
||||
$pdf->SetXY($this->marge_gauche, $tab2_top + 0);
|
||||
if ($this->franchise==1)
|
||||
{
|
||||
$pdf->MultiCell(100, $tab2_hl, $outputlangs->trans("VATIsNotUsedForInvoice"), 0, 'L', 0);
|
||||
}
|
||||
|
||||
// Tableau total
|
||||
$lltot = 200; $col1x = 120; $col2x = 182; $largcol2 = $lltot - $col2x;
|
||||
|
||||
@ -658,7 +704,6 @@ class pdf_crabe extends ModelePDFFactures
|
||||
|
||||
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($fac->total_ttc), $useborder, 'R', 1);
|
||||
$pdf->SetFont('Arial','', 9);
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
|
||||
if ($deja_regle > 0)
|
||||
@ -671,23 +716,35 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle), 0, 'R', 0);
|
||||
|
||||
$resteapayer = $fac->total_ttc - $deja_regle;
|
||||
if ($fac->paye) $resteapayer=0;
|
||||
|
||||
if ($fac->close_code == 'escompte')
|
||||
{
|
||||
$index++;
|
||||
$pdf->SetFillColor(256,256,256);
|
||||
|
||||
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->trans("EscompteOffered"), $useborder, 'L', 1);
|
||||
|
||||
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($fac->total_ttc - $deja_regle), $useborder, 'R', 1);
|
||||
}
|
||||
|
||||
$index++;
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
//$pdf->SetFont('Arial','B', 9);
|
||||
$pdf->SetFillColor(224,224,224);
|
||||
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->trans("RemainderToPay"), $useborder, 'L', 1);
|
||||
|
||||
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($fac->total_ttc - $deja_regle), $useborder, 'R', 1);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer), $useborder, 'R', 1);
|
||||
|
||||
// Fin
|
||||
$pdf->SetFont('Arial','', 9);
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
}
|
||||
|
||||
/* Ne semble pas requis par la réglementation
|
||||
$index++;
|
||||
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($col2x-$col1x+$largcol2, $tab2_hl, $outputlangs->trans('DispenseMontantLettres'), 0, 'L' );
|
||||
*/
|
||||
$index++;
|
||||
return ($tab2_top + ($tab2_hl * $index));
|
||||
}
|
||||
@ -713,7 +770,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
// line prend une position y en 3eme param
|
||||
$pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5);
|
||||
|
||||
$pdf->SetFont('Arial','',10);
|
||||
$pdf->SetFont('Arial','',9);
|
||||
|
||||
$pdf->SetXY ($this->posxdesc-1, $tab_top+2);
|
||||
$pdf->MultiCell(108,2, $outputlangs->trans("Designation"),'','L');
|
||||
@ -795,27 +852,27 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$pdf->MultiCell(100, 4, $outputlangs->trans("Invoice"), '' , 'R');
|
||||
|
||||
$pdf->SetFont('Arial','B',12);
|
||||
|
||||
|
||||
$posy+=6;
|
||||
$pdf->SetXY(100,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell(100, 4, $outputlangs->trans("Ref")." : " . $fac->ref, '', 'R');
|
||||
|
||||
$pdf->SetFont('Arial','',12);
|
||||
|
||||
$pdf->SetFont('Arial','',10);
|
||||
|
||||
$posy+=6;
|
||||
$pdf->SetXY(100,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell(100, 4, $outputlangs->trans("DateInvoice")." : " . dolibarr_print_date($fac->date,"%d %b %Y"), '', 'R');
|
||||
$pdf->MultiCell(100, 3, $outputlangs->trans("DateInvoice")." : " . dolibarr_print_date($fac->date,"%d %b %Y"), '', 'R');
|
||||
|
||||
$posy+=6;
|
||||
$posy+=5;
|
||||
$pdf->SetXY(100,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell(100, 4, $outputlangs->trans("DateEcheance")." : " . dolibarr_print_date($fac->date_lim_reglement,"%d %b %Y"), '', 'R');
|
||||
$pdf->MultiCell(100, 3, $outputlangs->trans("DateEcheance")." : " . dolibarr_print_date($fac->date_lim_reglement,"%d %b %Y"), '', 'R');
|
||||
|
||||
if ($showadress)
|
||||
{
|
||||
// Emetteur
|
||||
// Emetteur
|
||||
$posy=42;
|
||||
$hautcadre=40;
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
@ -869,6 +926,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$pdf->SetXY(102,$posy-5);
|
||||
$pdf->MultiCell(80,5, $outputlangs->trans("BillTo").":");
|
||||
$fac->fetch_client();
|
||||
|
||||
// Cadre client destinataire
|
||||
$pdf->rect(100, $posy, 100, $hautcadre);
|
||||
|
||||
@ -968,7 +1026,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
function _dol_htmlentities($stringtoencode,$isstringalreadyhtml)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
|
||||
if ($isstringalreadyhtml) return $stringtoencode;
|
||||
if ($conf->fckeditor->enabled) return htmlentities($stringtoencode);
|
||||
return $stringtoencode;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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
|
||||
@ -39,91 +39,99 @@ include_once "DolibarrModules.class.php";
|
||||
class modExternalRss extends DolibarrModules
|
||||
{
|
||||
|
||||
/**
|
||||
/**
|
||||
* \brief Constructeur. Definit les noms, constantes et boites
|
||||
* \param DB handler d'accès base
|
||||
*/
|
||||
function modExternalRss($DB)
|
||||
{
|
||||
$this->db = $DB ;
|
||||
$this->id = 'externalrss'; // Same value xxx than in file modXxx.class.php file
|
||||
$this->numero = 320;
|
||||
function modExternalRss($DB)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$this->db = $DB ;
|
||||
$this->id = 'externalrss'; // Same value xxx than in file modXxx.class.php file
|
||||
$this->numero = 320;
|
||||
|
||||
$this->family = "technic";
|
||||
$this->name = "Syndication RSS";
|
||||
$this->description = "Ajout de files d'informations RSS dans les écrans Dolibarr";
|
||||
$this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version
|
||||
$this->const_name = 'MAIN_MODULE_EXTERNALRSS';
|
||||
$this->special = 1;
|
||||
$this->picto='rss';
|
||||
|
||||
// Dir
|
||||
$this->dirs = array();
|
||||
|
||||
// Config pages
|
||||
$this->config_page_url = array("external_rss.php");
|
||||
|
||||
// Dépendances
|
||||
$this->depends = array();
|
||||
$this->requiredby = array();
|
||||
$this->phpmin = array(4,2,0);
|
||||
$this->phpmax = array();
|
||||
|
||||
// Constantes
|
||||
$this->const = array();
|
||||
|
||||
// Répertoires
|
||||
$this->dirs = array();
|
||||
$this->dirs[0] = $conf->externalrss->dir_temp;
|
||||
|
||||
// Boxes
|
||||
$this->boxes = array();
|
||||
// Les boites sont ajoutées lors de la configuration des flux
|
||||
|
||||
// Permissions
|
||||
$this->rights = array();
|
||||
$this->rights_class = 'externalrss';
|
||||
}
|
||||
|
||||
$this->family = "technic";
|
||||
$this->name = "Syndication RSS";
|
||||
$this->description = "Ajout de files d'informations RSS dans les écrans Dolibarr";
|
||||
$this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version
|
||||
$this->const_name = 'MAIN_MODULE_EXTERNALRSS';
|
||||
$this->special = 1;
|
||||
$this->picto='rss';
|
||||
|
||||
// Dir
|
||||
$this->dirs = array();
|
||||
|
||||
// Config pages
|
||||
$this->config_page_url = array("external_rss.php");
|
||||
|
||||
// Dépendances
|
||||
$this->depends = array();
|
||||
$this->requiredby = array();
|
||||
$this->phpmin = array(4,2,0);
|
||||
$this->phpmax = array();
|
||||
|
||||
// Constantes
|
||||
$this->const = array();
|
||||
|
||||
// Boxes
|
||||
$this->boxes = array();
|
||||
// Les boites sont ajoutées lors de la configuration des flux
|
||||
|
||||
// Permissions
|
||||
$this->rights = array();
|
||||
$this->rights_class = 'externalrss';
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* \brief Fonction appelée lors de l'activation du module. Insère en base les constantes, boites, permissions du module.
|
||||
* Définit également les répertoires de données à créer pour ce module.
|
||||
*/
|
||||
function init()
|
||||
{
|
||||
$sql = array();
|
||||
|
||||
// Recherche configuration de boites
|
||||
$this->boxes=array();
|
||||
$sql="select name, value from ".MAIN_DB_PREFIX."const";
|
||||
$sql.= " WHERE name like 'EXTERNAL_RSS_TITLE_%'";
|
||||
$result=$this->db->query($sql);
|
||||
if ($result)
|
||||
function init()
|
||||
{
|
||||
while ($obj = $this->db->fetch_object($result))
|
||||
{
|
||||
if (eregi('EXTERNAL_RSS_TITLE_([0-9]+)',$obj->name,$reg))
|
||||
{
|
||||
// Definie la boite si on a trouvée une ancienne configuration
|
||||
$this->boxes[$reg[1]][0] = "(ExternalRSSInformations)";
|
||||
$this->boxes[$reg[1]][1] = "box_external_rss.php";
|
||||
$this->boxes[$reg[1]][2] = $reg[1]." (".$obj->value.")";
|
||||
$sql = array();
|
||||
|
||||
// Recherche configuration de boites
|
||||
$this->boxes=array();
|
||||
$sql="select name, value from ".MAIN_DB_PREFIX."const";
|
||||
$sql.= " WHERE name like 'EXTERNAL_RSS_TITLE_%'";
|
||||
$result=$this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
while ($obj = $this->db->fetch_object($result))
|
||||
{
|
||||
if (eregi('EXTERNAL_RSS_TITLE_([0-9]+)',$obj->name,$reg))
|
||||
{
|
||||
// Definie la boite si on a trouvée une ancienne configuration
|
||||
$this->boxes[$reg[1]][0] = "(ExternalRSSInformations)";
|
||||
$this->boxes[$reg[1]][1] = "box_external_rss.php";
|
||||
$this->boxes[$reg[1]][2] = $reg[1]." (".$obj->value.")";
|
||||
}
|
||||
}
|
||||
$this->db->free($result);
|
||||
}
|
||||
$this->db->free($result);
|
||||
|
||||
$sql = array();
|
||||
|
||||
return $this->_init($sql);
|
||||
}
|
||||
|
||||
return $this->_init($sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Fonction appelée lors de la désactivation d'un module.
|
||||
* Supprime de la base les constantes, boites et permissions du module.
|
||||
*/
|
||||
function remove()
|
||||
{
|
||||
$sql = array();
|
||||
|
||||
// Supprime anciennes delcarations de la boite RSS
|
||||
$this->boxes[0][1] = "box_external_rss.php";
|
||||
|
||||
return $this->_remove($sql);
|
||||
}
|
||||
/**
|
||||
* \brief Fonction appelée lors de la désactivation d'un module.
|
||||
* Supprime de la base les constantes, boites et permissions du module.
|
||||
*/
|
||||
function remove()
|
||||
{
|
||||
$sql = array();
|
||||
|
||||
// Supprime anciennes delcarations de la boite RSS
|
||||
$this->boxes[0][1] = "box_external_rss.php";
|
||||
|
||||
return $this->_remove($sql);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
@ -30,6 +30,7 @@
|
||||
*/
|
||||
|
||||
require_once(FPDF_PATH.'fpdf.php');
|
||||
require_once(DOL_DOCUMENT_ROOT."/compta/bank/account.class.php"); // Requis car utilisé dans les classes qui héritent
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -40,7 +40,7 @@ require_once(DOL_DOCUMENT_ROOT."/product.class.php");
|
||||
class pdf_propale_azur extends ModelePDFPropales
|
||||
{
|
||||
var $emetteur; // Objet societe qui emet
|
||||
|
||||
|
||||
|
||||
/**
|
||||
\brief Constructeur
|
||||
@ -79,7 +79,7 @@ class pdf_propale_azur extends ModelePDFPropales
|
||||
|
||||
// Recupere emmetteur
|
||||
$this->emetteur=$mysoc;
|
||||
if (! $this->emetteur->pays_code) $this->emetteur->pays_code=substr($langs->defaultlang,-2); // Par defaut, si on trouve pas
|
||||
if (! $this->emetteur->pays_code) $this->emetteur->pays_code=substr($langs->defaultlang,-2); // Par defaut, si n'était pas défini
|
||||
|
||||
// Defini position des colonnes
|
||||
$this->posxdesc=$this->marge_gauche+1;
|
||||
@ -92,11 +92,11 @@ class pdf_propale_azur extends ModelePDFPropales
|
||||
$this->tva=array();
|
||||
$this->atleastoneratenotnull=0;
|
||||
$this->atleastonediscount=0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
\brief Fonction générant la propale sur le disque
|
||||
\param propale Objet propal
|
||||
\param propale Objet propal à générer (ou id si ancienne methode)
|
||||
\return int 1=ok, 0=ko
|
||||
*/
|
||||
function write_pdf_file($propale,$outputlangs='')
|
||||
@ -121,6 +121,7 @@ class pdf_propale_azur extends ModelePDFPropales
|
||||
$propale = new Propal($this->db,"",$id);
|
||||
$ret=$propale->fetch($id);
|
||||
}
|
||||
$deja_regle = "";
|
||||
|
||||
// Définition de $dir et $file
|
||||
if ($propale->specimen)
|
||||
@ -172,9 +173,9 @@ class pdf_propale_azur extends ModelePDFPropales
|
||||
}
|
||||
}
|
||||
|
||||
// Tete de page
|
||||
$this->_pagehead($pdf, $propale, 1, $outputlangs);
|
||||
|
||||
// Affiches lignes
|
||||
$pagenb = 1;
|
||||
$tab_top = 90;
|
||||
$tab_top_newpage = 50;
|
||||
@ -224,7 +225,7 @@ class pdf_propale_azur extends ModelePDFPropales
|
||||
{
|
||||
$prodser = new Product($this->db);
|
||||
$prodser->fetch($propale->lignes[$i]->fk_product);
|
||||
|
||||
|
||||
// On ajoute la ref
|
||||
if ($prodser->ref)
|
||||
{
|
||||
@ -275,7 +276,7 @@ class pdf_propale_azur extends ModelePDFPropales
|
||||
$pdf->SetXY ($this->posxup, $curY);
|
||||
$pdf->MultiCell(18, 4, price($propale->lignes[$i]->subprice), 0, 'R', 0);
|
||||
|
||||
// Quantit
|
||||
// Quantité
|
||||
$pdf->SetXY ($this->posxqty, $curY);
|
||||
$pdf->MultiCell(10, 4, $propale->lignes[$i]->qty, 0, 'R');
|
||||
|
||||
@ -299,13 +300,17 @@ class pdf_propale_azur extends ModelePDFPropales
|
||||
|
||||
$nexY+=2; // Passe espace entre les lignes
|
||||
|
||||
if ($nexY > 200 && $i < ($nblignes - 1))
|
||||
if ($nexY > ($tab_top+$tab_height) && $i < ($nblignes - 1))
|
||||
{
|
||||
//$this->_tableau($pdf, $tab_top, $tab_height + 20, $nexY, $outputlangs);
|
||||
if ($pagenb == 1)
|
||||
$this->_tableau($pdf, $tab_top, $nexY - $tab_top + 20, $nexY, $outputlangs);
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top, $nexY - $tab_top + 20, $nexY, $outputlangs);
|
||||
}
|
||||
else
|
||||
$this->_tableau($pdf, $tab_top_newpage, $nexY - $tab_top_newpage + 20, $nexY, $outputlangs);
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top_newpage, $nexY - $tab_top_newpage + 20, $nexY, $outputlangs);
|
||||
}
|
||||
|
||||
$this->_pagefoot($pdf,$outputlangs);
|
||||
|
||||
// Nouvelle page
|
||||
@ -319,138 +324,31 @@ class pdf_propale_azur extends ModelePDFPropales
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Affiche cadre tableau
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
//$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs);
|
||||
//$bottomlasttab=$tab_top + $tab_height + 1;
|
||||
|
||||
$this->_tableau($pdf, $tab_top, $nexY - $tab_top + 20, $nexY, $outputlangs);
|
||||
$bottomlasttab=$tab_top + $nexY - $tab_top + 20 + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
//$this->_tableau($pdf, $tab_top_newpage, $tab_height, $nexY, $outputlangs);
|
||||
//$bottomlasttab=$tab_top_newpage + $tab_height + 1;
|
||||
$this->_tableau($pdf, $tab_top_newpage, $nexY - $tab_top_newpage + 20, $nexY, $outputlangs);
|
||||
$bottomlasttab=$tab_top_newpage + $nexY - $tab_top_newpage + 20 + 1;
|
||||
}
|
||||
|
||||
$deja_regle = "";
|
||||
// Affiche zone infos
|
||||
$posy=$this->_tableau_info($pdf, $propale, $bottomlasttab, $outputlangs);
|
||||
|
||||
// Affiche zone totaux
|
||||
$posy=$this->_tableau_tot($pdf, $propale, $deja_regle, $bottomlasttab, $outputlangs);
|
||||
|
||||
// Affiche zone versements
|
||||
if ($deja_regle) {
|
||||
$this->_tableau_versements($pdf, $fac, $posy, $outputlangs);
|
||||
$posy=$this->_tableau_versements($pdf, $propale, $posy, $outputlangs);
|
||||
}
|
||||
|
||||
/*
|
||||
* Mode de règlement
|
||||
*/
|
||||
/*
|
||||
if (! $conf->global->FACTURE_CHQ_NUMBER && ! $conf->global->FACTURE_RIB_NUMBER)
|
||||
{
|
||||
$pdf->SetXY ($this->marge_gauche, 228);
|
||||
$pdf->SetTextColor(200,0,0);
|
||||
$pdf->SetFont('Arial','B',8);
|
||||
$pdf->MultiCell(90, 3, $outputlangs->trans("ErrorNoPaiementModeConfigured"),0,'L',0);
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
* Propose mode règlement par CHQ
|
||||
*/
|
||||
/*
|
||||
if ($conf->global->FACTURE_CHQ_NUMBER)
|
||||
{
|
||||
if ($conf->global->FACTURE_CHQ_NUMBER > 0)
|
||||
{
|
||||
$account = new Account($this->db);
|
||||
$account->fetch(FACTURE_CHQ_NUMBER);
|
||||
|
||||
$pdf->SetXY ($this->marge_gauche, 227);
|
||||
$pdf->SetFont('Arial','B',8);
|
||||
$pdf->MultiCell(90, 3, "Règlement par chèque à l'ordre de ".$account->proprio." envoyé à:",0,'L',0);
|
||||
$pdf->SetXY ($this->marge_gauche, 231);
|
||||
$pdf->SetFont('Arial','',8);
|
||||
$pdf->MultiCell(80, 3, $account->adresse_proprio, 0, 'L', 0);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
* Propose mode règlement par RIB
|
||||
*/
|
||||
/*
|
||||
if ($conf->global->FACTURE_RIB_NUMBER)
|
||||
{
|
||||
if ($conf->global->FACTURE_RIB_NUMBER > 0)
|
||||
{
|
||||
$account = new Account($this->db);
|
||||
$account->fetch(FACTURE_RIB_NUMBER);
|
||||
|
||||
$this->marges['g']=$this->marge_gauche;
|
||||
|
||||
$cury=242;
|
||||
$pdf->SetXY ($this->marges['g'], $cury);
|
||||
$pdf->SetFont('Arial','B',8);
|
||||
$pdf->MultiCell(90, 3, "Règlement par virement sur le compte bancaire suivant:", 0, 'L', 0);
|
||||
$cury+=4;
|
||||
$pdf->SetFont('Arial','B',6);
|
||||
$pdf->line($this->marges['g']+1, $cury, $this->marges['g']+1, $cury+10 );
|
||||
$pdf->SetXY ($this->marges['g'], $cury);
|
||||
$pdf->MultiCell(18, 3, "Code banque", 0, 'C', 0);
|
||||
$pdf->line($this->marges['g']+18, $cury, $this->marges['g']+18, $cury+10 );
|
||||
$pdf->SetXY ($this->marges['g']+18, $cury);
|
||||
$pdf->MultiCell(18, 3, "Code guichet", 0, 'C', 0);
|
||||
$pdf->line($this->marges['g']+36, $cury, $this->marges['g']+36, $cury+10 );
|
||||
$pdf->SetXY ($this->marges['g']+36, $cury);
|
||||
$pdf->MultiCell(24, 3, "Numéro compte", 0, 'C', 0);
|
||||
$pdf->line($this->marges['g']+60, $cury, $this->marges['g']+60, $cury+10 );
|
||||
$pdf->SetXY ($this->marges['g']+60, $cury);
|
||||
$pdf->MultiCell(13, 3, "Clé RIB", 0, 'C', 0);
|
||||
$pdf->line($this->marges['g']+73, $cury, $this->marges['g']+73, $cury+10 );
|
||||
|
||||
$pdf->SetFont('Arial','',8);
|
||||
$pdf->SetXY ($this->marges['g'], $cury+5);
|
||||
$pdf->MultiCell(18, 3, $account->code_banque, 0, 'C', 0);
|
||||
$pdf->SetXY ($this->marges['g']+18, $cury+5);
|
||||
$pdf->MultiCell(18, 3, $account->code_guichet, 0, 'C', 0);
|
||||
$pdf->SetXY ($this->marges['g']+36, $cury+5);
|
||||
$pdf->MultiCell(24, 3, $account->number, 0, 'C', 0);
|
||||
$pdf->SetXY ($this->marges['g']+60, $cury+5);
|
||||
$pdf->MultiCell(13, 3, $account->cle_rib, 0, 'C', 0);
|
||||
|
||||
$pdf->SetXY ($this->marges['g'], $cury+12);
|
||||
$pdf->MultiCell(90, 3, "Domiciliation : " . $account->domiciliation, 0, 'L', 0);
|
||||
$pdf->SetXY ($this->marges['g'], $cury+22);
|
||||
$pdf->MultiCell(90, 3, "Prefix IBAN : " . $account->iban_prefix, 0, 'L', 0);
|
||||
$pdf->SetXY ($this->marges['g'], $cury+25);
|
||||
$pdf->MultiCell(90, 3, "BIC : " . $account->bic, 0, 'L', 0);
|
||||
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
* Conditions de règlements
|
||||
*/
|
||||
if ($propale->cond_reglement_code)
|
||||
{
|
||||
$pdf->SetFont('Arial','B',8);
|
||||
$pdf->SetXY($this->marge_gauche, 217);
|
||||
$titre = $outputlangs->trans("PaymentConditions").':';
|
||||
$pdf->MultiCell(80, 5, $titre, 0, 'L');
|
||||
$pdf->SetFont('Arial','',8);
|
||||
$pdf->SetXY(50, 217);
|
||||
$lib_condition_paiement=$outputlangs->trans("PaymentCondition".$propale->cond_reglement_code)?$outputlangs->trans("PaymentCondition".$propale->cond_reglement_code):$propale->cond_reglement;
|
||||
$pdf->MultiCell(80, 5, $lib_condition_paiement,0,'L');
|
||||
}
|
||||
|
||||
/*
|
||||
* Pied de page
|
||||
*/
|
||||
// Pied de page
|
||||
$this->_pagefoot($pdf, $outputlangs);
|
||||
$pdf->AliasNbPages();
|
||||
|
||||
@ -481,25 +379,182 @@ class pdf_propale_azur extends ModelePDFPropales
|
||||
}
|
||||
|
||||
/*
|
||||
* \brief Affiche le total à payer
|
||||
* \param pdf Objet PDF
|
||||
* \param prop Objet propale
|
||||
* \param deja_regle Montant deja regle
|
||||
* \return y Position pour suite
|
||||
* \brief Affiche tableau des versement
|
||||
* \param pdf objet PDF
|
||||
* \param propale objet propale
|
||||
*/
|
||||
function _tableau_versements(&$pdf, $propale, $posy, $outputlangs)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* \brief Affiche infos divers
|
||||
* \param pdf Objet PDF
|
||||
* \param propale Objet propale
|
||||
* \param posy Position depart
|
||||
* \param outputlangs Objet langs
|
||||
* \return y Position pour suite
|
||||
*/
|
||||
function _tableau_info(&$pdf, $propale, $posy, $outputlangs)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$pdf->SetFont('Arial','', 9);
|
||||
|
||||
/*
|
||||
* Affiche la mention TVA non applicable selon option
|
||||
*/
|
||||
if ($this->franchise == 1)
|
||||
{
|
||||
$pdf->SetFont('Arial','B',8);
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->trans("VATIsNotUsedForInvoice"), 0, 'L', 0);
|
||||
|
||||
$posy=$pdf->GetY()+4;
|
||||
}
|
||||
|
||||
/*
|
||||
* Conditions de règlements
|
||||
*/
|
||||
if ($propal->cond_reglement_code || $propal->cond_reglement)
|
||||
{
|
||||
$pdf->SetFont('Arial','B',8);
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
$titre = $outputlangs->trans("PaymentConditions").':';
|
||||
$pdf->MultiCell(80, 5, $titre, 0, 'L');
|
||||
|
||||
$pdf->SetFont('Arial','',8);
|
||||
$pdf->SetXY(50, $posy);
|
||||
$lib_condition_paiement=$outputlangs->trans("PaymentCondition".$propal->cond_reglement_code)!=('PaymentCondition'.$propal->cond_reglement_code)?$outputlangs->trans("PaymentCondition".$propal->cond_reglement_code):$propal->cond_reglement;
|
||||
$pdf->MultiCell(80, 5, $lib_condition_paiement,0,'L');
|
||||
|
||||
$posy=$pdf->GetY()+3;
|
||||
}
|
||||
|
||||
/*
|
||||
* Mode de règlement
|
||||
*/
|
||||
if (! $conf->global->FACTURE_CHQ_NUMBER && ! $conf->global->FACTURE_RIB_NUMBER)
|
||||
{
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
$pdf->SetTextColor(200,0,0);
|
||||
$pdf->SetFont('Arial','B',8);
|
||||
$pdf->MultiCell(90, 3, $outputlangs->trans("ErrorNoPaiementModeConfigured"),0,'L',0);
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
|
||||
$posy=$pdf->GetY()+1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Propose mode règlement par CHQ
|
||||
*/
|
||||
if ($conf->global->FACTURE_CHQ_NUMBER)
|
||||
{
|
||||
if ($conf->global->FACTURE_CHQ_NUMBER > 0)
|
||||
{
|
||||
$account = new Account($this->db);
|
||||
$account->fetch($conf->global->FACTURE_CHQ_NUMBER);
|
||||
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
$pdf->SetFont('Arial','B',8);
|
||||
$pdf->MultiCell(90, 3, $outputlangs->trans('PaymentByChequeOrderedTo',$account->proprio).':',0,'L',0);
|
||||
$posy=$pdf->GetY()+1;
|
||||
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
$pdf->SetFont('Arial','',8);
|
||||
$pdf->MultiCell(80, 3, $account->adresse_proprio, 0, 'L', 0);
|
||||
|
||||
$posy=$pdf->GetY()+2;
|
||||
}
|
||||
if ($conf->global->FACTURE_CHQ_NUMBER == -1)
|
||||
{
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
$pdf->SetFont('Arial','B',8);
|
||||
$pdf->MultiCell(90, 3, $outputlangs->trans('PaymentByChequeOrderedToShort').' '.$this->emetteur->nom.' '.$outputlangs->trans('SendTo').':',0,'L',0);
|
||||
$posy=$pdf->GetY()+1;
|
||||
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
$pdf->SetFont('Arial','',8);
|
||||
$pdf->MultiCell(80, 6, $this->emetteur->adresse_full, 0, 'L', 0);
|
||||
|
||||
$posy=$pdf->GetY()+2;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Propose mode règlement par RIB
|
||||
*/
|
||||
if ($conf->global->FACTURE_RIB_NUMBER)
|
||||
{
|
||||
if ($conf->global->FACTURE_RIB_NUMBER)
|
||||
{
|
||||
$account = new Account($this->db);
|
||||
$account->fetch($conf->global->FACTURE_RIB_NUMBER);
|
||||
|
||||
$this->marges['g']=$this->marge_gauche;
|
||||
|
||||
$cury=$posy;
|
||||
$pdf->SetXY ($this->marges['g'], $cury);
|
||||
$pdf->SetFont('Arial','B',8);
|
||||
$pdf->MultiCell(90, 3, $outputlangs->trans('PaymentByTransferOnThisBankAccount').':', 0, 'L', 0);
|
||||
$cury+=4;
|
||||
$pdf->SetFont('Arial','B',6);
|
||||
$pdf->line($this->marges['g']+1, $cury, $this->marges['g']+1, $cury+10 );
|
||||
$pdf->SetXY ($this->marges['g'], $cury);
|
||||
$pdf->MultiCell(18, 3, $outputlangs->trans("BankCode"), 0, 'C', 0);
|
||||
$pdf->line($this->marges['g']+18, $cury, $this->marges['g']+18, $cury+10 );
|
||||
$pdf->SetXY ($this->marges['g']+18, $cury);
|
||||
$pdf->MultiCell(18, 3, $outputlangs->trans("DeskCode"), 0, 'C', 0);
|
||||
$pdf->line($this->marges['g']+36, $cury, $this->marges['g']+36, $cury+10 );
|
||||
$pdf->SetXY ($this->marges['g']+36, $cury);
|
||||
$pdf->MultiCell(24, 3, $outputlangs->trans("BankAccountNumber"), 0, 'C', 0);
|
||||
$pdf->line($this->marges['g']+60, $cury, $this->marges['g']+60, $cury+10 );
|
||||
$pdf->SetXY ($this->marges['g']+60, $cury);
|
||||
$pdf->MultiCell(13, 3, $outputlangs->trans("BankAccountNumberKey"), 0, 'C', 0);
|
||||
$pdf->line($this->marges['g']+73, $cury, $this->marges['g']+73, $cury+10 );
|
||||
|
||||
$pdf->SetFont('Arial','',8);
|
||||
$pdf->SetXY ($this->marges['g'], $cury+5);
|
||||
$pdf->MultiCell(18, 3, $account->code_banque, 0, 'C', 0);
|
||||
$pdf->SetXY ($this->marges['g']+18, $cury+5);
|
||||
$pdf->MultiCell(18, 3, $account->code_guichet, 0, 'C', 0);
|
||||
$pdf->SetXY ($this->marges['g']+36, $cury+5);
|
||||
$pdf->MultiCell(24, 3, $account->number, 0, 'C', 0);
|
||||
$pdf->SetXY ($this->marges['g']+60, $cury+5);
|
||||
$pdf->MultiCell(13, 3, $account->cle_rib, 0, 'C', 0);
|
||||
|
||||
$pdf->SetXY ($this->marges['g'], $cury+12);
|
||||
$pdf->MultiCell(90, 3, $outputlangs->trans("Residence").' : ' . $account->domiciliation, 0, 'L', 0);
|
||||
$pdf->SetXY ($this->marges['g'], $cury+22);
|
||||
$pdf->MultiCell(90, 3, $outputlangs->trans("IbanPrefix").' : ' . $account->iban_prefix, 0, 'L', 0);
|
||||
$pdf->SetXY ($this->marges['g'], $cury+25);
|
||||
$pdf->MultiCell(90, 3, $outputlangs->trans("BIC").' : ' . $account->bic, 0, 'L', 0);
|
||||
|
||||
$posy=$pdf->GetY()+2;
|
||||
}
|
||||
}
|
||||
|
||||
return $posy;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* \brief Affiche le total à payer
|
||||
* \param pdf Objet PDF
|
||||
* \param prop Objet propale
|
||||
* \param deja_regle Montant deja regle
|
||||
* \param posy Position depart
|
||||
* \param outputlangs Objet langs
|
||||
* \return y Position pour suite
|
||||
*/
|
||||
function _tableau_tot(&$pdf, $propale, $deja_regle, $posy, $outputlangs)
|
||||
{
|
||||
$tab2_top = $posy;
|
||||
$tab2_hl = 5;
|
||||
$tab2_height = $tab2_hl * 4;
|
||||
$pdf->SetFont('Arial','', 9);
|
||||
|
||||
// Affiche la mention TVA non applicable selon option
|
||||
$pdf->SetXY ($this->marge_gauche, $tab2_top + 0);
|
||||
if ($this->franchise==1)
|
||||
{
|
||||
$pdf->MultiCell(100, $tab2_hl, "* TVA non applicable art-293B du CGI", 0, 'L', 0);
|
||||
}
|
||||
$pdf->SetFont('Arial','', 8);
|
||||
|
||||
// Tableau total
|
||||
$lltot = 200; $col1x = 120; $col2x = 182; $largcol2 = $lltot - $col2x;
|
||||
@ -571,7 +626,6 @@ class pdf_propale_azur extends ModelePDFPropales
|
||||
|
||||
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($propale->total_ttc), $useborder, 'R', 1);
|
||||
$pdf->SetFont('Arial','', 9);
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
|
||||
if ($deja_regle > 0)
|
||||
@ -584,14 +638,31 @@ class pdf_propale_azur extends ModelePDFPropales
|
||||
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle), 0, 'R', 0);
|
||||
|
||||
$resteapayer = $propal->total_ttc - $deja_regle;
|
||||
if ($propal->paye) $resteapayer=0;
|
||||
|
||||
if ($propal->close_code == 'escompte')
|
||||
{
|
||||
$index++;
|
||||
$pdf->SetFillColor(256,256,256);
|
||||
|
||||
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->trans("EscompteOffered"), $useborder, 'L', 1);
|
||||
|
||||
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($propal->total_ttc - $deja_regle), $useborder, 'R', 1);
|
||||
}
|
||||
|
||||
$index++;
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
//$pdf->SetFont('Arial','B', 9);
|
||||
$pdf->SetFillColor(224,224,224);
|
||||
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->trans("RemainderToPay"), $useborder, 'L', 1);
|
||||
|
||||
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($propale->total_ttc - $deja_regle), $useborder, 'R', 1);
|
||||
|
||||
// Fin
|
||||
$pdf->SetFont('Arial','', 9);
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
}
|
||||
@ -607,7 +678,7 @@ class pdf_propale_azur extends ModelePDFPropales
|
||||
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
|
||||
// Montants exprimés en (en tab_top - 1)
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->SetFont('Arial','',8);
|
||||
@ -619,9 +690,9 @@ class pdf_propale_azur extends ModelePDFPropales
|
||||
// Rect prend une longueur en 3eme param
|
||||
$pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height);
|
||||
// line prend une position y en 3eme param
|
||||
$pdf->line($this->marge_gauche, $tab_top+6, $this->page_largeur-$this->marge_droite, $tab_top+6);
|
||||
$pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5);
|
||||
|
||||
$pdf->SetFont('Arial','',10);
|
||||
$pdf->SetFont('Arial','',9);
|
||||
|
||||
$pdf->SetXY ($this->posxdesc-1, $tab_top+2);
|
||||
$pdf->MultiCell(108,2, $outputlangs->trans("Designation"),'','L');
|
||||
@ -708,18 +779,18 @@ class pdf_propale_azur extends ModelePDFPropales
|
||||
$pdf->SetXY(100,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell(100, 4, $outputlangs->trans("Ref")." : " . $propale->ref, '', 'R');
|
||||
|
||||
$pdf->SetFont('Arial','',12);
|
||||
|
||||
$pdf->SetFont('Arial','',10);
|
||||
|
||||
$posy+=6;
|
||||
$pdf->SetXY(100,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell(100, 4, $outputlangs->trans("Date")." : " . dolibarr_print_date($propale->date,"%d %b %Y"), '', 'R');
|
||||
$pdf->MultiCell(100, 3, $outputlangs->trans("Date")." : " . dolibarr_print_date($propale->date,"%d %b %Y"), '', 'R');
|
||||
|
||||
$posy+=6;
|
||||
$posy+=5;
|
||||
$pdf->SetXY(100,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell(100, 4, $outputlangs->trans("DateEndPropal")." : " . dolibarr_print_date($propale->fin_validite,"%d %b %Y"), '', 'R');
|
||||
$pdf->MultiCell(100, 3, $outputlangs->trans("DateEndPropal")." : " . dolibarr_print_date($propale->fin_validite,"%d %b %Y"), '', 'R');
|
||||
|
||||
if ($showadress)
|
||||
{
|
||||
@ -803,6 +874,7 @@ class pdf_propale_azur extends ModelePDFPropales
|
||||
*/
|
||||
function _pagefoot(&$pdf,$outputlangs)
|
||||
{
|
||||
global $conf;
|
||||
$html=new Form($this->db);
|
||||
|
||||
// Premiere ligne d'info réglementaires
|
||||
@ -875,7 +947,7 @@ class pdf_propale_azur extends ModelePDFPropales
|
||||
function _dol_htmlentities($stringtoencode,$isstringalreadyhtml)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
|
||||
if ($isstringalreadyhtml) return $stringtoencode;
|
||||
if ($conf->fckeditor->enabled) return htmlentities($stringtoencode);
|
||||
return $stringtoencode;
|
||||
|
||||
@ -193,7 +193,7 @@ if ($_POST["action"] == "set")
|
||||
$dir[4] = "$main_data_dir/ficheinter";
|
||||
$dir[5] = "$main_data_dir/produit";
|
||||
$dir[6] = "$main_data_dir/rapport";
|
||||
$dir[7] = "$main_data_dir/rsscache";
|
||||
$dir[7] = "$main_data_dir/rss";
|
||||
$dir[8] = "$main_data_dir/logo";
|
||||
|
||||
// Boucle sur chaque répertoire de dir[] pour les créer s'ils nexistent pas
|
||||
|
||||
@ -127,7 +127,7 @@ if (isset($_POST['action']) && $_POST['action'] == 'upgrade')
|
||||
// Les autres path
|
||||
if (! defined('FPDF_FONTPATH')) { define('FPDF_FONTPATH', FPDF_PATH . 'font/'); }
|
||||
if (! defined('MAGPIE_DIR')) { define('MAGPIE_DIR', MAGPIERSS_PATH); }
|
||||
if (! defined('MAGPIE_CACHE_DIR')) { define('MAGPIE_CACHE_DIR', DOL_DATA_ROOT .'/rsscache'); }
|
||||
if (! defined('MAGPIE_CACHE_DIR')) { define('MAGPIE_CACHE_DIR', DOL_DATA_ROOT .'/rss/temp'); }
|
||||
|
||||
|
||||
/***************************************************************************************
|
||||
|
||||
@ -82,9 +82,13 @@ OtherBills=Other invoices
|
||||
DraftBills=Draft invoices
|
||||
Unpayed=Unpayed
|
||||
ConfirmDeleteBill=Are you sure you want to delete this invoice ?
|
||||
ConfirmValidateBill=Are you sure you want to validate this invoice with reference %s ?
|
||||
ConfirmClassifyPayedBill=Are you sure you want to change invoice %s to status payed ?
|
||||
ConfirmCancelBill=Are you sure you want to cancel invoice %s ?
|
||||
ConfirmValidateBill=Are you sure you want to validate this invoice with reference <b>%s</b> ?
|
||||
ConfirmClassifyPayedBill=Are you sure you want to change invoice <b>%s</b> to status payed ?
|
||||
ConfirmCancelBill=Are you sure you want to cancel invoice <b>%s</b> ?
|
||||
ConfirmClassifyPayedPartially=Are you sure you want to change invoice <b>%s</b> to status payed ?
|
||||
ConfirmClassifyPayedPartiallyquestion=This invoice has not been payed completely. What are reasons for you to close this invoice ?
|
||||
ConfirmClassifyPayedPartiallyReasonEscompte=Remainder to pay <b>(%s %s)</b> is a discount granted because payment was made before term
|
||||
ConfirmClassifyPayedPartiallyReasonOther=Other
|
||||
ValidateBill=Validate invoice
|
||||
NumberOfBills=Nb of invoices
|
||||
NumberOfBillsByMonth=Nb of invoices by month
|
||||
@ -94,6 +98,7 @@ File=File
|
||||
AlreadyPayed=Already payed
|
||||
RemainderToPay=Remainder to pay
|
||||
RemainderToTake=Remainder to take
|
||||
EscompteOffered=Discount offered (payment before term)
|
||||
CreateDraft=Create draft
|
||||
SendBillRef=Send invoice %s
|
||||
SendReminderBillRef=Send invoice %s (reminder)
|
||||
|
||||
@ -329,6 +329,7 @@ Undo=Undo
|
||||
Redo=Redo
|
||||
ExpandAll=Expand all
|
||||
UndoExpandAll=Undo expand
|
||||
Reason=Raison
|
||||
# Countries
|
||||
CountryFR=France
|
||||
CountryBE=Belgium
|
||||
|
||||
@ -82,9 +82,13 @@ OtherBills=Autres factures
|
||||
DraftBills=Factures brouillons
|
||||
Unpayed=Impayées
|
||||
ConfirmDeleteBill=Êtes-vous sûr de vouloir supprimer cette facture ?
|
||||
ConfirmValidateBill=Êtes-vous sûr de vouloir valider cette facture sous la référence %s ?
|
||||
ConfirmClassifyPayedBill=Êtes-vous sûr de vouloir classer la facture %s comme payée ?
|
||||
ConfirmCancelBill=Êtes-vous sûr de vouloir annuler la facture %s ?
|
||||
ConfirmValidateBill=Êtes-vous sûr de vouloir valider cette facture sous la référence <b>%s</b> ?
|
||||
ConfirmClassifyPayedBill=Êtes-vous sûr de vouloir classer la facture <b>%s</b> comme payée ?
|
||||
ConfirmCancelBill=Êtes-vous sûr de vouloir annuler la facture <b>%s</b> ?
|
||||
ConfirmClassifyPayedPartially=Êtes-vous sûr de vouloir classer la facture <b>%s</b> comme payée ?
|
||||
ConfirmClassifyPayedPartiallyQuestion=Cette facture n'a pas été payée complètement. Pour quelle raison voulez-vous la classer magré tout ?
|
||||
ConfirmClassifyPayedPartiallyReasonEscompte=Le reste à payer <b>(%s %s)</b> est un escompte accordé pour motif de paiement avant échéance
|
||||
ConfirmClassifyPayedPartiallyReasonOther=Autre
|
||||
ValidateBill=Valider facture
|
||||
NumberOfBills=Nb de factures
|
||||
NumberOfBillsByMonth=Nb de factures par mois
|
||||
@ -94,6 +98,7 @@ File=Fichier
|
||||
AlreadyPayed=Déjà réglé
|
||||
RemainderToPay=Reste à payer
|
||||
RemainderToTake=Reste à encaisser
|
||||
EscompteOffered=Escompte (paiement avant échéance)
|
||||
CreateDraft=Créer brouillon
|
||||
SendBillRef=Envoi facture %s
|
||||
SendReminderBillRef=Relance facture %s
|
||||
|
||||
@ -329,6 +329,7 @@ Undo=Annuler
|
||||
Redo=Refaire
|
||||
ExpandAll=Tout dérouler
|
||||
UndoExpandAll=Annuler déroulement
|
||||
Reason=Raison
|
||||
# Countries
|
||||
CountryFR=France
|
||||
CountryBE=Belgique
|
||||
|
||||
@ -238,22 +238,6 @@ class Livraison extends CommonObject
|
||||
$this->modelpdf = $obj->model_pdf;
|
||||
$this->db->free();
|
||||
|
||||
if ($this->user_author_id)
|
||||
{
|
||||
$sql = "SELECT name, firstname";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."user";
|
||||
$sql.= " WHERE rowid = ".$this->user_author_id;
|
||||
|
||||
$resqluser = $this->db->query($sql);
|
||||
|
||||
if ($resqluser)
|
||||
{
|
||||
$obju = $this->db->fetch_object($resqluser);
|
||||
$this->user_author_name = $obju->name;
|
||||
$this->user_author_firstname = $obju->firstname;
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->statut == 0) $this->brouillon = 1;
|
||||
|
||||
$file = $conf->livraison->dir_output . "/" .get_exdir($livraison->id) . "/" . $this->id.".pdf";
|
||||
|
||||
@ -170,7 +170,7 @@ if (! defined('TCPDF_PATH')) { define('TCPDF_PATH', DOL_DOCUMEN
|
||||
// Les autres path
|
||||
if (! defined('FPDF_FONTPATH')) { define('FPDF_FONTPATH', FPDF_PATH . 'font/'); }
|
||||
if (! defined('MAGPIE_DIR')) { define('MAGPIE_DIR', MAGPIERSS_PATH); }
|
||||
if (! defined('MAGPIE_CACHE_DIR')) { define('MAGPIE_CACHE_DIR', DOL_DATA_ROOT .'/rsscache'); }
|
||||
if (! defined('MAGPIE_CACHE_DIR')) { define('MAGPIE_CACHE_DIR', $conf->externalrss->dir_temp); }
|
||||
|
||||
// \todo Ajouter la ligne
|
||||
// require_once(DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php");
|
||||
|
||||
@ -814,22 +814,6 @@ class Propal extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->user_author_id)
|
||||
{
|
||||
$sql = "SELECT name, firstname";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."user";
|
||||
$sql.= " WHERE rowid = ".$this->user_author_id;
|
||||
|
||||
$resqluser = $this->db->query($sql);
|
||||
|
||||
if ($resqluser)
|
||||
{
|
||||
$obju = $this->db->fetch_object($resqluser);
|
||||
$this->user_author_name = $obju->name;
|
||||
$this->user_author_firstname = $obju->firstname;
|
||||
}
|
||||
}
|
||||
|
||||
if ($obj->fk_statut == 0)
|
||||
{
|
||||
$this->brouillon = 1;
|
||||
|
||||
@ -55,15 +55,15 @@ a:visited { font: verdana, arial, helvetica, sans-serif; font-weight: bold; colo
|
||||
a:active { font: verdana, arial, helvetica, sans-serif; font-weight: bold; color: #000000; text-decoration: none; }
|
||||
a:hover { font: verdana, arial, helvetica, sans-serif; font-weight: bold; color: #000000; text-decoration: none; }
|
||||
input
|
||||
{
|
||||
font: 12px helvetica, verdana, arial, sans-serif;
|
||||
{
|
||||
font: 12px helvetica, verdana, arial, sans-serif;
|
||||
background: #FDFDFD;
|
||||
border: 1px solid #ACBCBB;
|
||||
padding: 0px 0px 0px 0px;
|
||||
margin: 0px 0px 0px 0px;
|
||||
}
|
||||
input.flat
|
||||
{
|
||||
{
|
||||
font: 12px helvetica, verdana, arial, sans-serif;
|
||||
background: #FDFDFD;
|
||||
border: 1px solid #ACBCBB;
|
||||
@ -78,7 +78,7 @@ textarea {
|
||||
margin: 0px 0px 0px 0px;
|
||||
}
|
||||
textarea.flat
|
||||
{
|
||||
{
|
||||
font: 12px helvetica, verdana, arial, sans-serif;
|
||||
background: #FDFDFD;
|
||||
border: 1px solid #ACBCBB;
|
||||
@ -113,7 +113,7 @@ div.vmenuplusfiche
|
||||
top: auto;
|
||||
left: auto;
|
||||
position: static;
|
||||
float: left;
|
||||
float: left;
|
||||
display: block;
|
||||
margin-right: 6px;
|
||||
margin-left: 1px;
|
||||
@ -163,9 +163,9 @@ div.tmenu
|
||||
font-weight: bold;
|
||||
font-size: 12px;
|
||||
height: 19px;
|
||||
background: #b3c5cc;
|
||||
background: #b3c5cc;
|
||||
background-image : url(<?php echo $dolibarr_main_url_root.'/theme/eldy/img/tmenu.jpg' ?>);
|
||||
color: #000000;
|
||||
color: #000000;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
@ -193,7 +193,7 @@ a.tmenu:visited
|
||||
font-weight: bold;
|
||||
}
|
||||
a.tmenu#sel
|
||||
{
|
||||
{
|
||||
color: #234046;
|
||||
padding: 0px 8px 0px 8px;
|
||||
margin: 0px 0px 2px 0px;
|
||||
@ -282,7 +282,7 @@ div.blockvmenupair
|
||||
border-right: 1px solid #555555;
|
||||
border-bottom: 1px solid #555555;
|
||||
font: helvetica, verdana, arial, sans-serif;
|
||||
color: #000000;
|
||||
color: #000000;
|
||||
text-align:left;
|
||||
text-decoration: none;
|
||||
padding: 3px;
|
||||
@ -298,7 +298,7 @@ div.blockvmenuimpair
|
||||
border-right: 1px solid #555555;
|
||||
border-bottom: 1px solid #555555;
|
||||
font: helvetica, verdana, arial, sans-serif;
|
||||
color: #000000;
|
||||
color: #000000;
|
||||
text-align:left;
|
||||
text-decoration: none;
|
||||
padding: 3px;
|
||||
@ -315,7 +315,7 @@ div.help
|
||||
border-bottom: 1px solid #000000;
|
||||
background: #f0f0f0;
|
||||
font: helvetica, verdana, arial, sans-serif;
|
||||
color: #000000;
|
||||
color: #000000;
|
||||
text-align:left;
|
||||
text-decoration: none;
|
||||
padding: 3px;
|
||||
@ -323,23 +323,23 @@ div.help
|
||||
}
|
||||
|
||||
|
||||
td.barre {
|
||||
td.barre {
|
||||
border-right: 1px solid #000000;
|
||||
border-bottom: 1px solid #000000;
|
||||
background: #b3c5cc;
|
||||
font: helvetica, verdana, arial, sans-serif;
|
||||
color: #000000;
|
||||
color: #000000;
|
||||
text-align:left;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
td.barre_select {
|
||||
background: #b3c5cc;
|
||||
td.barre_select {
|
||||
background: #b3c5cc;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
td.photo {
|
||||
background: #F4F4F4;
|
||||
background: #F4F4F4;
|
||||
color: #000000;
|
||||
border: 1px solid #b3c5cc;
|
||||
}
|
||||
@ -361,7 +361,7 @@ div.formsearch
|
||||
background: #d0d4d7;
|
||||
top: 0px;
|
||||
left: 130px;
|
||||
padding: 4px;
|
||||
padding: 4px;
|
||||
vertical-align: middle;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
@ -414,7 +414,7 @@ div.onglet_inf
|
||||
font-weight:bold;
|
||||
font-size: 12px;
|
||||
height: 19px;
|
||||
color: #000000;
|
||||
color: #000000;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
@ -517,52 +517,52 @@ a.tabimage {
|
||||
|
||||
a.butAction:link { font: 12px helvetica, verdana, arial, sans-serif;
|
||||
font-weight: bold;
|
||||
background: white;
|
||||
border: 1px solid #8CACBB;
|
||||
color: #436976;
|
||||
padding: 0em 0.7em;
|
||||
margin: 0em 0.5em;
|
||||
text-decoration: none;
|
||||
white-space: nowrap; }
|
||||
|
||||
a.butAction:visited { font: 12px helvetica, verdana, arial, sans-serif;
|
||||
font-weight: bold;
|
||||
background: white;
|
||||
border: 1px solid #8CACBB;
|
||||
color: #436976;
|
||||
padding: 0em 0.7em;
|
||||
margin: 0em 0.5em;
|
||||
text-decoration: none;
|
||||
white-space: nowrap; }
|
||||
|
||||
a.butAction:active { font: 12px helvetica, verdana, arial, sans-serif;
|
||||
font-weight: bold;
|
||||
background: white;
|
||||
border: 1px solid #8CACBB;
|
||||
background: white;
|
||||
border: 1px solid #8CACBB;
|
||||
color: #436976;
|
||||
padding: 0em 0.7em;
|
||||
margin: 0em 0.5em;
|
||||
text-decoration: none;
|
||||
padding: 0em 0.7em;
|
||||
margin: 0em 0.5em;
|
||||
text-decoration: none;
|
||||
white-space: nowrap; }
|
||||
|
||||
a.butAction:hover { font: 12px helvetica, verdana, arial, sans-serif;
|
||||
a.butAction:visited { font: 12px helvetica, verdana, arial, sans-serif;
|
||||
font-weight: bold;
|
||||
background: #dee7ec;
|
||||
border: 1px solid #8CACBB;
|
||||
color: #436976;
|
||||
padding: 0em 0.7em;
|
||||
margin: 0em 0.5em;
|
||||
text-decoration: none;
|
||||
background: white;
|
||||
border: 1px solid #8CACBB;
|
||||
color: #436976;
|
||||
padding: 0em 0.7em;
|
||||
margin: 0em 0.5em;
|
||||
text-decoration: none;
|
||||
white-space: nowrap; }
|
||||
|
||||
a.butAction:active { font: 12px helvetica, verdana, arial, sans-serif;
|
||||
font-weight: bold;
|
||||
background: white;
|
||||
border: 1px solid #8CACBB;
|
||||
color: #436976;
|
||||
padding: 0em 0.7em;
|
||||
margin: 0em 0.5em;
|
||||
text-decoration: none;
|
||||
white-space: nowrap; }
|
||||
|
||||
a.butAction:hover { font: 12px helvetica, verdana, arial, sans-serif;
|
||||
font-weight: bold;
|
||||
background: #dee7ec;
|
||||
border: 1px solid #8CACBB;
|
||||
color: #436976;
|
||||
padding: 0em 0.7em;
|
||||
margin: 0em 0.5em;
|
||||
text-decoration: none;
|
||||
white-space: nowrap; }
|
||||
|
||||
a.butActionRefuse { font: 12px helvetica, verdana, arial, sans-serif;
|
||||
font-weight: bold;
|
||||
background: white;
|
||||
border: 1px solid red;
|
||||
color: #436976;
|
||||
padding: 0em 0.7em;
|
||||
margin: 0em 0.5em;
|
||||
text-decoration: none;
|
||||
background: white;
|
||||
border: 1px solid red;
|
||||
color: #436976;
|
||||
padding: 0em 0.7em;
|
||||
margin: 0em 0.5em;
|
||||
text-decoration: none;
|
||||
white-space: nowrap; }
|
||||
|
||||
a.butActionRefuse:hover { font: 12px helvetica, verdana, arial, sans-serif;
|
||||
@ -572,12 +572,12 @@ a.butActionRefuse:hover { font: 12px helvetica, verdana, arial, sans-serif;
|
||||
|
||||
a.butActionDelete { font: 12px helvetica, verdana, arial, sans-serif;
|
||||
font-weight: bold;
|
||||
background: white;
|
||||
border: 1px solid red;
|
||||
color: #436976;
|
||||
padding: 0em 0.7em;
|
||||
margin: 0em 0.5em;
|
||||
text-decoration: none;
|
||||
background: white;
|
||||
border: 1px solid red;
|
||||
color: #436976;
|
||||
padding: 0em 0.7em;
|
||||
margin: 0em 0.5em;
|
||||
text-decoration: none;
|
||||
white-space: nowrap; }
|
||||
|
||||
a.butActionDelete:link { font: 12px helvetica, verdana, arial, sans-serif; font-weight: bold; background: white; border: 1px solid #997777; color: #436976; padding: 0em 0.7em; margin: 0em 0.5em; text-decoration: none; white-space: nowrap; }
|
||||
@ -592,13 +592,13 @@ a.tabAction:link { font: 12px helvetica, verdana, arial, sans-serif; font-wei
|
||||
a.tabAction:visited { font: 12px helvetica, verdana, arial, sans-serif; font-weight: bold; background: white; border: 1px solid #8CACBB; color: #436976; padding: 0em 0.7em; margin: 0em 0.5em; text-decoration: none; white-space: nowrap; }
|
||||
a.tabAction:active { font: 12px helvetica, verdana, arial, sans-serif; font-weight: bold; background: white; border: 1px solid #8CACBB; color: #436976; padding: 0em 0.7em; margin: 0em 0.5em; text-decoration: none; white-space: nowrap; }
|
||||
a.tabAction:hover { font: 12px helvetica, verdana, arial, sans-serif; font-weight: bold; background: #dee7ec; border: 1px solid #8CACBB; color: #436976; padding: 0em 0.7em; margin: 0em 0.5em; text-decoration: none; white-space: nowrap; }
|
||||
|
||||
|
||||
a.butDelete:link { font: 12px helvetica, verdana, arial, sans-serif; font-weight: bold; background: white; border: 1px solid #997777; color: #436976; padding: 0em 0.7em; margin: 0em 0.5em; text-decoration: none; white-space: nowrap; }
|
||||
a.butDelete:active { font: 12px helvetica, verdana, arial, sans-serif; font-weight: bold; background: white; border: 1px solid #997777; color: #436976; padding: 0em 0.7em; margin: 0em 0.5em; text-decoration: none; white-space: nowrap; }
|
||||
a.butDelete:visited { font: 12px helvetica, verdana, arial, sans-serif; font-weight: bold; background: white; border: 1px solid #997777; color: #436976; padding: 0em 0.7em; margin: 0em 0.5em; text-decoration: none; white-space: nowrap; }
|
||||
a.butDelete:hover { font: 12px helvetica, verdana, arial, sans-serif; font-weight: bold; background: #FFe7ec; border: 1px solid #997777; color: #436976; padding: 0em 0.7em; margin: 0em 0.5em; text-decoration: none; white-space: nowrap; }
|
||||
|
||||
|
||||
|
||||
/* ============================================================================== */
|
||||
/* Tables */
|
||||
/* ============================================================================== */
|
||||
@ -659,7 +659,7 @@ border-collapse: collapse;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
tr.liste_titre {
|
||||
tr.liste_titre {
|
||||
background: #7699A9;
|
||||
background-image : url(<?php echo $dolibarr_main_url_root.'/theme/eldy/img/liste_titre.png' ?>);
|
||||
color: #334444;
|
||||
@ -668,7 +668,7 @@ font-weight: bold;
|
||||
border-bottom: 1px solid #FDFFFF;
|
||||
white-space: nowrap;
|
||||
}
|
||||
td.liste_titre {
|
||||
td.liste_titre {
|
||||
background: #7699A9;
|
||||
background-image : url(<?php echo $dolibarr_main_url_root.'/theme/eldy/img/liste_titre.png' ?>);
|
||||
color: #334444;
|
||||
@ -678,29 +678,29 @@ border-bottom: 1px solid #FDFFFF;
|
||||
white-space: nowrap;
|
||||
}
|
||||
td.liste_titre_sel
|
||||
{
|
||||
{
|
||||
background: #7699A9;
|
||||
background-image : url(<?php echo $dolibarr_main_url_root.'/theme/eldy/img/liste_titre.png' ?>);
|
||||
color: #F5FFFF;
|
||||
color: #F5FFFF;
|
||||
font: helvetica, verdana, arial, sans-serif;
|
||||
font-weight: bold;
|
||||
font-weight: bold;
|
||||
border-bottom: 1px solid #FDFFFF;
|
||||
white-space: nowrap;
|
||||
}
|
||||
input.liste_titre {
|
||||
input.liste_titre {
|
||||
background: #7699A9;
|
||||
background-image : url(<?php echo $dolibarr_main_url_root.'/theme/eldy/img/liste_titre.png' ?>);
|
||||
border: 0px;
|
||||
}
|
||||
|
||||
tr.liste_total td {
|
||||
tr.liste_total td {
|
||||
border-top: 1px solid #888888;
|
||||
background: #F4F4F4;
|
||||
font-weight: bold;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
th {
|
||||
th {
|
||||
background: #7699A9;
|
||||
color: #334444;
|
||||
font: helvetica, verdana, arial, sans-serif;
|
||||
@ -712,32 +712,32 @@ border-bottom: 1px solid #FFFFFF;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
td.border {
|
||||
td.border {
|
||||
border-top: 1px solid #000000;
|
||||
border-right: 1px solid #000000;
|
||||
border-bottom: 1px solid #000000;
|
||||
border-left: 1px solid #000000;
|
||||
}
|
||||
|
||||
.pair {
|
||||
background: #e6ebed;
|
||||
.pair {
|
||||
background: #e6ebed;
|
||||
font: helvetica, verdana, arial, sans-serif;
|
||||
border: 0px;
|
||||
}
|
||||
/*
|
||||
.pair:hover {
|
||||
.pair:hover {
|
||||
background: #c0c4c7;
|
||||
border: 0px;
|
||||
}
|
||||
*/
|
||||
|
||||
.impair {
|
||||
.impair {
|
||||
background: #d0d4d7;
|
||||
font: helvetica, verdana, arial, sans-serif;
|
||||
border: 0px;
|
||||
}
|
||||
/*
|
||||
.impair:hover {
|
||||
.impair:hover {
|
||||
background: #c0c4c7;
|
||||
border: 0px;
|
||||
}
|
||||
@ -746,7 +746,7 @@ border: 0px;
|
||||
/*
|
||||
* Boxes
|
||||
*/
|
||||
tr.box_titre {
|
||||
tr.box_titre {
|
||||
background: #7699A9;
|
||||
background-image : url(<?php echo $dolibarr_main_url_root.'/theme/eldy/img/liste_titre.png' ?>);
|
||||
color: #334444;
|
||||
@ -756,17 +756,17 @@ border-bottom: 1px solid #FDFFFF;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
tr.box_impair {
|
||||
tr.box_impair {
|
||||
background: #e6ebed;
|
||||
font: 12px arial, helvetica, verdana, sans-serif;
|
||||
}
|
||||
|
||||
tr.box_pair {
|
||||
tr.box_pair {
|
||||
background: #d0d4d7;
|
||||
font: 12px arial, helvetica, verdana, sans-serif;
|
||||
}
|
||||
|
||||
tr.fiche {
|
||||
tr.fiche {
|
||||
font: helvetica, verdana, arial, sans-serif;
|
||||
}
|
||||
|
||||
@ -789,7 +789,7 @@ div.warning {
|
||||
}
|
||||
|
||||
div.error {
|
||||
color: #550000; font-weight: bold;
|
||||
color: #550000; font-weight: bold;
|
||||
padding: 0.2em 0.2em 0.2em 0.2em;
|
||||
margin: 0.5em 0em 0.5em 0em;
|
||||
border: 1px solid #8C9CAB;
|
||||
@ -807,7 +807,7 @@ div.info {
|
||||
* Liens Payes/Non payes
|
||||
*/
|
||||
|
||||
a.normal:link { font-weight: normal }
|
||||
a.normal:link { font-weight: normal }
|
||||
a.normal:visited { font-weight: normal }
|
||||
a.normal:active { font-weight: normal }
|
||||
a.normal:hover { font-weight: normal }
|
||||
@ -823,36 +823,49 @@ a.impayee:hover { font-weight: bold; color: #550000; }
|
||||
/*
|
||||
* Lignes titre espace
|
||||
*/
|
||||
div.titre {
|
||||
div.titre {
|
||||
font: helvetica, verdana, arial, sans-serif;
|
||||
font-weight: bold;
|
||||
color: #336666;
|
||||
font-weight: bold;
|
||||
color: #336666;
|
||||
text-decoration: none }
|
||||
|
||||
|
||||
/* ============================================================================== */
|
||||
* Formulaire confirmation
|
||||
/* Formulaire confirmation */
|
||||
/* ============================================================================== */
|
||||
|
||||
td.validtitle {
|
||||
font-weight: bold;
|
||||
background: #EECC55;
|
||||
}
|
||||
td.valid {
|
||||
background: #EECC55;
|
||||
}
|
||||
table.valid {
|
||||
border-top: solid 1px #E6E6E6;
|
||||
border-left: solid 1px #E6E6E6;
|
||||
border-right: solid 1px #444444;
|
||||
border-bottom: solid 1px #555555;
|
||||
padding-top: 0px;
|
||||
padding-left: 0px;
|
||||
padding-right: 0px;
|
||||
padding-bottom: 0px;
|
||||
margin: 0px 0px;
|
||||
background: #D5BAA8;
|
||||
}
|
||||
|
||||
.validtitre {
|
||||
background: #D5BAA8;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.valid {
|
||||
}
|
||||
|
||||
|
||||
td.small {
|
||||
td.small {
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
tr.nonpayed {
|
||||
tr.nonpayed {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
|
||||
div.version {
|
||||
div.version {
|
||||
background: #F4F4F4;
|
||||
text-align: right;
|
||||
font-size: 9px;
|
||||
@ -880,13 +893,13 @@ z-index: 100;
|
||||
/* ============================================================================== */
|
||||
/* Calendar */
|
||||
/* ============================================================================== */
|
||||
.bodyline {
|
||||
.bodyline {
|
||||
-moz-border-radius:8px;
|
||||
border: 1px #E4ECEC outset;
|
||||
border: 1px #E4ECEC outset;
|
||||
padding:0px;
|
||||
margin-bottom:5px;
|
||||
}
|
||||
table.dp {
|
||||
table.dp {
|
||||
width: 180px;
|
||||
background-color: #FFFFFF;
|
||||
border-top: solid 2px #DDDDDD;
|
||||
@ -896,10 +909,10 @@ table.dp {
|
||||
}
|
||||
.dp td, .tpHour td, .tpMinute td{padding:2px; font-size:10px;}
|
||||
/* Barre titre */
|
||||
.dpHead,.tpHead,.tpHour td:Hover .tpHead{
|
||||
.dpHead,.tpHead,.tpHour td:Hover .tpHead{
|
||||
font-weight:bold;
|
||||
background-color:#b3c5cc;
|
||||
color:white;
|
||||
color:white;
|
||||
font-size:11px;
|
||||
cursor:auto;
|
||||
}
|
||||
@ -908,9 +921,9 @@ table.dp {
|
||||
text-align:center;
|
||||
background-color:#617389;
|
||||
color:#FFFFFF;
|
||||
font-weight:bold;
|
||||
font-weight:bold;
|
||||
border: 1px outset black;
|
||||
cursor:pointer;
|
||||
cursor:pointer;
|
||||
}
|
||||
.dpButtons:Active,.tpButtons:Active{border: 1px outset black;}
|
||||
.dpDayNames td,.dpExplanation {background-color:#D9DBE1; font-weight:bold; text-align:center; font-size:11px;}
|
||||
@ -934,7 +947,7 @@ table.dp {
|
||||
.tpMinute td:Hover {background-color:black; color:white; }
|
||||
.tpMinute td {background-color:#D9DBE1; text-align:center; cursor:pointer;}
|
||||
|
||||
/* Bouton X fermer */
|
||||
/* Bouton X fermer */
|
||||
.dpInvisibleButtons
|
||||
{
|
||||
border-style:none;
|
||||
@ -944,7 +957,7 @@ font-size:9px;
|
||||
border-width:0px;
|
||||
color:#0B63A2;
|
||||
vertical-align:middle;
|
||||
cursor: pointer;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -27,6 +27,8 @@ alter table llx_contrat add column note_public text after note;
|
||||
|
||||
alter table llx_facture add column note_public text after note;
|
||||
alter table llx_facture add column remise_absolue real DEFAULT 0 after remise_percent;
|
||||
alter table llx_facture add column close_code varchar(12) after remise;
|
||||
alter table llx_facture add column close_note varchar(128) after close_code;
|
||||
|
||||
alter table llx_propal add column note_public text after note;
|
||||
alter table llx_propal add column remise_absolue real DEFAULT 0 after remise_percent;
|
||||
|
||||
@ -35,6 +35,10 @@ create table llx_facture
|
||||
remise_percent real DEFAULT 0, -- remise relative
|
||||
remise_absolue real DEFAULT 0, -- remise absolue
|
||||
remise real DEFAULT 0, -- remise totale calculee
|
||||
|
||||
close_code varchar(12) after remise; -- Code motif cloture sans paiement complet
|
||||
close_note varchar(128) after close_code; -- Commentaire cloture sans paiement complet
|
||||
|
||||
tva real DEFAULT 0, -- montant tva apres remise totale
|
||||
total real DEFAULT 0, -- montant total ht apres remise totale
|
||||
total_ttc real DEFAULT 0, -- montant total ttc apres remise totale
|
||||
|
||||
Loading…
Reference in New Issue
Block a user