Guardar periodicidad de factura global
This commit is contained in:
parent
6c78a282fe
commit
dbc3910297
|
@ -4491,6 +4491,7 @@ class Facturas(BaseModel):
|
|||
error = TextField(default='')
|
||||
exportacion = TextField(default='01')
|
||||
receptor_regimen = TextField(default='')
|
||||
periodicidad = TextField(default='')
|
||||
|
||||
class Meta:
|
||||
order_by = ('fecha',)
|
||||
|
@ -8406,6 +8407,7 @@ class Tickets(BaseModel):
|
|||
@classmethod
|
||||
def invoice(cls, values, user):
|
||||
is_invoice_day = util.get_bool(values['is_invoice_day'])
|
||||
periodicidad = values['periodicidad']
|
||||
id_client = int(values['client'])
|
||||
tickets = util.loads(values['tickets'])
|
||||
invoice_by_ticket = Configuracion.get_bool('chk_config_invoice_by_ticket')
|
||||
|
@ -8422,6 +8424,7 @@ class Tickets(BaseModel):
|
|||
return data
|
||||
else:
|
||||
client = Socios.get(Socios.id==id_client)
|
||||
periodicidad = ''
|
||||
|
||||
if client.forma_pago is None:
|
||||
msg = 'La Forma de Pago del cliente, no esta asignada'
|
||||
|
@ -8449,6 +8452,7 @@ class Tickets(BaseModel):
|
|||
data['uso_cfdi'] = client.uso_cfdi.key
|
||||
data['regimen_fiscal'] = emisor.regimenes[0].key
|
||||
data['receptor_regimen'] = receptor_regimen
|
||||
data['periodicidad'] = periodicidad
|
||||
|
||||
with database_proxy.atomic() as txn:
|
||||
obj = Facturas.create(**data)
|
||||
|
@ -11008,6 +11012,9 @@ def _migrate_tables(rfc=''):
|
|||
if not 'receptor_regimen' in columns:
|
||||
receptor_regimen = TextField(default='')
|
||||
migrations.append(migrator.add_column(table, 'receptor_regimen', receptor_regimen))
|
||||
if not 'periodicidad' in columns:
|
||||
periodicidad = TextField(default='')
|
||||
migrations.append(migrator.add_column(table, 'periodicidad', periodicidad))
|
||||
|
||||
table = 'almacenes'
|
||||
columns = [c.name for c in database_proxy.get_columns(table)]
|
||||
|
|
|
@ -682,6 +682,7 @@ function cmd_new_invoice_from_ticket_click(){
|
|||
data['client'] = values.id_partner
|
||||
data['tickets'] = tickets
|
||||
data['is_invoice_day'] = chk.getValue()
|
||||
data['periodicidad'] = $$('lst_periodicidad').getValue()
|
||||
data['opt'] = 'invoice'
|
||||
|
||||
msg = 'Todos los datos son correctos.<BR><BR>¿Estás seguro de generar esta factura?'
|
||||
|
|
|
@ -238,14 +238,14 @@ var opt_periodicidad = [
|
|||
{id: '02', value: '[02] Semanal'},
|
||||
{id: '03', value: '[03] Quincenal'},
|
||||
{id: '04', value: '[04] Mensual'},
|
||||
{id: '05', value: '[05] Bimestral'},
|
||||
//~ {id: '05', value: '[05] Bimestral'},
|
||||
]
|
||||
|
||||
|
||||
var toolbar_ticket_invoice = {view: 'toolbar', elements: [{},
|
||||
{view: 'checkbox', id: 'chk_is_invoice_day', labelWidth: 0, width: 150,
|
||||
labelRight: 'Es factura del día'},
|
||||
{view: 'richselect', id: 'lst_periodicidad', labelWidth: 90, width: 400,
|
||||
{view: 'richselect', id: 'lst_periodicidad', labelWidth: 90, width: 250,
|
||||
label: 'Periodicidad:', options: opt_periodicidad, value: '01'},
|
||||
{},
|
||||
{view: 'button', id: 'cmd_close_ticket_invoice', label: 'Cerrar',
|
||||
|
|
Loading…
Reference in New Issue