本文整理汇总了PHP中vatrate函数的典型用法代码示例。如果您正苦于以下问题:PHP vatrate函数的具体用法?PHP vatrate怎么用?PHP vatrate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了vatrate函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: count
// % propal no signé par année sur 3 colonnes
}
// Nb Clients
for ($current_year = $year_n - 2; $current_year <= $year_n; $current_year++) {
print '<td>' . (isset($TStat['client'][$current_year]) ? count($TStat['client'][$current_year]) : '-') . '</td>';
// Nd clients par année sur 3 colonnes
}
print '<td>' . (isset($TStat['topClient'][$year_n - 2]['name']) ? $TStat['topClient'][$year_n - 2]['name'] : '-') . '</td>';
// Top client N-2
print '<td>' . (isset($TStat['topClient'][$year_n - 2]['percent_ca']) ? vatrate(round($TStat['topClient'][$year_n - 2]['percent_ca'], 2), 1) : '-') . '</td>';
print '<td>' . (isset($TStat['topClient'][$year_n - 1]['name']) ? $TStat['topClient'][$year_n - 1]['name'] : '-') . '</td>';
// Top client N-1
print '<td>' . (isset($TStat['topClient'][$year_n - 1]['percent_ca']) ? vatrate(round($TStat['topClient'][$year_n - 1]['percent_ca'], 2), 1) : '-') . '</td>';
print '<td>' . (isset($TStat['topClient'][$year_n]['name']) ? $TStat['topClient'][$year_n]['name'] : '-') . '</td>';
// Top client N
print '<td>' . (isset($TStat['topClient'][$year_n]['percent_ca']) ? vatrate(round($TStat['topClient'][$year_n]['percent_ca'], 2), 1) : '-') . '</td>';
print '</tr>';
$var = !$var;
}
print '<tr ' . $bc[$var] . '>';
print '<td><b>' . $langs->trans('Total') . '</b></td>';
foreach ($TTotalFacture['total_ca'] as $year => $nb) {
print '<td>' . $nb . '</td>';
}
print '<td colspan="12"></td>';
print '</tr>';
} else {
print '<td colspan="16"><div class="warning">' . $langs->transnoentitiesnoconv('noData') . '</div></td>';
}
print '</table>';
// Fin table info facture
示例2: dol_escape_htmltag
print '<td><input type="text" class="flat" name="search_soc" value="' . $search_soc . '" size="20"></td>';
print '<td colspan="8"> </td>';
// Print the search button
print '<td class="liste_titre" align="right">';
print '<input class="liste_titre" name="button_search" type="image" src="' . DOL_URL_ROOT . '/theme/' . $conf->theme . '/img/search.png" value="' . dol_escape_htmltag($langs->trans("Search")) . '" title="' . dol_escape_htmltag($langs->trans("Search")) . '">';
print '</td>';
print '</tr>';
$var = True;
foreach ($prodcustprice->lines as $line) {
print "<tr {$bc[$var]}>";
$staticprod = new Product($db);
$staticprod->fetch($line->fk_product);
print "<td>" . $staticprod->getNomUrl(1) . "</td>";
print "<td>" . dol_print_date($line->datec, "dayhour") . "</td>";
print '<td align="center">' . $langs->trans($line->price_base_type) . "</td>";
print '<td align="right">' . vatrate($line->tva_tx, true, $line->recuperableonly) . "</td>";
print '<td align="right">' . price($line->price) . "</td>";
print '<td align="right">' . price($line->price_ttc) . "</td>";
print '<td align="right">' . price($line->price_min) . '</td>';
print '<td align="right">' . price($line->price_min_ttc) . '</td>';
// User
$userstatic = new User($db);
$userstatic->fetch($line->fk_user);
print '<td align="right">';
print $userstatic->getLoginUrl(1);
print '</td>';
// Todo Edit or delete button
// Action
if ($user->rights->produit->creer || $user->rights->service->creer) {
print '<td align="right">';
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=delete_customer_price&socid=' . $soc->id . '&lineid=' . $line->id . '">';
示例3: _tableau_tot
/**
* \brief Show total to pay
* \param pdf Object PDF
* \param object Object invoice
* \param deja_regle Amount payed
* \return y Next position
*/
function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs)
{
global $conf,$mysoc;
$default_font_size = pdf_getPDFFontSize($outputlangs);
$tab2_top = $posy;
$tab2_hl = 4;
$pdf->SetFont('','', $default_font_size - 1);
$pdf->SetXY ($this->marge_gauche, $tab2_top + 0);
// If France, show VAT mention if not applicable
if ($this->emetteur->pays_code == 'FR' && $this->franchise == 1)
{
$pdf->MultiCell(100, $tab2_hl, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', 0);
}
// Tableau total
$lltot = 200; $col1x = 120; $col2x = 170; $largcol2 = $lltot - $col2x;
// Total HT
$pdf->SetFillColor(255,255,255);
$pdf->SetXY ($col1x, $tab2_top + 0);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + 0);
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_ht + $object->remise), 0, 'R', 1);
// Affichage des totaux de TVA par taux (conformement a reglementation)
$pdf->SetFillColor(248,248,248);
foreach( $this->tva as $tvakey => $tvaval )
{
if ($tvakey > 0) // On affiche pas taux 0
{
$this->atleastoneratenotnull++;
$index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl='';
if (preg_match('/\*/',$tvakey))
{
$tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
}
$totalvat =$outputlangs->transnoentities("TotalVAT").' ';
$totalvat.=vatrate($tvakey,1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
}
}
if (! $this->atleastoneratenotnull) // If not vat at all
{
$index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalVAT"), 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_tva), 0, 'R', 1);
// Total LocalTax1
if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on' && $object->total_localtax1>0)
{
$index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalLT1".$mysoc->pays_code), $useborder, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax1), $useborder, 'R', 1);
}
// Total LocalTax2
if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on' && $object->total_localtax2>0)
{
$index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalLT2".$mysoc->pays_code), $useborder, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2), $useborder, 'R', 1);
}
}
else
{
//Local tax 1
if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
{
foreach( $this->localtax1 as $tvakey => $tvaval )
{
if ($tvakey>0) // On affiche pas taux 0
{
//$this->atleastoneratenotnull++;
//.........这里部分代码省略.........
示例4: pdf_getlinevatrate
/**
* Return line vat rate
*
* @param Object $object Object
* @param int $i Current line number
* @param Translate $outputlangs Object langs for output
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @return string
*/
function pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails = 0)
{
global $hookmanager;
$result = '';
$reshook = 0;
//if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line) ) )
if (is_object($hookmanager)) {
$special_code = $object->lines[$i]->special_code;
if (!empty($object->lines[$i]->fk_parent_line)) {
$special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
}
$parameters = array('i' => $i, 'outputlangs' => $outputlangs, 'hidedetails' => $hidedetails, 'special_code' => $special_code);
$action = '';
$reshook = $hookmanager->executeHooks('pdf_getlinevatrate', $parameters, $object, $action);
// Note that $action and $object may have been modified by some hooks
if (!empty($hookmanager->resPrint)) {
$result .= $hookmanager->resPrint;
}
}
if (empty($reshook)) {
if (empty($hidedetails) || $hidedetails > 1) {
$result .= vatrate($object->lines[$i]->tva_tx, 1, $object->lines[$i]->info_bits, 1);
}
}
return $result;
}
示例5: dol_htmlentitiesbr
$text .= $productstatic->getNomUrl(0, '', 16);
}
$description = $objp->description;
// Add description in form
if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) {
$text .= !empty($objp->description) && $objp->description != $objp->product_label ? '<br>' . dol_htmlentitiesbr($objp->description) : '';
$description = '';
// Already added into main visible desc
}
echo $form->textwithtooltip($text, $description, 3, '', '', $cursorline, 0, !empty($line->fk_parent_line) ? img_picto('', 'rightarrow') : '');
print '</td>';
} else {
print '<td>' . dol_htmlentitiesbr($objp->description) . "</td>\n";
}
// TVA
print '<td align="center">' . vatrate($objp->tva_tx, '%', $objp->info_bits) . '</td>';
// Prix
print '<td align="right">' . ($objp->subprice != '' ? price($objp->subprice) : '') . "</td>\n";
// Quantite
print '<td align="center">' . $objp->qty . '</td>';
// Unit
if ($conf->global->PRODUCT_USE_UNITS) {
print '<td align="left">' . $langs->trans($object->lines[$cursorline - 1]->getLabelOfUnit()) . '</td>';
}
// Remise
if ($objp->remise_percent > 0) {
print '<td align="right" ' . $bc[$var] . '>' . $objp->remise_percent . "%</td>\n";
} else {
print '<td> </td>';
}
// Margin
示例6: _tableau_tot
/**
* Show total to pay
*
* @param PDF &$pdf Object PDF
* @param Facture $object Object invoice
* @param int $deja_regle Montant deja regle
* @param int $posy Position depart
* @param Translate $outputlangs Objet langs
* @return int Position pour suite
*/
function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs)
{
global $conf, $mysoc;
$default_font_size = pdf_getPDFFontSize($outputlangs);
$tab2_top = $posy;
$tab2_hl = 4;
$pdf->SetFont('', '', $default_font_size - 1);
// Tableau total
$col1x = 120;
$col2x = 170;
if ($this->page_largeur < 210) {
$col2x -= 20;
}
$largcol2 = $this->page_largeur - $this->marge_droite - $col2x;
$useborder = 0;
$index = 0;
// Total HT
$pdf->SetFillColor(224, 224, 224);
$pdf->SetXY($col1x, $tab2_top + 0);
$pdf->SetFont('', 'B', $default_font_size + 2);
$pdf->MultiCell($col2x - $col1x, $tab2_hl + 2, $outputlangs->transnoentities("TotalHTShort"), 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + 0);
$pdf->MultiCell($largcol2, $tab2_hl + 2, price($object->total_ht + (!empty($object->remise) ? $object->remise : 0)), 0, 'R', 1);
// Show VAT by rates and total
$pdf->SetFillColor(255, 255, 255);
$pdf->SetFont('', '', $default_font_size);
$this->atleastoneratenotnull = 0;
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) {
$tvaisnull = !empty($this->tva) && count($this->tva) == 1 && isset($this->tva['0.000']) && is_float($this->tva['0.000']) ? true : false;
if (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_ISNULL) && $tvaisnull) {
// Nothing to do
} else {
//Local tax 1 before VAT
//if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
//{
foreach ($this->localtax1 as $localtax_type => $localtax_rate) {
if (in_array((string) $localtax_type, array('1', '3', '5', '7'))) {
continue;
}
foreach ($localtax_rate as $tvakey => $tvaval) {
if ($tvakey != 0) {
//$this->atleastoneratenotnull++;
$index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl = '';
if (preg_match('/\\*/', $tvakey)) {
$tvakey = str_replace('*', '', $tvakey);
$tvacompl = " (" . $outputlangs->transnoentities("NonPercuRecuperable") . ")";
}
$totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code) . ' ';
$totalvat .= vatrate(abs($tvakey), 1) . $tvacompl;
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
}
}
}
//}
//Local tax 2 before VAT
//if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
//{
foreach ($this->localtax2 as $localtax_type => $localtax_rate) {
if (in_array((string) $localtax_type, array('1', '3', '5', '7'))) {
continue;
}
foreach ($localtax_rate as $tvakey => $tvaval) {
if ($tvakey != 0) {
//$this->atleastoneratenotnull++;
$index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl = '';
if (preg_match('/\\*/', $tvakey)) {
$tvakey = str_replace('*', '', $tvakey);
$tvacompl = " (" . $outputlangs->transnoentities("NonPercuRecuperable") . ")";
}
$totalvat = $outputlangs->transcountrynoentities("TotalLT2" . $mysoc->country_code) . ' ';
$totalvat .= vatrate(abs($tvakey), 1) . $tvacompl;
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
}
}
}
//}
// VAT
foreach ($this->tva as $tvakey => $tvaval) {
if ($tvakey > 0) {
$this->atleastoneratenotnull++;
$index++;
$pdf->SetXY($col1x, $tab2_top + 4 + $tab2_hl * $index);
//.........这里部分代码省略.........
开发者ID:sergioeugenio,项目名称:Dolibarr37_berrypro_Modulo,代码行数:101,代码来源:pdf_berrypro_trans_mont_noinc.modules.php
示例7: img_object
$text = img_object($langs->trans('Service'), 'service');
} else {
$text = img_object($langs->trans('Product'), 'product');
}
if (!empty($objp->custom_label)) {
$text .= ' <strong>' . $objp->custom_label . '</strong>';
print $form->textwithtooltip($text, dol_htmlentitiesbr($objp->description), 3, '', '', $i);
} else {
print $text . ' ' . nl2br($objp->description);
}
// Show range
print_date_range($db->jdate($objp->date_start), $db->jdate($objp->date_end));
print "</td>\n";
}
// Vat rate
print '<td align="center">' . vatrate($objp->tva_tx) . '%</td>';
// Qty
print '<td align="center">' . $objp->qty . '</td>';
if ($conf->global->PRODUCT_USE_UNITS) {
print '<td align="left">' . $product_static->getLabelOfUnit() . '</td>';
}
// Percent
if ($objp->remise_percent > 0) {
print '<td align="right">' . $objp->remise_percent . " %</td>\n";
} else {
print '<td> </td>';
}
// Total HT
print '<td align="right">' . price($objp->total_ht) . "</td>\n";
// Total VAT
print '<td align="right">' . price($objp->total_vat) . "</td>\n";
示例8: load_tva
/**
* Output an HTML select vat rate
*
* @param string $htmlname Nom champ html
* @param float $selectedrate Forcage du taux tva pre-selectionne. Mettre '' pour aucun forcage.
* @param Societe $societe_vendeuse Objet societe vendeuse
* @param Societe $societe_acheteuse Objet societe acheteuse
* @param int $idprod Id product
* @param int $info_bits Miscellaneous information on line (1 for NPR)
* @param int $type ''=Unknown, 0=Product, 1=Service (Used if idprod not defined)
* Si vendeur non assujeti a TVA, TVA par defaut=0. Fin de regle.
* Si le (pays vendeur = pays acheteur) alors la TVA par defaut=TVA du produit vendu. Fin de regle.
* Si (vendeur et acheteur dans Communaute europeenne) et bien vendu = moyen de transports neuf (auto, bateau, avion), TVA par defaut=0 (La TVA doit etre paye par l'acheteur au centre d'impots de son pays et non au vendeur). Fin de regle.
* Si vendeur et acheteur dans Communauté européenne et acheteur= particulier alors TVA par défaut=TVA du produit vendu. Fin de règle.
* Si vendeur et acheteur dans Communauté européenne et acheteur= entreprise alors TVA par défaut=0. Fin de règle.
* Sinon la TVA proposee par defaut=0. Fin de regle.
* @param bool $options_only Return options only (for ajax treatment)
* @return string
*/
function load_tva($htmlname = 'tauxtva', $selectedrate = '', $societe_vendeuse = '', $societe_acheteuse = '', $idprod = 0, $info_bits = 0, $type = '', $options_only = false)
{
global $langs, $conf, $mysoc;
$return = '';
$txtva = array();
$libtva = array();
$nprtva = array();
// Define defaultnpr and defaultttx
$defaultnpr = $info_bits & 0x1;
$defaultnpr = preg_match('/\\*/', $selectedrate) ? 1 : $defaultnpr;
$defaulttx = str_replace('*', '', $selectedrate);
// Check parameters
if (is_object($societe_vendeuse) && !$societe_vendeuse->country_code) {
if ($societe_vendeuse->id == $mysoc->id) {
$return .= '<font class="error">' . $langs->trans("ErrorYourCountryIsNotDefined") . '</div>';
} else {
$return .= '<font class="error">' . $langs->trans("ErrorSupplierCountryIsNotDefined") . '</div>';
}
return $return;
}
//var_dump($societe_acheteuse);
//print "name=$name, selectedrate=$selectedrate, seller=".$societe_vendeuse->country_code." buyer=".$societe_acheteuse->country_code." buyer is company=".$societe_acheteuse->isACompany()." idprod=$idprod, info_bits=$info_bits type=$type";
//exit;
// Define list of countries to use to search VAT rates to show
// First we defined code_country to use to find list
if (is_object($societe_vendeuse)) {
$code_country = "'" . $societe_vendeuse->country_code . "'";
} else {
$code_country = "'" . $mysoc->country_code . "'";
// Pour compatibilite ascendente
}
if (!empty($conf->global->SERVICE_ARE_ECOMMERCE_200238EC)) {
if (!$societe_vendeuse->isInEEC() && (!is_object($societe_acheteuse) || $societe_acheteuse->isInEEC() && !$societe_acheteuse->isACompany())) {
// We also add the buyer
if (is_numeric($type)) {
if ($type == 1) {
$code_country .= ",'" . $societe_acheteuse->country_code . "'";
}
} else {
if (!$idprod) {
$code_country .= ",'" . $societe_acheteuse->country_code . "'";
} else {
$prodstatic = new Product($this->db);
$prodstatic->fetch($idprod);
if ($prodstatic->type == 1) {
$code_country .= ",'" . $societe_acheteuse->country_code . "'";
}
}
}
}
}
// Now we get list
$num = $this->load_cache_vatrates($code_country);
if ($num > 0) {
// Definition du taux a pre-selectionner (si defaulttx non force et donc vaut -1 ou '')
if ($defaulttx < 0 || dol_strlen($defaulttx) == 0) {
$defaulttx = get_default_tva($societe_vendeuse, $societe_acheteuse, $idprod);
$defaultnpr = get_default_npr($societe_vendeuse, $societe_acheteuse, $idprod);
}
// Si taux par defaut n'a pu etre determine, on prend dernier de la liste.
// Comme ils sont tries par ordre croissant, dernier = plus eleve = taux courant
if ($defaulttx < 0 || dol_strlen($defaulttx) == 0) {
if (empty($conf->global->MAIN_VAT_DEFAULT_IF_AUTODETECT_FAILS)) {
$defaulttx = $this->cache_vatrates[$num - 1]['txtva'];
} else {
$defaulttx = $conf->global->MAIN_VAT_DEFAULT_IF_AUTODETECT_FAILS == 'none' ? '' : $conf->global->MAIN_VAT_DEFAULT_IF_AUTODETECT_FAILS;
}
}
// Disabled if seller is not subject to VAT
$disabled = false;
$title = '';
if (is_object($societe_vendeuse) && $societe_vendeuse->id == $mysoc->id && $societe_vendeuse->tva_assuj == "0") {
$title = ' title="' . $langs->trans('VATIsNotUsed') . '"';
$disabled = true;
}
if (!$options_only) {
$return .= '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '"' . ($disabled ? ' disabled="disabled"' : '') . $title . '>';
}
foreach ($this->cache_vatrates as $rate) {
// Keep only 0 if seller is not subject to VAT
if ($disabled && $rate['txtva'] != 0) {
//.........这里部分代码省略.........
示例9: _tableau_tot
/**
* \brief Affiche le total a payer
* \param pdf Objet PDF
* \param object Objet facture
* \param deja_regle Montant deja regle
* \param posy Position depart
* \param outputlangs Objet langs
* \return y Position pour suite
*/
function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs)
{
global $conf,$langs;
$langs->load("main");
$langs->load("bills");
$default_font_size = pdf_getPDFFontSize($outputlangs);
$tab2_top = $this->marges['h']+202;
$tab2_hl = 4;
$pdf->SetFont('','', $default_font_size - 1);
// Tableau total
$col1x=$this->marges['g']+110; $col2x=$this->marges['g']+164;
$lltot = 200; $largcol2 = $lltot - $col2x;
$pdf->SetXY ($this->marges['g'], $tab2_top + 0);
$useborder=0;
$index = 0;
// Total HT
$pdf->SetXY ($col1x, $tab2_top + 0);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 0);
$pdf->SetXY ($col2x, $tab2_top + 0);
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_ht + $object->remise), 0, 'R', 0);
// Show VAT by rates and total
$pdf->SetFillColor(248,248,248);
$this->atleastoneratenotnull=0;
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
{
foreach( $this->tva as $tvakey => $tvaval )
{
if ($tvakey > 0) // On affiche pas taux 0
{
$this->atleastoneratenotnull++;
$index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl='';
if (preg_match('/\*/',$tvakey))
{
$tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
}
$totalvat =$outputlangs->transnoentities("TotalVAT").' ';
$totalvat.=vatrate($tvakey,1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
}
}
if (! $this->atleastoneratenotnull) // If no vat at all
{
$index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalVAT"), 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_tva), 0, 'R', 1);
}
}
// Total TTC
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
{
$index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$pdf->SetTextColor(22,137,210);
$pdf->SetFont('','B', $default_font_size + 1);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), 0, 'L', 0);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_ttc), 0, 'R', 0);
$pdf->SetTextColor(0,0,0);
}
$creditnoteamount=$object->getSumCreditNotesUsed();
$depositsamount=$object->getSumDepositsUsed();
$resteapayer = price2num($object->total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT');
if ($object->paye) $resteapayer=0;
if ($deja_regle > 0 || $creditnoteamount > 0 || $depositsamount > 0)
{
$pdf->SetFont('','', $default_font_size);
// Already paid + Deposits
$index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
//.........这里部分代码省略.........
示例10: img_object
if ($type == 1) {
$text = img_object($langs->trans('Service'), 'service');
} else {
$text = img_object($langs->trans('Product'), 'product');
}
print $text . ' ' . nl2br($object->lines[$i]->description);
// Show range
print_date_range($date_start, $date_end);
}
if (is_object($hookmanager)) {
$parameters = array('fk_parent_line' => $line->fk_parent_line, 'line' => $object->lines[$i], 'var' => $var, 'num' => $num, 'i' => $i);
$reshook = $hookmanager->executeHooks('formViewProductSupplierOptions', $parameters, $object, $action);
}
print '</td>';
// VAT
print '<td align="right">' . vatrate($object->lines[$i]->tva_tx, true, $object->lines[$i]->info_bits) . '</td>';
// Unit price
print '<td align="right" class="nowrap">' . price($object->lines[$i]->pu_ht, 'MU') . '</td>';
print '<td align="right" class="nowrap">' . ($object->lines[$i]->pu_ttc ? price($object->lines[$i]->pu_ttc, 'MU') : ' ') . '</td>';
print '<td align="right">' . $object->lines[$i]->qty . '</td>';
print '<td align="right">' . ($object->lines[$i]->remise_percent > 0 ? $object->lines[$i]->remise_percent . '%' : '') . '</td>';
print '<td align="right" class="nowrap">' . price($object->lines[$i]->total_ht) . '</td>';
print '<td align="right" class="nowrap">' . price($object->lines[$i]->total_ttc) . '</td>';
if (is_object($hookmanager)) {
$parameters = array('line' => $object->lines[$i], 'num' => $num, 'i' => $i);
$reshook = $hookmanager->executeHooks('printObjectLine', $parameters, $object, $action);
}
print '<td align="center" width="16">';
if ($object->statut == 0) {
print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=edit_line&etat=0&lineid=' . $object->lines[$i]->rowid . '">' . img_edit() . '</a>';
} else {
示例11: _tableau_tot_situation
/**
* Show total to pay
*
* @param PDF $pdf Object PDF
* @param Facture $object Object invoice
* @param int $deja_regle Montant deja regle
* @param int $posy Position depart
* @param Translate $outputlangs Objet langs
* @return int Position pour suite
*/
function _tableau_tot_situation(&$pdf, $object, $deja_regle, $posy, $outputlangs)
{
global $conf, $mysoc;
$pdf->Line($this->posxdesc - 1, $posy - 2, $this->page_largeur - $this->marge_droite, $posy - 2);
$sign = 1;
if ($object->type == 2 && !empty($conf->global->INVOICE_POSITIVE_CREDIT_NOTE)) {
$sign = -1;
}
$default_font_size = pdf_getPDFFontSize($outputlangs);
$tab2_top = $posy;
$tab2_hl = 4;
$pdf->SetFont('', '', $default_font_size - 1);
// Tableau total
$col1x = 120;
$col2x = 170;
if ($this->page_largeur < 210) {
$col2x -= 20;
}
$largcol2 = $this->page_largeur - $this->marge_droite - $col2x;
$useborder = 0;
$index = 0;
// Total HT
$pdf->SetFillColor(255, 255, 255);
$pdf->SetXY($col1x, $tab2_top + 0);
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + 0);
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * ($object->total_ht + (!empty($object->remise) ? $object->remise : 0)), 0, $outputlangs), 0, 'R', 1);
// Show VAT by rates and total
$pdf->SetFillColor(248, 248, 248);
$this->atleastoneratenotnull = 0;
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) {
$tvaisnull = !empty($this->tva) && count($this->tva) == 1 && isset($this->tva['0.000']) && is_float($this->tva['0.000']) ? true : false;
if (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_ISNULL) && $tvaisnull) {
// Nothing to do
} else {
//Local tax 1 before VAT
//if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
//{
foreach ($this->localtax1 as $localtax_type => $localtax_rate) {
if (in_array((string) $localtax_type, array('1', '3', '5'))) {
continue;
}
foreach ($localtax_rate as $tvakey => $tvaval) {
if ($tvakey != 0) {
//$this->atleastoneratenotnull++;
$index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl = '';
if (preg_match('/\\*/', $tvakey)) {
$tvakey = str_replace('*', '', $tvakey);
$tvacompl = " (" . $outputlangs->transnoentities("NonPercuRecuperable") . ")";
}
$totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code) . ' ';
$totalvat .= vatrate(abs($tvakey), 1) . $tvacompl;
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1);
}
}
}
//}
//Local tax 2 before VAT
//if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
//{
foreach ($this->localtax2 as $localtax_type => $localtax_rate) {
if (in_array((string) $localtax_type, array('1', '3', '5'))) {
continue;
}
foreach ($localtax_rate as $tvakey => $tvaval) {
if ($tvakey != 0) {
//$this->atleastoneratenotnull++;
$index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl = '';
if (preg_match('/\\*/', $tvakey)) {
$tvakey = str_replace('*', '', $tvakey);
$tvacompl = " (" . $outputlangs->transnoentities("NonPercuRecuperable") . ")";
}
$totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code) . ' ';
$totalvat .= vatrate(abs($tvakey), 1) . $tvacompl;
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1);
}
}
}
//}
// VAT
foreach ($this->tva as $tvakey => $tvaval) {
if ($tvakey > 0) {
//.........这里部分代码省略.........
示例12: img_object
}
// Description - Editor wysiwyg
if (! $fac->lines[$i]->fk_product)
{
if ($type==1) $text = img_object($langs->trans('Service'),'service');
else $text = img_object($langs->trans('Product'),'product');
print $text.' '.nl2br($fac->lines[$i]->description);
// Show range
print_date_range($fac->lines[$i]->date_start,$fac->lines[$i]->date_end);
}
print '</td>';
// VAT
print '<td align="right">'.vatrate($fac->lines[$i]->tva_tx).'%</td>';
// Unit price
print '<td align="right" nowrap="nowrap">'.price($fac->lines[$i]->pu_ht,'MU').'</td>';
print '<td align="right" nowrap="nowrap">'.($fac->lines[$i]->pu_ttc?price($fac->lines[$i]->pu_ttc,'MU'):' ').'</td>';
print '<td align="right">'.$fac->lines[$i]->qty.'</td>';
print '<td align="right" nowrap="nowrap">'.price($fac->lines[$i]->total_ht).'</td>';
print '<td align="right" nowrap="nowrap">'.price($fac->lines[$i]->total_ttc).'</td>';
print '<td align="center" width="16">';
if ($fac->statut == 0) print '<a href="fiche.php?facid='.$fac->id.'&action=mod_ligne&etat=0&lineid='.$fac->lines[$i]->rowid.'">'.img_edit().'</a>';
else print ' ';
示例13: printOriginLine
/**
* Return HTML with a line of table array of source object lines
* TODO Move this and previous function into output html class file (htmlline.class.php).
* If lines are into a template, title must also be into a template
* But for the moment we don't know if it's possible as we keep a method available on overloaded objects.
* @param line
* @param var
*/
function printOriginLine($line, $var)
{
global $langs, $bc;
//var_dump($line);
$date_start = $line->date_debut_prevue;
if ($line->date_debut_reel) {
$date_start = $line->date_debut_reel;
}
$date_end = $line->date_fin_prevue;
if ($line->date_fin_reel) {
$date_end = $line->date_fin_reel;
}
$this->tpl['label'] = '';
if (!empty($line->fk_parent_line)) {
$this->tpl['label'] .= img_picto('', 'rightarrow');
}
if (($line->info_bits & 2) == 2) {
$discount = new DiscountAbsolute($db);
$discount->fk_soc = $this->socid;
$this->tpl['label'] .= $discount->getNomUrl(0, 'discount');
} else {
if ($line->fk_product) {
$productstatic = new Product($this->db);
$productstatic->id = $line->fk_product;
$productstatic->ref = $line->ref;
$productstatic->type = $line->fk_product_type;
$this->tpl['label'] .= $productstatic->getNomUrl(1);
$this->tpl['label'] .= $line->label ? ' - ' . $line->label : '';
// Dates
if ($line->product_type == 1 && ($date_start || $date_end)) {
$this->tpl['label'] .= get_date_range($date_start, $date_end);
}
} else {
$this->tpl['label'] .= $line->product_type == -1 ? ' ' : ($line->product_type == 1 ? img_object($langs->trans(''), 'service') : img_object($langs->trans(''), 'product'));
$this->tpl['label'] .= $line->label ? ' ' . $line->label : '';
// Dates
if ($line->product_type == 1 && ($date_start || $date_end)) {
$this->tpl['label'] .= get_date_range($date_start, $date_end);
}
}
}
if ($line->desc) {
if ($line->desc == '(CREDIT_NOTE)') {
$discount = new DiscountAbsolute($this->db);
$discount->fetch($line->fk_remise_except);
$this->tpl['description'] = $langs->transnoentities("DiscountFromCreditNote", $discount->getNomUrl(0));
} elseif ($line->desc == '(DEPOSIT)') {
$discount = new DiscountAbsolute($this->db);
$discount->fetch($line->fk_remise_except);
$this->tpl['description'] = $langs->transnoentities("DiscountFromDeposit", $discount->getNomUrl(0));
} else {
$this->tpl['description'] = dol_trunc($line->desc, 60);
}
} else {
$this->tpl['description'] = ' ';
}
$this->tpl['vat_rate'] = vatrate($line->tva_tx, true);
$this->tpl['price'] = price($line->subprice);
$this->tpl['qty'] = ($line->info_bits & 2) != 2 ? $line->qty : ' ';
$this->tpl['remise_percent'] = ($line->info_bits & 2) != 2 ? vatrate($line->remise_percent, true) : ' ';
include DOL_DOCUMENT_ROOT . '/core/tpl/originproductline.tpl.php';
}
示例14: vatrate
<a name="<?php echo $line->id; ?>"></a>
<?php
echo $html->textwithtooltip($text,$description,3,'','',$i,0,($line->fk_parent_line?img_picto('', 'rightarrow'):''));
// Show range
print_date_range($line->date_start, $line->date_end);
// Add description in form
if ($conf->global->PRODUIT_DESC_IN_FORM)
{
print ($line->description && $line->description!=$line->product_label)?'<br>'.dol_htmlentitiesbr($line->description):'';
}
?>
</td>
<td align="right" nowrap="nowrap"><?php echo vatrate($line->tva_tx,'%',$line->info_bits); ?></td>
<td align="right" nowrap="nowrap"><?php echo price($line->subprice); ?></td>
<td align="right" nowrap="nowrap">
<?php if ((($line->info_bits & 2) != 2) && $line->special_code != 3) echo $line->qty;
else echo ' '; ?>
</td>
<?php if (!empty($line->remise_percent) && $line->special_code != 3) { ?>
<td align="right"><?php echo dol_print_reduction($line->remise_percent,$langs); ?></td>
<?php } else { ?>
<td> </td>
<?php } ?>
<?php if ($line->special_code == 3) { ?>
示例15: printOriginLine
/**
* Return HTML with a line of table array of source object lines
* TODO Move this and previous function into output html class file (htmlline.class.php).
* If lines are into a template, title must also be into a template
* But for the moment we don't know if it's possible as we keep a method available on overloaded objects.
*
* @param array $line Line
* @param string $var Var
* @return void
*/
function printOriginLine($line, $var)
{
global $conf, $langs, $bc;
//var_dump($line);
$date_start = $line->date_debut_prevue;
if ($line->date_debut_reel) {
$date_start = $line->date_debut_reel;
}
$date_end = $line->date_fin_prevue;
if ($line->date_fin_reel) {
$date_end = $line->date_fin_reel;
}
$this->tpl['label'] = '';
if (!empty($line->fk_parent_line)) {
$this->tpl['label'] .= img_picto('', 'rightarrow');
}
if (($line->info_bits & 2) == 2) {
$discount = new DiscountAbsolute($this->db);
$discount->fk_soc = $this->socid;
$this->tpl['label'] .= $discount->getNomUrl(0, 'discount');
} else {
if ($line->fk_product) {
$productstatic = new Product($this->db);
$productstatic->id = $line->fk_product;
$productstatic->ref = $line->ref;
$productstatic->type = $line->fk_product_type;
$this->tpl['label'] .= $productstatic->getNomUrl(1);
$this->tpl['label'] .= $line->label ? ' - ' . $line->label : '';
// Dates
if ($line->product_type == 1 && ($date_start || $date_end)) {
$this->tpl['label'] .= get_date_range($date_start, $date_end);
}
} else {
$this->tpl['label'] .= $line->product_type == -1 ? ' ' : ($line->product_type == 1 ? img_object($langs->trans(''), 'service') : img_object($langs->trans(''), 'product'));
$this->tpl['label'] .= $line->label ? ' ' . $line->label : '';
// Dates
if ($line->product_type == 1 && ($date_start || $date_end)) {
$this->tpl['label'] .= get_date_range($date_start, $date_end);
}
}
}
if ($line->desc) {
if ($line->desc == '(CREDIT_NOTE)') {
$discount = new DiscountAbsolute($this->db);
$discount->fetch($line->fk_remise_except);
$this->tpl['description'] = $langs->transnoentities("DiscountFromCreditNote", $discount->getNomUrl(0));
} elseif ($line->desc == '(DEPOSIT)') {
$discount = new DiscountAbsolute($this->db);
$discount->fetch($line->fk_remise_except);
$this->tpl['description'] = $langs->transnoentities("DiscountFromDeposit", $discount->getNomUrl(0));
} else {
$this->tpl['description'] = dol_trunc($line->desc, 60);
}
} else {
$this->tpl['description'] = ' ';
}
$this->tpl['vat_rate'] = vatrate($line->tva_tx, true);
$this->tpl['price'] = price($line->subprice);
$this->tpl['qty'] = ($line->info_bits & 2) != 2 ? $line->qty : ' ';
$this->tpl['remise_percent'] = ($line->info_bits & 2) != 2 ? vatrate($line->remise_percent, true) : ' ';
// Output template part (modules that overwrite templates must declare this into descriptor)
// Use global variables + $dateSelector + $seller and $buyer
$dirtpls = array_merge($conf->modules_parts['tpl'], array('/core/tpl'));
foreach ($dirtpls as $reldir) {
$res = @(include dol_buildpath($reldir . '/originproductline.tpl.php'));
if ($res) {
break;
}
}
}