123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- <?php
- /**
- * 2007-2021 PrestaShop
- *
- * NOTICE OF LICENSE
- *
- * This source file is subject to the Academic Free License (AFL 3.0)
- * that is bundled with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://opensource.org/licenses/afl-3.0.php
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@prestashop.com so we can send you a copy immediately.
- *
- * DISCLAIMER
- *
- * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
- * versions in the future. If you wish to customize PrestaShop for your
- * needs please refer to http://www.prestashop.com for more information.
- *
- * @author PrestaShop SA <contact@prestashop.com>
- * @copyright 2007-2021 PrestaShop SA
- * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
- * International Registered Trademark & Property of PrestaShop SA
- */
- namespace Core\FacturisRepository;
- class ExpfacturaRepository extends Repository implements \Core\App\Repository\Facturis\ExpfacturaInterface
- {
- const DOCUMENT_TYPE = "expfactura";
- const ROMANIAN_LANG_ID = "1";
- const RON_CURRENCY = "RON";
- const A4_FORMAT = "1";
- public function add($expfactura)
- {
- $response = $this->insertExpfactura($expfactura);
- // $marketplaceExpfacturaRepository = new \MarketplaceRepository\ExpfacturaRepository();
- // $factId = $marketplaceExpfacturaRepository->getFactId($expfactura['dataFact']['id_order']);
- //
- // $values = array(
- // "facturi_key"=> $factId
- // );
- //
- // $resp = $this->checkExpfactura($values);
- //
- // if(\Configuration::get('fsync_option_showobs') == 'inactiv'){
- // $expfactura['dataFact']['facturi_obs_up'] = '';
- // $expfactura['dataFact']['facturi_obs_client'] = '';
- // }
- //
- // if(\Configuration::get('fsync_option_docupd') == 'activ'){
- //
- // if($resp == null ){
- // $response = $this->insertExpfactura($expfactura);
- // }else{
- // $response = [
- // 'id_fact' => $factId,
- // ];
- // }
- //
- // } else {
- //
- // if(!$resp == null && ($resp[0]['facturi_key'] == $factId) && ($resp[0]['facturi_status'] == 'Emisa')){
- // $expfactura['dataFact']['facturi_key'] = $factId;
- // $expfactura['dataFact']['facturi_data'] = $resp[0]['facturi_data'];
- // $expfactura['dataFact']['facturi_numar'] = $resp[0]['facturi_serie_numar'];
- // $response = $this->updateExpfactura($expfactura);
- // } elseif($resp == null ){
- // $response = $this->insertExpfactura($expfactura);
- // }else{
- // $response = [
- // 'id_fact' => $factId,
- // ];
- // }
- //
- // }
- //
- // return $response;
- }
- public function view($factId)
- {
- $params = array(
- "id_fact" => $factId,
- "type" => self::DOCUMENT_TYPE,
- "select_language" => self::ROMANIAN_LANG_ID,
- "select_currency" => self::RON_CURRENCY,
- "select_format" => self::A4_FORMAT
- );
- if (empty($factId)) {
- exit;
- }
-
- $this->viewExpfactura($params);
- }
- }
|