InvoiceRepository.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. /**
  3. * 2007-2021 PrestaShop
  4. *
  5. * NOTICE OF LICENSE
  6. *
  7. * This source file is subject to the Academic Free License (AFL 3.0)
  8. * that is bundled with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://opensource.org/licenses/afl-3.0.php
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@prestashop.com so we can send you a copy immediately.
  14. *
  15. * DISCLAIMER
  16. *
  17. * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
  18. * versions in the future. If you wish to customize PrestaShop for your
  19. * needs please refer to http://www.prestashop.com for more information.
  20. *
  21. * @author PrestaShop SA <contact@prestashop.com>
  22. * @copyright 2007-2021 PrestaShop SA
  23. * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
  24. * International Registered Trademark & Property of PrestaShop SA
  25. */
  26. namespace Core\FacturisRepository;
  27. class InvoiceRepository extends Repository implements \Core\App\Repository\Facturis\InvoiceInterface
  28. {
  29. const ROMANIAN_LANG_ID = "1";
  30. const RON_CURRENCY = "RON";
  31. const A4_FORMAT = "1";
  32. public function add($invoice)
  33. {
  34. $response = $this->insertInvoice($invoice);
  35. return $response;
  36. }
  37. public function view($factId)
  38. {
  39. $params = array(
  40. "id_fact" => $factId,
  41. "select_language" => self::ROMANIAN_LANG_ID,
  42. "select_currency" => self::RON_CURRENCY,
  43. "select_format" => self::A4_FORMAT
  44. );
  45. if (empty($factId)) {
  46. exit;
  47. }
  48. $this->viewInvoice($params);
  49. }
  50. }