59 lines
1.5 KiB
PHP
Executable File
59 lines
1.5 KiB
PHP
Executable File
<?php
|
|
function formatPDFPositions($positions, $focus) {
|
|
$result = array();
|
|
foreach ($positions as $pos) {
|
|
|
|
$pos['position'] = intval($pos['position'])+1;
|
|
|
|
$pos['quantity'] = $pos['quantity'];
|
|
$pos['price_brutto']=format_number($pos['price_brutto']);
|
|
$pos['total_vat']=format_number($pos['total_vat']);
|
|
$pos['ecmvat_value']=format_number($pos['ecmvat_value']);
|
|
$pos['total_brutto']=format_number($pos['total_brutto']);
|
|
$pos['total_netto']=format_number($pos['total_netto']);
|
|
|
|
$result[] = $pos;
|
|
}
|
|
|
|
return $result;
|
|
}
|
|
|
|
function formatPDFPositionsCorrect($pos, $focus) {
|
|
|
|
|
|
|
|
$pos['position'] = intval($pos['position'])+1;
|
|
|
|
$pos['quantity'] = $pos['quantity'];
|
|
$pos['price_netto']=format_number($pos['price_brutto']);
|
|
$pos['total_vat']=format_number($pos['total_vat']);
|
|
$pos['ecmvat_value']=format_number($pos['ecmvat_value']);
|
|
$pos['total_brutto']=format_number($pos['total_brutto']);
|
|
$pos['total_netto']=format_number($pos['total_netto']);
|
|
|
|
|
|
|
|
|
|
return $pos;
|
|
}
|
|
function mysql_escape_gpc($dirty)
|
|
{
|
|
if (ini_get('magic_quotes_gpc'))
|
|
{
|
|
return $dirty;
|
|
}
|
|
else
|
|
{
|
|
return mysql_real_escape_string($dirty);
|
|
}
|
|
}
|
|
function createNumber($num,$numDigits,$stock) {
|
|
$db = $GLOBALS ['db'];
|
|
$n=$db->fetchByAssoc($db->query("select no from ecmstocks where id='".$stock."'"));
|
|
|
|
if($n['no']!=''){
|
|
$add=$n['no'].'/';
|
|
}
|
|
$tmp= sprintf("%0".$numDigits."d",$num);
|
|
return $tmp.'/'.$s.date("Y");
|
|
} |