Permalink
Browse files

Added "notas de credito".

  • Loading branch information...
1 parent 264352d commit 1c13485060319cfcf4e07be546ab9ef5b32b3d3f @miloops committed Mar 31, 2011
Showing with 46 additions and 1 deletion.
  1. +10 −1 lib/bravo/constants.rb
  2. +36 −0 spec/bravo/bill_spec.rb
View
11 lib/bravo/constants.rb
@@ -35,5 +35,14 @@ module Bravo
ALIC_IVA = [["03", 0], ["04", 0.105], ["05", 0.21], ["06", 0.27]]
- BILL_TYPE = {:responsable_inscripto => {:responsable_inscripto => "01", :consumidor_final => "06", :exento => "06", :responsable_monotributo => "06"}}
+ BILL_TYPE = {
+ :responsable_inscripto => {
+ :responsable_inscripto => "01",
+ :consumidor_final => "06",
+ :exento => "06",
+ :responsable_monotributo => "06",
+ :nota_credito_a => "03",
+ :nota_credito_b => "08"
+ }
+ }
end
View
36 spec/bravo/bill_spec.rb
@@ -102,5 +102,41 @@
response.cae.length.should == 14
end
end
+
+ it "should authorize nota de credito A" do
+ @bill.net = 10000
+ @bill.aliciva_id = 2
+ @bill.doc_num = "30710151543"
+ @bill.iva_cond = :nota_credito_a
+ @bill.concepto = "Servicios"
+
+ @bill.authorized?.should == false
+ @bill.authorize.should == true
+ @bill.authorized?.should == true
+
+ response = @bill.response
+
+ response.length.should == 28
+ response.cae.length.should == 14
+ response.cbte_tipo.should == "03"
+ end
+
+ it "should authorize nota de credito B" do
+ @bill.net = 10000
+ @bill.aliciva_id = 2
+ @bill.doc_num = "30710151543"
+ @bill.iva_cond = :nota_credito_b
+ @bill.concepto = "Servicios"
+
+ @bill.authorized?.should == false
+ @bill.authorize.should == true
+ @bill.authorized?.should == true
+
+ response = @bill.response
+
+ response.length.should == 28
+ response.cae.length.should == 14
+ response.cbte_tipo.should == "08"
+ end
end
end

0 comments on commit 1c13485

Please sign in to comment.