Qual: Factorize redundant code

This commit is contained in:
Laurent Destailleur 2008-11-20 23:51:22 +00:00
parent 5e016e8f11
commit 77cc4a1b56
8 changed files with 90 additions and 222 deletions

View File

@ -148,7 +148,7 @@ $form = new Form($db);
/* ************************************************************************** */ /* ************************************************************************** */
/* */ /* */
/* Affichage page en mode cr<EFBFBD>ation */ /* Affichage page en mode creation */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */

View File

@ -536,46 +536,12 @@ class pdf_einstein extends ModelePDFCommandes
$account = new Account($this->db); $account = new Account($this->db);
$account->fetch($conf->global->FACTURE_RIB_NUMBER); $account->fetch($conf->global->FACTURE_RIB_NUMBER);
$this->marges['g']=$this->marge_gauche; $curx=$this->marge_gauche;
$cury=$posy;
$cury=$posy; $posy=pdf_bank($pdf,$outputlangs,$curx,$cury,$account);
$pdf->SetXY ($this->marges['g'], $cury);
$pdf->SetFont('Arial','B',8);
$pdf->MultiCell(90, 3, $outputlangs->transnoentities('PaymentByTransferOnThisBankAccount').':', 0, 'L', 0);
$cury+=4;
$pdf->SetFont('Arial','B',6);
$pdf->line($this->marges['g']+1, $cury, $this->marges['g']+1, $cury+10 );
$pdf->SetXY ($this->marges['g'], $cury);
$pdf->MultiCell(18, 3, $outputlangs->transnoentities("BankCode"), 0, 'C', 0);
$pdf->line($this->marges['g']+18, $cury, $this->marges['g']+18, $cury+10 );
$pdf->SetXY ($this->marges['g']+18, $cury);
$pdf->MultiCell(18, 3, $outputlangs->transnoentities("DeskCode"), 0, 'C', 0);
$pdf->line($this->marges['g']+36, $cury, $this->marges['g']+36, $cury+10 );
$pdf->SetXY ($this->marges['g']+36, $cury);
$pdf->MultiCell(24, 3, $outputlangs->transnoentities("BankAccountNumber"), 0, 'C', 0);
$pdf->line($this->marges['g']+60, $cury, $this->marges['g']+60, $cury+10 );
$pdf->SetXY ($this->marges['g']+60, $cury);
$pdf->MultiCell(13, 3, $outputlangs->transnoentities("BankAccountNumberKey"), 0, 'C', 0);
$pdf->line($this->marges['g']+73, $cury, $this->marges['g']+73, $cury+10 );
$pdf->SetFont('Arial','',8); $posy+=2;
$pdf->SetXY ($this->marges['g'], $cury+5);
$pdf->MultiCell(18, 3, $account->code_banque, 0, 'C', 0);
$pdf->SetXY ($this->marges['g']+18, $cury+5);
$pdf->MultiCell(18, 3, $account->code_guichet, 0, 'C', 0);
$pdf->SetXY ($this->marges['g']+36, $cury+5);
$pdf->MultiCell(24, 3, $account->number, 0, 'C', 0);
$pdf->SetXY ($this->marges['g']+60, $cury+5);
$pdf->MultiCell(13, 3, $account->cle_rib, 0, 'C', 0);
$pdf->SetXY ($this->marges['g'], $cury+12);
$pdf->MultiCell(90, 3, $outputlangs->transnoentities("Residence").' : ' . $account->domiciliation, 0, 'L', 0);
$pdf->SetXY ($this->marges['g'], $cury+22);
$pdf->MultiCell(90, 3, $outputlangs->transnoentities("IbanPrefix").' : ' . $account->iban_prefix, 0, 'L', 0);
$pdf->SetXY ($this->marges['g'], $cury+25);
$pdf->MultiCell(90, 3, $outputlangs->transnoentities("BIC").' : ' . $account->bic, 0, 'L', 0);
$posy=$pdf->GetY()+2;
} }
} }
} }

View File

