Merge pull request #2 from Dolibarr/develop

Develop
This commit is contained in:
Maxime Kohlhaas 2012-08-08 13:24:54 -07:00
commit 4420684a39
57 changed files with 1023 additions and 1109 deletions

View File

@ -5,6 +5,9 @@ English Dolibarr ChangeLog
***** ChangeLog for 3.3 compared to 3.2 *****
For users:
- New: If field "signature" is filled into user table, text is added
at end of predefined email texts. If option MAIL_DO_NOT_USE_SIGN is on, this
feautre is disabled.
- New: Add link "Back to list" on all cards.
- New: After first install, warning are visible onto mandatory setup not
configured. Show also total number of activated modules.
@ -42,7 +45,8 @@ For developers:
- New: Can add a link on title field of added dictionnary.
- New: Uniformize code.
- New: Add option WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER and
WORKFLOW_DISABLE_CLASSIFY_BILLED_FROM_ORDER
WORKFLOW_DISABLE_CLASSIFY_BILLED_FROM_ORDER.
- New: A module can add several css and js.
- New: removed deprecated methods
ldap::connect, formadmin::select_lang,
html::select_tva

View File

@ -324,7 +324,6 @@ if ($nboftargetok) {
$ret=`rm -f $BUILDROOT/$PROJECT/.gitignore $BUILDROOT/$PROJECT/*/.gitignore $BUILDROOT/$PROJECT/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.gitignore`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/theme/amarok`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/geoip/sample*.*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/lightbox`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/lib/Mail`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/license.txt`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/PHPExcel/Shared/PDF`;

View File

@ -73,16 +73,17 @@ class modMyModule extends DolibarrModules
// for specific path of parts (eg: /mymodule/core/modules/barcode)
// for specific css file (eg: /mymodule/css/mymodule.css.php)
//$this->module_parts = array(
// 'triggers' => 0, // Set this to 1 if module has its own trigger directory (core/triggers)
// 'login' => 0, // Set this to 1 if module has its own login method directory (core/login)
// 'substitutions' => 0, // Set this to 1 if module has its own substitution function file (core/substitutions)
// 'menus' => 0, // Set this to 1 if module has its own menus handler directory (core/menus)
// 'theme' => 0, // Set this to 1 if module has its own theme directory (core/theme)
// 'tpl' => 0, // Set this to 1 if module overwrite template dir (core/tpl)
// 'barcode' => 0, // Set this to 1 if module has its own barcode directory (core/modules/barcode)
// 'models' => 0, // Set this to 1 if module has its own models directory (core/modules/xxx)
// 'css' => '/mymodule/css/mymodule.css.php', // Set this to relative path of css if module has its own css file
// 'hooks' => array('hookcontext1','hookcontext2') // Set here all hooks context managed by module
// 'triggers' => 0, // Set this to 1 if module has its own trigger directory (core/triggers)
// 'login' => 0, // Set this to 1 if module has its own login method directory (core/login)
// 'substitutions' => 0, // Set this to 1 if module has its own substitution function file (core/substitutions)
// 'menus' => 0, // Set this to 1 if module has its own menus handler directory (core/menus)
// 'theme' => 0, // Set this to 1 if module has its own theme directory (core/theme)
// 'tpl' => 0, // Set this to 1 if module overwrite template dir (core/tpl)
// 'barcode' => 0, // Set this to 1 if module has its own barcode directory (core/modules/barcode)
// 'models' => 0, // Set this to 1 if module has its own models directory (core/modules/xxx)
// 'css' => array('/mymodule/css/mymodule.css.php'), // Set this to relative path of css file if module has its own css file
// 'js' => array('/mymodule/js/mymodule.js'), // Set this to relative path of js file if module must load a js on all pages
// 'hooks' => array('hookcontext1','hookcontext2') // Set here all hooks context managed by module
// 'workflow' => array('WORKFLOW_MODULE1_YOURACTIONTYPE_MODULE2'=>array('enabled'=>'! empty($conf->module1->enabled) && ! empty($conf->module2->enabled)', 'picto'=>'yourpicto@mymodule')) // Set here all workflow context managed by module
// );
$this->module_parts = array();

View File

@ -55,7 +55,7 @@ if ($action == 'updateMask')
{
$maskconstorder=GETPOST('maskconstorder','alpha');
$maskorder=GETPOST('maskorder','alpha');
if ($maskconstorder) $res = dolibarr_set_const($db,$maskconstorder,$maskorder,'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
@ -77,7 +77,7 @@ if ($action == 'specimen') // For orders
$commande = new CommandeFournisseur($db);
$commande->initAsSpecimen();
$commande->thirdparty=$specimenthirdparty;
// Search template files
$file=''; $classname=''; $filefound=0;
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
@ -91,13 +91,13 @@ if ($action == 'specimen') // For orders
break;
}
}
if ($filefound)
{
require_once($file);
$module = new $classname($db);
$module = new $classname($db,$commande);
if ($module->write_file($commande,$langs) > 0)
{
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=commande_fournisseur&file=SPECIMEN.pdf");
@ -123,7 +123,7 @@ if ($action == 'specimenfacture') // For invoices
$facture = new FactureFournisseur($db);
$facture->initAsSpecimen();
$facture->thirdparty=$specimenthirdparty; // Define who should has build the invoice (so the supplier)
// Search template files
$file=''; $classname=''; $filefound=0;
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
@ -137,13 +137,13 @@ if ($action == 'specimenfacture') // For invoices
break;
}
}
if ($filefound)
{
require_once($file);
$module = new $classname($db);
$module = new $classname($db,$facture);
if ($module->write_file($facture,$langs) > 0)
{
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=facture_fournisseur&file=SPECIMEN.pdf");
@ -166,7 +166,7 @@ if ($action == 'set')
{
$label = GETPOST('label','alpha');
$scandir = GETPOST('scandir','alpha');
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)";
$sql.= " VALUES ('".$db->escape($value)."','".$type."',".$conf->entity.", ";
$sql.= ($label?"'".$db->escape($label)."'":'null').", ";
@ -198,7 +198,7 @@ if ($action == 'setdoc')
{
$label = GETPOST('label','alpha');
$scandir = GETPOST('scandir','alpha');
$db->begin();
if ($type == 'order_supplier' && dolibarr_set_const($db, "COMMANDE_SUPPLIER_ADDON_PDF",$value,'chaine',0,'',$conf->entity))

View File

@ -51,7 +51,7 @@ if ($action == 'updateMask')
{
$maskconstproject=GETPOST('maskconstproject','alpha');
$maskproject=GETPOST('maskproject','alpha');
if ($maskconstproject) $res = dolibarr_set_const($db,$maskconstproject,$maskproject,'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
@ -86,7 +86,7 @@ if ($action == 'specimen')
break;
}
}
if ($filefound)
{
require_once($file);
@ -207,7 +207,7 @@ foreach ($dirmodels as $reldir)
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
if ($module->isEnabled())
{
{
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$module->nom."</td><td>\n";
print $module->info();
@ -339,10 +339,10 @@ foreach ($dirmodels as $reldir)
// Active
if (in_array($name, $def))
{
print "<td align=\"center\">\n";
print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">';
print img_picto($langs->trans("Enabled"),'switch_on');
print '</a>';
print '</a>';
print "</td>";
}
else
@ -371,7 +371,7 @@ foreach ($dirmodels as $reldir)
$htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
$htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1);
print '<td align="center">';
$link='<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&amp;module='.$name.'">'.img_object($langs->trans("Preview"),'order').'</a>';
$link='<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&amp;module='.$name.'">'.img_object($langs->trans("Preview"),'project').'</a>';
print $form->textwithpicto(' &nbsp; &nbsp; '.$link,$htmltooltip,-1,0);
print '</td>';

View File

@ -280,7 +280,7 @@ class Commande extends CommonOrder
dol_syslog("Rename ok");
// Suppression ancien fichier PDF dans nouveau rep
dol_delete_file($conf->commande->dir_output.'/'.$snum.'/'.$comref.'.*');
dol_delete_file($conf->commande->dir_output.'/'.$snum.'/'.$comref.'*.*');
}
}
}

View File

@ -98,7 +98,8 @@ $formother = new FormOther($db);
$formfile = new FormFile($db);
$companystatic = new Societe($db);
llxHeader();
$help_url="EN:Module_Customers_Orders|FR:Module_Commandes_Clients|ES:Módulo_Pedidos_de_clientes";
llxHeader('',$langs->trans("Orders"),$help_url);
$sql = 'SELECT s.nom, s.rowid as socid, s.client, c.rowid, c.ref, c.total_ht, c.ref_client,';
$sql.= ' c.date_valid, c.date_commande, c.date_livraison, c.fk_statut, c.facture as facturee';

View File

@ -29,10 +29,12 @@
require("../main.inc.php");
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
require_once(DOL_DOCUMENT_ROOT ."/commande/class/commande.class.php");
require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php");
require_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php");
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formother.class.php");
require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php");
require_once(DOL_DOCUMENT_ROOT."/core/lib/report.lib.php");
if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT."/core/lib/project.lib.php");
$langs->load('orders');
$langs->load('deliveries');
@ -73,10 +75,9 @@ if ($action == 'create')
}
}
$now=dol_now();
$html = new Form($db);
$formfile = new FormFile($db);
$companystatic = new Societe($db);
$htmlother = new FormOther($db);
$viewstatut=GETPOST('viewstatut');
/*
* Actions
@ -267,30 +268,30 @@ if (($action == 'create' || $action == 'add') && empty($mesgs))
{
$fk_parent_line = 0;
}
$result = $object->addline(
$id,
$desc,
$lines[$i]->subprice,
$lines[$i]->qty,
$lines[$i]->tva_tx,
$lines[$i]->localtax1_tx,
$lines[$i]->localtax2_tx,
$lines[$i]->fk_product,
$lines[$i]->remise_percent,
$date_start,
$date_end,
0,
$lines[$i]->info_bits,
$lines[$i]->fk_remise_except,
'HT',
0,
$product_type,
$lines[$i]->rang,
$lines[$i]->special_code,
$object->origin,
$lines[$i]->rowid,
$fk_parent_line
);
$result = $object->addline(
$id,
$desc,
$lines[$i]->subprice,
$lines[$i]->qty,
$lines[$i]->tva_tx,
$lines[$i]->localtax1_tx,
$lines[$i]->localtax2_tx,
$lines[$i]->fk_product,
$lines[$i]->remise_percent,
$date_start,
$date_end,
0,
$lines[$i]->info_bits,
$lines[$i]->fk_remise_except,
'HT',
0,
$product_type,
$lines[$i]->rang,
$lines[$i]->special_code,
$object->origin,
$lines[$i]->rowid,
$fk_parent_line
);
if ($result > 0)
{
$lineid=$result;
@ -342,146 +343,149 @@ if (($action == 'create' || $action == 'add') && empty($mesgs))
$mesgs[]='<div class="error">'.$object->error.'</div>';
}
}
}
/*
* View
*/
$html = new Form($db);
$htmlother = new FormOther($db);
$formfile = new FormFile($db);
$now=dol_now();
// Mode creation
if ($action == 'create')
/*
* View
*/
$html = new Form($db);
$htmlother = new FormOther($db);
$formfile = new FormFile($db);
$companystatic = new Societe($db);
// Mode creation
if ($action == 'create')
{
$facturestatic=new Facture($db);
llxHeader();
print_fiche_titre($langs->trans('NewBill'));
$soc = new Societe($db);
if ($socid) $res=$soc->fetch($socid);
if ($res)
{
$facturestatic=new Facture($db);
$cond_reglement_id = $soc->cond_reglement_id;
$mode_reglement_id = $soc->mode_reglement_id;
$remise_percent = $soc->remise_percent;
}
$remise_absolue = 0;
$dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0;
llxHeader();
print_fiche_titre($langs->trans('NewBill'));
$absolute_discount=$soc->getAvailableDiscounts();
print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="add">';
print '<input type="hidden" name="socid" value="'.$soc->id.'">' ."\n";
print '<input name="facnumber" type="hidden" value="provisoire">';
print '<input name="ref_client" type="hidden" value="'.$ref_client.'">';
print '<input name="ref_int" type="hidden" value="'.$ref_int.'">';
print '<input type="hidden" name="origin" value="'.GETPOST('origin').'">';
print '<input type="hidden" name="originid" value="'.GETPOST('originid').'">';
print '<table class="border" width="100%">';
// Ref
print '<tr><td class="fieldrequired">'.$langs->trans('Ref').'</td><td colspan="2">'.$langs->trans('Draft').'</td></tr>';
// Tiers
print '<tr><td class="fieldrequired">'.$langs->trans('Customer').'</td><td colspan="2">';
print $soc->getNomUrl(1);
print '<input type="hidden" name="socid" value="'.$soc->id.'">';
print '</td>';
print '</tr>'."\n";
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans('Type').'</td><td colspan="2">';
print '<table class="nobordernopadding">'."\n";
// Standard invoice
print '<tr height="18"><td width="16px" valign="middle">';
print '<input type="radio" name="type" value="0"'.(GETPOST('type')==0?' checked="true"':'').'>';
print '</td><td valign="middle">';
$desc=$html->textwithpicto($langs->trans("InvoiceStandardAsk"),$langs->transnoentities("InvoiceStandardDesc"),1);
print $desc;
print '</td></tr>'."\n";
print '</table>';
// Date invoice
print '<tr><td class="fieldrequired">'.$langs->trans('Date').'</td><td colspan="2">';
$html->select_date(0,'','','','',"add",1,1);
print '</td></tr>';
// Payment term
print '<tr><td nowrap>'.$langs->trans('PaymentConditionsShort').'</td><td colspan="2">';
$html->select_conditions_paiements(isset($_POST['cond_reglement_id'])?$_POST['cond_reglement_id']:$cond_reglement_id,'cond_reglement_id');
print '</td></tr>';
// Payment mode
print '<tr><td>'.$langs->trans('PaymentMode').'</td><td colspan="2">';
$html->select_types_paiements(isset($_POST['mode_reglement_id'])?$_POST['mode_reglement_id']:$mode_reglement_id,'mode_reglement_id');
print '</td></tr>';
// Project
if ($conf->projet->enabled)
{
$langs->load('projects');
print '<tr><td>'.$langs->trans('Project').'</td><td colspan="2">';
select_projects($soc->id, $projectid, 'projectid');
print '</td></tr>';
}
// Modele PDF
print '<tr><td>'.$langs->trans('Model').'</td>';
print '<td>';
include_once(DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php');
$liste=ModelePDFFactures::liste_modeles($db);
print $html->selectarray('model',$liste,$conf->global->FACTURE_ADDON_PDF);
print "</td></tr>";
$soc = new Societe($db);
if ($socid) $res=$soc->fetch($socid);
if ($res)
// Public note
print '<tr>';
print '<td class="border" valign="top">'.$langs->trans('NotePublic').'</td>';
print '<td valign="top" colspan="2">';
print '<textarea name="note_public" wrap="soft" cols="70" rows="'.ROWS_3.'">';
dol_include_once('/commande/class/commande.class.php');
$srcobject = new Commande($db);
$commandes = $langs->trans("Orders").": ";
foreach ($selected as $sel)
{
$result=$srcobject->fetch($sel);
if ($result > 0)
{
$cond_reglement_id = $soc->cond_reglement_id;
$mode_reglement_id = $soc->mode_reglement_id;
$remise_percent = $soc->remise_percent;
$commandes.= $srcobject->ref." ";
}
$remise_absolue = 0;
$dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0;
}
print $commandes;
$absolute_discount=$soc->getAvailableDiscounts();
print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="add">';
print '<input type="hidden" name="socid" value="'.$soc->id.'">' ."\n";
print '<input name="facnumber" type="hidden" value="provisoire">';
print '<input name="ref_client" type="hidden" value="'.$ref_client.'">';
print '<input name="ref_int" type="hidden" value="'.$ref_int.'">';
print '<input type="hidden" name="origin" value="'.GETPOST('origin').'">';
print '<input type="hidden" name="originid" value="'.GETPOST('originid').'">';
print '<table class="border" width="100%">';
// Ref
print '<tr><td class="fieldrequired">'.$langs->trans('Ref').'</td><td colspan="2">'.$langs->trans('Draft').'</td></tr>';
// Tiers
print '<tr><td class="fieldrequired">'.$langs->trans('Customer').'</td><td colspan="2">';
print $soc->getNomUrl(1);
print '<input type="hidden" name="socid" value="'.$soc->id.'">';
print '</td>';
print '</tr>'."\n";
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans('Type').'</td><td colspan="2">';
print '<table class="nobordernopadding">'."\n";
// Standard invoice
print '<tr height="18"><td width="16px" valign="middle">';
print '<input type="radio" name="type" value="0"'.(GETPOST('type')==0?' checked="true"':'').'>';
print '</td><td valign="middle">';
$desc=$html->textwithpicto($langs->trans("InvoiceStandardAsk"),$langs->transnoentities("InvoiceStandardDesc"),1);
print $desc;
print '</td></tr>'."\n";
print '</table>';
// Date invoice
print '<tr><td class="fieldrequired">'.$langs->trans('Date').'</td><td colspan="2">';
$html->select_date(0,'','','','',"add",1,1);
print '</td></tr>';
// Payment term
print '<tr><td nowrap>'.$langs->trans('PaymentConditionsShort').'</td><td colspan="2">';
$html->select_conditions_paiements(isset($_POST['cond_reglement_id'])?$_POST['cond_reglement_id']:$cond_reglement_id,'cond_reglement_id');
print '</td></tr>';
// Payment mode
print '<tr><td>'.$langs->trans('PaymentMode').'</td><td colspan="2">';
$html->select_types_paiements(isset($_POST['mode_reglement_id'])?$_POST['mode_reglement_id']:$mode_reglement_id,'mode_reglement_id');
print '</td></tr>';
// Project
if ($conf->projet->enabled)
{
$langs->load('projects');
print '<tr><td>'.$langs->trans('Project').'</td><td colspan="2">';
select_projects($soc->id, $projectid, 'projectid');
print '</td></tr>';
}
// Modele PDF
print '<tr><td>'.$langs->trans('Model').'</td>';
print '<td>';
include_once(DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php');
$liste=ModelePDFFactures::liste_modeles($db);
print $html->selectarray('model',$liste,$conf->global->FACTURE_ADDON_PDF);
print "</td></tr>";
// Public note
print '</textarea></td></tr>';
// Private note
if (! $user->societe_id)
{
print '<tr>';
print '<td class="border" valign="top">'.$langs->trans('NotePublic').'</td>';
print '<td class="border" valign="top">'.$langs->trans('NotePrivate').'</td>';
print '<td valign="top" colspan="2">';
print '<textarea name="note_public" wrap="soft" cols="70" rows="'.ROWS_3.'">';
dol_include_once('/commande/class/commande.class.php');
$srcobject = new Commande($db);
$commandes = $langs->trans("Orders").": ";
foreach ($selected as $sel)
{
$result=$srcobject->fetch($sel);
if ($result > 0)
{
$commandes.= $srcobject->ref." ";
}
}
print $commandes;
print '<textarea name="note" wrap="soft" cols="70" rows="'.ROWS_3.'">';
print '</textarea></td></tr>';
// Private note
if (! $user->societe_id)
{
print '<tr>';
print '<td class="border" valign="top">'.$langs->trans('NotePrivate').'</td>';
print '<td valign="top" colspan="2">';
print '<textarea name="note" wrap="soft" cols="70" rows="'.ROWS_3.'">';
print '</textarea></td></tr>';
}
print '</table>';
print '</td></tr>';
}
print '</table>';
print '</td></tr>';
while ($i < $n)
{
print '<input type="hidden" name="orders_to_invoice[]" value="'.$orders_id[$i].'">';
$i++;
}
print "</table>\n";
// Button "Create Draft"
print '<br><center><input type="submit" class="button" name="bouton" value="'.$langs->trans('CreateDraft').'"></center>';
print "</form>\n";
}
//Mode liste
else
if (($action != 'create' && $action != 'add') || ! empty($mesgs))
{
llxHeader();
?>
<script language="javascript" type="text/javascript">
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery("#checkall").click(function() {
jQuery(".checkformerge").attr('checked', true);
@ -492,14 +496,34 @@ else
});
</script>
<?php
$sql = 'SELECT s.nom, s.rowid as socid, s.client, c.rowid, c.ref, c.total_ht, c.ref_client,';
$sql.= ' c.date_valid, c.date_commande, c.date_livraison, c.fk_statut, c.facture as facturee';
$sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s';
$sql.= ', '.MAIN_DB_PREFIX.'commande as c';
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= ' WHERE c.fk_soc = s.rowid';
$sql.= ' AND c.fk_statut in (1, 2) AND c.facture = 0';
// Which invoice to show
if ($viewstatut <> '')
{
if ($viewstatut < 4 && $viewstatut > -2)
{
$sql.= ' AND c.fk_statut ='.$viewstatut; // brouillon, validee, en cours, annulee
if ($viewstatut == 3)
{
$sql.= ' AND c.facture = 0'; // need to create invoice
}
}
if ($viewstatut == 4)
{
$sql.= ' AND c.facture = 1'; // invoice created
}
if ($viewstatut == -2) // To process
{
//$sql.= ' AND c.fk_statut IN (1,2,3) AND c.facture = 0';
$sql.= " AND ((c.fk_statut IN (1,2)) OR (c.fk_statut = 3 AND c.facture = 0))"; // If status is 2 and facture=1, it must be selected
}
}
$sql.= ' AND s.entity = '.$conf->entity;
if ($socid) $sql.= ' AND s.rowid = '.$socid;
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
@ -511,18 +535,18 @@ else
{
$sql.= " AND (c.ref LIKE '%".$db->escape($sall)."%' OR c.note LIKE '%".$db->escape($sall)."%')";
}
//Date filter
if ($date_start && $date_end) $sql.= " AND c.date_commande >= '".$db->idate($date_start)."' AND c.date_commande <= '".$db->idate($date_end)."'";
if ($date_starty && $date_endy) $sql.= " AND c.date_livraison >= '".$db->idate($date_starty)."' AND c.date_livraison <= '".$db->idate($date_endy)."'";
if (!empty($sref_client))
{
$sql.= ' AND c.ref_client LIKE \'%'.$db->escape($sref_client).'%\'';
}
$sql.= ' ORDER BY '.$sortfield.' '.$sortorder;
$resql = $db->query($sql);
if ($resql)
{
if ($socid)
@ -545,7 +569,7 @@ else
print '<h3>';
$companystatic->id=$socid;
$companystatic->nom=$soc->nom;
print $companystatic->getNomUrl(1,'customer');
print '</h3>';
print '<table class="noborder" width="100%">';
@ -557,7 +581,7 @@ else
print_liste_field_titre($langs->trans('Status'),'','','','','align="right"');
print_liste_field_titre($langs->trans('GenerateBill'),'','','','','align="center"');
print '</tr>';
// Lignes des champs de filtre
print '<form method="get" action="orderstoinvoice.php">';
print '<input type="hidden" name="socid" value="'.$socid.'">';
@ -569,52 +593,52 @@ else
//print '<td class="liste_titre">';
print '<td class="liste_titre" align="left">';
print '<input class="flat" type="text" size="10" name="sref_client" value="'.$sref_client.'">';
//DATE ORDER
print '<td class="liste_titre" align="center">';
print $period;
print '</td>';
print '</td>';
//DATE DELIVERY
print '<td class="liste_titre" align="center">';
print $periodely;
print '</td>';
//SEARCH BUTTON
//SEARCH BUTTON
print '</td><td align="right" class="liste_titre">';
print '<input type="image" class="liste_titre" name="button_search" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
//ALL/NONE
print '<td class="liste_titre" align="center">';
if ($conf->use_javascript_ajax) print '<a href="#" id="checkall">'.$langs->trans("All").'</a> / <a href="#" id="checknone">'.$langs->trans("None").'</a>';
print '</td>';
print '</td></tr>';
print '</form>';
print '<form name="orders2invoice" action="orderstoinvoice.php" method="GET">';
$var=True;
$generic_commande = new Commande($db);
while ($i < $num)
{
$objp = $db->fetch_object($resql);
$var=!$var;
print '<tr '.$bc[$var].'>';
print '<td nowrap="nowrap">';
$generic_commande->id=$objp->rowid;
$generic_commande->ref=$objp->ref;
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
print '<td class="nobordernopadding" nowrap="nowrap">';
print $generic_commande->getNomUrl(1,$objp->fk_statut);
print '</td>';
print '<td width="20" class="nobordernopadding" nowrap="nowrap">';
if (($objp->fk_statut > 0) && ($objp->fk_statut < 3) && $db->jdate($objp->date_valid) < ($now - $conf->commande->client->warning_delay)) print img_picto($langs->trans("Late"),"warning");
print '</td>';
print '<td width="16" align="right" class="nobordernopadding">';
$filename=dol_sanitizeFileName($objp->ref);
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($objp->ref);
@ -622,37 +646,37 @@ else
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1);
print '</td></tr></table>';
print '</td>';
print '<td>'.$objp->ref_client.'</td>';
// Order date
print '<td align="center" nowrap>';
print dol_print_date($db->jdate($objp->date_commande),'day');
print '</td>';
//Delivery date
print '<td align="center" nowrap>';
print dol_print_date($db->jdate($objp->date_livraison),'day');
print '</td>';
// Statut
print '<td align="right" nowrap="nowrap">'.$generic_commande->LibStatut($objp->fk_statut,$objp->facturee,5).'</td>';
// Checkbox
print '<td align="center">';
print '<input class="flat checkformerge" type="checkbox" name="orders_to_invoice[]" value="'.$objp->rowid.'">';
print '</td>' ;
print '</tr>';
$total = $total + $objp->price;
$subtotal = $subtotal + $objp->price;
$i++;
}
print '</table>';
/*
* Boutons actions
* Boutons actions
*/
print '<div align="right">';
print '<input type="hidden" name="socid" value="'.$socid.'">';

View File

@ -1724,7 +1724,7 @@ class Facture extends CommonInvoice
dol_syslog("Rename ok");
// Suppression ancien fichier PDF dans nouveau rep
dol_delete_file($conf->facture->dir_output.'/'.$snumfa.'/'.$facref.'.*');
dol_delete_file($conf->facture->dir_output.'/'.$snumfa.'/'.$facref.'*.*');
}
}
}

View File

@ -165,6 +165,24 @@ abstract class CommonDocGenerator
);
}
/**
* Rect pdf
*
* @param unknown_type $pdf
* @param unknown_type $x
* @param unknown_type $y
* @param unknown_type $l
* @param unknown_type $h
* @param int $hidetop Hide top
* @param int $hidebottom Hide bottom
*/
function printRect($pdf, $x, $y, $l, $h, $hidetop=0, $hidebottom=0)
{
if (empty($hidetop)) $pdf->line($x, $y, $x+$l, $y);
$pdf->line($x+$l, $y, $x+$l, $y+$h);
if (empty($hidebottom)) $pdf->line($x+$l, $y+$h, $x, $y+$h);
$pdf->line($x, $y+$h, $x, $y);
}
}
?>

View File

@ -52,7 +52,7 @@ class Conf
public $smart_menu;
public $modules = array(); // List of activated modules
public $modules_parts = array('js'=>array(),'triggers'=>array(),'login'=>array(),'substitutions'=>array(),'menus'=>array(),'theme'=>array(),'tpl'=>array(),'barcode'=>array(),'models'=>array(),'hooks'=>array()); // List of modules parts
public $modules_parts = array('css'=>array(), 'js'=>array(),'triggers'=>array(),'login'=>array(),'substitutions'=>array(),'menus'=>array(),'theme'=>array(),'tpl'=>array(),'barcode'=>array(),'models'=>array(),'hooks'=>array()); // List of modules parts
// TODO Remove thoose arrays with generic module_parts
public $tabs_modules = array();

View File

@ -1424,7 +1424,7 @@ class Form
$outval='';
$opt = '<option value="'.$objp->idprodfournprice.'"';
if ($selected == $objp->idprodfournprice) $opt.= ' selected="selected"';
if ($selected && $selected == $objp->idprodfournprice) $opt.= ' selected="selected"';
if ($objp->fprice == '') $opt.=' disabled="disabled"';
$opt.= '>';
@ -3709,30 +3709,6 @@ class Form
}
else dol_print_error('','Call of showphoto with wrong parameters');
/* Disabled. lightbox seems to not work. I don't know why.
$ret.="\n<script type=\"text/javascript\">
jQuery(function() {
jQuery('.photologo').lightBox();
});
</script>\n";
$ret.="\n<script type=\"text/javascript\">
jQuery(function() {
jQuery('.photologo').lightBox({
overlayBgColor: '#FFF',
overlayOpacity: 0.6,
imageLoading: '".DOL_URL_ROOT."/includes/jquery/plugins/lightbox/images/lightbox-ico-loading.gif',
imageBtnClose: '".DOL_URL_ROOT."/includes/jquery/plugins/lightbox/images/lightbox-btn-close.gif',
imageBtnPrev: '".DOL_URL_ROOT."/includes/jquery/plugins/lightbox/images/lightbox-btn-prev.gif',
imageBtnNext: '".DOL_URL_ROOT."/includes/jquery/plugins/lightbox/images/lightbox-btn-next.gif',
containerResizeSpeed: 350,
txtImage: 'Imagem',
txtOf: 'de'
});
});
</script>\n";
*/
return $ret;
}

View File

@ -601,12 +601,13 @@ class FormMail
{
if (! isset($this->ckeditortoolbar)) $this->ckeditortoolbar = 'dolibarr_notes';
if(! empty($conf->global->MAIL_USE_SIGN) && $this->fromid > 0)
if (empty($conf->global->MAIL_DO_NOT_USE_SIGN) && $this->fromid > 0)
{
$fuser=new User($this->db);
$fuser->fetch($this->fromid);
if(!empty($fuser->signature)) {
if(! empty($fuser->signature))
{
$defaultmessage.=dol_htmlentitiesbr_decode($fuser->signature);
}
}

View File

@ -222,12 +222,18 @@ function getCountry($id,$withcode='',$dbtouse=0,$outputlangs='',$entconv=1)
{
global $db,$langs;
// Check parameters
if (empty($id))
{
if ($withcode === 'all') return array('id'=>'','code'=>'','label'=>'');
else return '';
}
if (! is_object($dbtouse)) $dbtouse=$db;
if (! is_object($outputlangs)) $outputlangs=$langs;
$sql = "SELECT rowid, code, libelle FROM ".MAIN_DB_PREFIX."c_pays";
if (is_numeric($id)) $sql.= " WHERE rowid=".$id;
else $sql.= " WHERE code='".$id."'";
else $sql.= " WHERE code='".$db->escape($id)."'";
dol_syslog("Company.lib::getCountry sql=".$sql);
$resql=$dbtouse->query($sql);
@ -251,10 +257,11 @@ function getCountry($id,$withcode='',$dbtouse=0,$outputlangs='',$entconv=1)
}
else
{
return "NotDefined";
return 'NotDefined';
}
}
else dol_print_error($dbtouse,'');
return 'Error';
}
/**

View File

@ -524,12 +524,12 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default
* @param Translate $outputlangs Object lang for output
* @param string $paramfreetext Constant name of free text
* @param Societe $fromcompany Object company
* @param int $marge_basse Margin bottom
* @param int $marge_gauche Margin left
* @param int $page_hauteur Page height
* @param int $marge_basse Margin bottom we use for the autobreak
* @param int $marge_gauche Margin left (no more used)
* @param int $page_hauteur Page height (no more used)
* @param Object $object Object shown in PDF
* @param int $showdetails Show company details
* @return void
* @param int $showdetails Show company details into footer. This param seems to not be used by standard version.
* @return int Return height of bottom margin including footer text
*/
function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_basse,$marge_gauche,$page_hauteur,$object,$showdetails=0)
{
@ -538,6 +538,8 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
$outputlangs->load("dict");
$line='';
$dims=$pdf->getPageDimensions();
// Line of free text
if (! empty($conf->global->$paramfreetext))
{
@ -659,11 +661,12 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
$nbofline=dol_nboflines_bis($line,0,$outputlangs->charset_output);
//print 'nbofline='.$nbofline; exit;
//print 'e'.$line.'t'.dol_nboflines($line);exit;
$posy=$marge_basse + ($nbofline*3) + (! empty($line1)?3:0) + (! empty($line2)?3:0) + (! empty($line3)?3:0) + (! empty($line4)?3:0);
$marginwithfooter=$marge_basse + ($nbofline*3) + (! empty($line1)?3:0) + (! empty($line2)?3:0) + (! empty($line3)?3:0) + (! empty($line4)?3:0);
$posy=$marginwithfooter+0;
if ($line) // Free text
{
$pdf->SetXY($marge_gauche,-$posy);
$pdf->SetXY($dims['lm'],-$posy);
$width=20000; $align='L'; // By default, ask a manual break: We use a large value 20000, to not have automatic wrap. This make user understand, he need to add CR on its text.
if ($conf->global->MAIN_USE_AUTOWRAP_ON_FREETEXT) { $width=200; $align='C'; }
$pdf->MultiCell($width, 3, $line, 0, $align, 0);
@ -671,13 +674,13 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
}
$pdf->SetY(-$posy);
$pdf->line($marge_gauche, $page_hauteur-$posy, 200, $page_hauteur-$posy);
$pdf->line($dims['lm'], $dims['hk']-$posy, $dims['wk']-$dims['rm'], $dims['hk']-$posy);
$posy--;
if (! empty($line1))
{
$pdf->SetFont('','B',7);
$pdf->SetXY($marge_gauche,-$posy);
$pdf->SetXY($dims['lm'],-$posy);
$pdf->MultiCell(200, 2, $line1, 0, 'C', 0);
$posy-=3;
$pdf->SetFont('','',7);
@ -686,7 +689,7 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
if (! empty($line2))
{
$pdf->SetFont('','B',7);
$pdf->SetXY($marge_gauche,-$posy);
$pdf->SetXY($dims['lm'],-$posy);
$pdf->MultiCell(200, 2, $line2, 0, 'C', 0);
$posy-=3;
$pdf->SetFont('','',7);
@ -694,14 +697,14 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
if (! empty($line3))
{
$pdf->SetXY($marge_gauche,-$posy);
$pdf->SetXY($dims['lm'],-$posy);
$pdf->MultiCell(200, 2, $line3, 0, 'C', 0);
}
if (! empty($line4))
{
$posy-=3;
$pdf->SetXY($marge_gauche,-$posy);
$pdf->SetXY($dims['lm'],-$posy);
$pdf->MultiCell(200, 2, $line4, 0, 'C', 0);
}
@ -712,6 +715,8 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
$pdf->MultiCell(11, 2, $pdf->PageNo().'/'.$pdf->getAliasNbPages(), 0, 'R', 0);
//print 'xxx'.$pdf->getAliasNbPages().'-'.$pdf->getAliasNumPage();exit;
}
return $marginwithfooter;
}
/**

View File

@ -744,12 +744,6 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
$newmenu->add("/societe/soc.php?action=create", $langs->trans("MenuNewThirdParty"),1);
if (! $conf->use_javascript_ajax) $newmenu->add("/societe/soc.php?action=create&amp;private=1",$langs->trans("MenuNewPrivateIndividual"),1);
}
// TODO Avoid doing dir scan
if(is_dir("societe/groupe"))
{
$newmenu->add("/societe/groupe/index.php", $langs->trans("MenuSocGroup"),1);
}
}
// Prospects
@ -858,8 +852,8 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
$newmenu->add("/commande/liste.php?leftmenu=orders", $langs->trans("List"), 1, $user->rights->commande->lire);
if ($leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=0", $langs->trans("StatusOrderDraftShort"), 2, $user->rights->commande->lire);
if ($leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=1", $langs->trans("StatusOrderValidated"), 2, $user->rights->commande->lire);
if ($leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=2", $langs->trans("StatusOrderOnProcessShort"), 2, $user->rights->commande->lire);
if ($leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=3", $langs->trans("StatusOrderToBill"), 2, $user->rights->commande->lire);
if ($leftmenu=="orders" && $conf->expedition->enabled) $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=2", $langs->trans("StatusOrderOnProcessShort"), 2, $user->rights->commande->lire);
if ($leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=".($conf->expedition->enabled?"3":"-2"), $langs->trans("StatusOrderToBill"), 2, $user->rights->commande->lire);
if ($leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=4", $langs->trans("StatusOrderProcessed"), 2, $user->rights->commande->lire);
if ($leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=-1", $langs->trans("StatusOrderCanceledShort"), 2, $user->rights->commande->lire);
$newmenu->add("/commande/stats/index.php?leftmenu=orders", $langs->trans("Statistics"), 1, $user->rights->commande->lire);

View File

@ -1286,6 +1286,20 @@ abstract class DolibarrModules
/**
* Insert activation of generic parts from modules in llx_const
* Input entry use $this->module_parts = array(
* 'triggers' => 0, // Set this to 1 if module has its own trigger directory (core/triggers)
* 'login' => 0, // Set this to 1 if module has its own login method directory (core/login)
* 'substitutions' => 0, // Set this to 1 if module has its own substitution function file (core/substitutions)
* 'menus' => 0, // Set this to 1 if module has its own menus handler directory (core/menus)
* 'theme' => 0, // Set this to 1 if module has its own theme directory (core/theme)
* 'tpl' => 0, // Set this to 1 if module overwrite template dir (core/tpl)
* 'barcode' => 0, // Set this to 1 if module has its own barcode directory (core/modules/barcode)
* 'models' => 0, // Set this to 1 if module has its own models directory (core/modules/xxx)
* 'css' => '/mymodule/css/mymodule.css.php', // Set this to relative path of css file if module has its own css file
* 'js' => '/mymodule/js/mymodule.js', // Set this to relative path of js file if module must load a js on all pages
* 'hooks' => array('hookcontext1','hookcontext2') // Set here all hooks context managed by module
* 'workflow' => array('WORKFLOW_MODULE1_YOURACTIONTYPE_MODULE2'=>array('enabled'=>'! empty($conf->module1->enabled) && ! empty($conf->module2->enabled)', 'picto'=>'yourpicto@mymodule') // Set here all workflow context managed by module
* )
*
* @return int Nb of errors (0 if OK)
*/

View File

@ -112,6 +112,9 @@ class CommActionRapport
if (file_exists($dir))
{
$pdf=pdf_getInstance($this->format);
$heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin)
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
$pdf->SetAutoPageBreak(1,0);
if (class_exists('TCPDF'))
{
@ -132,7 +135,6 @@ class CommActionRapport
$pdf->SetKeywords($outputlangs->convToOutputCharset($this->title." ".$this->subject));
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
$pdf->SetAutoPageBreak(1,0);
$nbpage = $this->_pages($pdf, $outputlangs);

View File

@ -117,6 +117,9 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
// Create PDF instance
$pdf=pdf_getInstance($this->format);
$heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin)
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
$pdf->SetAutoPageBreak(1,0);
if (class_exists('TCPDF'))
{
@ -137,7 +140,6 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
$pdf->SetAutoPageBreak(1,0);
$nboflines=count($this->lines);
// Define nb of page

View File

@ -141,6 +141,9 @@ class pdf_edison extends ModelePDFCommandes
$nblignes = count($object->lines);
$pdf=pdf_getInstance($this->format);
$heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin)
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
$pdf->SetAutoPageBreak(1,0);
if (class_exists('TCPDF'))
{
@ -167,7 +170,6 @@ class pdf_edison extends ModelePDFCommandes
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
$pdf->SetAutoPageBreak(1,0);
// New page
$pdf->AddPage();
@ -200,9 +202,16 @@ class pdf_edison extends ModelePDFCommandes
$pdf->SetFont('','', $default_font_size - 1); // Dans boucle pour gerer multi-page
$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
$pageposbefore=$pdf->getPage();
// Description of product line
pdf_writelinedesc($pdf,$object,$i,$outputlangs,100,3,30,$curY,1,$hidedesc,0,$hookmanager);
$pageposafter=$pdf->getPage();
$pdf->setPage($pageposbefore);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
$nexY = $pdf->GetY();
@ -228,39 +237,51 @@ class pdf_edison extends ModelePDFCommandes
$nexY+=2; // Passe espace entre les lignes
// cherche nombre de lignes a venir pour savoir si place suffisante
if ($i < ($nblignes - 1) && empty($hidedesc)) // If it's not last line
// Detect if some page were added automatically and output _tableau for past pages
while ($pagenb < $pageposafter)
{
//on recupere la description du produit suivant
$follow_descproduitservice = $object->lines[$i+1]->desc;
//on compte le nombre de ligne afin de verifier la place disponible (largeur de ligne 52 caracteres)
$nblineFollowDesc = (dol_nboflines_bis($follow_descproduitservice,52,$outputlangs->charset_output)*4);
if ($pagenb == 1)
{
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
}
else
{
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
}
$this->_pagefoot($pdf,$object,$outputlangs);
$pagenb++;
$pdf->setPage($pagenb);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
}
else // If it's last line
if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak)
{
$nblineFollowDesc = 0;
}
if ((($nexY+$nblineFollowDesc) > ($tab_top+$tab_height) && $i < ($nblignes - 1)) || (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak))
{
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs);
if ($pagenb == 1)
{
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
}
else
{
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
}
$this->_pagefoot($pdf,$object,$outputlangs);
// New page
$pdf->AddPage();
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
$pagenb++;
$this->_pagehead($pdf, $object, 0, $outputlangs, $hookmanager);
$pdf->SetFont('','', $default_font_size - 1);
$pdf->MultiCell(0, 3, ''); // Set interline to 3
$pdf->SetTextColor(0,0,0);
$nexY = $tab_top + 8;
}
}
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs);
$bottomlasttab=$tab_top + $tab_height + 1;
// Show square
if ($pagenb == 1)
{
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot, 0, $outputlangs, 0, 0);
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
}
else
{
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot, 0, $outputlangs, 1, 0);
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
}
// Affiche zone infos
$this->_tableau_info($pdf, $object, $bottomlasttab, $outputlangs);
@ -467,9 +488,11 @@ class pdf_edison extends ModelePDFCommandes
* @param string $tab_height Height of table (rectangle)
* @param int $nexY Y
* @param Translate $outputlangs Langs object
* @param int $hidetop Hide top bar of array
* @param int $hidebottom Hide bottom bar of array
* @return void
*/
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs)
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0)
{
global $langs,$conf;
$langs->load("main");

View File

@ -177,6 +177,9 @@ class pdf_einstein extends ModelePDFCommandes
$nblignes = count($object->lines);
$pdf=pdf_getInstance($this->format);
$heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin)
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
$pdf->SetAutoPageBreak(1,0);
if (class_exists('TCPDF'))
{
@ -203,7 +206,6 @@ class pdf_einstein extends ModelePDFCommandes
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);
$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++)
@ -262,10 +264,17 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
$pageposbefore=$pdf->getPage();
// Description of product line
$curX = $this->posxdesc-1;
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,3,$curX,$curY,$hideref,$hidedesc,0,$hookmanager);
$pageposafter=$pdf->getPage();
$pdf->setPage($pageposbefore);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
$nexY = $pdf->GetY();
@ -321,71 +330,50 @@ class pdf_einstein extends ModelePDFCommandes
$nexY+=2; // Passe espace entre les lignes
// Cherche nombre de lignes a venir pour savoir si place suffisante
if ($i < ($nblignes - 1) && empty($hidedesc)) // If it's not last line
{
//on recupere la description du produit suivant
$follow_descproduitservice = $object->lines[$i+1]->desc;
//on compte le nombre de ligne afin de verifier la place disponible (largeur de ligne 52 caracteres)
$nblineFollowDesc = (dol_nboflines_bis($follow_descproduitservice,52,$outputlangs->charset_output)*4);
// Et si on affiche dates de validite, on ajoute encore une ligne
if ($object->lines[$i]->date_start && $object->lines[$i]->date_end)
{
$nblineFollowDesc += 4;
}
}
else // If it's last line
{
$nblineFollowDesc = 0;
}
// Test if a new page is required
if ($pagenb == 1)
{
$tab_top_in_current_page=$tab_top;
$tab_height_in_current_page=$tab_height;
}
else
{
$tab_top_in_current_page=$tab_top_newpage;
$tab_height_in_current_page=$tab_height_newpage;
}
if ((($nexY+$nblineFollowDesc) > ($tab_top_in_current_page+$tab_height_in_current_page) && $i < ($nblignes - 1)) || (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak))
// Detect if some page were added automatically and output _tableau for past pages
while ($pagenb < $pageposafter)
{
if ($pagenb == 1)
{
$this->_tableau($pdf, $tab_top, $tab_height + 20, $nexY, $outputlangs);
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
}
else
{
$this->_tableau($pdf, $tab_top_newpage, $tab_height_newpage, $nexY, $outputlangs);
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
}
$this->_pagefoot($pdf,$object,$outputlangs);
$pagenb++;
$pdf->setPage($pagenb);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
}
if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak)
{
if ($pagenb == 1)
{
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
}
else
{
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
}
$this->_pagefoot($pdf,$object,$outputlangs);
// New page
$pdf->AddPage();
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
$pagenb++;
$this->_pagehead($pdf, $object, 0, $outputlangs, $hookmanager);
$pdf->SetFont('','', $default_font_size - 1);
$pdf->MultiCell(0, 3, ''); // Set interline to 3
$pdf->SetTextColor(0,0,0);
$nexY = $tab_top_newpage + 7;
}
}
// Show square
if ($pagenb == 1)
{
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs);
$bottomlasttab=$tab_top + $tab_height + 1;
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot, 0, $outputlangs, 0, 0);
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
}
else
{
$this->_tableau($pdf, $tab_top_newpage, $tab_height_newpage, $nexY, $outputlangs);
$bottomlasttab=$tab_top_newpage + $tab_height_newpage + 1;
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot, 0, $outputlangs, 1, 0);
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
}
// Affiche zone infos
@ -797,9 +785,11 @@ class pdf_einstein extends ModelePDFCommandes
* @param string $tab_height Height of table (rectangle)
* @param int $nexY Y
* @param Translate $outputlangs Langs object
* @param int $hidetop Hide top bar of array
* @param int $hidebottom Hide bottom bar of array
* @return void
*/
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs)
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0)
{
global $conf;

View File

@ -147,6 +147,9 @@ class pdf_expedition_merou extends ModelePdfExpedition
if (file_exists($dir))
{
$pdf=pdf_getInstance($this->format,'mm','l');
$heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin)
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
$pdf->SetAutoPageBreak(1,0);
if (class_exists('TCPDF'))
{
@ -174,7 +177,6 @@ class pdf_expedition_merou extends ModelePdfExpedition
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
$pdf->SetAutoPageBreak(1,0);
$pdf->SetFont('','', $default_font_size - 3);
@ -284,9 +286,11 @@ class pdf_expedition_merou extends ModelePdfExpedition
* @param string $tab_height Height of table (rectangle)
* @param int $nexY Y
* @param Translate $outputlangs Langs object
* @param int $hidetop Hide top bar of array
* @param int $hidebottom Hide bottom bar of array
* @return void
*/
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs)
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0)
{
global $langs;
$default_font_size = pdf_getPDFFontSize($outputlangs);

View File

@ -126,6 +126,9 @@ class pdf_expedition_rouget extends ModelePdfExpedition
if (file_exists($dir))
{
$pdf=pdf_getInstance($this->format);
$heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin)
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
$pdf->SetAutoPageBreak(1,0);
if (class_exists('TCPDF'))
{
@ -154,7 +157,6 @@ class pdf_expedition_rouget extends ModelePdfExpedition
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
$pdf->SetAutoPageBreak(1,0);
// New page
$pdf->AddPage();
@ -223,9 +225,16 @@ class pdf_expedition_rouget extends ModelePdfExpedition
$pdf->SetFont('','', $default_font_size - 1); // Dans boucle pour gerer multi-page
$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
$pageposbefore=$pdf->getPage();
// Description de la ligne produit
pdf_writelinedesc($pdf,$object,$i,$outputlangs,150,3,$this->posxdesc,$curY,0,1);
$pageposafter=$pdf->getPage();
$pdf->setPage($pageposbefore);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
$nexY = $pdf->GetY();
@ -274,9 +283,11 @@ class pdf_expedition_rouget extends ModelePdfExpedition
* @param string $tab_height Height of table (rectangle)
* @param int $nexY Y
* @param Translate $outputlangs Langs object
* @param int $hidetop Hide top bar of array
* @param int $hidebottom Hide bottom bar of array
* @return void
*/
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs)
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0)
{
global $conf;
@ -385,7 +396,7 @@ class pdf_expedition_rouget extends ModelePdfExpedition
}
$posx=100;
$posx=$this->page_largeur - 100 - $this->marge_droite;
$posy=$this->marge_haute;
$pdf->SetFont('','B', $default_font_size + 2);
@ -467,7 +478,7 @@ class pdf_expedition_rouget extends ModelePdfExpedition
$posx=$this->marge_gauche;
$posy=42;
$hautcadre=40;
if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=118;
if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->page_largeur - 80 - $this->marge_droite;
// Show sender frame
$pdf->SetTextColor(0,0,0);
@ -516,7 +527,7 @@ class pdf_expedition_rouget extends ModelePdfExpedition
// Show recipient
$posy=42;
$posx=100;
$posx=$this->page_largeur - 100 - $this->marge_droite;
if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->marge_gauche;
// Show recipient frame

View File

@ -178,6 +178,9 @@ class pdf_crabe extends ModelePDFFactures
$nblignes = count($object->lines);
$pdf=pdf_getInstance($this->format);
$heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin)
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
$pdf->SetAutoPageBreak(1,0);
if (class_exists('TCPDF'))
{
@ -204,7 +207,6 @@ class pdf_crabe extends ModelePDFFactures
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);
$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++)
@ -225,7 +227,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetTextColor(0,0,0);
$tab_top = 90;
$tab_top_newpage = 50;
$tab_top_newpage = 10;
$tab_height = 130;
$tab_height_newpage = 150;
@ -262,8 +264,9 @@ class pdf_crabe extends ModelePDFFactures
{
$curY = $nexY;
$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
$pageposbefore=$pdf->getPage();
// Description of product line
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
$curX = $this->posxdesc-1;
@ -271,7 +274,8 @@ class pdf_crabe extends ModelePDFFactures
$pageposafter=$pdf->getPage();
$pdf->setPage($pageposbefore);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
$nexY = $pdf->GetY();
@ -332,84 +336,47 @@ class pdf_crabe extends ModelePDFFactures
// Detect if some page were added automatically and output _tableau for past pages
while ($pagenb < $pageposafter)
{
if ($pagenb == 1)
if ($pagenb == 1)
{
$this->_tableau($pdf, $tab_top, $tab_height + 40, 0, $outputlangs);
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
}
else
{
$this->_tableau($pdf, $tab_top_newpage, $tab_height_newpage, 0, $outputlangs);
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
}
$this->_pagefoot($pdf,$object,$outputlangs);
$pagenb++;
$pdf->setPage($pagenb);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
}
// Cherche nombre de lignes a venir pour savoir si place suffisante
if ($i < ($nblignes - 1) && empty($hidedesc)) // If it's not last line
if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak)
{
//on recupere la description du produit suivant
$follow_descproduitservice = $object->lines[$i+1]->desc;
//on compte le nombre de ligne afin de verifier la place disponible (largeur de ligne 52 caracteres)
$nblineFollowDesc = dol_nboflines_bis($follow_descproduitservice,52,$outputlangs->charset_output)*4;
// Et si on affiche dates de validite, on ajoute encore une ligne
if ($object->lines[$i]->date_start && $object->lines[$i]->date_end)
{
$nblineFollowDesc += 4;
if ($pagenb == 1)
{
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
}
else
{
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
}
$this->_pagefoot($pdf,$object,$outputlangs);
// New page
$pdf->AddPage();
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
$pagenb++;
}
else // If it's last line
{
$nblineFollowDesc = 0;
}
// Test if a new page is required
if ($pagenb == 1)
{
$tab_top_in_current_page=$tab_top;
$tab_height_in_current_page=$tab_height;
}
else
{
$tab_top_in_current_page=$tab_top_newpage;
$tab_height_in_current_page=$tab_height_newpage;
}
if ((($nexY+$nblineFollowDesc) > ($tab_top_in_current_page+$tab_height_in_current_page) && $i < ($nblignes - 1)) || (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak))
{
if ($pagenb == 1)
{
$this->_tableau($pdf, $tab_top, $tab_height + 40, $nexY, $outputlangs);
}
else
{
$this->_tableau($pdf, $tab_top_newpage, $tab_height_newpage, $nexY, $outputlangs);
}
$this->_pagefoot($pdf,$object,$outputlangs);
// New page
$pdf->AddPage();
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
$pagenb++;
$this->_pagehead($pdf, $object, 0, $outputlangs, $hookmanager);
$pdf->SetFont('','', $default_font_size - 1);
$pdf->MultiCell(0, 3, ''); // Set interline to 3
$pdf->SetTextColor(0,0,0);
$nexY = $tab_top_newpage + 7;
}
}
// Show square
if ($pagenb == 1)
{
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs);
$bottomlasttab=$tab_top + $tab_height + 1;
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot, 0, $outputlangs, 0, 0);
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
}
else
{
$this->_tableau($pdf, $tab_top_newpage, $tab_height_newpage, $nexY, $outputlangs);
$bottomlasttab=$tab_top_newpage + $tab_height_newpage + 1;
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot, 0, $outputlangs, 1, 0);
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
}
// Affiche zone infos
@ -960,11 +927,13 @@ class pdf_crabe extends ModelePDFFactures
* @param PDF &$pdf Object PDF
* @param string $tab_top Top position of table
* @param string $tab_height Height of table (rectangle)
* @param int $nexY Y
* @param int $nexY Y (not used)
* @param Translate $outputlangs Langs object
* @param int $hidetop Hide top bar of array
* @param int $hidebottom Hide bottom bar of array
* @return void
*/
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs)
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0)
{
global $conf;
@ -973,51 +942,70 @@ class pdf_crabe extends ModelePDFFactures
// Amount in (at tab_top - 1)
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('','', $default_font_size - 2);
$titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->currency));
$pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top-4);
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
if (empty($hidetop))
{
$titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->currency));
$pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top-4);
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
}
$pdf->SetDrawColor(128,128,128);
$pdf->SetFont('','', $default_font_size - 1);
// Rect prend une longueur en 3eme param et 4eme param
$pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height);
// line prend une position y en 2eme param et 4eme param
$pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5);
// Output Rect
$this->printRect($pdf,$this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param
$pdf->SetFont('','', $default_font_size - 1);
if (empty($hidetop))
{
$pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line prend une position y en 2eme param et 4eme param
$pdf->SetXY($this->posxdesc-1, $tab_top+1);
$pdf->MultiCell(108,2, $outputlangs->transnoentities("Designation"),'','L');
$pdf->SetXY($this->posxdesc-1, $tab_top+1);
$pdf->MultiCell(108,2, $outputlangs->transnoentities("Designation"),'','L');
}
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
{
$pdf->line($this->posxtva-1, $tab_top, $this->posxtva-1, $tab_top + $tab_height);
$pdf->SetXY($this->posxtva-3, $tab_top+1);
$pdf->MultiCell($this->posxup-$this->posxtva+3,2, $outputlangs->transnoentities("VAT"),'','C');
if (empty($hidetop))
{
$pdf->SetXY($this->posxtva-3, $tab_top+1);
$pdf->MultiCell($this->posxup-$this->posxtva+3,2, $outputlangs->transnoentities("VAT"),'','C');
}
}
$pdf->line($this->posxup-1, $tab_top, $this->posxup-1, $tab_top + $tab_height);
$pdf->SetXY($this->posxup-1, $tab_top+1);
$pdf->MultiCell($this->posxqty-$this->posxup-1,2, $outputlangs->transnoentities("PriceUHT"),'','C');
$pdf->line($this->posxqty-1, $tab_top, $this->posxqty-1, $tab_top + $tab_height);
$pdf->SetXY($this->posxqty-1, $tab_top+1);
$pdf->MultiCell($this->posxdiscount-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C');
$pdf->line($this->posxdiscount-1, $tab_top, $this->posxdiscount-1, $tab_top + $tab_height);
if ($this->atleastonediscount)
if (empty($hidetop))
{
$pdf->SetXY($this->posxdiscount-1, $tab_top+1);
$pdf->MultiCell($this->postotalht-$this->posxdiscount+1,2, $outputlangs->transnoentities("ReductionShort"),'','C');
$pdf->SetXY($this->posxup-1, $tab_top+1);
$pdf->MultiCell($this->posxqty-$this->posxup-1,2, $outputlangs->transnoentities("PriceUHT"),'','C');
}
$pdf->line($this->posxqty-1, $tab_top, $this->posxqty-1, $tab_top + $tab_height);
if (empty($hidetop))
{
$pdf->SetXY($this->posxqty-1, $tab_top+1);
$pdf->MultiCell($this->posxdiscount-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C');
}
$pdf->line($this->posxdiscount-1, $tab_top, $this->posxdiscount-1, $tab_top + $tab_height);
if (empty($hidetop))
{
if ($this->atleastonediscount)
{
$pdf->SetXY($this->posxdiscount-1, $tab_top+1);
$pdf->MultiCell($this->postotalht-$this->posxdiscount+1,2, $outputlangs->transnoentities("ReductionShort"),'','C');
}
}
if ($this->atleastonediscount)
{
$pdf->line($this->postotalht, $tab_top, $this->postotalht, $tab_top + $tab_height);
}
$pdf->SetXY($this->postotalht-1, $tab_top+1);
$pdf->MultiCell(30,2, $outputlangs->transnoentities("TotalHT"),'','C');
if (empty($hidetop))
{
$pdf->SetXY($this->postotalht-1, $tab_top+1);
$pdf->MultiCell(30,2, $outputlangs->transnoentities("TotalHT"),'','C');
}
}
/**
@ -1244,7 +1232,7 @@ class pdf_crabe extends ModelePDFFactures
* @param PDF &$pdf PDF
* @param Object $object Object to show
* @param Translate $outputlangs Object lang for output
* @return void
* @return int Return height of bottom margin including footer text
*/
function _pagefoot(&$pdf,$object,$outputlangs)
{

View File

@ -166,6 +166,9 @@ class pdf_oursin extends ModelePDFFactures
if (file_exists($dir))
{
$pdf=pdf_getInstance($this->format);
$heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin)
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
$pdf->SetAutoPageBreak(1,0);
if (class_exists('TCPDF'))
{
@ -191,8 +194,16 @@ class pdf_oursin extends ModelePDFFactures
$pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Invoice"));
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);
$pdf->SetMargins(10, 10, 10);
$pdf->SetAutoPageBreak(1,0);
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
// Positionne $this->atleastonediscount si on a au moins une remise
for ($i = 0 ; $i < $nblignes ; $i++)
{
if ($object->lines[$i]->remise_percent)
{
$this->atleastonediscount++;
}
}
// New page
$pdf->AddPage();
@ -204,7 +215,9 @@ class pdf_oursin extends ModelePDFFactures
$pdf->SetTextColor(0,0,0);
$tab_top = $this->marges['h']+90;
$tab_top_newpage = $this->marges['h'];
$tab_height = 110;
$tab_height_newpage = 150;
$pdf->SetFillColor(220,220,220);
$pdf->SetFont('','', $default_font_size - 1);
@ -220,20 +233,24 @@ class pdf_oursin extends ModelePDFFactures
{
$curY = $nexY;
$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
$pageposbefore=$pdf->getPage();
// Description of product line
pdf_writelinedesc($pdf,$object,$i,$outputlangs,108,3,$this->posxdesc-1,$curY+1,$hideref,$hidedesc,0,$hookmanager);
$pageposafter=$pdf->getPage();
$pdf->setPage($pageposbefore);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
$nexY = $pdf->GetY();
// TVA
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
{
if ($this->franchise!=1)
{
$vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails, $hookmanager);
$pdf->SetXY($this->marges['g']+118, $curY);
$pdf->MultiCell(12, 3, $vat_rate, 0, 'R');
}
$vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails, $hookmanager);
$pdf->SetXY($this->marges['g']+118, $curY);
$pdf->MultiCell(12, 3, $vat_rate, 0, 'R');
}
// Prix unitaire HT avant remise
@ -258,25 +275,64 @@ class pdf_oursin extends ModelePDFFactures
$pdf->SetXY($this->marges['g']+168, $curY);
$pdf->MultiCell(21, 3, $total_excl_tax, 0, 'R', 0);
if (($nexY > 200 && $i < $nblignes - 1) || (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak))
{
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $object, $outputlangs);
$nexY = $iniY;
// New page
$pdf->AddPage();
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
$pagenb++;
$this->_pagehead($pdf, $object, 0, $outputlangs, $hookmanager);
$pdf->SetFont('','', $default_font_size - 1);
$pdf->MultiCell(0, 3, ''); // Set interline to 3
$pdf->SetTextColor(0,0,0);
// Detect if some page were added automatically and output _tableau for past pages
while ($pagenb < $pageposafter)
{
if ($pagenb == 1)
{
$this->_tableau($pdf, $tab_top, $tab_height + 40, 0, $outputlangs, 0, 1);
}
else
{
$this->_tableau($pdf, $tab_top_newpage, $tab_height_newpage, 0, $outputlangs, 1, 1);
}
$this->_pagefoot($pdf,$object,$outputlangs);
$pagenb++;
$pdf->setPage($pagenb);
}
/*if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak)
{
if ($pagenb == 1)
{
$this->_tableau($pdf, $tab_top, $tab_height + 40, 0, $outputlangs, 0, 1);
}
else
{
$this->_tableau($pdf, $tab_top_newpage, $tab_height_newpage, 0, $outputlangs, 1, 1);
}
$this->_pagefoot($pdf,$object,$outputlangs);
// New page
$pdf->AddPage();
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
$pagenb++;
}*/
if (($nexY > 200 && $i < $nblignes - 1) || (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak))
{
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $object, $outputlangs);
$nexY = $iniY;
// New page
$pdf->AddPage();
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
$pagenb++;
$this->_pagehead($pdf, $object, 0, $outputlangs, $hookmanager);
$pdf->SetFont('','', $default_font_size - 1);
$pdf->MultiCell(0, 3, ''); // Set interline to 3
$pdf->SetTextColor(0,0,0);
}
}
// Show square
if ($pagenb == 1)
{
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs);
$bottomlasttab=$tab_top + $tab_height + 1;
}
else
{
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs, 1, 0);
$bottomlasttab=$tab_top + $tab_height + 1;
}
$posy=$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $object, $outputlangs);
$bottomlasttab=$tab_top + $tab_height + 1;
// Affiche zone infos
$posy=$this->_tableau_info($pdf, $object, $bottomlasttab, $outputlangs);
@ -744,11 +800,12 @@ class pdf_oursin extends ModelePDFFactures
* @param string $tab_top Top position of table
* @param string $tab_height Height of table (rectangle)
* @param int $nexY Y
* @param Object $object Object
* @param Translate $outputlangs Langs object
* @param int $hidetop Hide top bar of array
* @param int $hidebottom Hide bottom bar of array
* @return void
*/
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $object, $outputlangs)
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0)
{
global $conf,$langs;
$langs->load("main");
@ -775,16 +832,7 @@ class pdf_oursin extends ModelePDFFactures
$pdf->SetXY($this->marges['g']+153,$tab_top + 1);
$pdf->MultiCell(0, 4, $outputlangs->transnoentities("Qty"), 0, 'L');
$nblignes = count($object->lines);
$rem=0;
for ($i = 0 ; $i < $nblignes ; $i++)
{
if ($object->lines[$i]->remise_percent)
{
$rem=1;
}
}
if ($rem==1)
if ($this->atleastonediscount)
{
$pdf->SetXY($this->marges['g']+165,$tab_top + 1);
$pdf->MultiCell(0, 4, $outputlangs->transnoentities("%"), 0, 'L');
@ -1018,7 +1066,7 @@ class pdf_oursin extends ModelePDFFactures
* @param PDF &$pdf PDF
* @param Object $object Object to show
* @param Translate $outputlangs Object lang for output
* @return void
* @return int Return height of bottom margin including footer text
*/
function _pagefoot(&$pdf, $object, $outputlangs)
{

View File

@ -134,6 +134,9 @@ class pdf_soleil extends ModelePDFFicheinter
if (file_exists($dir))
{
$pdf=pdf_getInstance($this->format);
$heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin)
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
$pdf->SetAutoPageBreak(1,0);
if (class_exists('TCPDF'))
{
@ -160,7 +163,6 @@ class pdf_soleil extends ModelePDFFicheinter
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
$pdf->SetAutoPageBreak(1,0);
// New page
$pdf->AddPage();
@ -268,67 +270,51 @@ class pdf_soleil extends ModelePDFFicheinter
$nexY+=2; // Passe espace entre les lignes
// Cherche nombre de lignes a venir pour savoir si place suffisante
if ($i < ($nblines - 1) && empty($hidedesc)) // If it's not last line
{
//on recupere la description du produit suivant
$follow_descproduitservice = $objectligne->desc;
//on compte le nombre de ligne afin de verifier la place disponible (largeur de ligne 52 caracteres)
$nblineFollowDesc = (dol_nboflines_bis($follow_descproduitservice,52,$outputlangs->charset_output)*3);
}
else // If it's last line
{
$nblineFollowDesc = 0;
}
// Test if a new page is required
if ($pagenb == 1)
{
$tab_top_in_current_page=$tab_top;
$tab_height_in_current_page=$tab_height;
}
else
{
$tab_top_in_current_page=$tab_top_newpage;
$tab_height_in_current_page=$tab_height_middlepage;
}
if (($nexY+$nblineFollowDesc) > ($tab_top_in_current_page+$tab_height_in_current_page) && $i < ($nblines - 1))
{
if ($pagenb == 1)
{
$this->_tableau($pdf, $tab_top, $tab_height + 20, $nexY, $outputlangs);
}
else
{
$this->_tableau($pdf, $tab_top_newpage, $tab_height_middlepage, $nexY, $outputlangs);
}
$this->_pagefoot($pdf,$object,$outputlangs);
// New page
$pdf->AddPage();
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
$pagenb++;
$this->_pagehead($pdf, $object, 0, $outputlangs);
$pdf->SetFont('','', $default_font_size - 1);
$pdf->MultiCell(0, 3, ''); // Set interline to 3
$pdf->SetTextColor(0,0,0);
$nexY = $tab_top_newpage + 7;
}
// Detect if some page were added automatically and output _tableau for past pages
while ($pagenb < $pageposafter)
{
if ($pagenb == 1)
{
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
}
else
{
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
}
$this->_pagefoot($pdf,$object,$outputlangs);
$pagenb++;
$pdf->setPage($pagenb);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
}
if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak)
{
if ($pagenb == 1)
{
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
}
else
{
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
}
$this->_pagefoot($pdf,$object,$outputlangs);
// New page
$pdf->AddPage();
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
$pagenb++;
}
}
}
// Show square
if ($pagenb == 1)
{
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs);
$bottomlasttab=$tab_top + $tab_height + 1;
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot, 0, $outputlangs, 0, 0);
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
}
else
{
$this->_tableau($pdf, $tab_top_newpage, $tab_height_newpage, $nexY, $outputlangs);
$bottomlasttab=$tab_top_newpage + $tab_height_newpage + 1;
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot, 0, $outputlangs, 1, 0);
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
}
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
@ -367,9 +353,11 @@ class pdf_soleil extends ModelePDFFicheinter
* @param string $tab_height Height of table (rectangle)
* @param int $nexY Y
* @param Translate $outputlangs Langs object
* @param int $hidetop Hide top bar of array
* @param int $hidebottom Hide bottom bar of array
* @return void
*/
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs)
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0)
{
global $conf;
$default_font_size = pdf_getPDFFontSize($outputlangs);
@ -406,13 +394,13 @@ class pdf_soleil extends ModelePDFFicheinter
$pdf->MultiCell(66,5, $outputlangs->transnoentities("NameAndSignatureOfInternalContact"),0,'L',0);
$pdf->SetXY(20,235);
$pdf->MultiCell(80,30, '', 1);
$pdf->MultiCell(80,25, '', 1);
$pdf->SetXY(110,230);
$pdf->MultiCell(80,5, $outputlangs->transnoentities("NameAndSignatureOfExternalContact"),0,'L',0);
$pdf->SetXY(110,235);
$pdf->MultiCell(80,30, '', 1);
$pdf->MultiCell(80,25, '', 1);
}
/**

View File

@ -120,6 +120,9 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
if (file_exists($dir))
{
$pdf=pdf_getInstance($this->format);
$heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin)
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
$pdf->SetAutoPageBreak(1,0);
if (class_exists('TCPDF'))
{
@ -158,7 +161,6 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
$pdf->SetAutoPageBreak(1,0);
// New page
$pdf->AddPage();
@ -184,10 +186,15 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
$pdf->SetFont('','', $default_font_size - 1); // Dans boucle pour gerer multi-page
// Description de la ligne produit
//$libelleproduitservice=pdf_getlinedesc($object,$i,$outputlangs);
$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
$pageposbefore=$pdf->getPage();
// Description de la ligne produit
pdf_writelinedesc($pdf,$object,$i,$outputlangs,100,3,30,$curY,1);
//$pdf->writeHTMLCell(100, 3, 30, $curY, $outputlangs->convToOutputCharset($libelleproduitservice), 0, 1);
$pageposafter=$pdf->getPage();
$pdf->setPage($pageposbefore);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
$pdf->SetFont('','', $default_font_size - 1); // Dans boucle pour gerer multi-page
$nexY = $pdf->GetY();
@ -217,66 +224,50 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
$nexY+=2; // Passe espace entre les lignes
// Cherche nombre de lignes a venir pour savoir si place suffisante
if ($i < ($nblines - 1) && empty($hidedesc)) // If it's not last line
{
//on recupere la description du produit suivant
$follow_descproduitservice = $object->lines[$i+1]->desc;
//on compte le nombre de ligne afin de verifier la place disponible (largeur de ligne 52 caracteres)
$nblineFollowDesc = (dol_nboflines_bis($follow_descproduitservice,52,$outputlangs->charset_output)*4);
}
else // If it's last line
{
$nblineFollowDesc = 0;
}
// Test if a new page is required
if ($pagenb == 1)
{
$tab_top_in_current_page=$tab_top;
$tab_height_in_current_page=$tab_height;
}
else
{
$tab_top_in_current_page=$tab_top_newpage;
$tab_height_in_current_page=$tab_height_newpage;
}
if (($nexY+$nblineFollowDesc) > ($tab_top_in_current_page+$tab_height_in_current_page) && $i < ($nblines - 1))
// Detect if some page were added automatically and output _tableau for past pages
while ($pagenb < $pageposafter)
{
if ($pagenb == 1)
{
$this->_tableau($pdf, $tab_top, $tab_height + 20, $nexY, $outputlangs);
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
}
else
{
$this->_tableau($pdf, $tab_top_newpage, $tab_height_newpage, $nexY, $outputlangs);
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
}
$this->_pagefoot($pdf, $object, $outputlangs);
$this->_pagefoot($pdf,$object,$outputlangs);
$pagenb++;
$pdf->setPage($pagenb);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
}
if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak)
{
if ($pagenb == 1)
{
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
}
else
{
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
}
$this->_pagefoot($pdf,$object,$outputlangs);
// New page
$pdf->AddPage();
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
$pagenb++;
$this->_pagehead($pdf, $object, 0, $outputlangs);
$pdf->SetFont('','', $default_font_size - 1);
$pdf->MultiCell(0, 3, ''); // Set interline to 3
$pdf->SetTextColor(0,0,0);
$nexY = $tab_top_newpage + 7;
}
}
// Show square
if ($pagenb == 1)
{
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs);
$bottomlasttab=$tab_top + $tab_height + 1;
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot, 0, $outputlangs, 0, 0);
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
}
else
{
$this->_tableau($pdf, $tab_top_newpage, $tab_height_newpage, $nexY, $outputlangs);
$bottomlasttab=$tab_top_newpage + $tab_height_newpage + 1;
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot, 0, $outputlangs, 1, 0);
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
}
/*
@ -309,9 +300,11 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
* @param string $tab_height Height of table (rectangle)
* @param int $nexY Y
* @param Translate $outputlangs Langs object
* @param int $hidetop Hide top bar of array
* @param int $hidebottom Hide bottom bar of array
* @return void
*/
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs)
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0)
{
$default_font_size = pdf_getPDFFontSize($outputlangs);
$pdf->SetFont('','', $default_font_size - 1);

View File

@ -142,6 +142,9 @@ class pdf_typhon extends ModelePDFDeliveryOrder
if (file_exists($dir))
{
$pdf=pdf_getInstance($this->format);
$heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin)
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
$pdf->SetAutoPageBreak(1,0);
if (class_exists('TCPDF'))
{
@ -180,7 +183,6 @@ class pdf_typhon extends ModelePDFDeliveryOrder
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);
$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
@ -240,10 +242,15 @@ class pdf_typhon extends ModelePDFDeliveryOrder
$pdf->SetFont('','', $default_font_size - 1); // Dans boucle pour gerer multi-page
// Description de la ligne produit
//$libelleproduitservice=pdf_getlinedesc($object,$i,$outputlangs);
$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
$pageposbefore=$pdf->getPage();
// Description de la ligne produit
pdf_writelinedesc($pdf,$object,$i,$outputlangs,108,3,$this->posxdesc-1,$curY);
//$pdf->writeHTMLCell(108, 3, $this->posxdesc-1, $curY, $outputlangs->convToOutputCharset($libelleproduitservice), 0, 1);
$pageposafter=$pdf->getPage();
$pdf->setPage($pageposbefore);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
$nexY = $pdf->GetY();
@ -281,68 +288,52 @@ class pdf_typhon extends ModelePDFDeliveryOrder
*/
$nexY+=2; // Passe espace entre les lignes
// Cherche nombre de lignes a venir pour savoir si place suffisante
if ($i < ($nblines - 1) && empty($hidedesc)) // If it's not last line
{
//on recupere la description du produit suivant
$follow_descproduitservice = $object->lines[$i+1]->desc;
//on compte le nombre de ligne afin de verifier la place disponible (largeur de ligne 52 caracteres)
$nblineFollowDesc = (dol_nboflines_bis($follow_descproduitservice,52,$outputlangs->charset_output)*4);
}
else // If it's last line
{
$nblineFollowDesc = 0;
}
// Test if a new page is required
if ($pagenb == 1)
{
$tab_top_in_current_page=$tab_top;
$tab_height_in_current_page=$tab_height;
}
else
{
$tab_top_in_current_page=$tab_top_newpage;
$tab_height_in_current_page=$tab_height_newpage;
}
if (($nexY+$nblineFollowDesc) > ($tab_top_in_current_page+$tab_height_in_current_page) && $i < ($nblines - 1))
{
if ($pagenb == 1)
{
$this->_tableau($pdf, $tab_top, $tab_height + 20, $nexY, $outputlangs);
}
else
{
$this->_tableau($pdf, $tab_top_newpage, $tab_height_newpage, $nexY, $outputlangs);
}
$this->_pagefoot($pdf, $object, $outputlangs);
// New page
$pdf->AddPage();
$pagenb++;
$this->_pagehead($pdf, $object, 0, $outputlangs);
$pdf->SetFont('','', $default_font_size - 1);
$pdf->MultiCell(0, 3, ''); // Set interline to 3
$pdf->SetTextColor(0,0,0);
$nexY = $tab_top_newpage + 7;
}
// Detect if some page were added automatically and output _tableau for past pages
while ($pagenb < $pageposafter)
{
if ($pagenb == 1)
{
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
}
else
{
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
}
$this->_pagefoot($pdf,$object,$outputlangs);
$pagenb++;
$pdf->setPage($pagenb);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
}
if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak)
{
if ($pagenb == 1)
{
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
}
else
{
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
}
$this->_pagefoot($pdf,$object,$outputlangs);
// New page
$pdf->AddPage();
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
$pagenb++;
}
}
// Show square
if ($pagenb == 1)
{
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs);
$bottomlasttab=$tab_top + $tab_height + 1;
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot, 0, $outputlangs, 0, 0);
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
}
else
{
$this->_tableau($pdf, $tab_top_newpage, $tab_height_newpage, $nexY, $outputlangs);
$bottomlasttab=$tab_top_newpage + $tab_height_newpage + 1;
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot, 0, $outputlangs, 1, 0);
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
}
/*
* Pied de page
*/
@ -437,9 +428,11 @@ class pdf_typhon extends ModelePDFDeliveryOrder
* @param string $tab_height Height of table (rectangle)
* @param int $nexY Y
* @param Translate $outputlangs Langs object
* @param int $hidetop Hide top bar of array
* @param int $hidebottom Hide bottom bar of array
* @return void
*/
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs)
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0)
{
global $conf,$mysoc;
$default_font_size = pdf_getPDFFontSize($outputlangs);

View File

@ -127,6 +127,9 @@ class pdf_baleine extends ModelePDFProjects
if (file_exists($dir))
{
$pdf=pdf_getInstance($this->format);
$heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin)
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
$pdf->SetAutoPageBreak(1,0);
if (class_exists('TCPDF'))
{
@ -154,7 +157,6 @@ class pdf_baleine extends ModelePDFProjects
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
$pdf->SetAutoPageBreak(1,0);
// New page
$pdf->AddPage();
@ -225,43 +227,51 @@ class pdf_baleine extends ModelePDFProjects
$nexY+=2; // Passe espace entre les lignes
// Cherche nombre de lignes a venir pour savoir si place suffisante
if ($i < ($nblignes - 1) && empty($hidedesc)) // If it's not last line
{
//on recupere la description du produit suivant
$follow_descproduitservice = $object->lines[$i+1]->desc;
//on compte le nombre de ligne afin de verifier la place disponible (largeur de ligne 52 caracteres)
$nblineFollowDesc = (dol_nboflines_bis($follow_descproduitservice,52,$outputlangs->charset_output)*4);
}
else // If it's last line
{
$nblineFollowDesc = 0;
}
if (($nexY+$nblineFollowDesc) > ($tab_top+$tab_height) && $i < ($nblignes - 1))
{
$this->_tableau($pdf, $tab_top, $tab_height + 20, $nexY, $outputlangs);
$this->_pagefoot($pdf, $object, $outputlangs);
// New page
$pdf->AddPage();
$pagenb++;
$this->_pagehead($pdf, $object, 0, $outputlangs);
$pdf->SetFont('','', $default_font_size - 1);
$pdf->MultiCell(0, 3, ''); // Set interline to 3
$pdf->SetTextColor(0,0,0);
$tab_top=$tab_top_newpage;
$tab_height=$tab_height_newpage;
$nexY = $tab_top + 7;
}
// Detect if some page were added automatically and output _tableau for past pages
while ($pagenb < $pageposafter)
{
if ($pagenb == 1)
{
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
}
else
{
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
}
$this->_pagefoot($pdf,$object,$outputlangs);
$pagenb++;
$pdf->setPage($pagenb);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
}
if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak)
{
if ($pagenb == 1)
{
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
}
else
{
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
}
$this->_pagefoot($pdf,$object,$outputlangs);
// New page
$pdf->AddPage();
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
$pagenb++;
}
}
// Show square
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs);
$bottomlasttab=$tab_top + $tab_height + 1;
if ($pagenb == 1)
{
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot, 0, $outputlangs, 0, 0);
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
}
else
{
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot, 0, $outputlangs, 1, 0);
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
}
/*
* Pied de page
@ -297,9 +307,11 @@ class pdf_baleine extends ModelePDFProjects
* @param string $tab_height Height of table (rectangle)
* @param int $nexY Y
* @param Translate $outputlangs Langs object
* @param int $hidetop Hide top bar of array
* @param int $hidebottom Hide bottom bar of array
* @return void
*/
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs)
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0)
{
global $conf,$mysoc;

View File

@ -163,6 +163,9 @@ class pdf_azur extends ModelePDFPropales
// Create pdf instance
$pdf=pdf_getInstance($this->format);
$heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin)
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
$pdf->SetAutoPageBreak(1,0);
if (class_exists('TCPDF'))
{
@ -189,7 +192,6 @@ class pdf_azur extends ModelePDFPropales
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);
$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++)
@ -249,10 +251,17 @@ class pdf_azur extends ModelePDFPropales
$pdf->SetFont('','', $default_font_size - 1); // Dans boucle pour gerer multi-page
$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
$pageposbefore=$pdf->getPage();
// Description de la ligne produit
$curX = $this->posxdesc-1;
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,4,$curX,$curY,$hideref,$hidedesc,0,$hookmanager);
$pageposafter=$pdf->getPage();
$pdf->setPage($pageposbefore);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
$nexY = $pdf->GetY();
@ -308,67 +317,50 @@ class pdf_azur extends ModelePDFPropales
$nexY+=2; // Passe espace entre les lignes
// Cherche nombre de lignes a venir pour savoir si place suffisante
if ($i < ($nblignes - 1) && empty($hidedesc)) // If it's not last line
{
//on recupere la description du produit suivant
$follow_descproduitservice = $object->lines[$i+1]->desc;
//on compte le nombre de ligne afin de verifier la place disponible (largeur de ligne 52 caracteres)
$nblineFollowDesc = (dol_nboflines_bis($follow_descproduitservice,52,$outputlangs->charset_output)*4);
}
else // If it's last line
{
$nblineFollowDesc = 0;
}
// Test if a new page is required
if ($pagenb == 1)
{
$tab_top_in_current_page=$tab_top;
$tab_height_in_current_page=$tab_height;
}
else
{
$tab_top_in_current_page=$tab_top_newpage;
$tab_height_in_current_page=$tab_height_middlepage;
}
if ((($nexY+$nblineFollowDesc) > ($tab_top_in_current_page+$tab_height_in_current_page) && $i < ($nblignes - 1)) || (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak))
{
if ($pagenb == 1)
{
$this->_tableau($pdf, $tab_top, $tab_height + 20, $nexY, $outputlangs);
}
else
{
$this->_tableau($pdf, $tab_top_newpage, $tab_height_middlepage, $nexY, $outputlangs);
}
$this->_pagefoot($pdf,$object,$outputlangs);
// New page
$pdf->AddPage();
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
$pagenb++;
$this->_pagehead($pdf, $object, 0, $outputlangs, $hookmanager);
$pdf->SetFont('','', $default_font_size - 1);
$pdf->MultiCell(0, 3, ''); // Set interline to 3
$pdf->SetTextColor(0,0,0);
$nexY = $tab_top_newpage + 7;
}
// Detect if some page were added automatically and output _tableau for past pages
while ($pagenb < $pageposafter)
{
if ($pagenb == 1)
{
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
}
else
{
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
}
$this->_pagefoot($pdf,$object,$outputlangs);
$pagenb++;
$pdf->setPage($pagenb);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
}
if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak)
{
if ($pagenb == 1)
{
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
}
else
{
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
}
$this->_pagefoot($pdf,$object,$outputlangs);
// New page
$pdf->AddPage();
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
$pagenb++;
}
}
// Show square
if ($pagenb == 1)
{
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs);
$bottomlasttab=$tab_top + $tab_height + 1;
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot, 0, $outputlangs, 0, 0);
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
}
else
{
$this->_tableau($pdf, $tab_top_newpage, $tab_height_endpage, $nexY, $outputlangs);
$bottomlasttab=$tab_top_newpage + $tab_height_endpage + 1;
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot, 0, $outputlangs, 1, 0);
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
}
// Affiche zone infos
@ -828,9 +820,11 @@ class pdf_azur extends ModelePDFPropales
* @param string $tab_height Height of table (rectangle)
* @param int $nexY Y
* @param Translate $outputlangs Langs object
* @param int $hidetop Hide top bar of array
* @param int $hidebottom Hide bottom bar of array
* @return void
*/
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs)
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0)
{
global $conf;
$default_font_size = pdf_getPDFFontSize($outputlangs);

View File

@ -163,6 +163,9 @@ class pdf_jaune extends ModelePDFPropales
// Create pdf instance
$pdf=pdf_getInstance($this->format);
$heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin)
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
$pdf->SetAutoPageBreak(1,0);
if (class_exists('TCPDF'))
{
@ -189,7 +192,6 @@ class pdf_jaune extends ModelePDFPropales
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);
$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++)
@ -249,10 +251,17 @@ class pdf_jaune extends ModelePDFPropales
$pdf->SetFont('','', $default_font_size - 1); // Dans boucle pour gerer multi-page
$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
$pageposbefore=$pdf->getPage();
// Description de la ligne produit
$curX = $this->posxdesc-1;
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,4,$curX,$curY,$hideref,$hidedesc,0,$hookmanager);
$pageposafter=$pdf->getPage();
$pdf->setPage($pageposbefore);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
$nexY = $pdf->GetY();
@ -308,67 +317,50 @@ class pdf_jaune extends ModelePDFPropales
$nexY+=2; // Passe espace entre les lignes
// Cherche nombre de lignes a venir pour savoir si place suffisante
if ($i < ($nblignes - 1) && empty($hidedesc)) // If it's not last line
{
//on recupere la description du produit suivant
$follow_descproduitservice = $object->lines[$i+1]->desc;
//on compte le nombre de ligne afin de verifier la place disponible (largeur de ligne 52 caracteres)
$nblineFollowDesc = (dol_nboflines_bis($follow_descproduitservice,52,$outputlangs->charset_output)*4);
}
else // If it's last line
{
$nblineFollowDesc = 0;
}
// Test if a new page is required
if ($pagenb == 1)
{
$tab_top_in_current_page=$tab_top;
$tab_height_in_current_page=$tab_height;
}
else
{
$tab_top_in_current_page=$tab_top_newpage;
$tab_height_in_current_page=$tab_height_middlepage;
}
if ((($nexY+$nblineFollowDesc) > ($tab_top_in_current_page+$tab_height_in_current_page) && $i < ($nblignes - 1)) || (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak))
{
if ($pagenb == 1)
{
$this->_tableau($pdf, $tab_top, $tab_height + 20, $nexY, $outputlangs);
}
else
{
$this->_tableau($pdf, $tab_top_newpage, $tab_height_middlepage, $nexY, $outputlangs);
}
$this->_pagefoot($pdf,$object,$outputlangs);
// New page
$pdf->AddPage();
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
$pagenb++;
$this->_pagehead($pdf, $object, 0, $outputlangs);
$pdf->SetFont('','', $default_font_size - 1);
$pdf->MultiCell(0, 3, ''); // Set interline to 3
$pdf->SetTextColor(0,0,0);
$nexY = $tab_top_newpage + 7;
}
// Detect if some page were added automatically and output _tableau for past pages
while ($pagenb < $pageposafter)
{
if ($pagenb == 1)
{
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
}
else
{
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
}
$this->_pagefoot($pdf,$object,$outputlangs);
$pagenb++;
$pdf->setPage($pagenb);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
}
if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak)
{
if ($pagenb == 1)
{
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
}
else
{
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
}
$this->_pagefoot($pdf,$object,$outputlangs);
// New page
$pdf->AddPage();
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
$pagenb++;
}
}
// Show square
if ($pagenb == 1)
{
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs);
$bottomlasttab=$tab_top + $tab_height + 1;
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot, 0, $outputlangs, 0, 0);
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
}
else
{
$this->_tableau($pdf, $tab_top_newpage, $tab_height_endpage, $nexY, $outputlangs);
$bottomlasttab=$tab_top_newpage + $tab_height_endpage + 1;
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot, 0, $outputlangs, 1, 0);
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
}
// Affiche zone infos
@ -809,9 +801,11 @@ class pdf_jaune extends ModelePDFPropales
* @param string $tab_height Height of table (rectangle)
* @param int $nexY Y
* @param Translate $outputlangs Langs object
* @param int $hidetop Hide top bar of array
* @param int $hidebottom Hide bottom bar of array
* @return void
*/
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs)
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0)
{
global $conf;
$default_font_size = pdf_getPDFFontSize($outputlangs);

View File

@ -171,6 +171,9 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$nblignes = count($object->lines);
$pdf=pdf_getInstance($this->format);
$heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin)
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
$pdf->SetAutoPageBreak(1,0);
if (class_exists('TCPDF'))
{
@ -197,7 +200,6 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);
$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++)
@ -253,13 +255,19 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
{
$curY = $nexY;
$pdf->SetFont('','', $default_font_size - 1); // Dans boucle pour gerer multi-page
// Description of product line
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
$pageposbefore=$pdf->getPage();
// Description of product line
$curX = $this->posxdesc-1;
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,3,$curX,$curY,0,0,1);
$pageposafter=$pdf->getPage();
$pdf->setPage($pageposbefore);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
$nexY = $pdf->GetY();
@ -310,72 +318,50 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$nexY+=2; // Passe espace entre les lignes
// Cherche nombre de lignes a venir pour savoir si place suffisante
if ($i < ($nblignes - 1) && empty($hidedesc)) // If it's not last line
{
//on recupere la description du produit suivant
$follow_descproduitservice = $object->lines[$i+1]->desc;
//on compte le nombre de ligne afin de verifier la place disponible (largeur de ligne 52 caracteres)
$nblineFollowDesc = dol_nboflines_bis($follow_descproduitservice,52,$outputlangs->charset_output)*4;
// Et si on affiche dates de validite, on ajoute encore une ligne
if ($object->lines[$i]->date_start && $object->lines[$i]->date_end)
{
$nblineFollowDesc += 4;
}
}
else // If it's last line
{
$nblineFollowDesc = 0;
}
// Test if a new page is required
if ($pagenb == 1)
{
$tab_top_in_current_page=$tab_top;
$tab_height_in_current_page=$tab_height;
}
else
{
$tab_top_in_current_page=$tab_top_newpage;
$tab_height_in_current_page=$tab_height_newpage;
}
if (($nexY+$nblineFollowDesc) > ($tab_top_in_current_page+$tab_height_in_current_page) && $i < ($nblignes - 1))
{
if ($pagenb == 1)
{
$this->_tableau($pdf, $tab_top, $tab_height + 20, $nexY, $outputlangs);
}
else
{
$this->_tableau($pdf, $tab_top_newpage, $tab_height_newpage, $nexY, $outputlangs);
}
$this->_pagefoot($pdf, $object, $outputlangs);
// New page
$pdf->AddPage();
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
$pagenb++;
$this->_pagehead($pdf, $object, 0, $outputlangs);
$pdf->SetFont('','', $default_font_size - 1);
$pdf->MultiCell(0, 3, ''); // Set interline to 3
$pdf->SetTextColor(0,0,0);
$nexY = $tab_top_newpage + 7;
}
// Detect if some page were added automatically and output _tableau for past pages
while ($pagenb < $pageposafter)
{
if ($pagenb == 1)
{
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
}
else
{
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
}
$this->_pagefoot($pdf,$object,$outputlangs);
$pagenb++;
$pdf->setPage($pagenb);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
}
if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak)
{
if ($pagenb == 1)
{
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
}
else
{
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
}
$this->_pagefoot($pdf,$object,$outputlangs);
// New page
$pdf->AddPage();
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
$pagenb++;
}
}
// Show square
if ($pagenb == 1)
{
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs);
$bottomlasttab=$tab_top + $tab_height + 1;
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot, 0, $outputlangs, 0, 0);
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
}
else
{
$this->_tableau($pdf, $tab_top_newpage, $tab_height_newpage, $nexY, $outputlangs);
$bottomlasttab=$tab_top_newpage + $tab_height_newpage + 1;
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot, 0, $outputlangs, 1, 0);
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
}
// Affiche zone totaux
@ -627,9 +613,11 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
* @param string $tab_height Height of table (rectangle)
* @param int $nexY Y
* @param Translate $outputlangs Langs object
* @param int $hidetop Hide top bar of array
* @param int $hidebottom Hide bottom bar of array
* @return void
*/
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs)
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0)
{
global $conf;

View File

@ -188,6 +188,9 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$nblignes = count($object->lines);
$pdf=pdf_getInstance($this->format);
$heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin)
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
$pdf->SetAutoPageBreak(1,0);
if (class_exists('TCPDF'))
{
@ -214,7 +217,6 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);
$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++)
@ -272,10 +274,17 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
$pageposbefore=$pdf->getPage();
// Description of product line
$curX = $this->posxdesc-1;
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,3,$curX,$curY,0,0,1,$hookmanager);
$pageposafter=$pdf->getPage();
$pdf->setPage($pageposbefore);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
$nexY = $pdf->GetY();
@ -328,72 +337,50 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$nexY+=2; // Passe espace entre les lignes
// Cherche nombre de lignes a venir pour savoir si place suffisante
if ($i < ($nblignes - 1) && empty($hidedesc)) // If it's not last line
{
//on recupere la description du produit suivant
$follow_descproduitservice = $object->lines[$i+1]->desc;
//on compte le nombre de ligne afin de verifier la place disponible (largeur de ligne 52 caracteres)
$nblineFollowDesc = (dol_nboflines_bis($follow_descproduitservice,52,$outputlangs->charset_output)*4);
// Et si on affiche dates de validite, on ajoute encore une ligne
if ($object->lines[$i]->date_start && $object->lines[$i]->date_end)
{
$nblineFollowDesc += 4;
}
}
else // If it's last line
{
$nblineFollowDesc = 0;
}
// Test if a new page is required
if ($pagenb == 1)
{
$tab_top_in_current_page=$tab_top;
$tab_height_in_current_page=$tab_height;
}
else
{
$tab_top_in_current_page=$tab_top_newpage;
$tab_height_in_current_page=$tab_height_newpage;
}
if (($nexY+$nblineFollowDesc) > ($tab_top_in_current_page+$tab_height_in_current_page) && $i < ($nblignes - 1))
{
if ($pagenb == 1)
{
$this->_tableau($pdf, $tab_top, $tab_height + 20, $nexY, $outputlangs);
}
else
{
$this->_tableau($pdf, $tab_top_newpage, $tab_height_newpage, $nexY, $outputlangs);
}
$this->_pagefoot($pdf, $object, $outputlangs);
// New page
$pdf->AddPage();
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
$pagenb++;
$this->_pagehead($pdf, $object, 0, $outputlangs, $hookmanager);
$pdf->SetFont('','', $default_font_size - 1);
$pdf->MultiCell(0, 3, ''); // Set interline to 3
$pdf->SetTextColor(0,0,0);
$nexY = $tab_top_newpage + 7;
}
// Detect if some page were added automatically and output _tableau for past pages
while ($pagenb < $pageposafter)
{
if ($pagenb == 1)
{
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
}
else
{
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
}
$this->_pagefoot($pdf,$object,$outputlangs);
$pagenb++;
$pdf->setPage($pagenb);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
}
if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak)
{
if ($pagenb == 1)
{
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
}
else
{
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
}
$this->_pagefoot($pdf,$object,$outputlangs);
// New page
$pdf->AddPage();
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
$pagenb++;
}
}
// Show square
if ($pagenb == 1)
{
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs);
$bottomlasttab=$tab_top + $tab_height + 1;
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot, 0, $outputlangs, 0, 0);
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
}
else
{
$this->_tableau($pdf, $tab_top_newpage, $tab_height_newpage, $nexY, $outputlangs);
$bottomlasttab=$tab_top_newpage + $tab_height_newpage + 1;
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot, 0, $outputlangs, 1, 0);
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
}
// Affiche zone infos
@ -808,9 +795,11 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
* @param string $tab_height Height of table (rectangle)
* @param int $nexY Y
* @param Translate $outputlangs Langs object
* @param int $hidetop Hide top bar of array
* @param int $hidebottom Hide bottom bar of array
* @return void
*/
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs)
*/
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0)
{
global $conf;

View File

@ -560,7 +560,7 @@ class Expedition extends CommonObject
dol_syslog("Rename ok");
// Suppression ancien fichier PDF dans nouveau rep
dol_delete_file($dirdest.'/'.$oldref.'.*');
dol_delete_file($dirdest.'/'.$oldref.'*.*');
}
}
}

View File

@ -367,7 +367,7 @@ class CommandeFournisseur extends CommonOrder
dol_syslog("Rename ok");
// Suppression ancien fichier PDF dans nouveau rep
dol_delete_file($dirdest.'/'.$oldref.'.*');
dol_delete_file($dirdest.'/'.$oldref.'*.*');
}
}
}

View File

@ -1282,6 +1282,7 @@ class FactureFournisseur extends CommonInvoice
function initAsSpecimen()
{
global $langs,$conf;
include_once(DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php');
$now = dol_now();

View File

@ -217,13 +217,13 @@ if ($id > 0 || ! empty($ref))
$db->free($resql);
}
$sql = "SELECT l.rowid, l.ref, l.fk_product, l.description, l.subprice, sum(l.qty) as qty";
$sql.= ", p.label";
$sql = "SELECT l.fk_product, l.subprice, SUM(l.qty) as qty,";
$sql.= " p.ref, p.label";
$sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as l";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON l.fk_product=p.rowid";
$sql.= " WHERE l.fk_commande = ".$commande->id;
$sql.= " GROUP BY l.fk_product";
$sql.= " ORDER BY l.rowid";
$sql.= " GROUP BY p.ref, p.label, l.fk_product, l.subprice"; // Calculation of amount dispatched is done per fk_product so we must group by fk_product
$sql.= " ORDER BY p.ref, p.label";
$resql = $db->query($sql);
if ($resql)
@ -260,7 +260,7 @@ if ($id > 0 || ! empty($ref))
{
$nbproduct++;
$remaintodispatch=($objp->qty - $products_dispatched[$objp->fk_product]);
$remaintodispatch=($objp->qty - $products_dispatched[$objp->fk_product]); // Calculation of dispatched
if ($remaintodispatch < 0) $remaintodispatch=0;
$var=!$var;
@ -268,7 +268,9 @@ if ($id > 0 || ! empty($ref))
print '<td>';
print '<a href="'.DOL_URL_ROOT.'/product/fournisseurs.php?id='.$objp->fk_product.'">'.img_object($langs->trans("ShowProduct"),'product').' '.$objp->ref.'</a>';
print ' - '.$objp->label;
if ($objp->description) print '<br>'.nl2br($objp->description);
// To show detail cref and description value, we must make calculation by cref
//print ($objp->cref?' ('.$objp->cref.')':'');
//if ($objp->description) print '<br>'.nl2br($objp->description);
print '<input name="product_'.$i.'" type="hidden" value="'.$objp->fk_product.'">';
print '<input name="pu_'.$i.'" type="hidden" value="'.$objp->subprice.'">';
print "</td>\n";

View File

@ -473,6 +473,8 @@ elseif ($action == 'addline')
// cas special pour lequel on a les meme reference que le fournisseur
// $label = '['.$product->ref.'] - '. $product->libelle;
$label = $product->description;
$label.= $product->description && $_POST['np_desc'] ? "\n" : "";
$label.= $_POST['np_desc'];
$tvatx=get_default_tva($object->thirdparty, $mysoc, $product->id, $_POST['idprodfournprice']);
@ -1784,12 +1786,19 @@ else
print '<td colspan="4">';
$form->select_produits_fournisseurs($object->socid,'','idprodfournprice');
if (empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT)) print '<br>';
if (is_object($hookmanager))
{
$parameters=array('htmlname'=>'idprodfournprice');
echo $hookmanager->executeHooks('formCreateProductSupplierOptions',$parameters,$object,$action);
}
$nbrows=ROWS_2;
if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT;
$doleditor = new DolEditor('np_desc', GETPOST('np_desc'), '', 100, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_DETAILS, $nbrows, 70);
$doleditor->Create();
print '</td>';
print '<td align="right"><input type="text" name="qty" value="1" size="1"></td>';
print '<td>&nbsp;</td>';

View File

@ -1,101 +0,0 @@
/**
* jQuery lightBox plugin
* This jQuery plugin was inspired and based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/)
* and adapted to me for use like a plugin from jQuery.
* @name jquery-lightbox-0.5.css
* @author Leandro Vieira Pinho - http://leandrovieira.com
* @version 0.5
* @date April 11, 2008
* @category jQuery plugin
* @copyright (c) 2008 Leandro Vieira Pinho (leandrovieira.com)
* @license CCAttribution-ShareAlike 2.5 Brazil - http://creativecommons.org/licenses/by-sa/2.5/br/deed.en_US
* @example Visit http://leandrovieira.com/projects/jquery/lightbox/ for more informations about this jQuery plugin
*/
#jquery-overlay {
position: absolute;
top: 0;
left: 0;
z-index: 90;
width: 100%;
height: 500px;
}
#jquery-lightbox {
position: absolute;
top: 0;
left: 0;
width: 100%;
z-index: 100;
text-align: center;
line-height: 0;
}
#jquery-lightbox a img { border: none; }
#lightbox-container-image-box {
position: relative;
background-color: #fff;
width: 250px;
height: 250px;
margin: 0 auto;
}
#lightbox-container-image { padding: 10px; }
#lightbox-loading {
position: absolute;
top: 40%;
left: 0%;
height: 25%;
width: 100%;
text-align: center;
line-height: 0;
}
#lightbox-nav {
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
z-index: 10;
}
#lightbox-container-image-box > #lightbox-nav { left: 0; }
#lightbox-nav a { outline: none;}
#lightbox-nav-btnPrev, #lightbox-nav-btnNext {
width: 49%;
height: 100%;
zoom: 1;
display: block;
}
#lightbox-nav-btnPrev {
left: 0;
float: left;
}
#lightbox-nav-btnNext {
right: 0;
float: right;
}
#lightbox-container-image-data-box {
font: 10px Verdana, Helvetica, sans-serif;
background-color: #fff;
margin: 0 auto;
line-height: 1.4em;
overflow: auto;
width: 100%;
padding: 0 10px 0;
}
#lightbox-container-image-data {
padding: 0 10px;
color: #666;
}
#lightbox-container-image-data #lightbox-image-details {
width: 70%;
float: left;
text-align: left;
}
#lightbox-image-details-caption { font-weight: bold; }
#lightbox-image-details-currentNumber {
display: block;
clear: left;
padding-bottom: 1.0em;
}
#lightbox-secNav-btnClose {
width: 66px;
float: right;
padding-bottom: 0.7em;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 700 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 812 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 832 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

View File

@ -1,42 +0,0 @@
/**
* jQuery lightBox plugin
* This jQuery plugin was inspired and based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/)
* and adapted to me for use like a plugin from jQuery.
* @name jquery-lightbox-0.5.js
* @author Leandro Vieira Pinho - http://leandrovieira.com
* @version 0.5
* @date April 11, 2008
* @category jQuery plugin
* @copyright (c) 2008 Leandro Vieira Pinho (leandrovieira.com)
* @license CCAttribution-ShareAlike 2.5 Brazil - http://creativecommons.org/licenses/by-sa/2.5/br/deed.en_US
* @example Visit http://leandrovieira.com/projects/jquery/lightbox/ for more informations about this jQuery plugin
*/
(function($){$.fn.lightBox=function(settings){settings=jQuery.extend({overlayBgColor:'#000',overlayOpacity:0.8,fixedNavigation:false,imageLoading:'images/lightbox-ico-loading.gif',imageBtnPrev:'images/lightbox-btn-prev.gif',imageBtnNext:'images/lightbox-btn-next.gif',imageBtnClose:'images/lightbox-btn-close.gif',imageBlank:'images/lightbox-blank.gif',containerBorderSize:10,containerResizeSpeed:400,txtImage:'Image',txtOf:'of',keyToClose:'c',keyToPrev:'p',keyToNext:'n',imageArray:[],activeImage:0},settings);var jQueryMatchedObj=this;function _initialize(){_start(this,jQueryMatchedObj);return false;}
function _start(objClicked,jQueryMatchedObj){$('embed, object, select').css({'visibility':'hidden'});_set_interface();settings.imageArray.length=0;settings.activeImage=0;if(jQueryMatchedObj.length==1){settings.imageArray.push(new Array(objClicked.getAttribute('href'),objClicked.getAttribute('title')));}else{for(var i=0;i<jQueryMatchedObj.length;i++){settings.imageArray.push(new Array(jQueryMatchedObj[i].getAttribute('href'),jQueryMatchedObj[i].getAttribute('title')));}}
while(settings.imageArray[settings.activeImage][0]!=objClicked.getAttribute('href')){settings.activeImage++;}
_set_image_to_view();}
function _set_interface(){$('body').append('<div id="jquery-overlay"></div><div id="jquery-lightbox"><div id="lightbox-container-image-box"><div id="lightbox-container-image"><img id="lightbox-image"><div style="" id="lightbox-nav"><a href="#" id="lightbox-nav-btnPrev"></a><a href="#" id="lightbox-nav-btnNext"></a></div><div id="lightbox-loading"><a href="#" id="lightbox-loading-link"><img src="'+settings.imageLoading+'"></a></div></div></div><div id="lightbox-container-image-data-box"><div id="lightbox-container-image-data"><div id="lightbox-image-details"><span id="lightbox-image-details-caption"></span><span id="lightbox-image-details-currentNumber"></span></div><div id="lightbox-secNav"><a href="#" id="lightbox-secNav-btnClose"><img src="'+settings.imageBtnClose+'"></a></div></div></div></div>');var arrPageSizes=___getPageSize();$('#jquery-overlay').css({backgroundColor:settings.overlayBgColor,opacity:settings.overlayOpacity,width:arrPageSizes[0],height:arrPageSizes[1]}).fadeIn();var arrPageScroll=___getPageScroll();$('#jquery-lightbox').css({top:arrPageScroll[1]+(arrPageSizes[3]/10),left:arrPageScroll[0]}).show();$('#jquery-overlay,#jquery-lightbox').click(function(){_finish();});$('#lightbox-loading-link,#lightbox-secNav-btnClose').click(function(){_finish();return false;});$(window).resize(function(){var arrPageSizes=___getPageSize();$('#jquery-overlay').css({width:arrPageSizes[0],height:arrPageSizes[1]});var arrPageScroll=___getPageScroll();$('#jquery-lightbox').css({top:arrPageScroll[1]+(arrPageSizes[3]/10),left:arrPageScroll[0]});});}
function _set_image_to_view(){$('#lightbox-loading').show();if(settings.fixedNavigation){$('#lightbox-image,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();}else{$('#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();}
var objImagePreloader=new Image();objImagePreloader.onload=function(){$('#lightbox-image').attr('src',settings.imageArray[settings.activeImage][0]);_resize_container_image_box(objImagePreloader.width,objImagePreloader.height);objImagePreloader.onload=function(){};};objImagePreloader.src=settings.imageArray[settings.activeImage][0];};function _resize_container_image_box(intImageWidth,intImageHeight){var intCurrentWidth=$('#lightbox-container-image-box').width();var intCurrentHeight=$('#lightbox-container-image-box').height();var intWidth=(intImageWidth+(settings.containerBorderSize*2));var intHeight=(intImageHeight+(settings.containerBorderSize*2));var intDiffW=intCurrentWidth-intWidth;var intDiffH=intCurrentHeight-intHeight;$('#lightbox-container-image-box').animate({width:intWidth,height:intHeight},settings.containerResizeSpeed,function(){_show_image();});if((intDiffW==0)&&(intDiffH==0)){if($.browser.msie){___pause(250);}else{___pause(100);}}
$('#lightbox-container-image-data-box').css({width:intImageWidth});$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({height:intImageHeight+(settings.containerBorderSize*2)});};function _show_image(){$('#lightbox-loading').hide();$('#lightbox-image').fadeIn(function(){_show_image_data();_set_navigation();});_preload_neighbor_images();};function _show_image_data(){$('#lightbox-container-image-data-box').slideDown('fast');$('#lightbox-image-details-caption').hide();if(settings.imageArray[settings.activeImage][1]){$('#lightbox-image-details-caption').html(settings.imageArray[settings.activeImage][1]).show();}
if(settings.imageArray.length>1){$('#lightbox-image-details-currentNumber').html(settings.txtImage+' '+(settings.activeImage+1)+' '+settings.txtOf+' '+settings.imageArray.length).show();}}
function _set_navigation(){$('#lightbox-nav').show();$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({'background':'transparent url('+settings.imageBlank+') no-repeat'});if(settings.activeImage!=0){if(settings.fixedNavigation){$('#lightbox-nav-btnPrev').css({'background':'url('+settings.imageBtnPrev+') left 15% no-repeat'}).unbind().bind('click',function(){settings.activeImage=settings.activeImage-1;_set_image_to_view();return false;});}else{$('#lightbox-nav-btnPrev').unbind().hover(function(){$(this).css({'background':'url('+settings.imageBtnPrev+') left 15% no-repeat'});},function(){$(this).css({'background':'transparent url('+settings.imageBlank+') no-repeat'});}).show().bind('click',function(){settings.activeImage=settings.activeImage-1;_set_image_to_view();return false;});}}
if(settings.activeImage!=(settings.imageArray.length-1)){if(settings.fixedNavigation){$('#lightbox-nav-btnNext').css({'background':'url('+settings.imageBtnNext+') right 15% no-repeat'}).unbind().bind('click',function(){settings.activeImage=settings.activeImage+1;_set_image_to_view();return false;});}else{$('#lightbox-nav-btnNext').unbind().hover(function(){$(this).css({'background':'url('+settings.imageBtnNext+') right 15% no-repeat'});},function(){$(this).css({'background':'transparent url('+settings.imageBlank+') no-repeat'});}).show().bind('click',function(){settings.activeImage=settings.activeImage+1;_set_image_to_view();return false;});}}
_enable_keyboard_navigation();}
function _enable_keyboard_navigation(){$(document).keydown(function(objEvent){_keyboard_action(objEvent);});}
function _disable_keyboard_navigation(){$(document).unbind();}
function _keyboard_action(objEvent){if(objEvent==null){keycode=event.keyCode;escapeKey=27;}else{keycode=objEvent.keyCode;escapeKey=objEvent.DOM_VK_ESCAPE;}
key=String.fromCharCode(keycode).toLowerCase();if((key==settings.keyToClose)||(key=='x')||(keycode==escapeKey)){_finish();}
if((key==settings.keyToPrev)||(keycode==37)){if(settings.activeImage!=0){settings.activeImage=settings.activeImage-1;_set_image_to_view();_disable_keyboard_navigation();}}
if((key==settings.keyToNext)||(keycode==39)){if(settings.activeImage!=(settings.imageArray.length-1)){settings.activeImage=settings.activeImage+1;_set_image_to_view();_disable_keyboard_navigation();}}}
function _preload_neighbor_images(){if((settings.imageArray.length-1)>settings.activeImage){objNext=new Image();objNext.src=settings.imageArray[settings.activeImage+1][0];}
if(settings.activeImage>0){objPrev=new Image();objPrev.src=settings.imageArray[settings.activeImage-1][0];}}
function _finish(){$('#jquery-lightbox').remove();$('#jquery-overlay').fadeOut(function(){$('#jquery-overlay').remove();});$('embed, object, select').css({'visibility':'visible'});}
function ___getPageSize(){var xScroll,yScroll;if(window.innerHeight&&window.scrollMaxY){xScroll=window.innerWidth+window.scrollMaxX;yScroll=window.innerHeight+window.scrollMaxY;}else if(document.body.scrollHeight>document.body.offsetHeight){xScroll=document.body.scrollWidth;yScroll=document.body.scrollHeight;}else{xScroll=document.body.offsetWidth;yScroll=document.body.offsetHeight;}
var windowWidth,windowHeight;if(self.innerHeight){if(document.documentElement.clientWidth){windowWidth=document.documentElement.clientWidth;}else{windowWidth=self.innerWidth;}
windowHeight=self.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight;}else if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight;}
if(yScroll<windowHeight){pageHeight=windowHeight;}else{pageHeight=yScroll;}
if(xScroll<windowWidth){pageWidth=xScroll;}else{pageWidth=windowWidth;}
arrayPageSize=new Array(pageWidth,pageHeight,windowWidth,windowHeight);return arrayPageSize;};function ___getPageScroll(){var xScroll,yScroll;if(self.pageYOffset){yScroll=self.pageYOffset;xScroll=self.pageXOffset;}else if(document.documentElement&&document.documentElement.scrollTop){yScroll=document.documentElement.scrollTop;xScroll=document.documentElement.scrollLeft;}else if(document.body){yScroll=document.body.scrollTop;xScroll=document.body.scrollLeft;}
arrayPageScroll=new Array(xScroll,yScroll);return arrayPageScroll;};function ___pause(ms){var date=new Date();curDate=null;do{var curDate=new Date();}
while(curDate-date<ms);};return this.unbind('click').click(_initialize);};})(jQuery);

File diff suppressed because one or more lines are too long

View File

@ -235,7 +235,7 @@ Discount=Discount
Discounts=Discounts
AddDiscount=Create discount
AddRelativeDiscount=Create relative discount
EditRelativelDiscount=Edit relatvie discount
EditRelativeDiscount=Edit relative discount
AddGlobalDiscount=Create absolute discount
EditGlobalDiscounts=Edit absolute discounts
AddCreditNote=Create credit note

View File

@ -21,7 +21,7 @@ CustomersOrders=Customer's orders
CustomersOrdersRunning=Current customer's orders
CustomersOrdersAndOrdersLines=Customer orders and order's lines
OrdersToValid=Customer's orders to validate
OrdersToBill=Customer's orders to bill
OrdersToBill=Customer's orders delivered
OrdersInProcess=Customer's orders in process
OrdersToProcess=Customer's orders to process
SuppliersOrdersToProcess=Supplier's orders to process
@ -32,7 +32,7 @@ StatusOrderSentShort=In process
StatusOrderSent=Shipment in process
StatusOrderOnProcessShort=Reception
StatusOrderProcessedShort=Processed
StatusOrderToBillShort=To bill
StatusOrderToBillShort=Delivered
StatusOrderApprovedShort=Approved
StatusOrderRefusedShort=Refused
StatusOrderToProcessShort=To process
@ -43,7 +43,7 @@ StatusOrderDraft=Draft (needs to be validated)
StatusOrderValidated=Validated
StatusOrderOnProcess=Waiting to receive
StatusOrderProcessed=Processed
StatusOrderToBill=To bill
StatusOrderToBill=Delivered
StatusOrderApproved=Approved
StatusOrderRefused=Refused
StatusOrderReceivedPartially=Partially received
@ -51,7 +51,7 @@ StatusOrderReceivedAll=Everything received
ShippingExist=A shipment exists
DraftOrWaitingApproved=Draft or approved not yet ordered
DraftOrWaitingShipped=Draft or validated not yet shipped
MenuOrdersToBill=Orders to bill
MenuOrdersToBill=Orders delivered
SearchOrder=Search order
Sending=Sending
Sendings=Sendings

View File

@ -24,6 +24,7 @@ TaskRDVWith=Cita con %s
ShowTask=Ver tarea
ShowAction=Ver evento
ActionsReport=Informe de eventos
ThirdPartiesOfSaleRepresentative=Terceros cuyo representante de ventas es
SalesRepresentative=Comercial
SalesRepresentatives=Comerciales
SalesRepresentativeFollowUp=Comercial (seguimiento)

View File

@ -144,6 +144,7 @@ DescADHERENT_MAIL_RESIL_SUBJECT=Asunto de e-mail de baja
DescADHERENT_MAIL_RESIL=E-mail de baja
DescADHERENT_MAIL_FROM=E-mail emisor para los e-mails automáticos
DescADHERENT_ETIQUETTE_TYPE=Formato páginas etiquetas
DescADHERENT_ETIQUETTE_TEXT=Texto a imprimir en la dirección de las etiquetas de cada miembro
DescADHERENT_CARD_TYPE=Formato páginas carné de miembro
DescADHERENT_CARD_HEADER_TEXT=Texto a imprimir en la parte superior del carné de miembro
DescADHERENT_CARD_TEXT=Texto a imprimir en el carné de miembro (Alineado a la izquierda)

View File

@ -21,7 +21,7 @@ CustomersOrders=Commandes clients
CustomersOrdersRunning=Commandes clients en cours
CustomersOrdersAndOrdersLines=Commandes clients et lignes de commandes
OrdersToValid=Commandes clients à valider
OrdersToBill=Commandes clients à facturer
OrdersToBill=Commandes clients délivrées
OrdersInProcess=Commandes clients en traitement
OrdersToProcess=Commandes clients à traiter
SuppliersOrdersToProcess=Commandes fournisseurs à traiter
@ -32,7 +32,7 @@ StatusOrderOnProcessShort=Traitement en cours
StatusOrderSentShort=Envoi en cours
StatusOrderSent=Envoi en cours
StatusOrderProcessedShort=Traitée
StatusOrderToBillShort=À facturer
StatusOrderToBillShort=Délivrée
StatusOrderApprovedShort=Approuvée
StatusOrderRefusedShort=Refusée
StatusOrderToProcessShort=A traiter
@ -43,7 +43,7 @@ StatusOrderDraft=Brouillon (à valider)
StatusOrderValidated=Validée
StatusOrderOnProcess=Attente réception
StatusOrderProcessed=Traitée
StatusOrderToBill=À facturer
StatusOrderToBill=Délivrée
StatusOrderApproved=Approuvée
StatusOrderRefused=Refusée
StatusOrderReceivedPartially=Reçu partiellement
@ -52,7 +52,7 @@ ShippingExist=Une expédition existe
DraftOrWaitingApproved=Brouillon ou approuvée pas encore commandée
DraftOrWaitingShipped=Brouillon ou validée pas encore expédiée
SearchOrder=Rechercher une commande
MenuOrdersToBill=Commandes à facturer
MenuOrdersToBill=Commandes délivrées
Sending=Expédition
Sendings=Expéditions
ShipProduct=Expédier produit

View File

@ -408,7 +408,7 @@ class Livraison extends CommonObject
dol_syslog("Rename ok");
// Suppression ancien fichier PDF dans nouveau rep
dol_delete_file($dirdest.'/'.$oldref.'.*');
dol_delete_file($dirdest.'/'.$oldref.'*.*');
}
}
}

View File

@ -876,7 +876,6 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
else print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/css/'.$jquerytheme.'/jquery-ui-latest.custom.css" />'."\n"; // JQuery
print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/tiptip/tipTip.css" />'."\n"; // Tooltip
print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/jnotify/jquery.jnotify-alt.min.css" />'."\n"; // JNotify
//print '<link rel="stylesheet" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/lightbox/css/jquery.lightbox-0.5.css" media="screen" />'."\n"; // Lightbox
if (! empty($conf->global->MAIN_USE_JQUERY_FILEUPLOAD)) // jQuery fileupload
{
print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/fileupload/css/jquery.fileupload-ui.css" />'."\n";
@ -903,17 +902,22 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
if (! empty($_SESSION['dol_resetcache'])) $themeparam.='&amp;dol_resetcache='.$_SESSION['dol_resetcache'];
//print 'themepath='.$themepath.' themeparam='.$themeparam;exit;
print '<link rel="stylesheet" type="text/css" title="default" href="'.$themepath.$themeparam.'">'."\n";
// CSS forced by modules (relative url starting with /)
if (isset($conf->modules_parts['css']))
{
$dircss=(array) $conf->modules_parts['css'];
foreach($dircss as $key => $cssfile)
$arraycss=(array) $conf->modules_parts['css'];
foreach($arraycss as $modcss => $filescss)
{
// cssfile is a relative path
print '<link rel="stylesheet" type="text/css" title="default" href="'.dol_buildpath($cssfile,1);
// We add params only if page is not static, because some web server setup does not return content type text/css if url has parameters, so browser cache is not used.
if (!preg_match('/\.css$/i',$cssfile)) print $themeparam;
print '"><!-- Added by module '.$key. '-->'."\n";
$filescss=(array) $filescss; // To be sure filecss is an array
foreach($filescss as $cssfile)
{
// cssfile is a relative path
print '<link rel="stylesheet" type="text/css" title="default" href="'.dol_buildpath($cssfile,1);
// We add params only if page is not static, because some web server setup does not return content type text/css if url has parameters, so browser cache is not used.
if (!preg_match('/\.css$/i',$cssfile)) print $themeparam;
print '"><!-- Added by module '.$modcss. '-->'."\n";
}
}
}
// CSS forced by page in top_htmlhead call (relative url starting with /)
@ -948,7 +952,6 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
else print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/js/jquery-ui-latest.custom.min'.$ext.'"></script>'."\n";
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/tablednd/jquery.tablednd_0_5'.$ext.'"></script>'."\n";
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/tiptip/jquery.tipTip.min'.$ext.'"></script>'."\n";
//print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/lightbox/js/jquery.lightbox-0.5.min'.$ext.'"></script>'."\n";
// jQuery Layout
if (! empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT) || defined('REQUIRE_JQUERY_LAYOUT'))
{
@ -1044,12 +1047,19 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/core/js/datepicker.js.php?lang='.$langs->defaultlang.'"></script>'."\n";
// JS forced by modules (relative url starting with /)
$dirjs=(array) $conf->modules_parts['js'];
foreach($dirjs as $key => $jsfile)
{
// jsfile is a relative path
print '<script type="text/javascript" src="'.dol_buildpath($jsfile,1).'"></script><!-- Added by module '.$key. '-->'."\n";
}
if (isset($conf->modules_parts['js'])) // $conf->modules_parts['js'] is array('module'=>array('file1','file2'))
{
$arrayjs=(array) $conf->modules_parts['js'];
foreach($arrayjs as $modjs => $filesjs)
{
$filesjs=(array) $filesjs; // To be sure filejs is an array
foreach($filesjs as $jsfile)
{
// jsfile is a relative path
print '<script type="text/javascript" src="'.dol_buildpath($jsfile,1).'"></script><!-- Added by module '.$modjs. '-->'."\n";
}
}
}
// JS forced by page in top_htmlhead (relative url starting with /)
if (is_array($arrayofjs))
{

View File

@ -106,7 +106,7 @@ class ActionsCardProduct
$this->tpl['description'] = nl2br($this->description);
// Statut
$this->tpl['status'] = $this->getLibStatut(2);
$this->tpl['status'] = $this->object->getLibStatut(2);
// Note
$this->tpl['note'] = nl2br($this->note);

View File

@ -105,7 +105,7 @@ class ActionsCardService
$this->tpl['description'] = nl2br($this->description);
// Statut
$this->tpl['status'] = $this->getLibStatut(2);
$this->tpl['status'] = $this->object->getLibStatut(2);
// Note
$this->tpl['note'] = nl2br($this->note);

View File

@ -2593,23 +2593,6 @@ class Product extends CommonObject
$pdirthumb = $pdir.'thumbs/';
$return ='<!-- Photo -->'."\n";
/*$return.="<script type=\"text/javascript\">
jQuery(function() {
jQuery('a.lightbox').lightBox({
overlayBgColor: '#888',
overlayOpacity: 0.6,
imageLoading: '".DOL_URL_ROOT."/theme/eldy/img/working.gif',
imageBtnClose: '".DOL_URL_ROOT."/theme/eldy/img/previous.png',
imageBtnPrev: '".DOL_URL_ROOT."/theme/eldy/img/1leftarrow.png',
imageBtnNext: '".DOL_URL_ROOT."/theme/eldy/img/1rightarrow.png',
containerResizeSpeed: 350,
txtImage: '".$langs->trans("Image")."',
txtOf: '".$langs->trans("on")."',
fixedNavigation:false
});
});
</script>\n";
*/
$nbphoto=0;
$dir_osencoded=dol_osencode($dir);
@ -2647,7 +2630,7 @@ class Product extends CommonObject
if ($nbbyrow) $return.= '<td width="'.ceil(100/$nbbyrow).'%" class="photo">';
$return.= "\n";
$return.= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart=product&entity='.$this->entity.'&file='.urlencode($pdir.$photo).'" class="lightbox" target="_blank">';
$return.= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart=product&entity='.$this->entity.'&file='.urlencode($pdir.$photo).'" class="aphoto" target="_blank">';
// Show image (width height=$maxHeight)
// Si fichier vignette disponible et image source trop grande, on utilise la vignette, sinon on utilise photo origine

View File

@ -170,6 +170,7 @@ if (! empty($project_ref) && ! empty($withproject))
llxHeader("",$langs->trans("Task"));
$form = new Form($db);
$userstatic = new User($db);
if ($id > 0 || ! empty($ref))
{
@ -403,17 +404,17 @@ if ($id > 0 || ! empty($ref))
print '</td>';
// User
$user->id = $task_time->fk_user;
print '<td>';
if ($_GET['action'] == 'editline' && $_GET['lineid'] == $task_time->rowid)
{
print $form->select_users($user->id,'userid_line');
print $form->select_users($task_time->fk_user,'userid_line');
}
else
{
$user->nom = $task_time->name;
$user->prenom = $task_time->firstname;
print $user->getNomUrl(1);
$userstatic->id = $task_time->fk_user;
$userstatic->nom = $task_time->name;
$userstatic->prenom = $task_time->firstname;
print $userstatic->getNomUrl(1);
}
print '</td>';