Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
gogl92 committed Nov 7, 2017
1 parent ab6e588 commit c28c281
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
15 changes: 10 additions & 5 deletions src/Facturacom33.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@
namespace inquid\facturacom;


use inquid\facturacom\models\Cliente;
use inquid\facturacom\models\EmpresaFacturadora;
use inquid\facturacom\models\Factura;
use inquid\facturacom\models\Factura33;
use inquid\facturacom\models\Error;
use inquid\facturacom\models\Serie;
use yii\base\Model;
use yii\db\ActiveRecord;

class Facturacom33 extends HttpClientV3
{
Expand Down Expand Up @@ -144,21 +150,20 @@ public function getSeries()
}

/**
* @param Factura33
* @param Factura33 $factura
* @return boolean|Error
*/
public function createFactura33($factura)
{
$model = new Factura33();
$model->setAttributes($factura->getAttributes());
$this->API_VERSION = 'api/v3';
if ($factura->validate()) {
try {
return $this->booleanResponse($this->sendRequest('post', 'cfdi33/create', $model->getAttributes()));
return $this->booleanResponse($this->sendRequest('post', 'cfdi33/create', $factura->getAttributes()));
} catch (\Exception $exception) {
return new Error(500, $exception->getMessage());
}
}
return new Error(500, $model->getErrors());
return new Error(500, $factura->getErrors());
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/models/Conceptos.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class Conceptos extends Model
/**
* @var float
*/
public $ValroUnitario;
public $ValorUnitario;
/**
* @var float
*/
Expand Down
12 changes: 6 additions & 6 deletions src/models/Factura33.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ class Factura33 extends Model
*/
public $TipoCfdi;
/**
* @var string $NumOrden
* @var string $NumOrder
*/
public $NumOrden;
public $NumOrder;
/**
* @var string $Comentarios
*/
Expand Down Expand Up @@ -119,9 +119,9 @@ class Factura33 extends Model
*/
public $MetodoPago;
/**
* @var integer $LugarExpeicion
* @var integer $LugarExpedicion
*/
public $LugarExpeicion;
public $LugarExpedicion;
/**
* @var string $Confirmacion
*/
Expand All @@ -143,9 +143,9 @@ class Factura33 extends Model
"RegimenFiscal" => ""
];
/**
* @var array $Recpetor
* @var array $Receptor
*/
public $Recpetor = [
public $Receptor = [
"ResidenciaFiscal" => "",
"UID" => ""
];
Expand Down

0 comments on commit c28c281

Please sign in to comment.