@@ -107,7 +107,7 @@ |
||
107 | 107 | { |
108 | 108 | $xmlObj = simplexml_load_string($response); |
109 | 109 | // Ticket |
110 | - $ticket = (string) $xmlObj->xpath("//ticket")[0]; |
|
110 | + $ticket = (string)$xmlObj->xpath("//ticket")[0]; |
|
111 | 111 | Repository::saveTicket($documentName, $ticket); |
112 | 112 | return $ticket; |
113 | 113 | } |
@@ -87,9 +87,9 @@ discard block |
||
87 | 87 | $dueDate = $inv->getDueDate(); |
88 | 88 | $formOfPayment = $inv->getFormOfPayment(); |
89 | 89 | $formOfPaymentSrt = ""; |
90 | - if($formOfPayment == Catalogo::FAC_FORM_OF_PAYMENT_CONTADO) { |
|
90 | + if ($formOfPayment == Catalogo::FAC_FORM_OF_PAYMENT_CONTADO) { |
|
91 | 91 | $formOfPaymentSrt = "CONTADO"; |
92 | - }elseif($formOfPayment == Catalogo::FAC_FORM_OF_PAYMENT_CREDITO) { |
|
92 | + }elseif ($formOfPayment == Catalogo::FAC_FORM_OF_PAYMENT_CREDITO) { |
|
93 | 93 | $formOfPaymentSrt = "CRÉDITO"; |
94 | 94 | } |
95 | 95 | $data = [ |
@@ -111,18 +111,18 @@ discard block |
||
111 | 111 | 'igvPercent' => SunatVars::IGV_PERCENT, |
112 | 112 | 'logo' => LogoMgr::getLogoString(), |
113 | 113 | 'qr' => QrGenerator::getQrString($inv), // QR Code |
114 | - 'taxableOperations' => $inv->getTotalTaxableOperations(), // Total operaciones gravadas |
|
115 | - 'freeOperations' => $inv->getTotalFreeOperations(), // Total operaciones gratuitas |
|
114 | + 'taxableOperations' => $inv->getTotalTaxableOperations(), // Total operaciones gravadas |
|
115 | + 'freeOperations' => $inv->getTotalFreeOperations(), // Total operaciones gratuitas |
|
116 | 116 | 'unaffectedOperations' => $inv->getTotalUnaffectedOperations(), // Total operaciones inafectas |
117 | - 'exemptedOperations' => $inv->getTotalExemptedOperations(), // Total operaciones exoneradas |
|
118 | - 'totalAllowances' => $inv->getTotalAllowances(), // Total operaciones exoneradas |
|
119 | - 'igvAmount' => $inv->getIGV(), // IGV |
|
120 | - 'payableAmount' => $payableAmount, // Total a pagar |
|
121 | - 'formOfPaymentStr' => $formOfPaymentSrt, // Forma de pago |
|
122 | - 'pendingAmount' => $inv->getPendingAmount(), // Forma de pago |
|
123 | - 'payableInWords' => $payableInWords, // Monto en palabras |
|
124 | - 'items' => self::getDocumentDataItems($inv), // Items |
|
125 | - 'installments' => self::getDocumentInstallments($inv), // Cuotas |
|
117 | + 'exemptedOperations' => $inv->getTotalExemptedOperations(), // Total operaciones exoneradas |
|
118 | + 'totalAllowances' => $inv->getTotalAllowances(), // Total operaciones exoneradas |
|
119 | + 'igvAmount' => $inv->getIGV(), // IGV |
|
120 | + 'payableAmount' => $payableAmount, // Total a pagar |
|
121 | + 'formOfPaymentStr' => $formOfPaymentSrt, // Forma de pago |
|
122 | + 'pendingAmount' => $inv->getPendingAmount(), // Forma de pago |
|
123 | + 'payableInWords' => $payableInWords, // Monto en palabras |
|
124 | + 'items' => self::getDocumentDataItems($inv), // Items |
|
125 | + 'installments' => self::getDocumentInstallments($inv), // Cuotas |
|
126 | 126 | ]; |
127 | 127 | // For credit and debit notes |
128 | 128 | if (in_array($inv->getDocumentType(), [Catalogo::DOCTYPE_NOTA_CREDITO, Catalogo::DOCTYPE_NOTA_DEBITO])) { |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | $ln = $Items->getCount(); |
145 | 145 | $items2 = []; |
146 | 146 | for ($i = 0; $i < $ln; $i++) { |
147 | - $items2[]= [ |
|
147 | + $items2[] = [ |
|
148 | 148 | 'productCode' => $Items->getProductCode($i), |
149 | 149 | 'quantity' => $Items->getQunatity($i), |
150 | 150 | 'unitName' => Catalogo::getUnitName($Items->getUnitCode($i)), |
@@ -89,7 +89,7 @@ |
||
89 | 89 | $formOfPaymentSrt = ""; |
90 | 90 | if($formOfPayment == Catalogo::FAC_FORM_OF_PAYMENT_CONTADO) { |
91 | 91 | $formOfPaymentSrt = "CONTADO"; |
92 | - }elseif($formOfPayment == Catalogo::FAC_FORM_OF_PAYMENT_CREDITO) { |
|
92 | + } elseif($formOfPayment == Catalogo::FAC_FORM_OF_PAYMENT_CREDITO) { |
|
93 | 93 | $formOfPaymentSrt = "CRÉDITO"; |
94 | 94 | } |
95 | 95 | $data = [ |
@@ -116,13 +116,13 @@ discard block |
||
116 | 116 | private function addDocumentTaxes() |
117 | 117 | { |
118 | 118 | $Invoice = $this->dataMap; |
119 | - $currencyID = $Invoice->getCurrencyCode(); // Tipo de moneda |
|
120 | - $totalTaxableOperations = $Invoice->getTotalTaxableOperations(); // Total operaciones gravadas |
|
121 | - $totalTaxes = $Invoice->getTotalTaxes(); // Total operaciones gravadas |
|
122 | - $Igv = $Invoice->getIGV(); // Total IGV |
|
123 | - $totalExemptedOperations = $Invoice->getTotalExemptedOperations(); // Total operaciones exoneradas |
|
119 | + $currencyID = $Invoice->getCurrencyCode(); // Tipo de moneda |
|
120 | + $totalTaxableOperations = $Invoice->getTotalTaxableOperations(); // Total operaciones gravadas |
|
121 | + $totalTaxes = $Invoice->getTotalTaxes(); // Total operaciones gravadas |
|
122 | + $Igv = $Invoice->getIGV(); // Total IGV |
|
123 | + $totalExemptedOperations = $Invoice->getTotalExemptedOperations(); // Total operaciones exoneradas |
|
124 | 124 | $totalUnaffectedOperations = $Invoice->getTotalUnaffectedOperations(); // Total operaciones inafectas |
125 | - $totalFreeOpertions = $Invoice->getTotalFreeOperations(); // Total operaciones gratuitas |
|
125 | + $totalFreeOpertions = $Invoice->getTotalFreeOperations(); // Total operaciones gratuitas |
|
126 | 126 | |
127 | 127 | // XML nodes |
128 | 128 | $TaxTotal = new TaxTotal(); |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | } |
134 | 134 | // Total operaciones exoneradas |
135 | 135 | if ($totalExemptedOperations) { |
136 | - UblHelper::addTaxSubtotal($TaxTotal, $currencyID, 0, $totalExemptedOperations, Catalogo::CAT5_EXO); |
|
136 | + UblHelper::addTaxSubtotal($TaxTotal, $currencyID, 0, $totalExemptedOperations, Catalogo::CAT5_EXO); |
|
137 | 137 | } |
138 | 138 | // Total operaciones inafectas |
139 | 139 | if ($totalUnaffectedOperations) { |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | } |
142 | 142 | // Total operaciones gratuitas |
143 | 143 | if ($totalFreeOpertions) { |
144 | - UblHelper::addTaxSubtotal($TaxTotal, $currencyID, 0, $totalFreeOpertions, Catalogo::CAT5_GRA); |
|
144 | + UblHelper::addTaxSubtotal($TaxTotal, $currencyID, 0, $totalFreeOpertions, Catalogo::CAT5_GRA); |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | // Total impuestos |
@@ -311,8 +311,8 @@ discard block |
||
311 | 311 | { |
312 | 312 | $Invoice = $this->dataMap; |
313 | 313 | $currencyID = $this->getDocumentCurrencyCode(); // Tipo de moneda |
314 | - $totalAllowances = $Invoice->getTotalAllowances(); // Total descuentos |
|
315 | - $payableAmount = $Invoice->getPayableAmount(); // Total a pagar |
|
314 | + $totalAllowances = $Invoice->getTotalAllowances(); // Total descuentos |
|
315 | + $payableAmount = $Invoice->getPayableAmount(); // Total a pagar |
|
316 | 316 | $billableAmount = $Invoice->getBillableValue(); |
317 | 317 | // LegalMonetaryTotal |
318 | 318 | $LegalMonetaryTotal = new LegalMonetaryTotal(); |