Skip to content

Commit

Permalink
Cherry pick of bd114fd failed
Browse files Browse the repository at this point in the history
stdout:
Auto-merging l10n_ar_afipws_fe/models/account_move.py
CONFLICT (content): Merge conflict in l10n_ar_afipws_fe/models/account_move.py

stderr:
20:09:22.272723 git.c:444               trace: built-in: git cherry-pick bd114fd
error: could not apply bd114fd... [FIX] Fix issue ingadhoc#28 and  ingadhoc#32
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
----------
status:
  • Loading branch information
filoquin committed Jan 30, 2023
1 parent 5db87dc commit 8aa240f
Show file tree
Hide file tree
Showing 2 changed files with 182 additions and 18 deletions.
34 changes: 16 additions & 18 deletions l10n_ar_afipws/demo/certificate_demo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,23 +64,21 @@ dD22fG1t6f8GFQo/c5eHcpOWbA4kvnaeXTSHj8uY483xG7vU95bnqcOzgFB1m+uP
pFw=
-----END CERTIFICATE REQUEST-----</field>
<field name="crt">-----BEGIN CERTIFICATE-----
MIIDZTCCAk2gAwIBAgIIDXu6TyDEZTAwDQYJKoZIhvcNAQENBQAwODEaMBgGA1UEAwwRQ29tcHV0
YWRvcmVzIFRlc3QxDTALBgNVBAoMBEFGSVAxCzAJBgNVBAYTAkFSMB4XDTIwMDkxNTA4NTcwMVoX
DTIyMDkxNTA4NTcwMVowSzEuMCwGA1UEAwwlQUZJUFdTaG9tb2xvZ2F0aW9uWW91ckNvbXBhbnkx
NDA5MjAxODEZMBcGA1UEBRMQQ1VJVCAyMDMxMzkzMjk3NTCCASIwDQYJKoZIhvcNAQEBBQADggEP
ADCCAQoCggEBAKPi1W59EEf2PVDVxqDjEceBiE05ZJM+2RlsHplV/GeD8wsaBQX4ic1GfZlYUqlO
xC5xJrUkpZpha36Car7s0xS7WyaB2HJnFsZe5tUSbxunUBA7vjfZXik5TTo1byLpipFvv2u77Bjf
ZE3JZTUacPKgYV+d0z3h7CUCQ/1MfCDpEeXm5g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mtSSlmmFrfoJqvuzTFLtbJoHYcmcWxl7m
1RJvG6dQEDu+N9leKTlNOjVvIumKkW+/a7vsGN9kTcllNRpw8qBhX53TPeHsJQJD/Ux8IOkR5ebm
D3MvuDy0YsYZzIvgqD4Sed8gPLLR2a7EyqWF7zC4GzlYyOfu5kauIsZW5rSMIn13b9MhMXI+kNFS
foqvGkcXMSEZTVev+on6e/nGVDacPys1lTkPg3DIMzIq+559mGrS0j03Kr+2I0KqUvw9mVLvEv0j
cZkOdJxeP8aJJwIDAQABo2AwXjAMBgNVHRMBAf8EAjAAMB8GA1UdIwQYMBaAFLOy0//96bre3o2v
ESGc1iB98k9vMB0GA1UdDgQWBBSHE0w7lo5R7BEUxusOyICwULBveTAOBgNVHQ8BAf8EBAMCBeAw
DQYJKoZIhvcNAQENBQADggEBAGteUdAolXR3gCPhvKy841pT/nF0RvZxBO5+o6C7OuT7+ig5/G5e
V2eFSo/9ykp+BhRsb+b7IF98f7PymXbMzwXzryiR/nRxM8KItfQmqEMoc1kuLisoEcCVlZWEKDE7
emngmcsWPhJOV1iC2pGbfsx3ZZ2LsLgiC36fY35gMAyga9LZGOWegSMW7mfOuZ9qNIET+L8grADl
1pigjBlyvdJEruCsvzcW2wgo5WgkQErDHLaTalL+U2e4R8c969CrIPo0WVKJHS9FaMrpMNDfQl36
ifkaCiO5L6pxIQ5Dw4yxne8x6X4LtJK04KN9SMuYx9oSXPDRYx/l5lGcubYASUo=
-----END CERTIFICATE-----</field>
</record>
</odoo>
166 changes: 166 additions & 0 deletions l10n_ar_afipws_fe/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,173 @@ def do_pyafipws_request_cae(self):
inv.l10n_latam_document_number, inv.l10n_latam_document_type_id.code
)