@ -696,46 +696,12 @@ class pdf_crabe extends ModelePDFFactures
$account = new Account($this->db); $account = new Account($this->db);
$account->fetch($conf->global->FACTURE_RIB_NUMBER); $account->fetch($conf->global->FACTURE_RIB_NUMBER);
$this->marges['g']=$this->marge_gauche; $curx=$this->marge_gauche;
$cury=$posy; $cury=$posy;
$pdf->SetXY ($this->marges['g'], $cury);
$pdf->SetFont('Arial','B',8); $posy=pdf_bank($pdf,$outputlangs,$curx,$cury,$account);
$pdf->MultiCell(90, 3, $outputlangs->transnoentities('PaymentByTransferOnThisBankAccount').':', 0, 'L', 0);
$cury+=4; $posy+=2;
$pdf->SetFont('Arial','B',6);
$pdf->line($this->marges['g']+1, $cury, $this->marges['g']+1, $cury+10 );
$pdf->SetXY ($this->marges['g'], $cury);
$pdf->MultiCell(18, 3, $outputlangs->transnoentities("BankCode"), 0, 'C', 0);
$pdf->line($this->marges['g']+18, $cury, $this->marges['g']+18, $cury+10 );
$pdf->SetXY ($this->marges['g']+18, $cury);
$pdf->MultiCell(18, 3, $outputlangs->transnoentities("DeskCode"), 0, 'C', 0);
$pdf->line($this->marges['g']+36, $cury, $this->marges['g']+36, $cury+10 );
$pdf->SetXY ($this->marges['g']+36, $cury);
$pdf->MultiCell(24, 3, $outputlangs->transnoentities("BankAccountNumber"), 0, 'C', 0);
$pdf->line($this->marges['g']+60, $cury, $this->marges['g']+60, $cury+10 );
$pdf->SetXY ($this->marges['g']+60, $cury);
$pdf->MultiCell(13, 3, $outputlangs->transnoentities("BankAccountNumberKey"), 0, 'C', 0);
$pdf->line($this->marges['g']+73, $cury, $this->marges['g']+73, $cury+10 );
$pdf->SetFont('Arial','',8);
$pdf->SetXY ($this->marges['g'], $cury+5);
$pdf->MultiCell(18, 3, $outputlangs->convToOutputCharset($account->code_banque), 0, 'C', 0);
$pdf->SetXY ($this->marges['g']+18, $cury+5);
$pdf->MultiCell(18, 3, $outputlangs->convToOutputCharset($account->code_guichet), 0, 'C', 0);
$pdf->SetXY ($this->marges['g']+36, $cury+5);
$pdf->MultiCell(24, 3, $outputlangs->convToOutputCharset($account->number), 0, 'C', 0);
$pdf->SetXY ($this->marges['g']+60, $cury+5);
$pdf->MultiCell(13, 3, $outputlangs->convToOutputCharset($account->cle_rib), 0, 'C', 0);
$pdf->SetXY ($this->marges['g'], $cury+12);
$pdf->MultiCell(90, 3, $outputlangs->transnoentities("Residence").' : ' . $outputlangs->convToOutputCharset($account->domiciliation), 0, 'L', 0);
$pdf->SetXY ($this->marges['g'], $cury+22);
$pdf->MultiCell(90, 3, $outputlangs->transnoentities("IbanPrefix").' : ' . $outputlangs->convToOutputCharset($account->iban_prefix), 0, 'L', 0);
$pdf->SetXY ($this->marges['g'], $cury+25);
$pdf->MultiCell(90, 3, $outputlangs->transnoentities("BIC").' : ' . $outputlangs->convToOutputCharset($account->bic), 0, 'L', 0);
$posy=$pdf->GetY()+2;
} }
} }
} }

View File

