Permalink
Browse files

BILL_TYPE, Y U SO COMPLEX?

  • Loading branch information...
miloops committed Dec 21, 2011
1 parent 0b55790 commit 3951136dbc6938e5f9fa4e512305a0cba1ff3ef9
Showing with 9 additions and 11 deletions.
  1. +2 −2 lib/bravo/bill.rb
  2. +6 −8 lib/bravo/constants.rb
  3. +1 −1 spec/bravo/bill_spec.rb
View
@@ -25,7 +25,7 @@ def initialize(attrs = {})
end
def cbte_type
- Bravo::BILL_TYPE[Bravo.own_iva_cond][iva_cond] ||
+ Bravo::BILL_TYPE[iva_cond] ||
raise(NullOrInvalidAttribute.new, "Please choose a valid document type.")
end
@@ -120,7 +120,7 @@ def authorized?
end
def query_bill(iva_cond, cbte_number)
- cbte_type = Bravo::BILL_TYPE[Bravo.own_iva_cond][iva_cond] ||
+ cbte_type = Bravo::BILL_TYPE[iva_cond] ||
raise(NullOrInvalidAttribute.new, "Please choose a valid document type.")
response = client.request :fe_comp_consultar do
View
@@ -36,13 +36,11 @@ 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",
- :nota_credito_a => "03",
- :nota_credito_b => "08"
- }
+ :responsable_inscripto => "01",
+ :consumidor_final => "06",
+ :exento => "06",
+ :responsable_monotributo => "06",
+ :nota_credito_a => "03",
+ :nota_credito_b => "08"
}
end
View
@@ -84,7 +84,7 @@
detail["FchVtoPago"].should == "20111210"
end
- Bravo::BILL_TYPE[Bravo.own_iva_cond].keys.each do |target_iva_cond|
+ Bravo::BILL_TYPE.keys.each do |target_iva_cond|
it "should authorize a valid bill for #{target_iva_cond.to_s}" do
@bill.net = 1000000
@bill.aliciva_id = 2

0 comments on commit 3951136

Please sign in to comment.