@@ -25,16 +25,16 @@ |
||
| 25 | 25 | |
| 26 | 26 | public function createViews() |
| 27 | 27 | { |
| 28 | - return function () { |
|
| 28 | + return function() { |
|
| 29 | 29 | $ncfTipo = new NCFTipo(); |
| 30 | 30 | $tipoComprobantes = $ncfTipo->allFor('ventas', 'suma'); |
| 31 | 31 | $customValues = []; |
| 32 | 32 | $customValues[] = ['value'=>'', 'title'=>'-----------']; |
| 33 | - foreach($tipoComprobantes as $tipo) { |
|
| 33 | + foreach ($tipoComprobantes as $tipo) { |
|
| 34 | 34 | $customValues[] = ['value'=>$tipo->tipocomprobante, 'title'=>$tipo->descripcion]; |
| 35 | 35 | } |
| 36 | 36 | $columnToModify = $this->views['EditCliente']->columnForName('codsubtipodoc'); |
| 37 | - if($columnToModify) { |
|
| 37 | + if ($columnToModify) { |
|
| 38 | 38 | $columnToModify->widget->setValuesFromArray($customValues); |
| 39 | 39 | } |
| 40 | 40 | }; |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | |
| 54 | 54 | public function saveInsert() |
| 55 | 55 | { |
| 56 | - return function () { |
|
| 56 | + return function() { |
|
| 57 | 57 | $ncfrango = new NCFRango(); |
| 58 | 58 | $cliente = new Cliente(); |
| 59 | 59 | $actualCliente = $cliente->get($this->codcliente); |
@@ -16,15 +16,15 @@ discard block |
||
| 16 | 16 | * along with fsRepublicaDominicana. If not, see <http://www.gnu.org/licenses/>. |
| 17 | 17 | */ |
| 18 | 18 | |
| 19 | - namespace FacturaScripts\Plugins\fsRepublicaDominicana\Extension\Model; |
|
| 19 | + namespace FacturaScripts\Plugins\fsRepublicaDominicana\Extension\Model; |
|
| 20 | 20 | |
| 21 | - class Cliente |
|
| 22 | - { |
|
| 23 | - /** |
|
| 24 | - * Type of NCF to generate to the customer |
|
| 25 | - * |
|
| 26 | - * @var string |
|
| 27 | - */ |
|
| 21 | + class Cliente |
|
| 22 | + { |
|
| 23 | + /** |
|
| 24 | + * Type of NCF to generate to the customer |
|
| 25 | + * |
|
| 26 | + * @var string |
|
| 27 | + */ |
|
| 28 | 28 | public $codsubtipodoc; |
| 29 | 29 | |
| 30 | 30 | public function getCodubtipodoc() |
@@ -32,4 +32,4 @@ discard block |
||
| 32 | 32 | $return = $this->codsubtipodoc; |
| 33 | 33 | return $return; |
| 34 | 34 | } |
| 35 | - } |
|
| 35 | + } |
|
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | self::$i18n = new Translator(); |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | - if(self::$type_operation === 'sales') { |
|
| 81 | + if (self::$type_operation === 'sales') { |
|
| 82 | 82 | return [ |
| 83 | 83 | self::TYPE_OPERATION_DOCUMENT_SALES_IPO => self::$i18n->trans('ncf-sales-income-type-ipo'), |
| 84 | 84 | self::TYPE_OPERATION_DOCUMENT_SALES_IF => self::$i18n->trans('ncf-sales-income-type-if'), |
@@ -111,6 +111,6 @@ discard block |
||
| 111 | 111 | */ |
| 112 | 112 | public static function defaultValue() |
| 113 | 113 | { |
| 114 | - return (self::$type_operation === 'sales')?self::TYPE_OPERATION_DOCUMENT_SALES_IPO:self::TYPE_OPERATION_DOCUMENT_PURCHASES_GP; |
|
| 114 | + return (self::$type_operation === 'sales') ?self::TYPE_OPERATION_DOCUMENT_SALES_IPO : self::TYPE_OPERATION_DOCUMENT_PURCHASES_GP; |
|
| 115 | 115 | } |
| 116 | 116 | } |
@@ -67,8 +67,8 @@ |
||
| 67 | 67 | $data = $this->getBusinessFormData(); |
| 68 | 68 | $cliente = $cliente0->get($data['subject']['codcliente']); |
| 69 | 69 | |
| 70 | - $data['form']['codsubtipodoc'] =(isset($data['form']['codsubtipodoc']))?$cliente->codsubtipodoc:"02"; |
|
| 71 | - $data['form']['codoperaciondoc'] = (isset($data['form']['codoperaciondoc']))?"01":"LIMPIO"; |
|
| 70 | + $data['form']['codsubtipodoc'] = (isset($data['form']['codsubtipodoc'])) ? $cliente->codsubtipodoc : "02"; |
|
| 71 | + $data['form']['codoperaciondoc'] = (isset($data['form']['codoperaciondoc'])) ? "01" : "LIMPIO"; |
|
| 72 | 72 | |
| 73 | 73 | $merged = array_merge($data['custom'], $data['final'], $data['form'], $data['subject']); |
| 74 | 74 | $this->views[$this->active]->loadFromData($merged); |
@@ -58,11 +58,11 @@ |
||
| 58 | 58 | { |
| 59 | 59 | $customValues = []; |
| 60 | 60 | $customValues[] = ['value'=>'', 'title'=>'-----------']; |
| 61 | - foreach(\range('A', 'Z') as $i){ |
|
| 61 | + foreach (\range('A', 'Z') as $i) { |
|
| 62 | 62 | $customValues[] = ['value'=>$i, 'title'=>$i]; |
| 63 | 63 | } |
| 64 | 64 | $columnToModify = $this->views[$viewName]->columnForName('serie'); |
| 65 | - if($columnToModify) { |
|
| 65 | + if ($columnToModify) { |
|
| 66 | 66 | $columnToModify->widget->setValuesFromArray($customValues); |
| 67 | 67 | } |
| 68 | 68 | } |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | { |
| 47 | 47 | $this->addView('ListNCFRango', 'NCFRango'); |
| 48 | 48 | $this->addSearchFields('ListNCFRango', ['tipocomprobante']); |
| 49 | - $this->addOrderBy('ListNCFRango', ['tipocomprobante','correlativo'], 'tipocomprobante'); |
|
| 49 | + $this->addOrderBy('ListNCFRango', ['tipocomprobante', 'correlativo'], 'tipocomprobante'); |
|
| 50 | 50 | |
| 51 | 51 | $this->setSettings('ListNCFRango', 'modalInsert', 'ncf-rango-insert'); |
| 52 | 52 | $this->setCustomWidgetValues('ListNCFRango'); |
@@ -56,11 +56,11 @@ discard block |
||
| 56 | 56 | { |
| 57 | 57 | $customValues = []; |
| 58 | 58 | $customValues[] = ['value'=>'', 'title'=>'-----------']; |
| 59 | - foreach(\range('A', 'Z') as $i){ |
|
| 59 | + foreach (\range('A', 'Z') as $i) { |
|
| 60 | 60 | $customValues[] = ['value'=>$i, 'title'=>$i]; |
| 61 | 61 | } |
| 62 | 62 | $columnToModify = $this->views[$viewName]->columnModalForName('serie_nueva'); |
| 63 | - if($columnToModify) { |
|
| 63 | + if ($columnToModify) { |
|
| 64 | 64 | $columnToModify->widget->setValuesFromArray($customValues); |
| 65 | 65 | } |
| 66 | 66 | } |
@@ -74,11 +74,11 @@ discard block |
||
| 74 | 74 | $valueUsuarioCreacion = $this->request->request->get('usuariocreacion'); |
| 75 | 75 | $valueFechaCreacion = $this->request->request->get('fechacreacion'); |
| 76 | 76 | $data = $this->request->request->all(); |
| 77 | - $data['serie']=(isset($valueSerie) and $valueSerie !=='')?$valueSerie:$data['serie']; |
|
| 78 | - $data['idempresa']=(isset($valueIdEmpresa) and $valueIdEmpresa !=='')?$valueIdEmpresa:$this->empresa->idempresa; |
|
| 79 | - $data['usuariomodificacion']=(isset($valueFechaCreacion) and $valueFechaCreacion !=='')?$this->user->nick:null; |
|
| 80 | - $data['usuariocreacion']=(isset($valueUsuarioCreacion) and $valueUsuarioCreacion !=='')?$valueUsuarioCreacion:$this->user->nick; |
|
| 81 | - $data['fechacreacion']=(isset($valueFechaCreacion) and $valueFechaCreacion !=='')?$valueFechaCreacion:\date('Y-m-d'); |
|
| 77 | + $data['serie'] = (isset($valueSerie) and $valueSerie !== '') ? $valueSerie : $data['serie']; |
|
| 78 | + $data['idempresa'] = (isset($valueIdEmpresa) and $valueIdEmpresa !== '') ? $valueIdEmpresa : $this->empresa->idempresa; |
|
| 79 | + $data['usuariomodificacion'] = (isset($valueFechaCreacion) and $valueFechaCreacion !== '') ? $this->user->nick : null; |
|
| 80 | + $data['usuariocreacion'] = (isset($valueUsuarioCreacion) and $valueUsuarioCreacion !== '') ? $valueUsuarioCreacion : $this->user->nick; |
|
| 81 | + $data['fechacreacion'] = (isset($valueFechaCreacion) and $valueFechaCreacion !== '') ? $valueFechaCreacion : \date('Y-m-d'); |
|
| 82 | 82 | $rangoNuevo = new NCFRango(); |
| 83 | 83 | $rangoNuevo->loadFromData($data); |
| 84 | 84 | $rangoNuevo->save(); |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | |
| 174 | 174 | protected function saveUpdate(array $values = array()) |
| 175 | 175 | { |
| 176 | - if($this->id and isset($this->usuariomodificacion_view)) { |
|
| 176 | + if ($this->id and isset($this->usuariomodificacion_view)) { |
|
| 177 | 177 | $this->fechamodificacion = \date('d-m-Y'); |
| 178 | 178 | $this->usuariomodificacion = $this->usuariomodificacion_view; |
| 179 | 179 | } |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | . $idempresa |
| 190 | 190 | . ' AND tipocomprobante = ' |
| 191 | 191 | . $dataBase->var2str($tipocomprobante) |
| 192 | - . ' AND estado = ' . $dataBase->var2str(TRUE) |
|
| 192 | + . ' AND estado = '.$dataBase->var2str(TRUE) |
|
| 193 | 193 | . ';'; |
| 194 | 194 | $data = $dataBase->select($sql); |
| 195 | 195 | return new NCFRango($data[0]); |
@@ -77,13 +77,13 @@ |
||
| 77 | 77 | parent::install(); |
| 78 | 78 | return "INSERT INTO rd_ncftipoanulacion (codigo, descripcion, estado) VALUES " . |
| 79 | 79 | "('01','Deterioro de Factura Pre-Imprensa',true), " . |
| 80 | - "('02','Errores de Impresión (Factura Pre-Impresa)',true), " . |
|
| 81 | - "('03','Impresión defectuosa',true), " . |
|
| 82 | - "('04','Duplicidad de Factura',true), " . |
|
| 83 | - "('05','Corrección de la Información',true), " . |
|
| 84 | - "('06','Cambio de Productos',true), " . |
|
| 85 | - "('07','Devolución de Productos',true), " . |
|
| 86 | - "('08','Omisión de Productos',true);"; |
|
| 80 | + "('02','Errores de Impresión (Factura Pre-Impresa)',true), " . |
|
| 81 | + "('03','Impresión defectuosa',true), " . |
|
| 82 | + "('04','Duplicidad de Factura',true), " . |
|
| 83 | + "('05','Corrección de la Información',true), " . |
|
| 84 | + "('06','Cambio de Productos',true), " . |
|
| 85 | + "('07','Devolución de Productos',true), " . |
|
| 86 | + "('08','Omisión de Productos',true);"; |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | public function restoreData() |
@@ -75,21 +75,21 @@ |
||
| 75 | 75 | public function install() |
| 76 | 76 | { |
| 77 | 77 | parent::install(); |
| 78 | - return "INSERT INTO rd_ncftipoanulacion (codigo, descripcion, estado) VALUES " . |
|
| 79 | - "('01','Deterioro de Factura Pre-Imprensa',true), " . |
|
| 80 | - "('02','Errores de Impresión (Factura Pre-Impresa)',true), " . |
|
| 81 | - "('03','Impresión defectuosa',true), " . |
|
| 82 | - "('04','Duplicidad de Factura',true), " . |
|
| 83 | - "('05','Corrección de la Información',true), " . |
|
| 84 | - "('06','Cambio de Productos',true), " . |
|
| 85 | - "('07','Devolución de Productos',true), " . |
|
| 78 | + return "INSERT INTO rd_ncftipoanulacion (codigo, descripcion, estado) VALUES ". |
|
| 79 | + "('01','Deterioro de Factura Pre-Imprensa',true), ". |
|
| 80 | + "('02','Errores de Impresión (Factura Pre-Impresa)',true), ". |
|
| 81 | + "('03','Impresión defectuosa',true), ". |
|
| 82 | + "('04','Duplicidad de Factura',true), ". |
|
| 83 | + "('05','Corrección de la Información',true), ". |
|
| 84 | + "('06','Cambio de Productos',true), ". |
|
| 85 | + "('07','Devolución de Productos',true), ". |
|
| 86 | 86 | "('08','Omisión de Productos',true);"; |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | public function restoreData() |
| 90 | 90 | { |
| 91 | 91 | $dataBase = new DataBase(); |
| 92 | - $sqlClean = "DELETE FROM " . $this->tableName() . ";"; |
|
| 92 | + $sqlClean = "DELETE FROM ".$this->tableName().";"; |
|
| 93 | 93 | $dataBase->exec($sqlClean); |
| 94 | 94 | foreach ($this->arrayTipoAnulacion as $arrayItem) { |
| 95 | 95 | $initialData = new NCFTipoAnulacion($arrayItem); |