Add navigation bar on supplier orders

This commit is contained in:
Laurent Destailleur 2009-01-30 23:49:32 +00:00
parent 03c4232191
commit 4606095b1e
12 changed files with 204 additions and 104 deletions

View File

@ -809,8 +809,8 @@ class Commande extends CommonObject
/** /**
* \brief Get object and lines from database * \brief Get object and lines from database
* \param rowid id of object to load * \param id Id of object to load
* \param ref Ref of invoice * \param ref Ref of object
* \return int >0 if OK, <0 if KO * \return int >0 if OK, <0 if KO
*/ */
function fetch($id,$ref='') function fetch($id,$ref='')

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com> * Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2008 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2008 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
@ -1966,8 +1966,8 @@ else
} }
} }
// Supprimer commande // Delete order
if ($commande->statut == 0 && $user->rights->commande->supprimer) if ($user->rights->commande->supprimer)
{ {
print '<a class="butActionDelete" '; print '<a class="butActionDelete" ';
if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX) if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX)

View File

@ -476,12 +476,18 @@ $formorder = new FormOrder($db);
/* */ /* */
/* *************************************************************************** */ /* *************************************************************************** */
if ($id > 0) $now=gmmktime();
$id = $_GET['id'];
$ref= $_GET['ref'];
if ($id > 0 || ! empty($ref))
{ {
//if ($mesg) print $mesg.'<br>'; //if ($mesg) print $mesg.'<br>';
$commande = new CommandeFournisseur($db); $commande = new CommandeFournisseur($db);
if ($commande->fetch($id) >= 0) $result=$commande->fetch($_GET['id'],$_GET['ref']);
if ($result >= 0)
{ {
$soc = new Societe($db); $soc = new Societe($db);
$soc->fetch($commande->socid); $soc->fetch($commande->socid);
@ -583,20 +589,20 @@ if ($id > 0)
// Ref // Ref
print '<tr><td width="20%">'.$langs->trans("Ref").'</td>'; print '<tr><td width="20%">'.$langs->trans("Ref").'</td>';
print '<td colspan="5">'.$commande->ref.'</td>'; print '<td colspan="2">';
print $html->showrefnav($commande,'ref','',1,'ref','ref');
print '</td>';
print '</tr>'; print '</tr>';
// Fournisseur // Fournisseur
print '<tr><td width="20%">'.$langs->trans("Supplier")."</td>"; print '<tr><td width="20%">'.$langs->trans("Supplier")."</td>";
print '<td colspan="5">'; print '<td colspan="2">'.$soc->getNomUrl(1,'supplier').'</td>';
print '<b><a href="'.DOL_URL_ROOT.'/fourn/fiche.php?socid='.$soc->id.'">';
print img_object($langs->trans("ShowSupplier"),'company').' '.$soc->nom.'</a></b></td>';
print '</tr>'; print '</tr>';
// Statut // Statut
print '<tr>'; print '<tr>';
print '<td>'.$langs->trans("Status").'</td>'; print '<td>'.$langs->trans("Status").'</td>';
print '<td width="50%" colspan="5">'; print '<td width="50%" colspan="2">';
print $commande->getLibStatut(4); print $commande->getLibStatut(4);
print "</td></tr>"; print "</td></tr>";
@ -604,25 +610,22 @@ if ($id > 0)
if ($commande->methode_commande_id > 0) if ($commande->methode_commande_id > 0)
{ {
print '<tr><td>'.$langs->trans("Date").'</td><td colspan="2">'; print '<tr><td>'.$langs->trans("Date").'</td><td colspan="2">';
if ($commande->date_commande) if ($commande->date_commande)
{ {
print dolibarr_print_date($commande->date_commande,"dayhourtext")."\n"; print dolibarr_print_date($commande->date_commande,"dayhourtext")."\n";
} }
print "</td></tr>";
print '</td><td width="50%" colspan="3">';
if ($commande->methode_commande) if ($commande->methode_commande)
{ {
print $langs->trans("Method")." : " .$commande->methode_commande; print '<tr><td>'.$langs->trans("Method").'</td><td colspan="2">'.$commande->methode_commande.'</td></tr>';
} }
print "</td></tr>";
} }
// Auteur // Auteur
print '<tr><td>'.$langs->trans("AuthorRequest").'</td>'; print '<tr><td>'.$langs->trans("AuthorRequest").'</td>';
print '<td colspan="2">'.$author->getNomUrl(1).'</td>'; print '<td colspan="2">'.$author->getNomUrl(1).'</td>';
print '<td colspan="3" width="50%">'; print '</tr>';
print "&nbsp;</td></tr>";
// Projet // Projet
if ($conf->projet->enabled) if ($conf->projet->enabled)
@ -643,19 +646,20 @@ if ($id > 0)
{ {
$html->form_project($_SERVER['PHP_SELF'].'?id='.$commande->id, $commande->socid, $commande->projet_id, 'none'); $html->form_project($_SERVER['PHP_SELF'].'?id='.$commande->id, $commande->socid, $commande->projet_id, 'none');
} }
print '</td></tr>'; print '</td>';
print '</tr>';
} }
// Ligne de 3 colonnes // Ligne de 3 colonnes
print '<tr><td>'.$langs->trans("AmountHT").'</td>'; print '<tr><td>'.$langs->trans("AmountHT").'</td>';
print '<td align="right"><b>'.price($commande->total_ht).'</b></td>'; print '<td align="right"><b>'.price($commande->total_ht).'</b></td>';
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td><td colspan="3">&nbsp;</td></tr>'; print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
print '<tr><td>'.$langs->trans("AmountVAT").'</td><td align="right">'.price($commande->total_tva).'</td>'; print '<tr><td>'.$langs->trans("AmountVAT").'</td><td align="right">'.price($commande->total_tva).'</td>';
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td><td colspan="3">&nbsp;</td></tr>'; print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
print '<tr><td>'.$langs->trans("AmountTTC").'</td><td align="right">'.price($commande->total_ttc).'</td>'; print '<tr><td>'.$langs->trans("AmountTTC").'</td><td align="right">'.price($commande->total_ttc).'</td>';
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td><td colspan="3">&nbsp;</td></tr>'; print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
print "</table>"; print "</table>";

View File

@ -71,10 +71,12 @@ class CommandeFournisseur extends Commande
/** /**
* \brief Load a supplier order * \brief Get object and lines from database
* \param Id of order to load * \param id Id of order to load
* \param ref Ref of object
* \return int >0 if OK, <0 if KO
*/ */
function fetch($id) function fetch($id,$ref='')
{ {
$sql = "SELECT c.rowid, c.date_creation, c.ref, c.fk_soc, c.fk_user_author, c.fk_statut, c.amount_ht, c.total_ht, c.total_ttc, c.tva,"; $sql = "SELECT c.rowid, c.date_creation, c.ref, c.fk_soc, c.fk_user_author, c.fk_statut, c.amount_ht, c.total_ht, c.total_ttc, c.tva,";
$sql .= " ".$this->db->pdate("c.date_commande")." as date_commande, c.fk_projet as fk_project, c.remise_percent, c.source, c.fk_methode_commande,"; $sql .= " ".$this->db->pdate("c.date_commande")." as date_commande, c.fk_projet as fk_project, c.remise_percent, c.source, c.fk_methode_commande,";
@ -82,7 +84,8 @@ class CommandeFournisseur extends Commande
$sql .= " cm.libelle as methode_commande"; $sql .= " cm.libelle as methode_commande";
$sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as c"; $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as c";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_methode_commande_fournisseur as cm ON cm.rowid = c.fk_methode_commande"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_methode_commande_fournisseur as cm ON cm.rowid = c.fk_methode_commande";
$sql .= " WHERE c.rowid = ".$id; if ($ref) $sql.= " WHERE c.ref='".$ref."'";
else $sql.= " WHERE c.rowid=".$id;
dolibarr_syslog("CommandeFournisseur::fetch sql=".$sql,LOG_DEBUG); dolibarr_syslog("CommandeFournisseur::fetch sql=".$sql,LOG_DEBUG);
$resql = $this->db->query($sql) ; $resql = $this->db->query($sql) ;
@ -1083,7 +1086,7 @@ class CommandeFournisseur extends Commande
$sql.= " SET fk_statut = ".$statut; $sql.= " SET fk_statut = ".$statut;
$sql.= " WHERE rowid = ".$this->id; $sql.= " WHERE rowid = ".$this->id;
$sql.= " AND (fk_statut = 3 OR fk_statut = 4)"; $sql.= " AND (fk_statut = 3 OR fk_statut = 4)";
dolibarr_syslog("CommandeFournisseur::Livraison sql=".$sql); dolibarr_syslog("CommandeFournisseur::Livraison sql=".$sql);
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if ($resql) if ($resql)
@ -1289,7 +1292,7 @@ class CommandeFournisseur extends Commande
{ {
// Mise a jour info denormalisees au niveau facture // Mise a jour info denormalisees au niveau facture
$this->update_price(); $this->update_price();
$this->db->commit(); $this->db->commit();
return $result; return $result;
} }

View File

@ -123,7 +123,7 @@ class pdf_einstein extends ModelePDFCommandes
if ($conf->commande->dir_output) if ($conf->commande->dir_output)
{ {
// D<EFBFBD>finition de l'objet $com (pour compatibilite ascendante) // Definition de l'objet $com (pour compatibilite ascendante)
if (! is_object($com)) if (! is_object($com))
{ {
$id = $com; $id = $com;
@ -208,7 +208,7 @@ class pdf_einstein extends ModelePDFCommandes
$tab_top = 90; $tab_top = 90;
$tab_top_newpage = 50; $tab_top_newpage = 50;
$tab_height = 110; $tab_height = 110;
$tab_height_newpage = 180; $tab_height_newpage = 150;
// Affiche notes // Affiche notes
if (! empty($com->note_public)) if (! empty($com->note_public))
@ -221,7 +221,7 @@ class pdf_einstein extends ModelePDFCommandes
$nexY = $pdf->GetY(); $nexY = $pdf->GetY();
$height_note=$nexY-$tab_top; $height_note=$nexY-$tab_top;
// Rect prend une longueur en 3eme param // Rect prend une longueur en 3eme et 4eme param
$pdf->SetDrawColor(192,192,192); $pdf->SetDrawColor(192,192,192);
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1);
@ -233,9 +233,9 @@ class pdf_einstein extends ModelePDFCommandes
$height_note=0; $height_note=0;
} }
$iniY = $tab_top + 8; $iniY = $tab_top + 7;
$curY = $tab_top + 8; $curY = $tab_top + 7;
$nexY = $tab_top + 8; $nexY = $tab_top + 7;
// Boucle sur les lignes // Boucle sur les lignes
for ($i = 0 ; $i < $nblignes ; $i++) for ($i = 0 ; $i < $nblignes ; $i++)
@ -247,7 +247,7 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->SetFont('Arial','', 9); // Dans boucle pour gerer multi-page $pdf->SetFont('Arial','', 9); // Dans boucle pour gerer multi-page
// Description // Description
$pdf->writeHTMLCell($this->posxtva-$this->posxdesc-1, 3, $this->posxdesc-1, $curY, $outputlangs->convToOutputCharset($libelleproduitservice), 0, 1); $pdf->writeHTMLCell($this->posxtva-$this->posxdesc-1, 3, $this->posxdesc-1, $curY, $outputlangs->convToOutputCharset($libelleproduitservice), 0, 1);
//if ($i==1) { print $outputlangs->convToOutputCharset($libelleproduitservice);exit; } //if ($i==1) { print $outputlangs->convToOutputCharset($libelleproduitservice);exit; }
$pdf->SetFont('Arial','', 9); // On repositionne la police par defaut $pdf->SetFont('Arial','', 9); // On repositionne la police par defaut
@ -298,8 +298,18 @@ class pdf_einstein extends ModelePDFCommandes
$nblineFollowDesc = 0; $nblineFollowDesc = 0;
} }
// test si besoin nouvelle page // Test if a new page is required
if (($nexY+$nblineFollowDesc) > ($tab_top+$tab_height) && $i < ($nblignes - 1)) 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) if ($pagenb == 1)
{ {
@ -320,12 +330,12 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->MultiCell(0, 3, '', 0, 'J'); // Set interline to 3 $pdf->MultiCell(0, 3, '', 0, 'J'); // Set interline to 3
$pdf->SetTextColor(0,0,0); $pdf->SetTextColor(0,0,0);
$nexY = $tab_top_newpage + 8; $nexY = $tab_top_newpage + 7;
} }
} }
// Affiche cadre tableau // Show square
if ($pagenb == 1) if ($pagenb == 1)
{ {
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs); $this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs);
@ -333,8 +343,8 @@ class pdf_einstein extends ModelePDFCommandes
} }
else else
{ {
$this->_tableau($pdf, $tab_top_newpage, $tab_height, $nexY, $outputlangs); $this->_tableau($pdf, $tab_top_newpage, $tab_height_newpage, $nexY, $outputlangs);
$bottomlasttab=$tab_top_newpage + $tab_height + 1; $bottomlasttab=$tab_top_newpage + $tab_height_newpage + 1;
} }
// Affiche zone infos // Affiche zone infos
@ -638,7 +648,7 @@ class pdf_einstein extends ModelePDFCommandes
{ {
global $conf; global $conf;
// Montants exprim<EFBFBD>s en (en tab_top - 1) // Montants exprimes en (en tab_top - 1)
$pdf->SetTextColor(0,0,0); $pdf->SetTextColor(0,0,0);
$pdf->SetFont('Arial','',8); $pdf->SetFont('Arial','',8);
$titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->monnaie)); $titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->monnaie));
@ -646,9 +656,9 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->SetDrawColor(128,128,128); $pdf->SetDrawColor(128,128,128);
// Rect prend une longueur en 3eme param // Rect prend une longueur en 3eme et 4eme param
$pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height); $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height);
// line prend une position y en 3eme param // line prend une position y en 3eme et 4eme param
$pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); $pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5);
$pdf->SetFont('Arial','',9); $pdf->SetFont('Arial','',9);

