Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 4 additions & 16 deletions packages/report/src/Report/Render/QrRender.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,25 +46,13 @@ public function getImage($sale)
}

/**
* @param Despatch $despatch
*
* Summary of getImageDespatch
* @param string $qr Link de la guía de remisión encontrada en el CDR
* @return string
*/
public function getImageDespatch($despatch)
public function getImageDespatch(string $qr)
{
$destinatario = $despatch->getDestinatario();
$params = [
$despatch->getCompany()->getRuc(),
$despatch->getTipoDoc(),
$despatch->getSerie(),
$despatch->getCorrelativo(),
$despatch->getFechaEmision()->format('Y-m-d'),
$destinatario->getTipoDoc(),
$destinatario->getNumDoc(),
];
$content = implode('|', $params).'|';

return $this->getQrImage($content);
return $this->getQrImage($qr);
}

private function getQrImage(string $content)
Expand Down
4 changes: 2 additions & 2 deletions packages/report/src/Report/Templates/despatch.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,12 @@
</blockquote>
</td>
<td width="15%" align="right">
<img src="{{ qrCodeDespatch(doc)|image_b64('svg+xml') }}" alt="Qr Image">
<img src="{{ qrCodeDespatch(params.system.qr)|image_b64('svg+xml') }}" alt="Qr Image">
</td>
</tr>
</tbody></table>
</div>
</td>
</tr>
</tbody></table>
</body></html>
</body></html>