Skip to content

Commit

Permalink
add guias, compra + add install description
Browse files Browse the repository at this point in the history
  • Loading branch information
giansalex committed Jan 24, 2018
1 parent 13ceb62 commit e093dfa
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
Representación en formato HTML del comprobante electrónico empleado en la facturación electrónica - SUNAT - Perú.
> Para generar el PDF puede utilizar [wkhtmltopdf](https://wkhtmltopdf.org/) y/o [greenter/htmltopdf](https://github.com/giansalex/greenter-htmltopdf).
## Install
Using composer from [packagist.org](https://packagist.org/packages/greenter/report)
```bash
composer require greenter/report
```

## Preview

![Factura](docs/factura.png)
Expand Down
11 changes: 10 additions & 1 deletion src/Report/Templates/invoice2.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,17 @@
{% endif %}
<tr>
<td width="60%" height="15" align="left"><strong>Tipo Moneda: </strong> {{ doc.tipoMoneda|catalog('021') }} </td>
<td width="40%" height="15" align="left"> </td>
<td width="40%" height="15" align="left">{% if doc.compra is defined and doc.compra %}<strong>O/C: </strong> {{ doc.compra }}{% endif %}</td>
</tr>
{% if doc.guias %}
<tr>
<td width="60%" align="left"><strong>Guias: </strong>
{% for guia in doc.guias %}
{{ guia.nroDoc }}&nbsp;&nbsp;
{% endfor %}</td>
<td width="40%"></td>
</tr>
{% endif %}
</tbody></table>
</div><br>
{% set moneda = doc.tipoMoneda|catalog('02') %}
Expand Down
11 changes: 10 additions & 1 deletion tests/Report/HtmlReportTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Greenter\Model\Client\Client;
use Greenter\Model\Company\Address;
use Greenter\Model\Company\Company;
use Greenter\Model\Sale\Document;
use Greenter\Model\Sale\Invoice;
use Greenter\Model\Sale\Legend;
use Greenter\Model\Sale\Note;
Expand Down Expand Up @@ -52,6 +53,7 @@ private function getInvoice()
->setTotal(120)
]);
$invoice
->setCompra('0000123232')
->setTotalAnticipos(120.24)
->setMtoOperGratuitas(12)
->setSumDsctoGlobal(12)
Expand All @@ -69,7 +71,14 @@ private function getInvoice()
->setMtoOperInafectas(0)
->setMtoIGV(36)
->setMtoISC(2)
->setMtoImpVenta(236);
->setMtoImpVenta(236)
->setGuias([(new Document())
->setTipoDoc('09')
->setNroDoc('T001-213'),
(new Document())
->setTipoDoc('09')
->setNroDoc('001-442')
]);

$detail1 = new SaleDetail();
$detail1->setCodProducto('C023')
Expand Down

0 comments on commit e093dfa

Please sign in to comment.