View File

@ -207,11 +207,10 @@ class pdf_crabe extends ModelePDFFactures
$pdf->MultiCell(0, 3, '', 0, 'J'); // Set interline to 3 $pdf->MultiCell(0, 3, '', 0, 'J'); // Set interline to 3
$pdf->SetTextColor(0,0,0); $pdf->SetTextColor(0,0,0);
$pagenb = 1;
$tab_top = 90; $tab_top = 90;
$tab_top_newpage = 50; $tab_top_newpage = 50;
$tab_height = 110; $tab_height = 110;
$tab_height_newpage = 180; $tab_height_newpage = 150;
// Affiche notes // Affiche notes
if (! empty($fac->note_public)) if (! empty($fac->note_public))
@ -236,9 +235,9 @@ class pdf_crabe extends ModelePDFFactures
$height_note=0; $height_note=0;
} }
$iniY = $tab_top + 8; $iniY = $tab_top + 7;
$curY = $tab_top + 8; $curY = $tab_top + 7;
$nexY = $tab_top + 8; $nexY = $tab_top + 7;
// Loop on each lines // Loop on each lines
for ($i = 0 ; $i < $nblignes ; $i++) for ($i = 0 ; $i < $nblignes ; $i++)
@ -305,8 +304,18 @@ class pdf_crabe extends ModelePDFFactures
$nblineFollowDesc = 0; $nblineFollowDesc = 0;
} }
// test si besoin nouvelle page // Test if a new page is required
if (($nexY+$nblineFollowDesc) > ($tab_top+$tab_height) && $i < ($nblignes - 1)) 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) if ($pagenb == 1)
{ {
@ -327,14 +336,12 @@ class pdf_crabe extends ModelePDFFactures
$pdf->MultiCell(0, 3, '', 0, 'J'); // Set interline to 3 $pdf->MultiCell(0, 3, '', 0, 'J'); // Set interline to 3
$pdf->SetTextColor(0,0,0); $pdf->SetTextColor(0,0,0);
$nexY = $tab_top_newpage + 8; $nexY = $tab_top_newpage + 7;
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('Arial','', 10);
} }
} }
// Affiche cadre tableau // Show square
if ($pagenb == 1) if ($pagenb == 1)
{ {
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs); $this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs);
@ -342,8 +349,8 @@ class pdf_crabe extends ModelePDFFactures
} }
else else
{ {
$this->_tableau($pdf, $tab_top_newpage, $tab_height, $nexY, $outputlangs); $this->_tableau($pdf, $tab_top_newpage, $tab_height_newpage, $nexY, $outputlangs);
$bottomlasttab=$tab_top_newpage + $tab_height + 1; $bottomlasttab=$tab_top_newpage + $tab_height_newpage + 1;
} }
// Affiche zone infos // Affiche zone infos

