123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- <?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 AvizeRepository extends Repository implements \Core\App\Repository\Facturis\AvizeInterface
- {
- const DOCUMENT_TYPE = "avize";
- const ROMANIAN_LANG_ID = "1";
- const RON_CURRENCY = "RON";
- const A4_FORMAT = "1";
- public function add($avize)
- {
- $response = $this->insertAvize($avize);
- // $marketplaceAvizeRepository = new \MarketplaceRepository\AvizeRepository(
- // $this->settingsRepository->getToken(),
- // $this->settingsRepository->getShop()
- // );
- // $factId = $marketplaceAvizeRepository->getFactId($avize['dataFact']['id_order']);
- //
- // $values = array(
- // "facturi_key"=> $factId
- // );
- //
- // $resp = $this->checkAvize($values);
- //
- // if(\Configuration::get('fsync_option_showobs') == 'inactiv'){
- // $avize['dataFact']['facturi_obs_up'] = '';
- // $avize['dataFact']['facturi_obs_client'] = '';
- // }
- //
- // if(\Configuration::get('fsync_option_docupd') == 'activ'){
- //
- // if($resp == null ){
- // $response = $this->insertAvize($avize);
- // }else{
- // $response = [
- // 'id_fact' => $factId,
- // ];
- // }
- //
- // } else {
- //
- // if(!$resp == null && ($resp[0]['facturi_key'] == $factId) && ($resp[0]['facturi_status'] == 'Emisa')){
- // $avize['dataFact']['facturi_key'] = $factId;
- // $avize['dataFact']['facturi_data'] = $resp[0]['facturi_data'];
- // $avize['dataFact']['facturi_numar'] = $resp[0]['facturi_serie_numar'];
- // $response = $this->updateAvize($avize);
- // } elseif($resp == null ){
- // $response = $this->insertAvize($avize);
- // }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->viewAvize($params);
- }
- }
|