| Total Complexity | 2 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 19 | class QrRender |
||
| 20 | { |
||
| 21 | /** |
||
| 22 | * @param BaseSale $sale |
||
| 23 | * |
||
| 24 | * @return string |
||
| 25 | */ |
||
| 26 | 3 | public function getImage($sale) |
|
| 27 | { |
||
| 28 | 3 | $client = $sale->getClient(); |
|
| 29 | $params = [ |
||
| 30 | 3 | $sale->getCompany()->getRuc(), |
|
| 31 | 3 | $sale->getTipoDoc(), |
|
| 32 | 3 | $sale->getSerie(), |
|
| 33 | 3 | $sale->getCorrelativo(), |
|
| 34 | 3 | number_format($sale->getMtoIGV(), 2, '.', ''), |
|
| 35 | 3 | number_format($sale->getMtoImpVenta(), 2, '.', ''), |
|
| 36 | 3 | $sale->getFechaEmision()->format('Y-m-d'), |
|
| 37 | 3 | $client->getTipoDoc(), |
|
| 38 | 3 | $client->getNumDoc(), |
|
| 39 | ]; |
||
| 40 | 3 | $content = implode('|', $params).'|'; |
|
| 41 | |||
| 42 | 3 | return $this->getQrImage($content); |
|
| 43 | } |
||
| 44 | |||
| 45 | 3 | private function getQrImage($content) |
|
| 55 | } |
||
| 56 | } |
||
| 57 |