fix billing process

This commit is contained in:
Dennis Eichhorn 2023-04-08 04:36:25 +02:00
parent e5c90f2de9
commit 5e73406405
3 changed files with 17 additions and 11 deletions

View File

@ -8,9 +8,11 @@ assignees: ''
---
# Bug Description
A clear and concise description of what the bug is.
# How to Reproduce
Steps to reproduce the behavior:
1. Go to '...'
@ -19,16 +21,20 @@ Steps to reproduce the behavior:
4. See error
# Expected Behavior
A clear and concise description of what you expected to happen.
# Screenshots
If applicable, add screenshots to help explain your problem.
# System Information
- System: [e.g. PC or iPhone11, ...]
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- KarakaVersion [e.g. 22]
- System: [e.g. PC or iPhone11, ...]
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- KarakaVersion [e.g. 22]
# Additional Information
Add any other context about the problem here.

View File

@ -46,8 +46,8 @@ final class ApiController extends Controller
private function validateTaxCodeCreate(RequestAbstract $request) : array
{
$val = [];
if (($val['abbr'] = empty($request->getData('abbr')))
|| ($val['title'] = empty($request->getData('title')))
if (($val['abbr'] = !$request->hasData('abbr'))
|| ($val['title'] = !$request->hasData('title'))
) {
return $val;
}
@ -100,7 +100,7 @@ final class ApiController extends Controller
$code->percentageSales = $request->getDataInt('percentage_sales_tax') ?? 0;
$code->percentageInput = $request->getDataInt('percentage_input_tax') ?? 0;
if (!empty($request->getData('title'))) {
if ($request->hasData('title')) {
$code->l11n->title = (string) ($request->getData('title'));
$code->l11n->short = $request->getDataString('short') ?? '';
$code->l11n->long = $request->getDataString('long') ?? '';
@ -122,8 +122,8 @@ final class ApiController extends Controller
private function validateTaxCodeL11nCreate(RequestAbstract $request) : array
{
$val = [];
if (($val['title'] = empty($request->getData('title')))
|| ($val['code'] = empty($request->getData('code')))
if (($val['title'] = !$request->hasData('title'))
|| ($val['code'] = !$request->hasData('code'))
) {
return $val;
}

View File

@ -223,7 +223,7 @@ echo $this->getData('nav')->render();
?>
<tr>
<td><?= $values['month'] . '/' . \substr((string) $values['year'], -2); ?>
<td><?= (new Money(((int) $values['net_sales']) / 1000))->getCurrency(); ?>
<td><?= (new Money(((int) $values['net_sales']) / 10000))->getCurrency(); ?>
<td><?= ((int) $values['customers']); ?>
<?php endforeach; ?>
<tr>
@ -343,7 +343,7 @@ echo $this->getData('nav')->render();
?>
<tr>
<td><?= (string) $values['year']; ?>
<td><?= (new Money(((int) $values['net_sales']) / 1000))->getCurrency(); ?>
<td><?= (new Money(((int) $values['net_sales']) / 10000))->getCurrency(); ?>
<td><?= ((int) $values['customers']); ?>
<?php endforeach; ?>
</table>