View File

@ -209,11 +209,35 @@ class pdf_typhon extends ModelePDFDeliveryOrder
$tab_top = 90; $tab_top = 90;
$tab_top_newpage = 50; $tab_top_newpage = 50;
$tab_height = 150; $tab_height = 110;
$tab_height_newpage = 150;
$iniY = $tab_top + 8; // Affiche notes
$curY = $tab_top + 8; if (! empty($delivery->note_public))
$nexY = $tab_top + 8; {
$tab_top = 88;
$pdf->SetFont('Arial','', 9); // Dans boucle pour gerer multi-page
$pdf->SetXY ($this->posxdesc-1, $tab_top);
$pdf->MultiCell(190, 3, $outputlangs->convToOutputCharset($fac->note_public), 0, 'J');
$nexY = $pdf->GetY();
$height_note=$nexY-$tab_top;
// Rect prend une longueur en 3eme param
$pdf->SetDrawColor(192,192,192);
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1);
$tab_height = $tab_height - $height_note;
$tab_top = $nexY+6;
}
else
{
$height_note=0;
}
$iniY = $tab_top + 7;
$curY = $tab_top + 7;
$nexY = $tab_top + 7;
// Boucle sur les lignes // Boucle sur les lignes
for ($i = 0 ; $i < $nblignes ; $i++) for ($i = 0 ; $i < $nblignes ; $i++)
@ -263,9 +287,28 @@ class pdf_typhon extends ModelePDFDeliveryOrder
*/ */
$nexY+=2; // Passe espace entre les lignes $nexY+=2; // Passe espace entre les lignes
if ($nexY > 200 && $i < ($nblignes - 1)) // Test if a new page is required
if ($pagenb == 1)
{ {
$this->_tableau($pdf, $tab_top, $tab_height + 20, $nexY, $outputlangs); $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, $outputlangs); $this->_pagefoot($pdf, $outputlangs);
// New page // New page
@ -276,12 +319,11 @@ class pdf_typhon extends ModelePDFDeliveryOrder
$pdf->MultiCell(0, 3, '', 0, 'J'); // Set interline to 3 $pdf->MultiCell(0, 3, '', 0, 'J'); // Set interline to 3
$pdf->SetTextColor(0,0,0); $pdf->SetTextColor(0,0,0);
$nexY = $tab_top_newpage + 8; $nexY = $tab_top_newpage + 7;
} }
} }
// Affiche cadre tableau // Show square
if ($pagenb == 1) if ($pagenb == 1)
{ {
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs); $this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs);
@ -289,10 +331,11 @@ class pdf_typhon extends ModelePDFDeliveryOrder
} }
else else
{ {
$this->_tableau($pdf, $tab_top_newpage, $tab_height, $nexY, $outputlangs); $this->_tableau($pdf, $tab_top_newpage, $tab_height_newpage, $nexY, $outputlangs);
$bottomlasttab=$tab_top_newpage + $tab_height + 1; $bottomlasttab=$tab_top_newpage + $tab_height_newpage + 1;
} }
/* /*
* Pied de page * Pied de page
*/ */

