Gestion d'affichage de specimen sur propale

This commit is contained in:
Laurent Destailleur 2006-06-12 22:20:24 +00:00
parent 4aeb30dd08
commit 0d3affa1f8
17 changed files with 1100 additions and 1028 deletions

View File

@ -22,7 +22,7 @@
* $Source$
*/
/**
/**
\file htdocs/admin/facture.php
\ingroup facture
\brief Page d'administration/configuration du module Facture
@ -96,7 +96,7 @@ if ($_GET["action"] == 'del')
if ($_GET["action"] == 'setdoc')
{
$db->begin();
if (dolibarr_set_const($db, "FACTURE_ADDON_PDF",$_GET["value"]))
{
// La constante qui a été lue en avant du nouveau set
@ -111,7 +111,7 @@ if ($_GET["action"] == 'setdoc')
$result1=$db->query($sql_del);
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom,type) VALUES ('".$_GET["value"]."','".$type."')";
$result2=$db->query($sql);
if ($result1 && $result2)
if ($result1 && $result2)
{
$db->commit();
}
@ -214,18 +214,18 @@ while (($file = readdir($handle))!==false)
print '<tr '.$bc[$var].'><td width="100">';
echo "$file";
print "</td><td>\n";
// Chargement de la classe de numérotation
require_once($dir.$filebis);
$classname = "mod_facture_".$file;
$module = new $classname($db);
print $module->info();
print '</td>';
// Affiche example
print '<td nowrap="nowrap">'.$module->getExample().'</td>';
print '<td align="center">';
if ($conf->global->FACTURE_ADDON == "$file")
{
@ -236,7 +236,7 @@ while (($file = readdir($handle))!==false)
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$file.'" alt="'.$langs->trans("Default").'">'.$langs->trans("Default").'</a>';
}
print '</td>';
// Info
$htmltooltip='';
$nextval=$module->getNextValue();
@ -247,7 +247,7 @@ while (($file = readdir($handle))!==false)
print '<td align="center" '.$html->tooltip_properties($htmltooltip).'>';
print ($htmltooltip?img_help(0):'');
print '</td>';
print "</tr>\n";
}
}
@ -306,7 +306,7 @@ while (($file = readdir($handle))!==false)
$var = !$var;
$name = substr($file, 4, strlen($file) -16);
$classname = substr($file, 0, strlen($file) -12);
print '<tr '.$bc[$var].'><td width="100">';
echo "$name";
print "</td><td>\n";
@ -315,12 +315,12 @@ while (($file = readdir($handle))!==false)
$module = new $classname($db);
print $module->description;
print '</td>';
// Activé
if (in_array($name, $def))
{
print "<td align=\"center\">\n";
if ($conf->global->FACTURE_ADDON_PDF != "$name")
if ($conf->global->FACTURE_ADDON_PDF != "$name")
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'">';
print img_tick($langs->trans("Disable"));
@ -350,7 +350,7 @@ while (($file = readdir($handle))!==false)
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'" alt="'.$langs->trans("Default").'">'.$langs->trans("Default").'</a>';
}
print '</td>';
// Info
$htmltooltip = '<b>'.$langs->trans("Type").'</b>: '.($module->type?$module->type:$langs->trans("Unknown"));
$htmltooltip.='<br><b>'.$langs->trans("Width").'</b>: '.$module->page_largeur;
@ -410,11 +410,11 @@ if ($conf->banque->enabled)
{
$var=!$var;
$row = $db->fetch_row($resql);
print '<option value="'.$row[0].'"';
print $conf->global->FACTURE_RIB_NUMBER == $row[0] ? ' selected="true"':'';
print '>'.$row[1].'</option>';
$i++;
}
print "</select>";
@ -450,7 +450,7 @@ if ($resql)
{
$var=!$var;
$row = $db->fetch_row($resql);
print '<option value="'.$row[0].'"';
print $conf->global->FACTURE_CHQ_NUMBER == $row[0] ? ' selected="true"':'';
print '>'.$langs->trans("OwnerOfBankAccount",$row[1]).'</option>';

View File

@ -31,6 +31,7 @@
*/
require("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/propal.class.php");
$langs->load("admin");
$langs->load("bills");
@ -44,7 +45,32 @@ if (!$user->admin)
/*
* Actions
*/
if ($_GET["action"] == 'specimen')
{
$modele=$_GET["module"];
$propal = new Propal($db);
$propal->initAsSpecimen();
// Charge le modele
$dir = DOL_DOCUMENT_ROOT . "/includes/modules/propale/";
$file = "pdf_propale_".$modele.".modules.php";
if (file_exists($dir.$file))
{
$classname = "pdf_propale_".$modele;
require_once($dir.$file);
$obj = new $classname($db);
if ($obj->write_pdf_file($propal) > 0)
{
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=propal&file=SPECIMEN.pdf");
return;
}
}
}
if ($_POST["action"] == 'nbprod')
{
dolibarr_set_const($db, "PROPALE_NEW_FORM_NB_PRODUCT",$_POST["value"]);
@ -88,7 +114,7 @@ if ($_GET["action"] == 'del')
if ($_GET["action"] == 'setdoc')
{
$db->begin();
if (dolibarr_set_const($db, "PROPALE_ADDON_PDF",$_GET["value"]))
{
// La constante qui a été lue en avant du nouveau set
@ -103,7 +129,7 @@ if ($_GET["action"] == 'setdoc')
$result1=$db->query($sql_del);
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom,type) VALUES ('".$_GET["value"]."','".$type."')";
$result2=$db->query($sql);
if ($result1 && $result2)
if ($result1 && $result2)
{
$db->commit();
}
@ -175,7 +201,7 @@ if ($handle)
print '<tr '.$bc[$var].'><td>'.$module->nom."</td><td>\n";
print $module->info();
print '</td>';
// Examples
print '<td nowrap="nowrap">'.$module->getExample()."</td>\n";
@ -273,7 +299,7 @@ while (($file = readdir($handle))!==false)
if (in_array($name, $def))
{
print "<td align=\"center\">\n";
if ($conf->global->PROPALE_ADDON_PDF != "$name")
if ($conf->global->PROPALE_ADDON_PDF != "$name")
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'">';
print img_tick($langs->trans("Disable"));
@ -303,7 +329,7 @@ while (($file = readdir($handle))!==false)
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'" alt="'.$langs->trans("Default").'">'.$langs->trans("Default").'</a>';
}
print '</td>';
// Info
$htmltooltip = '<b>'.$langs->trans("Type").'</b>: '.($obj->type?$obj->type:$langs->trans("Unknown"));
$htmltooltip.='<br><b>'.$langs->trans("Width").'</b>: '.$obj->page_largeur;
@ -312,7 +338,9 @@ while (($file = readdir($handle))!==false)
$htmltooltip.='<br><b>'.$langs->trans("Logo").'</b>: '.yn($obj->option_logo);
$htmltooltip.='<br><b>'.$langs->trans("PaymentMode").'</b>: '.yn($obj->option_modereg);
$htmltooltip.='<br><b>'.$langs->trans("PaymentConditions").'</b>: '.yn($obj->option_condreg);
print '<td align="center" '.$html->tooltip_properties($htmltooltip).'>'.img_help(0).'</td>';
print '<td align="center" '.$html->tooltip_properties($htmltooltip).'>';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'" alt="" title="">'.img_help(0,0).'</a>';
print '</td>';
print "</tr>\n";
}
@ -397,7 +425,7 @@ if ($conf->commande->enabled)
print '</tr>';
print '</table>';
print '</form>';
print '<br>';
}

View File

