mirror of
https://github.com/Karaka-Management/oms-Accounting.git
synced 2026-01-26 03:28:39 +00:00
bug and media fixes
This commit is contained in:
parent
804e1fa71d
commit
89c2beacf1
|
|
@ -13,5 +13,5 @@
|
|||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
'0100' => ''
|
||||
'0100' => '',
|
||||
];
|
||||
|
|
|
|||
|
|
@ -14,9 +14,9 @@ declare(strict_types=1);
|
|||
|
||||
namespace Modules\Accounting\Controller;
|
||||
|
||||
use phpOMS\Message\Http\RequestStatusCode;
|
||||
use phpOMS\Message\RequestAbstract;
|
||||
use phpOMS\Message\ResponseAbstract;
|
||||
use phpOMS\Message\Http\RequestStatusCode;
|
||||
use phpOMS\Model\Message\FormValidation;
|
||||
|
||||
/**
|
||||
|
|
@ -31,7 +31,7 @@ use phpOMS\Model\Message\FormValidation;
|
|||
*/
|
||||
final class ApiController extends Controller
|
||||
{
|
||||
/**
|
||||
/**
|
||||
* Api method to create an account
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
|
|
|
|||
|
|
@ -85,9 +85,9 @@ abstract class AccountAbstract
|
|||
/**
|
||||
* Get entry.
|
||||
*
|
||||
* @param \DateTime $start Interval start
|
||||
* @param \DateTime $start Interval start
|
||||
* @param null|\DateTime $end Interval end
|
||||
* @param int $dateType Date type by witch the entries should be filtered
|
||||
* @param int $dateType Date type by witch the entries should be filtered
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
|
|
|
|||
|
|
@ -111,11 +111,11 @@ class BalanceL11n implements \JsonSerializable, ArrayableInterface
|
|||
public function toArray() : array
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'name' => $this->name,
|
||||
'id' => $this->id,
|
||||
'name' => $this->name,
|
||||
'description' => $this->description,
|
||||
'balance' => $this->balance,
|
||||
'language' => $this->language,
|
||||
'balance' => $this->balance,
|
||||
'language' => $this->language,
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -84,8 +84,8 @@ class CostCenter
|
|||
public function toArray() : array
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'code' => $this->code,
|
||||
'id' => $this->id,
|
||||
'code' => $this->code,
|
||||
'parent' => $this->parent,
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -111,11 +111,11 @@ class CostCenterL11n implements \JsonSerializable, ArrayableInterface
|
|||
public function toArray() : array
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'name' => $this->name,
|
||||
'id' => $this->id,
|
||||
'name' => $this->name,
|
||||
'description' => $this->description,
|
||||
'costcenter' => $this->costcenter,
|
||||
'language' => $this->language,
|
||||
'costcenter' => $this->costcenter,
|
||||
'language' => $this->language,
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -84,8 +84,8 @@ class CostObject
|
|||
public function toArray() : array
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'code' => $this->code,
|
||||
'id' => $this->id,
|
||||
'code' => $this->code,
|
||||
'parent' => $this->parent,
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -111,11 +111,11 @@ class CostObjectL11n implements \JsonSerializable, ArrayableInterface
|
|||
public function toArray() : array
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'name' => $this->name,
|
||||
'id' => $this->id,
|
||||
'name' => $this->name,
|
||||
'description' => $this->description,
|
||||
'costobject' => $this->costobject,
|
||||
'language' => $this->language,
|
||||
'costobject' => $this->costobject,
|
||||
'language' => $this->language,
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ class Creditor
|
|||
public function toArray() : array
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'id' => $this->id,
|
||||
'account' => $this->account,
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ class Debitor
|
|||
public function toArray() : array
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'id' => $this->id,
|
||||
'account' => $this->account,
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ return ['Accounting' => [
|
|||
'CostCenter' => 'Kostnadssted',
|
||||
'CostCenters' => 'Kostnadssteder',
|
||||
'CostObject' => 'Kostnadsbærer',
|
||||
'CostObjects' => 'Kostnads objekter',
|
||||
'CostObjects' => "Kostnads \u{200b}\u{200b}objekter",
|
||||
'Created' => 'laget',
|
||||
'Creator' => 'skaperen',
|
||||
'Credit' => 'Kreditt',
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ return ['Accounting' => [
|
|||
'CostCenter' => 'Kostnadscenter',
|
||||
'CostCenters' => 'Kostnadsställen',
|
||||
'CostObject' => 'Kostnadsobjekt',
|
||||
'CostObjects' => 'Kostnads Objects',
|
||||
'CostObjects' => "Kostnads \u{200b}\u{200b}Objects",
|
||||
'Created' => 'Skapad',
|
||||
'Creator' => 'Skapare',
|
||||
'Credit' => 'Kreditera',
|
||||
|
|
|
|||
|
|
@ -392,4 +392,4 @@ function phpServe() : void
|
|||
});
|
||||
}
|
||||
|
||||
phpServe();
|
||||
\phpServe();
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ trait ApiControllerBatchEntryTrait
|
|||
*/
|
||||
public function testApiBatchEntryCreate() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
|
||||
$request->header->account = 1;
|
||||
|
|
@ -45,7 +45,7 @@ trait ApiControllerBatchEntryTrait
|
|||
*/
|
||||
public function testApiBatchEntryCreateInvalid() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
|
||||
$request->header->account = 1;
|
||||
|
|
@ -61,7 +61,7 @@ trait ApiControllerBatchEntryTrait
|
|||
*/
|
||||
public function testApiBatchEntryUpdate() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
|
||||
$request->header->account = 1;
|
||||
|
|
@ -79,7 +79,7 @@ trait ApiControllerBatchEntryTrait
|
|||
*/
|
||||
public function testApiBatchEntryUpdateInvalid() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
|
||||
$request->header->account = 1;
|
||||
|
|
@ -95,7 +95,7 @@ trait ApiControllerBatchEntryTrait
|
|||
*/
|
||||
public function testApiRecurringEntryCreate() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
|
||||
$request->header->account = 1;
|
||||
|
|
@ -113,7 +113,7 @@ trait ApiControllerBatchEntryTrait
|
|||
*/
|
||||
public function testApiRecurringEntryCreateInvalid() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
|
||||
$request->header->account = 1;
|
||||
|
|
@ -129,7 +129,7 @@ trait ApiControllerBatchEntryTrait
|
|||
*/
|
||||
public function testApiRecurringEntryUpdate() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
|
||||
$request->header->account = 1;
|
||||
|
|
@ -147,7 +147,7 @@ trait ApiControllerBatchEntryTrait
|
|||
*/
|
||||
public function testApiRecurringEntryUpdateInvalid() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
|
||||
$request->header->account = 1;
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ trait ApiControllerCostCenterTrait
|
|||
*/
|
||||
public function testApiCostCenterCreate() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
|
||||
$request->header->account = 1;
|
||||
|
|
@ -45,7 +45,7 @@ trait ApiControllerCostCenterTrait
|
|||
*/
|
||||
public function testApiCostCenterCreateInvalid() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
|
||||
$request->header->account = 1;
|
||||
|
|
@ -61,7 +61,7 @@ trait ApiControllerCostCenterTrait
|
|||
*/
|
||||
public function testApiCostCenterUpdate() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
|
||||
$request->header->account = 1;
|
||||
|
|
@ -79,7 +79,7 @@ trait ApiControllerCostCenterTrait
|
|||
*/
|
||||
public function testApiCostCenterUpdateInvalid() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
|
||||
$request->header->account = 1;
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ trait ApiControllerCostObjectTrait
|
|||
*/
|
||||
public function testApiCostObjectCreate() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
|
||||
$request->header->account = 1;
|
||||
|
|
@ -45,7 +45,7 @@ trait ApiControllerCostObjectTrait
|
|||
*/
|
||||
public function testApiCostObjectCreateInvalid() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
|
||||
$request->header->account = 1;
|
||||
|
|
@ -61,7 +61,7 @@ trait ApiControllerCostObjectTrait
|
|||
*/
|
||||
public function testApiCostObjectUpdate() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
|
||||
$request->header->account = 1;
|
||||
|
|
@ -79,7 +79,7 @@ trait ApiControllerCostObjectTrait
|
|||
*/
|
||||
public function testApiCostObjectUpdateInvalid() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
|
||||
$request->header->account = 1;
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ trait ApiControllerTaxKeyTrait
|
|||
*/
|
||||
public function testApiTaxKeyCreate() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
|
||||
$request->header->account = 1;
|
||||
|
|
@ -45,7 +45,7 @@ trait ApiControllerTaxKeyTrait
|
|||
*/
|
||||
public function testApiTaxKeyCreateInvalid() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
|
||||
$request->header->account = 1;
|
||||
|
|
@ -61,7 +61,7 @@ trait ApiControllerTaxKeyTrait
|
|||
*/
|
||||
public function testApiTaxKeyUpdate() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
|
||||
$request->header->account = 1;
|
||||
|
|
@ -79,7 +79,7 @@ trait ApiControllerTaxKeyTrait
|
|||
*/
|
||||
public function testApiTaxKeyUpdateInvalid() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
|
||||
$request->header->account = 1;
|
||||
|
|
|
|||
|
|
@ -15,13 +15,13 @@ declare(strict_types=1);
|
|||
namespace Modules\Accounting\tests\Controller;
|
||||
|
||||
use Model\CoreSettings;
|
||||
use Modules\Admin\Models\AccountPermission;
|
||||
use Modules\Accounting\tests\Controller\Api\ApiControllerAccountTrait;
|
||||
use Modules\Accounting\tests\Controller\Api\ApiControllerBatchEntryTrait;
|
||||
use Modules\Accounting\tests\Controller\Api\ApiControllerCostCenterTrait;
|
||||
use Modules\Accounting\tests\Controller\Api\ApiControllerCostObjectTrait;
|
||||
use Modules\Accounting\tests\Controller\Api\ApiControllerTaxKeyTrait;
|
||||
use Modules\Accounting\tests\Controller\Api\ApiControllerEntryTrait;
|
||||
use Modules\Accounting\tests\Controller\Api\ApiControllerBatchEntryTrait;
|
||||
use Modules\Accounting\tests\Controller\Api\ApiControllerTaxKeyTrait;
|
||||
use Modules\Admin\Models\AccountPermission;
|
||||
use phpOMS\Account\Account;
|
||||
use phpOMS\Account\AccountManager;
|
||||
use phpOMS\Account\PermissionType;
|
||||
|
|
|
|||
|
|
@ -37,8 +37,8 @@ final class AccountAbstractTest extends \PHPUnit\Framework\TestCase
|
|||
public function testDefault() : void
|
||||
{
|
||||
self::assertEquals(0, $this->class->getId());
|
||||
self::assertEquals(null, $this->class->summaryAccount);
|
||||
self::assertEquals(null, $this->class->getEntryById(0));
|
||||
self::assertNull($this->class->summaryAccount);
|
||||
self::assertNull($this->class->getEntryById(0));
|
||||
self::assertEquals([], $this->class->getEntriesByDate(new \DateTime()));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -81,18 +81,18 @@ final class BalanceL11nTest extends \PHPUnit\Framework\TestCase
|
|||
*/
|
||||
public function testSerialize() : void
|
||||
{
|
||||
$this->l11n->name = 'Title';
|
||||
$this->l11n->name = 'Title';
|
||||
$this->l11n->description = 'Description';
|
||||
$this->l11n->balance = 2;
|
||||
$this->l11n->balance = 2;
|
||||
$this->l11n->setLanguage(ISO639x1Enum::_DE);
|
||||
|
||||
self::assertEquals(
|
||||
[
|
||||
'id' => 0,
|
||||
'name' => 'Title',
|
||||
'id' => 0,
|
||||
'name' => 'Title',
|
||||
'description' => 'Description',
|
||||
'balance' => 2,
|
||||
'language' => ISO639x1Enum::_DE,
|
||||
'balance' => 2,
|
||||
'language' => ISO639x1Enum::_DE,
|
||||
],
|
||||
$this->l11n->jsonSerialize()
|
||||
);
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ final class BatchPostingTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals(0, $this->batch->creator);
|
||||
self::assertEquals('', $this->batch->description);
|
||||
self::assertEquals(0, $this->batch->count());
|
||||
self::assertEquals(null, $this->batch->getPosting(1));
|
||||
self::assertNull($this->batch->getPosting(1));
|
||||
self::assertInstanceOf('\DateTimeImmutable', $this->batch->created);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -81,18 +81,18 @@ final class CostCenterL11nTest extends \PHPUnit\Framework\TestCase
|
|||
*/
|
||||
public function testSerialize() : void
|
||||
{
|
||||
$this->l11n->name = 'Title';
|
||||
$this->l11n->description = 'Description';
|
||||
$this->l11n->name = 'Title';
|
||||
$this->l11n->description = 'Description';
|
||||
$this->l11n->costcenter = 2;
|
||||
$this->l11n->setLanguage(ISO639x1Enum::_DE);
|
||||
|
||||
self::assertEquals(
|
||||
[
|
||||
'id' => 0,
|
||||
'name' => 'Title',
|
||||
'id' => 0,
|
||||
'name' => 'Title',
|
||||
'description' => 'Description',
|
||||
'costcenter' => 2,
|
||||
'language' => ISO639x1Enum::_DE,
|
||||
'costcenter' => 2,
|
||||
'language' => ISO639x1Enum::_DE,
|
||||
],
|
||||
$this->l11n->jsonSerialize()
|
||||
);
|
||||
|
|
|
|||
|
|
@ -72,8 +72,8 @@ final class CostCenterTest extends \PHPUnit\Framework\TestCase
|
|||
|
||||
self::assertEquals(
|
||||
[
|
||||
'id' => 0,
|
||||
'code' => '123',
|
||||
'id' => 0,
|
||||
'code' => '123',
|
||||
'parent' => null,
|
||||
],
|
||||
$this->cc->jsonSerialize()
|
||||
|
|
|
|||
|
|
@ -81,18 +81,18 @@ final class CostObjectL11nTest extends \PHPUnit\Framework\TestCase
|
|||
*/
|
||||
public function testSerialize() : void
|
||||
{
|
||||
$this->l11n->name = 'Title';
|
||||
$this->l11n->description = 'Description';
|
||||
$this->l11n->name = 'Title';
|
||||
$this->l11n->description = 'Description';
|
||||
$this->l11n->costobject = 2;
|
||||
$this->l11n->setLanguage(ISO639x1Enum::_DE);
|
||||
|
||||
self::assertEquals(
|
||||
[
|
||||
'id' => 0,
|
||||
'name' => 'Title',
|
||||
'id' => 0,
|
||||
'name' => 'Title',
|
||||
'description' => 'Description',
|
||||
'costobject' => 2,
|
||||
'language' => ISO639x1Enum::_DE,
|
||||
'costobject' => 2,
|
||||
'language' => ISO639x1Enum::_DE,
|
||||
],
|
||||
$this->l11n->jsonSerialize()
|
||||
);
|
||||
|
|
|
|||
|
|
@ -72,8 +72,8 @@ final class CostObjectTest extends \PHPUnit\Framework\TestCase
|
|||
|
||||
self::assertEquals(
|
||||
[
|
||||
'id' => 0,
|
||||
'code' => '123',
|
||||
'id' => 0,
|
||||
'code' => '123',
|
||||
'parent' => null,
|
||||
],
|
||||
$this->co->jsonSerialize()
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ final class CreditorTest extends \PHPUnit\Framework\TestCase
|
|||
{
|
||||
self::assertEquals(
|
||||
[
|
||||
'id' => 0,
|
||||
'id' => 0,
|
||||
'account' => null,
|
||||
],
|
||||
$this->creditor->jsonSerialize()
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ final class DebitorTest extends \PHPUnit\Framework\TestCase
|
|||
{
|
||||
self::assertEquals(
|
||||
[
|
||||
'id' => 0,
|
||||
'id' => 0,
|
||||
'account' => null,
|
||||
],
|
||||
$this->debitor->jsonSerialize()
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user