@ -227,17 +227,10 @@ class pdf_huitre extends ModelePDFFactures
$account = new Account($this->db); $account = new Account($this->db);
$account->fetch(FACTURE_RIB_NUMBER); $account->fetch(FACTURE_RIB_NUMBER);
$pdf->SetXY (10, 40); $curx=10;
$pdf->SetFont('Arial','U',8); $cury=40;
$pdf->MultiCell(40, 4, $outputlangs->transnoentities("BankDetails"), 0, 'L', 0);
$pdf->SetFont('Arial','',8); $posy=pdf_bank($pdf,$outputlangs,$curx,$cury,$account);
$pdf->MultiCell(40, 4, $outputlangs->transnoentities("BankCode").' : ' . $outputlangs->convToOutputCharset($account->code_banque), 0, 'L', 0);
$pdf->MultiCell(40, 4, $outputlangs->transnoentities("DeskCode").' : ' . $outputlangs->convToOutputCharset($account->code_guichet), 0, 'L', 0);
$pdf->MultiCell(50, 4, $outputlangs->transnoentities("BankAccountNumber").' : ' . $outputlangs->convToOutputCharset($account->number), 0, 'L', 0);
$pdf->MultiCell(40, 4, $outputlangs->transnoentities("BankAccountNumberKey").' : ' . $outputlangs->convToOutputCharset($account->cle_rib), 0, 'L', 0);
$pdf->MultiCell(40, 4, $outputlangs->transnoentities("Residence").' : ' . $outputlangs->convToOutputCharset($account->domiciliation), 0, 'L', 0);
$pdf->MultiCell(40, 4, $outputlangs->transnoentities("IbanPrefix").' : ' . $outputlangs->convToOutputCharset($account->iban_prefix), 0, 'L', 0);
$pdf->MultiCell(40, 4, $outputlangs->transnoentities("BIC").' : ' . $outputlangs->convToOutputCharset($account->bic), 0, 'L', 0);
} }
} }

View File