View File

@ -206,10 +206,11 @@ class pdf_propale_azur extends ModelePDFPropales
$pdf->SetTextColor(0,0,0); $pdf->SetTextColor(0,0,0);
$tab_top = 90; $tab_top = 90;
$tab_top_middlepage = 50;
$tab_top_newpage = 50; $tab_top_newpage = 50;
$tab_height = 110; $tab_height = 110;
$tab_height_newpage = 150;
$tab_height_middlepage = 190; $tab_height_middlepage = 190;
$tab_height_newpage = 150;
// Affiche notes // Affiche notes
if (! empty($propale->note_public)) if (! empty($propale->note_public))
@ -234,9 +235,9 @@ class pdf_propale_azur extends ModelePDFPropales
$height_note=0; $height_note=0;
} }
$iniY = $tab_top + 8; $iniY = $tab_top + 7;
$curY = $tab_top + 8; $curY = $tab_top + 7;
$nexY = $tab_top + 8; $nexY = $tab_top + 7;
// Loop on each lines // Loop on each lines
for ($i = 0 ; $i < $nblignes ; $i++) for ($i = 0 ; $i < $nblignes ; $i++)
@ -308,16 +309,26 @@ class pdf_propale_azur extends ModelePDFPropales
$nblineFollowDesc = 0; $nblineFollowDesc = 0;
} }
// test si besoin nouvelle page // Test if a new page is required
if (($nexY+$nblineFollowDesc) > ($tab_top+$tab_height) && $i < ($nblignes - 1)) 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) if ($pagenb == 1)
{ {
$this->_tableau($pdf, $tab_top, $tab_height_newpage, $nexY, $outputlangs); $this->_tableau($pdf, $tab_top, $tab_height + 20, $nexY, $outputlangs);
} }
else else
{ {
$this->_tableau($pdf, $tab_top_newpage, $tab_height_middlepage, $nexY, $outputlangs); $this->_tableau($pdf, $tab_top_newpage, $tab_height_newpage, $nexY, $outputlangs);
} }
$this->_pagefoot($pdf,$outputlangs); $this->_pagefoot($pdf,$outputlangs);
@ -330,12 +341,12 @@ class pdf_propale_azur extends ModelePDFPropales
$pdf->MultiCell(0, 4, '', 0, 'J'); // Set interline to 3 $pdf->MultiCell(0, 4, '', 0, 'J'); // Set interline to 3
$pdf->SetTextColor(0,0,0); $pdf->SetTextColor(0,0,0);
$nexY = $tab_top_newpage + 8; $nexY = $tab_top_newpage + 7;
} }
} }
// Affiche cadre tableau // Show square
if ($pagenb == 1) if ($pagenb == 1)
{ {
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs); $this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs);

