arraintxo
Repos
7
Followers
10
Following
10

Events

closed issue
2 ivas en una factura

Hola

Como puedo generar en la misma factura 2 vatdetails, tengo algunas facturas que tienen 2 ivas, por ejemplo el 21% y el 10%, tengo el siguiente código

`$subject = $this->getSubject($proveedor['nif'], $proveedor['nombre']);

    $fingerprint = $this->getFingerprint($licencia['licencia_tbai'], $licencia['developer'], $licencia['nombre'], $licencia['version']);

    $header = Header::createSimplified((string)time(), new Date(date('d-m-Y')), new Time(date('H:i:s')), $this->testSerie());
    sleep(1); // Avoid same invoice number as time is used for generation

    $total = $factura['0']['total'];

    $data = new Data('Factura Simplificada', new Amount($total), [Data::VAT_REGIME_01]);

    foreach($factura[$proveedor['id']]['productos'] as $key => $va){
        foreach($va as $k => $val){
            $data->addDetail(new Detail($val['nombre'], new Amount($val['importe'], 12, 8), new Amount($val['unidades']), new Amount($val['total'])));
        }
    }

    $vatDetail = new VatDetail(new Amount($factura[$proveedor['id']]['totales']['total']), new Amount($factura[$proveedor['id']]['totales']['iva'][$iva]), new Amount($factura[$proveedor['id']]['totales']['iva_total']));
    $notExemptBreakdown = new NationalSubjectNotExemptBreakdownItem(NationalSubjectNotExemptBreakdownItem::NOT_EXEMPT_TYPE_S1, [$vatDetail]);

` El problema es que sólo me pilla un IVA y necesito 2 tipos de IVA.

Un saludo

Created at 4 days ago
issue comment
Dokumentazioa

Ziur adibide pare bat jarriko ditugula honetarako denbora apur bat ateratzen dugunean, bitartean test-en artean dagoen TicketBaiMother klasean fakturak zelan sortu ikusi dezakezu: https://github.com/Barnetik/tbai-php-lib/blob/main/tests/Barnetik/Tbai/Mother/TicketBaiMother.php

Hauek sinatu eta bidaltzeko egin beharrekoak ere edozein "Endpoint"eko testetan ikusi dezakezu:

  • Araba: https://github.com/Barnetik/tbai-php-lib/blob/main/tests/Barnetik/Tbai/Api/Araba/EndpointTest.php
  • Bizkaia: https://github.com/Barnetik/tbai-php-lib/blob/main/tests/Barnetik/Tbai/Api/Bizkaia/EndpointTest.php
  • Gipuzkoa: https://github.com/Barnetik/tbai-php-lib/blob/main/tests/Barnetik/Tbai/Api/Gipuzkoa/EndpointTest.php
Created at 4 days ago

Fixed licensing on composer.json

Created at 1 week ago

Update composer.json

Created at 1 week ago
issue comment
2 ivas en una factura

Buenas @decoderz , Tienes un ejemplo de como hacerlo aquí: https://github.com/Barnetik/tbai-php-lib/blob/ed9cc6315ee8e042bffbbb4aad35d99fa41944d6/tests/Barnetik/Tbai/Mother/TicketBaiMother.php#L117

        $data = new Data('factura ejemplo TBAI', new Amount('90.82'), [Data::VAT_REGIME_01]);
        $data->addDetail(new Detail('Artículo 1 Ejemplo', new Amount('23.356', 12, 8), new Amount('1'), new Amount('25.84'), new Amount('2.00')));
        $data->addDetail(new Detail('Artículo 2 xxx', new Amount('18.2', 12, 8), new Amount('1.50'), new Amount('33.03')));
        $data->addDetail(new Detail('Artículo 3 aaaaaaa', new Amount('1.40', 12, 8), new Amount('18'), new Amount('30.49')));
        $data->addDetail(new Detail('Artículo 4 reducido', new Amount('1.40', 12, 8), new Amount('1'), new Amount('1.46')));

        $vatDetail = new VatDetail(new Amount('73.86'), new Amount('21'), new Amount('15.50'));
        $vatDetail2 = new VatDetail(new Amount('1.40'), new Amount('4'), new Amount('0.06'));
        $notExemptBreakdown = new NationalSubjectNotExemptBreakdownItem(NationalSubjectNotExemptBreakdownItem::NOT_EXEMPT_TYPE_S1, [$vatDetail, $vatDetail2]);

        $breakdown = new Breakdown();
        $breakdown->addNationalSubjectNotExemptBreakdownItem($notExemptBreakdown);
Created at 1 week ago

Bugfix when simplified rectification was created using json document

Created at 1 week ago
Created at 3 weeks ago
Created at 3 weeks ago

Update README.md

Created at 3 weeks ago

Update README.md

Created at 3 weeks ago

Testing rectification works for selfEmployed invoices in Bizkaia

Created at 3 weeks ago

Added retries support on invoice submits

git pushMerge branch 'main' of github.com:Barnetik/tbai-php-lib

Created at 3 weeks ago

Update README.md

Created at 3 weeks ago

Test invoice cancelation works for batuz model 140

Created at 3 weeks ago

Added more time between tests

Created at 4 weeks ago

Bugfix on test workflow

Created at 4 weeks ago

Bugfix on array position check

Merge branch 'main' of github.com:Barnetik/tbai-php-lib

Created at 4 weeks ago

Update README.md

Created at 4 weeks ago

added Physical person support for Batuz (Bizkaia)

Created at 4 weeks ago
issue comment
Uncaught Error: Class 'PreviousInvoice' not found

Por lo que dices, parece que añadiendo

use Barnetik\Tbai\Fingerprint\PreviousInvoice;

se resolvería el problema

Created at 4 weeks ago