<<<<<<< HEAD
if int(invoice_info["ws_next_invoice_number"]) != int(number_parts["invoice_number"]):
||||||| parent of 8658e76 (temp)
mipyme_fce = int(doc_afip_code) in [201, 206, 211]
# due date only for concept "services" and mipyme_fce
if int(concepto) != 1 and int(doc_afip_code) not in [202, 203, 207, 208, 212, 213] or mipyme_fce:
fecha_venc_pago = inv.invoice_date_due or inv.invoice_date
if afip_ws != 'wsmtxca':
fecha_venc_pago = fecha_venc_pago.strftime('%Y%m%d')
else:
fecha_venc_pago = None

# fecha de servicio solo si no es 1
if int(concepto) != 1:
fecha_serv_desde = inv.l10n_ar_afip_service_start
fecha_serv_hasta = inv.l10n_ar_afip_service_end
if afip_ws != 'wsmtxca':
fecha_serv_desde = fecha_serv_desde.strftime('%Y%m%d')
fecha_serv_hasta = fecha_serv_hasta.strftime('%Y%m%d')
else:
fecha_serv_desde = fecha_serv_hasta = None

amounts = self._l10n_ar_get_amounts()
# invoice amount totals:
imp_total = str("%.2f" % inv.amount_total)
# ImpTotConc es el iva no gravado
imp_tot_conc = str("%.2f" % amounts['vat_untaxed_base_amount'])
# tal vez haya una mejor forma, la idea es que para facturas c
# no se pasa iva. Probamos hacer que vat_taxable_amount
# incorpore a los imp cod 0, pero en ese caso termina reportando
# iva y no lo queremos
if inv.l10n_latam_document_type_id.l10n_ar_letter == 'C':
imp_neto = str("%.2f" % inv.amount_untaxed)
else:
imp_neto = str("%.2f" % amounts['vat_taxable_amount'])
imp_iva = str("%.2f" % amounts['vat_amount'])
# se usaba para wsca..
# imp_subtotal = str("%.2f" % inv.amount_untaxed)
imp_trib = str("%.2f" % amounts['not_vat_taxes_amount'])
imp_op_ex = str("%.2f" % amounts['vat_exempt_base_amount'])
moneda_id = inv.currency_id.l10n_ar_afip_code
moneda_ctz = inv.l10n_ar_currency_rate

CbteAsoc = inv.get_related_invoices_data()

# create the invoice internally in the helper
if afip_ws == 'wsfe':
ws.CrearFactura(
concepto, tipo_doc, nro_doc, doc_afip_code, pos_number,
cbt_desde, cbt_hasta, imp_total, imp_tot_conc, imp_neto,
imp_iva,
imp_trib, imp_op_ex, fecha_cbte, fecha_venc_pago,
fecha_serv_desde, fecha_serv_hasta,
moneda_id, moneda_ctz
)
# elif afip_ws == 'wsmtxca':
# obs_generales = inv.comment
# ws.CrearFactura(
# concepto, tipo_doc, nro_doc, doc_afip_code, pos_number,
# cbt_desde, cbt_hasta, imp_total, imp_tot_conc, imp_neto,
# imp_subtotal, # difference with wsfe
# imp_trib, imp_op_ex, fecha_cbte, fecha_venc_pago,
# fecha_serv_desde, fecha_serv_hasta,
# moneda_id, moneda_ctz,
# obs_generales # difference with wsfe
# )
elif afip_ws == 'wsfex':
# # foreign trade data: export permit, country code, etc.:
if inv.invoice_incoterm_id:
incoterms = inv.invoice_incoterm_id.code
incoterms_ds = inv.invoice_incoterm_id.name
# máximo de 20 caracteres admite
incoterms_ds = incoterms_ds and incoterms_ds[:20]
else:
incoterms = incoterms_ds = None
# por lo que verificamos, se pide permiso existente solo
# si es tipo expo 1 y es factura (codigo 19), para todo el
# resto pasamos cadena vacia
if int(doc_afip_code) == 19 and tipo_expo == 1:
# TODO investigar si hay que pasar si ("S")
permiso_existente = "N"
else:
permiso_existente = ""
obs_generales = inv.narration
=======
mipyme_fce = int(doc_afip_code) in [201, 206, 211]
# due date only for concept "services" and mipyme_fce
if int(concepto) != 1 and int(doc_afip_code) not in [202, 203, 207, 208, 212, 213] or mipyme_fce:
fecha_venc_pago = inv.invoice_date_due or inv.invoice_date
if afip_ws != 'wsmtxca':
fecha_venc_pago = fecha_venc_pago.strftime('%Y%m%d')
else:
fecha_venc_pago = None

