Example #1
0
/**
 *	Return line remise percent
 *
 *	@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_getlineremisepercent($object, $i, $outputlangs, $hidedetails = 0)
{
    global $hookmanager;
    include_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
    $reshook = 0;
    $result = '';
    //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_getlineremisepercent', $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 ($object->lines[$i]->special_code == 3) {
            return '';
        }
        if (empty($hidedetails) || $hidedetails > 1) {
            $result .= dol_print_reduction($object->lines[$i]->remise_percent, $outputlangs);
        }
    }
    return $result;
}
Example #2
0
    print '<td align="left" class="linecoluseunit nowrap">';
    $label = $line->getLabelOfUnit('short');
    if ($label !== '') {
        print $langs->trans($label);
    }
    print '</td>';
}
?>

	<?php 
if (!empty($line->remise_percent) && $line->special_code != 3) {
    ?>
	<td class="linecoldiscount" align="right"><?php 
    $coldisplay++;
    include_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
    echo dol_print_reduction($line->remise_percent, $langs);
    ?>
</td>
	<?php 
} else {
    ?>
	<td class="linecoldiscount"><?php 
    $coldisplay++;
    ?>
&nbsp;</td>
	<?php 
}
if ($this->situation_cycle_ref) {
    $coldisplay++;
    print '<td align="right" class="linecolcycleref nowrap">' . $line->situation_percent . '%</td>';
}
 if (!$line->fk_product) {
     if ($type == 1) {
         $text = img_object($langs->trans('Service'), 'service');
     } else {
         $text = img_object($langs->trans('Product'), 'product');
     }
     print $text . ' ' . nl2br($line->description);
     // Show range
     print_date_range($date_start, $date_end);
 }
 print '</td>';
 print '<td align="right" class="nowrap">' . vatrate($line->tva_tx) . '%</td>';
 print '<td align="right" class="nowrap">' . price($line->subprice) . "</td>\n";
 print '<td align="right" class="nowrap">' . $line->qty . '</td>';
 if ($line->remise_percent > 0) {
     print '<td align="right" class="nowrap">' . dol_print_reduction($line->remise_percent, $langs) . "</td>\n";
 } else {
     print '<td>&nbsp;</td>';
 }
 print '<td align="right" class="nowrap">' . price($line->total_ht) . '</td>';
 if (is_object($hookmanager)) {
     $parameters = array('line' => $line, 'num' => $num, 'i' => $i);
     $reshook = $hookmanager->executeHooks('printObjectLine', $parameters, $object, $action);
 }
 if ($object->statut == 0 && $user->rights->fournisseur->commande->creer) {
     print '<td align="center" width="16"><a href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&amp;action=edit_line&amp;rowid=' . $line->id . '#' . $line->id . '">';
     print img_edit();
     print '</a></td>';
     $actiondelete = 'delete_product_line';
     print '<td align="center" width="16"><a href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&amp;action=' . $actiondelete . '&amp;lineid=' . $line->id . '">';
     print img_delete();
Example #4
0
/**
 *	Return line remise percent
 *
 *	@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)
 *  @param	HookManager	$hookmanager		Hook manager instance
 * 	@return	void
 */
function pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails = 0, $hookmanager = false)
{
    include_once DOL_DOCUMENT_ROOT . "/core/lib/functions2.lib.php";
    if ($object->lines[$i]->special_code != 3) {
        if (is_object($hookmanager) && ($object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code) || !empty($object->lines[$i]->fk_parent_line))) {
            $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 = '';
            return $hookmanager->executeHooks('pdf_getlineremisepercent', $parameters, $object, $action);
            // Note that $action and $object may have been modified by some hooks
        } else {
            if (empty($hidedetails) || $hidedetails > 1) {
                return dol_print_reduction($object->lines[$i]->remise_percent, $outputlangs);
            }
        }
    }
}
		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 '&nbsp;';	?>
	</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>&nbsp;</td>
	<?php } ?>

	<?php if ($line->special_code == 3)	{ ?>
	<td align="right" nowrap="nowrap"><?php echo $langs->trans('Option'); ?></td>
	<?php } else { ?>
	<td align="right" nowrap="nowrap"><?php echo price($line->total_ht); ?></td>
	<?php } ?>

	<?php if ($this->statut == 0  && $user->rights->$element->creer) { ?>
	<td align="center">
		<?php if (($line->info_bits & 2) == 2) { ?>
		<?php } else { ?>
		<a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=editline&amp;lineid='.$line->id.'#'.$line->id; ?>">
Example #6
0
/**
 *	Return line remise percent
 *	@param		object				Object
 *	@param		i					Current line number
 *  @param    	outputlangs			Object langs for output
 *  @param		hidedetails			Hide value
 *  								0 = no
 *  								1 = yes
 *  								2 = just special lines
 */
function pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails = 0)
{
    include_once DOL_DOCUMENT_ROOT . "/lib/functions2.lib.php";
    if ($object->lines[$i]->special_code != 3) {
        if (!empty($object->hooks) && ($object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code) || !empty($object->lines[$i]->fk_parent_line))) {
            $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);
            }
            foreach ($object->hooks as $hook) {
                if (method_exists($hook['modules'][$special_code], 'pdf_getlineremisepercent')) {
                    return $hook['modules'][$special_code]->pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails);
                }
            }
        } else {
            if (empty($hidedetails) || $hidedetails > 1) {
                return dol_print_reduction($object->lines[$i]->remise_percent, $outputlangs);
            }
        }
    }
}