Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
giansalex committed Mar 17, 2019
2 parents c964e32 + d465472 commit 024d6db
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 76 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Greenter Changes

## Nov 2018-11-05 Core
**Summary**
- Se agregó `Moneda`.

**Summary Detail**
- Se agrego `MtoIvap`

**CdrResponse**
- Se agregó `isAccepted()`, indica cuando un cdr es aceptado.

## Oct 2018-10-14 UBL 2.1

**Invoice**
Expand All @@ -9,8 +19,11 @@
- Se agregó `TotalImpuestos` es requerido.
- Se agregó `ValorVenta` es requerido.
- Se agregó `MtoBaseIsc`.
- Se agregó `MtoBaseOth`.
- Se agregó `MtoOperExportacion`.
- Se agrego `Cargos`.
- Se agrego `Descuentos`.
- Se agrego `Compra`.

**Invoice Detail**
- Se agregó `TotalImpuestos` es requerido.
Expand All @@ -26,6 +39,9 @@
- `Legends` ahora se toma del catálogo 52.
- Se agregó `TotalImpuestos` es requerido.
- Se agregó `MtoBaseIsc`.
- Se agregó `MtoBaseOth`.
- Se agregó `MtoOperExportacion`.
- Se agrego `Compra`.

**Address**
- Se agregó `CodLocal`, código asignado por SUNAT para el establecimiento anexo declarado en el RUC (opcional).
Expand Down
10 changes: 10 additions & 0 deletions src/Core/Model/Response/CdrResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@ class CdrResponse
*/
protected $notes;

/**
* @return bool
*/
public function isAccepted()
{
$code = intval($this->getCode());

return $code === 0 || $code >= 4000;
}

/**
* @return string
*/
Expand Down
11 changes: 11 additions & 0 deletions src/Core/Model/Response/Error.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ class Error
*/
protected $message;

/**
* Error constructor.
* @param string $code
* @param string $message
*/
public function __construct($code = '', $message = '')
{
$this->code = $code;
$this->message = $message;
}

/**
* @return string
*/
Expand Down
54 changes: 2 additions & 52 deletions src/Core/Model/Response/StatusResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/**
* Class StatusResult.
*/
class StatusResult extends BaseResult
class StatusResult extends BillResult
{
/**
* StatusCode enviado por Sunat.
Expand All @@ -24,16 +24,6 @@ class StatusResult extends BaseResult
*/
protected $code;

/**
* @var string
*/
protected $cdrZip;

/**
* @var CdrResponse
*/
protected $cdrResponse;

/**
* @return string
*/
Expand All @@ -45,52 +35,12 @@ public function getCode()
/**
* @param string $code
*
* @return StatusResult
* @return $this
*/
public function setCode($code)
{
$this->code = $code;

return $this;
}

/**
* @return string
*/
public function getCdrZip()
{
return $this->cdrZip;
}

/**
* @param string $cdrZip
*
* @return StatusResult
*/
public function setCdrZip($cdrZip)
{
$this->cdrZip = $cdrZip;

return $this;
}

/**
* @return CdrResponse
*/
public function getCdrResponse()
{
return $this->cdrResponse;
}

/**
* @param CdrResponse $cdrResponse
*
* @return StatusResult
*/
public function setCdrResponse($cdrResponse)
{
$this->cdrResponse = $cdrResponse;

return $this;
}
}
24 changes: 0 additions & 24 deletions src/Core/Model/Sale/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,6 @@ class Invoice extends BaseSale
* @var Client
*/
private $seller;
/**
* @var Client
*/
private $buyer;

/**
* @var float
Expand Down Expand Up @@ -318,26 +314,6 @@ public function setSeller($seller)
return $this;
}

/**
* @return Client
*/
public function getBuyer()
{
return $this->buyer;
}

/**
* Datos del comprador.
*
* @param Client $buyer
* @return Invoice
*/
public function setBuyer($buyer)
{
$this->buyer = $buyer;
return $this;
}

/**
* @return Charge[]
*/
Expand Down
23 changes: 23 additions & 0 deletions src/Core/Model/Summary/Summary.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ class Summary implements DocumentInterface
*/
protected $fecResumen;

/**
* @var string
*/
protected $moneda = 'PEN';

/**
* @var Company
*/
Expand Down Expand Up @@ -105,6 +110,24 @@ public function setFecResumen(\DateTimeInterface $fecResumen)
return $this;
}

/**
* @return string
*/
public function getMoneda()
{
return $this->moneda;
}

/**
* @param string $moneda
* @return Summary
*/
public function setMoneda($moneda)
{
$this->moneda = $moneda;
return $this;
}

/**
* @return Company
*/
Expand Down
23 changes: 23 additions & 0 deletions src/Core/Model/Summary/SummaryDetail.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ class SummaryDetail
*/
private $mtoIGV;

/**
* @var float
*/
private $mtoIvap;

/**
* @var float
*/
Expand Down Expand Up @@ -407,6 +412,24 @@ public function setMtoIGV($mtoIGV)
return $this;
}

/**
* @return float
*/
public function getMtoIvap()
{
return $this->mtoIvap;
}

/**
* @param float $mtoIvap
* @return SummaryDetail
*/
public function setMtoIvap($mtoIvap)
{
$this->mtoIvap = $mtoIvap;
return $this;
}

/**
* @return float
*/
Expand Down

0 comments on commit 024d6db

Please sign in to comment.