code fixes

This commit is contained in:
Dennis Eichhorn 2024-03-15 20:24:38 +00:00
parent 7110ed87fa
commit 81a7ef60da
6 changed files with 35 additions and 7 deletions

View File

@ -29,6 +29,18 @@
"name": "tax_code_input",
"type": "INT(11)",
"null": false
},
"tax_code_tax1_account": {
"name": "tax_code_tax1_account",
"type": "VARCHAR(10)",
"null": false,
"default": null
},
"tax_code_tax2_account": {
"name": "tax_code_tax2_account",
"type": "VARCHAR(10)",
"null": false,
"default": null
}
}
},

View File

@ -73,6 +73,8 @@
"percentage_invoice": 70000,
"percentage_sales_tax": 70000,
"percentage_input_tax": 70000,
"tax1_account": "1571",
"tax2_account": null,
"tax_report": {
"base": null,
"amount": 43
@ -92,6 +94,8 @@
"percentage_invoice": 190000,
"percentage_sales_tax": 190000,
"percentage_input_tax": 190000,
"tax1_account": "1576",
"tax2_account": null,
"tax_report": {
"base": null,
"amount": 43
@ -130,6 +134,8 @@
"percentage_invoice": 70000,
"percentage_sales_tax": 70000,
"percentage_input_tax": 70000,
"tax1_account": null,
"tax2_account": "1771",
"tax_report": {
"base": null,
"amount": 43
@ -149,6 +155,8 @@
"percentage_invoice": 190000,
"percentage_sales_tax": 190000,
"percentage_input_tax": 190000,
"tax1_account": null,
"tax2_account": "1776",
"tax_report": {
"base": null,
"amount": 43
@ -168,6 +176,8 @@
"percentage_invoice": 0,
"percentage_sales_tax": 190000,
"percentage_input_tax": 190000,
"tax1_account": "1574",
"tax2_account": "1774",
"tax_report": {
"base": null,
"amount": 43

View File

@ -80,6 +80,8 @@ final class Installer extends InstallerAbstract
$request->setData('abbr', $data['abbr'] ?? '');
$request->setData('percentage_invoice', $data['percentage_invoice'] ?? 0);
$request->setData('percentage_sales_tax', $data['percentage_sales_tax'] ?? 0);
$request->setData('tax1', $data['tax1_account'] ?? null);
$request->setData('tax2', $data['tax2_account'] ?? null);
$request->setData('percentage_input_tax', $data['percentage_input_tax'] ?? 0);
$request->setData('title', \reset($data['l11n'])['title'] ?? '');
$request->setData('short', \reset($data['l11n'])['short'] ?? '');

View File

@ -97,6 +97,8 @@ final class ApiController extends Controller
$code->percentageInvoice = $request->getDataInt('percentage_invoice') ?? 0;
$code->percentageSales = $request->getDataInt('percentage_sales_tax') ?? 0;
$code->percentageInput = $request->getDataInt('percentage_input_tax') ?? 0;
$code->taxAccount1 = $request->getDataString('tax1');
$code->taxAccount2 = $request->getDataString('tax2');
if ($request->hasData('title')) {
$code->l11n->title = $request->getDataString('title') ?? '';

View File

@ -44,9 +44,9 @@ class TaxCode implements \JsonSerializable
// 1. Account (gross postings are automatically split)
// 2. Tax code
// 3. Tax combination
public ?int $taxAccount1 = null;
public ?string $taxAccount1 = null;
public ?int $taxAccount2 = null;
public ?string $taxAccount2 = null;
/**
* Localization.

View File

@ -41,6 +41,8 @@ final class TaxCodeMapper extends DataMapperFactory
'tax_code_invoice' => ['name' => 'tax_code_invoice', 'type' => 'int', 'internal' => 'percentageInvoice'],
'tax_code_sales' => ['name' => 'tax_code_sales', 'type' => 'int', 'internal' => 'percentageSales'],
'tax_code_input' => ['name' => 'tax_code_input', 'type' => 'int', 'internal' => 'percentageInput'],
'tax_code_tax1_account' => ['name' => 'tax_code_tax1_account', 'type' => 'string', 'internal' => 'taxAccount1'],
'tax_code_tax2_account' => ['name' => 'tax_code_tax2_account', 'type' => 'string', 'internal' => 'taxAccount2'],
];
/**