Skip to content

Commit

Permalink
Merge pull request #867 from fproldan/backport-866-to-diamoerp-staging
Browse files Browse the repository at this point in the history
[Backport diamoerp-staging] Emitir Factura Mipyme desde Suscripción
  • Loading branch information
fproldan authored Sep 5, 2024
2 parents 93ab657 + 6f85b70 commit 8a889a5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
8 changes: 8 additions & 0 deletions erpnext/accounts/doctype/subscription/subscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,14 @@ def create_invoice(self, prorate):
if doctype == 'Sales Invoice':
invoice.customer = self.party
invoice.territory = frappe.db.get_value('Customer', self.party, 'territory')

if self.punto_de_venta and self.secuencia:
punto_de_venta = frappe.get_doc('Punto de Venta', self.punto_de_venta)
tipo_de_comprobante = punto_de_venta.get_tipo_comprobante_for_secuence(self.secuencia)
if tipo_de_comprobante and tipo_de_comprobante.codigo in ['201', '206', '211']: # MIPYME
subscription_settings = frappe.get_single('Subscription Settings')
invoice.naming_series = self.secuencia
invoice.opcion_de_transmision = subscription_settings.opcion_de_transmision
else:
invoice.supplier = self.party
if frappe.db.get_value('Supplier', self.party, 'tax_withholding_category'):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"field_order": [
"grace_period",
"cancel_after_grace",
"prorate"
"prorate",
"opcion_de_transmision"
],
"fields": [
{
Expand All @@ -28,11 +29,17 @@
"fieldname": "prorate",
"fieldtype": "Check",
"label": "Prorate"
},
{
"fieldname": "opcion_de_transmision",
"fieldtype": "Select",
"label": "Opci\u00f3n de Transmisi\u00f3n Predeterminada",
"options": "\nTransferencia al sistema de circulaci\u00f3n abierta\nAgente de dep\u00f3sito colectivo"
}
],
"issingle": 1,
"links": [],
"modified": "2021-05-14 20:01:49.069747",
"modified": "2024-08-30 08:37:35.967594",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Subscription Settings",
Expand Down

0 comments on commit 8a889a5

Please sign in to comment.