viernes, 23 de marzo de 2018
Don't let select a paid invoice on another payment #3
/***
@author: José Francisco Rodríguez Chávez
@email: jfrodriguez.idempiere@gmail.com
@created: 20/03/2018 10:45 am
@lastupdated: 20/03/2018 10:45 am
@version: 1.0
@description: Don't let duplicated invoices on payment allocate
@name: beanshell:ValidarFacturaVariosPagos
***/
import org.compiere.util.DB;
import org.compiere.util.Env;
import org.adempiere.webui.window.FDialog;
v_id_factura = A_PO.get_Value("C_Invoice_ID");
pcheck = (v_id_factura == null || v_id_factura == VOID);
if(!pcheck)
{
String sql = "SELECT * FROM adempiere.fnt_validar_factura_varios_pagos(" + v_id_factura + ");";
String sql2 = "SELECT * FROM adempiere.fnt_obtener_vpagos_factura(" + v_id_factura + ");";
rows = DB.getRowSet(sql.toString());
rows2 = DB.getRowSet(sql2.toString());
if(rows.next())
{
if(rows.getBoolean(1) == false)
{
if(rows2.next())
{
String pagos = rows2.getString(1);
return "La factura seleccionada ya esta en uso en el pago: " + pagos;
}
}
}
}
Suscribirse a:
Enviar comentarios (Atom)
No hay comentarios:
Publicar un comentario