Skip to content

Commit

Permalink
{package}: [update] - general fiscalization stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
tkresic committed Feb 9, 2021
1 parent e1878b0 commit 29d8656
Show file tree
Hide file tree
Showing 14 changed files with 1,147 additions and 41 deletions.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,23 @@
[![](https://img.shields.io/badge/version-0.0.1-blue.svg)](https://shields.io/)
[![](https://img.shields.io/badge/maintained-yes-green.svg)](https://shields.io/)

## Quick start
PHP package for Croatian fiscalization.


## Install the packages

- `composer install`


## Update required fields in tests

In order for tests to work, head to `tests\CroatianFiscalizationTest` and change the required fields which you will need to have in order for fiscalization to work:

- Test certificate with path and password
- Company UID
- Operative user UID


## Run the tests

- `php vendor/phpunit/phpunit/phpunit`
7 changes: 6 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@
],
"type": "library",
"require": {
"php": "^7.4"
"php": "^7.4",
"ext-xmlwriter": "*",
"ext-openssl": "*",
"ext-dom": "*",
"ext-curl": "*",
"ext-simplexml": "*"
},
"require-dev": {
"phpunit/phpunit": "^8.5"
Expand Down
8 changes: 0 additions & 8 deletions src/Bill/Bill.php

This file was deleted.

8 changes: 0 additions & 8 deletions src/Bill/BillNumber.php

This file was deleted.

8 changes: 0 additions & 8 deletions src/Bill/BillRequest.php

This file was deleted.

8 changes: 0 additions & 8 deletions src/Bill/TaxRate.php

This file was deleted.

32 changes: 32 additions & 0 deletions src/Company/Certificate.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

namespace tonikresic\CroatianFiscalization\Company;

class Certificate
{
/**
* Path to the Certificate.
*
* @var string
*/
public string $path;

/**
* Certificate password.
*
* @var string
*/
public string $password;

/**
* Certificate constructor.
*
* @param string $path
* @param string $password
*/
public function __construct(string $path, string $password)
{
$this->path = $path;
$this->password = $password;
}
}
51 changes: 51 additions & 0 deletions src/Company/Company.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php

namespace tonikresic\CroatianFiscalization\Company;

class Company
{
/**
* Company UID.
*
* @var string
*/
public string $uid;

/**
* Company fiscalization Certificate.
*
* @var Certificate
*/
public Certificate $certificate;

/**
* Demo fiscalization.
*
* @var bool
*/
public bool $demo;


/**
* If the Invoice should be taxed.
*
* @var bool
*/
public bool $shouldBeTaxed;

/**
* Company constructor.
*
* @param string $uid
* @param Certificate $certificate
* @param bool $demo
* @param bool $shouldBeTaxed
*/
public function __construct(string $uid, Certificate $certificate, bool $demo, bool $shouldBeTaxed)
{
$this->uid = $uid;
$this->certificate = $certificate;
$this->demo = $demo;
$this->shouldBeTaxed = $shouldBeTaxed;
}
}
Loading

0 comments on commit 29d8656

Please sign in to comment.