# fecha de servicio solo si no es 1
if int(concepto) != 1:
fecha_serv_desde = inv.l10n_ar_afip_service_start
fecha_serv_hasta = inv.l10n_ar_afip_service_end
if afip_ws != 'wsmtxca':
fecha_serv_desde = fecha_serv_desde.strftime('%Y%m%d')
fecha_serv_hasta = fecha_serv_hasta.strftime('%Y%m%d')
else:
fecha_serv_desde = fecha_serv_hasta = None

amounts = inv._l10n_ar_get_amounts()
# invoice amount totals:
imp_total = str("%.2f" % inv.amount_total)
# ImpTotConc es el iva no gravado
imp_tot_conc = str("%.2f" % amounts['vat_untaxed_base_amount'])
# tal vez haya una mejor forma, la idea es que para facturas c
# no se pasa iva. Probamos hacer que vat_taxable_amount
# incorpore a los imp cod 0, pero en ese caso termina reportando
# iva y no lo queremos
if inv.l10n_latam_document_type_id.l10n_ar_letter == 'C':
imp_neto = str("%.2f" % inv.amount_untaxed)
else:
imp_neto = str("%.2f" % amounts['vat_taxable_amount'])
imp_iva = str("%.2f" % amounts['vat_amount'])
# se usaba para wsca..
# imp_subtotal = str("%.2f" % inv.amount_untaxed)
imp_trib = str("%.2f" % amounts['not_vat_taxes_amount'])
imp_op_ex = str("%.2f" % amounts['vat_exempt_base_amount'])
moneda_id = inv.currency_id.l10n_ar_afip_code
moneda_ctz = inv.l10n_ar_currency_rate

CbteAsoc = inv.get_related_invoices_data()

# create the invoice internally in the helper
if afip_ws == 'wsfe':
ws.CrearFactura(
concepto, tipo_doc, nro_doc, doc_afip_code, pos_number,
cbt_desde, cbt_hasta, imp_total, imp_tot_conc, imp_neto,
imp_iva,
imp_trib, imp_op_ex, fecha_cbte, fecha_venc_pago,
fecha_serv_desde, fecha_serv_hasta,
moneda_id, moneda_ctz
)
# elif afip_ws == 'wsmtxca':
# obs_generales = inv.comment
# ws.CrearFactura(
# concepto, tipo_doc, nro_doc, doc_afip_code, pos_number,
# cbt_desde, cbt_hasta, imp_total, imp_tot_conc, imp_neto,
# imp_subtotal, # difference with wsfe
# imp_trib, imp_op_ex, fecha_cbte, fecha_venc_pago,
# fecha_serv_desde, fecha_serv_hasta,
# moneda_id, moneda_ctz,
# obs_generales # difference with wsfe
# )
elif afip_ws == 'wsfex':
# # foreign trade data: export permit, country code, etc.:
if inv.invoice_incoterm_id:
incoterms = inv.invoice_incoterm_id.code
incoterms_ds = inv.invoice_incoterm_id.name
# máximo de 20 caracteres admite
incoterms_ds = incoterms_ds and incoterms_ds[:20]
else:
incoterms = incoterms_ds = None
# por lo que verificamos, se pide permiso existente solo
# si es tipo expo 1 y es factura (codigo 19), para todo el
# resto pasamos cadena vacia
if int(doc_afip_code) == 19 and tipo_expo == 1:
# TODO investigar si hay que pasar si ("S")
permiso_existente = "N"
else:
permiso_existente = ""
obs_generales = inv.narration
>>>>>>> 8658e76 (temp)

raise UserError(_('Check document number. Next is %s' % invoice_info["ws_next_invoice_number"]))

Expand Down

0 comments on commit 8aa240f

Please sign in to comment.