Fix type change in deposit

This commit is contained in:
el Mau 2023-02-22 11:07:38 -06:00
commit 3148c5ba82
4 changed files with 25 additions and 10 deletions

View File

@ -23,6 +23,7 @@ import sqlite3
from peewee import *
from playhouse.fields import PasswordField, ManyToManyField
from playhouse.shortcuts import case, SQL, cast
from psycopg2.errors import UniqueViolation
if __name__ == '__main__':
@ -2221,7 +2222,7 @@ class CuentasBanco(BaseModel):
with database_proxy.transaction():
try:
obj = CuentasBanco.create(**values)
except IntegrityError:
except (IntegrityError, UniqueViolation):
msg = 'Esta cuenta ya existe'
return {'ok': False, 'msg': msg}

View File

@ -578,13 +578,13 @@ function validate_deposito(values){
return false
}
if(grid.count() && current_currency!=CURRENCY_MN){
if(type_change <= 1.0){
msg = 'El Tipo de Cambio debe ser mayor a 1.00'
msg_error(msg)
return false
}
}
//~ if(grid.count() && current_currency!=CURRENCY_MN){
//~ if(type_change <= 1.0){
//~ msg = 'El Tipo de Cambio debe ser mayor a 1.00'
//~ msg_error(msg)
//~ return false
//~ }
//~ }
var today = new Date()
if(values.deposito_fecha > today){

View File

@ -296,6 +296,8 @@ function cmd_new_invoice_click(){
lst.setValue('')
lst.getList().clearAll()
$$('date_invoice').setValue(Date())
form.focus('search_client_name')
}
@ -360,6 +362,14 @@ function cmd_delete_invoice_click(id, e, node){
function validate_invoice(values){
var date_invoice = $$('date_invoice').getValue()
if(date_invoice == null){
msg = 'La fecha es requerida'
msg_error(msg)
$$('date_invoice').setFocus()
return false
}
var usar_cartaporte = $$('chk_cfdi_usar_cartaporte').getValue()
if(usar_cartaporte){
value = $$('lst_carta_UnidadPeso').getValue()
@ -822,6 +832,7 @@ function cmd_timbrar_click(id, e, node){
}
var values = form.getValues()
if(!validate_invoice(values)){
return
}

View File

@ -485,8 +485,11 @@ var suggest_students = {
}
var body_comprobante = {rows: [{
cols: [
var body_comprobante = {rows: [
{view: 'datepicker', id: 'date_invoice', label: 'Fecha', format: '%d-%F-%Y',
required: true, invalidMessage: 'Selecciona una fecha', hidden: true
},
{cols: [
{
view: 'richselect',
id: 'lst_tipo_comprobante',