New: Gestion des escomptes

This commit is contained in:
Laurent Destailleur 2006-08-19 23:00:53 +00:00
parent 1e06a25231
commit b2f911181b
30 changed files with 1105 additions and 830 deletions

View File

@ -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(); $this->lignes = $this->fetch_lignes();
/* /*

View File

@ -949,7 +949,7 @@ else
$author->fetch(); $author->fetch();
$head = commande_prepare_head($commande); $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 * Confirmation de la suppression de la commande

View File

@ -81,6 +81,7 @@ if ($_GET["id"] > 0)
{ {
$soc = new Societe($db); $soc = new Societe($db);
$soc->fetch($commande->socidp); $soc->fetch($commande->socidp);
$author = new User($db); $author = new User($db);
$author->id = $commande->user_author_id; $author->id = $commande->user_author_id;
$author->fetch(); $author->fetch();

View File

@ -224,6 +224,28 @@ if ($_POST['action'] == 'confirm_payed' && $_POST['confirm'] == 'yes' && $user->
$fac->fetch($_GET['facid']); $fac->fetch($_GET['facid']);
$result = $fac->set_payed($user); $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 * Insertion facture
@ -284,7 +306,7 @@ if ($_POST['action'] == 'add')
else else
{ {
$_GET["action"]='create'; $_GET["action"]='create';
$mesg='<div class="error">'.$facture->error.'</div>'; $msg='<div class="error">'.$facture->error.'</div>';
} }
} }
else else
@ -582,7 +604,7 @@ if ($_POST['action'] == 'confirm_canceled' && $_POST['confirm'] == 'yes')
if ($user->rights->facture->supprimer) if ($user->rights->facture->supprimer)
{ {
$fac = new Facture($db); $fac = new Facture($db);
$fac->fetch($_GET['facid']); $fac->fetch($_GET['facid']);
$result = $fac->set_canceled($user); $result = $fac->set_canceled($user);
} }
} }
@ -838,7 +860,7 @@ if ($_GET['action'] == 'create')
{ {
print_titre($langs->trans('NewBill')); print_titre($langs->trans('NewBill'));
if ($mesg) print $mesg; if ($msg) print $msg;
$soc = new Societe($db); $soc = new Societe($db);
@ -1416,6 +1438,10 @@ else
$soc = new Societe($db, $fac->socidp); $soc = new Societe($db, $fac->socidp);
$soc->fetch($fac->socidp); $soc->fetch($fac->socidp);
$absolute_discount=$soc->getCurrentDiscount(); $absolute_discount=$soc->getCurrentDiscount();
$totalpaye = $fac->getSommePaiement();
$resteapayer = $fac->total_ttc - $totalpaye;
if ($fac->paye) $resteapayer=0;
$author = new User($db); $author = new User($db);
if ($fac->user_author) if ($fac->user_author)
@ -1470,14 +1496,26 @@ else
/* /*
* Confirmation du classement payé * 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'); $html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id,$langs->trans('ClassifyPayed'),$langs->trans('ConfirmClassifyPayedBill',$fac->ref),'confirm_payed');
print '<br />'; 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') if ($_GET['action'] == 'canceled')
{ {
@ -1563,8 +1601,6 @@ else
/* /*
* Liste des paiements * Liste des paiements
*/ */
$totalpaye = 0;
$sql = 'SELECT '.$db->pdate('datep').' as dp, pf.amount,'; $sql = 'SELECT '.$db->pdate('datep').' as dp, pf.amount,';
$sql.= ' c.libelle as paiement_type, p.num_paiement, p.rowid'; $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'; $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; $var=!$var;
print '<tr '.$bc[$var].'><td>'; 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 '<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>'.$objp->paiement_type.' '.$objp->num_paiement.'</td>';
print '<td align="right">'.price($objp->amount).'</td><td>'.$langs->trans('Currency'.$conf->monnaie).'</td>'; print '<td align="right">'.price($objp->amount).'</td><td>'.$langs->trans('Currency'.$conf->monnaie).'</td>';
print '</tr>'; print '</tr>';
$totalpaye += $objp->amount;
$i++; $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('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>'; 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>';
if ($fac->close_code == 'escompte')
$resteapayer = $fac->total_ttc - $totalpaye; {
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 '<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>'; 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 // 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.'&amp;action=prerelance">'.$langs->trans('SendRemindByMail').'</a>'; print ' <a class="butAction" href="'.$_SERVER['PHP_SELF'].'?facid='.$fac->id.'&amp;action=prerelance">'.$langs->trans('SendRemindByMail').'</a>';
} }
@ -2261,18 +2297,18 @@ else
// Classer 'payé' // Classer 'payé'
if ($fac->statut == 1 && $fac->paye == 0 && $user->rights->facture->paiement 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.'&amp;action=payed">'.$langs->trans('ClassifyPayed').'</a>'; print ' <a class="butAction" href="'.$_SERVER['PHP_SELF'].'?facid='.$fac->id.'&amp;action=payed">'.$langs->trans('ClassifyPayed').'</a>';
} }
// Classer 'fermée' (possible si validée et pas encore classer payée) // Classer 'fermée' (possible si validée et pas encore classée payée)
if ($fac->statut == 1 && $fac->paye == 0 && $user->rights->facture->paiement if ($fac->statut == 1 && $fac->paye == 0 && $resteapayer > 0
&& price($resteapayer) > 0) && $user->rights->facture->paiement)
{ {
if ($totalpaye > 0) if ($totalpaye > 0)
{ {
print ' <a class="butAction" href="'.$_SERVER['PHP_SELF'].'?facid='.$fac->id.'&amp;action=canceled">'.$langs->trans('ClassifyPayedPartially').'</a>'; print ' <a class="butAction" href="'.$_SERVER['PHP_SELF'].'?facid='.$fac->id.'&amp;action=payed">'.$langs->trans('ClassifyPayedPartially').'</a>';
} }
else else
{ {

View File

@ -147,6 +147,7 @@ class Conf
// Module externalrss // Module externalrss
$this->externalrss->enabled=defined("MAIN_MODULE_EXTERNALRSS")?MAIN_MODULE_EXTERNALRSS:0; $this->externalrss->enabled=defined("MAIN_MODULE_EXTERNALRSS")?MAIN_MODULE_EXTERNALRSS:0;
$this->externalrss->dir_temp=DOL_DATA_ROOT."/rss/temp";
// Module commande client // Module commande client
$this->commande->enabled=defined("MAIN_MODULE_COMMANDE")?MAIN_MODULE_COMMANDE:0; $this->commande->enabled=defined("MAIN_MODULE_COMMANDE")?MAIN_MODULE_COMMANDE:0;

View File

@ -89,6 +89,7 @@ if ($_GET["id"] > 0)
$soc = new Societe($db); $soc = new Societe($db);
$soc->fetch($commande->socidp); $soc->fetch($commande->socidp);
$author = new User($db); $author = new User($db);
$author->id = $commande->user_author_id; $author->id = $commande->user_author_id;
$author->fetch(); $author->fetch();

View File

@ -191,6 +191,7 @@ if ($_GET["action"] == 'create')
{ {
$soc = new Societe($db); $soc = new Societe($db);
$soc->fetch($commande->socidp); $soc->fetch($commande->socidp);
$author = new User($db); $author = new User($db);
$author->id = $commande->user_author_id; $author->id = $commande->user_author_id;
$author->fetch(); $author->fetch();

View File

@ -63,6 +63,8 @@ class Facture extends CommonObject
var $note_public; var $note_public;
var $statut; var $statut;
var $paye; // 1 si facture payée COMPLETEMENT, 0 sinon 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 $propalid;
var $projetid; var $projetid;
var $date_lim_reglement; 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 = '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.datef').' as df, f.fk_projet';
$sql .= ','.$this->db->pdate('f.date_lim_reglement').' as dlr'; $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_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 .= ', 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'; $sql .= ', cf.fk_commande';
@ -346,6 +348,8 @@ class Facture extends CommonObject
$this->total_tva = $obj->tva; $this->total_tva = $obj->tva;
$this->total_ttc = $obj->total_ttc; $this->total_ttc = $obj->total_ttc;
$this->paye = $obj->paye; $this->paye = $obj->paye;
$this->close_code = $obj->close_code;
$this->close_note = $obj->close_note;
$this->socidp = $obj->fk_soc; $this->socidp = $obj->fk_soc;
$this->statut = $obj->fk_statut; $this->statut = $obj->fk_statut;
$this->date_lim_reglement = $obj->dlr; $this->date_lim_reglement = $obj->dlr;
@ -365,36 +369,20 @@ class Facture extends CommonObject
$this->lignes = array(); $this->lignes = array();
if ($this->user_author) if ($this->commande_id)
{ {
$sql = "SELECT name, firstname"; $sql = "SELECT ref";
$sql.= " FROM ".MAIN_DB_PREFIX."user"; $sql.= " FROM ".MAIN_DB_PREFIX."commande";
$sql.= " WHERE rowid = ".$this->user_author; $sql.= " WHERE rowid = ".$this->commande_id;
$resqluser = $this->db->query($sql); $resqlcomm = $this->db->query($sql);
if ($resqluser) if ($resqlcomm)
{ {
$obju = $this->db->fetch_object($resqluser); $objc = $this->db->fetch_object($resqlcomm);
$this->user_author_name = $obju->name; $this->commande_ref = $objc->ref;
$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->statut == 0) 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 * \brief Tag la facture comme payée complètement + appel trigger BILL_PAYED
* \param user Objet utilisateur qui modifie * \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 * \return int <0 si ok, >0 si ok
*/ */
function set_payed($user) function set_payed($user,$close_code='',$close_note='')
{ {
global $conf,$langs; global $conf,$langs;
dolibarr_syslog("Facture.class.php::set_payed rowid=".$this->id); dolibarr_syslog("Facture.class.php::set_payed rowid=".$this->id);
$sql = 'UPDATE '.MAIN_DB_PREFIX.'facture'; $sql = 'UPDATE '.MAIN_DB_PREFIX.'facture SET';
$sql.= ' SET paye=1 WHERE rowid = '.$this->id ; $sql.= ' paye=1';
$resql = $this->db->query($sql); 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) if ($resql)
{ {
$this->use_webcal=($conf->global->PHPWEBCALENDAR_BILLSTATUS=='always'?1:0); $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 * \brief Renvoie la sommes des paiements deja effectués
* \remarks Utilisé entre autre par certains modèles de factures * \return Montant deja versé, <0 si ko
*/ */
function getSommePaiement() function getSommePaiement()
{ {
$sql = 'SELECT sum(amount) FROM '.MAIN_DB_PREFIX.'paiement_facture WHERE fk_facture = '.$this->id; $sql = 'SELECT sum(amount) as amount';
if ($this->db->query($sql)) $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); $obj = $this->db->fetch_object($resql);
return $row[0]; return $obj->amount;
} }
else else
{ {

View File

@ -53,15 +53,15 @@ if ($_GET["id"] > 0)
{ {
$soc->fetch($commande->socidp); $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][0] = DOL_URL_ROOT.'/fourn/fiche.php?socid='.$soc->id;
$addons[0][1] = $soc->nom; $addons[0][1] = $soc->nom;
llxHeader('',$langs->trans("History"),"CommandeFournisseur",$addons); llxHeader('',$langs->trans("History"),"CommandeFournisseur",$addons);
$author = new User($db);
$author->id = $commande->user_author_id;
$author->fetch();
$h = 0; $h = 0;
$head[$h][0] = DOL_URL_ROOT.'/fourn/commande/fiche.php?id='.$commande->id; $head[$h][0] = DOL_URL_ROOT.'/fourn/commande/fiche.php?id='.$commande->id;
$head[$h][1] = $langs->trans("OrderCard"); $head[$h][1] = $langs->trans("OrderCard");

View File

@ -74,6 +74,7 @@ if ($_GET["id"] > 0)
{ {
$soc = new Societe($db); $soc = new Societe($db);
$soc->fetch($commande->socidp); $soc->fetch($commande->socidp);
$author = new User($db); $author = new User($db);
$author->id = $commande->user_author_id; $author->id = $commande->user_author_id;
$author->fetch(); $author->fetch();

View File

@ -483,7 +483,7 @@ class CommandeFournisseur extends Commande
{ {
require_once (DOL_DOCUMENT_ROOT."/lib/CMailFile.class.php"); 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(); $cc->fetch();
$sendto = $cc->email; $sendto = $cc->email;

View File

@ -1487,28 +1487,60 @@ class Form
/** /**
* \brief Affiche formulaire de demande de confirmation * \brief Affiche formulaire de demande de confirmation
* \param page page * \param page page
* \param title title * \param title title
* \param question question * \param question question
* \param action action * \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; 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 '<input type="hidden" name="action" value="'.$action.'">';
print '<table class="border" width="100%">';
print '<table width="100%" class="valid">';
// Ligne titre // 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>&nbsp;</td>';
print '<td><input type="radio" class="flat" name="'.$input['name'].'" value="'.$selkey.'"> '.$selval.'</td></tr>';
$i++;
}
}
}
print '</tr></table>';
print '</td>';
}
// Ligne message // 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"); $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 '<td class="valid" align="center"><input class="button" type="submit" value="'.$langs->trans("Confirm").'"></td></tr>';
print '</table>'; print '</table>';
print "</form>\n"; print "</form>\n";
} }

View File

@ -83,13 +83,11 @@ class DolibarrModules
// Créé les répertoires // Créé les répertoires
if (is_array($this->dirs)) if (is_array($this->dirs))
{ {
foreach ($this->dirs as $key => $value) foreach ($this->dirs as $key => $dir)
{ {
$dir = $value;
if ($dir && ! file_exists($dir)) if ($dir && ! file_exists($dir))
{ {
umask(0); if (create_exdir($dir) < 0)
if (! @mkdir($dir, 0755))
{ {
$this->error = $langs->trans("ErrorCanNotCreateDir",$dir); $this->error = $langs->trans("ErrorCanNotCreateDir",$dir);
dolibarr_syslog("DolibarrModules::_init error"); dolibarr_syslog("DolibarrModules::_init error");
@ -106,7 +104,7 @@ class DolibarrModules
$result=$this->db->query($sql); $result=$this->db->query($sql);
if (! $result) if (! $result)
{ {
dolibarr_syslog("Error sql=".$sql." - ".$this->db->error()); dolibarr_syslog("DolibarrModules.class::init Error sql=".$sql." - ".$this->db->error());
$err++; $err++;
} }
} }

View File

@ -42,7 +42,7 @@ class pdf_einstein extends ModelePDFCommandes
{ {
var $emetteur; // Objet societe qui emet var $emetteur; // Objet societe qui emet
/** /**
\brief Constructeur \brief Constructeur
\param db Handler accès base de donnée \param db Handler accès base de donnée
@ -51,6 +51,8 @@ class pdf_einstein extends ModelePDFCommandes
{ {
global $conf,$langs,$mysoc; global $conf,$langs,$mysoc;
$langs->load("main");
$langs->load("bills");
$this->db = $db; $this->db = $db;
$this->name = "einstein"; $this->name = "einstein";
$this->description = "Modèle de commandes complet (logo...)"; $this->description = "Modèle de commandes complet (logo...)";
@ -64,14 +66,15 @@ class pdf_einstein extends ModelePDFCommandes
$this->marge_droite=10; $this->marge_droite=10;
$this->marge_haute=10; $this->marge_haute=10;
$this->marge_basse=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_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_codeproduitservice = 1; // Affiche code produit-service
$this->option_multilang = 1; // Dispo en plusieurs langues $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; $this->franchise=1;
// Recupere emmetteur // Recupere emmetteur
@ -85,7 +88,7 @@ class pdf_einstein extends ModelePDFCommandes
$this->posxqty=151; $this->posxqty=151;
$this->posxdiscount=162; $this->posxdiscount=162;
$this->postotalht=177; $this->postotalht=177;
$this->tva=array(); $this->tva=array();
$this->atleastoneratenotnull=0; $this->atleastoneratenotnull=0;
$this->atleastonediscount=0; $this->atleastonediscount=0;
@ -95,14 +98,14 @@ class pdf_einstein extends ModelePDFCommandes
\brief Renvoi dernière erreur \brief Renvoi dernière erreur
\return string Dernière erreur \return string Dernière erreur
*/ */
function pdferror() function pdferror()
{ {
return $this->error; return $this->error;
} }
/** /**
\brief Fonction générant la commande sur le disque \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 \return int 1=ok, 0=ko
*/ */
function write_pdf_file($com,$outputlangs='') function write_pdf_file($com,$outputlangs='')
@ -115,19 +118,20 @@ class pdf_einstein extends ModelePDFCommandes
$outputlangs->load("bills"); $outputlangs->load("bills");
$outputlangs->load("products"); $outputlangs->load("products");
$outputlangs->load("orders"); $outputlangs->load("orders");
$outputlangs->setPhpLang(); $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) 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 // Définition de $dir et $file
if ($com->specimen) if ($com->specimen)
{ {
@ -140,7 +144,7 @@ class pdf_einstein extends ModelePDFCommandes
$dir = $conf->commande->dir_output . "/" . $comref; $dir = $conf->commande->dir_output . "/" . $comref;
$file = $dir . "/" . $comref . ".pdf"; $file = $dir . "/" . $comref . ".pdf";
} }
if (! file_exists($dir)) if (! file_exists($dir))
{ {
if (create_exdir($dir) < 0) if (create_exdir($dir) < 0)
@ -149,9 +153,10 @@ class pdf_einstein extends ModelePDFCommandes
return 0; return 0;
} }
} }
if (file_exists($dir)) if (file_exists($dir))
{ {
$nblignes = sizeof($com->lignes);
// Initialisation document vierge // Initialisation document vierge
$pdf=new FPDF('P','mm',$this->format); $pdf=new FPDF('P','mm',$this->format);
$pdf->Open(); $pdf->Open();
@ -168,7 +173,6 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->SetAutoPageBreak(1,0); $pdf->SetAutoPageBreak(1,0);
// Positionne $this->atleastonediscount si on a au moins une remise // Positionne $this->atleastonediscount si on a au moins une remise
$nblignes = sizeof($com->lignes);
for ($i = 0 ; $i < $nblignes ; $i++) for ($i = 0 ; $i < $nblignes ; $i++)
{ {
if ($com->lignes[$i]->remise_percent) if ($com->lignes[$i]->remise_percent)
@ -177,13 +181,37 @@ class pdf_einstein extends ModelePDFCommandes
} }
} }
// Tete de page
$this->_pagehead($pdf, $com, 1, $outputlangs); $this->_pagehead($pdf, $com, 1, $outputlangs);
$pagenb = 1; $pagenb = 1;
$tab_top = 90; $tab_top = 90;
$tab_top_newpage = 50; $tab_top_newpage = 50;
$tab_height = 110; $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; $iniY = $tab_top + 8;
$curY = $tab_top + 8; $curY = $tab_top + 8;
@ -205,23 +233,31 @@ class pdf_einstein extends ModelePDFCommandes
if ($com->lignes[$i]->fk_product) if ($com->lignes[$i]->fk_product)
{ {
$prodser = new Product($this->db); $prodser = new Product($this->db);
$prodser->fetch($com->lignes[$i]->fk_product); $prodser->fetch($com->lignes[$i]->fk_product);
// On ajoute la ref
if ($prodser->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 // Ajoute description du produit
if ($conf->global->FORM_ADD_PROD_DESC && !$conf->global->PRODUIT_CHANGE_PROD_DESC) 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"; if ($libelleproduitservice) $libelleproduitservice.="\n";
$libelleproduitservice.=$com->lignes[$i]->product_desc; $libelleproduitservice.=$com->lignes[$i]->product_desc;
} }
} }
} }
if ($com->lignes[$i]->date_start && $com->lignes[$i]->date_end) if ($com->lignes[$i]->date_start && $com->lignes[$i]->date_end)
{ {
// Affichage durée si il y en a une // 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 $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) if ($pagenb == 1)
{ {
$this->_tableau($pdf, $tab_top, $tab_height + 20, $nexY, $outputlangs); $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->_tableau($pdf, $tab_top_newpage, $tab_height_newpage, $nexY, $outputlangs);
} }
$this->_pagefoot($pdf,$outputlangs); $this->_pagefoot($pdf,$outputlangs);
// Nouvelle page // Nouvelle page
$pdf->AddPage(); $pdf->AddPage();
$pagenb++; $pagenb++;
$this->_pagehead($pdf, $com, 0, $outputlangs); $this->_pagehead($pdf, $com, 0, $outputlangs);
$nexY = $tab_top_newpage + 8; $nexY = $tab_top_newpage + 8;
$pdf->SetTextColor(0,0,0); $pdf->SetTextColor(0,0,0);
$pdf->SetFont('Arial','', 10); $pdf->SetFont('Arial','', 10);
} }
} }
// Affiche cadre tableau // Affiche cadre tableau
if ($pagenb == 1) if ($pagenb == 1)
{ {
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs); $this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs);
$bottomlasttab=$tab_top + $tab_height + 1; $bottomlasttab=$tab_top + $tab_height + 1;
} }
else else
{ {
$this->_tableau($pdf, $tab_top_newpage, $tab_height, $nexY, $outputlangs); $this->_tableau($pdf, $tab_top_newpage, $tab_height, $nexY, $outputlangs);
$bottomlasttab=$tab_top_newpage + $tab_height + 1; $bottomlasttab=$tab_top_newpage + $tab_height + 1;
} }
$deja_regle = ""; // Affiche zone infos
$posy=$this->_tableau_tot($pdf, $com, $deja_regle, $bottomlasttab, $outputlangs); $posy=$this->_tableau_tot($pdf, $com, $deja_regle, $bottomlasttab, $outputlangs);
// Affiche zone totaux
if ($deja_regle) { $posy=$this->_tableau_tot($pdf, $com, $deja_regle, $bottomlasttab, $outputlangs);
$this->_tableau_versements($pdf, $fac, $posy, $outputlangs);
// Affiche zone versements
if ($deja_regle) {
$posy=$this->_tableau_versements($pdf, $com, $posy, $outputlangs);
} }
/* // Pied de page
* 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
*/
$this->_pagefoot($pdf,$outputlangs); $this->_pagefoot($pdf,$outputlangs);
$pdf->AliasNbPages(); $pdf->AliasNbPages();
$pdf->Close(); $pdf->Close();
$pdf->Output($file); $pdf->Output($file);
@ -436,22 +370,184 @@ class pdf_einstein extends ModelePDFCommandes
} }
else else
{ {
$this->error=$langs->trans("ErrorCanNotCreateDir",$dir); $this->error=$outputlangs->trans("ErrorCanNotCreateDir",$dir);
$langs->setPhpLang(); // On restaure langue session $langs->setPhpLang(); // On restaure langue session
return 0; return 0;
} }
} }
else else
{ {
$this->error=$langs->trans("ErrorConstantNotDefined","COMMANDE_OUTPUTDIR"); $this->error=$outputlangs->trans("ErrorConstantNotDefined","COMMANDE_OUTPUTDIR");
$langs->setPhpLang(); // On restaure langue session $langs->setPhpLang(); // On restaure langue session
return 0; return 0;
} }
$this->error=$langs->trans("ErrorUnknown"); $this->error=$outputlangs->trans("ErrorUnknown");
$langs->setPhpLang(); // On restaure langue session $langs->setPhpLang(); // On restaure langue session
return 0; // Erreur par defaut 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 * \brief Affiche le total à payer
* \param pdf Objet PDF * \param pdf Objet PDF
@ -461,21 +557,11 @@ class pdf_einstein extends ModelePDFCommandes
*/ */
function _tableau_tot(&$pdf, $com, $deja_regle, $posy, $outputlangs) function _tableau_tot(&$pdf, $com, $deja_regle, $posy, $outputlangs)
{ {
$outputlangs->load("main");
$outputlangs->load("bills");
$tab2_top = $posy; $tab2_top = $posy;
$tab2_hl = 5; $tab2_hl = 5;
$tab2_height = $tab2_hl * 4; $tab2_height = $tab2_hl * 4;
$pdf->SetFont('Arial','', 9); $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 // Tableau total
$lltot = 200; $col1x = 120; $col2x = 182; $largcol2 = $lltot - $col2x; $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->MultiCell($largcol2, $tab2_hl, "-".$com->remise_percent."%", 0, 'R', 1);
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * 2); $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->SetXY ($col2x, $tab2_top + $tab2_hl * 2);
$pdf->MultiCell($largcol2, $tab2_hl, price($com->total_ht), 0, 'R', 0); $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 if ($tvakey) // On affiche pas taux 0
{ {
$this->atleastoneratenotnull++; $this->atleastoneratenotnull++;
$index++; $index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $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->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->trans("TotalVAT").' '.abs($tvakey).'%'.$tvacompl, 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); $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) if (! $this->atleastoneratenotnull)
@ -531,13 +617,13 @@ class pdf_einstein extends ModelePDFCommandes
$index++; $index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->trans("TotalVAT"), 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->trans("TotalVAT"), 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($com->total_tva), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($com->total_tva), 0, 'R', 1);
} }
$useborder=0; $useborder=0;
$index++; $index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$pdf->SetTextColor(0,0,60); $pdf->SetTextColor(0,0,60);
@ -546,31 +632,34 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($com->total_ttc), $useborder, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($com->total_ttc), $useborder, 'R', 1);
$pdf->SetFont('Arial','', 9);
$pdf->SetTextColor(0,0,0); $pdf->SetTextColor(0,0,0);
if ($deja_regle > 0) if ($deja_regle > 0)
{ {
$index++; $index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->trans("AlreadyPayed"), 0, 'L', 0); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->trans("AlreadyPayed"), 0, 'L', 0);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle), 0, 'R', 0); $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle), 0, 'R', 0);
$index++; $index++;
$pdf->SetTextColor(0,0,60); $pdf->SetTextColor(0,0,60);
//$pdf->SetFont('Arial','B', 9); $pdf->SetFillColor(224,224,224);
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->trans("RemainderToPay"), $useborder, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->trans("RemainderToPay"), $useborder, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($com->total_ttc - $deja_regle), $useborder, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($com->total_ttc - $deja_regle), $useborder, 'R', 1);
// Fin
$pdf->SetFont('Arial','', 9); $pdf->SetFont('Arial','', 9);
$pdf->SetTextColor(0,0,0); $pdf->SetTextColor(0,0,0);
} }
$index++; $index++;
return ($tab2_top + ($tab2_hl * $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) function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs)
{ {
global $conf; global $conf;
$outputlangs->load("main");
$outputlangs->load("bills");
// Montants exprimés en (en tab_top - 1) // Montants exprimés en (en tab_top - 1)
$pdf->SetTextColor(0,0,0); $pdf->SetTextColor(0,0,0);
$pdf->SetFont('Arial','',8); $pdf->SetFont('Arial','',8);
@ -596,9 +683,9 @@ class pdf_einstein extends ModelePDFCommandes
// Rect prend une longueur en 3eme param // 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); $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 // 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->SetXY ($this->posxdesc-1, $tab_top+2);
$pdf->MultiCell(108,2, $outputlangs->trans("Designation"),'','L'); $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->MultiCell(100, 4, $outputlangs->trans("Order"), '' , 'R');
$pdf->SetFont('Arial','B',12); $pdf->SetFont('Arial','B',12);
$posy+=6; $posy+=6;
$pdf->SetXY(100,$posy); $pdf->SetXY(100,$posy);
$pdf->SetTextColor(0,0,60); $pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 4, $outputlangs->trans("Ref")." : " . $com->ref, '', 'R'); $pdf->MultiCell(100, 4, $outputlangs->trans("Ref")." : " . $com->ref, '', 'R');
$pdf->SetFont('Arial','',12); $pdf->SetFont('Arial','',10);
$posy+=6; $posy+=6;
$pdf->SetXY(100,$posy); $pdf->SetXY(100,$posy);
$pdf->SetTextColor(0,0,60); $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) if ($showadress)
{ {
@ -703,21 +796,21 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->SetFont('Arial','',8); $pdf->SetFont('Arial','',8);
$pdf->SetXY($this->marge_gauche,$posy-5); $pdf->SetXY($this->marge_gauche,$posy-5);
$pdf->MultiCell(66,5, $outputlangs->trans("BillFrom").":"); $pdf->MultiCell(66,5, $outputlangs->trans("BillFrom").":");
$pdf->SetXY($this->marge_gauche,$posy); $pdf->SetXY($this->marge_gauche,$posy);
$pdf->SetFillColor(230,230,230); $pdf->SetFillColor(230,230,230);
$pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1); $pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1);
$pdf->SetXY($this->marge_gauche+2,$posy+3); $pdf->SetXY($this->marge_gauche+2,$posy+3);
// Nom emetteur // Nom emetteur
$pdf->SetTextColor(0,0,60); $pdf->SetTextColor(0,0,60);
$pdf->SetFont('Arial','B',11); $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'); 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'); else $pdf->MultiCell(80, 4, $this->emetteur->nom, 0, 'L');
// Caractéristiques emetteur // Caractéristiques emetteur
$carac_emetteur = ''; $carac_emetteur = '';
if (defined("FAC_PDF_ADRESSE") && FAC_PDF_ADRESSE) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).FAC_PDF_ADRESSE; 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 // Web
if (defined("FAC_PDF_WWW") && FAC_PDF_WWW) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->trans("Web").": ".FAC_PDF_WWW; 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; elseif ($this->emetteur->url) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->trans("Web").": ".$this->emetteur->url;
$pdf->SetFont('Arial','',9); $pdf->SetFont('Arial','',9);
$pdf->SetXY($this->marge_gauche+2,$posy+8); $pdf->SetXY($this->marge_gauche+2,$posy+8);
$pdf->MultiCell(80,4, $carac_emetteur); $pdf->MultiCell(80,4, $carac_emetteur);
// Client destinataire // Client destinataire
$posy=42; $posy=42;
$pdf->SetTextColor(0,0,0); $pdf->SetTextColor(0,0,0);
$pdf->SetFont('Arial','',8); $pdf->SetFont('Arial','',8);
$pdf->SetXY(102,$posy-5); $pdf->SetXY(102,$posy-5);
$pdf->MultiCell(80,5, $outputlangs->trans("BillTo").":"); $pdf->MultiCell(80,5, $outputlangs->trans("BillTo").":");
// $com->fetch_client();
$client = new Societe($this->db);
$client->fetch($com->socidp);
$com->client = $client;
//
// Cadre client destinataire // Cadre client destinataire
$pdf->rect(100, $posy, 100, $hautcadre); $pdf->rect(100, $posy, 100, $hautcadre);
// Nom client // Nom client
$pdf->SetXY(102,$posy+3); $pdf->SetXY(102,$posy+3);
$pdf->SetFont('Arial','B',11); $pdf->SetFont('Arial','B',11);
$pdf->MultiCell(106,4, $com->client->nom, 0, 'L'); $pdf->MultiCell(106,4, $com->client->nom, 0, 'L');
// Caractéristiques client // Caractéristiques client
$carac_client=$com->client->adresse; $carac_client=$com->client->adresse;
$carac_client.="\n".$com->client->cp . " " . $com->client->ville."\n"; $carac_client.="\n".$com->client->cp . " " . $com->client->ville."\n";
@ -781,12 +870,9 @@ class pdf_einstein extends ModelePDFCommandes
function _pagefoot(&$pdf,$outputlangs) function _pagefoot(&$pdf,$outputlangs)
{ {
global $conf; global $conf;
$outputlangs->load("main");
$outputlangs->load("bills");
$outputlangs->load("companies");
$html=new Form($this->db); $html=new Form($this->db);
// Premiere ligne d'info réglementaires // Premiere ligne d'info réglementaires
$ligne1=""; $ligne1="";
if ($this->emetteur->forme_juridique_code) if ($this->emetteur->forme_juridique_code)
@ -810,7 +896,7 @@ class pdf_einstein extends ModelePDFCommandes
$ligne2=""; $ligne2="";
if ($this->emetteur->profid3) 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) if ($this->emetteur->profid4)
{ {
@ -830,7 +916,7 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->SetY(-$posy); $pdf->SetY(-$posy);
$pdf->line($this->marge_gauche, $this->page_hauteur-$posy, 200, $this->page_hauteur-$posy); $pdf->line($this->marge_gauche, $this->page_hauteur-$posy, 200, $this->page_hauteur-$posy);
$posy--; $posy--;
if ($ligne1) if ($ligne1)
{ {
$pdf->SetXY($this->marge_gauche,-$posy); $pdf->SetXY($this->marge_gauche,-$posy);
@ -843,7 +929,7 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->SetXY($this->marge_gauche,-$posy); $pdf->SetXY($this->marge_gauche,-$posy);
$pdf->MultiCell(200, 2, $ligne2, 0, 'C', 0); $pdf->MultiCell(200, 2, $ligne2, 0, 'C', 0);
} }
$pdf->SetXY(-20,-$posy); $pdf->SetXY(-20,-$posy);
$pdf->MultiCell(10, 2, $pdf->PageNo().'/{nb}', 0, 'R', 0); $pdf->MultiCell(10, 2, $pdf->PageNo().'/{nb}', 0, 'R', 0);
} }
@ -857,7 +943,7 @@ class pdf_einstein extends ModelePDFCommandes
function _dol_htmlentities($stringtoencode,$isstringalreadyhtml) function _dol_htmlentities($stringtoencode,$isstringalreadyhtml)
{ {
global $conf; global $conf;
if ($isstringalreadyhtml) return $stringtoencode; if ($isstringalreadyhtml) return $stringtoencode;
if ($conf->fckeditor->enabled) return htmlentities($stringtoencode); if ($conf->fckeditor->enabled) return htmlentities($stringtoencode);
return $stringtoencode; return $stringtoencode;

View File

@ -73,6 +73,7 @@ class pdf_crabe extends ModelePDFFactures
$this->option_condreg = 1; // Affiche conditions règlement $this->option_condreg = 1; // Affiche conditions règlement
$this->option_codeproduitservice = 1; // Affiche code produit-service $this->option_codeproduitservice = 1; // Affiche code produit-service
$this->option_multilang = 1; // Dispo en plusieurs langues $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') if (defined("FACTURE_TVAOPTION") && FACTURE_TVAOPTION == 'franchise')
$this->franchise=1; $this->franchise=1;
@ -109,9 +110,9 @@ class pdf_crabe extends ModelePDFFactures
$outputlangs->load("companies"); $outputlangs->load("companies");
$outputlangs->load("bills"); $outputlangs->load("bills");
$outputlangs->load("products"); $outputlangs->load("products");
$outputlangs->setPhpLang(); $outputlangs->setPhpLang();
if ($conf->facture->dir_output) if ($conf->facture->dir_output)
{ {
// Définition de l'objet $fac (pour compatibilite ascendante) // Définition de l'objet $fac (pour compatibilite ascendante)
@ -121,6 +122,7 @@ class pdf_crabe extends ModelePDFFactures
$fac = new Facture($this->db,"",$id); $fac = new Facture($this->db,"",$id);
$ret=$fac->fetch($id); $ret=$fac->fetch($id);
} }
$deja_regle = $fac->getSommePaiement();
// Définition de $dir et $file // Définition de $dir et $file
if ($fac->specimen) if ($fac->specimen)
@ -172,9 +174,9 @@ class pdf_crabe extends ModelePDFFactures
} }
} }
// Tete de page
$this->_pagehead($pdf, $fac, 1, $outputlangs); $this->_pagehead($pdf, $fac, 1, $outputlangs);
// Affiches lignes
$pagenb = 1; $pagenb = 1;
$tab_top = 90; $tab_top = 90;
$tab_top_newpage = 50; $tab_top_newpage = 50;
@ -224,10 +226,12 @@ class pdf_crabe extends ModelePDFFactures
if ($fac->lignes[$i]->produit_id) if ($fac->lignes[$i]->produit_id)
{ {
$prodser = new Product($this->db); $prodser = new Product($this->db);
$prodser->fetch($fac->lignes[$i]->produit_id); $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) if($prodser->type == 0)
$prefix_prodserv = $outputlangs->trans("Product")." "; $prefix_prodserv = $outputlangs->trans("Product")." ";
if($prodser->type == 1) if($prodser->type == 1)
@ -236,8 +240,8 @@ class pdf_crabe extends ModelePDFFactures
$libelleproduitservice=$prefix_prodserv.$prodser->ref." - ".$libelleproduitservice; $libelleproduitservice=$prefix_prodserv.$prodser->ref." - ".$libelleproduitservice;
} }
// Ajoute description du produit // Ajoute description du produit
if ($conf->global->FORM_ADD_PROD_DESC && !$conf->global->PRODUIT_CHANGE_PROD_DESC) 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) 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->_tableau($pdf, $tab_top_newpage, $tab_height_newpage, $nexY, $outputlangs);
} }
$this->_pagefoot($pdf,$outputlangs); $this->_pagefoot($pdf,$outputlangs);
// Nouvelle page // Nouvelle page
$pdf->AddPage(); $pdf->AddPage();
@ -322,6 +326,7 @@ class pdf_crabe extends ModelePDFFactures
} }
} }
// Affiche cadre tableau // Affiche cadre tableau
if ($pagenb == 1) if ($pagenb == 1)
{ {
@ -334,124 +339,18 @@ class pdf_crabe extends ModelePDFFactures
$bottomlasttab=$tab_top_newpage + $tab_height + 1; $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); $posy=$this->_tableau_tot($pdf, $fac, $deja_regle, $bottomlasttab, $outputlangs);
// Affiche zone versements
if ($deja_regle) { if ($deja_regle) {
$this->_tableau_versements($pdf, $fac, $posy, $outputlangs); $posy=$this->_tableau_versements($pdf, $fac, $posy, $outputlangs);
} }
/* // Pied de page
* 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
*/
$this->_pagefoot($pdf,$outputlangs); $this->_pagefoot($pdf,$outputlangs);
$pdf->AliasNbPages(); $pdf->AliasNbPages();
@ -474,7 +373,7 @@ class pdf_crabe extends ModelePDFFactures
$this->error=$outputlangs->trans("ErrorConstantNotDefined","FAC_OUTPUTDIR"); $this->error=$outputlangs->trans("ErrorConstantNotDefined","FAC_OUTPUTDIR");
$langs->setPhpLang(); // On restaure langue session $langs->setPhpLang(); // On restaure langue session
return 0; return 0;
} }
$this->error=$outputlangs->trans("ErrorUnknown"); $this->error=$outputlangs->trans("ErrorUnknown");
$langs->setPhpLang(); // On restaure langue session $langs->setPhpLang(); // On restaure langue session
return 0; // Erreur par defaut return 0; // Erreur par defaut
@ -487,7 +386,7 @@ class pdf_crabe extends ModelePDFFactures
* \param fac objet facture * \param fac objet facture
*/ */
function _tableau_versements(&$pdf, $fac, $posy, $outputlangs) function _tableau_versements(&$pdf, $fac, $posy, $outputlangs)
{ {
$tab3_posx = 120; $tab3_posx = 120;
$tab3_top = $posy + 8; $tab3_top = $posy + 8;
$tab3_width = 80; $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 * \brief Affiche le total à payer
* \param pdf Objet PDF * \param pdf Objet PDF
* \param fac Objet facture * \param fac Objet facture
* \param deja_regle Montant deja regle * \param deja_regle Montant deja regle
* \return y Position pour suite * \param posy Position depart
* \param outputlangs Objet langs
* \return y Position pour suite
*/ */
function _tableau_tot(&$pdf, $fac, $deja_regle, $posy, $outputlangs) function _tableau_tot(&$pdf, $fac, $deja_regle, $posy, $outputlangs)
{ {
@ -581,13 +634,6 @@ class pdf_crabe extends ModelePDFFactures
$tab2_height = $tab2_hl * 4; $tab2_height = $tab2_hl * 4;
$pdf->SetFont('Arial','', 9); $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 // Tableau total
$lltot = 200; $col1x = 120; $col2x = 182; $largcol2 = $lltot - $col2x; $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->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($fac->total_ttc), $useborder, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($fac->total_ttc), $useborder, 'R', 1);
$pdf->SetFont('Arial','', 9);
$pdf->SetTextColor(0,0,0); $pdf->SetTextColor(0,0,0);
if ($deja_regle > 0) if ($deja_regle > 0)
@ -671,23 +716,35 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle), 0, 'R', 0); $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++; $index++;
$pdf->SetTextColor(0,0,60); $pdf->SetTextColor(0,0,60);
//$pdf->SetFont('Arial','B', 9); $pdf->SetFillColor(224,224,224);
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->trans("RemainderToPay"), $useborder, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->trans("RemainderToPay"), $useborder, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); $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->SetFont('Arial','', 9);
$pdf->SetTextColor(0,0,0); $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++; $index++;
return ($tab2_top + ($tab2_hl * $index)); return ($tab2_top + ($tab2_hl * $index));
} }
@ -713,7 +770,7 @@ class pdf_crabe extends ModelePDFFactures
// line prend une position y en 3eme param // 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->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->SetXY ($this->posxdesc-1, $tab_top+2);
$pdf->MultiCell(108,2, $outputlangs->trans("Designation"),'','L'); $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->MultiCell(100, 4, $outputlangs->trans("Invoice"), '' , 'R');
$pdf->SetFont('Arial','B',12); $pdf->SetFont('Arial','B',12);
$posy+=6; $posy+=6;
$pdf->SetXY(100,$posy); $pdf->SetXY(100,$posy);
$pdf->SetTextColor(0,0,60); $pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 4, $outputlangs->trans("Ref")." : " . $fac->ref, '', 'R'); $pdf->MultiCell(100, 4, $outputlangs->trans("Ref")." : " . $fac->ref, '', 'R');
$pdf->SetFont('Arial','',12); $pdf->SetFont('Arial','',10);
$posy+=6; $posy+=6;
$pdf->SetXY(100,$posy); $pdf->SetXY(100,$posy);
$pdf->SetTextColor(0,0,60); $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->SetXY(100,$posy);
$pdf->SetTextColor(0,0,60); $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) if ($showadress)
{ {
// Emetteur // Emetteur
$posy=42; $posy=42;
$hautcadre=40; $hautcadre=40;
$pdf->SetTextColor(0,0,0); $pdf->SetTextColor(0,0,0);
@ -869,6 +926,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetXY(102,$posy-5); $pdf->SetXY(102,$posy-5);
$pdf->MultiCell(80,5, $outputlangs->trans("BillTo").":"); $pdf->MultiCell(80,5, $outputlangs->trans("BillTo").":");
$fac->fetch_client(); $fac->fetch_client();
// Cadre client destinataire // Cadre client destinataire
$pdf->rect(100, $posy, 100, $hautcadre); $pdf->rect(100, $posy, 100, $hautcadre);
@ -968,7 +1026,7 @@ class pdf_crabe extends ModelePDFFactures
function _dol_htmlentities($stringtoencode,$isstringalreadyhtml) function _dol_htmlentities($stringtoencode,$isstringalreadyhtml)
{ {
global $conf; global $conf;
if ($isstringalreadyhtml) return $stringtoencode; if ($isstringalreadyhtml) return $stringtoencode;
if ($conf->fckeditor->enabled) return htmlentities($stringtoencode); if ($conf->fckeditor->enabled) return htmlentities($stringtoencode);
return $stringtoencode; return $stringtoencode;

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * 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 * 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 class modExternalRss extends DolibarrModules
{ {
/** /**
* \brief Constructeur. Definit les noms, constantes et boites * \brief Constructeur. Definit les noms, constantes et boites
* \param DB handler d'accès base * \param DB handler d'accès base
*/ */
function modExternalRss($DB) function modExternalRss($DB)
{ {
$this->db = $DB ; global $conf;
$this->id = 'externalrss'; // Same value xxx than in file modXxx.class.php file
$this->numero = 320; $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. * \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. * Définit également les répertoires de données à créer pour ce module.
*/ */
function init() 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)
{ {
while ($obj = $this->db->fetch_object($result)) $sql = array();
{
if (eregi('EXTERNAL_RSS_TITLE_([0-9]+)',$obj->name,$reg)) // Recherche configuration de boites
{ $this->boxes=array();
// Definie la boite si on a trouvée une ancienne configuration $sql="select name, value from ".MAIN_DB_PREFIX."const";
$this->boxes[$reg[1]][0] = "(ExternalRSSInformations)"; $sql.= " WHERE name like 'EXTERNAL_RSS_TITLE_%'";
$this->boxes[$reg[1]][1] = "box_external_rss.php"; $result=$this->db->query($sql);
$this->boxes[$reg[1]][2] = $reg[1]." (".$obj->value.")"; 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.
/** */
* \brief Fonction appelée lors de la désactivation d'un module. function remove()
* Supprime de la base les constantes, boites et permissions du module. {
*/ $sql = array();
function remove()
{ // Supprime anciennes delcarations de la boite RSS
$sql = array(); $this->boxes[0][1] = "box_external_rss.php";
// Supprime anciennes delcarations de la boite RSS return $this->_remove($sql);
$this->boxes[0][1] = "box_external_rss.php"; }
return $this->_remove($sql);
}
} }
?> ?>

View File

@ -30,6 +30,7 @@
*/ */
require_once(FPDF_PATH.'fpdf.php'); 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
/** /**

View File

@ -40,7 +40,7 @@ require_once(DOL_DOCUMENT_ROOT."/product.class.php");
class pdf_propale_azur extends ModelePDFPropales class pdf_propale_azur extends ModelePDFPropales
{ {
var $emetteur; // Objet societe qui emet var $emetteur; // Objet societe qui emet
/** /**
\brief Constructeur \brief Constructeur
@ -79,7 +79,7 @@ class pdf_propale_azur extends ModelePDFPropales
// Recupere emmetteur // Recupere emmetteur
$this->emetteur=$mysoc; $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 // Defini position des colonnes
$this->posxdesc=$this->marge_gauche+1; $this->posxdesc=$this->marge_gauche+1;
@ -92,11 +92,11 @@ class pdf_propale_azur extends ModelePDFPropales
$this->tva=array(); $this->tva=array();
$this->atleastoneratenotnull=0; $this->atleastoneratenotnull=0;
$this->atleastonediscount=0; $this->atleastonediscount=0;
} }
/** /**
\brief Fonction générant la propale sur le disque \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 \return int 1=ok, 0=ko
*/ */
function write_pdf_file($propale,$outputlangs='') function write_pdf_file($propale,$outputlangs='')
@ -121,6 +121,7 @@ class pdf_propale_azur extends ModelePDFPropales
$propale = new Propal($this->db,"",$id); $propale = new Propal($this->db,"",$id);
$ret=$propale->fetch($id); $ret=$propale->fetch($id);
} }
$deja_regle = "";
// Définition de $dir et $file // Définition de $dir et $file
if ($propale->specimen) if ($propale->specimen)
@ -172,9 +173,9 @@ class pdf_propale_azur extends ModelePDFPropales
} }
} }
// Tete de page
$this->_pagehead($pdf, $propale, 1, $outputlangs); $this->_pagehead($pdf, $propale, 1, $outputlangs);
// Affiches lignes
$pagenb = 1; $pagenb = 1;
$tab_top = 90; $tab_top = 90;
$tab_top_newpage = 50; $tab_top_newpage = 50;
@ -224,7 +225,7 @@ class pdf_propale_azur extends ModelePDFPropales
{ {
$prodser = new Product($this->db); $prodser = new Product($this->db);
$prodser->fetch($propale->lignes[$i]->fk_product); $prodser->fetch($propale->lignes[$i]->fk_product);
// On ajoute la ref // On ajoute la ref
if ($prodser->ref) if ($prodser->ref)
{ {
@ -275,7 +276,7 @@ class pdf_propale_azur extends ModelePDFPropales
$pdf->SetXY ($this->posxup, $curY); $pdf->SetXY ($this->posxup, $curY);
$pdf->MultiCell(18, 4, price($propale->lignes[$i]->subprice), 0, 'R', 0); $pdf->MultiCell(18, 4, price($propale->lignes[$i]->subprice), 0, 'R', 0);
// Quantit // Quantité
$pdf->SetXY ($this->posxqty, $curY); $pdf->SetXY ($this->posxqty, $curY);
$pdf->MultiCell(10, 4, $propale->lignes[$i]->qty, 0, 'R'); $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 $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) 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 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); $this->_pagefoot($pdf,$outputlangs);
// Nouvelle page // Nouvelle page
@ -319,138 +324,31 @@ class pdf_propale_azur extends ModelePDFPropales
} }
} }
// Affiche cadre tableau // Affiche cadre tableau
if ($pagenb == 1) 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); $this->_tableau($pdf, $tab_top, $nexY - $tab_top + 20, $nexY, $outputlangs);
$bottomlasttab=$tab_top + $nexY - $tab_top + 20 + 1; $bottomlasttab=$tab_top + $nexY - $tab_top + 20 + 1;
} }
else 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); $this->_tableau($pdf, $tab_top_newpage, $nexY - $tab_top_newpage + 20, $nexY, $outputlangs);
$bottomlasttab=$tab_top_newpage + $nexY - $tab_top_newpage + 20 + 1; $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); $posy=$this->_tableau_tot($pdf, $propale, $deja_regle, $bottomlasttab, $outputlangs);
// Affiche zone versements
if ($deja_regle) { if ($deja_regle) {
$this->_tableau_versements($pdf, $fac, $posy, $outputlangs); $posy=$this->_tableau_versements($pdf, $propale, $posy, $outputlangs);
} }
/* // Pied de page
* 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
*/
$this->_pagefoot($pdf, $outputlangs); $this->_pagefoot($pdf, $outputlangs);
$pdf->AliasNbPages(); $pdf->AliasNbPages();
@ -481,25 +379,182 @@ class pdf_propale_azur extends ModelePDFPropales
} }
/* /*
* \brief Affiche le total à payer * \brief Affiche tableau des versement
* \param pdf Objet PDF * \param pdf objet PDF
* \param prop Objet propale * \param propale objet propale
* \param deja_regle Montant deja regle */
* \return y Position pour suite 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) function _tableau_tot(&$pdf, $propale, $deja_regle, $posy, $outputlangs)
{ {
$tab2_top = $posy; $tab2_top = $posy;
$tab2_hl = 5; $tab2_hl = 5;
$tab2_height = $tab2_hl * 4; $tab2_height = $tab2_hl * 4;
$pdf->SetFont('Arial','', 9); $pdf->SetFont('Arial','', 8);
// 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 // Tableau total
$lltot = 200; $col1x = 120; $col2x = 182; $largcol2 = $lltot - $col2x; $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->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($propale->total_ttc), $useborder, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($propale->total_ttc), $useborder, 'R', 1);
$pdf->SetFont('Arial','', 9);
$pdf->SetTextColor(0,0,0); $pdf->SetTextColor(0,0,0);
if ($deja_regle > 0) if ($deja_regle > 0)
@ -584,14 +638,31 @@ class pdf_propale_azur extends ModelePDFPropales
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle), 0, 'R', 0); $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++; $index++;
$pdf->SetTextColor(0,0,60); $pdf->SetTextColor(0,0,60);
//$pdf->SetFont('Arial','B', 9); $pdf->SetFillColor(224,224,224);
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->trans("RemainderToPay"), $useborder, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->trans("RemainderToPay"), $useborder, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($propale->total_ttc - $deja_regle), $useborder, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($propale->total_ttc - $deja_regle), $useborder, 'R', 1);
// Fin
$pdf->SetFont('Arial','', 9); $pdf->SetFont('Arial','', 9);
$pdf->SetTextColor(0,0,0); $pdf->SetTextColor(0,0,0);
} }
@ -607,7 +678,7 @@ class pdf_propale_azur extends ModelePDFPropales
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs) function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs)
{ {
global $conf; global $conf;
// Montants exprimés en (en tab_top - 1) // Montants exprimés en (en tab_top - 1)
$pdf->SetTextColor(0,0,0); $pdf->SetTextColor(0,0,0);
$pdf->SetFont('Arial','',8); $pdf->SetFont('Arial','',8);
@ -619,9 +690,9 @@ class pdf_propale_azur extends ModelePDFPropales
// Rect prend une longueur en 3eme param // 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); $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 // 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->SetXY ($this->posxdesc-1, $tab_top+2);
$pdf->MultiCell(108,2, $outputlangs->trans("Designation"),'','L'); $pdf->MultiCell(108,2, $outputlangs->trans("Designation"),'','L');
@ -708,18 +779,18 @@ class pdf_propale_azur extends ModelePDFPropales
$pdf->SetXY(100,$posy); $pdf->SetXY(100,$posy);
$pdf->SetTextColor(0,0,60); $pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 4, $outputlangs->trans("Ref")." : " . $propale->ref, '', 'R'); $pdf->MultiCell(100, 4, $outputlangs->trans("Ref")." : " . $propale->ref, '', 'R');
$pdf->SetFont('Arial','',12); $pdf->SetFont('Arial','',10);
$posy+=6; $posy+=6;
$pdf->SetXY(100,$posy); $pdf->SetXY(100,$posy);
$pdf->SetTextColor(0,0,60); $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->SetXY(100,$posy);
$pdf->SetTextColor(0,0,60); $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) if ($showadress)
{ {
@ -803,6 +874,7 @@ class pdf_propale_azur extends ModelePDFPropales
*/ */
function _pagefoot(&$pdf,$outputlangs) function _pagefoot(&$pdf,$outputlangs)
{ {
global $conf;
$html=new Form($this->db); $html=new Form($this->db);
// Premiere ligne d'info réglementaires // Premiere ligne d'info réglementaires
@ -875,7 +947,7 @@ class pdf_propale_azur extends ModelePDFPropales
function _dol_htmlentities($stringtoencode,$isstringalreadyhtml) function _dol_htmlentities($stringtoencode,$isstringalreadyhtml)
{ {
global $conf; global $conf;
if ($isstringalreadyhtml) return $stringtoencode; if ($isstringalreadyhtml) return $stringtoencode;
if ($conf->fckeditor->enabled) return htmlentities($stringtoencode); if ($conf->fckeditor->enabled) return htmlentities($stringtoencode);
return $stringtoencode; return $stringtoencode;

View File

@ -193,7 +193,7 @@ if ($_POST["action"] == "set")
$dir[4] = "$main_data_dir/ficheinter"; $dir[4] = "$main_data_dir/ficheinter";
$dir[5] = "$main_data_dir/produit"; $dir[5] = "$main_data_dir/produit";
$dir[6] = "$main_data_dir/rapport"; $dir[6] = "$main_data_dir/rapport";
$dir[7] = "$main_data_dir/rsscache"; $dir[7] = "$main_data_dir/rss";
$dir[8] = "$main_data_dir/logo"; $dir[8] = "$main_data_dir/logo";
// Boucle sur chaque répertoire de dir[] pour les créer s'ils nexistent pas // Boucle sur chaque répertoire de dir[] pour les créer s'ils nexistent pas

View File

@ -127,7 +127,7 @@ if (isset($_POST['action']) && $_POST['action'] == 'upgrade')
// Les autres path // Les autres path
if (! defined('FPDF_FONTPATH')) { define('FPDF_FONTPATH', FPDF_PATH . 'font/'); } if (! defined('FPDF_FONTPATH')) { define('FPDF_FONTPATH', FPDF_PATH . 'font/'); }
if (! defined('MAGPIE_DIR')) { define('MAGPIE_DIR', MAGPIERSS_PATH); } 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'); }
/*************************************************************************************** /***************************************************************************************

View File

@ -82,9 +82,13 @@ OtherBills=Other invoices
DraftBills=Draft invoices DraftBills=Draft invoices
Unpayed=Unpayed Unpayed=Unpayed
ConfirmDeleteBill=Are you sure you want to delete this invoice ? ConfirmDeleteBill=Are you sure you want to delete this invoice ?
ConfirmValidateBill=Are you sure you want to validate this invoice with reference %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 %s to status payed ? ConfirmClassifyPayedBill=Are you sure you want to change invoice <b>%s</b> to status payed ?
ConfirmCancelBill=Are you sure you want to cancel invoice %s ? 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 ValidateBill=Validate invoice
NumberOfBills=Nb of invoices NumberOfBills=Nb of invoices
NumberOfBillsByMonth=Nb of invoices by month NumberOfBillsByMonth=Nb of invoices by month
@ -94,6 +98,7 @@ File=File
AlreadyPayed=Already payed AlreadyPayed=Already payed
RemainderToPay=Remainder to pay RemainderToPay=Remainder to pay
RemainderToTake=Remainder to take RemainderToTake=Remainder to take
EscompteOffered=Discount offered (payment before term)
CreateDraft=Create draft CreateDraft=Create draft
SendBillRef=Send invoice %s SendBillRef=Send invoice %s
SendReminderBillRef=Send invoice %s (reminder) SendReminderBillRef=Send invoice %s (reminder)

View File

@ -329,6 +329,7 @@ Undo=Undo
Redo=Redo Redo=Redo
ExpandAll=Expand all ExpandAll=Expand all
UndoExpandAll=Undo expand UndoExpandAll=Undo expand
Reason=Raison
# Countries # Countries
CountryFR=France CountryFR=France
CountryBE=Belgium CountryBE=Belgium

View File

@ -82,9 +82,13 @@ OtherBills=Autres factures
DraftBills=Factures brouillons DraftBills=Factures brouillons
Unpayed=Impayées Unpayed=Impayées
ConfirmDeleteBill=Êtes-vous sûr de vouloir supprimer cette facture ? 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 ? 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 %s comme payée ? 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 %s ? 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 ValidateBill=Valider facture
NumberOfBills=Nb de factures NumberOfBills=Nb de factures
NumberOfBillsByMonth=Nb de factures par mois NumberOfBillsByMonth=Nb de factures par mois
@ -94,6 +98,7 @@ File=Fichier
AlreadyPayed=Déjà réglé AlreadyPayed=Déjà réglé
RemainderToPay=Reste à payer RemainderToPay=Reste à payer
RemainderToTake=Reste à encaisser RemainderToTake=Reste à encaisser
EscompteOffered=Escompte (paiement avant échéance)
CreateDraft=Créer brouillon CreateDraft=Créer brouillon
SendBillRef=Envoi facture %s SendBillRef=Envoi facture %s
SendReminderBillRef=Relance facture %s SendReminderBillRef=Relance facture %s

View File

@ -329,6 +329,7 @@ Undo=Annuler
Redo=Refaire Redo=Refaire
ExpandAll=Tout dérouler ExpandAll=Tout dérouler
UndoExpandAll=Annuler déroulement UndoExpandAll=Annuler déroulement
Reason=Raison
# Countries # Countries
CountryFR=France CountryFR=France
CountryBE=Belgique CountryBE=Belgique

View File

@ -238,22 +238,6 @@ class Livraison extends CommonObject
$this->modelpdf = $obj->model_pdf; $this->modelpdf = $obj->model_pdf;
$this->db->free(); $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; if ($this->statut == 0) $this->brouillon = 1;
$file = $conf->livraison->dir_output . "/" .get_exdir($livraison->id) . "/" . $this->id.".pdf"; $file = $conf->livraison->dir_output . "/" .get_exdir($livraison->id) . "/" . $this->id.".pdf";

View File

@ -170,7 +170,7 @@ if (! defined('TCPDF_PATH')) { define('TCPDF_PATH', DOL_DOCUMEN
// Les autres path // Les autres path
if (! defined('FPDF_FONTPATH')) { define('FPDF_FONTPATH', FPDF_PATH . 'font/'); } if (! defined('FPDF_FONTPATH')) { define('FPDF_FONTPATH', FPDF_PATH . 'font/'); }
if (! defined('MAGPIE_DIR')) { define('MAGPIE_DIR', MAGPIERSS_PATH); } 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 // \todo Ajouter la ligne
// require_once(DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php"); // require_once(DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php");

View File

@ -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) if ($obj->fk_statut == 0)
{ {
$this->brouillon = 1; $this->brouillon = 1;

View File

@ -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: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; } a:hover { font: verdana, arial, helvetica, sans-serif; font-weight: bold; color: #000000; text-decoration: none; }
input input
{ {
font: 12px helvetica, verdana, arial, sans-serif; font: 12px helvetica, verdana, arial, sans-serif;
background: #FDFDFD; background: #FDFDFD;
border: 1px solid #ACBCBB; border: 1px solid #ACBCBB;
padding: 0px 0px 0px 0px; padding: 0px 0px 0px 0px;
margin: 0px 0px 0px 0px; margin: 0px 0px 0px 0px;
} }
input.flat input.flat
{ {
font: 12px helvetica, verdana, arial, sans-serif; font: 12px helvetica, verdana, arial, sans-serif;
background: #FDFDFD; background: #FDFDFD;
border: 1px solid #ACBCBB; border: 1px solid #ACBCBB;
@ -78,7 +78,7 @@ textarea {
margin: 0px 0px 0px 0px; margin: 0px 0px 0px 0px;
} }
textarea.flat textarea.flat
{ {
font: 12px helvetica, verdana, arial, sans-serif; font: 12px helvetica, verdana, arial, sans-serif;
background: #FDFDFD; background: #FDFDFD;
border: 1px solid #ACBCBB; border: 1px solid #ACBCBB;
@ -113,7 +113,7 @@ div.vmenuplusfiche
top: auto; top: auto;
left: auto; left: auto;
position: static; position: static;
float: left; float: left;
display: block; display: block;
margin-right: 6px; margin-right: 6px;
margin-left: 1px; margin-left: 1px;
@ -163,9 +163,9 @@ div.tmenu
font-weight: bold; font-weight: bold;
font-size: 12px; font-size: 12px;
height: 19px; height: 19px;
background: #b3c5cc; background: #b3c5cc;
background-image : url(<?php echo $dolibarr_main_url_root.'/theme/eldy/img/tmenu.jpg' ?>); background-image : url(<?php echo $dolibarr_main_url_root.'/theme/eldy/img/tmenu.jpg' ?>);
color: #000000; color: #000000;
text-decoration: none; text-decoration: none;
} }
@ -193,7 +193,7 @@ a.tmenu:visited
font-weight: bold; font-weight: bold;
} }
a.tmenu#sel a.tmenu#sel
{ {
color: #234046; color: #234046;
padding: 0px 8px 0px 8px; padding: 0px 8px 0px 8px;
margin: 0px 0px 2px 0px; margin: 0px 0px 2px 0px;
@ -282,7 +282,7 @@ div.blockvmenupair
border-right: 1px solid #555555; border-right: 1px solid #555555;
border-bottom: 1px solid #555555; border-bottom: 1px solid #555555;
font: helvetica, verdana, arial, sans-serif; font: helvetica, verdana, arial, sans-serif;
color: #000000; color: #000000;
text-align:left; text-align:left;
text-decoration: none; text-decoration: none;
padding: 3px; padding: 3px;
@ -298,7 +298,7 @@ div.blockvmenuimpair
border-right: 1px solid #555555; border-right: 1px solid #555555;
border-bottom: 1px solid #555555; border-bottom: 1px solid #555555;
font: helvetica, verdana, arial, sans-serif; font: helvetica, verdana, arial, sans-serif;
color: #000000; color: #000000;
text-align:left; text-align:left;
text-decoration: none; text-decoration: none;
padding: 3px; padding: 3px;
@ -315,7 +315,7 @@ div.help
border-bottom: 1px solid #000000; border-bottom: 1px solid #000000;
background: #f0f0f0; background: #f0f0f0;
font: helvetica, verdana, arial, sans-serif; font: helvetica, verdana, arial, sans-serif;
color: #000000; color: #000000;
text-align:left; text-align:left;
text-decoration: none; text-decoration: none;
padding: 3px; padding: 3px;
@ -323,23 +323,23 @@ div.help
} }
td.barre { td.barre {
border-right: 1px solid #000000; border-right: 1px solid #000000;
border-bottom: 1px solid #000000; border-bottom: 1px solid #000000;
background: #b3c5cc; background: #b3c5cc;
font: helvetica, verdana, arial, sans-serif; font: helvetica, verdana, arial, sans-serif;
color: #000000; color: #000000;
text-align:left; text-align:left;
text-decoration: none; text-decoration: none;
} }
td.barre_select { td.barre_select {
background: #b3c5cc; background: #b3c5cc;
color: #000000; color: #000000;
} }
td.photo { td.photo {
background: #F4F4F4; background: #F4F4F4;
color: #000000; color: #000000;
border: 1px solid #b3c5cc; border: 1px solid #b3c5cc;
} }
@ -361,7 +361,7 @@ div.formsearch
background: #d0d4d7; background: #d0d4d7;
top: 0px; top: 0px;
left: 130px; left: 130px;
padding: 4px; padding: 4px;
vertical-align: middle; vertical-align: middle;
margin-bottom: 10px; margin-bottom: 10px;
} }
@ -414,7 +414,7 @@ div.onglet_inf
font-weight:bold; font-weight:bold;
font-size: 12px; font-size: 12px;
height: 19px; height: 19px;
color: #000000; color: #000000;
text-decoration: none; text-decoration: none;
} }
@ -517,52 +517,52 @@ a.tabimage {
a.butAction:link { font: 12px helvetica, verdana, arial, sans-serif; a.butAction:link { font: 12px helvetica, verdana, arial, sans-serif;
font-weight: bold; font-weight: bold;
background: white; background: white;
border: 1px solid #8CACBB; 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;
color: #436976; color: #436976;
padding: 0em 0.7em; padding: 0em 0.7em;
margin: 0em 0.5em; margin: 0em 0.5em;
text-decoration: none; text-decoration: none;
white-space: nowrap; } 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; font-weight: bold;
background: #dee7ec; background: white;
border: 1px solid #8CACBB; border: 1px solid #8CACBB;
color: #436976; color: #436976;
padding: 0em 0.7em; padding: 0em 0.7em;
margin: 0em 0.5em; margin: 0em 0.5em;
text-decoration: none; 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; } white-space: nowrap; }
a.butActionRefuse { font: 12px helvetica, verdana, arial, sans-serif; a.butActionRefuse { font: 12px helvetica, verdana, arial, sans-serif;
font-weight: bold; font-weight: bold;
background: white; background: white;
border: 1px solid red; border: 1px solid red;
color: #436976; color: #436976;
padding: 0em 0.7em; padding: 0em 0.7em;
margin: 0em 0.5em; margin: 0em 0.5em;
text-decoration: none; text-decoration: none;
white-space: nowrap; } white-space: nowrap; }
a.butActionRefuse:hover { font: 12px helvetica, verdana, arial, sans-serif; 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; a.butActionDelete { font: 12px helvetica, verdana, arial, sans-serif;
font-weight: bold; font-weight: bold;
background: white; background: white;
border: 1px solid red; border: 1px solid red;
color: #436976; color: #436976;
padding: 0em 0.7em; padding: 0em 0.7em;
margin: 0em 0.5em; margin: 0em 0.5em;
text-decoration: none; text-decoration: none;
white-space: nowrap; } 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; } 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: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: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.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: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: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: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; } 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 */ /* Tables */
/* ============================================================================== */ /* ============================================================================== */
@ -659,7 +659,7 @@ border-collapse: collapse;
width: 100%; width: 100%;
} }
tr.liste_titre { tr.liste_titre {
background: #7699A9; background: #7699A9;
background-image : url(<?php echo $dolibarr_main_url_root.'/theme/eldy/img/liste_titre.png' ?>); background-image : url(<?php echo $dolibarr_main_url_root.'/theme/eldy/img/liste_titre.png' ?>);
color: #334444; color: #334444;
@ -668,7 +668,7 @@ font-weight: bold;
border-bottom: 1px solid #FDFFFF; border-bottom: 1px solid #FDFFFF;
white-space: nowrap; white-space: nowrap;
} }
td.liste_titre { td.liste_titre {
background: #7699A9; background: #7699A9;
background-image : url(<?php echo $dolibarr_main_url_root.'/theme/eldy/img/liste_titre.png' ?>); background-image : url(<?php echo $dolibarr_main_url_root.'/theme/eldy/img/liste_titre.png' ?>);
color: #334444; color: #334444;
@ -678,29 +678,29 @@ border-bottom: 1px solid #FDFFFF;
white-space: nowrap; white-space: nowrap;
} }
td.liste_titre_sel td.liste_titre_sel
{ {
background: #7699A9; background: #7699A9;
background-image : url(<?php echo $dolibarr_main_url_root.'/theme/eldy/img/liste_titre.png' ?>); 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: helvetica, verdana, arial, sans-serif;
font-weight: bold; font-weight: bold;
border-bottom: 1px solid #FDFFFF; border-bottom: 1px solid #FDFFFF;
white-space: nowrap; white-space: nowrap;
} }
input.liste_titre { input.liste_titre {
background: #7699A9; background: #7699A9;
background-image : url(<?php echo $dolibarr_main_url_root.'/theme/eldy/img/liste_titre.png' ?>); background-image : url(<?php echo $dolibarr_main_url_root.'/theme/eldy/img/liste_titre.png' ?>);
border: 0px; border: 0px;
} }
tr.liste_total td { tr.liste_total td {
border-top: 1px solid #888888; border-top: 1px solid #888888;
background: #F4F4F4; background: #F4F4F4;
font-weight: bold; font-weight: bold;
white-space: nowrap; white-space: nowrap;
} }
th { th {
background: #7699A9; background: #7699A9;
color: #334444; color: #334444;
font: helvetica, verdana, arial, sans-serif; font: helvetica, verdana, arial, sans-serif;
@ -712,32 +712,32 @@ border-bottom: 1px solid #FFFFFF;
white-space: nowrap; white-space: nowrap;
} }
td.border { td.border {
border-top: 1px solid #000000; border-top: 1px solid #000000;
border-right: 1px solid #000000; border-right: 1px solid #000000;
border-bottom: 1px solid #000000; border-bottom: 1px solid #000000;
border-left: 1px solid #000000; border-left: 1px solid #000000;
} }
.pair { .pair {
background: #e6ebed; background: #e6ebed;
font: helvetica, verdana, arial, sans-serif; font: helvetica, verdana, arial, sans-serif;
border: 0px; border: 0px;
} }
/* /*
.pair:hover { .pair:hover {
background: #c0c4c7; background: #c0c4c7;
border: 0px; border: 0px;
} }
*/ */
.impair { .impair {
background: #d0d4d7; background: #d0d4d7;
font: helvetica, verdana, arial, sans-serif; font: helvetica, verdana, arial, sans-serif;
border: 0px; border: 0px;
} }
/* /*
.impair:hover { .impair:hover {
background: #c0c4c7; background: #c0c4c7;
border: 0px; border: 0px;
} }
@ -746,7 +746,7 @@ border: 0px;
/* /*
* Boxes * Boxes
*/ */
tr.box_titre { tr.box_titre {
background: #7699A9; background: #7699A9;
background-image : url(<?php echo $dolibarr_main_url_root.'/theme/eldy/img/liste_titre.png' ?>); background-image : url(<?php echo $dolibarr_main_url_root.'/theme/eldy/img/liste_titre.png' ?>);
color: #334444; color: #334444;
@ -756,17 +756,17 @@ border-bottom: 1px solid #FDFFFF;
white-space: nowrap; white-space: nowrap;
} }
tr.box_impair { tr.box_impair {
background: #e6ebed; background: #e6ebed;
font: 12px arial, helvetica, verdana, sans-serif; font: 12px arial, helvetica, verdana, sans-serif;
} }
tr.box_pair { tr.box_pair {
background: #d0d4d7; background: #d0d4d7;
font: 12px arial, helvetica, verdana, sans-serif; font: 12px arial, helvetica, verdana, sans-serif;
} }
tr.fiche { tr.fiche {
font: helvetica, verdana, arial, sans-serif; font: helvetica, verdana, arial, sans-serif;
} }
@ -789,7 +789,7 @@ div.warning {
} }
div.error { div.error {
color: #550000; font-weight: bold; color: #550000; font-weight: bold;
padding: 0.2em 0.2em 0.2em 0.2em; padding: 0.2em 0.2em 0.2em 0.2em;
margin: 0.5em 0em 0.5em 0em; margin: 0.5em 0em 0.5em 0em;
border: 1px solid #8C9CAB; border: 1px solid #8C9CAB;
@ -807,7 +807,7 @@ div.info {
* Liens Payes/Non payes * Liens Payes/Non payes
*/ */
a.normal:link { font-weight: normal } a.normal:link { font-weight: normal }
a.normal:visited { font-weight: normal } a.normal:visited { font-weight: normal }
a.normal:active { font-weight: normal } a.normal:active { font-weight: normal }
a.normal:hover { font-weight: normal } a.normal:hover { font-weight: normal }
@ -823,36 +823,49 @@ a.impayee:hover { font-weight: bold; color: #550000; }
/* /*
* Lignes titre espace * Lignes titre espace
*/ */
div.titre { div.titre {
font: helvetica, verdana, arial, sans-serif; font: helvetica, verdana, arial, sans-serif;
font-weight: bold; font-weight: bold;
color: #336666; color: #336666;
text-decoration: none } text-decoration: none }
/* ============================================================================== */ /* ============================================================================== */
* Formulaire confirmation /* Formulaire confirmation */
/* ============================================================================== */ /* ============================================================================== */
td.validtitle { table.valid {
font-weight: bold; border-top: solid 1px #E6E6E6;
background: #EECC55; border-left: solid 1px #E6E6E6;
} border-right: solid 1px #444444;
td.valid { border-bottom: solid 1px #555555;
background: #EECC55; 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; font-size: 10px;
} }
tr.nonpayed { tr.nonpayed {
font-weight: bold; font-weight: bold;
} }
div.version { div.version {
background: #F4F4F4; background: #F4F4F4;
text-align: right; text-align: right;
font-size: 9px; font-size: 9px;
@ -880,13 +893,13 @@ z-index: 100;
/* ============================================================================== */ /* ============================================================================== */
/* Calendar */ /* Calendar */
/* ============================================================================== */ /* ============================================================================== */
.bodyline { .bodyline {
-moz-border-radius:8px; -moz-border-radius:8px;
border: 1px #E4ECEC outset; border: 1px #E4ECEC outset;
padding:0px; padding:0px;
margin-bottom:5px; margin-bottom:5px;
} }
table.dp { table.dp {
width: 180px; width: 180px;
background-color: #FFFFFF; background-color: #FFFFFF;
border-top: solid 2px #DDDDDD; border-top: solid 2px #DDDDDD;
@ -896,10 +909,10 @@ table.dp {
} }
.dp td, .tpHour td, .tpMinute td{padding:2px; font-size:10px;} .dp td, .tpHour td, .tpMinute td{padding:2px; font-size:10px;}
/* Barre titre */ /* Barre titre */
.dpHead,.tpHead,.tpHour td:Hover .tpHead{ .dpHead,.tpHead,.tpHour td:Hover .tpHead{
font-weight:bold; font-weight:bold;
background-color:#b3c5cc; background-color:#b3c5cc;
color:white; color:white;
font-size:11px; font-size:11px;
cursor:auto; cursor:auto;
} }
@ -908,9 +921,9 @@ table.dp {
text-align:center; text-align:center;
background-color:#617389; background-color:#617389;
color:#FFFFFF; color:#FFFFFF;
font-weight:bold; font-weight:bold;
border: 1px outset black; border: 1px outset black;
cursor:pointer; cursor:pointer;
} }
.dpButtons:Active,.tpButtons:Active{border: 1px outset black;} .dpButtons:Active,.tpButtons:Active{border: 1px outset black;}
.dpDayNames td,.dpExplanation {background-color:#D9DBE1; font-weight:bold; text-align:center; font-size:11px;} .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:Hover {background-color:black; color:white; }
.tpMinute td {background-color:#D9DBE1; text-align:center; cursor:pointer;} .tpMinute td {background-color:#D9DBE1; text-align:center; cursor:pointer;}
/* Bouton X fermer */ /* Bouton X fermer */
.dpInvisibleButtons .dpInvisibleButtons
{ {
border-style:none; border-style:none;
@ -944,7 +957,7 @@ font-size:9px;
border-width:0px; border-width:0px;
color:#0B63A2; color:#0B63A2;
vertical-align:middle; vertical-align:middle;
cursor: pointer; cursor: pointer;
} }

View File

@ -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 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 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 note_public text after note;
alter table llx_propal add column remise_absolue real DEFAULT 0 after remise_percent; alter table llx_propal add column remise_absolue real DEFAULT 0 after remise_percent;

View File

@ -35,6 +35,10 @@ create table llx_facture
remise_percent real DEFAULT 0, -- remise relative remise_percent real DEFAULT 0, -- remise relative
remise_absolue real DEFAULT 0, -- remise absolue remise_absolue real DEFAULT 0, -- remise absolue
remise real DEFAULT 0, -- remise totale calculee 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 tva real DEFAULT 0, -- montant tva apres remise totale
total real DEFAULT 0, -- montant total ht apres remise totale total real DEFAULT 0, -- montant total ht apres remise totale
total_ttc real DEFAULT 0, -- montant total ttc apres remise totale total_ttc real DEFAULT 0, -- montant total ttc apres remise totale