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