Revize 2110
Přidáno uživatelem David Raška před asi 11 roky(ů)
freenetis/branches/1.1/application/i18n/cs_CZ/texts.php | ||
---|---|---|
'suffix has to start with slash character and has to end with slash character' => 'Přípona musí začínat lomítkem a musí končit lomítkem.',
|
||
'suggest amount' => 'Navrhovaná částka',
|
||
'sum' => 'Součet',
|
||
'sum of costs and total cost are not equal' => 'Součet částek nesouhlasí s celkovou částkou.',
|
||
'summary' => 'Shrnutí',
|
||
'partner' => 'Partner',
|
||
'suppliers account' => 'Účet dodavatelů',
|
freenetis/branches/1.1/application/libraries/phone_invoice_parsers/Vodafone_Onenet_Xml.php | ||
---|---|---|
$xml_path = array();
|
||
|
||
$total_bill_sum = FALSE;
|
||
$cost = 0.0;
|
||
$tax = 0.0;
|
||
$total_cost = 0.0;
|
||
$total_tax = 0.0;
|
||
$service = new stdClass();
|
||
|
||
$phone_list_total_cost = 0.0;
|
||
$phone_list_total_cost_tax = 0.0;
|
||
|
||
$phone_list = array();
|
||
|
||
while ($xml->read())
|
||
{
|
||
if ($xml->nodeType == XMLReader::ELEMENT)
|
||
... | ... | |
case 'cost':
|
||
$service->price = $xml->readString();
|
||
break;
|
||
case 'cost_tax':
|
||
$service->cost_tax = $xml->readString();
|
||
break;
|
||
case 'real_cost':
|
||
$service->real_cost = $xml->readString();
|
||
break;
|
||
case 'r_dur':
|
||
$service->duration = gmdate('H:i:s', $xml->readString());
|
||
break;
|
||
... | ... | |
case 'cost':
|
||
if ($total_bill_sum)
|
||
{
|
||
$cost = (float)$xml->readString();
|
||
$total_cost = (float)$xml->readString();
|
||
}
|
||
break;
|
||
case 'cost_tax':
|
||
if ($total_bill_sum)
|
||
{
|
||
$tax = (float)$xml->readString() - $cost;
|
||
$total_tax = (float)$xml->readString() - $total_cost;
|
||
}
|
||
break;
|
||
}
|
||
}
|
||
else if ($prev == 'phone_list')
|
||
{
|
||
switch ($xml->name)
|
||
{
|
||
case 'pA':
|
||
$phone_list[] = $xml->readString();
|
||
break;
|
||
case 'cost':
|
||
$phone_list_total_cost += $xml->readString();
|
||
break;
|
||
case 'cost_tax':
|
||
$phone_list_total_cost_tax += $xml->readString();
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
else if ($xml->nodeType == XMLReader::END_ELEMENT)
|
||
{
|
||
... | ... | |
|
||
if ($xml->name == 'dur' && $end == 'Document')
|
||
{
|
||
if ($service->price != $service->real_cost)
|
||
{
|
||
throw new Exception('Cost and Real cost are not equal');
|
||
}
|
||
|
||
try
|
||
{
|
||
$services = $data->get_bill_number($service->pa);
|
||
... | ... | |
}
|
||
}
|
||
|
||
if ($integrity_test_enabled)
|
||
{
|
||
foreach ($data->bill_numbers as $p => $d)
|
||
if (!in_array($p, $phone_list))
|
||
throw new Exception(__("Some phones wasn't founded").$p);
|
||
}
|
||
|
||
if (round($total_cost) != round($phone_list_total_cost) ||
|
||
round($total_cost+$total_tax) != round($phone_list_total_cost_tax))
|
||
{
|
||
throw new Exception('Sum of costs and total cost are not equal.');
|
||
}
|
||
|
||
$xml->close();
|
||
|
||
$data->dph = $tax;
|
||
$data->dph_rate = round((($cost + $tax)/$cost - 1) * 100);
|
||
$data->total_price = $cost;
|
||
$data->dph = $total_tax;
|
||
$data->dph_rate = round((($total_cost + $total_tax)/$total_cost - 1) * 100);
|
||
$data->total_price = $total_cost;
|
||
|
||
return $data;
|
||
}
|
Také k dispozici: Unified diff
Upravy:
- Pridani validace castky na fakture a castkami u jednotlivych cisel