@ -270,7 +270,7 @@ class pdf_oursin extends ModelePDFFactures
$pdf->SetTextColor(0,0,0); $pdf->SetTextColor(0,0,0);
} }
// Propose mode r<EFBFBD>glement par CHQ // Propose mode reglement par CHQ
if (defined("FACTURE_CHQ_NUMBER")) if (defined("FACTURE_CHQ_NUMBER"))
{ {
if (FACTURE_CHQ_NUMBER > 0) if (FACTURE_CHQ_NUMBER > 0)
@ -287,7 +287,7 @@ class pdf_oursin extends ModelePDFFactures
} }
} }
// Propose mode r<EFBFBD>glement par RIB // Propose mode reglement par RIB
if (defined("FACTURE_RIB_NUMBER")) if (defined("FACTURE_RIB_NUMBER"))
{ {
if (FACTURE_RIB_NUMBER > 0) if (FACTURE_RIB_NUMBER > 0)
@ -296,45 +296,13 @@ class pdf_oursin extends ModelePDFFactures
$account->fetch(FACTURE_RIB_NUMBER); $account->fetch(FACTURE_RIB_NUMBER);
$cury=240; $cury=240;
$pdf->SetXY ($this->marges['g'], $cury); $curx=$this->marges['g'];
$pdf->SetFont('Arial','B',8);
$pdf->MultiCell(90, 3, $outputlangs->transnoentities('PaymentByTransferOnThisBankAccount').':', 0, 'L', 0);
$cury=245;
$pdf->SetFont('Arial','B',6);
$pdf->line($this->marges['g'], $cury, $this->marges['g'], $cury+10 );
$pdf->SetXY ($this->marges['g'], $cury);
$pdf->MultiCell(18, 3, $outputlangs->transnoentities("BankCode"), 0, 'C', 0);
$pdf->line($this->marges['g']+18, $cury, $this->marges['g']+18, $cury+10 );
$pdf->SetXY ($this->marges['g']+18, $cury);
$pdf->MultiCell(18, 3, $outputlangs->transnoentities("DeskCode"), 0, 'C', 0);
$pdf->line($this->marges['g']+36, $cury, $this->marges['g']+36, $cury+10 );
$pdf->SetXY ($this->marges['g']+36, $cury);
$pdf->MultiCell(24, 3, $outputlangs->transnoentities("BankAccountNumber"), 0, 'C', 0);
$pdf->line($this->marges['g']+60, $cury, $this->marges['g']+60, $cury+10 );
$pdf->SetXY ($this->marges['g']+60, $cury);
$pdf->MultiCell(13, 3, $outputlangs->transnoentities("BankAccountNumberKey"), 0, 'C', 0);
$pdf->line($this->marges['g']+73, $cury, $this->marges['g']+73, $cury+10 );
$pdf->SetFont('Arial','',8); $posy=pdf_bank($pdf,$outputlangs,$curx,$cury,$account);
$pdf->SetXY ($this->marges['g'], $cury+5);
$pdf->MultiCell(18, 3, $account->code_banque, 0, 'C', 0);
$pdf->SetXY ($this->marges['g']+18, $cury+5);
$pdf->MultiCell(18, 3, $account->code_guichet, 0, 'C', 0);
$pdf->SetXY ($this->marges['g']+36, $cury+5);
$pdf->MultiCell(24, 3, $account->number, 0, 'C', 0);
$pdf->SetXY ($this->marges['g']+60, $cury+5);
$pdf->MultiCell(13, 3, $account->cle_rib, 0, 'C', 0);
$pdf->SetXY ($this->marges['g'], $cury+14);
$pdf->MultiCell(90, 3, $outputlangs->transnoentities("Residence").' : ' . $outputlangs->convToOutputCharset($account->domiciliation), 0, 'L', 0);
$pdf->SetXY ($this->marges['g'], $cury+19);
$pdf->MultiCell(90, 3, $outputlangs->transnoentities("IbanPrefix").' : ' . $outputlangs->convToOutputCharset($account->iban_prefix), 0, 'L', 0);
$pdf->SetXY ($this->marges['g'], $cury+24);
$pdf->MultiCell(90, 3, $outputlangs->transnoentities("BIC").' : ' . $outputlangs->convToOutputCharset($account->bic), 0, 'L', 0);
} }
} }
// Conditions de r<EFBFBD>glements // Conditions de reglements
if ($fac->cond_reglement_code) if ($fac->cond_reglement_code)
{ {
$pdf->SetFont('Arial','B',10); $pdf->SetFont('Arial','B',10);
@ -729,10 +697,10 @@ class pdf_oursin extends ModelePDFFactures
$pdf->SetFont('Arial','B',11); $pdf->SetFont('Arial','B',11);
$fac->fetch_client(); $fac->fetch_client();
$pdf->SetXY($this->marges['g']+100,$posy+4); $pdf->SetXY($this->marges['g']+100,$posy+4);
$pdf->MultiCell(86,4, $fac->client->nom, 0, 'L'); $pdf->MultiCell(86,4, $outputlangs->transnoentities($fac->client->nom), 0, 'L');
$pdf->SetFont('Arial','B',10); $pdf->SetFont('Arial','B',10);
$pdf->SetXY($this->marges['g']+100,$posy+12); $pdf->SetXY($this->marges['g']+100,$posy+12);
$pdf->MultiCell(86,4, $fac->client->adresse . "\n\n" . $fac->client->cp . " " . $fac->client->ville); $pdf->MultiCell(86,4, $outputlangs->transnoentities($fac->client->adresse) . "\n\n" . $outputlangs->transnoentities($fac->client->cp) . " " . $outputlangs->transnoentities($fac->client->ville));
/* /*
* ref facture * ref facture
@ -745,7 +713,7 @@ class pdf_oursin extends ModelePDFFactures
$pdf->SetFont('Arial','B',11); $pdf->SetFont('Arial','B',11);
$pdf->SetXY($this->marges['g'],$posy+6); $pdf->SetXY($this->marges['g'],$posy+6);
$pdf->SetTextColor(22,137,210); $pdf->SetTextColor(22,137,210);
$pdf->MultiCell(100, 10, $outputlangs->transnoentities("RefBill")." : " . $fac->ref, '', 'L'); $pdf->MultiCell(100, 10, $outputlangs->transnoentities("RefBill")." : " . $outputlangs->transnoentities($fac->ref), '', 'L');
$pdf->SetTextColor(0,0,0); $pdf->SetTextColor(0,0,0);
/* /*

View File

@ -546,46 +546,12 @@ class pdf_propale_azur extends ModelePDFPropales
$account = new Account($this->db); $account = new Account($this->db);
$account->fetch($conf->global->FACTURE_RIB_NUMBER); $account->fetch($conf->global->FACTURE_RIB_NUMBER);
$this->marges['g']=$this->marge_gauche; $curx=$this->marge_gauche;
$cury=$posy;
$cury=$posy; $posy=pdf_bank($pdf,$outputlangs,$curx,$cury,$account);
$pdf->SetXY ($this->marges['g'], $cury);
$pdf->SetFont('Arial','B',8);
$pdf->MultiCell(90, 3, $outputlangs->transnoentities('PaymentByTransferOnThisBankAccount').':', 0, 'L', 0);
$cury+=4;
$pdf->SetFont('Arial','B',6);
$pdf->line($this->marges['g']+1, $cury, $this->marges['g']+1, $cury+10 );
$pdf->SetXY ($this->marges['g'], $cury);
$pdf->MultiCell(18, 3, $outputlangs->transnoentities("BankCode"), 0, 'C', 0);
$pdf->line($this->marges['g']+18, $cury, $this->marges['g']+18, $cury+10 );
$pdf->SetXY ($this->marges['g']+18, $cury);
$pdf->MultiCell(18, 3, $outputlangs->transnoentities("DeskCode"), 0, 'C', 0);
$pdf->line($this->marges['g']+36, $cury, $this->marges['g']+36, $cury+10 );
$pdf->SetXY ($this->marges['g']+36, $cury);
$pdf->MultiCell(24, 3, $outputlangs->transnoentities("BankAccountNumber"), 0, 'C', 0);
$pdf->line($this->marges['g']+60, $cury, $this->marges['g']+60, $cury+10 );
$pdf->SetXY ($this->marges['g']+60, $cury);
$pdf->MultiCell(13, 3, $outputlangs->transnoentities("BankAccountNumberKey"), 0, 'C', 0);
$pdf->line($this->marges['g']+73, $cury, $this->marges['g']+73, $cury+10 );
$pdf->SetFont('Arial','',8); $posy+=2;
$pdf->SetXY ($this->marges['g'], $cury+5);
$pdf->MultiCell(18, 3, $outputlangs->convToOutputCharset($account->code_banque), 0, 'C', 0);
$pdf->SetXY ($this->marges['g']+18, $cury+5);
$pdf->MultiCell(18, 3, $outputlangs->convToOutputCharset($account->code_guichet), 0, 'C', 0);
$pdf->SetXY ($this->marges['g']+36, $cury+5);
$pdf->MultiCell(24, 3, $outputlangs->convToOutputCharset($account->number), 0, 'C', 0);
$pdf->SetXY ($this->marges['g']+60, $cury+5);
$pdf->MultiCell(13, 3, $outputlangs->convToOutputCharset($account->cle_rib), 0, 'C', 0);
$pdf->SetXY ($this->marges['g'], $cury+12);
$pdf->MultiCell(90, 3, $outputlangs->transnoentities("Residence").' : ' . $outputlangs->convToOutputCharset($account->domiciliation), 0, 'L', 0);
$pdf->SetXY ($this->marges['g'], $cury+22);
$pdf->MultiCell(90, 3, $outputlangs->transnoentities("IbanPrefix").' : ' . $outputlangs->convToOutputCharset($account->iban_prefix), 0, 'L', 0);
$pdf->SetXY ($this->marges['g'], $cury+25);
$pdf->MultiCell(90, 3, $outputlangs->transnoentities("BIC").' : ' . $outputlangs->convToOutputCharset($account->bic), 0, 'L', 0);
$posy=$pdf->GetY()+2;
} }
} }
} }

View File

@ -368,7 +368,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
*/ */
/* /*
* Propose mode r<EFBFBD>glement par RIB * Propose mode reglement par RIB
*/ */
/* /*
if (defined("FACTURE_RIB_NUMBER")) if (defined("FACTURE_RIB_NUMBER"))
@ -378,45 +378,10 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$account = new Account($this->db); $account = new Account($this->db);
$account->fetch(FACTURE_RIB_NUMBER); $account->fetch(FACTURE_RIB_NUMBER);
$this->marges['g']=$this->marge_gauche; $curx=$this->marge_gauche;
$cury=242; $cury=242;
$pdf->SetXY ($this->marges['g'], $cury);
$pdf->SetFont('Arial','B',8);
$pdf->MultiCell(90, 3, "R<EFBFBD>glement par virement sur le compte bancaire suivant:", 0, 'L', 0);
$cury+=4;
$pdf->SetFont('Arial','B',6);
$pdf->line($this->marges['g']+1, $cury, $this->marges['g']+1, $cury+10 );
$pdf->SetXY ($this->marges['g'], $cury);
$pdf->MultiCell(18, 3, "Code banque", 0, 'C', 0);
$pdf->line($this->marges['g']+18, $cury, $this->marges['g']+18, $cury+10 );
$pdf->SetXY ($this->marges['g']+18, $cury);
$pdf->MultiCell(18, 3, "Code guichet", 0, 'C', 0);
$pdf->line($this->marges['g']+36, $cury, $this->marges['g']+36, $cury+10 );
$pdf->SetXY ($this->marges['g']+36, $cury);
$pdf->MultiCell(24, 3, "Num<EFBFBD>ro compte", 0, 'C', 0);
$pdf->line($this->marges['g']+60, $cury, $this->marges['g']+60, $cury+10 );
$pdf->SetXY ($this->marges['g']+60, $cury);
$pdf->MultiCell(13, 3, "Cl<EFBFBD> RIB", 0, 'C', 0);
$pdf->line($this->marges['g']+73, $cury, $this->marges['g']+73, $cury+10 );
$pdf->SetFont('Arial','',8);
$pdf->SetXY ($this->marges['g'], $cury+5);
$pdf->MultiCell(18, 3, $account->code_banque, 0, 'C', 0);
$pdf->SetXY ($this->marges['g']+18, $cury+5);
$pdf->MultiCell(18, 3, $account->code_guichet, 0, 'C', 0);
$pdf->SetXY ($this->marges['g']+36, $cury+5);
$pdf->MultiCell(24, 3, $account->number, 0, 'C', 0);
$pdf->SetXY ($this->marges['g']+60, $cury+5);
$pdf->MultiCell(13, 3, $account->cle_rib, 0, 'C', 0);
$pdf->SetXY ($this->marges['g'], $cury+12);
$pdf->MultiCell(90, 3, "Domiciliation : " . $account->domiciliation, 0, 'L', 0);
$pdf->SetXY ($this->marges['g'], $cury+22);
$pdf->MultiCell(90, 3, $outputlangs->trans("IBAN")." : " . $account->iban_prefix, 0, 'L', 0);
$pdf->SetXY ($this->marges['g'], $cury+25);
$pdf->MultiCell(90, 3, $outputlangs->trans("BIC")." : " . $account->bic, 0, 'L', 0);
pdf_bank($pdf,$outputlangs,$curx,$cury,$account);
} }
} }
*/ */
@ -602,7 +567,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
{ {
global $conf; global $conf;
// Montants exprim<69>s en (en tab_top - 1) // Montants exprim<69>s 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->transnoentities("Currency".$conf->monnaie)); $titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentities("Currency".$conf->monnaie));

View File

@ -241,7 +241,7 @@ function getFormeJuridiqueLabel($code)
* \param conf Object conf * \param conf Object conf
* \param lang Object lang * \param lang Object lang
* \param db Database handler * \param db Database handler
* \param objsoc Third party object * \param objsoc Third party object
*/ */
function show_contacts($conf,$langs,$db,$objsoc) function show_contacts($conf,$langs,$db,$objsoc)
{ {
@ -286,7 +286,7 @@ function show_contacts($conf,$langs,$db,$objsoc)
$var = !$var; $var = !$var;
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
print '<td>'; print '<td>';
$contactstatic->id = $obj->rowid; $contactstatic->id = $obj->rowid;
$contactstatic->name = $obj->name; $contactstatic->name = $obj->name;
@ -324,7 +324,7 @@ function show_contacts($conf,$langs,$db,$objsoc)
print img_object($langs->trans("Rendez-Vous"),"action"); print img_object($langs->trans("Rendez-Vous"),"action");
print '</a></td>'; print '</a></td>';
} }
print "</tr>\n"; print "</tr>\n";
$i++; $i++;
} }
@ -359,7 +359,7 @@ function show_actions_todo($conf,$langs,$db,$objsoc,$objcon='')
$actionstatic=new ActionComm($db); $actionstatic=new ActionComm($db);
$userstatic=new User($db); $userstatic=new User($db);
$contactstatic = new Contact($db); $contactstatic = new Contact($db);
if (is_object($objcon) && $objcon->id) print_titre($langs->trans("TasksHistoryForThisContact")); if (is_object($objcon) && $objcon->id) print_titre($langs->trans("TasksHistoryForThisContact"));
else print_titre($langs->trans("ActionsOnCompany")); else print_titre($langs->trans("ActionsOnCompany"));
@ -390,7 +390,7 @@ function show_actions_todo($conf,$langs,$db,$objsoc,$objcon='')
$i = 0 ; $i = 0 ;
$num = $db->num_rows($result); $num = $db->num_rows($result);
$var=true; $var=true;
if ($num) if ($num)
{ {
while ($i < $num) while ($i < $num)
@ -401,7 +401,7 @@ function show_actions_todo($conf,$langs,$db,$objsoc,$objcon='')
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
print '<td width="100" align="left">'.dolibarr_print_date($obj->dp,'dayhour')."</td>\n"; print '<td width="100" align="left">'.dolibarr_print_date($obj->dp,'dayhour')."</td>\n";
// Picto warning // Picto warning
print '<td width="16">'; print '<td width="16">';
if ($obj->dp && date("U",$obj->dp) < time()) print ' '.img_warning("Late"); if ($obj->dp && date("U",$obj->dp) < time()) print ' '.img_warning("Late");
@ -423,7 +423,7 @@ function show_actions_todo($conf,$langs,$db,$objsoc,$objcon='')
$actionstatic->id=$obj->id; $actionstatic->id=$obj->id;
print '<td width="140">'.$actionstatic->getNomUrl(1,16).'</td>'; print '<td width="140">'.$actionstatic->getNomUrl(1,16).'</td>';
} }
print '<td colspan="2">'.$obj->label.'</td>'; print '<td colspan="2">'.$obj->label.'</td>';
// Contact pour cette action // Contact pour cette action
@ -438,7 +438,7 @@ function show_actions_todo($conf,$langs,$db,$objsoc,$objcon='')
{ {
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
} }
print '<td width="80" nowrap="nowrap">'; print '<td width="80" nowrap="nowrap">';
$userstatic->id=$obj->fk_user_author; $userstatic->id=$obj->fk_user_author;
$userstatic->login=$obj->login; $userstatic->login=$obj->login;
@ -504,7 +504,7 @@ function show_actions_done($conf,$langs,$db,$objsoc,$objcon='')
$sql.= " AND c.id=a.fk_action"; $sql.= " AND c.id=a.fk_action";
$sql.= " AND a.percent = 100"; $sql.= " AND a.percent = 100";
$sql.= " ORDER BY a.datea DESC, a.id DESC"; $sql.= " ORDER BY a.datea DESC, a.id DESC";
dolibarr_syslog("company.lib::show_actions_done sql=".$sql, LOG_DEBUG); dolibarr_syslog("company.lib::show_actions_done sql=".$sql, LOG_DEBUG);
$resql=$db->query($sql); $resql=$db->query($sql);
if ($resql) if ($resql)
@ -529,11 +529,11 @@ function show_actions_done($conf,$langs,$db,$objsoc,$objcon='')
dolibarr_print_error($db); dolibarr_print_error($db);
} }
} }
if ($conf->mailing->enabled && $objcon->email) if ($conf->mailing->enabled && $objcon->email)
{ {
$langs->load("mails"); $langs->load("mails");
// Recherche histo sur mailing // Recherche histo sur mailing
$sql = "SELECT m.rowid as id, ".$db->pdate("mc.date_envoi")." as da, m.titre as note, '100' as percentage,"; $sql = "SELECT m.rowid as id, ".$db->pdate("mc.date_envoi")." as da, m.titre as note, '100' as percentage,";
$sql.= " 'AC_EMAILING' as acode,"; $sql.= " 'AC_EMAILING' as acode,";
@ -569,7 +569,7 @@ function show_actions_done($conf,$langs,$db,$objsoc,$objcon='')
} }
} }
if ($conf->agenda->enabled || ($conf->mailing->enabled && $objcon->email)) if ($conf->agenda->enabled || ($conf->mailing->enabled && $objcon->email))
{ {
require_once(DOL_DOCUMENT_ROOT."/actioncomm.class.php"); require_once(DOL_DOCUMENT_ROOT."/actioncomm.class.php");
@ -582,7 +582,7 @@ function show_actions_done($conf,$langs,$db,$objsoc,$objcon='')
$propalstatic=new Propal($db); $propalstatic=new Propal($db);
$orderstatic=new Commande($db); $orderstatic=new Commande($db);
$facturestatic=new Facture($db); $facturestatic=new Facture($db);
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td colspan="8"><a href="'.DOL_URL_ROOT.'/comm/action/listactions.php?socid='.$objsoc->id.'&amp;status=done">'.$langs->trans("ActionsDoneShort").'</a></td>'; print '<td colspan="8"><a href="'.DOL_URL_ROOT.'/comm/action/listactions.php?socid='.$objsoc->id.'&amp;status=done">'.$langs->trans("ActionsDoneShort").'</a></td>';
@ -619,7 +619,7 @@ function show_actions_done($conf,$langs,$db,$objsoc,$objcon='')
// Note // Note
print '<td>'.dolibarr_trunc($histo[$key]['note'], 30).'</td>'; print '<td>'.dolibarr_trunc($histo[$key]['note'], 30).'</td>';
// Objet lie // Objet lie
print '<td>'; print '<td>';
if ($histo[$key]['pid'] && $conf->propal->enabled) if ($histo[$key]['pid'] && $conf->propal->enabled)
@ -656,7 +656,7 @@ function show_actions_done($conf,$langs,$db,$objsoc,$objcon='')
{ {
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
} }
// Auteur // Auteur
print '<td nowrap="nowrap" width="80">'; print '<td nowrap="nowrap" width="80">';
$userstatic->id=$histo[$key]['userid']; $userstatic->id=$histo[$key]['userid'];
@ -679,6 +679,50 @@ function show_actions_done($conf,$langs,$db,$objsoc,$objcon='')
} }
/**
* \brief Show bank informations for PDF generation
*/
function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account)
{
$pdf->SetXY ($curx, $cury);
$pdf->SetFont('Arial','B',8);
$pdf->MultiCell(90, 3, $outputlangs->transnoentities('PaymentByTransferOnThisBankAccount').':', 0, 'L', 0);
$cury+=4;
$pdf->SetFont('Arial','B',6);
$pdf->line($curx+1, $cury, $curx+1, $cury+10 );
$pdf->SetXY ($curx, $cury);
$pdf->MultiCell(18, 3, $outputlangs->transnoentities("BankCode"), 0, 'C', 0);
$pdf->line($curx+18, $cury, $curx+18, $cury+10 );
$pdf->SetXY ($curx+18, $cury);
$pdf->MultiCell(18, 3, $outputlangs->transnoentities("DeskCode"), 0, 'C', 0);
$pdf->line($curx+36, $cury, $curx+36, $cury+10 );
$pdf->SetXY ($curx+36, $cury);
$pdf->MultiCell(24, 3, $outputlangs->transnoentities("BankAccountNumber"), 0, 'C', 0);
$pdf->line($curx+60, $cury, $curx+60, $cury+10 );
$pdf->SetXY ($curx+60, $cury);
$pdf->MultiCell(13, 3, $outputlangs->transnoentities("BankAccountNumberKey"), 0, 'C', 0);
$pdf->line($curx+73, $cury, $curx+73, $cury+10 );
$pdf->SetFont('Arial','',8);
$pdf->SetXY ($curx, $cury+5);
$pdf->MultiCell(18, 3, $outputlangs->convToOutputCharset($account->code_banque), 0, 'C', 0);
$pdf->SetXY ($curx+18, $cury+5);
$pdf->MultiCell(18, 3, $outputlangs->convToOutputCharset($account->code_guichet), 0, 'C', 0);
$pdf->SetXY ($curx+36, $cury+5);
$pdf->MultiCell(24, 3, $outputlangs->convToOutputCharset($account->number), 0, 'C', 0);
$pdf->SetXY ($curx+60, $cury+5);
$pdf->MultiCell(13, 3, $outputlangs->convToOutputCharset($account->cle_rib), 0, 'C', 0);
$pdf->SetXY ($curx, $cury+12);
$pdf->MultiCell(90, 3, $outputlangs->transnoentities("Residence").' : ' . $outputlangs->convToOutputCharset($account->domiciliation), 0, 'L', 0);
$pdf->SetXY ($curx, $cury+22);
$pdf->MultiCell(90, 3, $outputlangs->transnoentities("IbanPrefix").' : ' . $outputlangs->convToOutputCharset($account->iban_prefix), 0, 'L', 0);
$pdf->SetXY ($curx, $cury+25);
$pdf->MultiCell(90, 3, $outputlangs->transnoentities("BIC").' : ' . $outputlangs->convToOutputCharset($account->bic), 0, 'L', 0);
return $pdf->getY();
}
/** /**
* \brief Show footer of page for PDF generation * \brief Show footer of page for PDF generation
@ -695,7 +739,7 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
global $conf; global $conf;
$outputlangs->load("dict"); $outputlangs->load("dict");
// Line of free text // Line of free text
$ligne=(! empty($conf->global->$paramfreetext))?$outputlangs->convToOutputCharset($conf->global->$paramfreetext):""; $ligne=(! empty($conf->global->$paramfreetext))?$outputlangs->convToOutputCharset($conf->global->$paramfreetext):"";