diff --git a/.gitignore b/.gitignore index aee705d..56af442 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ /nbproject/private/ /vendor/ -/tests/repository/cdr -/tests/repository/sxml -/tests/repository/xml -/tests/repository/zip \ No newline at end of file +/tests/repository/cdr/ +/tests/repository/sxml/ +/tests/repository/xml/ +/tests/repository/zip/ \ No newline at end of file diff --git a/README.md b/README.md index 5ec95ef..661cb6c 100644 --- a/README.md +++ b/README.md @@ -51,71 +51,75 @@ $dt->setTime(13, 25, 51); // data de la factura $dataFactura = [ - 'operationTypeCode' => '0101', // Tipo de operación Catálogo #51. - 'voucherSeries' => 1, // Serie de la factura. - 'voucherNumber' => 4355, // Número correlativo de la factura. - 'customerName' => 'SERVICABINAS S.A.', // Razón social del receptor. - 'customerDocNumber' => '20587896411', // RUC del receptor. - 'customerDocType' => '6', // Tipo de documento del receptor Catálogo #6. - 'date' => $dt, // Opcional, por defecto usará la fecha y hora del sistema. - 'purchaseOrder' => 7852166, // Opcional, numero de orden de commpra. + 'operationType' => '0101', // Tipo de operación Catálogo #51 + 'voucherSeries' => 1, // Serie de la factura + 'voucherNumber' => 4355, // Número correlativo de la factura + 'customerDocType' => '6', // Tipo de documento Catálogo #6 + 'customerDocNumber' => '20587896411', // RUC + 'customerRegName' => 'SERVICABINAS S.A.', // Razón social + 'issueDate' => $dt, // Fecha de emisión [opcional], si no se especifica se usara la fecha del sistema! + 'purchaseOrder' => 7852166, // Numero de orden de commpra, 'allowances' => [ - ['reasonCode' => '00', 'multiplierFactor' => 0.05] + [ + 'reasonCode' => '00', // Código de descuento Cátalogo #53 + 'multiplierFactor' => 0.05 + ] ], + 'charges' => [], 'items' => [ [ - 'productCode' => 'GLG199', // Código. - 'sunatProductCode' => '52161515', // Código de producto SUNAT. Catálogo #25. - 'unitCode' => 'NIU', // Código de unidad. Catálogo #3. - 'quantity' => 2000, // Cantidad. - 'description' => 'Grabadora LG Externo Modelo: GE20LU10', // Descripción. - 'priceType' => '01', // Catálogo #16. - 'taxType' => '1000', // Catálogo #5. - 'igvAffectationCode' => '10', // Catálogo #7. - 'unitValue' => 98.00, // Valor unitario. - 'igvIncluded' => true, // true si el IGV está incluido en el Valor unitario. - 'allowances' => [ + 'productCode' => 'GLG199', // Código + 'sunatProductCode' => '52161515', // Código de producto SUNAT + 'unitCode' => 'NIU', // Código de unidad + 'quantity' => 2000, // Cantidad + 'description' => 'Grabadora LG Externo Modelo: GE20LU10', // Descripción detallada + 'priceType' => '01', // Catálogo #16 [01:Precio Unitario|02:Valor Referencial] + 'taxType' => '1000', // Catálogo #5 + 'igvAffectationCode' => '10', // Catálogo #7 + 'unitValue' => 98.00, // Valor unitario + 'igvIncluded' => true, // true si el valor unitario incluye IGV + 'allowances' => [ ['reasonCode' => '00', 'multiplierFactor' => 0.1] ] ], [ - 'productCode' => 'MVS546', - 'sunatProductCode' => '43211902', - 'unitCode' => 'NIU', - 'quantity' => 300, - 'description' => 'Monitor LCD ViewSonic VG2028WM 20', - 'priceType' => '01', - 'taxType' => '1000', - 'igvAffectationCode' => '10', - 'unitValue' => 620.00, - 'igvIncluded' => true, - 'allowances' => [ + 'productCode' => 'MVS546', + 'sunatProductCode' => '43211902', + 'unitCode' => 'NIU', + 'quantity' => 300, + 'description' => 'Monitor LCD ViewSonic VG2028WM 20', + 'priceType' => '01', + 'taxType' => '1000', + 'igvAffectationCode' => '10', + 'unitValue' => 620.00, + 'igvIncluded' => true, + 'allowances' => [ ['reasonCode' => '00', 'multiplierFactor' => 0.15] ] ], [ - 'productCode' => 'MPC35', - 'sunatProductCode' => '43202010', - 'unitCode' => 'NIU', - 'quantity' => 250, - 'description' => 'Memoria DDR-3 B1333 Kingston', - 'priceType' => '01', - 'taxType' => '9997', - 'igvAffectationCode' => '20', - 'unitValue' => 52.00, - 'igvIncluded' => false + 'productCode' => 'MPC35', + 'sunatProductCode' => '43202010', + 'unitCode' => 'NIU', + 'quantity' => 250, + 'description' => 'Memoria DDR-3 B1333 Kingston', + 'priceType' => '01', + 'taxType' => '9997', + 'igvAffectationCode' => '20', + 'unitValue' => 52.00, + 'igvIncluded' => false ], [ - 'productCode' => 'TMS22', - 'sunatProductCode' => '43211706', - 'unitCode' => 'NIU', - 'quantity' => 500, - 'description' => 'Teclado Microsoft SideWinder X6', - 'priceType' => '01', - 'taxType' => '1000', - 'igvAffectationCode' => '10', - 'unitValue' => 196.00, - 'igvIncluded' => true + 'productCode' => 'TMS22', + 'sunatProductCode' => '43211706', + 'unitCode' => 'NIU', + 'quantity' => 500, + 'description' => 'Teclado Microsoft SideWinder X6', + 'priceType' => '01', + 'taxType' => '1000', + 'igvAffectationCode' => '10', + 'unitValue' => 196.00, + 'igvIncluded' => true ] ] ]; diff --git a/tests/cases/boleta_caso1.php b/tests/cases/boleta_caso1.php index 133473c..d4cdf36 100644 --- a/tests/cases/boleta_caso1.php +++ b/tests/cases/boleta_caso1.php @@ -14,7 +14,7 @@ 'allowances' => [ [ 'reasonCode' => '00', // Código de descuento Cátalogo #53 - 'multiplierFactor' => 0.05 + 'multiplierFactor' => 0.05 ] ], 'charges' => [], diff --git a/tests/cases/factura_caso1.php b/tests/cases/factura_caso1.php index c68c519..26bb473 100644 --- a/tests/cases/factura_caso1.php +++ b/tests/cases/factura_caso1.php @@ -13,7 +13,10 @@ 'issueDate' => $dt, // Fecha de emisión [opcional], si no se especifica se usara la fecha del sistema! 'purchaseOrder' => 7852166, // Numero de orden de commpra, 'allowances' => [ - ['reasonCode' => '00', 'multiplierFactor' => 0.05] + [ + 'reasonCode' => '00', // Código de descuento Cátalogo #53 + 'multiplierFactor' => 0.05 + ] ], 'charges' => [], 'items' => [ diff --git a/tests/demo.php b/tests/demo.php index 4642dfb..17753e8 100644 --- a/tests/demo.php +++ b/tests/demo.php @@ -38,71 +38,75 @@ // data de la factura $dataFactura = [ - 'operationTypeCode' => '0101', // Tipo de operación Catálogo #51. - 'voucherSeries' => 1, // Serie de la factura. - 'voucherNumber' => 4355, // Número correlativo de la factura. - 'customerName' => 'SERVICABINAS S.A.', // Razón social del receptor. - 'customerDocNumber' => '20587896411', // RUC del receptor. - 'customerDocType' => '6', // Tipo de documento del receptor Catálogo #6. - 'date' => $dt, // Opcional, por defecto usará la fecha y hora del sistema. - 'purchaseOrder' => 7852166, // Opcional, numero de orden de commpra. + 'operationType' => '0101', // Tipo de operación Catálogo #51 + 'voucherSeries' => 1, // Serie de la factura + 'voucherNumber' => 4355, // Número correlativo de la factura + 'customerDocType' => '6', // Tipo de documento Catálogo #6 + 'customerDocNumber' => '20587896411', // RUC + 'customerRegName' => 'SERVICABINAS S.A.', // Razón social + 'issueDate' => $dt, // Fecha de emisión [opcional], si no se especifica se usara la fecha del sistema! + 'purchaseOrder' => 7852166, // Numero de orden de commpra, 'allowances' => [ - ['reasonCode' => '00', 'multiplierFactor' => 0.05] + [ + 'reasonCode' => '00', // Código de descuento Cátalogo #53 + 'multiplierFactor' => 0.05 + ] ], + 'charges' => [], 'items' => [ [ - 'productCode' => 'GLG199', // Código. - 'sunatProductCode' => '52161515', // Código de producto SUNAT. Catálogo #25. - 'unitCode' => 'NIU', // Código de unidad. Catálogo #3. - 'quantity' => 2000, // Cantidad. - 'description' => 'Grabadora LG Externo Modelo: GE20LU10', // Descripción. - 'priceType' => '01', // Catálogo #16. - 'taxType' => '1000', // Catálogo #5. - 'igvAffectationCode' => '10', // Catálogo #7. - 'unitValue' => 98.00, // Valor unitario. - 'igvIncluded' => true, // true si el IGV está incluido en el Valor unitario. - 'allowances' => [ + 'productCode' => 'GLG199', // Código + 'sunatProductCode' => '52161515', // Código de producto SUNAT + 'unitCode' => 'NIU', // Código de unidad + 'quantity' => 2000, // Cantidad + 'description' => 'Grabadora LG Externo Modelo: GE20LU10', // Descripción detallada + 'priceType' => '01', // Catálogo #16 [01:Precio Unitario|02:Valor Referencial] + 'taxType' => '1000', // Catálogo #5 + 'igvAffectationCode' => '10', // Catálogo #7 + 'unitValue' => 98.00, // Valor unitario + 'igvIncluded' => true, // true si el valor unitario incluye IGV + 'allowances' => [ ['reasonCode' => '00', 'multiplierFactor' => 0.1] ] ], [ - 'productCode' => 'MVS546', - 'sunatProductCode' => '43211902', - 'unitCode' => 'NIU', - 'quantity' => 300, - 'description' => 'Monitor LCD ViewSonic VG2028WM 20', - 'priceType' => '01', - 'taxType' => '1000', - 'igvAffectationCode' => '10', - 'unitValue' => 620.00, - 'igvIncluded' => true, - 'allowances' => [ + 'productCode' => 'MVS546', + 'sunatProductCode' => '43211902', + 'unitCode' => 'NIU', + 'quantity' => 300, + 'description' => 'Monitor LCD ViewSonic VG2028WM 20', + 'priceType' => '01', + 'taxType' => '1000', + 'igvAffectationCode' => '10', + 'unitValue' => 620.00, + 'igvIncluded' => true, + 'allowances' => [ ['reasonCode' => '00', 'multiplierFactor' => 0.15] ] ], [ - 'productCode' => 'MPC35', - 'sunatProductCode' => '43202010', - 'unitCode' => 'NIU', - 'quantity' => 250, - 'description' => 'Memoria DDR-3 B1333 Kingston', - 'priceType' => '01', - 'taxType' => '9997', - 'igvAffectationCode' => '20', - 'unitValue' => 52.00, - 'igvIncluded' => false + 'productCode' => 'MPC35', + 'sunatProductCode' => '43202010', + 'unitCode' => 'NIU', + 'quantity' => 250, + 'description' => 'Memoria DDR-3 B1333 Kingston', + 'priceType' => '01', + 'taxType' => '9997', + 'igvAffectationCode' => '20', + 'unitValue' => 52.00, + 'igvIncluded' => false ], [ - 'productCode' => 'TMS22', - 'sunatProductCode' => '43211706', - 'unitCode' => 'NIU', - 'quantity' => 500, - 'description' => 'Teclado Microsoft SideWinder X6', - 'priceType' => '01', - 'taxType' => '1000', - 'igvAffectationCode' => '10', - 'unitValue' => 196.00, - 'igvIncluded' => true + 'productCode' => 'TMS22', + 'sunatProductCode' => '43211706', + 'unitCode' => 'NIU', + 'quantity' => 500, + 'description' => 'Teclado Microsoft SideWinder X6', + 'priceType' => '01', + 'taxType' => '1000', + 'igvAffectationCode' => '10', + 'unitValue' => 196.00, + 'igvIncluded' => true ] ] ]; diff --git a/tests/testdox.txt b/tests/testdox.txt index df154e8..d3f5a12 100644 --- a/tests/testdox.txt +++ b/tests/testdox.txt @@ -1,4 +1 @@ -s\FSInputGeneration - [x] Generar boleta - [x] Generar factura