-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recyklační příspěvky přímo ve faktuře #42
Comments
Vyřešil jsem takto: 1/ vytvořením nového <?php declare(strict_types=1);
namespace Riesenia\Pohoda\Invoice;
use Riesenia\Pohoda\Agenda;
use Riesenia\Pohoda\Common\OptionsResolver;
class RecyclingContrib extends Agenda
{
/** @var string[] */
protected $_refElements = ['recyclingContribType'];
/** @var string[] */
protected $_elements = ['recyclingContribType', 'recyclingContribText', 'recyclingContribAmount', 'recyclingContribUnit', 'coefficientOfRecyclingContrib'];
/**
* {@inheritdoc}
*/
public function getXML(): \SimpleXMLElement
{
$xml = $this->_createXML()->addChild('inv:recyclingContrib', '', $this->_namespace('inv'));
$this->_addElements($xml, $this->_elements, 'typ');
return $xml;
}
/**
* {@inheritdoc}
*/
protected function _configureOptions(OptionsResolver $resolver)
{
// available options
$resolver->setDefined($this->_elements);
$resolver->setNormalizer('recyclingContribType', $resolver->getNormalizer('string32'));
$resolver->setNormalizer('recyclingContribText', $resolver->getNormalizer('string90'));
$resolver->setNormalizer('recyclingContribAmount', $resolver->getNormalizer('float'));
$resolver->setNormalizer('recyclingContribUnit', $resolver->getNormalizer('string2'));
$resolver->setNormalizer('coefficientOfRecyclingContrib', $resolver->getNormalizer('float'));
}
} 2/ úpravou protected $_elements = ['text', 'quantity', 'unit', 'coefficient', 'payVAT', 'rateVAT', 'percentVAT', 'discountPercentage', 'homeCurrency', 'foreignCurrency', 'typeServiceMOSS', 'note', 'code', 'guarantee', 'guaranteeType', 'stockItem', 'accounting', 'classificationVAT', 'classificationKVDPH', 'centre', 'activity', 'contract', 'expirationDate', 'PDP', 'recyclingContrib']; a public function __construct(array $data, string $ico, bool $resolveOptions = true)
{
if (isset($data['recyclingContrib'])) {
$data['recyclingContrib'] = new RecyclingContrib($data['recyclingContrib'], $ico, $resolveOptions);
}
parent::__construct($data, $ico, $resolveOptions);
} Omlouvám se, že neposílám rovnou PR, ale řešil jsem velmi narychlo. |
zdravim. budete mat priestor na toto spravit pr? |
@segy zkusím v pátek. |
kedykolvek :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
RP lze zadat i přímo do faktury:
XML requestu pak vypadá takto:
The text was updated successfully, but these errors were encountered: