/** * Show miscellaneous information (payment mode, payment term, ...) * * @param PDF $pdf Object PDF * @param Object $object Object to show * @param int $posy Y * @param Translate $outputlangs Langs object * @return void */ function _tableau_info(&$pdf, $object, $posy, $outputlangs) { global $conf; $default_font_size = pdf_getPDFFontSize($outputlangs); $pdf->SetFont('', '', $default_font_size - 1); // If France, show VAT mention if not applicable if ($this->emetteur->country_code == 'FR' && $this->franchise == 1) { $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->SetXY($this->marge_gauche, $posy); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', 0); $posy = $pdf->GetY() + 4; } $posxval = 52; // Show payments conditions if ($object->type != 2 && ($object->cond_reglement_code || $object->cond_reglement)) { $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->SetXY($this->marge_gauche, $posy); $titre = $outputlangs->transnoentities("PaymentConditions") . ':'; $pdf->MultiCell(80, 4, $titre, 0, 'L'); $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posxval, $posy); $lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition" . $object->cond_reglement_code) != 'PaymentCondition' . $object->cond_reglement_code ? $outputlangs->transnoentities("PaymentCondition" . $object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc); $lib_condition_paiement = str_replace('\\n', "\n", $lib_condition_paiement); $pdf->MultiCell(80, 4, $lib_condition_paiement, 0, 'L'); $posy = $pdf->GetY() + 3; } if ($object->type != 2) { // Check a payment mode is defined if (empty($object->mode_reglement_code) && empty($conf->global->FACTURE_CHQ_NUMBER) && empty($conf->global->FACTURE_RIB_NUMBER)) { $this->error = $outputlangs->transnoentities("ErrorNoPaiementModeConfigured"); } elseif ($object->mode_reglement_code == 'CHQ' && empty($conf->global->FACTURE_CHQ_NUMBER) || $object->mode_reglement_code == 'VIR' && empty($conf->global->FACTURE_RIB_NUMBER)) { $outputlangs->load("errors"); $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $this->error = $outputlangs->transnoentities("ErrorPaymentModeDefinedToWithoutSetup", $object->mode_reglement_code); $pdf->MultiCell(80, 3, $this->error, 0, 'L', 0); $pdf->SetTextColor(0, 0, 0); $posy = $pdf->GetY() + 1; } // Show payment mode if ($object->mode_reglement_code && $object->mode_reglement_code != 'CHQ' && $object->mode_reglement_code != 'VIR') { $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->SetXY($this->marge_gauche, $posy); $titre = $outputlangs->transnoentities("PaymentMode") . ':'; $pdf->MultiCell(80, 5, $titre, 0, 'L'); $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posxval, $posy); $lib_mode_reg = $outputlangs->transnoentities("PaymentType" . $object->mode_reglement_code) != 'PaymentType' . $object->mode_reglement_code ? $outputlangs->transnoentities("PaymentType" . $object->mode_reglement_code) : $outputlangs->convToOutputCharset($object->mode_reglement); $pdf->MultiCell(80, 5, $lib_mode_reg, 0, 'L'); $posy = $pdf->GetY() + 2; } // Show payment mode CHQ if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ') { // Si mode reglement non force ou si force a CHQ if (!empty($conf->global->FACTURE_CHQ_NUMBER)) { $diffsizetitle = empty($conf->global->PDF_DIFFSIZE_TITLE) ? 3 : $conf->global->PDF_DIFFSIZE_TITLE; if ($conf->global->FACTURE_CHQ_NUMBER > 0) { $account = new Account($this->db); $account->fetch($conf->global->FACTURE_CHQ_NUMBER); $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', 'B', $default_font_size - $diffsizetitle); $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $account->proprio), 0, 'L', 0); $posy = $pdf->GetY() + 1; if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS)) { $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', '', $default_font_size - $diffsizetitle); $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($account->owner_address), 0, 'L', 0); $posy = $pdf->GetY() + 2; } } if ($conf->global->FACTURE_CHQ_NUMBER == -1) { $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', 'B', $default_font_size - $diffsizetitle); $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $this->emetteur->name), 0, 'L', 0); $posy = $pdf->GetY() + 1; if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS)) { $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', '', $default_font_size - $diffsizetitle); $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0, 'L', 0); $posy = $pdf->GetY() + 2; } } } } // If payment mode not forced or forced to VIR, show payment with BAN if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'VIR') { if (!empty($object->fk_account) || !empty($object->fk_bank) || !empty($conf->global->FACTURE_RIB_NUMBER)) { $bankid = empty($object->fk_account) ? $conf->global->FACTURE_RIB_NUMBER : $object->fk_account; if (!empty($object->fk_bank)) { $bankid = $object->fk_bank; } // For backward compatibility when object->fk_account is forced with object->fk_bank $account = new Account($this->db); $account->fetch($bankid); $curx = $this->marge_gauche; $cury = $posy; $posy = pdf_bank($pdf, $outputlangs, $curx, $cury, $account, 0, $default_font_size); $posy += 2; } } } return $posy; }
/** * Show miscellaneous information (payment mode, payment term, ...) * * @param PDF &$pdf Object PDF * @param Object $object Object to show * @param int $posy Y * @param Translate $outputlangs Langs object * @return void */ function _tableau_info(&$pdf, $object, $posy, $outputlangs) { global $conf; $default_font_size = pdf_getPDFFontSize($outputlangs); $pdf->SetFont('', '', $default_font_size - 1); // If France, show VAT mention if not applicable if ($this->emetteur->pays_code == 'FR' && $this->franchise == 1) { $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->SetXY($this->marge_gauche, $posy); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', 0); $posy = $pdf->GetY() + 4; } $posxval = 52; // Show payments conditions if ($object->type != 2 && ($object->cond_reglement_code || $object->cond_reglement)) { $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->SetXY($this->marge_gauche, $posy); $titre = $outputlangs->transnoentities("PaymentConditions") . ':'; $pdf->MultiCell(80, 4, $titre, 0, 'L'); $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posxval - 6, $posy); $lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition" . $object->cond_reglement_code) != 'PaymentCondition' . $object->cond_reglement_code ? $outputlangs->transnoentities("PaymentCondition" . $object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc); $lib_condition_paiement = str_replace('\\n', "\n", $lib_condition_paiement); $pdf->MultiCell(65, 4, $lib_condition_paiement, 0, 'L'); $posy = $pdf->GetY() + 3; } if ($object->type != 2) { // Check a payment mode is defined if (empty($object->mode_reglement_code) && !$conf->global->FACTURE_CHQ_NUMBER && !$conf->global->FACTURE_RIB_NUMBER) { $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell(80, 3, $outputlangs->transnoentities("ErrorNoPaiementModeConfigured"), 0, 'L', 0); $pdf->SetTextColor(0, 0, 0); $posy = $pdf->GetY() + 1; } // Show payment mode if ($object->mode_reglement_code && $object->mode_reglement_code != 'CHQ' && $object->mode_reglement_code != 'VIR') { $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->SetXY($this->marge_gauche, $posy); $titre = $outputlangs->transnoentities("PaymentMode") . ':'; $pdf->MultiCell(80, 5, $titre, 0, 'L'); $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posxval, $posy); $lib_mode_reg = $outputlangs->transnoentities("PaymentType" . $object->mode_reglement_code) != 'PaymentType' . $object->mode_reglement_code ? $outputlangs->transnoentities("PaymentType" . $object->mode_reglement_code) : $outputlangs->convToOutputCharset($object->mode_reglement); $pdf->MultiCell(80, 5, $lib_mode_reg, 0, 'L'); $posy = $pdf->GetY() + 2; } // Show payment mode CHQ if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ') { // Si mode reglement non force ou si force a CHQ if (!empty($conf->global->FACTURE_CHQ_NUMBER)) { if ($conf->global->FACTURE_CHQ_NUMBER > 0) { $account = new Account($this->db); $account->fetch($conf->global->FACTURE_CHQ_NUMBER); $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', 'B', $default_font_size - 3); $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $account->proprio), 0, 'L', 0); $posy = $pdf->GetY() + 1; if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS)) { $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', '', $default_font_size - 3); $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($account->adresse_proprio), 0, 'L', 0); $posy = $pdf->GetY() + 2; } } if ($conf->global->FACTURE_CHQ_NUMBER == -1) { $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', 'B', $default_font_size - 3); $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $this->emetteur->name), 0, 'L', 0); $posy = $pdf->GetY() + 1; if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS)) { $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', '', $default_font_size - 3); $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0, 'L', 0); $posy = $pdf->GetY() + 2; } } } } // If payment mode not forced or forced to VIR, show payment with BAN if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'VIR') { if (!empty($object->fk_bank) || !empty($conf->global->FACTURE_RIB_NUMBER)) { if (empty($object->fk_bank) || $object->fk_bank == '') { $bankid = $conf->global->FACTURE_RIB_NUMBER; } else { $bankid = $object->fk_bank; } $account = new Account($this->db); $account->fetch($bankid); $curx = $this->marge_gauche; $cury = $posy; $posy = pdf_bank($pdf, $outputlangs, $curx, $cury, $account, 0, $default_font_size); $posy += 2; } } // Mostrar aviso pago con pagaré // $pdf->SetXY($this->marge_gauche, $posy); // $pdf->SetFont('','B', $default_font_size - 2); // $pdf->SetTextColor(0,0,60); // $pdf->MultiCell(100, 3, "Aceptamos pago mediante Pagaré a la orden.", '', 'L'); // Mostrar de nuevo la fecha de vencimiento $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->SetTextColor(0, 0, 60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("DateEcheance") . " : " . dol_print_date($object->date_lim_reglement, "day", false, $outputlangs, true), '', 'L'); } return $posy; }
/** * Generate Header * * @param PDF &$pdf Pdf object * @param int $page Current page number * @param int $pages Total number of pages * @param Translate $outputlangs Object language for output * @return void */ function Header(&$pdf, $page, $pages, $outputlangs) { global $langs; $default_font_size = pdf_getPDFFontSize($outputlangs); $outputlangs->load("compta"); $outputlangs->load("banks"); $title = $outputlangs->transnoentities("CheckReceipt"); $pdf->SetFont('', 'B', $default_font_size); $pdf->SetXY(10, 8); $pdf->MultiCell(0, 2, $title, 0, 'L'); $pdf->SetFont('', '', $default_font_size); $pdf->SetXY(10, 15); $pdf->MultiCell(22, 2, $outputlangs->transnoentities("Ref"), 0, 'L'); $pdf->SetXY(32, 15); $pdf->SetFont('', '', $default_font_size); $pdf->MultiCell(60, 2, $outputlangs->convToOutputCharset($this->number), 0, 'L'); $pdf->SetFont('', '', $default_font_size); $pdf->SetXY(10, 20); $pdf->MultiCell(22, 2, $outputlangs->transnoentities("Date"), 0, 'L'); $pdf->SetXY(32, 20); $pdf->SetFont('', '', $default_font_size); $pdf->MultiCell(60, 2, dol_print_date($this->date, "day", false, $outputlangs)); $pdf->SetFont('', '', $default_font_size); $pdf->SetXY(10, 26); $pdf->MultiCell(22, 2, $outputlangs->transnoentities("Owner"), 0, 'L'); $pdf->SetFont('', '', $default_font_size); $pdf->SetXY(32, 26); $pdf->MultiCell(60, 2, $outputlangs->convToOutputCharset($this->account->proprio), 0, 'L'); $pdf->SetFont('', '', $default_font_size); $pdf->SetXY(10, 32); $pdf->MultiCell(0, 2, $outputlangs->transnoentities("Account"), 0, 'L'); pdf_bank($pdf, $outputlangs, 32, 32, $this->account, 1); $pdf->SetFont('', '', $default_font_size); $pdf->SetXY(114, 15); $pdf->MultiCell(40, 2, $outputlangs->transnoentities("Signature"), 0, 'L'); $pdf->Rect(9, 14, 192, 35); $pdf->line(9, 19, 112, 19); $pdf->line(9, 25, 112, 25); //$pdf->line(9, 31, 201, 31); $pdf->line(9, 31, 112, 31); $pdf->line(30, 14, 30, 49); $pdf->line(112, 14, 112, 49); // Number of cheques $posy = 51; $pdf->Rect(9, $posy, 192, 6); $pdf->line(55, $posy, 55, $posy + 6); $pdf->line(140, $posy, 140, $posy + 6); $pdf->line(170, $posy, 170, $posy + 6); $pdf->SetFont('', '', $default_font_size); $pdf->SetXY(10, $posy + 1); $pdf->MultiCell(40, 2, $outputlangs->transnoentities("NumberOfCheques"), 0, 'L'); $pdf->SetFont('', 'B', $default_font_size); $pdf->SetXY(57, $posy + 1); $pdf->MultiCell(40, 2, $this->nbcheque, 0, 'L'); $pdf->SetFont('', '', $default_font_size); $pdf->SetXY(148, $posy + 1); $pdf->MultiCell(40, 2, $langs->trans("Total")); $pdf->SetFont('', 'B', $default_font_size); $pdf->SetXY(170, $posy + 1); $pdf->MultiCell(31, 2, price($this->amount), 0, 'C', 0); // Tableau $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY(11, $this->tab_top + 2); $pdf->MultiCell(40, 2, $outputlangs->transnoentities("Num"), 0, 'L'); $pdf->line(40, $this->tab_top, 40, $this->tab_top + $this->tab_height + 10); $pdf->SetXY(41, $this->tab_top + 2); $pdf->MultiCell(40, 2, $outputlangs->transnoentities("Bank"), 0, 'L'); $pdf->line(100, $this->tab_top, 100, $this->tab_top + $this->tab_height + 10); $pdf->SetXY(101, $this->tab_top + 2); $pdf->MultiCell(40, 2, $outputlangs->transnoentities("CheckTransmitter"), 0, 'L'); $pdf->line(180, $this->tab_top, 180, $this->tab_top + $this->tab_height + 10); $pdf->SetXY(180, $this->tab_top + 2); $pdf->MultiCell(20, 2, $outputlangs->transnoentities("Amount"), 0, 'R'); $pdf->line(9, $this->tab_top + 8, 201, $this->tab_top + 8); $pdf->Rect(9, $this->tab_top, 192, $this->tab_height + 10); }
/** * Show miscellaneous information (payment mode, payment term, ...) * * @param PDF $pdf Object PDF * @param Object $object Object to show * @param int $posy Y * @param Translate $outputlangs Langs object * @return void */ function _tableau_info(&$pdf, $object, $posy, $outputlangs) { global $conf; $default_font_size = pdf_getPDFFontSize($outputlangs); $pdf->SetFont('', '', $default_font_size - 1); // If France, show VAT mention if not applicable if ($this->emetteur->country_code == 'FR' && $this->franchise == 1) { $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->SetXY($this->marge_gauche, $posy); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', 0); $posy = $pdf->GetY() + 4; } $posxval = 52; // Show payments conditions if ($object->cond_reglement_code || $object->cond_reglement) { $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->SetXY($this->marge_gauche, $posy); $titre = $outputlangs->transnoentities("PaymentConditions") . ':'; $pdf->MultiCell(80, 4, $titre, 0, 'L'); $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posxval, $posy); $lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition" . $object->cond_reglement_code) != 'PaymentCondition' . $object->cond_reglement_code ? $outputlangs->transnoentities("PaymentCondition" . $object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc); $lib_condition_paiement = str_replace('\\n', "\n", $lib_condition_paiement); $pdf->MultiCell(80, 4, $lib_condition_paiement, 0, 'L'); $posy = $pdf->GetY() + 3; } // Check a payment mode is defined /* Not used with orders if (empty($object->mode_reglement_code) && ! $conf->global->FACTURE_CHQ_NUMBER && ! $conf->global->FACTURE_RIB_NUMBER) { $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetTextColor(200,0,0); $pdf->SetFont('','B', $default_font_size - 2); $pdf->MultiCell(80, 3, $outputlangs->transnoentities("ErrorNoPaiementModeConfigured"),0,'L',0); $pdf->SetTextColor(0,0,0); $posy=$pdf->GetY()+1; } */ /* TODO else if (! empty($object->availability_code)) { $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetTextColor(200,0,0); $pdf->SetFont('','B', $default_font_size - 2); $pdf->MultiCell(80, 3, $outputlangs->transnoentities("AvailabilityPeriod").': '.,0,'L',0); $pdf->SetTextColor(0,0,0); $posy=$pdf->GetY()+1; }*/ // Show planed date of delivery if (!empty($object->date_livraison)) { $outputlangs->load("sendings"); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->SetXY($this->marge_gauche, $posy); $titre = $outputlangs->transnoentities("DateDeliveryPlanned") . ':'; $pdf->MultiCell(80, 4, $titre, 0, 'L'); $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posxval, $posy); $dlp = dol_print_date($object->date_livraison, "daytext", false, $outputlangs, true); $pdf->MultiCell(80, 4, $dlp, 0, 'L'); $posy = $pdf->GetY() + 1; } elseif ($object->availability_code || $object->availability) { $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->SetXY($this->marge_gauche, $posy); $titre = $outputlangs->transnoentities("AvailabilityPeriod") . ':'; $pdf->MultiCell(80, 4, $titre, 0, 'L'); $pdf->SetTextColor(0, 0, 0); $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posxval, $posy); $lib_availability = $outputlangs->transnoentities("AvailabilityType" . $object->availability_code) != 'AvailabilityType' . $object->availability_code ? $outputlangs->transnoentities("AvailabilityType" . $object->availability_code) : $outputlangs->convToOutputCharset(isset($object->availability) ? $object->availability : ''); $lib_availability = str_replace('\\n', "\n", $lib_availability); $pdf->MultiCell(80, 4, $lib_availability, 0, 'L'); $posy = $pdf->GetY() + 1; } // Show payment mode if ($object->mode_reglement_code && $object->mode_reglement_code != 'CHQ' && $object->mode_reglement_code != 'VIR') { $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->SetXY($this->marge_gauche, $posy); $titre = $outputlangs->transnoentities("PaymentMode") . ':'; $pdf->MultiCell(80, 5, $titre, 0, 'L'); $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posxval, $posy); $lib_mode_reg = $outputlangs->transnoentities("PaymentType" . $object->mode_reglement_code) != 'PaymentType' . $object->mode_reglement_code ? $outputlangs->transnoentities("PaymentType" . $object->mode_reglement_code) : $outputlangs->convToOutputCharset($object->mode_reglement); $pdf->MultiCell(80, 5, $lib_mode_reg, 0, 'L'); $posy = $pdf->GetY() + 2; } // Show payment mode CHQ if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ') { // Si mode reglement non force ou si force a CHQ if (!empty($conf->global->FACTURE_CHQ_NUMBER)) { if ($conf->global->FACTURE_CHQ_NUMBER > 0) { $account = new Account($this->db); $account->fetch($conf->global->FACTURE_CHQ_NUMBER); $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', 'B', $default_font_size - 3); $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $account->proprio), 0, 'L', 0); $posy = $pdf->GetY() + 1; if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS)) { $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', '', $default_font_size - 3); $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($account->owner_address), 0, 'L', 0); $posy = $pdf->GetY() + 2; } } if ($conf->global->FACTURE_CHQ_NUMBER == -1) { $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', 'B', $default_font_size - 3); $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $this->emetteur->name), 0, 'L', 0); $posy = $pdf->GetY() + 1; if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS)) { $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', '', $default_font_size - 3); $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0, 'L', 0); $posy = $pdf->GetY() + 2; } } } } // If payment mode not forced or forced to VIR, show payment with BAN if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'VIR') { if (!empty($conf->global->FACTURE_RIB_NUMBER)) { $account = new Account($this->db); $account->fetch($conf->global->FACTURE_RIB_NUMBER); $curx = $this->marge_gauche; $cury = $posy; $posy = pdf_bank($pdf, $outputlangs, $curx, $cury, $account, 0, $default_font_size); $posy += 2; } } return $posy; }
/** * \brief Affiche infos divers * \param pdf Objet PDF * \param object Objet facture * \param posy Position depart * \param outputlangs Objet langs * \return y Position pour suite */ function _tableau_info(&$pdf, $object, $posy, $outputlangs) { global $conf; $default_font_size = pdf_getPDFFontSize($outputlangs); $pdf->SetFont('','', $default_font_size - 1); // If France, show VAT mention if not applicable if ($this->emetteur->pays_code == 'FR' && $this->franchise == 1) { $pdf->SetFont('','B', $default_font_size - 2); $pdf->SetXY($this->marge_gauche, $posy); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', 0); $posy=$pdf->GetY()+4; } // Show availability conditions if ($object->type != 2 && ($object->availability_code || $object->availability)) { $pdf->SetFont('','B', $default_font_size - 2); $pdf->SetXY($this->marge_gauche, $posy); $titre = $outputlangs->transnoentities("AvailabilityPeriod").':'; $pdf->MultiCell(80, 4, $titre, 0, 'L'); $pdf->SetTextColor(0,0,0); $pdf->SetFont('','', $default_font_size - 2); $pdf->SetXY(82, $posy); $lib_availability=$outputlangs->transnoentities("AvailabilityPeriod".$object->availability_code)!=('AvailabilityPeriod'.$object->availability_code)?$outputlangs->transnoentities("AvailabilityPeriod".$object->availability_code):$outputlangs->convToOutputCharset($object->availability); $lib_availability=str_replace('\n',"\n",$lib_availability); $pdf->MultiCell(80, 4, $lib_availability,0,'L'); $posy=$pdf->GetY()+1; } // Show payments conditions if ($object->type != 2 && ($object->cond_reglement_code || $object->cond_reglement)) { $pdf->SetFont('','B', $default_font_size - 2); $pdf->SetXY($this->marge_gauche, $posy); $titre = $outputlangs->transnoentities("PaymentConditions").':'; $pdf->MultiCell(80, 4, $titre, 0, 'L'); $pdf->SetFont('','', $default_font_size - 2); $pdf->SetXY(52, $posy); $lib_condition_paiement=$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code)!=('PaymentCondition'.$object->cond_reglement_code)?$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code):$outputlangs->convToOutputCharset($object->cond_reglement_doc); $lib_condition_paiement=str_replace('\n',"\n",$lib_condition_paiement); $pdf->MultiCell(80, 4, $lib_condition_paiement,0,'L'); $posy=$pdf->GetY()+3; } if ($object->type != 2) { // Check a payment mode is defined if (empty($object->mode_reglement_code) && ! $conf->global->FACTURE_CHQ_NUMBER && ! $conf->global->FACTURE_RIB_NUMBER) { $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetTextColor(200,0,0); $pdf->SetFont('','B', $default_font_size - 2); $pdf->MultiCell(90, 3, $outputlangs->transnoentities("ErrorNoPaiementModeConfigured"),0,'L',0); $pdf->SetTextColor(0,0,0); $posy=$pdf->GetY()+1; } // Shown payment mode if ($object->mode_reglement_code && $object->mode_reglement_code != 'CHQ' && $object->mode_reglement_code != 'VIR') { $pdf->SetFont('','B', $default_font_size - 2); $pdf->SetXY($this->marge_gauche, $posy); $titre = $outputlangs->transnoentities("PaymentMode").':'; $pdf->MultiCell(80, 5, $titre, 0, 'L'); $pdf->SetFont('','', $default_font_size - 2); $pdf->SetXY(50, $posy); $lib_mode_reg=$outputlangs->transnoentities("PaymentType".$object->mode_reglement_code)!=('PaymentType'.$object->mode_reglement_code)?$outputlangs->transnoentities("PaymentType".$object->mode_reglement_code):$outputlangs->convToOutputCharset($object->mode_reglement); $pdf->MultiCell(80, 5, $lib_mode_reg,0,'L'); $posy=$pdf->GetY()+2; } // Show payment mode CHQ if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ') { // Si mode reglement non force ou si force a CHQ if ($conf->global->FACTURE_CHQ_NUMBER) { if ($conf->global->FACTURE_CHQ_NUMBER > 0) { $account = new Account($this->db); $account->fetch($conf->global->FACTURE_CHQ_NUMBER); $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('','B', $default_font_size - 2); $pdf->MultiCell(90, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo',$account->proprio).':',0,'L',0); $posy=$pdf->GetY()+1; $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('','', $default_font_size - 2); $pdf->MultiCell(80, 3, $outputlangs->convToOutputCharset($account->adresse_proprio), 0, 'L', 0); $posy=$pdf->GetY()+2; } if ($conf->global->FACTURE_CHQ_NUMBER == -1) { $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('','B', $default_font_size - 2); $pdf->MultiCell(90, 3, $outputlangs->transnoentities('PaymentByChequeOrderedToShort').' '.$outputlangs->convToOutputCharset($this->emetteur->name).' '.$outputlangs->transnoentities('SendTo').':',0,'L',0); $posy=$pdf->GetY()+1; $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('','', $default_font_size - 2); $pdf->MultiCell(80, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0, 'L', 0); $posy=$pdf->GetY()+2; } } } // If payment mode not forced or forced to VIR, show payment with BAN if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'VIR') { if (! empty($conf->global->FACTURE_RIB_NUMBER)) { $account = new Account($this->db); $account->fetch($conf->global->FACTURE_RIB_NUMBER); $curx=$this->marge_gauche; $cury=$posy; $posy=pdf_bank($pdf,$outputlangs,$curx,$cury,$account); $posy+=2; } } } return $posy; }