Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport diamoerp-staging] Emitir Factura Mipyme desde Suscripción #867

Merged
merged 1 commit into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading