This commit is contained in:
2021-07-28 11:39:27 -07:00
15 changed files with 11244 additions and 432 deletions

View File

@@ -2176,7 +2176,7 @@ Public Class ClsInventarios
#Region " INVENTARIOS - INVENTARIO FISICO "
Public Function AddInventarioFisico(CveEmpresa As Integer, InventarioFisico As String, Observaciones As String, Estatus As Integer, CveSubProyecto As Integer) As Boolean
Public Function AddInventarioFisico(CveEmpresa As Integer, InventarioFisico As String, Observaciones As String, Estatus As Integer, CveSubProyecto As Integer, Optional ConAplicacion As Boolean = False) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_InventarioFisicoAdd")
@@ -2186,6 +2186,7 @@ Public Class ClsInventarios
.Add("@InventarioFisico", SqlDbType.VarChar).Value = InventarioFisico
.Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones
.Add("@Estatus", SqlDbType.Int).Value = Estatus
.Add("@ConAplicacion", SqlDbType.Int).Value = If(ConAplicacion, 1, 0)
.Add("@CveInventarioFisico", SqlDbType.Int).Direction = ParameterDirection.Output
End With
@@ -2582,6 +2583,101 @@ Public Class ClsInventarios
Return Retorno
End Function
Public Function GetInventarioFisicoDetallesUsuarios(CveInventarioFisico As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_InventarioFisicoDetallesUsuariosGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch Ex1 As SqlException
Me.OnError("Ocurrió un error al obtener los usuarios del inventario fisico.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Catch ex As Exception
OnError("Ocurrió un error al obtener llos usuarios del inventario fisico.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function AddInventarioFisicoUsuarios(CveInventarioFisico As Integer, CveUsuario As Integer, Incluye As Boolean, Cerrado As Boolean, Bloqueado As Boolean) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_InventarioFisicoUsuariosAdd")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@Incluye", SqlDbType.Bit).Value = If(Incluye, 1, 0)
.Add("@Cerrado", SqlDbType.Bit).Value = If(Cerrado, 1, 0)
.Add("@Bloqueado", SqlDbType.Bit).Value = If(Bloqueado, 1, 0)
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch Ex1 As SqlException
Me.OnError("Ocurrió un error al guardar los usuarios del inventario fisico.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Catch ex As Exception
OnError("Ocurrió un error al guardar los usuarios del inventario fisico.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function RemoveInventarioFisicoUsuarios(CveInventarioFisico As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_InventarioFisicoUsuariosRemove")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch Ex1 As SqlException
Me.OnError("Ocurrió un error al eliminar los usuarios del inventario fisico.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Catch ex As Exception
OnError("Ocurrió un error al eliminar los usuarios servicio del inventario fisico.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function UpdateInventarioFisicoUsuarios(CveInventarioFisico As Integer, CveUsuario As Integer, Cerrado As Boolean, Bloqueado As Boolean) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_InventarioFisicoUsuariosUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@Cerrado", SqlDbType.Bit).Value = Cerrado
.Add("@Bloqueado", SqlDbType.Bit).Value = Bloqueado
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch Ex1 As SqlException
Me.OnError("Ocurrió un error al eliminar los usuarios del inventario fisico.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Catch ex As Exception
OnError("Ocurrió un error al eliminar los usuarios servicio del inventario fisico.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function GetInventarioFisicoDetallesProveedores(CveInventarioFisico As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False

View File

@@ -1961,7 +1961,7 @@ Public Class E141 : Implements IHttpHandler
End If
End If
Threading.Thread.Sleep(3000)
Threading.Thread.Sleep(1000)
End While
End If
@@ -2219,8 +2219,7 @@ Public Class E141 : Implements IHttpHandler
CountPeticionesExitosas += 1
End If
End If
Threading.Thread.Sleep(3000)
Threading.Thread.Sleep(1000)
End While
End If
End If

View File

@@ -60,8 +60,16 @@
</div>
<hr />
<div class="row">
<div class="row" id="divTipoDevolucion" runat="server" visible="false" style="margin-top: -20px;">
<div class="col-md-12">
<div class="col-md-5"></div>
<asp:RadioButtonList ID="TipoDevolucion" runat="server" RepeatDirection="Horizontal" OnSelectedIndexChanged="TipoDevolucion_SelectedIndexChanged" AutoPostBack="true">
<asp:ListItem Value="1" Text="Bancos"></asp:ListItem>
<asp:ListItem Value="2" Text="Viaticos"></asp:ListItem>
</asp:RadioButtonList>
</div>
</div>
<div class="row" runat="server" id="DivBancos">
<div class="col-md-6">
<div class="row">
<div class="col-md-4">
@@ -180,7 +188,49 @@
</div>
</div>
<div class="row">
<div class="row" runat="server" id="DivViaticos" visible="false" style="margin-bottom: 10px;">
<div class="col-md-12">
<div class="portlet-title">
<div class="caption ">
<span class="caption-subject font-yellow-gold bold uppercase">
<asp:Literal ID="LtlMovtoPermanenteaddup" runat="server"></asp:Literal></span>
</div>
<div class="tools">
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
</div>
</div>
<div class="portlet-body ">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtDescripcion" CssClass="form-control" runat="server"></asp:TextBox>
<asp:Label runat="server" Text="Descripción:" AssociatedControlID="TxtDescripcion"></asp:Label>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group form-md-line-input input-iconright">
<asp:Label runat="server" Text="Concepto:" AssociatedControlID=""></asp:Label>
<asp:DropDownList ID="DdlConcepto" runat="server" DataTextField="CodigoConcepto" DataValueField="CveConcepto" Class="form-control input-sm select2me" Width="100%" ValidationGroup="GrpGuardar"></asp:DropDownList>
</div>
</div>
<div class="col-md-4">
<div class="form-group form-md-line-input input-iconright">
<asp:Label runat="server" Text="Valor:" AssociatedControlID=""></asp:Label>
<asp:TextBox ID="TxtValor" CssClass="form-control" runat="server"></asp:TextBox>
</div>
</div>
<div class="col-md-4">
<div class="form-group form-md-line-input input-iconright">
<asp:Label runat="server" Text="Veces por Aplicar:" AssociatedControlID=""></asp:Label>
<asp:TextBox ID="TxtVecesAplicar" CssClass="form-control" runat="server"></asp:TextBox>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-2">
<label>Observaciones:</label>
</div>
@@ -189,6 +239,9 @@
<asp:HiddenField ID="HdnObs" runat="server" ClientIDMode="Static" />
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
@@ -275,7 +328,6 @@
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
<script>
function FnSuma(t, txt, importe) {
debugger;
if (t.checked) {
txt.value = FormatoNumero(importe, 2);
} else {
@@ -283,10 +335,10 @@
}
$get('TxtImporte').value = FormatoNumero(SumaValores(), 2);
}
function FnCambia(chk, txt, saldo, op, text) {
debugger;
if (op == 1) {
if (txt.value != '') {
chk.checked = true;

View File

@@ -49,9 +49,11 @@ public partial class Bancos_Devoluciones : ClsPaginas
CargaCliente();
CargaProveedor();
CargaPersonal();
CargaConcepto();
TxtImporte.Attributes.Add("disabled", "disabled");
TxtComisiones.Attributes.Add("disabled", "disabled");
TxtTotal.Attributes.Add("disabled", "disabled");
TipoDevolucion.SelectedValue = "1";
}
}
@@ -70,6 +72,7 @@ public partial class Bancos_Devoluciones : ClsPaginas
LimpiarGV();
LimpiarDDL();
GvDevoluciones.Columns[7].Visible = true;
divTipoDevolucion.Visible = false;
break;
case "2":
tipo = "Ing";
@@ -80,6 +83,7 @@ public partial class Bancos_Devoluciones : ClsPaginas
LimpiarGV();
LimpiarDDL();
GvDevoluciones.Columns[7].Visible = false;
divTipoDevolucion.Visible = false;
break;
case "3":
tipo = "Ing";
@@ -90,6 +94,7 @@ public partial class Bancos_Devoluciones : ClsPaginas
LimpiarGV();
LimpiarDDL();
GvDevoluciones.Columns[7].Visible = false;
divTipoDevolucion.Visible = true;
break;
case "4":
tipo = "Ing";
@@ -100,10 +105,29 @@ public partial class Bancos_Devoluciones : ClsPaginas
LimpiarGV();
LimpiarDDL();
GvDevoluciones.Columns[7].Visible = false;
divTipoDevolucion.Visible = false;
break;
}
CargaTipoTransaccion(tipo);
}
protected void TipoDevolucion_SelectedIndexChanged(object sender, EventArgs e)
{
string tipo = "";
switch (TipoDevolucion.SelectedValue)
{
case "1":
DivBancos.Visible = true;
DivViaticos.Visible = false;
break;
case "2":
DivBancos.Visible = false;
DivViaticos.Visible = true;
break;
}
}
protected void CargaTipoTransaccion(string tipo)
{
DdlTipoTransanccion.Items.Clear();
@@ -315,7 +339,13 @@ public partial class Bancos_Devoluciones : ClsPaginas
#region"GUARDAR"
protected void BtnGuardar_Click(object sender, EventArgs e)
{
if (TxtImporte.Text == "")
if (OpcionDevolucion.SelectedValue.ToEntero() != 3 && TipoDevolucion.SelectedValue.ToString().ToEntero() != 2 && TxtImporte.Text == "")
{
Alert("Debe ingresar un importe", TipoMensaje.MsgAdvertencia);
return;
}
if (OpcionDevolucion.SelectedValue.ToEntero() == 3 && TipoDevolucion.SelectedValue.ToString().ToEntero() == 2 && TxtValor.Text == "")
{
Alert("Debe ingresar un importe", TipoMensaje.MsgAdvertencia);
return;
@@ -324,10 +354,11 @@ public partial class Bancos_Devoluciones : ClsPaginas
ClsBancos ObjIE = new ClsBancos();
ClsContabilidad ObjMov = new ClsContabilidad(ObjIE.IniciaTransacSQL());
ClsCompras ObjComp = new ClsCompras(ObjIE.IniciaTransacSQL());
ClsNominas ObjNom = new ClsNominas(ObjIE.IniciaTransacSQL());
string MsgError = "";
string PagueseA = "";
int CveIE = 0;
int CveIE = -1;
int CveConceptoContableBanco = 30;
int CveConceptoContableDevolucion = 0;
int CvePlantillaPoliza = 0;
@@ -358,9 +389,9 @@ public partial class Bancos_Devoluciones : ClsPaginas
break;
case "3":
PagueseA = DdlPersonal.SelectedItem.ToString();
CveConceptoContableDevolucion = 250;
CvePlantillaPoliza = 100;
TipoMovoDevolucion = true;
CveConceptoContableDevolucion = 250;
break;
case "4":
PagueseA = DdlPersonal.SelectedItem.ToString();
@@ -377,84 +408,128 @@ public partial class Bancos_Devoluciones : ClsPaginas
// DATOS PREPOLIZA
if ( DdlTipoTransanccion.SelectedValue == "1" && UsuarioActual.CveEmpresa != 119) FolioFijo = TxtFolio.Text.ToEntero();
CvePrePoliza = ObjMov.AddPrePolizas("Bancos/IE Devoluciones", CvePlantillaPoliza, TxtImporte.Text.Trim().ToDouble(), TxtImporte.Text.Trim().ToDouble(), CveMoneda, TxtFechaDocumento.Text.ToDate(), TxtObservaciones.Text.Trim(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo: FolioFijo, ReglaFolioPoliza: ObjComp.ObtenerReglaFolio(DdlTipoTransanccion.SelectedValue, null, UsuarioActual.CveEmpresa), CveTipoPoliza: ObjMov.ObtenerTipoPoliza(DdlTipoTransanccion.SelectedValue, "-1", UsuarioActual.CveEmpresa));
CvePrePoliza = ObjMov.AddPrePolizas("Bancos/IE Devoluciones", CvePlantillaPoliza, TxtImporte.Text.Trim().ToDouble(), TxtImporte.Text.Trim().ToDouble(), 1, TxtFechaDocumento.Text.ToDate(), TxtObservaciones.Text.Trim(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo: FolioFijo, ReglaFolioPoliza: ObjComp.ObtenerReglaFolio(DdlTipoTransanccion.SelectedValue, null, UsuarioActual.CveEmpresa), CveTipoPoliza: ObjMov.ObtenerTipoPoliza(DdlTipoTransanccion.SelectedValue, "-1", UsuarioActual.CveEmpresa));
if (CvePrePoliza > 0)
{
string Conc = TxtObservaciones.Text == "" ? TxtFolio.Text : TxtObservaciones.Text;
string Ref = TxtObservaciones.Text == "" ? TxtFolio.Text : TxtObservaciones.Text;
CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero(), DdlTipoTransanccion.SelectedValue.ToEntero(), TxtFechaDocumento.Text.Trim().ToDate(), TxtFolio.Text.Trim(), PagueseA, TxtImporte.Text.Trim().ToDouble(), CveMoneda,
TC, TxtObservaciones.Text.Trim(), "", false, false, -1, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa);
if (CveIE > 0)
if (OpcionDevolucion.SelectedValue.ToEntero() == 3 || TipoDevolucion.SelectedValue.ToString().ToEntero() == 2)
{
//GUARDA PREPOLIZAS DETALLE DEVOLUCION
foreach (GridViewRow gvr in GvDevoluciones.Rows)
{
if (gvr.FCCheckBox("Chk").Checked)
{
if (OpcionDevolucion.SelectedValue.ToEntero() == 1)
if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovoDevolucion, gvr.FCTextBox("TxtAbonar").Text.ToDecimal(), Ref, CveConceptoContableDevolucion, Conc, DateTime.Now, 0, -1, CveProveedor: cveProveedor, CvePersonal: cvePersonal, ImporteMX: gvr.FCTextBox("TxtAbonar").Text.ToDecimal(), CveIEDevolucion: CveIE))
{
if (gvr.FCTextBox("TxtIVA").Text.ToDecimal() > 0)
MsgError = "No se pudo insertar concepto de Devolución";
break;
}
}
}
//GUARDA PREPOLIZAS DETALLE Bancos
if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, !TipoMovoDevolucion, TxtImporte.Text.ToDecimal(), Ref, 174, Conc, DateTime.Now, 0, -1, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero(), CveCliente: cveCliente, CveProveedor: cveProveedor, CvePersonal: cvePersonal, ImporteMX: TxtImporte.Text.ToDecimal()))
{
MsgError = "No se pudo insertar concepto de Devolución";
}
if (MsgError.Equals(""))
{
int cveConcepto = DdlConcepto.SelectedValue.ToEntero();
string descripcion = TxtDescripcion.Text;
int tipoDescuento = 1;
double valor = TxtValor.Text.ToDouble();
int vecesAplicar = TxtVecesAplicar.Text.ToEntero();
decimal montoLimite = 0;
string fechaInicioAplicacion = DateTime.Now.ToString("yyyy/MM/dd");
bool estatus = true;
int CveCuenta = -1;
if (!ObjNom.AddMovtoPermanente(cveConcepto, cvePersonal, descripcion, tipoDescuento, valor, vecesAplicar, montoLimite, fechaInicioAplicacion, estatus, CveCuenta))
{
MsgError = "No se pudo insertar movimiento permanente";
}
}
}
else
{
CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero(), DdlTipoTransanccion.SelectedValue.ToEntero(), TxtFechaDocumento.Text.Trim().ToDate(), TxtFolio.Text.Trim(), PagueseA, TxtImporte.Text.Trim().ToDouble(), CveMoneda,
TC, TxtObservaciones.Text.Trim(), "", false, false, -1, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa);
if (CveIE > 0)
{
//GUARDA PREPOLIZAS DETALLE DEVOLUCION
foreach (GridViewRow gvr in GvDevoluciones.Rows)
{
if (gvr.FCCheckBox("Chk").Checked)
{
if (OpcionDevolucion.SelectedValue.ToEntero() == 1)
{
//INGxC
if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, gvr.FCTextBox("TxtAbonar").Text.ToDecimal(), Ref, CveConceptoContableDevolucion, Conc, DateTime.Now, IDCtaContableDevolucion, -1, CveIE: gvr.DataKey("CveIE").ToEntero(), CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero(), CveCliente: DdlCliente.SelectedValue.ToEntero(), ImporteMX: gvr.FCTextBox("TxtAbonar").Text.ToDecimal(), CveIEDevolucion: CveIE))
if (gvr.FCTextBox("TxtIVA").Text.ToDecimal() > 0)
{
MsgError = "No se pudo insertar concepto de devolución";
}
//INGxC
if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, gvr.FCTextBox("TxtAbonar").Text.ToDecimal(), Ref, CveConceptoContableDevolucion, Conc, DateTime.Now, IDCtaContableDevolucion, -1, CveIE: gvr.DataKey("CveIE").ToEntero(), CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero(), CveCliente: DdlCliente.SelectedValue.ToEntero(), ImporteMX: gvr.FCTextBox("TxtAbonar").Text.ToDecimal(), CveIEDevolucion: CveIE))
{
MsgError = "No se pudo insertar concepto de devolución";
}
//IVA
if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, false, -gvr.FCTextBox("TxtIVA").Text.ToDecimal(), Ref, 13, Conc, DateTime.Now, UsuarioActual.Empresa.IdCuentaIVAxTrasladar, -1, CveIE, CveIEDevolucion: gvr.DataKey("CveIE").ToEntero(), CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero(), CveCliente: DdlCliente.SelectedValue.ToEntero(), ImporteMX: -gvr.FCTextBox("TxtIVA").Text.ToDecimal()))
{
MsgError = "No se pudo insertar concepto de IVA";
}
//IVA
if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, false, -gvr.FCTextBox("TxtIVA").Text.ToDecimal(), Ref, 13, Conc, DateTime.Now, UsuarioActual.Empresa.IdCuentaIVAxTrasladar, -1, CveIE, CveIEDevolucion: gvr.DataKey("CveIE").ToEntero(), CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero(), CveCliente: DdlCliente.SelectedValue.ToEntero(), ImporteMX: -gvr.FCTextBox("TxtIVA").Text.ToDecimal()))
{
MsgError = "No se pudo insertar concepto de IVA";
}
if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, -gvr.FCTextBox("TxtIVA").Text.ToDecimal(), Ref, 61, Conc, DateTime.Now, UsuarioActual.Empresa.IdCuentaIVAxTrasladar, -1, CveIE, CveIEDevolucion: gvr.DataKey("CveIE").ToEntero(), CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero(), CveCliente: DdlCliente.SelectedValue.ToEntero(), ImporteMX: -gvr.FCTextBox("TxtIVA").Text.ToDecimal()))
if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, -gvr.FCTextBox("TxtIVA").Text.ToDecimal(), Ref, 61, Conc, DateTime.Now, UsuarioActual.Empresa.IdCuentaIVAxTrasladar, -1, CveIE, CveIEDevolucion: gvr.DataKey("CveIE").ToEntero(), CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero(), CveCliente: DdlCliente.SelectedValue.ToEntero(), ImporteMX: -gvr.FCTextBox("TxtIVA").Text.ToDecimal()))
{
MsgError = "No se pudo insertar concepto de IVA";
}
}
else
{
MsgError = "No se pudo insertar concepto de IVA";
//INGxC
if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovoDevolucion, gvr.FCTextBox("TxtAbonar").Text.ToDecimal(), Ref, CveConceptoContableDevolucion, Conc, DateTime.Now, IDCtaContableDevolucion, -1, CveIE: CveIE, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero(), CveCliente: DdlCliente.SelectedValue.ToEntero(), ImporteMX: gvr.FCTextBox("TxtAbonar").Text.ToDecimal(), CveIEDevolucion: gvr.DataKey("CveIE").ToEntero()))
{
MsgError = "No se pudo insertar concepto de bancos";
}
}
}
else
{
//INGxC
if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovoDevolucion, gvr.FCTextBox("TxtAbonar").Text.ToDecimal(), Ref, CveConceptoContableDevolucion, Conc, DateTime.Now, IDCtaContableDevolucion, -1, CveIE: CveIE, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero(), CveCliente: DdlCliente.SelectedValue.ToEntero(), ImporteMX: gvr.FCTextBox("TxtAbonar").Text.ToDecimal(), CveIEDevolucion: gvr.DataKey("CveIE").ToEntero()))
{
MsgError = "No se pudo insertar concepto de bancos";
}
}
}
else
{
if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovoDevolucion, gvr.FCTextBox("TxtAbonar").Text.ToDecimal(), Ref, CveConceptoContableDevolucion, Conc, DateTime.Now, IDCtaContableDevolucion, -1, CveIE: gvr.DataKey("CveIE").ToEntero(), CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero(), CveProveedor: cveProveedor, CvePersonal: cvePersonal, ImporteMX: gvr.FCTextBox("TxtAbonar").Text.ToDecimal(), CveIEDevolucion: CveIE))
{
MsgError = "No se pudo insertar concepto de Devolución";
break;
}
// OTROS INGRESOS
if (gvr.FCTextBox("TxtComision").Text.ToDecimal() != 0)
{
if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovoDevolucion, gvr.FCTextBox("TxtComision").Text.ToDecimal(), Ref, 78, Conc, DateTime.Now, UsuarioActual.Empresa.IdCuentaOtrosIngresos, -1, CveIE: gvr.DataKey("CveIE").ToEntero(), CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero(), CveProveedor: cveProveedor, CvePersonal: cvePersonal, ImporteMX: gvr.FCTextBox("TxtComision").Text.ToDecimal(), CveIEDevolucion: CveIE))
if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovoDevolucion, gvr.FCTextBox("TxtAbonar").Text.ToDecimal(), Ref, CveConceptoContableDevolucion, Conc, DateTime.Now, IDCtaContableDevolucion, -1, CveIE: gvr.DataKey("CveIE").ToEntero(), CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero(), CveProveedor: cveProveedor, CvePersonal: cvePersonal, ImporteMX: gvr.FCTextBox("TxtAbonar").Text.ToDecimal(), CveIEDevolucion: CveIE))
{
MsgError = "No se pudo insertar concepto de Devolución";
break;
}
// OTROS INGRESOS
if (gvr.FCTextBox("TxtComision").Text.ToDecimal() != 0)
{
if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovoDevolucion, gvr.FCTextBox("TxtComision").Text.ToDecimal(), Ref, 78, Conc, DateTime.Now, UsuarioActual.Empresa.IdCuentaOtrosIngresos, -1, CveIE: gvr.DataKey("CveIE").ToEntero(), CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero(), CveProveedor: cveProveedor, CvePersonal: cvePersonal, ImporteMX: gvr.FCTextBox("TxtComision").Text.ToDecimal(), CveIEDevolucion: CveIE))
{
MsgError = "No se pudo insertar concepto de Devolución";
break;
}
}
}
}
}
}
//GUARDA PREPOLIZAS DETALLE Bancos
if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, !TipoMovoDevolucion, TxtImporte.Text.ToDecimal(), Ref, CveConceptoContableBanco, Conc, DateTime.Now, IDCtaContableBancos, -1, CveIE, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero(), CveCliente: cveCliente, CveProveedor: cveProveedor, CvePersonal: cvePersonal, ImporteMX: TxtImporte.Text.ToDecimal()))
{
MsgError = "No se pudo insertar concepto de bancos";
//GUARDA PREPOLIZAS DETALLE Bancos
if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, !TipoMovoDevolucion, TxtImporte.Text.ToDecimal(), Ref, CveConceptoContableBanco, Conc, DateTime.Now, IDCtaContableBancos, -1, CveIE, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero(), CveCliente: cveCliente, CveProveedor: cveProveedor, CvePersonal: cvePersonal, ImporteMX: TxtImporte.Text.ToDecimal()))
{
MsgError = "No se pudo insertar concepto de bancos";
}
}
}
else
{
MsgError = "No se insertó movimiento bancario";
}
else
{
MsgError = "No se insertó movimiento bancario";
}
}
}
else
{
@@ -551,9 +626,31 @@ public partial class Bancos_Devoluciones : ClsPaginas
ObjIE.Dispose();
ObjMov.Dispose();
ObjNom.Dispose();
if (ObjComp != null)
ObjComp.Dispose();
}
#endregion
#endregion
protected void CargaConcepto()
{
ClsNominas onom = new ClsNominas();
onom.GetConceptos(UsuarioActual.CveEmpresa);
DataTable dt = onom.DtResultados.FiltraParametros(" FormulaTotal = 'FNC.[MovimientosPermanentes]'");
DdlConcepto.Items.Clear();
DdlConcepto.DataSource = dt.FiltraParametros("Tipo ='D'");
DataRow drow = dt.NewRow();
drow["CveConcepto"] = "-1";
drow["Concepto"] = "Seleccione";
dt.Rows.InsertAt(drow, 0);
DdlConcepto.DataSource = dt;
DdlConcepto.SelectedValueExist("-1");
DdlConcepto.DataBind();
onom.Dispose();
//DdlConcepto.Items.Insert(0, new ListItem("Seleccione", "-1"));
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,126 +1,139 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepIgnicion.aspx.cs" Inherits="GPS_RepIgnicion" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server">
Reporte de Ignición
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server">
<li>
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:LinkButton ID="LnkImprimirPDF" Visible="false" OnClick="LnkImprimirPDF_Click" runat="server"><i class="fa fa-file-pdf-o"></i> Imprimir PDF</asp:LinkButton>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="LnkImprimirPDF" />
</Triggers>
</asp:UpdatePanel>
</li>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" Runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" Runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter" style="">
<div class="portlet-title portlet-filterT smalltitle " style="">
<div class="tools">
<asp:Button ID="BtnConsultar" OnClick="BtnConsultar_Click" runat="server" ValidationGroup="GrpGuardar" Text="Consultar" class="btn btn-primary" />
</div>
<div class="titlefiltros caption" style="margin-top: -8px;">
<ul class="list-inline" style="font-size: 12px;">
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepIgnicion.aspx.cs" Inherits="GPS_RepIgnicion" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Reporte de Ignición
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<li>
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:LinkButton ID="LnkImprimirPDF" Visible="false" OnClick="LnkImprimirPDF_Click" runat="server"><i class="fa fa-file-pdf-o"></i> Imprimir PDF</asp:LinkButton>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="LnkImprimirPDF" />
</Triggers>
</asp:UpdatePanel>
</li>
<li>
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:LinkButton ID="LnkImprimirEXCEL" Visible="false" OnClick="LnkImprimirEXCEL_Click" runat="server"><i class="fa fa-file-excel-o"></i> Imprimir EXCEL</asp:LinkButton>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="LnkImprimirEXCEL" />
</Triggers>
</asp:UpdatePanel>
</li>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter" style="">
<div class="portlet-title portlet-filterT smalltitle " style="">
<div class="tools">
<asp:Button ID="BtnConsultar" OnClick="BtnConsultar_Click" runat="server" ValidationGroup="GrpGuardar" Text="Consultar" class="btn btn-primary" />
</div>
<div class="titlefiltros caption" style="margin-top: -8px;">
<ul class="list-inline" style="font-size: 12px;">
<li>Vehículo:
<asp:DropDownList AppendDataBoundItems="true" ID="DdlDispositivo" runat="server" Width="200px" DataTextField="Display" DataValueField="CveDispositivo" CssClass="form-control input-sm select2me">
<asp:ListItem Selected="True" Value="-1" Text="Seleccione"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVDispositivo" runat="server" ControlToValidate="DdlDispositivo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Conductor''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEDispositivo" runat="server" HighlightCssClass="vco" TargetControlID="RFVDispositivo" Width="350px"></ajax:ValidatorCalloutExtender>
</li>
<asp:DropDownList AppendDataBoundItems="true" ID="DdlDispositivo" runat="server" Width="200px" DataTextField="Display" DataValueField="CveDispositivo" CssClass="form-control input-sm select2me">
<asp:ListItem Selected="True" Value="-1" Text="Seleccione"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVDispositivo" runat="server" ControlToValidate="DdlDispositivo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Conductor''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEDispositivo" runat="server" HighlightCssClass="vco" TargetControlID="RFVDispositivo" Width="350px"></ajax:ValidatorCalloutExtender>
</li>
<li>Fecha Inicio:
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy hh:mm" style="display: inline-block;">
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control input-sm ADDateTimePicker" CausesValidation="true" MaxLength="18" Width="132px "></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Inicio''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator4" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</li>
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy hh:mm" style="display: inline-block;">
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control input-sm ADDateTimePicker" CausesValidation="true" MaxLength="18" Width="132px "></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Inicio''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator4" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</li>
<li>Fecha Fin:
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy" style="display: inline-block;">
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control input-sm ADDateTimePicker" CausesValidation="true" MaxLength="18" Width="132px "></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Fin''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator5" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</li>
</ul>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet light smmallpadding traspasorow bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Igniciones</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body rowpadding">
<asp:GridView ID="GvIgnicion" runat="server" GridLines="None" OnRowDataBound="GvIgnicion_RowDataBound" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" data-rows ="1" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Numero de Vueltas Realizadas">
<Columns>
<asp:BoundField DataField="Vehiculo" ItemStyle-Width="12.5%" HeaderText="Vehículo" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="FechaEncendido" ItemStyle-Width="12.5%" HeaderText="Fecha Encendido" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="FechaApagado" ItemStyle-Width="12.5%" HeaderText="Fecha Apagado" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="VMedia" DataFormatString="{0:N2} Km/hr." ItemStyle-Width="12.5%" HeaderText="Velocidad Media" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="VMax" DataFormatString="{0:N2} Km/hr." ItemStyle-Width="12.5%" HeaderText="Velocidad Máxima" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="Kilometraje" DataFormatString="{0:N2} Km." ItemStyle-Width="12.5%" HeaderText="Kilometraje" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="Duracion" ItemStyle-Width="12.5%" HeaderText="Duración" ItemStyle-HorizontalAlign="Center" />
<asp:TemplateField ItemStyle-Width="12.5%" HeaderText="Dirección Inicial" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Literal ID="LtlDireccionInicial" runat="server"></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="12.5%" HeaderText="Dirección Final" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Literal ID="LtlDireccionFinal" runat="server"></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div id="DivModalGrafica" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpGraficaEventos" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-body">
<asp:HiddenField ID="HdnImagen" ClientIDMode="Static" Value="[]" runat="server" />
<asp:HiddenField ID="HdnGrafica" ClientIDMode="Static" Value="[]" runat="server" />
<div id="DvGrafica" style="min-width: 900px; height: 500px; margin: 0 auto"></div>
</div>
<div class="modal-footer">
<div class="modal-btn">
<button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">
</asp:Content>
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy" style="display: inline-block;">
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control input-sm ADDateTimePicker" CausesValidation="true" MaxLength="18" Width="132px "></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Fin''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator5" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</li>
</ul>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet light smmallpadding traspasorow bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Igniciones</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body rowpadding">
<asp:GridView ID="GvIgnicion" runat="server" GridLines="None" OnRowDataBound="GvIgnicion_RowDataBound" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" data-rows="1" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Numero de Vueltas Realizadas">
<Columns>
<asp:BoundField DataField="Vehiculo" ItemStyle-Width="12.5%" HeaderText="Vehículo" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="FechaEncendido" ItemStyle-Width="12.5%" HeaderText="Fecha Encendido" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="FechaApagado" ItemStyle-Width="12.5%" HeaderText="Fecha Apagado" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="VMedia" DataFormatString="{0:N2} Km/hr." ItemStyle-Width="12.5%" HeaderText="Velocidad Media" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="VMax" DataFormatString="{0:N2} Km/hr." ItemStyle-Width="12.5%" HeaderText="Velocidad Máxima" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="Kilometraje" DataFormatString="{0:N2} Km." ItemStyle-Width="12.5%" HeaderText="Kilometraje" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="Duracion" ItemStyle-Width="12.5%" HeaderText="Duración" ItemStyle-HorizontalAlign="Center" />
<asp:TemplateField ItemStyle-Width="12.5%" HeaderText="Dirección Inicial" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Literal ID="LtlDireccionInicial" runat="server"></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="12.5%" HeaderText="Dirección Final" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Literal ID="LtlDireccionFinal" runat="server"></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div id="DivModalGrafica" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpGraficaEventos" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-body">
<asp:HiddenField ID="HdnImagen" ClientIDMode="Static" Value="[]" runat="server" />
<asp:HiddenField ID="HdnGrafica" ClientIDMode="Static" Value="[]" runat="server" />
<div id="DvGrafica" style="min-width: 900px; height: 500px; margin: 0 auto"></div>
</div>
<div class="modal-footer">
<div class="modal-btn">
<button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -58,7 +58,8 @@ public partial class GPS_RepIgnicion : ClsPaginas
DtIgniciones = ObjGPS.DtResultados;
GvIgnicion.DataSource = DtIgniciones;
GvIgnicion.DataBind();
LnkImprimirPDF.Visible = true;
LnkImprimirPDF.Visible = true;
LnkImprimirEXCEL.Visible = true;
}
}
UpDatos.Update();
@@ -104,14 +105,18 @@ public partial class GPS_RepIgnicion : ClsPaginas
protected void LnkImprimirPDF_Click(object sender, EventArgs e)
{
EnviarReporteProgramado();
EnviarReporteProgramado("PDF");
}
protected void LnkImprimirEXCEL_Click(object sender, EventArgs e)
{
EnviarReporteProgramado("EXCEL");
}
public void EnviarReporteProgramado()
public void EnviarReporteProgramado(string Formato = "PDF")
{
if (DtIgniciones != null)
{
byte[] retorno;
string RutaReporte = "Empresas/Grales/ReportesProgramados/RPIgnicion.rdlc";
string RutaReporte = ModExtensiones.DirectorioBaseEmpresas + "Empresas/Grales/ReportesProgramados/RPIgnicion.rdlc";
try
{
@@ -121,10 +126,10 @@ public partial class GPS_RepIgnicion : ClsPaginas
RptParametro.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Usuario));
RptParametro.Add(new ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy HH:mm tt")));
retorno = StreamPDF(RutaReporte, DtIgniciones, RptParametro, "ReporteEventos", "PDF", "DsOC");
retorno = StreamPDF(RutaReporte, DtIgniciones, RptParametro, "ReporteEventos", Formato, "DsOC");
// TODO: Labeled Arguments not supported. Argument: 6 := 'MR'
// TODO: Labeled Arguments not supported. Argument: 7 := 'RDSName'
ImprimirbytesPDF(retorno, "ReporteEventos");
ImprimirbytesPDF(retorno, "ReporteEventos", Formato: Formato);
}
catch (Exception ex)
{

View File

@@ -124,10 +124,17 @@
<div class="modal-body">
<asp:UpdatePanel ID="UpBodyInventarioFisico" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtTitulo" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="50"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVTitulos" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtTitulo" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Titulo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
<label for="<%= TxtTitulo.ClientID.ToString()%>">Titulo:</label>
<div class="row">
<div class="col-md-10">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtTitulo" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="50"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVTitulos" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtTitulo" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Titulo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
<label for="<%= TxtTitulo.ClientID.ToString()%>">Titulo:</label>
</div>
</div>
<div class="col-md-2">
<asp:CheckBox runat="server" ID="chkUsarApp" AutoPostBack="true" Text="Usar en App:"/>
</div>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtObservaciones" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="500"></asp:TextBox>
@@ -402,7 +409,65 @@
<asp:BoundField DataField="RazonSocial" HeaderText="Proveedor" ItemStyle-HorizontalAlign="Left" />
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Comandos">
<ItemTemplate>
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" OnClick="DeleteProveedor_Click" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" OnClick="DeleteProveedor_Click" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si"/>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6" runat="server" id="divUsuarios" >
<div class="portlet light xspadding bordered" id="idUsuarios">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Usuarios</span>
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body">
<asp:UpdatePanel ID="upUsuarios" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<div class="row">
<div class="col-md-10">
<label for="<%= DdlUsuarios.ClientID.ToString()%>">Usuarios:</label>
<asp:DropDownList ID="DdlUsuarios" CssClass="form-control select2me" runat="server" DataTextField="Nombre" DataValueField="CveUsuario" Width="100%">
</asp:DropDownList>
</div>
<div class="col-md-2" style="margin-top:20px;">
<asp:Button for="DdlUsuarios" ID="btnAddUsuarios" runat="server" CssClass="btn btn-primary btn-sm" Text="+" />
</div>
</div>
<div class="row">
<div class="col-md-12">
<asp:GridView ID="gvUsuarios" runat="server" GridLines="None" DataKeyNames="CveUsuario, Nombre, Cerrado, Bloqueado" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn ScrollAD" data-heightfijo="150" data-height="150" Width="380px" AutoGenerateColumns="False" EmptyDataText="">
<Columns>
<asp:BoundField DataField="Nombre" HeaderText="Usuarios" ItemStyle-HorizontalAlign="Left" />
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Comandos">
<ItemTemplate>
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" OnClick="DeleteUsurios_Click" CausesValidation="False" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Bloqueado">
<ItemTemplate>
<asp:CheckBox ID="chkBloqueado" runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Cerrado">
<ItemTemplate>
<asp:LinkButton ID="imgCerrar" runat="server" AlternateText="Cerrar" OnClick="imgCerrar_Click" CausesValidation="False" CssClass="btn black" Text="<i class='fa fa-lock'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" style="padding-left: 7px;padding-bottom: 1px;padding-top: 1px;padding-right: 7px; color:black;"/>
</ItemTemplate>
</asp:TemplateField>
</Columns>

View File

@@ -32,6 +32,16 @@ Partial Class Inventarios_InventarioFisico
ViewState("tDTProv") = value
End Set
End Property
Private Property tDTUsuario As DataTable
Get
Return If(IsNothing(ViewState("tDTUsuario")), Nothing, CType(ViewState("tDTUsuario"), DataTable))
End Get
Set(value As DataTable)
ViewState("tDTUsuario") = value
End Set
End Property
Private Property tDTClasifExcluye As DataTable
Get
Return If(IsNothing(ViewState("tDTClasifExcluye")), Nothing, CType(ViewState("tDTClasifExcluye"), DataTable))
@@ -78,10 +88,12 @@ Partial Class Inventarios_InventarioFisico
CargDdlProveedor()
CargaDdlProductosServicios()
CargDdlAlmacen()
CargaDdlUsuarios()
CreaTmpClasificaciones()
CreaTmpProductosServicios()
CreaTmpAlmacen()
CreaTmpProveedores()
CreaTmpUsuario()
CargaDatos(UsuarioActual.CveEmpresa)
End If
@@ -145,6 +157,16 @@ Partial Class Inventarios_InventarioFisico
GvProveedor.DataBind()
UpProveedor.Update()
End Sub
Private Sub CargaGvUsuarios()
Dim ObjInventario As New ClsInventarios()
If ObjInventario.GetInventarioFisicoDetallesUsuarios(HdnID.Value, UsuarioActual.CveEmpresa) Then
gvUsuarios.DataSource = ObjInventario.DtResultados.FiltraParametros("Incluye = 1")
End If
ObjInventario.Dispose()
gvUsuarios.DataBind()
upUsuarios.Update()
End Sub
Private Sub CargaDdlSubProyectos()
CargarCentrosDeCosto(Nothing, DdlSubProyecto, Nothing, LblSubProyecto)
CargarCentrosDeCosto(Nothing, DdlFiltroSubProyecto, Nothing, LblFiltroSubProyecto)
@@ -191,6 +213,15 @@ Partial Class Inventarios_InventarioFisico
End Sub
Private Sub CargaDdlUsuarios()
Dim FiltroAD() As String = {"CveUsuario", "Usuario", "Nombre", "Contraseña", "CveEmpresa", "Rol", "Correo", "Empresa", "CveRol"}
DdlUsuarios.DataSource = GlobalDTUsuarios.FiltraParametros(String.Format("CveEmpresa = {0} AND Estatus =1", UsuarioActual.CveEmpresa), "Rol ASC", FiltroAD)
DdlUsuarios.Items.Insert(0, New ListItem("Todos", "-1"))
DdlUsuarios.DataBind()
End Sub
#End Region
@@ -352,6 +383,7 @@ Partial Class Inventarios_InventarioFisico
tDTProv.Columns.Add("Incluye", GetType(Integer))
End Sub
Protected Sub DeleteProveedor_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
tDTProv.Rows(GvRow.RowIndex.ToEntero).Delete()
@@ -361,6 +393,69 @@ Partial Class Inventarios_InventarioFisico
End Sub
#End Region
#Region "USUARIOS"
Private Sub btnAddUsuarios_Click(sender As Object, e As EventArgs) Handles btnAddUsuarios.Click
If DdlUsuarios.SelectedValue = -1 Then
Alert("Tienes seleccionada la opcion 'Todos'.", TipoMensaje.MsgInformacion)
GvPS.DataSource = Nothing
GvPS.DataBind()
tDTPS.Rows.Clear()
Else
Dim Row As DataRow = Nothing
Row = tDTUsuario.NewRow
Row("CveUsuario") = DdlUsuarios.SelectedValue.ToEntero
Row("Nombre") = DdlUsuarios.SelectedItem.ToString
Row("Cerrado") = False
Row("Bloqueado") = False
tDTUsuario.Rows.Add(Row)
gvUsuarios.DataSource = tDTUsuario
gvUsuarios.DataBind()
upUsuarios.Update()
End If
End Sub
Private Sub CreaTmpUsuario()
tDTUsuario = New DataTable
tDTUsuario.Columns.Add("CveUsuario", GetType(Integer))
tDTUsuario.Columns.Add("Nombre", GetType(String))
tDTUsuario.Columns.Add("Incluye", GetType(Integer))
tDTUsuario.Columns.Add("Cerrado", GetType(Boolean))
tDTUsuario.Columns.Add("Bloqueado", GetType(Boolean))
End Sub
Public Sub DeleteUsurios_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
tDTUsuario.Rows(GvRow.RowIndex.ToEntero).Delete()
gvUsuarios.DataSource = tDTUsuario
gvUsuarios.DataBind()
upUsuarios.Update()
End Sub
Public Sub imgCerrar_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Dim Estado As Boolean = Convert.ToBoolean(tDTUsuario.Rows(GvRow.RowIndex.ToEntero).Item(3))
If Estado Then
tDTUsuario.Rows(GvRow.RowIndex.ToEntero).Item(3) = False
Else
tDTUsuario.Rows(GvRow.RowIndex.ToEntero).Item(3) = True
End If
Dim ObjInventario As New ClsInventarios()
Dim CveUsuario As Integer = tDTUsuario.Rows(GvRow.RowIndex.ToEntero).Item(0).ToString().ToEntero()
Dim Cerrado As Boolean = Convert.ToBoolean(tDTUsuario.Rows(GvRow.RowIndex.ToEntero).Item(3))
Dim Bloqueado As Boolean = Convert.ToBoolean(tDTUsuario.Rows(GvRow.RowIndex.ToEntero).Item(4))
ObjInventario.UpdateInventarioFisicoUsuarios(HdnID.Value, CveUsuario, Cerrado, Bloqueado)
gvUsuarios.DataSource = tDTUsuario
gvUsuarios.DataBind()
upUsuarios.Update()
End Sub
#End Region
#Region "INVENTARIO FISICO"
Public Sub Delete_Click(sender As Object, e As EventArgs)
Dim ObjInventario As New ClsInventarios()
@@ -383,12 +478,16 @@ Partial Class Inventarios_InventarioFisico
DdlPSExcluye.ddl.SelectedValueExist(-1)
DdlClasificacion.SelectedValueExist(-1)
DdlClasificacionExcluida.SelectedValueExist(-1)
DdlUsuarios.SelectedValueExist(-1)
tDTUsuario.Rows.Clear()
tDTClasif.Rows.Clear()
tDTClasifExcluye.Rows.Clear()
tDTPS.Rows.Clear()
tDTPSExcluye.Rows.Clear()
tALM.Rows.Clear()
gvUsuarios.DataSource = Nothing
gvUsuarios.DataBind()
GvAlmacen.DataSource = Nothing
GvAlmacen.DataBind()
GvClasificacion.DataSource = Nothing
@@ -411,11 +510,13 @@ Partial Class Inventarios_InventarioFisico
CargaGvClasificacion()
CargaGvProductosServicios()
CargaGvProveedores()
CargaGvUsuarios()
tDTClasif = GvClasificacion.DataSource
tDTClasifExcluye = GvClasificacionExcluida.DataSource
tDTPS = GvPS.DataSource
tDTPSExcluye = GvPSExcluye.DataSource
tDTProv = GvProveedor.DataSource
tDTUsuario = gvUsuarios.DataSource
tALM = GvAlmacen.DataSource
UpAddInventarioFisico.Update()
RegistraScript(String.Format("$('#{0}').modal('show');", "divAddInventarioFisico"))
@@ -434,12 +535,13 @@ Partial Class Inventarios_InventarioFisico
tDTClasifExcluye.Rows.Clear()
tALM.Rows.Clear()
tDTProv.Rows.Clear()
tDTUsuario.Rows.Clear()
End If
DdlProductosServicios.ddl.SelectedValueExist(-1)
DdlPSExcluye.ddl.SelectedValueExist(-1)
DdlProveedor.ddl.SelectedValueExist(-1)
DdlUsuarios.SelectedValueExist(-1)
DdlClasificacion.SelectedValueExist(-1)
DdlClasificacionExcluida.SelectedValueExist(-1)
@@ -461,6 +563,8 @@ Partial Class Inventarios_InventarioFisico
GvPSExcluye.DataBind()
GvProveedor.DataSource = Nothing
GvProveedor.DataBind()
gvUsuarios.DataSource = Nothing
gvUsuarios.DataBind()
UpAddInventarioFisico.Update()
RegistraScript("$('#divAddInventarioFisico').modal('show');")
@@ -524,6 +628,16 @@ Partial Class Inventarios_InventarioFisico
End If
If ErrorClasif = False Then
For Each Gvr As GridViewRow In gvUsuarios.Rows
If Not ObjInventario.AddInventarioFisicoUsuarios(HdnID.Value, Gvr.DataKey("CveUsuario").ToEntero, True, False, False) Then
ErrorClasif = True
Exit For
End If
Next
End If
If ErrorClasif = False And CveInventarioFisico > 0 Then
ObjInventario.Commit()
Alert("Agregado Correctamente.", TipoMensaje.MsgInformacion)
@@ -556,6 +670,10 @@ Partial Class Inventarios_InventarioFisico
ErrorClasif = True
End If
If Not ObjInventario.RemoveInventarioFisicoUsuarios(HdnID.Value) Then
ErrorClasif = True
End If
If ErrorClasif = False Then
For Each Gvr As GridViewRow In GvAlmacen.Rows
If Not ObjInventario.AddInventarioFisicoAlmacenes(HdnID.Value, Gvr.DataKey("CveAlmacen").ToEntero) Then
@@ -606,6 +724,21 @@ Partial Class Inventarios_InventarioFisico
End If
If ErrorClasif = False Then
Dim cerrado As Boolean = False
Dim bloqueado As Boolean = False
For Each Gvr As GridViewRow In gvUsuarios.Rows
cerrado = Convert.ToBoolean(Gvr.DataKey("Cerrado").ToString)
bloqueado = Gvr.FCCheckBox("chkBloqueado").Checked
If Not ObjInventario.AddInventarioFisicoUsuarios(HdnID.Value, Gvr.DataKey("CveUsuario").ToEntero, True, cerrado, bloqueado) Then
ErrorClasif = True
Exit For
End If
Next
End If
If ErrorClasif = False And HdnID.Value > 0 Then
ObjInventario.Commit()
@@ -634,9 +767,24 @@ Partial Class Inventarios_InventarioFisico
End If
End Sub
Protected Sub gvUsuarios_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles gvUsuarios.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If Convert.ToBoolean(e.Row.DBCampo("Bloqueado")) Then
e.Row.FCCheckBox("chkBloqueado").Checked = True
End If
If Convert.ToBoolean(e.Row.DBCampo("Cerrado")) Then
e.Row.FCLinkButton("imgCerrar").Text = "<i class='fa fa-lock'></i>"
Else
e.Row.FCLinkButton("imgCerrar").Text = "<i class='fa fa-unlock'></i>"
End If
End If
End Sub
#End Region
#Region "ALMACEN"
Public Sub DeleteAlmacen_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
@@ -689,4 +837,13 @@ Partial Class Inventarios_InventarioFisico
#End Region
Protected Sub chkUsarApp_CheckedChanged(sender As Object, e As EventArgs) Handles chkUsarApp.CheckedChanged
If chkUsarApp.Checked Then
divUsuarios.Visible = True
Else
divUsuarios.Visible = False
End If
End Sub
End Class

View File

@@ -4,6 +4,7 @@ Imports System.Data
Imports Extensiones
Imports System.IO
Imports GemBox.Spreadsheet
Imports Newtonsoft.Json
Partial Class OC
Inherits ClsPaginas
@@ -2095,141 +2096,120 @@ Partial Class OC
End If
'Valida cantidad en contrato
Dim ObjContratos As New ClsContratos
Dim TieneError As Boolean = False
Dim Mensaje As String = ""
Dim dttemp As DataTable = Nothing 'GlobalDTContratos(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveSubProyecto = {0}", DdlSubProyecto.SelectedValue.ToString))
If dttemp IsNot Nothing AndAlso dttemp.Rows.Count > 0 Then
Dim drContrato As DataRow = dttemp.Rows(0)
If ObjContratos.GetContratosDetalle(drContrato("CveContrato").ToString.ToEntero, UsuarioActual.CveEmpresa) Then
Dim dtContratodetalle As DataTable = ObjContratos.DtResultados.FiltraParametros(String.Format("CvePS = {0}", DdlP2.SelectedValue.ToString))
If dtContratodetalle IsNot Nothing AndAlso dtContratodetalle.Rows.Count > 0 Then
Dim drContratoDetalle As DataRow = dtContratodetalle(0)
If Convert.ToBoolean(drContratoDetalle("LimitarCantidad")) Then
If ObjContratos.GetReporteContratosAvancesDetalleControl(drContrato("CveContrato").ToString.ToEntero, UsuarioActual.CveEmpresa) Then
Dim dtContratodetalleControl As DataTable = ObjContratos.DtResultados.FiltraParametros(String.Format("CvePS = {0}", DdlP2.SelectedValue.ToString))
If dtContratodetalleControl IsNot Nothing AndAlso dtContratodetalleControl.Rows.Count > 0 Then
Dim drContratoDetalleControl As DataRow = dtContratodetalleControl(0)
If TxtCant.Text.Trim.ToDouble > drContratoDetalleControl("FaltanteCantidad").ToString.ToDouble Then
Mensaje = String.Format("La cantidad del Producto/Servicio debe ser menor o igual a {0}", drContratoDetalleControl("FaltanteCantidad").ToString)
TieneError = True
End If
Else
Mensaje = "Este producto no pertence al contrato seleccionado"
TieneError = True
End If
Else
Mensaje = "Error al consultar el contrato"
End If
End If
Else
Mensaje = "Este producto no pertence al contrato seleccionado"
TieneError = True
End If
Else
Mensaje = "Error al consultar el contrato"
End If
Dim dttemp As New DataTable ' GlobalDTContratos().FiltraParametros(String.Format("CveSubProyecto = {0}", DdlSubProyecto.SelectedValue.ToString))
dttemp.Columns.Add("CveSubProyecto", GetType(Integer))
dttemp.Columns.Add("CvePS", GetType(Integer))
dttemp.Columns.Add("Cantidad", GetType(Decimal))
dttemp.Columns.Add("PU", GetType(Decimal))
Dim DrPSValidar = dttemp.NewRow
DrPSValidar("CveSubProyecto") = DdlSubProyecto.SelectedValue.ToString.ToEntero
DrPSValidar("CvePS") = DdlP2.SelectedValue.ToString.ToEntero
DrPSValidar("Cantidad") = TxtCant.Text.Trim.ToDecimal
DrPSValidar("PU") = txtPrecioUnitario.Text.Trim.ToDecimal
dttemp.Rows.Add(DrPSValidar)
Dim dtPSInvalidos As String = ValidarPSContrato(dttemp)
If dtPSInvalidos <> "" Then
Alert(dtPSInvalidos, TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If Not TieneError Then
ObjContratos.Dispose()
If DtDetalle IsNot Nothing Then
Dim DrPS = GlobalDTPS(CveEmpresaActual, CvePS:=DdlP2.SelectedValue.ToEntero).FiltroPrimero("")
If DrPS Is Nothing Then
Alert("Ocurrió un error al cargar la información del producto. Por favor vuelva a intentar.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If DtDetalle IsNot Nothing Then
Dim DrPS = GlobalDTPS(CveEmpresaActual, CvePS:=DdlP2.SelectedValue.ToEntero).FiltroPrimero("")
If DrPS Is Nothing Then
Alert("Ocurrió un error al cargar la información del producto. Por favor vuelva a intentar.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If UsuarioActual.Empresa.Funcionalidad(532) = "1" Then
Dim ObjCon As New ClsContratos
Dim CvePresupuesto As Integer = 0
Dim Autorizado As Double = 0
Dim Ejercido As Double = 0
If ObjCon.GetPresupuestos(-1, "-1", DdlSubProyecto.SelectedValue.ToEntero, 2, -1, UsuarioActual.CveEmpresa) Then
If ObjCon.DtResultados.Rows.Count > 0 Then
CvePresupuesto = ObjCon.DtResultados.Rows(0)("CvePresupuesto").ToString.ToEntero
If CvePresupuesto > 0 Then
If ObjCon.GetPresupuestosDetalle(CvePresupuesto, -1, UsuarioActual.CveEmpresa) Then
If ObjCon.DtResultados.FiltraParametros($"CveClasificacion = {DdlClasificacion.SelectedValue.ToEntero} AND Importe > 0").Rows.Count > 0 Then
Autorizado = ObjCon.DtResultados.FiltraParametros($"CveClasificacion = {DdlClasificacion.SelectedValue.ToEntero} AND Importe > 0").Rows(0)("Importe").ToString.ToDouble
End If
If UsuarioActual.Empresa.Funcionalidad(532) = "1" Then
Dim ObjCon As New ClsContratos
Dim CvePresupuesto As Integer = 0
Dim Autorizado As Double = 0
Dim Ejercido As Double = 0
If ObjCon.GetPresupuestos(-1, "-1", DdlSubProyecto.SelectedValue.ToEntero, 2, -1, UsuarioActual.CveEmpresa) Then
If ObjCon.DtResultados.Rows.Count > 0 Then
CvePresupuesto = ObjCon.DtResultados.Rows(0)("CvePresupuesto").ToString.ToEntero
If CvePresupuesto > 0 Then
If ObjCon.GetPresupuestosDetalle(CvePresupuesto, -1, UsuarioActual.CveEmpresa) Then
If ObjCon.DtResultados.FiltraParametros($"CveClasificacion = {DdlClasificacion.SelectedValue.ToEntero} AND Importe > 0").Rows.Count > 0 Then
Autorizado = ObjCon.DtResultados.FiltraParametros($"CveClasificacion = {DdlClasificacion.SelectedValue.ToEntero} AND Importe > 0").Rows(0)("Importe").ToString.ToDouble
End If
If ObjCon.GetPresupuestosRep(CvePresupuesto, -1, 1, $"01/09/{DateTime.Now.Year - 1}".ToDate, Now, UsuarioActual.CveEmpresa, DdlProyecto.SelectedValue.ToEntero,
DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveUsuario, DdlClasificacion.SelectedValue.ToEntero) Then
If ObjCon.DtResultados.Rows.Count > 0 Then
Ejercido = ObjCon.DtResultados.Rows(0)("Ejercido").ToString.ToDouble
End If
End If
If ObjCon.GetPresupuestosRep(CvePresupuesto, -1, 1, $"01/09/{DateTime.Now.Year - 1}".ToDate, Now, UsuarioActual.CveEmpresa, DdlProyecto.SelectedValue.ToEntero,
DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveUsuario, DdlClasificacion.SelectedValue.ToEntero) Then
If ObjCon.DtResultados.Rows.Count > 0 Then
Ejercido = ObjCon.DtResultados.Rows(0)("Ejercido").ToString.ToDouble
End If
End If
End If
End If
ObjCon.Dispose()
End If
ObjCon.Dispose()
If CvePresupuesto > 0 And Autorizado > 0 Then
Dim Diferencia As Double = (Ejercido + If(txtPrecioUnitario.Text.ToDouble > 0, (txtPrecioUnitario.Text.ToDouble * TxtCant.Text.ToDouble) - TxtDescuentoAdd.Text.ToDouble, 0)) - Autorizado
If Diferencia > 0 Then
Alert($"No hay presupuesto disponible en el subproyecto <b>{DdlSubProyecto.SelectedItem.Text}</b> y la clasificación <b>{DdlClasificacion.SelectedItem.Text}</b> se excede por <b>{Diferencia.FormatoNumero}</b>", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If CvePresupuesto > 0 And Autorizado > 0 Then
Dim Diferencia As Double = (Ejercido + If(txtPrecioUnitario.Text.ToDouble > 0, (txtPrecioUnitario.Text.ToDouble * TxtCant.Text.ToDouble) - TxtDescuentoAdd.Text.ToDouble, 0)) - Autorizado
If Diferencia > 0 Then
Alert($"No hay presupuesto disponible en el subproyecto <b>{DdlSubProyecto.SelectedItem.Text}</b> y la clasificación <b>{DdlClasificacion.SelectedItem.Text}</b> se excede por <b>{Diferencia.FormatoNumero}</b>", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
Dim RetISR As Double = DrPS("RetISR").ToString.ToDouble
Dim RetIVA As Double = DrPS("RetIVA").ToString.ToDouble
Dim IvaPS As Double = DrPS("IVA").ToString.ToDouble
'If IvaPS = -1 Then 'IVA DE LA SUCURSAL
' IvaPS = GlobalDTSubProyectos(-1, DdlSubProyecto.SelectedValue.ToEntero).FiltroPrimeroValor("IVA").ToDouble
'End If
Dim IEPSPS As Double = DrPS("IEPSPorcentaje").ToString.ToDouble
Dim IEPSPSIVA As Double = If(DrPS("IEPSGrabaIVA").ToString = "True", DrPS("IEPSPorcentaje").ToString.ToDouble, 0)
Dim IdCuentaPorEjercer As Integer = If(HdnCveCuentaPorEjercer.Value = String.Empty, -1, HdnCveCuentaPorEjercer.Value.ToEntero)
Dim IdCuentaComprometido As Integer = If(HdnCveCuentaComprometido.Value = String.Empty, -1, HdnCveCuentaComprometido.Value.ToEntero)
Dim Proyecto As String = If(DdlProyecto.SelectedValue.ToString.ToEntero > 0, DdlProyecto.SelectedItem.Text, "Sin Proyecto")
Dim SubProyecto As String = If(DdlSubProyecto.SelectedValue.ToString.ToEntero > 0, DdlSubProyecto.SelectedItem.Text, "Sin SubProyecto")
Dim TotalPS As Double = If(txtPrecioUnitario.Text.ToDouble > 0, (txtPrecioUnitario.Text.ToDouble * TxtCant.Text.ToDouble) - TxtDescuentoAdd.Text.ToDouble, 0)
Dim ImportePS As Double = If(txtPrecioUnitario.Text.ToDouble > 0, txtPrecioUnitario.Text.ToDouble, 0)
Dim CveOrdenCompraDetalle As Integer = DtDetalle.MAX("CveOrdenCompraDetalle").ToEntero + 100
'Si es Proveedor Extranjero el IVA es 0%
If GlobalDTCompProveedores(CveEmpresaActual).FiltraParametros($"CveProveedor = {DdlProveedores.SelectedValue} AND RFC = 'XEXX010101000'").Rows.Count = 1 Then
IvaPS = 0
End If
AddPS(TxtCant.Text, DdlP2.SelectedValue.ToEntero, DdlP2.SelectedText, TxtObsPS.Text, ImportePS, TxtDescuentoAdd.Text.ToDouble, TotalPS,
CboUnidadMedida.SelectedValue.ToEntero, IvaPS, IEPSPS, IEPSPSIVA, DdlClasificacion.SelectedValue.ToEntero, CboUnidadMedida.SelectedItem.Text, DdlClasificacion.SelectedItem.Text, DdlProyecto.SelectedValue.ToEntero, Proyecto,
DdlSubProyecto.SelectedValue.ToEntero, SubProyecto, LblCodigo.Text, HdnCveActivoFijo.Value.ToEntero, 0, CveOrdenCompraDetalle, CveOrdenCompra, IdCuentaPorEjercer,
IdCuentaComprometido, DdlACGeneral1.SelectedValue.ToEntero, DdlACGeneral2.SelectedValue.ToEntero, DdlACGeneral3.SelectedValue.ToEntero, DdlACGeneral4.SelectedValue.ToEntero,
DdlACGeneral5.SelectedValue.ToEntero, RetIVA, RetISR, CveCultivoCuadroDetalle:=DdlCultivosCuadro.SelectedValue.ToEntero, Cuadro:=DdlCultivosCuadro.SelectedItem.Text)
TxtCant.Text = ""
CboUnidadMedida.SelectedIndex = 0
DdlClasificacion.SelectedIndex = 0
DdlP2.SelectedValue = "-1"
DdlP2.SelectedText = "Seleccione un producto o servicio"
txtPrecioUnitario.Text = ""
TxtObsPS.Text = ""
HdnCveActivoFijo.Value = ""
LblCodigo.Text = ""
LblCvePOA.Text = ""
TxtCant.Focus()
Total.Text = "0.00"
TxtDescuentoAdd.Text = "0.00"
End If
CargaSuperior()
CargaDatosDetalles()
UPPDetalle.Update()
Else
Alert(Mensaje, TipoMensaje.MsgAdvertencia)
Dim RetISR As Double = DrPS("RetISR").ToString.ToDouble
Dim RetIVA As Double = DrPS("RetIVA").ToString.ToDouble
Dim IvaPS As Double = DrPS("IVA").ToString.ToDouble
'If IvaPS = -1 Then 'IVA DE LA SUCURSAL
' IvaPS = GlobalDTSubProyectos(-1, DdlSubProyecto.SelectedValue.ToEntero).FiltroPrimeroValor("IVA").ToDouble
'End If
Dim IEPSPS As Double = DrPS("IEPSPorcentaje").ToString.ToDouble
Dim IEPSPSIVA As Double = If(DrPS("IEPSGrabaIVA").ToString = "True", DrPS("IEPSPorcentaje").ToString.ToDouble, 0)
Dim IdCuentaPorEjercer As Integer = If(HdnCveCuentaPorEjercer.Value = String.Empty, -1, HdnCveCuentaPorEjercer.Value.ToEntero)
Dim IdCuentaComprometido As Integer = If(HdnCveCuentaComprometido.Value = String.Empty, -1, HdnCveCuentaComprometido.Value.ToEntero)
Dim Proyecto As String = If(DdlProyecto.SelectedValue.ToString.ToEntero > 0, DdlProyecto.SelectedItem.Text, "Sin Proyecto")
Dim SubProyecto As String = If(DdlSubProyecto.SelectedValue.ToString.ToEntero > 0, DdlSubProyecto.SelectedItem.Text, "Sin SubProyecto")
Dim TotalPS As Double = If(txtPrecioUnitario.Text.ToDouble > 0, (txtPrecioUnitario.Text.ToDouble * TxtCant.Text.ToDouble) - TxtDescuentoAdd.Text.ToDouble, 0)
Dim ImportePS As Double = If(txtPrecioUnitario.Text.ToDouble > 0, txtPrecioUnitario.Text.ToDouble, 0)
Dim CveOrdenCompraDetalle As Integer = DtDetalle.MAX("CveOrdenCompraDetalle").ToEntero + 100
'Si es Proveedor Extranjero el IVA es 0%
If GlobalDTCompProveedores(CveEmpresaActual).FiltraParametros($"CveProveedor = {DdlProveedores.SelectedValue} AND RFC = 'XEXX010101000'").Rows.Count = 1 Then
IvaPS = 0
End If
AddPS(TxtCant.Text, DdlP2.SelectedValue.ToEntero, DdlP2.SelectedText, TxtObsPS.Text, ImportePS, TxtDescuentoAdd.Text.ToDouble, TotalPS,
CboUnidadMedida.SelectedValue.ToEntero, IvaPS, IEPSPS, IEPSPSIVA, DdlClasificacion.SelectedValue.ToEntero, CboUnidadMedida.SelectedItem.Text, DdlClasificacion.SelectedItem.Text, DdlProyecto.SelectedValue.ToEntero, Proyecto,
DdlSubProyecto.SelectedValue.ToEntero, SubProyecto, LblCodigo.Text, HdnCveActivoFijo.Value.ToEntero, 0, CveOrdenCompraDetalle, CveOrdenCompra, IdCuentaPorEjercer,
IdCuentaComprometido, DdlACGeneral1.SelectedValue.ToEntero, DdlACGeneral2.SelectedValue.ToEntero, DdlACGeneral3.SelectedValue.ToEntero, DdlACGeneral4.SelectedValue.ToEntero,
DdlACGeneral5.SelectedValue.ToEntero, RetIVA, RetISR, CveCultivoCuadroDetalle:=DdlCultivosCuadro.SelectedValue.ToEntero, Cuadro:=DdlCultivosCuadro.SelectedItem.Text)
TxtCant.Text = ""
CboUnidadMedida.SelectedIndex = 0
DdlClasificacion.SelectedIndex = 0
DdlP2.SelectedValue = "-1"
DdlP2.SelectedText = "Seleccione un producto o servicio"
txtPrecioUnitario.Text = ""
TxtObsPS.Text = ""
HdnCveActivoFijo.Value = ""
LblCodigo.Text = ""
LblCvePOA.Text = ""
TxtCant.Focus()
Total.Text = "0.00"
TxtDescuentoAdd.Text = "0.00"
End If
ObjContratos.Dispose()
CargaSuperior()
CargaDatosDetalles()
UPPDetalle.Update()
End Sub
Private Sub AddPS(Cantidad As String, CvePS As Integer, PS As String, Observaciones As String, Importe As Double, Descuento As Double, Total As Double, CveUnidadMedida As Integer, IVAPS As Double, IEPSPS As Double, IEPSPSIVA As Double, CveClasificacion As Integer,
UM As String, Clasificacion As String, CveProyecto As Integer, Proyecto As String, CveSubProyecto As Integer, SubProyecto As String, CodigoAF As String, CveActivoFijo As Integer, TipoDato As Integer,
@@ -2505,6 +2485,12 @@ Partial Class OC
TieneError = True
End If
Dim dtPSInvalidos As String = ValidarPSContrato(DtDetalle.FiltraParametros("", "", {"CveSubProyecto", "CvePS", "Cantidad", "PU"}))
If dtPSInvalidos <> "" Then
Alert(dtPSInvalidos, TipoMensaje.MsgAdvertencia)
TieneError = True
End If
Return TieneError
End Function
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click
@@ -8544,4 +8530,40 @@ Partial Class OC
DdlCultivosCuadroEdit.SelectedValueExist(CveCultivoCuadroDetalle)
End Sub
Private Function ValidarPSContrato(DtPS As DataTable) As String
Dim Retorno As String = ""
Dim objContratos As New ClsContratos
Dim TempPS As String = JsonConvert.SerializeObject(DtPS).ToString
Dim MensajeProducto As String = ""
Dim MensajeCantidad As String = ""
Dim MensajeImporte As String = ""
If objContratos.ValidaPSContrato(TempPS) Then
If objContratos.DtResultados.Rows.Count > 0 Then
MensajeProducto = "Los siguientes productos no pertenece al contrato seleccionado: "
MensajeCantidad = "Los siguientes productos sobrepasan la cantidad faltante del contrato seleccionado: "
MensajeImporte = "Los siguientes productos sobrepasan los importes faltantes del contrato seleccionado: "
For Each dr As DataRow In objContratos.DtResultados.Rows
If dr("ProductoNoContratado").ToString.ToEntero = 1 Then
MensajeProducto += String.Format("<br/> {0}", dr("PS"))
ElseIf dr("CantidadSobrePasada").ToString.ToEntero = 1 Then
MensajeCantidad += String.Format("<br/> {0} - Cantidad maxima: {1}", dr("PS"), dr("FaltanteCantidad"))
ElseIf dr("ImporteSobrePasado").ToString.ToEntero = 1 Then
MensajeImporte += String.Format("<br/> {0} - Importe maximo: {1}", dr("PS"), dr("FaltanteImporte"))
End If
Next
End If
End If
If MensajeProducto.Length <> 64 Then
Retorno = MensajeProducto
ElseIf MensajeCantidad.Length <> 84 Then
Retorno = MensajeCantidad
ElseIf MensajeImporte.Length <> 86 Then
Retorno = MensajeImporte
End If
Return Retorno
End Function
End Class

View File

@@ -1571,6 +1571,7 @@
</div>
<div class="modal-body">
<asp:HiddenField ID="HdnDescuento" runat="server" ClientIDMode="Static" Value="0" />
<asp:HiddenField ID="HdnPorcentajeDescuentoMaximo" runat="server" ClientIDMode="Static" Value="0" />
<asp:HiddenField ID="HdnDescuentoGeneral" runat="server" ClientIDMode="Static" Value="-1" />
<asp:HiddenField ID="HdnTipoDescuento" runat="server" ClientIDMode="Static" Value="-1" />
<table>
@@ -3344,6 +3345,15 @@
}
var Descuento = parseFloat($get("TxtPorDescP").value);
var PorcentajeDescuentoMaximo = parseFloat($get("HdnPorcentajeDescuentoMaximo").value);
if (PorcentajeDescuentoMaximo > 0 && Descuento > PorcentajeDescuentoMaximo) {
$get("TxtDescP").value = "0";
$get("TxtPorDescP").value = "0";
Descuento = 0;
alert("No puede exceder el descuento maximo autorizado.");
}
$get("LblPrecioFinal").innerText = formato_numero(Monto - ((Monto * Descuento) / 100), 2, '.', ',');
$get("LblTotalPS").innerText = formato_numero(parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")), 2, '.', ',');
var Total = Monto - parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", ""));
@@ -3354,6 +3364,7 @@
if (TipoDescuento == 2) {
$get("LblDescuentos").innerText = formato_numero(Total, 2, '.', ',');
}
}
else {
$get("LblPrecioFinal").innerText = "0.00";
@@ -3383,6 +3394,17 @@
}
var Descuento = parseFloat($get("TxtDescP").value);
var PorcentajeDescuento = (Descuento * 100 / Monto)
var PorcentajeDescuentoMaximo = parseFloat($get("HdnPorcentajeDescuentoMaximo").value);
if (PorcentajeDescuentoMaximo > 0 && PorcentajeDescuento > PorcentajeDescuentoMaximo) {
$get("TxtDescP").value = "0";
$get("TxtPorDescP").value = "0";
Descuento = 0;
alert("No puede exceder el descuento maximo autorizado.");
}
$get("TxtPorDescP").value = formato_numero((Descuento * 100 / Monto), 2, '.', ',');
$get("LblPrecioFinal").innerText = formato_numero(Monto - Descuento, 2, '.', ',');
$get("LblTotalPS").innerText = formato_numero(parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")), 2, '.', ',');

View File

@@ -1062,6 +1062,7 @@ Partial Class PV
ViewState("ClienteRetIVA") = 0
ViewState("ClienteRetISR") = 0
ViewState("EnviarCorreoCliente") = False
HdnPorcentajeDescuentoMaximo.Value = UsuarioActual.DescuentoAutorizado.ToString()
CveVentaDetalle = -1
EstablecioFolio = False
EstatusCliente = False
@@ -5102,52 +5103,52 @@ Partial Class PV
End Sub
Protected Sub BtnAplicarDescG_Click(sender As Object, e As System.EventArgs) Handles BtnAplicarDescG.Click
If HdnTipoDescuento.Value = "2" Then
'If HdnTipoDescuento.Value = "2" Then
If TmpDT IsNot Nothing AndAlso TmpDT.Rows.Count > 0 Then
Dim IVAPromedio As Double = Math.Round(TmpDT.SUM("IVA") / TmpDT.COUNT("Consec"), 2)
Dim IVA As Double = TmpDT.Rows(0)("IVA").ToString.ToDouble
' If TmpDT IsNot Nothing AndAlso TmpDT.Rows.Count > 0 Then
' Dim IVAPromedio As Double = Math.Round(TmpDT.SUM("IVA") / TmpDT.COUNT("Consec"), 2)
' Dim IVA As Double = TmpDT.Rows(0)("IVA").ToString.ToDouble
If IVAPromedio <> IVA Then
Alert("No se puede aplicar descuento general a la factura ya tiene conceptos con diferente tasa de IVA", TipoMensaje.MsgError)
Else
AplicarDescuentos()
'Dim Descuento As Double = HdnDescuento.Value.Trim.Replace(",", "").ToDouble
CalculaTotalesVenta()
'LblDescuentos.Text = Descuento.FormatoNumero(2)
'TxtIVA.Text = ((TxtSubTotal.Text.Trim.Replace(",", "").ToDouble - Descuento - LblAmortizacion.Text.Trim.Replace(",", "").ToDouble) * IVAPromedio).FormatoNumero(2)
'HdnIVAOriginal.Value = TxtIVA.Text
'CalculaTotales(True)
HdnTipoDescuento.Value = "-1"
HdnDescuento.Value = "0"
RegistraScript("BorraDescuentos();")
End If
End If
UpPS.Update()
' If IVAPromedio <> IVA Then
' Alert("No se puede aplicar descuento general a la factura ya tiene conceptos con diferente tasa de IVA", TipoMensaje.MsgError)
' Else
' AplicarDescuentos()
' 'Dim Descuento As Double = HdnDescuento.Value.Trim.Replace(",", "").ToDouble
' CalculaTotalesVenta()
' 'LblDescuentos.Text = Descuento.FormatoNumero(2)
' 'TxtIVA.Text = ((TxtSubTotal.Text.Trim.Replace(",", "").ToDouble - Descuento - LblAmortizacion.Text.Trim.Replace(",", "").ToDouble) * IVAPromedio).FormatoNumero(2)
' 'HdnIVAOriginal.Value = TxtIVA.Text
' 'CalculaTotales(True)
' HdnTipoDescuento.Value = "-1"
' HdnDescuento.Value = "0"
' RegistraScript("BorraDescuentos();")
' End If
' End If
' UpPS.Update()
ElseIf HdnTipoDescuento.Value = "3" Then
If TmpDT IsNot Nothing AndAlso TmpDT.Rows.Count > 0 Then
Dim IVAPromedio As Double = Math.Round(TmpDT.SUM("IVA") / TmpDT.COUNT("Consec"), 2)
Dim IVA As Double = TmpDT.Rows(0)("IVA").ToString.ToDouble
'ElseIf HdnTipoDescuento.Value = "3" Then
' If TmpDT IsNot Nothing AndAlso TmpDT.Rows.Count > 0 Then
' Dim IVAPromedio As Double = Math.Round(TmpDT.SUM("IVA") / TmpDT.COUNT("Consec"), 2)
' Dim IVA As Double = TmpDT.Rows(0)("IVA").ToString.ToDouble
If IVAPromedio <> IVA Then
Alert("No se puede aplicar descuento general a la factura ya tiene conceptos con diferente tasa de IVA", TipoMensaje.MsgError)
Else
AplicarDescuentos()
'Dim Amortizacion As Decimal = HdnDescuento.Value.Trim.Replace(",", "").ToDecimal
'LblAmortizacion.Text = Amortizacion.FormatoNumero(2)
'TxtIVA.Text = ((TxtSubTotal.Text.Trim.Replace(",", "").ToDouble - Amortizacion - LblDescuentos.Text.Trim.Replace(",", "").ToDouble) * IVAPromedio).FormatoNumero(2)
'HdnIVAOriginal.Value = TxtIVA.Text
'CalculaTotales(True)
CalculaTotalesVenta()
HdnTipoDescuento.Value = "-1"
HdnDescuento.Value = "0"
RegistraScript("BorraDescuentos();")
End If
End If
UpPS.Update()
' If IVAPromedio <> IVA Then
' Alert("No se puede aplicar descuento general a la factura ya tiene conceptos con diferente tasa de IVA", TipoMensaje.MsgError)
' Else
' AplicarDescuentos()
' 'Dim Amortizacion As Decimal = HdnDescuento.Value.Trim.Replace(",", "").ToDecimal
' 'LblAmortizacion.Text = Amortizacion.FormatoNumero(2)
' 'TxtIVA.Text = ((TxtSubTotal.Text.Trim.Replace(",", "").ToDouble - Amortizacion - LblDescuentos.Text.Trim.Replace(",", "").ToDouble) * IVAPromedio).FormatoNumero(2)
' 'HdnIVAOriginal.Value = TxtIVA.Text
' 'CalculaTotales(True)
' CalculaTotalesVenta()
' HdnTipoDescuento.Value = "-1"
' HdnDescuento.Value = "0"
' RegistraScript("BorraDescuentos();")
' End If
' End If
' UpPS.Update()
End If
'End If
RegistraScript("$('#ModalDescuento').modal('hide')", "hidemodal")
End Sub
@@ -6463,7 +6464,7 @@ Partial Class PV
Else
'TxtPUFactura.Enabled = True
'TxtPUFactura.Text = ""
DdlPSAjuste.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, AplicaParaVenta:=1)
DdlPSAjuste.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
End If
DdlPSAjuste.DataBind()
' DdlPSAjuste.Items.Insert(0, New ListItem("Seleccione", "-1"))

View File

@@ -6680,11 +6680,16 @@
</div>
</div>
<div class="portlet-body form-horizontal form-row-sepe formnombottom">
<div class="row">
<div class="col-md-12">
<asp:CheckBox ID="ChkMostarProductosRNCBon" runat="server" AutoPostBack="true" Text="Mostrar Productos" OnCheckedChanged="ChkMostarProductosRNCBon_CheckedChanged" />
</div>
</div>
<div class="row" style="margin-right: 10px;" align="right">
<input type="text" id="TxtBusquedaNCBon" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaNCBon','{0}')", GvRemisionesNCBon.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaNCBon','{0}')", GvRemisionesNCBon.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<div class="row">
<div class="row" id="DivRNCBonificaciones" runat="server" visible="false">
<div class="col-md-12" style="max-height: 440px; overflow: auto">
<asp:GridView ID="GvRemisionesNCBon" runat="server" AutoGenerateColumns="False"
DataKeyNames="CveVenta,CveVentaRNCCargo" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn" GridLines="None">
@@ -6716,6 +6721,35 @@
</asp:GridView>
</div>
</div>
<div class="row" id="DivRNCBonificacionesDetalle" runat="server" visible="false">
<div class="col-md-12" style="max-height: 440px; overflow: auto">
<asp:GridView ID="GvRemisionesNCBonDetalle" runat="server" AutoGenerateColumns="False"
DataKeyNames="CveVenta,CveVentaDetalleRNC,CvePS,PU,PorcentajeIVA" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn" GridLines="None">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="ChkAplicar" runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cantidad">
<ItemTemplate>
<asp:TextBox ID="TxtCantidadRNC" runat="server" Text='<%#Eval("CantidadPendiente").ToString%>' MaxLength="12" Width="46px" Height="24px"></asp:TextBox>
<asp:RangeValidator ID="RVCantRNC" runat="server" Type="Double" MinimumValue="0" MaximumValue='<%#Eval("CantidadPendiente").ToString%>' ErrorMessage="Cantidad Excedida" ControlToValidate="TxtCantidadRNC" Display="None" ValidationGroup="VGAplicarRNC"></asp:RangeValidator>
<ajax:ValidatorCalloutExtender ID="VCECantidad3" runat="server" HighlightCssClass="vco" TargetControlID="RVCantRNC" Width="300px"></ajax:ValidatorCalloutExtender>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Producto" DataField="CodigoPS" ItemStyle-HorizontalAlign="Left" />
<asp:HyperLinkField DataNavigateUrlFields="CveVenta" Target="_blank" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" DataTextField="Folio" HeaderText="Folio" ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Fecha" DataField="Fecha" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" />
<asp:TemplateField HeaderText="Total" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Literal ID="TtlTotal" runat="server" Text='<%# Eval("Total", "{0:N2}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</div>
</div>
<div class="row">
@@ -7769,7 +7803,6 @@
}
function CalculaSaldoRNCChkDetalleBonificacion(TxtCantidad, CantidadPendiente, ImporteTotal, Chk) {
//ImportesRNCCargo
let Importe = 0;
@@ -7836,6 +7869,73 @@
}
}
function CalculaSaldoRNCChkDetalleBon(TxtCantidad, CantidadPendiente, ImporteTotal, Chk) {
//ImportesRNCCargo
let Importe = 0;
if (Chk.checked) {
let SaldoMaximoUtilizable = ToDouble(HdnSMUBon.value);
let ImportesAsignados = 0;
$('.ImportesRNCDetalleBonificacion').each(function () {
if (Chk.id != $(this).find("td").eq(0).find(":checkbox").attr('id')) {
let seleccionado = $(this).find("td").eq(0).find(":checkbox").is(':checked');
if (seleccionado) {
let cantidad = ToDouble($(this).find("td").eq(1).find(":text").val());
let porcentajeIVA = ToDouble($(this).find("td").eq(0).find(":hidden").val());
let precio = ToDouble($(this).find("td").eq(5).find(":hidden").val());
let totalcalculableImpuestos = (cantidad * precio);
let iva = ToDouble((totalcalculableImpuestos * porcentajeIVA).toFixed(2));
ImportesAsignados += totalcalculableImpuestos + iva;
}
}
});
Importe = SaldoMaximoUtilizable - ImportesAsignados;
if (Importe > 0) {
} else {
if (SaldoMaximoUtilizable > 0) {
Importe = 0;
Chk.checked = false;
} else {
Importe = 0;
}
}
} else {
Importe = 0;
}
Importe = ToDouble(Importe.toFixed(2));
if (Importe > 0) {
let pu = (ImporteTotal / CantidadPendiente);
if (pu > 0) {
const cantidadSugerida = (Importe / pu);
if (cantidadSugerida > CantidadPendiente) {
TxtCantidad.value = CantidadPendiente.toString();
}else {
TxtCantidad.value = cantidadSugerida.toString();
}
}else {
TxtCantidad.value = "0";
}
}else {
TxtCantidad.value = "0";
}
}
function LimitaSaldoRNCChk(TxtImporte, Saldo) {

View File

@@ -25127,6 +25127,18 @@ Partial Class Ventas
End If
UpModalRemisionesNC.Update()
End Sub
Protected Sub ChkMostarProductosRNCBon_CheckedChanged(sender As Object, e As EventArgs)
If ChkMostarProductosRNCBon.Checked Then
DivRNCBonificaciones.Visible = False
DivRNCBonificacionesDetalle.Visible = True
CargaRNCDetalleBonificacion(DdlVentaUsado.SelectedValue.ToEntero())
Else
DivRNCBonificaciones.Visible = True
DivRNCBonificacionesDetalle.Visible = False
RblRNCTipo_SelectedIndexChanged(RblRNCTipo, EventArgs.Empty)
End If
UpModalRemisionesNC.Update()
End Sub
Protected Sub ChkMostarProductosRNCDesc_CheckedChanged(sender As Object, e As EventArgs)
RblRNCTipoDesc_SelectedIndexChanged(RblRNCTipo, EventArgs.Empty)
@@ -25339,7 +25351,63 @@ Partial Class Ventas
UpDescNC.Update()
End Sub
Private Sub CargaRNCDetalleBonificacion(Optional CveVentaUsado As Integer = -1)
'Dim ObjMovtos As New ClsMovimientos()
'If ObjMovtos.GetRemisionesNCCliente(CveCliente, True, CveMoneda:=-1, CveClienteSucursal:=DdlSucursalCliente.SelectedValue.ToEntero()) Then
' Me.TmpDTRNCBonificacionDetalle = ObjMovtos.DtResultados.Copy()
'End If
'ObjMovtos.Dispose()
'Me.TmpDTRNCBonificacionDetalle.Columns.Add(New DataColumn("CveVentaDetalleNCGenerada", GetType(Integer)))
'Me.TmpDTRNCBonificacionDetalleSeleccionadas = Nothing
'Me.TmpDTRNCBonificacionDetalleSeleccionadas = TmpDTRNCBonificacionDetalle.Clone()
'Me.TmpDTRNCBonificacionDetalleSeleccionadas.Clear()
'GvRemisionesNCBonDetalle.DataSource = TmpDTRNCBonificacionDetalle.FiltraParametros("TipoRNC = 2")
'GvRemisionesNCBonDetalle.DataBind()
Dim ObjMovtos As New ClsMovimientos()
If ObjMovtos.GetRemisionesNCCliente(CveCliente, True, CveMoneda:=-1, CveClienteSucursal:=DdlSucursalCliente.SelectedValue.ToEntero()) Then
Me.TmpDTRNCDetalle = ObjMovtos.DtResultados.Copy()
End If
ObjMovtos.Dispose()
Me.TmpDTRNCDetalle.Columns.Add(New DataColumn("CveVentaDetalleNCGenerada", GetType(Integer)))
Me.TmpDTRNCDetalleSelecciondas = Nothing
Me.TmpDTRNCDetalleSelecciondas = TmpDTRNCDetalle.Clone()
Me.TmpDTRNCDetalleSelecciondas.Clear()
GvRemisionesNCBonDetalle.DataSource = TmpDTRNCDetalle.FiltraParametros("TipoRNC = 2")
GvRemisionesNCBonDetalle.DataBind()
Dim ObjAcum As New ClsAcumuladores
If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then
Dim RowUsadosNC As DataRow = ObjAcum.DtResultados.Rows(5)
DivSMU.Visible = True
HdnSMUBon.Value = RowUsadosNC("ValorConImpuestos").ToString()
LtlSMUBon.Text = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal().FormatoNumero(2)
Else
'DivSMU.Visible = False
HdnSMUBon.Value = "0"
LtlSMUBon.Text = "0"
End If
ObjAcum.Dispose()
'Dim SaldoMaximoUsados As Decimal = Me.TmpDT.SUM("Total", "EsCargo = True").ToDecimal() + Me.TmpDT.SUM("ImporteIVA", "EsCargo = True").ToDecimal()
'If SaldoMaximoUsados > 0 Then
' HdnSaldoMaximoUsados.Value = SaldoMaximoUsados.ToString()
' LblSaldoMaximoUsados.Text = String.Format("{0:N2}", SaldoMaximoUsados)
'Else
' HdnSaldoMaximoUsados.Value = "0"
' LblSaldoMaximoUsados.Text = "0"
'End If
UpModalRemisionesNC.Update()
End Sub
Private Sub CargaRNCDetalleDescBonificacion()
Dim DtNC As DataTable = Nothing
@@ -25375,74 +25443,95 @@ Partial Class Ventas
If TmpDTRNCBonificacionesSeleccionadas Is Nothing Then
TmpDTRNCBonificacionesSeleccionadas = Me.TmpDTRNCBonificacionesCliente.Clone()
End If
If ChkMostarProductosRNCBon.Checked Then
DivRNCBonificaciones.Visible = False
DivRNCBonificacionesDetalle.Visible = True
Dim ListaBon As New List(Of VentasBonificaciones)
Dim DtBon As DataTable = Nothing
Dim SbFiltro As New StringBuilder()
SbFiltro.Append("CveVenta IN(")
Using ObjAcum As New ClsAcumuladores
If ObjAcum.DistribuidorMovtosGet(CveCliente, UsuarioActual.CveEmpresa, CveVentaRNCCargo:=CveVentaRNCCargo) Then
DtBon = ObjAcum.DtResultados.Copy()
End If
End Using
If DtBon IsNot Nothing Then
Dim queryBonificacion = From dr In DtBon
Where dr("CveVentaBonificacion").ToString().ToEntero > 0
Group By CveVentaBonificacion = dr("CveVentaBonificacion").ToString().ToEntero, CveVenta = dr("CveVenta").ToString().ToEntero
Into x = Group
Select New With {
.CveVentaRNCCargo = CveVenta,
.CveVentaBonificacion = CveVentaBonificacion,
.ImporteBonificacion = x.Sum(Function(s) s("ImporteBonificacion").ToString().ToDecimal),
.IVABonificacion = x.Sum(Function(s) s("IVABonificacion").ToString().ToDecimal)
}
For Each bon In queryBonificacion
SbFiltro.AppendFormat("'{0}',", bon.CveVentaBonificacion)
ListaBon.Add(New VentasBonificaciones() With {.CveVentaRNCCargo = bon.CveVentaRNCCargo, .CveVentaBonificacion = bon.CveVentaBonificacion, .ImporteBonificacion = bon.ImporteBonificacion, .IVABonificacion = bon.IVABonificacion})
Next
SbFiltro.Remove(SbFiltro.Length - 1, 1)
SbFiltro.Append(")")
End If
If ListaBon.Count > 0 Then
Dim Bonificaciones = Me.TmpDTRNCBonificacionesCliente.Select(SbFiltro.ToString())
For Each RowBonificacion As DataRow In Bonificaciones
Dim RNCBonificacion = ListaBon.Where(Function(x) x.CveVentaBonificacion = RowBonificacion("CveVenta").ToString().ToEntero())
RowBonificacion("ImporteBonificacion") = RNCBonificacion.Sum(Function(x) x.ImporteBonificacion)
RowBonificacion("IVABonificacion") = RNCBonificacion.Sum(Function(x) x.IVABonificacion)
RowBonificacion("CveVentaRNCCargo") = CveVentaRNCCargo
If AplicarRNC Then
TmpDTRNCBonificacionesSeleccionadas.Rows.Add(RowBonificacion.ItemArray)
Else
For Each RowEliminar In Me.TmpDTRNCBonificacionesSeleccionadas.Select(SbFiltro.ToString())
RowEliminar.Delete()
Next
End If
Next
End If
'VERIFICA SI TIENE BONIFICACIONES PARA AGREGARLAS
If TmpDTRNCBonificacionesSeleccionadas IsNot Nothing AndAlso TmpDTRNCBonificacionesSeleccionadas.Rows.Count > 0 Then
DivRNCBon.Visible = True
CargaRNCDetalleBonificacion()
Else
DivRNCBon.Visible = False
DivRNCBonificaciones.Visible = True
DivRNCBonificacionesDetalle.Visible = False
Dim ListaBon As New List(Of VentasBonificaciones)
Dim DtBon As DataTable = Nothing
Dim SbFiltro As New StringBuilder()
SbFiltro.Append("CveVenta IN(")
Using ObjAcum As New ClsAcumuladores
If ObjAcum.DistribuidorMovtosGet(CveCliente, UsuarioActual.CveEmpresa, CveVentaRNCCargo:=CveVentaRNCCargo) Then
DtBon = ObjAcum.DtResultados.Copy()
End If
End Using
If DtBon IsNot Nothing Then
Dim queryBonificacion = From dr In DtBon
Where dr("CveVentaBonificacion").ToString().ToEntero > 0
Group By CveVentaBonificacion = dr("CveVentaBonificacion").ToString().ToEntero, CveVenta = dr("CveVenta").ToString().ToEntero
Into x = Group
Select New With {
.CveVentaRNCCargo = CveVenta,
.CveVentaBonificacion = CveVentaBonificacion,
.ImporteBonificacion = x.Sum(Function(s) s("ImporteBonificacion").ToString().ToDecimal),
.IVABonificacion = x.Sum(Function(s) s("IVABonificacion").ToString().ToDecimal)
}
For Each bon In queryBonificacion
SbFiltro.AppendFormat("'{0}',", bon.CveVentaBonificacion)
ListaBon.Add(New VentasBonificaciones() With {.CveVentaRNCCargo = bon.CveVentaRNCCargo, .CveVentaBonificacion = bon.CveVentaBonificacion, .ImporteBonificacion = bon.ImporteBonificacion, .IVABonificacion = bon.IVABonificacion})
Next
SbFiltro.Remove(SbFiltro.Length - 1, 1)
SbFiltro.Append(")")
End If
If ListaBon.Count > 0 Then
Dim Bonificaciones = Me.TmpDTRNCBonificacionesCliente.Select(SbFiltro.ToString())
For Each RowBonificacion As DataRow In Bonificaciones
Dim RNCBonificacion = ListaBon.Where(Function(x) x.CveVentaBonificacion = RowBonificacion("CveVenta").ToString().ToEntero())
RowBonificacion("ImporteBonificacion") = RNCBonificacion.Sum(Function(x) x.ImporteBonificacion)
RowBonificacion("IVABonificacion") = RNCBonificacion.Sum(Function(x) x.IVABonificacion)
RowBonificacion("CveVentaRNCCargo") = CveVentaRNCCargo
If AplicarRNC Then
TmpDTRNCBonificacionesSeleccionadas.Rows.Add(RowBonificacion.ItemArray)
Else
For Each RowEliminar In Me.TmpDTRNCBonificacionesSeleccionadas.Select(SbFiltro.ToString())
RowEliminar.Delete()
Next
End If
Next
End If
'VERIFICA SI TIENE BONIFICACIONES PARA AGREGARLAS
If TmpDTRNCBonificacionesSeleccionadas IsNot Nothing AndAlso TmpDTRNCBonificacionesSeleccionadas.Rows.Count > 0 Then
DivRNCBon.Visible = True
Else
DivRNCBon.Visible = False
End If
GvRemisionesNCBon.DataSource = TmpDTRNCBonificacionesSeleccionadas
GvRemisionesNCBon.DataBind()
'Dim SMUBon As Decimal = Me.TmpDTRNCBonificacionesSeleccionadas.SUM("ImporteBonificacion").ToDecimal() + Me.TmpDTRNCBonificacionesSeleccionadas.SUM("IVABonificacion").ToDecimal()
'LtlSMUBon.Text = String.Format("{0:N2}", SMUBon)
'HdnSMUBon.Value = SMUBon.ToString()
Dim ObjAcum2 As New ClsAcumuladores
If ObjAcum2.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then
Dim RowUsadosNC As DataRow = ObjAcum2.DtResultados.Rows(5)
HdnSMUBon.Value = RowUsadosNC("ValorConImpuestos").ToString()
LtlSMUBon.Text = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal().FormatoNumero(2)
Else
HdnSMUBon.Value = "0"
LtlSMUBon.Text = "0"
End If
ObjAcum2.Dispose()
UpModalRemisionesNC.Update()
End If
GvRemisionesNCBon.DataSource = TmpDTRNCBonificacionesSeleccionadas
GvRemisionesNCBon.DataBind()
Dim SMUBon As Decimal = Me.TmpDTRNCBonificacionesSeleccionadas.SUM("ImporteBonificacion").ToDecimal() + Me.TmpDTRNCBonificacionesSeleccionadas.SUM("IVABonificacion").ToDecimal()
LtlSMUBon.Text = String.Format("{0:N2}", SMUBon)
HdnSMUBon.Value = SMUBon.ToString()
UpModalRemisionesNC.Update()
End Sub
'Protected Sub ChkAplicarRNC_CheckedChanged(sender As Object, e As EventArgs)
@@ -25623,6 +25712,22 @@ Partial Class Ventas
End If
End If
End Sub
Protected Sub GvRemisionesNCBonDetalle_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvRemisionesNCBonDetalle.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("CveVentaDetalleRNC").ToEntero() = 0 Then
e.Row.CssClass = "Totales"
e.Row.FCCheckBox("ChkAplicar").Visible = False
e.Row.FCTextBox("TxtCantidadRNC").Visible = False
Else
e.Row.CssClass = "ImportesRNCDetalle"
e.Row.FCCheckBox("ChkAplicar").Attributes.Add("onclick", $"CalculaSaldoRNCChkDetalleBon({e.Row.FCTextBox("TxtCantidadRNC").ClientID},{e.Row.DBCampo("CantidadPendiente").ToDouble},{e.Row.DBCampo("Total").ToDouble}, this);")
'e.Row.FCTextBox("TxtImporte").Attributes.Add("onkeyup", $"LimitaSaldoRNCChk({e.Row.FCTextBox("TxtImporte").ClientID},{e.Row.DBCampo("Saldo").ToDouble});")
End If
End If
End Sub
Protected Sub GvRNCDevoluciones_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvRNCDevoluciones.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.FCCheckBox("ChkAplicar").Attributes.Add("onclick", $"CalculaSaldoRNCBonChkDesc({e.Row.FCTextBox("TxtImporte").ClientID},{e.Row.DBCampo("Saldo").ToDouble}, this);")
@@ -30037,7 +30142,8 @@ Partial Class Ventas
NCConcepto = ArrayNC(1).ToEntero()
End Select
If ChkMostarProductosRNC.Checked Then
'CARGOS/AJUSTES POR GARANTIA POR PRODUCTO
If RblRNCTipo.SelectedValue.Contiene("1", "3") AndAlso ChkMostarProductosRNC.Checked Then
Dim TotalAcumulado As Decimal = 0
Me.AplicaRNCXDetalle = True
@@ -30105,8 +30211,8 @@ Partial Class Ventas
Exit For
End If
Next
Else
'CARGOS/AJUSTES POR GARANTIA POR TOTAL
ElseIf RblRNCTipo.SelectedValue.Contiene("1", "3") AndAlso Not ChkMostarProductosRNC.Checked Then
For Each GvRow As GridViewRow In GvRemisionesNC.Rows
If GvRow.RowType = DataControlRowType.DataRow Then
@@ -30156,7 +30262,77 @@ Partial Class Ventas
Else
DdlNCPS.Enabled = True
End If
'BONIFICACIONES POR PRODUCTO
ElseIf RblRNCTipo.SelectedValue.Contiene("2") AndAlso ChkMostarProductosRNCBon.Checked Then
Dim TotalAcumulado As Decimal = 0
Me.AplicaRNCXDetalle = True
For Each GvRow As GridViewRow In GvRemisionesNCBonDetalle.Rows
If GvRow.RowType = DataControlRowType.DataRow Then
If GvRow.FCCheckBox("ChkAplicar").Checked Then
Dim Rows = TmpDTRNCDetalle.Select($"CveVentaDetalleRNC = {GvRow.DataKey("CveVentaDetalleRNC").ToEntero()}")
For Each row In Rows
row("Cantidad") = GvRow.FCTextBox("TxtCantidadRNC").Text.ToDecimal()
TmpDTRNCDetalleSelecciondas.Rows.Add(row.ItemArray)
Next
End If
End If
Next
Dim TerminarCiclo As Boolean = False
For Each Dr As DataRow In TmpDTRNCDetalleSelecciondas.FiltraParametros("", DistinctColumns:={"CveVenta"}).Rows
Dim RemNC As New Modelos.Factura(UsuarioActual, Dr("CveVenta").ToString().ToEntero(), UsuarioActual.CveEmpresa)
Dim TotalRNC As Decimal = 0
For Each GvRow As GridViewRow In GvRemisionesNCBonDetalle.Rows
If GvRow.RowType = DataControlRowType.DataRow Then
If GvRow.FCCheckBox("ChkAplicar").Checked AndAlso GvRow.DataKey("CveVenta").ToEntero() = Dr("CveVenta").ToString().ToEntero() Then
Dim Cantidad As Decimal = GvRow.FCTextBox("TxtCantidadRNC").Text.ToDecimal()
Dim PU = GvRow.DataKey("PU").ToDecimal()
Dim PorcentajeIVA As Decimal = GvRow.DataKey("PorcentajeIVA").ToDecimal()
Dim TotalCalculableImpuestos As Decimal = (Cantidad * PU)
Dim ImporteIVA As Decimal = (TotalCalculableImpuestos * PorcentajeIVA).RoundSQL(2)
Dim TotalRNCDetalle As Decimal = (TotalCalculableImpuestos + ImporteIVA)
TotalRNC += TotalRNCDetalle
End If
End If
Next
TotalAcumulado += TotalRNC
'SI SE EXECE RESTA AL ULTIMO
If TotalAcumulado > LtlSMUBon.Text.ToDecimal() Then
TerminarCiclo = True
TotalAcumulado -= TotalRNC
TotalRNC = LtlSMUBon.Text.ToDecimal() - TotalAcumulado
End If
RemNC.TotalRemNCAplicado = TotalRNC
'MARCA LA VENTA QUE FUE USADA PARA EL FILTRO
RemNC.Num3 = DdlVentaUsado.SelectedValue.ToEntero()
TotalRemNCAplicado += RemNC.TotalRemNCAplicado
If RemNC.TotalRemNCAplicado <= 0 Then
Alert($"Debe asignar un importe en la siguiente remisión: <b>{RemNC.SerieFolio}</b>", TipoMensaje.MsgAdvertencia)
ListaRemisionesNC.Clear()
Exit Sub
End If
ListaRemisionesNC.Add(RemNC)
If TerminarCiclo Then
Exit For
End If
Next
'BONIFICACIONES POR TOTAL
ElseIf RblRNCTipo.SelectedValue.Contiene("2") AndAlso Not ChkMostarProductosRNCBon.Checked Then
For Each GvRow As GridViewRow In GvRemisionesNCBon.Rows
If GvRow.RowType = DataControlRowType.DataRow Then
If GvRow.FCCheckBox("ChkAplicar").Checked Then
@@ -30167,21 +30343,20 @@ Partial Class Ventas
If RemNC.TotalRemNCAplicado <= 0 Then
Alert($"Debe asignar un importe en la siguiente remisión: <b>{RemNC.SerieFolio}</b>", TipoMensaje.MsgAdvertencia)
ListaNCBonificacion.Clear()
ListaRemisionesNC.Clear()
Exit Sub
End If
ListaNCBonificacion.Add(RemNC)
ListaRemisionesNC.Add(RemNC)
End If
End If
Next
'SI SON SOLO BONIFICACIONES GENERA LA NC PRINCIPAL EN BASE A ESAS
If RblRNCTipo.SelectedValue.ToString() = "2" AndAlso ListaRemisionesNC.Count = 0 Then
ListaRemisionesNC.AddRange(ListaNCBonificacion)
ListaNCBonificacion.Clear()
End If
'If RblRNCTipo.SelectedValue.ToString() = "2" AndAlso ListaRemisionesNC.Count = 0 Then
' ListaRemisionesNC.AddRange(ListaNCBonificacion)
' ListaNCBonificacion.Clear()
'End If
End If
Dim DrPSSeleccionado As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=NCConcepto).FiltroPrimero("")