-- simplificación provisión
This commit is contained in:
@@ -9018,20 +9018,10 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
|
||||
protected void LnkGuardarConceptosProvision_Click(object sender, EventArgs e)
|
||||
{
|
||||
bool continuar = true;
|
||||
DataTable dtconta = null;
|
||||
bool continuar = true;
|
||||
using (ClsContabilidad ObjConta = new ClsContabilidad())
|
||||
{
|
||||
int CveProveedor = -1;
|
||||
int CveClientes = -1;
|
||||
int CveClasificacion = -1;
|
||||
int CveAlmacen = -1;
|
||||
|
||||
|
||||
if (ObjConta.GetCuentas(-1, "-1", 1, UsuarioActual.CveEmpresa))
|
||||
{
|
||||
dtconta = ObjConta.DtResultados;
|
||||
}
|
||||
{
|
||||
int CveClasificacion = -1;
|
||||
ObjConta.IniciaTransacSQL();
|
||||
foreach (GridViewRow gvrow in GVProvision.Rows)
|
||||
{
|
||||
@@ -9039,42 +9029,19 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
if (continuar && CveConceptoNomina > 0)
|
||||
{
|
||||
int CvePersonal = gvrow.DataKey("CvePersonal").ToEntero();
|
||||
int CveconceptosContables = ((DropDownList)gvrow.FindControl("DdlCconceptosContables")).SelectedValue.ToEntero();
|
||||
int Cve = ((DropDownList)gvrow.FindControl("Ddlcuentassd")).SelectedValue.ToEntero();
|
||||
|
||||
int CveCuenta = -1;
|
||||
int IdCuentaContable = -1;
|
||||
if (UsuarioActual.Empresa.TipoContabilidad == 1)
|
||||
{
|
||||
DataRow drcuenta = dtconta.FiltroPrimero(string.Format(" CveCuenta ={0}", Cve));
|
||||
if (drcuenta != null)
|
||||
{
|
||||
IdCuentaContable = drcuenta["IdCompaq"].ToString().ToEntero();
|
||||
}
|
||||
CveCuenta = Cve;
|
||||
}
|
||||
else
|
||||
{
|
||||
DataRow drcuenta = dtconta.FiltroPrimero(string.Format("IdCompaq ={0}", Cve));
|
||||
if (drcuenta != null)
|
||||
{
|
||||
CveCuenta = drcuenta["CveCuenta"].ToString().ToEntero();
|
||||
}
|
||||
IdCuentaContable = Cve;
|
||||
}
|
||||
int CveconceptosContables = gvrow.FCDropDownList("DdlCconceptosContables").SelectedValue.ToEntero();
|
||||
int CveCuenta = gvrow.FCDropDownList("Ddlcuentassd").SelectedValue.ToEntero();
|
||||
if (CveconceptosContables > 0 && CveCuenta > 0)
|
||||
{
|
||||
if (!ObjConta.AddCuentasAsignaciones(CveconceptosContables, UsuarioActual.CveEmpresa, CveCuenta, CveProveedor, CveClientes,
|
||||
CvePersonal, CveClasificacion, CveAlmacen, -1, CveBancoCuenta: -1, CveConceptoNomina: CveConceptoNomina))
|
||||
if (!ObjConta.AddCuentasAsignaciones(CveconceptosContables, UsuarioActual.CveEmpresa, CveCuenta,
|
||||
CvePersonal: CvePersonal, CveClasificacion: CveClasificacion, CveConceptoNomina: CveConceptoNomina))
|
||||
{ continuar = false; }
|
||||
|
||||
}
|
||||
else { continuar = false; }
|
||||
}
|
||||
}
|
||||
if (continuar)
|
||||
{
|
||||
|
||||
ObjConta.Commit();
|
||||
}
|
||||
else
|
||||
@@ -9082,7 +9049,6 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
ObjConta.RollBack();
|
||||
}
|
||||
}
|
||||
|
||||
if (continuar)
|
||||
{
|
||||
Alert("las cuentas hán sido asignadas.");
|
||||
|
||||
Reference in New Issue
Block a user