View File

@ -210,7 +210,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$tab_top = 90; $tab_top = 90;
$tab_top_newpage = 50; $tab_top_newpage = 50;
$tab_height = 110; $tab_height = 110;
$tab_height_newpage = 180; $tab_height_newpage = 150;
// Affiche notes // Affiche notes
if (! empty($com->note_public)) if (! empty($com->note_public))
@ -235,9 +235,9 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$height_note=0; $height_note=0;
} }
$iniY = $tab_top + 8; $iniY = $tab_top + 7;
$curY = $tab_top + 8; $curY = $tab_top + 7;
$nexY = $tab_top + 8; $nexY = $tab_top + 7;
// Boucle sur les lignes // Boucle sur les lignes
for ($i = 0 ; $i < $nblignes ; $i++) for ($i = 0 ; $i < $nblignes ; $i++)
@ -288,9 +288,28 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$nexY+=2; // Passe espace entre les lignes $nexY+=2; // Passe espace entre les lignes
if ($nexY > 200 && $i < ($nblignes - 1)) // Test if a new page is required
if ($pagenb == 1)
{ {
$this->_tableau($pdf, $tab_top, $tab_height + 20, $nexY, $outputlangs); $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, $outputlangs); $this->_pagefoot($pdf, $outputlangs);
// New page // New page
@ -301,11 +320,12 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$pdf->MultiCell(0, 3, '', 0, 'J'); // Set interline to 3 $pdf->MultiCell(0, 3, '', 0, 'J'); // Set interline to 3
$pdf->SetTextColor(0,0,0); $pdf->SetTextColor(0,0,0);
$nexY = $tab_top_newpage + 8; $nexY = $tab_top_newpage + 7;
} }
} }
// Affiche cadre tableau
// Show square
if ($pagenb == 1) if ($pagenb == 1)
{ {
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs); $this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs);
@ -313,20 +333,19 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
} }
else else
{ {
$this->_tableau($pdf, $tab_top_newpage, $tab_height, $nexY, $outputlangs); $this->_tableau($pdf, $tab_top_newpage, $tab_height_newpage, $nexY, $outputlangs);
$bottomlasttab=$tab_top_newpage + $tab_height + 1; $bottomlasttab=$tab_top_newpage + $tab_height_newpage + 1;
} }
$deja_regle = "";
$posy=$this->_tableau_tot($pdf, $com, $deja_regle, $bottomlasttab, $outputlangs); $posy=$this->_tableau_tot($pdf, $com, $deja_regle, $bottomlasttab, $outputlangs);
if ($deja_regle) { if ($deja_regle)
{
$this->_tableau_versements($pdf, $fac, $posy); $this->_tableau_versements($pdf, $fac, $posy);
} }
/* /*
* Mode de r<EFBFBD>glement * Mode de reglement
*/ */
if ((! defined("FACTURE_CHQ_NUMBER") || ! FACTURE_CHQ_NUMBER) && (! defined("FACTURE_RIB_NUMBER") || ! FACTURE_RIB_NUMBER)) if ((! defined("FACTURE_CHQ_NUMBER") || ! FACTURE_CHQ_NUMBER) && (! defined("FACTURE_RIB_NUMBER") || ! FACTURE_RIB_NUMBER))
{ {

View File

@ -39,7 +39,7 @@ PMPValue=Value
EnhancedValueOfWarehouses=Warehouses value EnhancedValueOfWarehouses=Warehouses value
UserWarehouseAutoCreate=Create a stock automatically when creating a user UserWarehouseAutoCreate=Create a stock automatically when creating a user
QtyDispatched=Quantity dispatched QtyDispatched=Quantity dispatched
OrderDispatch=Order dispatching OrderDispatch=Stock dispatching
RuleForStockManagementDecrease=Rule for stock management decrease RuleForStockManagementDecrease=Rule for stock management decrease
RuleForStockManagementIncrease=Rule for stock management increase RuleForStockManagementIncrease=Rule for stock management increase
DeStockOnBill=Decrease real stocks on invoices/credit notes validation (warning, in this version, it's only in warehouse number 1 that stock is modified) DeStockOnBill=Decrease real stocks on invoices/credit notes validation (warning, in this version, it's only in warehouse number 1 that stock is modified)

View File

@ -39,7 +39,7 @@ PMPValue=Valorisation (PMP)
EnhancedValueOfWarehouses=Valorisation des stocks EnhancedValueOfWarehouses=Valorisation des stocks
UserWarehouseAutoCreate=Créer un stock automatiquement à la création d'un utilisateur UserWarehouseAutoCreate=Créer un stock automatiquement à la création d'un utilisateur
QtyDispatched=Quantité ventilée QtyDispatched=Quantité ventilée
OrderDispatch=Ventilation commande OrderDispatch=Réception vers stocks
RuleForStockManagementDecrease=Règle de gestion des décrémentations de stock RuleForStockManagementDecrease=Règle de gestion des décrémentations de stock
RuleForStockManagementIncrease=Règle de gestion des incrémentations de stock RuleForStockManagementIncrease=Règle de gestion des incrémentations de stock
DeStockOnBill=Décrémente les stocks physiques sur validation des factures/avoirs (attention, dans cette version, c'est toujours dans le premier entrepot numero 1 que se fait l'ajustement) DeStockOnBill=Décrémente les stocks physiques sur validation des factures/avoirs (attention, dans cette version, c'est toujours dans le premier entrepot numero 1 que se fait l'ajustement)

View File

@ -29,7 +29,7 @@ function facturefourn_prepare_head($fac)
global $langs, $conf; global $langs, $conf;
$h = 0; $h = 0;
$head = array(); $head = array();
$head[$h][0] = DOL_URL_ROOT.'/fourn/facture/fiche.php?facid='.$fac->id; $head[$h][0] = DOL_URL_ROOT.'/fourn/facture/fiche.php?facid='.$fac->id;
$head[$h][1] = $langs->trans('Card'); $head[$h][1] = $langs->trans('Card');
$head[$h][2] = 'card'; $head[$h][2] = 'card';
@ -39,7 +39,7 @@ function facturefourn_prepare_head($fac)
$head[$h][1] = $langs->trans('BillContacts'); $head[$h][1] = $langs->trans('BillContacts');
$head[$h][2] = 'contact'; $head[$h][2] = 'contact';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/fourn/facture/note.php?facid='.$fac->id; $head[$h][0] = DOL_URL_ROOT.'/fourn/facture/note.php?facid='.$fac->id;
$head[$h][1] = $langs->trans('Notes'); $head[$h][1] = $langs->trans('Notes');
$head[$h][2] = 'note'; $head[$h][2] = 'note';
@ -69,7 +69,7 @@ function facturefourn_prepare_head($fac)
$h++; $h++;
} }
} }
return $head; return $head;
} }
@ -79,16 +79,19 @@ function ordersupplier_prepare_head($commande)
global $langs, $conf; global $langs, $conf;
$h = 0; $h = 0;
$head = array(); $head = array();
$head[$h][0] = DOL_URL_ROOT.'/fourn/commande/fiche.php?id='.$commande->id; $head[$h][0] = DOL_URL_ROOT.'/fourn/commande/fiche.php?id='.$commande->id;
$head[$h][1] = $langs->trans("OrderCard"); $head[$h][1] = $langs->trans("OrderCard");
$head[$h][2] = 'card'; $head[$h][2] = 'card';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/fourn/commande/dispatch.php?id='.$commande->id; if ($conf->stock->enabled)
$head[$h][1] = $langs->trans("OrderDispatch"); {
$head[$h][2] = 'dispatch'; $head[$h][0] = DOL_URL_ROOT.'/fourn/commande/dispatch.php?id='.$commande->id;
$h++; $head[$h][1] = $langs->trans("OrderDispatch");
$head[$h][2] = 'dispatch';
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/fourn/commande/note.php?id='.$commande->id; $head[$h][0] = DOL_URL_ROOT.'/fourn/commande/note.php?id='.$commande->id;
$head[$h][1] = $langs->trans("Note"); $head[$h][1] = $langs->trans("Note");
@ -99,7 +102,7 @@ function ordersupplier_prepare_head($commande)
$head[$h][1] = $langs->trans("Documents"); $head[$h][1] = $langs->trans("Documents");
$head[$h][2] = 'documents'; $head[$h][2] = 'documents';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/fourn/commande/history.php?id='.$commande->id; $head[$h][0] = DOL_URL_ROOT.'/fourn/commande/history.php?id='.$commande->id;
$head[$h][1] = $langs->trans("OrderFollow"); $head[$h][1] = $langs->trans("OrderFollow");
$head[$h][2] = 'info'; $head[$h][2] = 'info';
@ -119,7 +122,7 @@ function ordersupplier_prepare_head($commande)
$h++; $h++;
} }
} }
return $head; return $head;
} }