class SunatInvoice::CreditNote
Attributes
-
date - issued date
-
ref_document_number
- serial and number of document affected -
ref_document_type
- type of document affected -
response_code
- reason for which credit note is issued (CATALOG_09) -
description - description of reason
-
document_type - should be '07' according CATALOG_01
-
document_number - serial and correlative number of document
-
provider - a
SunatInvoice::Provider
instance -
customer - a
SunatInvoice::Customer
instance -
signature - a
SunatInvoice::Signature
instance -
lines - array of
SunatInvoice::CreditNoteLine
instances
-
date - issued date
-
ref_document_number
- serial and number of document affected -
ref_document_type
- type of document affected -
response_code
- reason for which credit note is issued (CATALOG_09) -
description - description of reason
-
document_type - should be '07' according CATALOG_01
-
document_number - serial and correlative number of document
-
provider - a
SunatInvoice::Provider
instance -
customer - a
SunatInvoice::Customer
instance -
signature - a
SunatInvoice::Signature
instance -
lines - array of
SunatInvoice::CreditNoteLine
instances
-
date - issued date
-
ref_document_number
- serial and number of document affected -
ref_document_type
- type of document affected -
response_code
- reason for which credit note is issued (CATALOG_09) -
description - description of reason
-
document_type - should be '07' according CATALOG_01
-
document_number - serial and correlative number of document
-
provider - a
SunatInvoice::Provider
instance -
customer - a
SunatInvoice::Customer
instance -
signature - a
SunatInvoice::Signature
instance -
lines - array of
SunatInvoice::CreditNoteLine
instances
-
date - issued date
-
ref_document_number
- serial and number of document affected -
ref_document_type
- type of document affected -
response_code
- reason for which credit note is issued (CATALOG_09) -
description - description of reason
-
document_type - should be '07' according CATALOG_01
-
document_number - serial and correlative number of document
-
provider - a
SunatInvoice::Provider
instance -
customer - a
SunatInvoice::Customer
instance -
signature - a
SunatInvoice::Signature
instance -
lines - array of
SunatInvoice::CreditNoteLine
instances
Public Instance Methods
# File lib/sunat_invoice/credit_note.rb, line 22 def xml build = build_xml do |xml| build_document_data(xml) build_discrepancy_response(xml) build_billing_reference(xml) build_common_content(xml) end @signature.sign(build.to_xml) end
Private Instance Methods
# File lib/sunat_invoice/credit_note.rb, line 50 def build_billing_reference(xml) xml['cac'].BillingReference do xml['cac'].InvoiceDocumentReference do xml['cbc'].ID ref_document_number xml['cbc'].DocumentTypeCode ref_document_type end end end
# File lib/sunat_invoice/credit_note.rb, line 42 def build_discrepancy_response(xml) xml['cac'].DiscrepancyResponse do xml['cbc'].ReferenceID ref_document_number xml['cbc'].ResponseCode response_code # CATALOG_09 xml['cbc'].Description description end end
# File lib/sunat_invoice/credit_note.rb, line 38 def namespaces CREDIT_NOTE_NAMESPACES.merge(TRADE_NAMESPACES) end
# File lib/sunat_invoice/credit_note.rb, line 34 def root_name 'CreditNote' end