@ -59,7 +59,7 @@ $month=isset($_GET["month"])?$_GET["month"]:"";
// Sécurité accés client
$socidp='';
if ($_GET["socidp"]) { $socidp=$_GET["socidp"]; }
if ($user->societe_id > 0)
if ($user->societe_id > 0)
{
$action = '';
$socidp = $user->societe_id;
@ -139,10 +139,10 @@ if ($_POST['action'] == 'setdeliveryadress' && $user->rights->propale->creer)
if ($result < 0) dolibarr_print_error($db,$propal->error);
}
if ($_POST['action'] == 'add')
if ($_POST['action'] == 'add')
{
$propal = new Propal($db, $_POST['socidp']);
/*
* Si on seléctionné une propal à copier, on réalise la copie
*/
@ -180,15 +180,15 @@ if ($_POST['action'] == 'add')
$propal->duree_validite = $_POST['duree_validite'];
$propal->cond_reglement_id = $_POST['cond_reglement_id'];
$propal->mode_reglement_id = $_POST['mode_reglement_id'];
$propal->contactid = $_POST['contactidp'];
$propal->projetidp = $_POST['projetidp'];
$propal->modelpdf = $_POST['model'];
$propal->author = $user->id;
$propal->note = $_POST['note'];
$propal->ref = $_POST['ref'];
for ($i = 1 ; $i <= PROPALE_NEW_FORM_NB_PRODUCT ; $i++)
{
if ($_POST['idprod'.$i])
@ -199,7 +199,7 @@ if ($_POST['action'] == 'add')
$propal->add_product($_POST[$xid],$_POST[$xqty],$_POST[$xremise]);
}
}
$id = $propal->create();
}
/*
@ -208,7 +208,7 @@ if ($_POST['action'] == 'add')
if ($id > 0)
{
propale_pdf_create($db, $id, $_POST['model']);
Header ('Location: '.$_SERVER["PHP_SELF"].'?propalid='.$id);
exit;
}
@ -222,7 +222,7 @@ if ($_POST['action'] == 'add')
/*
* Cloture de la propale
*/
if ($_POST['action'] == 'setstatut' && $user->rights->propale->cloturer)
if ($_POST['action'] == 'setstatut' && $user->rights->propale->cloturer)
{
if (! $_POST['cancel'])
{
@ -265,25 +265,25 @@ if ($_POST['action'] == 'send')
$replyto = $_POST['replytoname']. ' <' . $_POST['replytomail'].'>';
$message = $_POST['message'];
$sendtocc = $_POST['sendtocc'];
if ($_POST['action'] == 'send')
{
$subject = $_POST['subject'];
if($subject == '')
{
$subject = $langs->trans('Propal').' '.$propal->ref;
}
$actiontypeid=3;
$actionmsg ='Mail envoyé par '.$from.' à '.$sendto.'.<br>';
if ($message)
{
$actionmsg.='Texte utilisé dans le corps du message:<br>';
$actionmsg.=$message;
}
$actionmsg2='Envoi Propal par mail';
}
@ -357,7 +357,7 @@ if ($_GET['action'] == 'commande')
$propal->create_commande($user);
}
if ($_GET['action'] == 'modif' && $user->rights->propale->creer)
if ($_GET['action'] == 'modif' && $user->rights->propale->creer)
{
/*
* Repasse la propale en mode brouillon
@ -372,7 +372,7 @@ if ($_POST['action'] == "setabsolutediscount" && $user->rights->propale->creer)
{
$propal = new Propal($db);
$ret=$propal->fetch($_POST['propalid']);
if ($_POST["remise_id"])
{
$propal->insert_discount($_POST["remise_id"]);
@ -382,23 +382,23 @@ if ($_POST['action'] == "setabsolutediscount" && $user->rights->propale->creer)
/*
* Ajout d'une ligne produit dans la propale
*/
if ($_POST['action'] == "addligne" && $user->rights->propale->creer)
if ($_POST['action'] == "addligne" && $user->rights->propale->creer)
{
if ($_POST['qty'] && (($_POST['np_price']!=0 && $_POST['np_desc']) || $_POST['idprod']))
{
$propal = new Propal($db);
$ret=$propal->fetch($_POST['propalid']);
if (isset($_POST['np_tva_tx']))
{
$propal->insert_product_generic(
$_POST['np_desc'],
$_POST['np_price'],
$_POST['np_desc'],
$_POST['np_price'],
$_POST['qty'],
$_POST['np_tva_tx'],
$_POST['np_remise']);
}
else
else
{
$propal->insert_product(
$_POST['idprod'],
@ -410,7 +410,7 @@ if ($_POST['action'] == "addligne" && $user->rights->propale->creer)
}
}
if ($_POST['action'] == 'updateligne' && $user->rights->propale->creer && $_POST["save"] == $langs->trans("Save"))
if ($_POST['action'] == 'updateligne' && $user->rights->propale->creer && $_POST["save"] == $langs->trans("Save"))
{
/*
* Mise à jour d'une ligne dans la propale
@ -433,7 +433,7 @@ if ($_REQUEST['action'] == 'builddoc' && $user->rights->propale->creer)
}
if ($_GET['action'] == 'del_ligne' && $user->rights->propale->creer && !$conf->global->PRODUIT_CONFIRM_DELETE_LINE)
if ($_GET['action'] == 'del_ligne' && $user->rights->propale->creer && !$conf->global->PRODUIT_CONFIRM_DELETE_LINE)
{
/*
* Supprime une ligne produit dans la propale
@ -460,7 +460,7 @@ if ($_POST['action'] == 'set_contact')
// Conditions de règlement
if ($_POST["action"] == 'setconditions')
{
{
$propal = new Propal($db, $_GET["propalid"]);
$propal->cond_reglement_id = $_POST['cond_reglement_id'];
$sql = "UPDATE ".MAIN_DB_PREFIX."propal";
@ -546,7 +546,7 @@ if ($_GET['propalid'] > 0)
$html->form_confirm($_SERVER["PHP_SELF"].'?propalid='.$propal->id, $langs->trans('DeleteProp'), $langs->trans('ConfirmDeleteProp'), 'confirm_delete');
print '<br>';
}
/*
* Confirmation de la suppression d'une ligne produit
*/
@ -1490,7 +1490,7 @@ else
if (!$user->rights->commercial->client->voir && !$socidp) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
if ($sall) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'propaldet as pd ON p.rowid=pd.fk_propal';
$sql.= ' WHERE p.fk_soc = s.idp';
if (!$user->rights->commercial->client->voir && !$socidp) //restriction
{
$sql .= " AND s.idp = sc.fk_soc AND sc.fk_user = " .$user->id;
@ -1508,10 +1508,10 @@ else
$sql .= " AND p.price='".addslashes($_GET['search_montant_ht'])."'";
}
if ($sall) $sql.= " AND (s.nom like '%".addslashes($sall)."%' OR p.note like '%".addslashes($sall)."%' OR pd.description like '%".addslashes($sall)."%')";
if ($socidp) $sql .= ' AND s.idp = '.$socidp;
if ($socidp) $sql .= ' AND s.idp = '.$socidp;
if ($_GET['viewstatut'] <> '')
{
$sql .= ' AND p.fk_statut in ('.$_GET['viewstatut'].')';
$sql .= ' AND p.fk_statut in ('.$_GET['viewstatut'].')';
}
if ($month > 0)
{
@ -1571,7 +1571,7 @@ else
$var=!$var;
print '<tr '.$bc[$var].'>';
print '<td><a href="'.$_SERVER["PHP_SELF"].'?propalid='.$objp->propalid.'">'.img_object($langs->trans('ShowPropal'),'propal').' '.$objp->ref."</a></td>\n";
if ($objp->client == 1)
{
$url = DOL_URL_ROOT.'/comm/fiche.php?socid='.$objp->idp;
@ -1583,18 +1583,18 @@ else
// Société
print '<td><a href="'.$url.'">'.img_object($langs->trans('ShowCompany'),'company').' '.$objp->nom.'</a></td>';
// Date propale
print '<td align="center">';
$y = strftime('%Y',$objp->dp);
$m = strftime('%m',$objp->dp);
print strftime('%d',$objp->dp)."\n";
print ' <a href="'.$_SERVER["PHP_SELF"].'?year='.$y.'&amp;month='.$m.'">';
print dolibarr_print_date($objp->dp,'%b')."</a>\n";
print ' <a href="'.$_SERVER["PHP_SELF"].'?year='.$y.'">';
print strftime('%Y',$objp->dp)."</a></td>\n";
// Date fin validite
if ($objp->dfv)
{
@ -1606,15 +1606,15 @@ else
{
print '<td>&nbsp;</td>';
}
print '<td align="right">'.price($objp->price)."</td>\n";
$propal=New Propal($db);
print '<td align="right">'.$propal->LibStatut($objp->fk_statut,5)."</td>\n";
print "</tr>\n";
$total = $total + $objp->price;
$subtotal = $subtotal + $objp->price;
$i++;
}
print '</table>';

View File

@ -48,7 +48,7 @@ class Facture
var $socidp; // Id client
var $client; // Objet societe client (à charger par fetch_client)
var $number;
var $author;
var $date;
@ -68,6 +68,14 @@ class Facture
var $mode_reglement_id;
var $mode_reglement_code;
// Pour board
var $nbtodo;
var $nbtodolate;
var $specimen;
var $error;
/**
* \brief Constructeur de la classe
* \param DB handler accès base de données
@ -260,7 +268,7 @@ class Facture
$interface=new Interfaces($this->db);
$result=$interface->run_triggers('BILL_CREATE',$this,$user,$langs,$conf);
// Fin appel triggers
$this->db->commit();
return $this->id;
}
@ -350,15 +358,15 @@ class Facture
$this->commande_id = $obj->fk_commande;
$this->lignes = array();
if ($this->user_author)
{
$sql = "SELECT name, firstname";
$sql.= " FROM ".MAIN_DB_PREFIX."user";
$sql.= " WHERE rowid = ".$this->user_author;
$resqluser = $this->db->query($sql);
if ($resqluser)
{
$obju = $this->db->fetch_object($resqluser);
@ -366,22 +374,22 @@ class Facture
$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)
{
$this->brouillon = 1;
@ -457,12 +465,12 @@ class Facture
$client->fetch($this->socidp);
$this->client = $client;
}
/**
*
*
*/
function fetch_contact_facture($id)
{
$idcontact = $id;
@ -520,7 +528,7 @@ class Facture
function delete($rowid)
{
global $user,$langs,$conf;
$this->db->begin();
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.'facture_tva_sum WHERE fk_facture = '.$rowid;
@ -550,7 +558,7 @@ class Facture
$interface=new Interfaces($this->db);
$result=$interface->run_triggers('BILL_DELETE',$this,$user,$langs,$conf);
// Fin appel triggers
$this->db->commit();
return 1;
}
@ -622,12 +630,12 @@ class Facture
return -1;
}
$this->db->free($resqltemp);
/* Definition de la date limite */
// 1 : ajout du nombre de jours
$datelim = $this->date + ( $cdr_nbjour * 3600 * 24 );
// 2 : application de la règle "fin de mois"
if ($cdr_fdm)
{
@ -646,22 +654,22 @@ class Facture
$datelim=mktime(12,0,0,$mois,1,$annee);
$datelim -= (3600 * 24);
}
// 3 : application du décalage
$datelim += ( $cdr_decalage * 3600 * 24);
return $datelim;
}
/**
* \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
* \return int <0 si ok, >0 si ok
*/
function set_payed($user)
{
global $conf,$langs;
dolibarr_syslog("Facture.class.php::set_payed rowid=".$this->id);
$sql = 'UPDATE '.MAIN_DB_PREFIX.'facture';
$sql.= ' SET paye=1 WHERE rowid = '.$this->id ;
@ -670,20 +678,20 @@ class Facture
if ($resql)
{
$this->use_webcal=($conf->global->PHPWEBCALENDAR_BILLSTATUS=='always'?1:0);
// Appel des triggers
include_once(DOL_DOCUMENT_ROOT . "/interfaces.class.php");
$interface=new Interfaces($this->db);
$result=$interface->run_triggers('BILL_PAYED',$this,$user,$langs,$conf);
// Fin appel triggers
}
return 1;
}
/**
* \brief Tag la facture comme non payée complètement + appel trigger BILL_UNPAYED
* \param user Objet utilisateur qui modifie
* \param user Objet utilisateur qui modifie
* \return int <0 si ok, >0 si ok
*/
function set_unpayed($user)
@ -698,17 +706,17 @@ class Facture
if ($resql)
{
$this->use_webcal=($conf->global->PHPWEBCALENDAR_BILLSTATUS=='always'?1:0);
// Appel des triggers
include_once(DOL_DOCUMENT_ROOT . "/interfaces.class.php");
$interface=new Interfaces($this->db);
$result=$interface->run_triggers('BILL_UNPAYED',$this,$user,$langs,$conf);
// Fin appel triggers
}
return 1;
}
/**
* \brief Tag la facture comme payer partiellement
* \param rowid id de la facture à modifier
@ -721,7 +729,7 @@ class Facture
/**
* \brief Tag la facture comme abandonnée + appel trigger BILL_CANCEL
* \param user Objet utilisateur qui modifie
* \param user Objet utilisateur qui modifie
* \return int <0 si ok, >0 si ok
*/
function set_canceled($user)
@ -758,7 +766,7 @@ class Facture
function set_valid($rowid, $user, $soc, $force_number='')
{
global $conf,$langs;
$error = 0;
if ($this->brouillon)
{
@ -829,7 +837,7 @@ class Facture
{
$obj = $this->db->fetch_object($resql);
$avoir=$obj->amount;
// On met à jour avoir comme affecté à facture
$sql = 'UPDATE '.MAIN_DB_PREFIX.'societe_remise_except';
$sql.= ' SET fk_facture = '.$this->id.',';
@ -864,8 +872,8 @@ class Facture
$i++;
}
*/
/*
* Pour chaque produit, on met a jour indicateur nbvente
* On crée ici une dénormalisation des données pas forcément utilisée.
@ -896,7 +904,7 @@ class Facture
$this->use_webcal=($conf->global->PHPWEBCALENDAR_BILLSTATUS=='always'?1:0);
$this->ref = $numfa;
// Appel des triggers
include_once(DOL_DOCUMENT_ROOT . "/interfaces.class.php");
$interface=new Interfaces($this->db);
@ -926,13 +934,13 @@ class Facture
}
}
}
/*
*
*
*
*/
function set_pdf_model($user, $modelpdf)
{
if ($user->rights->facture->creer)
@ -940,7 +948,7 @@ class Facture
$sql = "UPDATE ".MAIN_DB_PREFIX."facture SET model_pdf = '$modelpdf'";
$sql .= " WHERE rowid = $this->id AND fk_statut < 2 ;";
if ($this->db->query($sql) )
{
return 1;
@ -1056,7 +1064,7 @@ class Facture
$row = $this->db->fetch_row($resql);
$rangmax = $row[0];
}
if ($conf->global->PRODUIT_CHANGE_PROD_DESC)
{
if (!$product_desc)
@ -1071,7 +1079,7 @@ class Facture
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'facturedet ';
$sql.= ' (fk_facture, description, price, qty, tva_taux, fk_product, remise_percent, subprice, remise, date_start, date_end, fk_code_ventilation, rang)';
if ($conf->global->PRODUIT_CHANGE_PROD_DESC)
{
$sql.= " VALUES ($facid, '".addslashes($product_desc)."','$price','$qty','$txtva',";
@ -1080,7 +1088,7 @@ class Facture
{
$sql.= " VALUES ($facid, '".addslashes($desc)."','$price','$qty','$txtva',";
}
if ($fk_product) { $sql.= "'$fk_product',"; }
else { $sql.='0,'; }
$sql.= " '$remise_percent','$subprice','$remise',";
@ -1322,11 +1330,11 @@ class Facture
function set_remise_absolue($user, $remise)
{
$remise=trim($remise)?trim($remise):0;
if ($user->rights->facture->creer)
{
$remise=price2num($remise);
$sql = 'UPDATE '.MAIN_DB_PREFIX.'facture';
$sql.= ' SET remise_absolue = '.$remise;
$sql.= ' WHERE rowid = '.$this->id.' AND fk_statut = 0 ;';
@ -1354,7 +1362,7 @@ class Facture
function getSumTva()
{
$tvs=array();
$sql = 'SELECT amount, tva_tx FROM '.MAIN_DB_PREFIX.'facture_tva_sum WHERE fk_facture = '.$this->id;
if ($this->db->query($sql))
{
@ -1518,22 +1526,22 @@ class Facture
{
global $db, $langs;
$langs->load("bills");
$dir = DOL_DOCUMENT_ROOT . "/includes/modules/facture/";
if (defined("FACTURE_ADDON") && FACTURE_ADDON)
{
$file = FACTURE_ADDON."/".FACTURE_ADDON.".modules.php";
// Chargement de la classe de numérotation
$classname = "mod_facture_".FACTURE_ADDON;
require_once($dir.$file);
$obj = new $classname();
$numref = "";
$numref = $obj->getNumRef($soc,$this);
if ( $numref != "")
{
return $numref;
@ -1550,7 +1558,7 @@ class Facture
return "";
}
}
/**
* \brief Mets à jour les commentaires privés
* \param note Commentaire
@ -1596,7 +1604,7 @@ class Facture
return -1;
}
}
/**
* \brief Charge les informations de l'onglet info dans l'objet facture
* \param id Id de la facture a charger
@ -1712,7 +1720,7 @@ class Facture
/**
* \brief Créé une demande de prélèvement
* \param user Utilisateur créant la demande
* \return int <0 si ko, >0 si ok
* \return int <0 si ko, >0 si ok
*/
function demande_prelevement($user)
{
@ -1967,14 +1975,14 @@ class Facture
if ($fk_socpeople <= 0) return -1;
// Verifie type_contact
if (! $type_contact || ! is_numeric($type_contact))
if (! $type_contact || ! is_numeric($type_contact))
{
$this->error="Valeur pour type_contact incorrect";
return -3;
return -3;
}
$datecreate = time();
// Insertion dans la base
$sql = "INSERT INTO ".MAIN_DB_PREFIX."element_contact";
$sql.= " (element_id, fk_socpeople, datecreate, statut, fk_c_type_contact) ";
@ -1982,7 +1990,7 @@ class Facture
$sql.= $this->db->idate($datecreate);
$sql.= ", 4, '". $type_contact . "' ";
$sql.= ")";
// Retour
if ( $this->db->query($sql) )
{
@ -1993,7 +2001,7 @@ class Facture
$this->error=$this->db->error()." - $sql";
return -1;
}
}
}
/**
* \brief Mise a jour du contact associé une facture
@ -2019,16 +2027,16 @@ class Facture
dolibarr_print_error($this->db);
return -1;
}
}
}
/**
/**
* \brief Supprime une ligne de contact
* \param rowid La reference du contact
* \return statur >0 si ok, <0 si ko
*/
function delete_contact($rowid)
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."element_contact";
$sql.= " WHERE rowid =".$rowid;
if ($this->db->query($sql))
@ -2041,7 +2049,7 @@ class Facture
}
}
/**
/**
* \brief Récupère les lignes de contact de l'objet
* \param statut Statut des lignes detail à récupérer
* \param source Source du contact external (llx_socpeople) ou internal (llx_user)
@ -2050,11 +2058,11 @@ class Facture
function liste_contact($statut=-1,$source='external')
{
global $langs;
$element='facture';
$tab=array();
$sql = "SELECT ec.rowid, ec.statut, ec.fk_socpeople as id,";
if ($source == 'internal') $sql.=" '-1' as socid,";
if ($source == 'external') $sql.=" t.fk_soc as socid,";
@ -2075,7 +2083,7 @@ class Facture
if ($source == 'external') $sql.= " AND ec.fk_socpeople = t.idp";
if ($statut >= 0) $sql.= " AND statut = '$statut'";
$sql.=" ORDER BY t.name ASC";
$resql=$this->db->query($sql);
if ($resql)
{
@ -2084,7 +2092,7 @@ class Facture
while ($i < $num)
{
$obj = $this->db->fetch_object($resql);
$transkey="TypeContact_".$obj->element."_".$obj->source."_".$obj->code;
$libelle_type=($langs->trans($transkey)!=$transkey ? $langs->trans($transkey) : $obj->libelle);
$tab[$i]=array('source'=>$obj->source,'socid'=>$obj->socid,'id'=>$obj->id,'nom'=>$obj->nom,
@ -2101,7 +2109,7 @@ class Facture
}
}
/**
/**
* \brief Le détail d'un contact
* \param rowid L'identifiant du contact
* \return object L'objet construit par DoliDb.fetch_object
@ -2131,9 +2139,9 @@ class Facture
dolibarr_print_error($this->db);
return null;
}
}
}
/**
/**
* \brief Liste les valeurs possibles de type de contacts pour les factures
* \param source 'internal' ou 'external'
* \return array Tableau des types de contacts
@ -2141,11 +2149,11 @@ class Facture
function liste_type_contact($source)
{
global $langs;
$element='facture';
$tab = array();
$sql = "SELECT distinct tc.rowid, tc.code, tc.libelle";
$sql.= " FROM ".MAIN_DB_PREFIX."c_type_contact as tc";
$sql.= " WHERE element='".$element."'";
@ -2173,7 +2181,7 @@ class Facture
$this->error=$this->db->error();
return null;
}
}
}
/**
* \brief Retourne id des contacts d'une source et d'un type donné
@ -2181,14 +2189,14 @@ class Facture
* Exemple: contact client de livraison ('external', 'SHIPPING')
* Exemple: contact interne suivi paiement ('internal', 'SALESREPFOLL')
* \return array Liste des id contacts
*/
*/
function getIdContact($source,$code)
{
$element='facture'; // Contact sur la facture
$result=array();
$i=0;
$sql = "SELECT ec.fk_socpeople";
$sql.= " FROM ".MAIN_DB_PREFIX."element_contact as ec, ".MAIN_DB_PREFIX."c_type_contact as tc";
$sql.= " WHERE ec.element_id = ".$this->id;
@ -2211,14 +2219,14 @@ class Facture
$this->error=$this->db->error();
return null;
}
return $result;
}
}
/**
* \brief Retourne id des contacts clients de facturation
* \return array Liste des id contacts facturation
*/
*/
function getIdBillingContact()
{
return $this->getIdContact('external','BILLING');
@ -2227,7 +2235,7 @@ class Facture
/**
* \brief Retourne id des contacts clients de livraison
* \return array Liste des id contacts livraison
*/
*/
function getIdShippingContact()
{
return $this->getIdContact('external','SHIPPING');
@ -2253,12 +2261,12 @@ class Facture
while ($i < $num_socs)
{
$i++;
$row = $this->db->fetch_row($resql);
$socids[$i] = $row[0];
}
}
// Charge tableau des produits prodids
$prodids = array();
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."product WHERE envente=1";
@ -2274,7 +2282,7 @@ class Facture
$prodids[$i] = $row[0];
}
}
// Initialise paramètres
$this->id=0;
$this->ref = 'SPECIMEN';
@ -2301,7 +2309,7 @@ class Facture
$this->lignes[$xnbp]=$ligne;
$xnbp++;
}
$this->amount_ht = $xnbp*100;
$this->total_ht = $xnbp*100;
$this->total_tva = $xnbp*19.6;

View File

@ -64,7 +64,7 @@ class ModelePDFFactures extends FPDF
$sql ="SELECT nom as id, nom as lib";
$sql.=" FROM ".MAIN_DB_PREFIX."document_model";
$sql.=" WHERE type = '".$type."'";
$resql = $db->query($sql);
if ($resql)
{
@ -189,7 +189,7 @@ function facture_pdf_create($db, $id, $message='', $modele='', $outputlangs='')
else
{
dolibarr_print_error('',"facture_pdf_create Error: ".$obj->error);
$this->error=$langs->trans("Error")." ".$obj->error;
$this->error=$langs->trans("Error")." ".$obj->error;
return -1;
}
@ -210,17 +210,17 @@ function facture_pdf_create($db, $id, $message='', $modele='', $outputlangs='')
function facture_meta_create($db, $facid, $message="")
{
global $langs,$conf;
$fac = new Facture($db,"",$facid);
$fac->fetch($facid);
$fac->fetch($facid);
$fac->fetch_client();
if ($conf->facture->dir_output)
{
$facref = sanitize_string($fac->ref);
$dir = $conf->facture->dir_output . "/" . $facref ;
$facref = sanitize_string($fac->ref);
$dir = $conf->facture->dir_output . "/" . $facref ;
$file = $dir . "/" . $facref . ".meta";
if (! file_exists($dir))
{
umask(0);
@ -230,7 +230,7 @@ function facture_meta_create($db, $facid, $message="")
return 0;
}
}
if (file_exists($dir))
{
$nblignes = sizeof($fac->lignes);
@ -241,7 +241,7 @@ NB_ITEMS=\"" . $nblignes . "\"
CLIENT=\"" . $client . "\"
TOTAL_HT=\"" . $fac->total_ht . "\"
TOTAL_TTC=\"" . $fac->total_ttc . "\"\n";
for ($i = 0 ; $i < $nblignes ; $i++) {
//Pour les articles
$meta .= "ITEM_" . $i . "_QUANTITY=\"" . $fac->lignes[$i]->qty . "\"
@ -268,13 +268,13 @@ function facture_delete_preview($db, $facid)
global $langs,$conf;
$fac = new Facture($db,"",$facid);
$fac->fetch($facid);
$fac->fetch($facid);
$fac->fetch_client();
if ($conf->facture->dir_output)
{
$facref = sanitize_string($fac->ref);
$dir = $conf->facture->dir_output . "/" . $facref ;
$facref = sanitize_string($fac->ref);
$dir = $conf->facture->dir_output . "/" . $facref ;
$file = $dir . "/" . $facref . ".pdf.png";
if ( file_exists( $file ) && is_writable( $file ) )

View File

@ -32,7 +32,7 @@
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php");
/**
/**
\class pdf_bernique
\brief Classe permettant de générer les factures au modèle Bernique
*/
@ -40,13 +40,13 @@ require_once(DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php")
class pdf_bernique extends ModelePDFFactures {
function pdf_bernique($db=0)
{
{
global $langs;
$langs->load("main");
$langs->load("bills");
$langs->load("products");
$this->db = $db;
$this->description = $langs->trans('PDFBerniqueDescription');
@ -65,7 +65,7 @@ class pdf_bernique extends ModelePDFFactures {
function write_pdf_file($fac,$outputlangs='')
{
global $user,$langs,$conf,$mysoc;
if ($conf->facture->dir_output)
{
// Définition de l'objet $fac (pour compatibilite ascendante)
@ -88,7 +88,7 @@ class pdf_bernique extends ModelePDFFactures {
$dir = $conf->facture->dir_output . "/" . $facref;
$file = $dir . "/" . $facref . ".pdf";
}
if (! file_exists($dir))
{
if (create_exdir($dir) < 0)
@ -97,61 +97,61 @@ class pdf_bernique extends ModelePDFFactures {
return 0;
}
}
if (file_exists($dir))
{
// Initialisation facture vierge
$pdf=new FPDF('P','mm','A4');
$pdf->Open();
$pdf->AddPage();
$this->_pagehead($pdf, $fac);
$pdf->SetTitle($fac->ref);
$pdf->SetSubject($langs->trans("Bill"));
$pdf->SetCreator("Dolibarr ".DOL_VERSION);
$pdf->SetAuthor($user->fullname);
$tab_top = 100;
$tab_height = 110;
/*
*
*/
$pdf->SetFillColor(220,220,220);
$pdf->SetFont('Arial','', 9);
$pdf->SetXY (10, $tab_top + 10 );
$iniY = $pdf->GetY();
$curY = $pdf->GetY();
$nexY = $pdf->GetY();
$nblignes = sizeof($fac->lignes);
for ($i = 0 ; $i < $nblignes ; $i++)
{
$curY = $nexY;
$pdf->SetXY (11, $curY );
$pdf->MultiCell(118, 5, $fac->lignes[$i]->desc, 0, 'J');
$nexY = $pdf->GetY();
$pdf->SetXY (133, $curY);
$pdf->MultiCell(10, 5, $fac->lignes[$i]->tva_taux, 0, 'C');
$pdf->SetXY (145, $curY);
$pdf->MultiCell(10, 5, $fac->lignes[$i]->qty, 0, 'C');
$pdf->SetXY (156, $curY);
$pdf->MultiCell(18, 5, price($fac->lignes[$i]->price), 0, 'R', 0);
$pdf->SetXY (174, $curY);
$total = price($fac->lignes[$i]->price * $fac->lignes[$i]->qty);
$pdf->MultiCell(26, 5, $total, 0, 'R', 0);
if ($nexY > 200 && $i < $nblignes - 1)
{
$this->_tableau($pdf, $tab_top, $tab_height, $nexY);
@ -161,14 +161,14 @@ class pdf_bernique extends ModelePDFFactures {
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('Arial','', 10);
}
}
$this->_tableau($pdf, $tab_top, $tab_height, $nexY);
$this->_tableau_tot($pdf, $fac, $tab_top, $tab_height);
$this->_tableau_compl($pdf, $fac);
/*
*
*/
@ -178,7 +178,7 @@ class pdf_bernique extends ModelePDFFactures {
{
$account = new Account($this->db);
$account->fetch(FACTURE_RIB_NUMBER);
$pdf->SetXY (10, 40);
$pdf->SetFont('Arial','U',8);
$pdf->MultiCell(40, 4, $langs->trans("BankDetails"), 0, 'L', 0);
@ -192,21 +192,21 @@ class pdf_bernique extends ModelePDFFactures {
$pdf->MultiCell(40, 4, $langs->trans("BIC").' : ' . $account->bic, 0, 'L', 0);
}
}
/*
*
*
*/
$pdf->SetFont('Arial','',9);
$pdf->SetXY(10, 260);
$pdf->MultiCell(190, 5, $langs->trans("IntracommunityVATNumber").' : '.MAIN_INFO_TVAINTRA, 0, 'J');
$pdf->MultiCell(190, 5, $langs->trans("PrettyLittleSentence"), 0, 'J');
$pdf->Close();
$pdf->Output($file);
return 1;
}
else
@ -221,7 +221,7 @@ class pdf_bernique extends ModelePDFFactures {
return 0;
}
}
/*
*
*
@ -232,18 +232,18 @@ class pdf_bernique extends ModelePDFFactures {
global $langs;
$langs->load("main");
$langs->load("bills");
$tab3_top = 240;
$tab3_height = 18;
$tab3_width = 60;
$pdf->Rect(10, $tab3_top, $tab3_width, $tab3_height);
$pdf->line(10, $tab3_top + 6, $tab3_width+10, $tab3_top + 6 );
$pdf->line(10, $tab3_top + 12, $tab3_width+10, $tab3_top + 12 );
$pdf->line(30, $tab3_top, 30, $tab3_top + $tab3_height );
$pdf->SetFont('Arial','',8);
$pdf->SetXY (10, $tab3_top - 6);
$pdf->MultiCell(60, 6, $langs->trans("ExtraInfos"), 0, 'L', 0);
@ -253,7 +253,7 @@ class pdf_bernique extends ModelePDFFactures {
$pdf->MultiCell(20, 6, $langs->trans("ChequeNumber"), 0, 'L', 0);
$pdf->SetXY (10, $tab3_top + 12);
$pdf->MultiCell(20, 6, $langs->trans("Bank"), 0, 'L', 0);
/*
* Conditions de règlements
*/
@ -267,25 +267,25 @@ class pdf_bernique extends ModelePDFFactures {
$pdf->MultiCell(120, 5, $titre.$lib_condition_paiement, 0, 'J');
}
}
function _tableau_tot(&$pdf, $fac, $top, $height)
{
global $langs;
$langs->load("main");
$langs->load("bills");
$tab2_top = $top + $height;
$tab2_hl = 5;
$tab2_height = $tab2_hl * 4;
$pdf->SetFont('Arial','', 9);
$tvas = $fac->getSumTva();
$i = 0;
$tab4_top = $tab2_top + 2 + ($tab2_hl * 2);
foreach ($tvas as $key => $value)
{
$pdf->SetXY (10, $tab4_top + ( $i * $tab2_hl));
@ -299,43 +299,43 @@ class pdf_bernique extends ModelePDFFactures {
$pdf->line(10, $tab4_top, 10, $tab4_top + ($tab2_hl * $i));
$pdf->line(35, $tab4_top, 35, $tab4_top + ($tab2_hl * $i));
$pdf->line(55, $tab4_top, 55, $tab4_top + ($tab2_hl * $i));
$pdf->Rect(10, $tab2_top, 190, $tab2_hl * 2);
$pdf->line(10, $tab2_top + $tab2_hl, 200, $tab2_top + $tab2_hl);
$pdf->SetXY (132, $tab2_top + 0);
$pdf->MultiCell(42, $tab2_hl, $langs->trans("TotalHT"), 0, 'R', 0);
$pdf->SetXY (11, $tab2_top + $tab2_hl);
$pdf->MultiCell(42, $tab2_hl, $langs->trans("Discount")." ". $fac->remise_percent . " %", 0, 'L', 0);
$pdf->SetXY (132, $tab2_top + $tab2_hl * 2);
$pdf->MultiCell(42, $tab2_hl, $langs->trans("WithDiscountTotalHT"), 0, 'R', 0);
$pdf->SetXY (132, $tab2_top + $tab2_hl * 3);
$pdf->MultiCell(42, $tab2_hl, $langs->trans("TotalVAT"), 0, 'R', 0);
$pdf->SetXY (132, $tab2_top + $tab2_hl * 4);
$pdf->MultiCell(42, $tab2_hl, $langs->trans("TotalTTC"), 0, 'R', 1);
$pdf->SetXY (174, $tab2_top + 0);
$pdf->MultiCell(26, $tab2_hl, price($fac->total_ht + $fac->remise), 0, 'R', 0);
$pdf->SetXY (174, $tab2_top + $tab2_hl);
$pdf->MultiCell(26, $tab2_hl, price($fac->remise), 0, 'R', 0);
$pdf->SetXY (174, $tab2_top + $tab2_hl * 2);
$pdf->MultiCell(26, $tab2_hl, price($fac->total_ht), 0, 'R', 0);
$pdf->SetXY (174, $tab2_top + $tab2_hl * 3);
$pdf->MultiCell(26, $tab2_hl, price($fac->total_tva), 0, 'R', 0);
$pdf->SetXY (174, $tab2_top + $tab2_hl * 4);
$pdf->MultiCell(26, $tab2_hl, price($fac->total_ttc), 0, 'R', 1);
}
/*
*
*/
@ -344,23 +344,23 @@ class pdf_bernique extends ModelePDFFactures {
global $langs;
$langs->load("main");
$langs->load("bills");
$pdf->SetFont('Arial','',10);
$pdf->Text(11,$tab_top + 5,$langs->trans("Designation"));
$pdf->line(132, $tab_top, 132, $tab_top + $tab_height);
$pdf->Text(134,$tab_top + 5,$langs->trans("VAT"));
$pdf->line(144, $tab_top, 144, $tab_top + $tab_height);
$pdf->Text(147,$tab_top + 5,$langs->trans("Qty"));
$pdf->line(156, $tab_top, 156, $tab_top + $tab_height);
$pdf->Text(160,$tab_top + 5,$langs->trans("PriceU"));
$pdf->line(174, $tab_top, 174, $tab_top + $tab_height);
$pdf->Text(187,$tab_top + 5,$langs->trans("Total"));
$pdf->Rect(10, $tab_top, 190, $tab_height);
$pdf->line(10, $tab_top + 10, 200, $tab_top + 10 );
}
@ -375,7 +375,7 @@ class pdf_bernique extends ModelePDFFactures {
global $langs,$conf;
$langs->load("main");
$langs->load("bills");
$pdf->SetXY(10,5);
if (defined("FAC_PDF_INTITULE"))
{
@ -383,7 +383,7 @@ class pdf_bernique extends ModelePDFFactures {
$pdf->SetFont('Arial','B',14);
$pdf->MultiCell(60, 8, FAC_PDF_INTITULE, 0, 'L');
}
$pdf->SetTextColor(70,70,170);
if (defined("FAC_PDF_ADRESSE"))
{
@ -400,7 +400,7 @@ class pdf_bernique extends ModelePDFFactures {
$pdf->SetFont('Arial','',10);
$pdf->MultiCell(40, 5, "SIREN : ".MAIN_INFO_SIREN);
}
if (defined("FAC_PDF_INTITULE2"))
{
$pdf->SetXY(100,5);
@ -420,13 +420,13 @@ class pdf_bernique extends ModelePDFFactures {
$pdf->SetXY(102,$pdf->GetY());
$pdf->MultiCell(66,5, $fac->client->adresse . "\n" . $fac->client->cp . " " . $fac->client->ville);
$pdf->rect(100, 40, 100, 40);
$pdf->SetTextColor(200,0,0);
$pdf->SetFont('Arial','B',14);
$pdf->Text(11, 88, $langs->trans('Date').' : ' . strftime("%d %b %Y", $fac->date));
$pdf->Text(11, 94, $langs->trans('Invoice').' : '.$fac->ref);
/*
*/
$pdf->SetTextColor(0,0,0);
@ -435,7 +435,7 @@ class pdf_bernique extends ModelePDFFactures {
$pdf->Text(200 - $pdf->GetStringWidth($titre), 98, $titre);
/*
*/
}
}

View File

@ -41,13 +41,13 @@ class pdf_bulot extends ModelePDFFactures {
\param db handler accès base de donnée
*/
function pdf_bulot($db)
{
{
global $langs;
$langs->load("main");
$langs->load("bills");
$langs->load("products");
$this->db = $db;
$this->description = $langs->trans('PDFBulotDescription');
@ -66,7 +66,7 @@ class pdf_bulot extends ModelePDFFactures {
function write_pdf_file($fac,$outputlangs='')
{
global $user,$langs,$conf,$mysoc;
if ($conf->facture->dir_output)
{
// Définition de l'objet $fac (pour compatibilite ascendante)
@ -89,7 +89,7 @@ class pdf_bulot extends ModelePDFFactures {
$dir = $conf->facture->dir_output . "/" . $facref;
$file = $dir . "/" . $facref . ".pdf";
}
if (! file_exists($dir))
{
if (create_exdir($dir) < 0)
@ -98,61 +98,61 @@ class pdf_bulot extends ModelePDFFactures {
return 0;
}
}
if (file_exists($dir))
{
// Initialisation facture vierge
$pdf=new FPDF('P','mm','A4');
$pdf->Open();
$pdf->AddPage();
$this->_pagehead($pdf, $fac);
$pdf->SetTitle($fac->ref);
$pdf->SetSubject($langs->trans("Bill"));
$pdf->SetCreator("Dolibarr ".DOL_VERSION);
$pdf->SetAuthor($user->fullname);
$tab_top = 100;
$tab_height = 110;
/*
*
*/
$pdf->SetFillColor(220,220,220);
$pdf->SetFont('Arial','', 9);
$pdf->SetXY (10, $tab_top + 10 );
$iniY = $pdf->GetY();
$curY = $pdf->GetY();
$nexY = $pdf->GetY();
$nblignes = sizeof($fac->lignes);
for ($i = 0 ; $i < $nblignes ; $i++)
{
$curY = $nexY;
$pdf->SetXY (11, $curY );
$pdf->MultiCell(118, 5, $fac->lignes[$i]->desc, 0, 'J');
$nexY = $pdf->GetY();
$pdf->SetXY (133, $curY);
$pdf->MultiCell(10, 5, $fac->lignes[$i]->tva_taux, 0, 'C');
$pdf->SetXY (145, $curY);
$pdf->MultiCell(10, 5, $fac->lignes[$i]->qty, 0, 'C');
$pdf->SetXY (156, $curY);
$pdf->MultiCell(18, 5, price($fac->lignes[$i]->price), 0, 'R', 0);
$pdf->SetXY (174, $curY);
$total = price($fac->lignes[$i]->price * $fac->lignes[$i]->qty);
$pdf->MultiCell(26, 5, $total, 0, 'R', 0);
if ($nexY > 200 && $i < $nblignes - 1)
{
$this->_tableau($pdf, $tab_top, $tab_height, $nexY);
@ -162,14 +162,14 @@ class pdf_bulot extends ModelePDFFactures {
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('Arial','', 10);
}
}
$this->_tableau($pdf, $tab_top, $tab_height, $nexY);
$this->_tableau_tot($pdf, $fac, $tab_top, $tab_height);
$this->_tableau_compl($pdf, $fac);
/*
*
*/
@ -179,7 +179,7 @@ class pdf_bulot extends ModelePDFFactures {
{
$account = new Account($this->db);
$account->fetch(FACTURE_RIB_NUMBER);
$pdf->SetXY (10, 40);
$pdf->SetFont('Arial','U',8);
$pdf->MultiCell(40, 4, $langs->trans("BankDetails"), 0, 'L', 0);
@ -193,25 +193,25 @@ class pdf_bulot extends ModelePDFFactures {
$pdf->MultiCell(40, 4, $langs->trans("BIC").' : ' . $account->bic, 0, 'L', 0);
}
}
/*
*
*
*/
$pdf->SetFont('Arial','U',12);
$pdf->SetXY(10, 220);
$titre = $langs->trans("PaymentConditions").' : '.$fac->cond_reglement_facture;
$pdf->MultiCell(190, 5, $titre, 0, 'J');
$pdf->SetFont('Arial','',9);
$pdf->SetXY(10, 265);
$pdf->MultiCell(190, 5, $langs->trans("PrettyLittleSentence"), 0, 'J');
$pdf->Close();
$pdf->Output($file);
return 1;
}
else
@ -237,18 +237,18 @@ class pdf_bulot extends ModelePDFFactures {
function _tableau_compl(&$pdf, $fac)
{
global $langs;
$tab3_top = 240;
$tab3_height = 18;
$tab3_width = 60;
$pdf->Rect(10, $tab3_top, $tab3_width, $tab3_height);
$pdf->line(10, $tab3_top + 6, $tab3_width+10, $tab3_top + 6 );
$pdf->line(10, $tab3_top + 12, $tab3_width+10, $tab3_top + 12 );
$pdf->line(30, $tab3_top, 30, $tab3_top + $tab3_height );
$pdf->SetFont('Arial','',8);
$pdf->SetXY (10, $tab3_top - 6);
$pdf->MultiCell(60, 6, $langs->trans("ExtraInfos"), 0, 'L', 0);
@ -271,78 +271,78 @@ class pdf_bulot extends ModelePDFFactures {
global $langs;
$langs->load("main");
$langs->load("bills");
$tab2_top = $top + $height;
$tab2_hl = 5;
$tab2_height = $tab2_hl * 4;
$pdf->SetFont('Arial','', 9);
$pdf->SetFont('Arial','', 9);
// $pdf->Rect(132, $tab2_top, 68, $tab2_height);
// $pdf->line(174, $tab2_top, 174, $tab2_top + $tab2_height);
// $pdf->line(132, $tab2_top + $tab2_height - 21, 200, $tab2_top + $tab2_height - 21 );
// $pdf->line(132, $tab2_top + $tab2_height - 14, 200, $tab2_top + $tab2_height - 14 );
// $pdf->line(132, $tab2_top + $tab2_height - 7, 200, $tab2_top + $tab2_height - 7 );
$pdf->SetXY (132, $tab2_top + 0);
$pdf->MultiCell(42, $tab2_hl, $langs->trans("TotalHT"), 0, 'R', 0);
$pdf->SetXY (174, $tab2_top + 0);
$pdf->MultiCell(26, $tab2_hl, price($fac->total_ht + $fac->remise), 0, 'R', 0);
if ($fac->remise > 0)
{
$pdf->SetXY (132, $tab2_top + $tab2_hl);
$pdf->MultiCell(42, $tab2_hl, $langs->trans("GlobalDiscount"), 0, 'R', 0);
$pdf->SetXY (174, $tab2_top + $tab2_hl);
$pdf->MultiCell(26, $tab2_hl, price($fac->remise), 0, 'R', 0);
$pdf->SetXY (132, $tab2_top + $tab2_hl * 2);
$pdf->MultiCell(42, $tab2_hl, $langs->trans("WithDiscountTotalHT"), 0, 'R', 0);
$pdf->SetXY (174, $tab2_top + $tab2_hl * 2);
$pdf->MultiCell(26, $tab2_hl, price($fac->total_ht), 0, 'R', 0);
$index = 3;
}
else
{
$index = 1;
}
$pdf->SetXY (132, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell(42, $tab2_hl, $langs->trans("TotalVAT"), 0, 'R', 0);
$pdf->SetXY (174, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell(26, $tab2_hl, price($fac->total_tva), 0, 'R', 0);
$pdf->SetXY (132, $tab2_top + $tab2_hl * ($index+1));
$pdf->MultiCell(42, $tab2_hl, $langs->trans("TotalTTC"), 0, 'R', 1);
$pdf->SetXY (174, $tab2_top + $tab2_hl * ($index+1));
$pdf->MultiCell(26, $tab2_hl, price($fac->total_ttc), 0, 'R', 1);
$deja_regle = $fac->getSommePaiement();
if ($deja_regle > 0)
{
$pdf->SetXY (132, $tab2_top + $tab2_hl * ($index+2));
$pdf->MultiCell(42, $tab2_hl, $langs->trans("AlreadyPayed"), 0, 'R', 0);
$pdf->SetXY (174, $tab2_top + $tab2_hl * ($index+2));
$pdf->MultiCell(26, $tab2_hl, price($deja_regle), 0, 'R', 0);
$pdf->SetXY (132, $tab2_top + $tab2_hl * ($index+3));
$pdf->MultiCell(42, $tab2_hl, $langs->trans("RemainderToPay"), 0, 'R', 1);
$pdf->SetXY (174, $tab2_top + $tab2_hl * ($index+3));
$pdf->MultiCell(26, $tab2_hl, price($fac->total_ttc - $deja_regle), 0, 'R', 1);
}
}
/*
* \brief Affiche la grille des lignes de factures
* \param pdf objet PDF
@ -352,23 +352,23 @@ class pdf_bulot extends ModelePDFFactures {
global $langs;
$langs->load("main");
$langs->load("bills");
$pdf->SetFont('Arial','',10);
$pdf->Text(11,$tab_top + 5,$langs->trans("Designation"));
$pdf->line(132, $tab_top, 132, $tab_top + $tab_height);
$pdf->Text(134,$tab_top + 5,$langs->trans("VAT"));
$pdf->line(144, $tab_top, 144, $tab_top + $tab_height);
$pdf->Text(147,$tab_top + 5,$langs->trans("Qty"));
$pdf->line(156, $tab_top, 156, $tab_top + $tab_height);
$pdf->Text(160,$tab_top + 5,$langs->trans("PriceU"));
$pdf->line(174, $tab_top, 174, $tab_top + $tab_height);
$pdf->Text(187,$tab_top + 5,$langs->trans("Total"));
$pdf->Rect(10, $tab_top, 190, $tab_height);
$pdf->line(10, $tab_top + 10, 200, $tab_top + 10 );
}
@ -384,7 +384,7 @@ class pdf_bulot extends ModelePDFFactures {
global $langs,$conf;
$langs->load("main");
$langs->load("bills");
$pdf->SetXY(10,5);
if (defined("FAC_PDF_INTITULE"))
{
@ -392,7 +392,7 @@ class pdf_bulot extends ModelePDFFactures {
$pdf->SetFont('Arial','B',14);
$pdf->MultiCell(60, 8, FAC_PDF_INTITULE, 0, 'L');
}
$pdf->SetTextColor(70,70,170);
if (defined("FAC_PDF_ADRESSE"))
{
@ -409,7 +409,7 @@ class pdf_bulot extends ModelePDFFactures {
$pdf->SetFont('Arial','',10);
$pdf->MultiCell(40, 5, "SIREN : ".MAIN_INFO_SIREN);
}
if (defined("FAC_PDF_INTITULE2"))
{
$pdf->SetXY(100,5);
@ -429,13 +429,13 @@ class pdf_bulot extends ModelePDFFactures {
$pdf->SetXY(102,$pdf->GetY());
$pdf->MultiCell(66,5, $fac->client->adresse . "\n" . $fac->client->cp . " " . $fac->client->ville);
$pdf->rect(100, 40, 100, 40);
$pdf->SetTextColor(200,0,0);
$pdf->SetFont('Arial','B',14);
$pdf->Text(11, 88, $langs->trans('Date').' : ' . strftime("%d %b %Y", $fac->date));
$pdf->Text(11, 94, $langs->trans('Invoice').' : '.$fac->ref);
/*
*/
$pdf->SetTextColor(0,0,0);
@ -444,9 +444,9 @@ class pdf_bulot extends ModelePDFFactures {
$pdf->Text(200 - $pdf->GetStringWidth($titre), 98, $titre);
/*
*/
}
}
?>

View File

@ -39,7 +39,7 @@ require_once(DOL_DOCUMENT_ROOT."/product.class.php");
class pdf_crabe extends ModelePDFFactures
{
/**
\brief Constructeur
\param db Handler accès base de donnée
@ -47,11 +47,11 @@ class pdf_crabe extends ModelePDFFactures
function pdf_crabe($db)
{
global $conf,$langs;
$langs->load("main");
$langs->load("bills");
$langs->load("products");
$this->db = $db;
$this->name = "crabe";
$this->description = $langs->trans('PDFCrabeDescription');
@ -71,7 +71,7 @@ class pdf_crabe extends ModelePDFFactures
$this->option_modereg = 1; // Affiche mode règlement
$this->option_condreg = 1; // Affiche conditions règlement
$this->option_codeproduitservice = 1; // Affiche code produit-service
if (defined("FACTURE_TVAOPTION") && FACTURE_TVAOPTION == 'franchise')
if (defined("FACTURE_TVAOPTION") && FACTURE_TVAOPTION == 'franchise')
$this->franchise=1;
// Recupere code pays de l'emmetteur
@ -87,9 +87,9 @@ class pdf_crabe extends ModelePDFFactures
dolibarr_print_error($this->db);
}
$this->db->free($result);
$this->tva=array();
// Defini position des colonnes
$this->posxdesc=$this->marge_gauche+1;
$this->posxtva=121;
@ -189,7 +189,7 @@ class pdf_crabe extends ModelePDFFactures
}
$this->_pagehead($pdf, $fac);
// Affiches lignes
$pagenb = 1;
$tab_top = 90;
@ -247,7 +247,7 @@ class pdf_crabe extends ModelePDFFactures
$prefix_prodserv = $langs->trans("Product")." ";
if($prodser->type == 1)
$prefix_prodserv = $langs->trans("Service")." ";
$libelleproduitservice=$prefix_prodserv.$prodser->ref." - ".$libelleproduitservice;
}
@ -259,7 +259,7 @@ class pdf_crabe extends ModelePDFFactures
if ($libelleproduitservice) $libelleproduitservice.="\n";
$libelleproduitservice.=$fac->lignes[$i]->product_desc;
}
}
}
}
if ($fac->lignes[$i]->date_start && $fac->lignes[$i]->date_end) {
@ -310,7 +310,7 @@ class pdf_crabe extends ModelePDFFactures
{
$this->_tableau($pdf, $tab_top, $tab_height + 20, $nexY);
$this->_pagefoot($pdf);
// Nouvelle page
$pdf->AddPage();
$pagenb++;
@ -328,17 +328,17 @@ class pdf_crabe extends ModelePDFFactures
$this->_tableau($pdf, $tab_top, $tab_height, $nexY);
$bottomlasttab=$tab_top + $tab_height + 1;
}
else
else
{
$this->_tableau($pdf, $tab_top_newpage, $tab_height, $nexY);
$bottomlasttab=$tab_top_newpage + $tab_height + 1;
}
$deja_regle = $fac->getSommePaiement();
$posy=$this->_tableau_tot($pdf, $fac, $deja_regle, $bottomlasttab);
if ($deja_regle) {
if ($deja_regle) {
$this->_tableau_versements($pdf, $fac, $posy);
}
@ -393,7 +393,7 @@ class pdf_crabe extends ModelePDFFactures
$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);
@ -413,7 +413,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetXY ($this->marges['g']+60, $cury);
$pdf->MultiCell(13, 3, $langs->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);
@ -423,7 +423,7 @@ class pdf_crabe extends ModelePDFFactures
$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, $langs->trans("Residence").' : ' . $account->domiciliation, 0, 'L', 0);
$pdf->SetXY ($this->marges['g'], $cury+22);
@ -454,7 +454,7 @@ class pdf_crabe extends ModelePDFFactures
*/
$this->_pagefoot($pdf);
$pdf->AliasNbPages();
$pdf->Close();
$pdf->Output($file);
@ -487,7 +487,7 @@ class pdf_crabe extends ModelePDFFactures
global $langs;
$langs->load("main");
$langs->load("bills");
$tab3_posx = 120;
$tab3_top = $posy + 8;
$tab3_width = 80;
@ -520,7 +520,7 @@ class pdf_crabe extends ModelePDFFactures
while ($i < $num) {
$y+=3;
$row = $this->db->fetch_row();
$pdf->SetXY ($tab3_posx, $tab3_top+$y );
$pdf->MultiCell(20, 4, strftime("%d/%m/%y",$row[0]), 0, 'L', 0);
$pdf->SetXY ($tab3_posx+21, $tab3_top+$y);
@ -553,7 +553,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->MultiCell(20, 4, $oper, 0, 'L', 0);
$pdf->SetXY ($tab3_posx+60, $tab3_top+$y);
$pdf->MultiCell(20, 4, $row[3], 0, 'L', 0);
$pdf->line($tab3_posx, $tab3_top+$y+3, $tab3_posx+$tab3_width, $tab3_top+$y+3 );
$i++;
@ -632,12 +632,12 @@ class pdf_crabe extends ModelePDFFactures
if ($tvakey) // On affiche pas taux 0
{
$this->atleastoneratenotnull++;
$index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl = ( (float)$tvakey < 0 ) ? " (".$langs->trans("NonPercuRecuperable").")" : '' ;
$tvacompl = ( (float)$tvakey < 0 ) ? " (".$langs->trans("NonPercuRecuperable").")" : '' ;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $langs->trans("TotalVAT").' '.abs($tvakey).'%'.$tvacompl, 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval * (float)$tvakey / 100 ), 0, 'R', 1);
}
@ -653,7 +653,7 @@ class pdf_crabe extends ModelePDFFactures
}
$useborder=0;
$index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$pdf->SetTextColor(0,0,60);
@ -668,7 +668,7 @@ class pdf_crabe extends ModelePDFFactures
if ($deja_regle > 0)
{
$index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $langs->trans("AlreadyPayed"), 0, 'L', 0);
@ -686,7 +686,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetFont('Arial','', 9);
$pdf->SetTextColor(0,0,0);
}
/* Ne semble pas requis par la réglementation
$index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
@ -705,7 +705,7 @@ class pdf_crabe extends ModelePDFFactures
global $langs,$conf;
$langs->load("main");
$langs->load("bills");
// Montants exprimés en (en tab_top - 1)
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('Arial','',8);
@ -742,7 +742,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetXY ($this->posxdiscount-1, $tab_top+2);
$pdf->MultiCell(16,2, $langs->trans("ReductionShort"),'','C');
}
if ($this->atleastonediscount)
{
$pdf->line($this->postotalht, $tab_top, $this->postotalht, $tab_top + $tab_height);
@ -761,12 +761,12 @@ class pdf_crabe extends ModelePDFFactures
function _pagehead(&$pdf, $fac, $showadress=1)
{
global $langs,$conf,$mysoc;
$langs->load("main");
$langs->load("bills");
$langs->load("propal");
$langs->load("companies");
$pdf->SetTextColor(0,0,60);
$pdf->SetFont('Arial','B',13);
@ -800,7 +800,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 4, $langs->trans("Invoice")." ".$fac->ref, '' , 'R');
$pdf->SetFont('Arial','',12);
$posy+=6;
$pdf->SetXY(100,$posy);
$pdf->SetTextColor(0,0,60);
@ -820,21 +820,21 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetFont('Arial','',8);
$pdf->SetXY($this->marge_gauche,$posy-5);
$pdf->MultiCell(66,5, $langs->trans("BillFrom").":");
$pdf->SetXY($this->marge_gauche,$posy);
$pdf->SetFillColor(230,230,230);
$pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1);
$pdf->SetXY($this->marge_gauche+2,$posy+3);
// Nom emetteur
$pdf->SetTextColor(0,0,60);
$pdf->SetFont('Arial','B',11);
if (defined("FAC_PDF_SOCIETE_NOM") && FAC_PDF_SOCIETE_NOM) $pdf->MultiCell(80, 4, FAC_PDF_SOCIETE_NOM, 0, 'L');
else $pdf->MultiCell(80, 4, $mysoc->nom, 0, 'L');
// Caractéristiques emetteur
$carac_emetteur = '';
if (defined("FAC_PDF_ADRESSE") && FAC_PDF_ADRESSE) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).FAC_PDF_ADRESSE;
@ -855,11 +855,11 @@ class pdf_crabe extends ModelePDFFactures
// Web
if (defined("FAC_PDF_WWW") && FAC_PDF_WWW) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$langs->trans("Web").": ".FAC_PDF_WWW;
elseif ($mysoc->url) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$langs->trans("Web").": ".$mysoc->url;
$pdf->SetFont('Arial','',9);
$pdf->SetXY($this->marge_gauche+2,$posy+8);
$pdf->MultiCell(80,4, $carac_emetteur);
// Client destinataire
$posy=42;
$pdf->SetTextColor(0,0,0);
@ -869,12 +869,12 @@ class pdf_crabe extends ModelePDFFactures
$fac->fetch_client();
// Cadre client destinataire
$pdf->rect(100, $posy, 100, $hautcadre);
// Nom client
$pdf->SetXY(102,$posy+3);
$pdf->SetFont('Arial','B',11);
$pdf->MultiCell(106,4, $fac->client->nom, 0, 'L');
// Caractéristiques client
$carac_client=$fac->client->adresse;
$carac_client.="\n".$fac->client->cp . " " . $fac->client->ville."\n";
@ -883,7 +883,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetXY(102,$posy+8);
$pdf->MultiCell(86,4, $carac_client);
}
}
/*
@ -896,9 +896,9 @@ class pdf_crabe extends ModelePDFFactures
$langs->load("main");
$langs->load("bills");
$langs->load("companies");
$html=new Form($this->db);
// Premiere ligne d'info réglementaires
$ligne1="";
if ($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE)
@ -942,7 +942,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetY(-$posy);
$pdf->line($this->marge_gauche, $this->page_hauteur-$posy, 200, $this->page_hauteur-$posy);
$posy--;
if ($ligne1)
{
$pdf->SetXY($this->marge_gauche,-$posy);
@ -955,7 +955,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetXY($this->marge_gauche,-$posy);
$pdf->MultiCell(200, 2, $ligne2, 0, 'C', 0);
}
$pdf->SetXY(-20,-$posy);
$pdf->MultiCell(10, 2, $pdf->PageNo().'/{nb}', 0, 'R', 0);
}

View File

@ -50,7 +50,7 @@ class pdf_huitre extends ModelePDFFactures {
$langs->load("bills");
$langs->load("products");
$this->db = $db;
$this->name = "huitre";
$this->description = $langs->trans('PDFHuitreDescription');
@ -71,7 +71,7 @@ class pdf_huitre extends ModelePDFFactures {
function write_pdf_file($fac,$outputlangs='')
{
global $user,$langs,$conf,$mysoc;
if ($conf->facture->dir_output)
{
// Définition de l'objet $fac (pour compatibilite ascendante)
@ -94,7 +94,7 @@ class pdf_huitre extends ModelePDFFactures {
$dir = $conf->facture->dir_output . "/" . $facref;
$file = $dir . "/" . $facref . ".pdf";
}
if (! file_exists($dir))
{
if (create_exdir($dir) < 0)
@ -103,16 +103,16 @@ class pdf_huitre extends ModelePDFFactures {
return 0;
}
}
if (file_exists($dir))
{
// Initialisation facture vierge
$pdf=new FPDF('P','mm','A4');
$pdf->Open();
$pdf->AddPage();
$this->_pagehead($pdf, $fac);
$pdf->SetTitle($fac->ref);
$pdf->SetSubject($langs->trans("Bill"));
$pdf->SetCreator("Dolibarr (By ADYTEK)".DOL_VERSION);
@ -121,41 +121,41 @@ class pdf_huitre extends ModelePDFFactures {
$pdf->SetAutoPageBreak(1,0);
$tab_top = 100;
$tab_height = 110;
$pdf->SetFillColor(242,239,119);
$pdf->SetFont('Arial','', 9);
$pdf->SetXY (10, $tab_top + 10 );
$iniY = $pdf->GetY();
$curY = $pdf->GetY();
$nexY = $pdf->GetY();
$nblignes = sizeof($fac->lignes);
// Boucle sur les lignes de factures
for ($i = 0 ; $i < $nblignes ; $i++)
{
$curY = $nexY;
$pdf->SetXY (11, $curY );
$pdf->MultiCell(118, 5, $fac->lignes[$i]->desc, 0, 'J');
$nexY = $pdf->GetY();
$pdf->SetXY (133, $curY);
$pdf->MultiCell(10, 5, $fac->lignes[$i]->tva_taux, 0, 'C');
$pdf->SetXY (145, $curY);
$pdf->MultiCell(10, 5, $fac->lignes[$i]->qty, 0, 'C');
$pdf->SetXY (156, $curY);
$pdf->MultiCell(18, 5, price($fac->lignes[$i]->price), 0, 'R', 0);
$pdf->SetXY (174, $curY);
$total = price($fac->lignes[$i]->price * $fac->lignes[$i]->qty);
$pdf->MultiCell(26, 5, $total, 0, 'R', 0);
if ($nexY > 200 && $i < $nblignes - 1)
{
$this->_tableau($pdf, $tab_top, $tab_height, $nexY);
@ -165,14 +165,14 @@ class pdf_huitre extends ModelePDFFactures {
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('Arial','', 10);
}
}
$this->_tableau($pdf, $tab_top, $tab_height, $nexY);
$this->_tableau_tot($pdf, $fac);
$this->_tableau_compl($pdf, $fac);
/*
*
*/
@ -182,7 +182,7 @@ class pdf_huitre extends ModelePDFFactures {
{
$account = new Account($this->db);
$account->fetch(FACTURE_RIB_NUMBER);
$pdf->SetXY (10, 40);
$pdf->SetFont('Arial','U',8);
$pdf->MultiCell(40, 4, $langs->trans("BankDetails"), 0, 'L', 0);
@ -196,12 +196,12 @@ class pdf_huitre extends ModelePDFFactures {
$pdf->MultiCell(40, 4, $langs->trans("BIC").' : ' . $account->bic, 0, 'L', 0);
}
}
/*
*
*
*/
if ( $fac->note_public)
{
$pdf->SetFont('Arial','',7);
@ -209,12 +209,12 @@ class pdf_huitre extends ModelePDFFactures {
$note = $langs->trans("Note").' : '.$fac->note_public;
$pdf->MultiCell(110, 3, $note, 0, 'J');
}
$pdf->SetFont('Arial','U',11);
$pdf->SetXY(10, 225);
$titre = $langs->trans("PaymentConditions").' : '.$fac->cond_reglement_facture;
$pdf->MultiCell(190, 5, $titre, 0, 'J');
$pdf->SetFont('Arial','',6);
$pdf->SetXY(10, 265);
$pdf->MultiCell(90, 2, $langs->trans('LawApplicationPart1'), 0, 'J');
@ -224,27 +224,27 @@ class pdf_huitre extends ModelePDFFactures {
$pdf->MultiCell(90, 2, $langs->trans('LawApplicationPart3'), 0, 'J');
$pdf->SetXY(10, 271);
$pdf->MultiCell(90, 2, $langs->trans('LawApplicationPart4'), 0, 'J');
$pdf->SetFont('Arial','',7);
$pdf->SetXY(85, 271);
$pdf->MultiCell(90, 3, $langs->trans('VATDischarged'), 0, 'J');
$this->_pagefoot($pdf, $fac);
$pdf->AliasNbPages();
//----
$pdf->SetTextColor(0,0,0);
$pdf->SetFillColor(242,239,119);
$pdf->SetLineWidth(0.5);
$pdf->Close();
$pdf->Output($file);
return 1; // Pas d'erreur
}
else
@ -261,8 +261,8 @@ class pdf_huitre extends ModelePDFFactures {
$this->error=$langs->trans("ErrorUnknown");
return 0; // Erreur par defaut
}
/*
*
*
@ -312,18 +312,18 @@ class pdf_huitre extends ModelePDFFactures {
global $langs;
$langs->load("main");
$langs->load("bills");
$tab3_top = 240;
$tab3_height = 18;
$tab3_width = 60;
$pdf->Rect(10, $tab3_top, $tab3_width, $tab3_height);
$pdf->line(10, $tab3_top + 6, $tab3_width+10, $tab3_top + 6 );
$pdf->line(10, $tab3_top + 12, $tab3_width+10, $tab3_top + 12 );
$pdf->line(40, $tab3_top, 40, $tab3_top + $tab3_height );
$pdf->SetFont('Arial','',8);
$pdf->SetXY (10, $tab3_top - 6);
$pdf->MultiCell(60, 6, $langs->trans("ExtraInfos"), 0, 'L', 0);
@ -345,15 +345,15 @@ class pdf_huitre extends ModelePDFFactures {
global $langs;
$langs->load("main");
$langs->load("bills");
$tab2_top = 212;
$tab2_hl = 5;
$tab2_height = $tab2_hl * 4;
$pdf->SetFont('Arial','', 9);
// $pdf->Rect(132, $tab2_top, 68, $tab2_height);
// $pdf->line(174, $tab2_top, 174, $tab2_top + $tab2_height);
// $pdf->line(132, $tab2_top + $tab2_height - 21, 200, $tab2_top + $tab2_height - 21 );
// $pdf->line(132, $tab2_top + $tab2_height - 14, 200, $tab2_top + $tab2_height - 14 );
// $pdf->line(132, $tab2_top + $tab2_height - 7, 200, $tab2_top + $tab2_height - 7 );
@ -390,10 +390,10 @@ class pdf_huitre extends ModelePDFFactures {
$pdf->SetXY (174, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell(26, $tab2_hl, price($fac->total_tva), 0, 'R', 0);
$pdf->SetXY (132, $tab2_top + $tab2_hl * ($index+1));
$pdf->MultiCell(42, $tab2_hl, $langs->trans("TotalTTC"), 0, 'R', 1);
$pdf->SetXY (174, $tab2_top + $tab2_hl * ($index+1));
$pdf->MultiCell(26, $tab2_hl, price($fac->total_ttc), 0, 'R', 1);
@ -423,14 +423,14 @@ class pdf_huitre extends ModelePDFFactures {
global $langs;
$langs->load("main");
$langs->load("bills");
$pdf->SetFont('Arial','',10);
$pdf->Text(11,$tab_top + 5,$langs->trans("Designation"));
$pdf->line(132, $tab_top, 132, $tab_top + $tab_height);
$pdf->Text(134,$tab_top + 5,$langs->trans("VAT"));
$pdf->line(144, $tab_top, 144, $tab_top + $tab_height);
$pdf->Text(147,$tab_top + 5,$langs->trans("Qty"));
@ -439,7 +439,7 @@ class pdf_huitre extends ModelePDFFactures {
$pdf->line(174, $tab_top, 174, $tab_top + $tab_height);
$pdf->Text(187,$tab_top + 5,$langs->trans("Total"));
$pdf->Rect(10, $tab_top, 190, $tab_height);
$pdf->line(10, $tab_top + 10, 200, $tab_top + 10 );
}
@ -531,7 +531,7 @@ class pdf_huitre extends ModelePDFFactures {
*/
$pdf->SetTextColor(0,0,0);
$pdf->SetFillColor(242,239,119);
// $this->RoundedRect(100, 40, 100, 40, 3, 'F');
$pdf->rect(100, 40, 100, 40, 'F');
$pdf->SetFont('Arial','B',12);

View File

@ -41,8 +41,8 @@ require_once(DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php")
class pdf_oursin extends ModelePDFFactures
{
var $marges=array("g"=>10,"h"=>5,"d"=>10,"b"=>15);
/**
\brief Constructeur
\param db handler accès base de donnée
@ -50,7 +50,7 @@ class pdf_oursin extends ModelePDFFactures
function pdf_oursin($db)
{
global $conf,$langs;
$langs->load("main");
$langs->load("bills");
$langs->load("products");
@ -71,7 +71,7 @@ class pdf_oursin extends ModelePDFFactures
$this->option_codeproduitservice = 1; // Affiche code produit-service FACTURE_CODEPRODUITSERVICE
if (defined("FACTURE_TVAOPTION") && FACTURE_TVAOPTION == 'franchise')
$this->franchise=1;
// Recupere code pays de l'emmetteur
$this->emetteur->code_pays=substr($langs->defaultlang,-2); // Par defaut, si on trouve pas
$sql = "SELECT code from ".MAIN_DB_PREFIX."c_pays";
@ -111,11 +111,11 @@ class pdf_oursin extends ModelePDFFactures
function write_pdf_file($fac,$outputlangs='')
{
global $user,$langs,$conf,$mysoc;
$langs->load("main");
$langs->load("bills");
$langs->load("products");
if ($conf->facture->dir_output)
{
// Définition de l'objet $fac (pour compatibilite ascendante)
@ -138,7 +138,7 @@ class pdf_oursin extends ModelePDFFactures
$dir = $conf->facture->dir_output . "/" . $facref;
$file = $dir . "/" . $facref . ".pdf";
}
if (! file_exists($dir))
{
if (create_exdir($dir) < 0)
@ -147,49 +147,49 @@ class pdf_oursin extends ModelePDFFactures
return 0;
}
}
if (file_exists($dir))
{
// Initialisation facture vierge
$pdf=new FPDF('P','mm',$this->format);
$pdf->Open();
$pdf->AddPage();
$this->_pagehead($pdf, $fac);
$pdf->SetTitle($fac->ref);
$pdf->SetSubject($langs->trans("Invoice"));
$pdf->SetCreator("Dolibarr ".DOL_VERSION);
$pdf->SetAuthor($user->fullname);
$pdf->SetMargins(10, 10, 10);
$pdf->SetAutoPageBreak(1,0);
$tab_top = $this->marges['h']+90;
$tab_height = 110;
$pdf->SetFillColor(220,220,220);
$pdf->SetFont('Arial','', 9);
$pdf->SetXY ($this->marges['g'], $tab_top + $this->marges['g'] );
$iniY = $pdf->GetY();
$curY = $pdf->GetY();
$nexY = $pdf->GetY();
$nblignes = sizeof($fac->lignes);
// Boucle sur les lignes de factures
for ($i = 0 ; $i < $nblignes ; $i++)
{
$curY = $nexY;
// Description produit
$codeproduitservice="";
$pdf->SetXY ($this->marges['g']+ 1, $curY );
if (defined("FACTURE_CODEPRODUITSERVICE") && FACTURE_CODEPRODUITSERVICE) {
// Affiche code produit si ligne associée à un code produit
$prodser = new Product($this->db);
$prodser->fetch($fac->lignes[$i]->produit_id);
if ($prodser->ref) {
$codeproduitservice=" - ".$langs->trans("ProductCode")." ".$prodser->ref;
@ -200,9 +200,9 @@ class pdf_oursin extends ModelePDFFactures
$codeproduitservice.=" (".$langs->trans("From")." ".dolibarr_print_date($fac->lignes[$i]->date_start)." ".$langs->trans("to")." ".dolibarr_print_date($fac->lignes[$i]->date_end).")";
}
$pdf->MultiCell(108, 5, $fac->lignes[$i]->desc."$codeproduitservice", 0, 'J');
$nexY = $pdf->GetY();
// TVA
if ($this->franchise!=1)
{
@ -212,23 +212,23 @@ class pdf_oursin extends ModelePDFFactures
// Prix unitaire HT avant remise
$pdf->SetXY ($this->marges['g']+132, $curY);
$pdf->MultiCell(16, 5, price($fac->lignes[$i]->subprice), 0, 'R', 0);
// Quantit
$pdf->SetXY ($this->marges['g']+150, $curY);
$pdf->MultiCell(10, 5, $fac->lignes[$i]->qty, 0, 'R');
// Remise sur ligne
$pdf->SetXY ($this->marges['g']+160, $curY);
if ($fac->lignes[$i]->remise_percent) {
$pdf->MultiCell(14, 5, $fac->lignes[$i]->remise_percent."%", 0, 'R');
}
// Total HT
$pdf->SetXY ($this->marges['g']+168, $curY);
$total = price($fac->lignes[$i]->price * $fac->lignes[$i]->qty);
$pdf->MultiCell(21, 5, $total, 0, 'R', 0);
if ($nexY > 200 && $i < $nblignes - 1)
{
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $fac);
@ -238,18 +238,18 @@ class pdf_oursin extends ModelePDFFactures
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('Arial','', 10);
}
}
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $fac);
$deja_regle = $fac->getSommePaiement();
$this->_tableau_tot($pdf, $fac, $deja_regle);
if ($deja_regle) {
$this->_tableau_versements($pdf, $fac);
}
/*
* Mode de règlement
*/
@ -261,7 +261,7 @@ class pdf_oursin extends ModelePDFFactures
$pdf->MultiCell(90, 3, $langs->trans("ErrorCreateBankAccount"),0,'L',0);
$pdf->SetTextColor(0,0,0);
}
/*
* Propose mode règlement par CHQ
*/
@ -271,7 +271,7 @@ class pdf_oursin extends ModelePDFFactures
{
$account = new Account($this->db);
$account->fetch(FACTURE_CHQ_NUMBER);
$pdf->SetXY ($this->marges['g'], 225);
$pdf->SetFont('Arial','B',8);
$pdf->MultiCell(90, 3, $langs->trans('PaymentByChequeOrderedTo').' '.$account->proprio.' '.$langs->trans('SendTo').':',0,'L',0);
@ -280,7 +280,7 @@ class pdf_oursin extends ModelePDFFactures
$pdf->MultiCell(80, 3, $account->adresse_proprio, 0, 'L', 0);
}
}
/*
* Propose mode règlement par RIB
*/
@ -290,7 +290,7 @@ class pdf_oursin extends ModelePDFFactures
{
$account = new Account($this->db);
$account->fetch(FACTURE_RIB_NUMBER);
$cury=240;
$pdf->SetXY ($this->marges['g'], $cury);
$pdf->SetFont('Arial','B',8);
@ -310,7 +310,7 @@ class pdf_oursin extends ModelePDFFactures
$pdf->SetXY ($this->marges['g']+60, $cury);
$pdf->MultiCell(13, 3, $langs->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);
@ -320,7 +320,7 @@ class pdf_oursin extends ModelePDFFactures
$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+15);
$pdf->MultiCell(90, 3, $langs->trans("Residence").' : ' . $account->domiciliation, 0, 'L', 0);
$pdf->SetXY ($this->marges['g'], $cury+25);
@ -329,7 +329,7 @@ class pdf_oursin extends ModelePDFFactures
$pdf->MultiCell(90, 3, $langs->trans("BIC").' : ' . $account->bic, 0, 'L', 0);
}
}
/*
* Conditions de règlements
*/
@ -343,17 +343,17 @@ class pdf_oursin extends ModelePDFFactures
$pdf->SetXY($this->marges['g']+44, 217);
$pdf->MultiCell(80, 5, $fac->cond_reglement_facture,0,'L');
}
/*
* Pied de page
*/
$this->_pagefoot($pdf, $fac);
$pdf->AliasNbPages();
$pdf->Close();
$pdf->Output($file);
return 1; // Pas d'erreur
}
else
@ -382,7 +382,7 @@ class pdf_oursin extends ModelePDFFactures
global $langs;
$langs->load("main");
$langs->load("bills");
$tab3_posx = $this->marges['g']+110;
$tab3_top = $this->marges['h']+235;
$tab3_width = 80;
@ -415,7 +415,7 @@ class pdf_oursin extends ModelePDFFactures
while ($i < $num) {
$y+=3;
$row = $this->db->fetch_row();
$pdf->SetXY ($tab3_posx, $tab3_top+$y );
$pdf->MultiCell(20, 4, strftime("%d/%m/%y",$row[0]), 0, 'L', 0);
$pdf->SetXY ($tab3_posx+21, $tab3_top+$y);
@ -448,7 +448,7 @@ class pdf_oursin extends ModelePDFFactures
$pdf->MultiCell(20, 4, $oper, 0, 'L', 0);
$pdf->SetXY ($tab3_posx+60, $tab3_top+$y);
$pdf->MultiCell(20, 4, $row[3], 0, 'L', 0);
$pdf->line($tab3_posx, $tab3_top+$y+3, $tab3_posx+$tab3_width, $tab3_top+$y+3 );
$i++;
@ -558,7 +558,7 @@ class pdf_oursin extends ModelePDFFactures
global $langs;
$langs->load("main");
$langs->load("bills");
$pdf->line( $this->marges['g'], $tab_top+8, 210-$this->marges['d'], $tab_top+8 );
$pdf->line( $this->marges['g'], $tab_top + $tab_height, 210-$this->marges['d'], $tab_top + $tab_height );
@ -572,8 +572,8 @@ class pdf_oursin extends ModelePDFFactures
$nblignes = sizeof($fac->lignes);
$rem=0;
for ($i = 0 ; $i < $nblignes ; $i++)
if ($fac->lignes[$i]->remise_percent)
{
if ($fac->lignes[$i]->remise_percent)
{
$rem=1;
}
if ($rem==1)
@ -595,7 +595,7 @@ class pdf_oursin extends ModelePDFFactures
$langs->load("bills");
$langs->load("propal");
$langs->load("companies");
$pdf->SetTextColor(0,0,60);
$pdf->SetFont('Arial','B',13);
@ -603,15 +603,15 @@ class pdf_oursin extends ModelePDFFactures
// Logo
$logo=$conf->societe->dir_logos.'/'.$mysoc->logo;
if ($mysoc->logo)
if ($mysoc->logo)
{
if (is_readable($logo))
if (is_readable($logo))
{
$taille=getimagesize($logo);
$longueur=$taille[0]/2.835;
$pdf->Image($logo, $this->marges['g'], $this->marges['h'], 0, 24);
}
else
else
{
$pdf->SetTextColor(200,0,0);
$pdf->SetFont('Arial','B',8);
@ -632,7 +632,7 @@ class pdf_oursin extends ModelePDFFactures
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('Arial','',8);
$pdf->SetXY($this->marges['g'],$posy-5);
$pdf->SetXY($this->marges['g'],$posy);
$pdf->SetFillColor(255,255,255);
@ -652,7 +652,7 @@ class pdf_oursin extends ModelePDFFactures
{
$pdf->MultiCell(80, 4, MAIN_INFO_SOCIETE_NOM, 0, 'L');
}
// Caractéristiques emetteur
$pdf->SetFont('Arial','',9);
if (defined("FAC_PDF_ADRESSE"))
@ -722,7 +722,7 @@ class pdf_oursin extends ModelePDFFactures
$pdf->SetFont('Arial','',9);
$pdf->MultiCell(60, 4, $langs->trans("Project")." : ".$projet->title);
}
/*
* ref propal
*/
@ -734,8 +734,8 @@ class pdf_oursin extends ModelePDFFactures
$objp = $fac->db->fetch_object();
$pdf->SetFont('Arial','',9);
$pdf->MultiCell(60, 4, $langs->trans("RefProposal")." : ".$objp->ref);
}
}
/*
* monnaie
*/
@ -759,7 +759,7 @@ class pdf_oursin extends ModelePDFFactures
$langs->load("main");
$langs->load("bills");
$langs->load("companies");
$footy=13;
$pdf->SetFont('Arial','',8);

View File

@ -21,7 +21,7 @@
* $Source$
*/
/**
/**
\file htdocs/includes/modules/propale/modules_propale.php
\ingroup propale
\brief Fichier contenant la classe mère de generation des propales en PDF
@ -40,16 +40,16 @@ require_once(FPDF_PATH.'fpdf.php');
class ModelePDFPropales extends FPDF
{
var $error='';
/**
/**
* \brief Renvoi le dernier message d'erreur de création de propale
*/
function pdferror()
{
return $this->error;
}
/**
/**
* \brief Renvoi la liste des modèles actifs
*/
function liste_modeles($db)
@ -59,7 +59,7 @@ class ModelePDFPropales extends FPDF
$sql ="SELECT nom as id, nom as lib";
$sql.=" FROM ".MAIN_DB_PREFIX."document_model";
$sql.=" WHERE type = '".$type."'";
$resql = $db->query($sql);
if ($resql)
{
@ -128,7 +128,7 @@ class ModeleNumRefPropales
global $langs;
return $langs->trans("NotAvailable");
}
}
@ -206,14 +206,14 @@ function propale_delete_preview($db, $propalid, $propalref='')
$propal->fetch($propalid);
$propalref = $propal->ref;
}
if ($conf->propal->dir_output)
{
$propref = sanitize_string($propalref);
$dir = $conf->propal->dir_output . "/" . $propalref ;
$file = $dir . "/" . $propalref . ".pdf.png";
$multiple = $file . ".";
if ( file_exists( $file ) && is_writable( $file ) )
{
if ( ! unlink($file) )
@ -227,7 +227,7 @@ function propale_delete_preview($db, $propalid, $propalref='')
for ($i = 0; $i < 20; $i++)
{
$preview = $multiple.$i;
if ( file_exists( $preview ) && is_writable( $preview ) )
{
if ( ! unlink($preview) )

View File

@ -40,7 +40,7 @@ require_once(DOL_DOCUMENT_ROOT."/product.class.php");
class pdf_propale_azur extends ModelePDFPropales
{
/**
\brief Constructeur
\param db Handler accès base de donnée
@ -49,6 +49,10 @@ class pdf_propale_azur extends ModelePDFPropales
{
global $conf,$langs;
$langs->load("main");
$langs->load("bills");
$langs->load("products");
$this->db = $db;
$this->name = "azur";
$this->description = "Modèle de propositions commerciales complet (logo...)";
@ -62,13 +66,13 @@ class pdf_propale_azur extends ModelePDFPropales
$this->marge_droite=10;
$this->marge_haute=10;
$this->marge_basse=10;
$this->option_logo = 1; // Affiche logo
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION
$this->option_modereg = 1; // Affiche mode règlement
$this->option_condreg = 1; // Affiche conditions règlement
$this->option_codeproduitservice = 1; // Affiche code produit-service
if (defined("FACTURE_TVAOPTION") && FACTURE_TVAOPTION == 'franchise')
if (defined("FACTURE_TVAOPTION") && FACTURE_TVAOPTION == 'franchise')
$this->franchise=1;
// Recupere code pays de l'emmetteur
@ -94,7 +98,7 @@ class pdf_propale_azur extends ModelePDFPropales
$this->posxqty=151;
$this->posxdiscount=162;
$this->postotalht=177;
$this->atleastoneratenotnull=0;
$this->atleastonediscount=0;
}
@ -103,7 +107,7 @@ class pdf_propale_azur extends ModelePDFPropales
\brief Renvoi dernière erreur
\return string Dernière erreur
*/
function pdferror()
function pdferror()
{
return $this->error;
}
@ -127,10 +131,10 @@ class pdf_propale_azur extends ModelePDFPropales
\remarks MAIN_INFO_CAPITAL
\remarks MAIN_INFO_TVAINTRA
*/
function write_pdf_file($propale)
function write_pdf_file($propale,$outputlangs='')
{
global $user,$conf,$langs;
global $user,$conf,$langs,$mysoc;
if ($conf->propal->dir_output)
{
// Définition de l'objet $propale (pour compatibilite ascendante)
@ -140,7 +144,7 @@ class pdf_propale_azur extends ModelePDFPropales
$propale = new Propal($this->db,"",$id);
$ret=$propale->fetch($id);
}
// Définition de $dir et $file
if ($propale->specimen)
{
@ -153,7 +157,7 @@ class pdf_propale_azur extends ModelePDFPropales
$dir = $conf->propal->dir_output . "/" . $propref;
$file = $dir . "/" . $propref . ".pdf";
}
if (! file_exists($dir))
{
if (create_exdir($dir) < 0)
@ -162,24 +166,26 @@ class pdf_propale_azur extends ModelePDFPropales
return 0;
}
}
if (file_exists($dir))
{
$nblignes = sizeof($propale->lignes);
// Initialisation document vierge
$pdf=new FPDF('P','mm',$this->format);
$pdf->Open();
$pdf->AddPage();
$pdf->SetDrawColor(128,128,128);
$pdf->SetTitle($propale->ref);
$pdf->SetSubject($langs->trans("Bill"));
$pdf->SetCreator("Dolibarr ".DOL_VERSION);
$pdf->SetAuthor($user->fullname);
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
$pdf->SetAutoPageBreak(1,0);
// Positionne $this->atleastonediscount si on a au moins une remise
for ($i = 0 ; $i < $nblignes ; $i++)
{
@ -188,30 +194,30 @@ class pdf_propale_azur extends ModelePDFPropales
$this->atleastonediscount++;
}
}
$this->_pagehead($pdf, $propale);
// Affiches lignes
$pagenb = 1;
$tab_top = 90;
$tab_top_newpage = 50;
$tab_height = 110;
// Affiche notes
if ($propale->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, $propale->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;
}
@ -219,16 +225,16 @@ class pdf_propale_azur extends ModelePDFPropales
{
$height_note=0;
}
$iniY = $tab_top + 8;
$curY = $tab_top + 8;
$nexY = $tab_top + 8;
// Boucle sur les lignes
for ($i = 0 ; $i < $nblignes ; $i++)
{
$curY = $nexY;
// Description de la ligne produit
$libelleproduitservice=$propale->lignes[$i]->libelle;
if ($propale->lignes[$i]->desc&&$propale->lignes[$i]->desc!=$propale->lignes[$i]->libelle)
@ -240,7 +246,7 @@ class pdf_propale_azur extends ModelePDFPropales
if ($propale->lignes[$i]->product_id)
{
$prodser = new Product($this->db);
$prodser->fetch($propale->lignes[$i]->product_id);
if ($prodser->ref)
{
@ -249,10 +255,10 @@ class pdf_propale_azur extends ModelePDFPropales
$prefix_prodserv = $langs->trans("Product")." ";
if($prodser->type == 1)
$prefix_prodserv = $langs->trans("Service")." ";
$libelleproduitservice=$prefix_prodserv.$prodser->ref." - ".$libelleproduitservice;
}
// Ajoute description du produit
if ($conf->global->PROP_ADD_PROD_DESC && !$conf->global->PRODUIT_CHANGE_PROD_DESC)
{
@ -268,46 +274,46 @@ class pdf_propale_azur extends ModelePDFPropales
// Affichage durée si il y en a une
$libelleproduitservice.="\n(".$langs->trans("From")." ".dolibarr_print_date($propale->lignes[$i]->date_start)." ".$langs->trans("to")." ".dolibarr_print_date($propale->lignes[$i]->date_end).")";
}
$pdf->SetFont('Arial','', 9); // Dans boucle pour gérer multi-page
$pdf->SetXY ($this->posxdesc-1, $curY);
$pdf->MultiCell(108, 4, $libelleproduitservice, 0, 'J');
$nexY = $pdf->GetY();
// TVA
$pdf->SetXY ($this->posxtva, $curY);
$pdf->MultiCell(10, 4, ($propale->lignes[$i]->tva_tx < 0 ? '*':'').abs($propale->lignes[$i]->tva_tx), 0, 'R');
// Prix unitaire HT avant remise
$pdf->SetXY ($this->posxup, $curY);
$pdf->MultiCell(18, 4, price($propale->lignes[$i]->subprice), 0, 'R', 0);
// Quantit
$pdf->SetXY ($this->posxqty, $curY);
$pdf->MultiCell(10, 4, $propale->lignes[$i]->qty, 0, 'R');
// Remise sur ligne
$pdf->SetXY ($this->posxdiscount, $curY);
if ($propale->lignes[$i]->remise_percent)
{
$pdf->MultiCell(14, 4, $propale->lignes[$i]->remise_percent."%", 0, 'R');
}
// Total HT ligne
$pdf->SetXY ($this->postotalht, $curY);
$total = price($propale->lignes[$i]->price * $propale->lignes[$i]->qty);
$pdf->MultiCell(23, 4, $total, 0, 'R', 0);
// Collecte des totaux par valeur de tva
// dans le tableau tva["taux"]=total_tva
$tvaligne=$propale->lignes[$i]->price * $propale->lignes[$i]->qty;
if ($propale->remise_percent) $tvaligne-=($tvaligne*$propale->remise_percent)/100;
$this->tva[ (string)$propale->lignes[$i]->tva_tx ] += $tvaligne;
$nexY+=2; // Passe espace entre les lignes
if ($nexY > 200 && $i < ($nblignes - 1))
{
//$this->_tableau($pdf, $tab_top, $tab_height + 20, $nexY);
@ -316,24 +322,24 @@ class pdf_propale_azur extends ModelePDFPropales
else
$this->_tableau($pdf, $tab_top_newpage, $nexY - $tab_top_newpage + 20, $nexY);
$this->_pagefoot($pdf);
// Nouvelle page
$pdf->AddPage();
$pagenb++;
$this->_pagehead($pdf, $propale, 0);
$nexY = $tab_top_newpage + 8;
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('Arial','', 10);
}
}
// Affiche cadre tableau
if ($pagenb == 1)
{
//$this->_tableau($pdf, $tab_top, $tab_height, $nexY);
//$bottomlasttab=$tab_top + $tab_height + 1;
$this->_tableau($pdf, $tab_top, $nexY - $tab_top + 20, $nexY);
$bottomlasttab=$tab_top + $nexY - $tab_top + 20 + 1;
}
@ -344,15 +350,15 @@ class pdf_propale_azur extends ModelePDFPropales
$this->_tableau($pdf, $tab_top_newpage, $nexY - $tab_top_newpage + 20, $nexY);
$bottomlasttab=$tab_top_newpage + $nexY - $tab_top_newpage + 20 + 1;
}
$deja_regle = "";
$posy=$this->_tableau_tot($pdf, $propale, $deja_regle, $bottomlasttab);
if ($deja_regle) {
$this->_tableau_versements($pdf, $fac, $posy);
}
/*
* Mode de règlement
*/
@ -366,7 +372,7 @@ class pdf_propale_azur extends ModelePDFPropales
$pdf->SetTextColor(0,0,0);
}
*/
/*
* Propose mode règlement par CHQ
*/
@ -377,7 +383,7 @@ class pdf_propale_azur extends ModelePDFPropales
{
$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);
@ -387,7 +393,7 @@ class pdf_propale_azur extends ModelePDFPropales
}
}
*/
/*
* Propose mode règlement par RIB
*/
@ -398,9 +404,9 @@ class pdf_propale_azur extends ModelePDFPropales
{
$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);
@ -420,7 +426,7 @@ class pdf_propale_azur extends ModelePDFPropales
$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);
@ -430,18 +436,18 @@ class pdf_propale_azur extends ModelePDFPropales
$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
*/
@ -456,17 +462,17 @@ class pdf_propale_azur extends ModelePDFPropales
$lib_condition_paiement=$langs->trans("PaymentCondition".$propale->cond_reglement_code)?$langs->trans("PaymentCondition".$propale->cond_reglement_code):$propale->cond_reglement;
$pdf->MultiCell(80, 5, $lib_condition_paiement,0,'L');
}
/*
* Pied de page
*/
$this->_pagefoot($pdf);
$pdf->AliasNbPages();
$pdf->Close();
$pdf->Output($file);
return 1; // Pas d'erreur
}
else
@ -550,12 +556,12 @@ class pdf_propale_azur extends ModelePDFPropales
if ($tvakey) // On affiche pas taux 0
{
$this->atleastoneratenotnull++;
$index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl = ( (float)$tvakey < 0 ) ? " (".$langs->trans("NonPercuRecuperable").")" : '' ;
$tvacompl = ( (float)$tvakey < 0 ) ? " (".$langs->trans("NonPercuRecuperable").")" : '' ;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $langs->trans("TotalVAT").' '.abs($tvakey).'%'.$tvacompl, 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval * abs((float)$tvakey) / 100 ), 0, 'R', 1);
}
@ -565,13 +571,13 @@ class pdf_propale_azur extends ModelePDFPropales
$index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $langs->trans("TotalVAT"), 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($propale->total_tva), 0, 'R', 1);
}
$useborder=0;
$index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$pdf->SetTextColor(0,0,60);
@ -586,7 +592,7 @@ class pdf_propale_azur extends ModelePDFPropales
if ($deja_regle > 0)
{
$index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $langs->trans("AlreadyPayed"), 0, 'L', 0);
@ -604,7 +610,7 @@ class pdf_propale_azur extends ModelePDFPropales
$pdf->SetFont('Arial','', 9);
$pdf->SetTextColor(0,0,0);
}
$index++;
return ($tab2_top + ($tab2_hl * $index));
}
@ -618,7 +624,7 @@ class pdf_propale_azur extends ModelePDFPropales
global $langs,$conf;
$langs->load("main");
$langs->load("bills");
// Montants exprimés en (en tab_top - 1)
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('Arial','',8);
@ -679,12 +685,12 @@ class pdf_propale_azur extends ModelePDFPropales
$langs->load("bills");
$langs->load("propal");
$langs->load("companies");
$pdf->SetTextColor(0,0,60);
$pdf->SetFont('Arial','B',13);
$posy=$this->marge_haute;
$pdf->SetXY($this->marge_gauche,$posy);
// Logo
@ -713,7 +719,7 @@ class pdf_propale_azur extends ModelePDFPropales
$pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 4, $langs->trans("Proposal")." ".$propale->ref, '' , 'R');
$pdf->SetFont('Arial','',12);
$posy+=6;
$pdf->SetXY(100,$posy);
$pdf->SetTextColor(0,0,60);
@ -733,21 +739,21 @@ class pdf_propale_azur extends ModelePDFPropales
$pdf->SetFont('Arial','',8);
$pdf->SetXY($this->marge_gauche,$posy-5);
$pdf->MultiCell(66,5, $langs->trans("BillFrom").":");
$pdf->SetXY($this->marge_gauche,$posy);
$pdf->SetFillColor(230,230,230);
$pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1);
$pdf->SetXY($this->marge_gauche+2,$posy+3);
// Nom emetteur
$pdf->SetTextColor(0,0,60);
$pdf->SetFont('Arial','B',11);
if (defined("FAC_PDF_SOCIETE_NOM") && FAC_PDF_SOCIETE_NOM) $pdf->MultiCell(80, 4, FAC_PDF_SOCIETE_NOM, 0, 'L');
else $pdf->MultiCell(80, 4, $mysoc->nom, 0, 'L');
// Caractéristiques emetteur
$carac_emetteur = '';
if (defined("FAC_PDF_ADRESSE") && FAC_PDF_ADRESSE) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).FAC_PDF_ADRESSE;
@ -768,11 +774,11 @@ class pdf_propale_azur extends ModelePDFPropales
// Web
if (defined("FAC_PDF_WWW") && FAC_PDF_WWW) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$langs->trans("Web").": ".FAC_PDF_WWW;
elseif ($mysoc->url) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$langs->trans("Web").": ".$mysoc->url;
$pdf->SetFont('Arial','',9);
$pdf->SetXY($this->marge_gauche+2,$posy+8);
$pdf->MultiCell(80,4, $carac_emetteur);
// Client destinataire
$posy=42;
$pdf->SetTextColor(0,0,0);
@ -780,15 +786,15 @@ class pdf_propale_azur extends ModelePDFPropales
$pdf->SetXY(102,$posy-5);
$pdf->MultiCell(80,5, $langs->trans("BillTo").":");
$propale->fetch_client();
// Cadre client destinataire
$pdf->rect(100, $posy, 100, $hautcadre);
// Nom client
$pdf->SetXY(102,$posy+3);
$pdf->SetFont('Arial','B',11);
$pdf->MultiCell(106,4, $propale->client->nom, 0, 'L');
// Caractéristiques client
$carac_client=$propale->client->adresse;
$carac_client.="\n".$propale->client->cp . " " . $propale->client->ville."\n";
@ -810,9 +816,9 @@ class pdf_propale_azur extends ModelePDFPropales
$langs->load("main");
$langs->load("bills");
$langs->load("companies");
$html=new Form($this->db);
// Premiere ligne d'info réglementaires
$ligne1="";
if ($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE)
@ -856,7 +862,7 @@ class pdf_propale_azur extends ModelePDFPropales
$pdf->SetY(-$posy);
$pdf->line($this->marge_gauche, $this->page_hauteur-$posy, 200, $this->page_hauteur-$posy);
$posy--;
if ($ligne1)
{
$pdf->SetXY($this->marge_gauche,-$posy);
@ -869,7 +875,7 @@ class pdf_propale_azur extends ModelePDFPropales
$pdf->SetXY($this->marge_gauche,-$posy);
$pdf->MultiCell(200, 2, $ligne2, 0, 'C', 0);
}
$pdf->SetXY(-20,-$posy);
$pdf->MultiCell(10, 2, $pdf->PageNo().'/{nb}', 0, 'R', 0);
}

View File

@ -41,7 +41,7 @@ class pdf_propale_bleu extends ModelePDFPropales
\param db handler accès base de donnée
*/
function pdf_propale_bleu($db=0)
{
{
$this->db = $db;
$this->name = "bleu";
$this->description = "Modèle de propale sans remise.";
@ -60,12 +60,12 @@ class pdf_propale_bleu extends ModelePDFPropales
\brief Renvoi dernière erreur
\return string Dernière erreur
*/
function pdferror()
function pdferror()
{
return $this->error;
}
/**
\brief Fonction générant la propale sur le disque
\param propale Objet propal
@ -85,10 +85,10 @@ class pdf_propale_bleu extends ModelePDFPropales
\remarks MAIN_INFO_CAPITAL
\remarks MAIN_INFO_TVAINTRA
*/
function write_pdf_file($propale)
function write_pdf_file($propale,$outputlangs='')
{
global $user,$conf,$langs;
global $user,$conf,$langs,$mysoc;
if ($conf->propal->dir_output)
{
// Définition de l'objet $propal (pour compatibilite ascendante)
@ -98,7 +98,7 @@ class pdf_propale_bleu extends ModelePDFPropales
$propale = new Propal($this->db,"",$id);
$ret=$propale->fetch($id);
}
// Définition de $dir et $file
if ($propale->specimen)
{
@ -111,7 +111,7 @@ class pdf_propale_bleu extends ModelePDFPropales
$dir = $conf->propal->dir_output . "/" . $propref;
$file = $dir . "/" . $propref . ".pdf";
}
if (! file_exists($dir))
{
if (create_exdir($dir) < 0)
@ -120,21 +120,21 @@ class pdf_propale_bleu extends ModelePDFPropales
return 0;
}
}
if (file_exists($dir))
{
$pdf=new FPDF('P','mm',$this->format);
$pdf->Open();
$pdf->AddPage();
$pdf->SetTitle($propale->ref);
$pdf->SetSubject("Proposition commerciale");
$pdf->SetCreator("Dolibarr ".DOL_VERSION);
$pdf->SetAuthor($user->fullname);
$this->_pagehead($pdf, $propale);
/*
*/
$tab_top = 100;
@ -142,49 +142,49 @@ class pdf_propale_bleu extends ModelePDFPropales
/*
*
*/
$pdf->SetFillColor(220,220,220);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('Arial','', 10);
$pdf->SetXY (10, $tab_top + 10 );
$iniY = $pdf->GetY();
$curY = $pdf->GetY();
$nexY = $pdf->GetY();
$nblignes = sizeof($propale->lignes);
for ($i = 0 ; $i < $nblignes ; $i++)
{
$curY = $nexY;
$pdf->SetXY (30, $curY );
$pdf->MultiCell(100, 5, $propale->lignes[$i]->desc, 0, 'J', 0);
$nexY = $pdf->GetY();
$pdf->SetXY (10, $curY );
$pdf->MultiCell(20, 5, $propale->lignes[$i]->ref, 0, 'C');
$pdf->SetXY (133, $curY );
$pdf->MultiCell(10, 5, $propale->lignes[$i]->tva_tx, 0, 'C');
$pdf->SetXY (145, $curY );
$pdf->MultiCell(10, 5, $propale->lignes[$i]->qty, 0, 'C');
$pdf->SetXY (156, $curY );
$pdf->MultiCell(18, 5, price($propale->lignes[$i]->price), 0, 'R', 0);
$pdf->SetXY (174, $curY );
$total = price($propale->lignes[$i]->price * $propale->lignes[$i]->qty);
$pdf->MultiCell(26, 5, $total, 0, 'R', 0);
$pdf->line(10, $curY, 200, $curY );
if ($nexY > 240 && $i < $nblignes - 1)
{
$this->_tableau($pdf, $tab_top, $tab_height, $nexY);
@ -195,7 +195,7 @@ class pdf_propale_bleu extends ModelePDFPropales
$pdf->SetFont('Arial','', 10);
}
}
$this->_tableau($pdf, $tab_top, $tab_height, $nexY);
/*
*
@ -203,39 +203,39 @@ class pdf_propale_bleu extends ModelePDFPropales
$tab2_top = 254;
$tab2_lh = 7;
$tab2_height = $tab2_lh * 3;
$pdf->SetFont('Arial','', 11);
$pdf->Rect(132, $tab2_top, 68, $tab2_height);
$pdf->line(132, $tab2_top + $tab2_height - ($tab2_lh*3), 200, $tab2_top + $tab2_height - ($tab2_lh*3) );
$pdf->line(132, $tab2_top + $tab2_height - ($tab2_lh*2), 200, $tab2_top + $tab2_height - ($tab2_lh*2) );
$pdf->line(132, $tab2_top + $tab2_height - $tab2_lh, 200, $tab2_top + $tab2_height - $tab2_lh );
$pdf->line(174, $tab2_top, 174, $tab2_top + $tab2_height);
$pdf->SetXY (132, $tab2_top + 0);
$pdf->MultiCell(42, $tab2_lh, "Total HT", 0, 'R', 0);
$pdf->SetXY (132, $tab2_top + $tab2_lh);
$pdf->MultiCell(42, $tab2_lh, "Total TVA", 0, 'R', 0);
$pdf->SetXY (132, $tab2_top + ($tab2_lh*2));
$pdf->MultiCell(42, $tab2_lh, "Total TTC", 1, 'R', 1);
$pdf->SetXY (174, $tab2_top + 0);
$pdf->MultiCell(26, $tab2_lh, price($propale->total_ht), 0, 'R', 0);
$pdf->SetXY (174, $tab2_top + $tab2_lh);
$pdf->MultiCell(26, $tab2_lh, price($propale->total_tva), 0, 'R', 0);
$pdf->SetXY (174, $tab2_top + ($tab2_lh*2));
$pdf->MultiCell(26, $tab2_lh, price($propale->total_ttc), 1, 'R', 1);
/*
*
*/
$pdf->Output($file);
return 1;
}
@ -249,21 +249,21 @@ class pdf_propale_bleu extends ModelePDFPropales
$langs->load("bills");
$pdf->SetFont('Arial','',11);
$pdf->Text(30,$tab_top + 5,$langs->trans("Designation"));
$pdf->line(132, $tab_top, 132, $tab_top + $tab_height);
$pdf->Text(134,$tab_top + 5,$langs->trans("VAT"));
$pdf->line(144, $tab_top, 144, $tab_top + $tab_height);
$pdf->Text(147,$tab_top + 5,$langs->trans("Qty"));
$pdf->line(156, $tab_top, 156, $tab_top + $tab_height);
$pdf->Text(160,$tab_top + 5,$langs->trans("PriceU"));
$pdf->line(174, $tab_top, 174, $tab_top + $tab_height);
$pdf->Text(187,$tab_top + 5,$langs->trans("Total"));
// $pdf->Rect(10, $tab_top, 190, $nexY - $tab_top);
$pdf->Rect(10, $tab_top, 190, $tab_height);
@ -285,7 +285,7 @@ class pdf_propale_bleu extends ModelePDFPropales
$pdf->SetFont('Times','B',14);
$pdf->MultiCell(76, 8, FAC_PDF_INTITULE, 0, 'L');
}
$pdf->SetTextColor(70,70,170);
if (defined("FAC_PDF_ADRESSE"))
{
@ -296,13 +296,13 @@ class pdf_propale_bleu extends ModelePDFPropales
{
$pdf->SetFont('Times','',10);
$pdf->MultiCell(76, 5, $langs->trans("Phone")." : ".FAC_PDF_TEL);
}
}
if (defined("MAIN_INFO_SIREN"))
{
$pdf->SetFont('Times','',10);
$pdf->MultiCell(76, 5, "SIREN : ".MAIN_INFO_SIREN);
}
}
if (defined("FAC_PDF_INTITULE2"))
{
$pdf->SetXY(100,5);
@ -322,14 +322,14 @@ class pdf_propale_bleu extends ModelePDFPropales
$pdf->SetXY(102,47);
$pdf->MultiCell(96,5, $propale->client->adresse . "\n" . $propale->client->cp . " " . $propale->client->ville);
$pdf->rect(100, 40, 100, 40);
$pdf->SetTextColor(200,0,0);
$pdf->SetFont('Courier','B',12);
$pdf->Text(11, 88, "Date : " . strftime("%d %b %Y", $propale->date));
$pdf->Text(11, 94, "Proposition commerciale : ".$propale->ref);
}
}

View File

@ -41,7 +41,7 @@ class pdf_propale_jaune extends ModelePDFPropales
\param db handler accès base de donnée
*/
function pdf_propale_jaune($db=0)
{
{
$this->db = $db;
$this->name = "jaune";
$this->description = "Modèle de proposition Jaune";
@ -51,7 +51,7 @@ class pdf_propale_jaune extends ModelePDFPropales
$this->page_largeur = 210;
$this->page_hauteur = 297;
$this->format = array($this->page_largeur,$this->page_hauteur);
$this->error = "";
}
@ -59,21 +59,21 @@ class pdf_propale_jaune extends ModelePDFPropales
/** \brief Renvoi dernière erreur
\return string Dernière erreur
*/
function pdferror()
function pdferror()
{
return $this->error;
}
/**
\brief Fonction générant la propale sur le disque
\param propale Objet propal
\return int 1=ok, 0=ko
*/
function write_pdf_file($propale)
function write_pdf_file($propale,$outputlangs='')
{
global $user,$conf,$langs;
global $user,$conf,$langs,$mysoc;
if ($conf->propal->dir_output)
{
// Définition de l'objet $propal (pour compatibilite ascendante)
@ -83,7 +83,7 @@ class pdf_propale_jaune extends ModelePDFPropales
$propale = new Propal($this->db,"",$id);
$ret=$propale->fetch($id);
}
// Définition de $dir et $file
if ($propale->specimen)
{
@ -96,7 +96,7 @@ class pdf_propale_jaune extends ModelePDFPropales
$dir = $conf->propal->dir_output . "/" . $propref;
$file = $dir . "/" . $propref . ".pdf";
}
if (! file_exists($dir))
{
if (create_exdir($dir) < 0)
@ -105,22 +105,22 @@ class pdf_propale_jaune extends ModelePDFPropales
return 0;
}
}
if (file_exists($dir))
{
$pdf=new FPDF('P','mm',$this->format);
$pdf->Open();
$pdf->SetTitle($propale->ref);
$pdf->SetSubject("Proposition commerciale");
$pdf->SetCreator("Dolibarr ".DOL_VERSION);
$pdf->SetAuthor($user->fullname);
$pdf->AddPage();
$this->_pagehead($pdf, $propale);
/*
*/
$tab_top = 100;
@ -128,46 +128,46 @@ class pdf_propale_jaune extends ModelePDFPropales
/*
*
*/
$pdf->SetFillColor(242,239,119);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('Arial','', 10);
$pdf->SetXY (10, $tab_top + 10 );
$iniY = $pdf->GetY();
$curY = $pdf->GetY();
$nexY = $pdf->GetY();
$nblignes = sizeof($propale->lignes);
for ($i = 0 ; $i < $nblignes ; $i++)
{
$curY = $nexY;
$total = price($propale->lignes[$i]->price * $propale->lignes[$i]->qty);
$pdf->SetXY (30, $curY );
$pdf->MultiCell(102, 5, $propale->lignes[$i]->desc, 0, 'J', 0);
$nexY = $pdf->GetY();
$pdf->SetXY (10, $curY );
$pdf->MultiCell(20, 5, $propale->lignes[$i]->ref, 0, 'C', 0);
$pdf->SetXY (132, $curY );
$pdf->MultiCell(12, 5, $propale->lignes[$i]->tva_tx, 0, 'C', 0);
$pdf->SetXY (144, $curY );
$pdf->MultiCell(10, 5, $propale->lignes[$i]->qty, 0, 'C', 0);
$pdf->SetXY (154, $curY );
$pdf->MultiCell(22, 5, price($propale->lignes[$i]->price), 0, 'R', 0);
$pdf->SetXY (176, $curY );
$pdf->MultiCell(24, 5, $total, 0, 'R', 0);
$pdf->line(10, $curY, 200, $curY );
if ($nexY > 240 && $i < $nblignes - 1)
{
$this->_tableau($pdf, $tab_top, $tab_height, $nexY);
@ -178,7 +178,7 @@ class pdf_propale_jaune extends ModelePDFPropales
$pdf->SetFont('Arial','', 10);
}
}
$this->_tableau($pdf, $tab_top, $tab_height, $nexY);
/*
*
@ -186,39 +186,39 @@ class pdf_propale_jaune extends ModelePDFPropales
$tab2_top = 254;
$tab2_lh = 7;
$tab2_height = $tab2_lh * 3;
$pdf->SetFont('Arial','', 11);
$pdf->Rect(132, $tab2_top, 68, $tab2_height);
$pdf->line(132, $tab2_top + $tab2_height - ($tab2_lh*3), 200, $tab2_top + $tab2_height - ($tab2_lh*3) );
$pdf->line(132, $tab2_top + $tab2_height - ($tab2_lh*2), 200, $tab2_top + $tab2_height - ($tab2_lh*2) );
$pdf->line(132, $tab2_top + $tab2_height - $tab2_lh, 200, $tab2_top + $tab2_height - $tab2_lh );
$pdf->line(174, $tab2_top, 174, $tab2_top + $tab2_height);
$pdf->SetXY (132, $tab2_top + 0);
$pdf->MultiCell(42, $tab2_lh, "Total HT", 0, 'R', 0);
$pdf->SetXY (132, $tab2_top + $tab2_lh);
$pdf->MultiCell(42, $tab2_lh, "Total TVA", 0, 'R', 0);
$pdf->SetXY (132, $tab2_top + ($tab2_lh*2));
$pdf->MultiCell(42, $tab2_lh, "Total TTC", 1, 'R', 1);
$pdf->SetXY (174, $tab2_top + 0);
$pdf->MultiCell(26, $tab2_lh, price($propale->total_ht), 0, 'R', 0);
$pdf->SetXY (174, $tab2_top + $tab2_lh);
$pdf->MultiCell(26, $tab2_lh, price($propale->total_tva), 0, 'R', 0);
$pdf->SetXY (174, $tab2_top + ($tab2_lh*2));
$pdf->MultiCell(26, $tab2_lh, price($propale->total_ttc), 1, 'R', 1);
/*
*
*/
$pdf->Output($file);
return 1;
}
@ -238,23 +238,23 @@ class pdf_propale_jaune extends ModelePDFPropales
$pdf->SetXY(30,$tab_top);
$pdf->MultiCell(102,10,$langs->trans("Designation"),0,'L',1);
$pdf->line(132, $tab_top, 132, $tab_top + $tab_height);
$pdf->SetXY(132,$tab_top);
$pdf->MultiCell(12, 10,$langs->trans("VAT"),0,'C',1);
$pdf->line(144, $tab_top, 144, $tab_top + $tab_height);
$pdf->SetXY(144,$tab_top);
$pdf->MultiCell(10,10,$langs->trans("Qty"),0,'C',1);
$pdf->line(154, $tab_top, 154, $tab_top + $tab_height);
$pdf->SetXY(154,$tab_top);
$pdf->MultiCell(22,10,$langs->trans("PriceU"),0,'R',1);
$pdf->line(176, $tab_top, 176, $tab_top + $tab_height);
$pdf->SetXY(176,$tab_top);
$pdf->MultiCell(24,10,$langs->trans("Total"),0,'R',1);
$pdf->Rect(10, $tab_top, 190, $tab_height);
$pdf->SetTextColor(0,0,0);
@ -272,7 +272,7 @@ class pdf_propale_jaune extends ModelePDFPropales
$pdf->SetFont('Arial','B',14);
$pdf->MultiCell(76, 8, FAC_PDF_INTITULE, 0, 'L');
}
$pdf->SetTextColor(70,70,170);
if (defined("FAC_PDF_ADRESSE"))
{
@ -285,14 +285,14 @@ class pdf_propale_jaune extends ModelePDFPropales
$pdf->SetX(12);
$pdf->SetFont('Arial','',10);
$pdf->MultiCell(76, 5, "Tél : ".FAC_PDF_TEL);
}
}
if (defined("MAIN_INFO_SIREN"))
{
$pdf->SetX(12);
$pdf->SetFont('Arial','',10);
$pdf->MultiCell(76, 5, "SIREN : ".MAIN_INFO_SIREN);
}
$pdf->rect(10, 40, 80, 40);
}
$pdf->rect(10, 40, 80, 40);
$pdf->SetXY(10,5);
$pdf->SetFont('Arial','B',16);
@ -311,7 +311,7 @@ class pdf_propale_jaune extends ModelePDFPropales
$pdf->SetXY(102,47);
$pdf->MultiCell(96,5, $propale->client->adresse . "\n" . $propale->client->cp . " " . $propale->client->ville);
$pdf->rect(100, 40, 100, 40);
$pdf->SetTextColor(200,0,0);
$pdf->SetFont('Arial','B',12);
@ -321,7 +321,7 @@ class pdf_propale_jaune extends ModelePDFPropales
$pdf->SetXY(10,90);
$pdf->MultiCell(110, 10, "Numéro : ".$propale->ref);
$pdf->SetXY(110,90);
$pdf->MultiCell(100, 10, "Date : " . strftime("%d %B %Y", $propale->date));
$pdf->MultiCell(100, 10, "Date : " . strftime("%d %B %Y", $propale->date));
}
}
?>

View File

@ -21,7 +21,7 @@
* $Source$
*/
/**
/**
\file htdocs/includes/modules/propale/pdf_propale_rouge.modules.php
\ingroup propale
\brief Fichier de la classe permettant de générer les propales au modèle Rouge
@ -44,7 +44,7 @@ class pdf_propale_rouge extends ModelePDFPropales
\param db handler accès base de donnée
*/
function pdf_propale_rouge($db=0)
{
{
$this->db = $db;
$this->name = "rouge";
$this->description = "Modèle de propale simple";
@ -57,26 +57,26 @@ class pdf_propale_rouge extends ModelePDFPropales
$this->error = "";
}
/** \brief Renvoi dernière erreur
\return string Dernière erreur
*/
function pdferror()
function pdferror()
{
return $this->error;
}
/**
\brief Fonction générant la propale sur le disque
\param propale Objet propal
\return int 1=ok, 0=ko
*/
function write_pdf_file($propale)
function write_pdf_file($propale,$outputlangs='')
{
global $user,$conf,$langs;
global $user,$conf,$langs,$mysoc;
if ($conf->propal->dir_output)
{
// Définition de l'objet $propal (pour compatibilite ascendante)
@ -114,58 +114,58 @@ class pdf_propale_rouge extends ModelePDFPropales
$pdf=new FPDF('P','mm',$this->format);
$pdf->Open();
$pdf->AddPage();
$pdf->SetTitle($propale->ref);
$pdf->SetSubject($langs->trans("CommercialProposal"));
$pdf->SetCreator("Dolibarr ".DOL_VERSION);
$pdf->SetAuthor($user->fullname);
$this->_pagehead($pdf, $propale);
$tab_top = 100;
$tab_height = 140;
$pdf->SetFillColor(220,220,220);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('Arial','', 10);
$pdf->SetXY (10, $tab_top + 10 );
$iniY = $pdf->GetY();
$curY = $pdf->GetY();
$nexY = $pdf->GetY();
$nblignes = sizeof($propale->lignes);
for ($i = 0 ; $i < $nblignes ; $i++)
{
$curY = $nexY;
$pdf->SetXY (30, $curY );
$pdf->MultiCell(100, 5, $propale->lignes[$i]->desc, 0, 'J', 0);
$nexY = $pdf->GetY();
$pdf->SetXY (10, $curY );
$pdf->MultiCell(20, 5, $propale->lignes[$i]->ref, 0, 'C');
$pdf->SetXY (133, $curY );
$pdf->MultiCell(10, 5, $propale->lignes[$i]->tva_tx, 0, 'C');
$pdf->SetXY (145, $curY );
$pdf->MultiCell(10, 5, $propale->lignes[$i]->qty, 0, 'C');
$pdf->SetXY (156, $curY );
$pdf->MultiCell(18, 5, price($propale->lignes[$i]->price), 0, 'R', 0);
$pdf->SetXY (174, $curY );
$total = price($propale->lignes[$i]->price * $propale->lignes[$i]->qty);
$pdf->MultiCell(26, 5, $total, 0, 'R', 0);
$pdf->line(10, $curY, 200, $curY );
if ($nexY > 240 && $i < $nblignes - 1)
{
$this->_tableau($pdf, $tab_top, $tab_height, $nexY);
@ -176,7 +176,7 @@ class pdf_propale_rouge extends ModelePDFPropales
$pdf->SetFont('Arial','', 10);
}
}
$this->_tableau($pdf, $tab_top, $tab_height, $nexY);
/*
*
@ -184,55 +184,55 @@ class pdf_propale_rouge extends ModelePDFPropales
$tab2_top = 241;
$tab2_lh = 7;
$tab2_height = $tab2_lh * 4;
$pdf->SetFont('Arial','', 11);
$pdf->Rect(132, $tab2_top, 68, $tab2_height);
$pdf->line(132, $tab2_top + $tab2_height - ($tab2_lh*3), 200, $tab2_top + $tab2_height - ($tab2_lh*3) );
$pdf->line(132, $tab2_top + $tab2_height - ($tab2_lh*2), 200, $tab2_top + $tab2_height - ($tab2_lh*2) );
$pdf->line(132, $tab2_top + $tab2_height - $tab2_lh, 200, $tab2_top + $tab2_height - $tab2_lh );
$pdf->line(174, $tab2_top, 174, $tab2_top + $tab2_height);
$pdf->SetXY (132, $tab2_top + 0);
$pdf->MultiCell(42, $tab2_lh, $langs->trans("TotalHT"), 0, 'R', 0);
$pdf->SetXY (132, $tab2_top + $tab2_lh);
$pdf->MultiCell(42, $tab2_lh, $langs->trans("Discount"), 0, 'R', 0);
$pdf->SetXY (132, $tab2_top + $tab2_lh*2);
$pdf->MultiCell(42, $tab2_lh, "Total HT après remise", 0, 'R', 0);
$pdf->SetXY (132, $tab2_top + $tab2_lh*3);
$pdf->MultiCell(42, $tab2_lh, $langs->trans("TotalVAT"), 0, 'R', 0);
$pdf->SetXY (132, $tab2_top + ($tab2_lh*4));
$pdf->MultiCell(42, $tab2_lh, $langs->trans("TotalTTC"), 1, 'R', 1);
$pdf->SetXY (174, $tab2_top + 0);
$pdf->MultiCell(26, $tab2_lh, price($propale->total_ht + $propale->remise), 0, 'R', 0);
$pdf->SetXY (174, $tab2_top + $tab2_lh);
$pdf->MultiCell(26, $tab2_lh, price($propale->remise), 0, 'R', 0);
$pdf->SetXY (174, $tab2_top + $tab2_lh*2);
$pdf->MultiCell(26, $tab2_lh, price($propale->total_ht), 0, 'R', 0);
$pdf->SetXY (174, $tab2_top + $tab2_lh*3);
$pdf->MultiCell(26, $tab2_lh, price($propale->total_tva), 0, 'R', 0);
$pdf->SetXY (174, $tab2_top + ($tab2_lh*4));
$pdf->MultiCell(26, $tab2_lh, price($propale->total_ttc), 1, 'R', 1);
if (defined("PROP_PDF_MESSAGE") && PROP_PDF_MESSAGE)
{
$pdf->SetXY (10, $tab2_top + 2);
$pdf->SetFont('Arial','',10);
$pdf->MultiCell(120, 5, PROP_PDF_MESSAGE);
}
$pdf->Output($file);
return 1;
}
@ -242,8 +242,8 @@ class pdf_propale_rouge extends ModelePDFPropales
$this->error=$langs->trans("ErrorConstantNotDefined","PROPALE_OUTPUTDIR");
return 0;
}
}
}
function _tableau(&$pdf, $tab_top, $tab_height, $nexY)
@ -253,21 +253,21 @@ class pdf_propale_rouge extends ModelePDFPropales
$langs->load("bills");
$pdf->SetFont('Arial','',11);
$pdf->Text(30,$tab_top + 5,$langs->trans("Designation"));
$pdf->line(132, $tab_top, 132, $tab_top + $tab_height);
$pdf->Text(134,$tab_top + 5,$langs->trans("VAT"));
$pdf->line(144, $tab_top, 144, $tab_top + $tab_height);
$pdf->Text(147,$tab_top + 5,$langs->trans("Qty"));
$pdf->line(156, $tab_top, 156, $tab_top + $tab_height);
$pdf->Text(160,$tab_top + 5,$langs->trans("PriceU"));
$pdf->line(174, $tab_top, 174, $tab_top + $tab_height);
$pdf->Text(187,$tab_top + 5,$langs->trans("Total"));
// $pdf->Rect(10, $tab_top, 190, $nexY - $tab_top);
$pdf->Rect(10, $tab_top, 190, $tab_height);
@ -288,7 +288,7 @@ class pdf_propale_rouge extends ModelePDFPropales
$pdf->SetFont('Arial','B',14);
$pdf->MultiCell(76, 8, FAC_PDF_INTITULE, 0, 'L');
}
$pdf->SetTextColor(70,70,170);
if (defined("FAC_PDF_ADRESSE"))
{
@ -299,13 +299,13 @@ class pdf_propale_rouge extends ModelePDFPropales
{
$pdf->SetFont('Arial','',10);
$pdf->MultiCell(76, 5, "Tél : ".FAC_PDF_TEL);
}
}
if (defined("MAIN_INFO_SIREN"))
{
$pdf->SetFont('Arial','',10);
$pdf->MultiCell(76, 5, "SIREN : ".MAIN_INFO_SIREN);
}
}
if (defined("FAC_PDF_INTITULE2"))
{
$pdf->SetXY(100,5);
@ -325,14 +325,14 @@ class pdf_propale_rouge extends ModelePDFPropales
$pdf->SetXY(102,47);
$pdf->MultiCell(96,5, $propale->client->adresse . "\n" . $propale->client->cp . " " . $propale->client->ville);
$pdf->rect(100, 40, 100, 40);
$pdf->SetTextColor(200,0,0);
$pdf->SetFont('Arial','B',12);
$pdf->Text(11, 88, "Date : " . strftime("%d %b %Y", $propale->date));
$pdf->Text(11, 94, "Proposition commerciale : ".$propale->ref);
}
}

View File

@ -42,7 +42,7 @@ class pdf_propale_vert extends ModelePDFPropales
\param db handler accès base de donnée
*/
function pdf_propale_vert($db=0)
{
{
$this->db = $db;
$this->name = "vert";
$this->description = "Affichage de la remise par produit";
@ -52,7 +52,7 @@ class pdf_propale_vert extends ModelePDFPropales
$this->page_largeur = 210;
$this->page_hauteur = 297;
$this->format = array($this->page_largeur,$this->page_hauteur);
$this->error = "";
}
@ -60,21 +60,21 @@ class pdf_propale_vert extends ModelePDFPropales
/** \brief Renvoi dernière erreur
\return string Dernière erreur
*/
function pdferror()
function pdferror()
{
return $this->error;
}
/**
\brief Fonction générant la propale sur le disque
\param propale Objet propal
\return int 1=ok, 0=ko
*/
function write_pdf_file($propale)
function write_pdf_file($propale,$outputlangs='')
{
global $user,$conf,$langs;
global $user,$conf,$langs,$mysoc;
if ($conf->propal->dir_output)
{
// Définition de l'objet $propal (pour compatibilite ascendante)
@ -84,7 +84,7 @@ class pdf_propale_vert extends ModelePDFPropales
$propale = new Propal($this->db,"",$id);
$ret=$propale->fetch($id);
}
// Définition de $dir et $file
if ($propale->specimen)
{
@ -97,7 +97,7 @@ class pdf_propale_vert extends ModelePDFPropales
$dir = $conf->propal->dir_output . "/" . $propref;
$file = $dir . "/" . $propref . ".pdf";
}
if (! file_exists($dir))
{
if (create_exdir($dir) < 0)
@ -106,21 +106,21 @@ class pdf_propale_vert extends ModelePDFPropales
return 0;
}
}
if (file_exists($dir))
{
$pdf=new FPDF('P','mm',$this->format);
$pdf->Open();
$pdf->AddPage();
$pdf->SetTitle($propale->ref);
$pdf->SetSubject("Proposition commerciale");
$pdf->SetCreator("Dolibarr ".DOL_VERSION);
$pdf->SetAuthor($user->fullname);
$this->_pagehead($pdf, $propale);
/*
*/
$tab_top = 100;
@ -128,53 +128,53 @@ class pdf_propale_vert extends ModelePDFPropales
/*
*
*/
$pdf->SetFillColor(220,220,220);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('Arial','', 10);
$pdf->SetXY (10, $tab_top + 10 );
$iniY = $pdf->GetY();
$curY = $pdf->GetY();
$nexY = $pdf->GetY();
$nblignes = sizeof($propale->lignes);
for ($i = 0 ; $i < $nblignes ; $i++)
{
$curY = $nexY;
$pdf->SetXY (40, $curY );
$pdf->MultiCell(90, 5, $propale->lignes[$i]->desc, 0, 'J', 0);
$nexY = $pdf->GetY();
$pdf->SetXY (10, $curY );
$pdf->SetFont('Arial','', 8);
$pdf->MultiCell(30, 5, $propale->lignes[$i]->ref, 0, 'L', 0);
$pdf->SetFont('Arial','', 10);
$pdf->SetXY (132, $curY );
$pdf->MultiCell(10, 5, $propale->lignes[$i]->tva_tx, 0, 'C', 0);
$pdf->SetXY (142, $curY );
$pdf->MultiCell(8, 5, $propale->lignes[$i]->qty, 0, 'C');
$pdf->SetXY (150, $curY );
$pdf->MultiCell(16, 5, price($propale->lignes[$i]->subprice), 0, 'R', 0);
$pdf->SetXY (166, $curY );
$pdf->MultiCell(14, 5, $propale->lignes[$i]->remise_percent."%", 0, 'R', 0);
$pdf->SetXY (180, $curY );
$total = price($propale->lignes[$i]->price * $propale->lignes[$i]->qty);
$pdf->MultiCell(20, 5, $total, 0, 'R', 0);
$pdf->line(10, $curY, 200, $curY );
if ($nexY > 240 && $i < $nblignes - 1)
{
$this->_tableau($pdf, $tab_top, $tab_height, $nexY);
@ -185,7 +185,7 @@ class pdf_propale_vert extends ModelePDFPropales
$pdf->SetFont('Arial','', 10);
}
}
$this->_tableau($pdf, $tab_top, $tab_height, $nexY);
/*
*
@ -193,51 +193,51 @@ class pdf_propale_vert extends ModelePDFPropales
$tab2_top = 241;
$tab2_lh = 7;
$tab2_height = $tab2_lh * 4;
$pdf->SetFont('Arial','', 11);
$pdf->Rect(132, $tab2_top, 68, $tab2_height);
$pdf->line(132, $tab2_top + $tab2_height - ($tab2_lh*3), 200, $tab2_top + $tab2_height - ($tab2_lh*3) );
$pdf->line(132, $tab2_top + $tab2_height - ($tab2_lh*2), 200, $tab2_top + $tab2_height - ($tab2_lh*2) );
$pdf->line(132, $tab2_top + $tab2_height - $tab2_lh, 200, $tab2_top + $tab2_height - $tab2_lh );
$pdf->line(174, $tab2_top, 174, $tab2_top + $tab2_height);
$pdf->SetXY (132, $tab2_top + 0);
$pdf->MultiCell(42, $tab2_lh, $langs->trans("TotalHT"), 0, 'R', 0);
$pdf->SetXY (132, $tab2_top + $tab2_lh);
$pdf->MultiCell(42, $tab2_lh, $langs->trans("GlobalDiscount"), 0, 'R', 0);
$pdf->SetXY (132, $tab2_top + $tab2_lh*2);
$pdf->MultiCell(42, $tab2_lh, "Total HT après remise", 0, 'R', 0);
$pdf->SetXY (132, $tab2_top + $tab2_lh*3);
$pdf->MultiCell(42, $tab2_lh, $langs->trans("TotalVAT"), 0, 'R', 0);
$pdf->SetXY (132, $tab2_top + ($tab2_lh*4));
$pdf->MultiCell(42, $tab2_lh, $langs->trans("TotalTTC"), 1, 'R', 1);
$pdf->SetXY (174, $tab2_top + 0);
$pdf->MultiCell(26, $tab2_lh, price($propale->total_ht + $propale->remise), 0, 'R', 0);
$pdf->SetXY (174, $tab2_top + $tab2_lh);
$pdf->MultiCell(26, $tab2_lh, price($propale->remise), 0, 'R', 0);
$pdf->SetXY (174, $tab2_top + $tab2_lh*2);
$pdf->MultiCell(26, $tab2_lh, price($propale->total_ht), 0, 'R', 0);
$pdf->SetXY (174, $tab2_top + $tab2_lh*3);
$pdf->MultiCell(26, $tab2_lh, price($propale->total_tva), 0, 'R', 0);
$pdf->SetXY (174, $tab2_top + ($tab2_lh*4));
$pdf->MultiCell(26, $tab2_lh, price($propale->total_ttc), 1, 'R', 1);
/*
*
*/
$pdf->Output($file);
return 1;
}
@ -249,10 +249,10 @@ class pdf_propale_vert extends ModelePDFPropales
global $langs,$conf;
$langs->load("main");
$langs->load("bills");
$yt = 100;
$pdf->SetFont('Arial','',10);
$pdf->SetXY(10, $yt);
$pdf->MultiCell(30,5,$langs->trans("Ref"),0,'L');
@ -262,15 +262,15 @@ class pdf_propale_vert extends ModelePDFPropales
$pdf->SetXY(132, $yt);
$pdf->line(132, $tab_top, 132, $tab_top + $tab_height);
$pdf->MultiCell(10,5,$langs->trans("VAT"),0,'C');
$pdf->line(142, $tab_top, 142, $tab_top + $tab_height);
$pdf->SetXY(142, $yt);
$pdf->MultiCell(8,5,$langs->trans("Qty"),0,'C');
$pdf->line(150, $tab_top, 150, $tab_top + $tab_height);
$pdf->SetXY(150, $yt);
$pdf->MultiCell(16,5,$langs->trans("PriceU"),0,'C');
$pdf->line(166, $tab_top, 166, $tab_top + $tab_height);
$pdf->SetXY(166, $yt);
$pdf->MultiCell(14,5,$langs->trans("ReductionShort"),0,'C');
@ -278,7 +278,7 @@ class pdf_propale_vert extends ModelePDFPropales
$pdf->line(180, $tab_top, 180, $tab_top + $tab_height);
$pdf->SetXY(180, $yt);
$pdf->MultiCell(20,5,$langs->trans("Total"),0,'R');
// $pdf->Rect(10, $tab_top, 190, $nexY - $tab_top);
$pdf->Rect(10, $tab_top, 190, $tab_height);
@ -303,7 +303,7 @@ class pdf_propale_vert extends ModelePDFPropales
$pdf->SetFont('Arial','B',14);
$pdf->MultiCell(76, 8, FAC_PDF_INTITULE, 0, 'L');
}
$pdf->SetTextColor(70,70,170);
if (defined("FAC_PDF_ADRESSE"))
{
@ -314,13 +314,13 @@ class pdf_propale_vert extends ModelePDFPropales
{
$pdf->SetFont('Arial','',10);
$pdf->MultiCell(76, 5, "Tél : ".FAC_PDF_TEL);
}
}
if (defined("MAIN_INFO_SIREN"))
{
$pdf->SetFont('Arial','',10);
$pdf->MultiCell(76, 5, "SIREN : ".MAIN_INFO_SIREN);
}
}
if (defined("FAC_PDF_INTITULE2"))
{
$pdf->SetXY(100,5);
@ -340,14 +340,14 @@ class pdf_propale_vert extends ModelePDFPropales
$pdf->SetXY(102,47);
$pdf->MultiCell(96,5, $propale->client->adresse . "\n" . $propale->client->cp . " " . $propale->client->ville);
$pdf->rect(100, 40, 100, 40);
$pdf->SetTextColor(200,0,0);
$pdf->SetFont('Arial','B',12);
$pdf->Text(11, 88, "Date : " . strftime("%d %b %Y", $propale->date));
$pdf->Text(11, 94, "Proposition commerciale : ".$propale->ref);
}
}

File diff suppressed because it is too large Load Diff