This commit is contained in:
Desarrollo2019
2019-08-15 17:04:39 -07:00
16 changed files with 11413 additions and 11194 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1181,13 +1181,14 @@ Namespace Modelos
'Se agregan los PS 'Se agregan los PS
For Each Row As DataRow In TmpDTDetalle.Rows For Each Row As DataRow In TmpDTDetalle.Rows
If Not ObjVentas.AddVentaDetalle(ObjVentas.CveVenta, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("CveUM").ToString.ToEntero, If Not ObjVentas.AddVentaDetalle(ObjVentas.CveVenta, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("CveUM").ToString.ToEntero,
Row("PU").ToString.ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)), Row("IVA").ToString.ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)), Math.Round((Row("Total").ToString.ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)) * (1 + Row("IVA").ToString.ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)))), 6), Row("PU").ToString.ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)), Row("ImporteIVA").ToString.ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)), Math.Round((Row("Total").ToString.ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)) * (1 + Row("PorcentajeIVA").ToString.ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)))), 6),
Row("Obs").ToString, Row("Descuento").ToString.ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)), Row("TipoDescuento").ToString.ToEntero, Row("CveSubProyecto").ToString.ToEntero, Row("CvePresupuestoIngreso").ToString.ToEntero, Row("Obs").ToString, Row("Descuento").ToString.ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)), Row("TipoDescuento").ToString.ToEntero, Row("CveSubProyecto").ToString.ToEntero, Row("CvePresupuestoIngreso").ToString.ToEntero,
TiempoEntrega:=Row("TiempoEntrega").ToString, CveVentaDetallePadre:=Row("CveVentaDetalle").ToString.ToEntero, CveContratoDetalle:=Row("CveContratoDetalle").ToString.ToEntero, TiempoEntrega:=Row("TiempoEntrega").ToString, CveVentaDetallePadre:=Row("CveVentaDetalle").ToString.ToEntero, CveContratoDetalle:=Row("CveContratoDetalle").ToString.ToEntero,
CvePromocionDetalle:=If(DtPromociones IsNot Nothing, DtPromociones.FiltroPrimeroValor("CvePromocionDetalle", $"CvePS={Row("CvePS").ToString}").ToEntero, -1), CvePromocionDetalle:=If(DtPromociones IsNot Nothing, DtPromociones.FiltroPrimeroValor("CvePromocionDetalle", $"CvePS={Row("CvePS").ToString}").ToEntero, -1),
IEPS:=Row("ImporteIEPS").ToString.ToDouble, CveMovimientoDetallePedido:=Row("CveMovimientoDetallePedido").ToString.ToEntero, IEPS:=Row("ImporteIEPS").ToString.ToDouble, CveMovimientoDetallePedido:=Row("CveMovimientoDetallePedido").ToString.ToEntero,
ImporteRetIVA:=Row("ImporteRetIVA").ToString.ToDouble, ImporteRetISR:=Row("ImporteRetISR").ToString.ToDouble, ImporteRetIVA:=Row("ImporteRetIVA").ToString.ToDouble, ImporteRetISR:=Row("ImporteRetISR").ToString.ToDouble,
PorcentajeIEPS:=Row("PorcentajeIEPS").ToString.ToDouble, PorcentajeRetIVA:=Row("PorcentajeRetIVA").ToString.ToDouble, PorcentajeRetISR:=Row("PorcentajeRetISR").ToString.ToDouble, CuentaPredial:=Row("CuentaPredial").ToString) Then PorcentajeIEPS:=Row("PorcentajeIEPS").ToString.ToDouble, PorcentajeRetIVA:=Row("PorcentajeRetIVA").ToString.ToDouble, PorcentajeRetISR:=Row("PorcentajeRetISR").ToString.ToDouble, CuentaPredial:=Row("CuentaPredial").ToString,
PorcentajeIVA:=Row("PorcentajeIVA").ToString.ToDecimal) Then
ErrorList.Add("Ocurrió un error al agregar un Producto o Servicio a la factura.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico") ErrorList.Add("Ocurrió un error al agregar un Producto o Servicio a la factura.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
Exit For Exit For
Else Else

View File

@@ -11,7 +11,7 @@
</asp:Content> </asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server"> <asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
<asp:Literal ID="LtlTitulo" runat="server" Text="Pagos"></asp:Literal>&nbsp;<asp:Literal ID="LtlIE" runat="server"></asp:Literal> <asp:Literal ID="LtlTitulo" runat="server" Text="Pagos"></asp:Literal>&nbsp;<asp:Literal ID="LtlIE" runat="server"></asp:Literal>
</asp:Content> </asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server"> <asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content> </asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server"> <asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">

View File

@@ -307,6 +307,8 @@ Partial Class Bancos_PopIECompras
Public Class IEMovimiento Public Class IEMovimiento
Public Property SubTotal As Decimal Public Property SubTotal As Decimal
Public Property IVA As Decimal Public Property IVA As Decimal
Public Property IVADeducible As Decimal
Public Property IVANoDeducible As Decimal
Public Property RetIVA As Decimal Public Property RetIVA As Decimal
Public Property RetISR As Decimal Public Property RetISR As Decimal
Public Property Total As Decimal Public Property Total As Decimal
@@ -615,6 +617,8 @@ Partial Class Bancos_PopIECompras
MovimientoPagar = New IEMovimiento MovimientoPagar = New IEMovimiento
MovimientoPagar.SubTotal = dr("SubTotal").ToString.ToDecimal MovimientoPagar.SubTotal = dr("SubTotal").ToString.ToDecimal
MovimientoPagar.IVA = dr("IVA").ToString.ToDecimal MovimientoPagar.IVA = dr("IVA").ToString.ToDecimal
MovimientoPagar.IVADeducible = dr("IVADeducible").ToString.ToDecimal
MovimientoPagar.IVANoDeducible = dr("IVANoDeducible").ToString.ToDecimal
MovimientoPagar.RetIVA = dr("RetIVA").ToString.ToDecimal MovimientoPagar.RetIVA = dr("RetIVA").ToString.ToDecimal
MovimientoPagar.RetISR = dr("RetISR").ToString.ToDecimal MovimientoPagar.RetISR = dr("RetISR").ToString.ToDecimal
MovimientoPagar.Total = dr("Total").ToString.ToDecimal MovimientoPagar.Total = dr("Total").ToString.ToDecimal
@@ -2250,16 +2254,16 @@ Partial Class Bancos_PopIECompras
If TotalImporte = CompraSaldo Then If TotalImporte = CompraSaldo Then
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.IVA ImporteMovimiento = MovimientoPagar.IVADeducible
ImporteMX = ImporteMovimiento ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.IVA) ImporteMovimiento = (MovimientoPagar.IVADeducible)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = (MovimientoPagar.IVA) ImporteMovimiento = (MovimientoPagar.IVADeducible)
ImporteMX = ImporteMovimiento * tipoCambioCompra ImporteMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.IVA) ImporteMovimiento = (MovimientoPagar.IVADeducible)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
End If End If
ImporteMovimiento = Math.Round(ImporteMovimiento, 2) ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
@@ -2273,16 +2277,92 @@ Partial Class Bancos_PopIECompras
End If End If
Else Else
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.IVA * PorcentajePago ImporteMovimiento = MovimientoPagar.IVADeducible * PorcentajePago
ImporteMX = ImporteMovimiento ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.IVA * PorcentajePago) ImporteMovimiento = (MovimientoPagar.IVADeducible * PorcentajePago)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = (MovimientoPagar.IVA * PorcentajePago) ImporteMovimiento = (MovimientoPagar.IVADeducible * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra ImporteMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.IVA * PorcentajePago) ImporteMovimiento = (MovimientoPagar.IVADeducible * PorcentajePago)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
End If
ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
ImporteMX = Math.Round(ImporteMX, 2)
TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
End If
PorcentajeImpuesto = MovimientoPagar.PorcentajeIVA
Dim IdCtaIVAXAcreditar As Integer = 0
Dim IdCtaIVAAcreditable As Integer = 0
If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows.Count > 0 Then
IdCtaIVAXAcreditar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero
IdCtaIVAAcreditable = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero
End If
IdCtaContable = If(IdCtaIVAAcreditable > 0, IdCtaIVAAcreditable, 0)
If ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaIVAAcreditable").ToString.ToEntero
CveCuenta = ObjMov.DtResultados.Rows(0)("IdCuentaIVAAcreditableSIG").ToString.ToEntero
End If
End If
Case 280 'Iva Acreditable No Deducible
If UsuarioActual.Empresa.Funcionalidad(521) = "1" Then
'funcionalidad que toma el 100% del pago para acreditamiento de iva
Dim TotalImporte As Decimal
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
TotalImporte = ImportePagado.ToString.ToDecimal
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
TotalImporte = Math.Round(ImportePagado.ToString.ToDecimal / tipoCambioPago, 2)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
TotalImporte = Math.Round(ImportePagado.ToString.ToDecimal * tipoCambioPago, 2)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
TotalImporte = ImportePagado.ToString.ToDecimal
End If
If TotalImporte = CompraSaldo Then
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.IVANoDeducible
ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.IVANoDeducible)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = (MovimientoPagar.IVANoDeducible)
ImporteMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.IVANoDeducible)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
End If
ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
ImporteMX = Math.Round(ImporteMX, 2)
TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
Else
ImporteMovimiento = 0
ImporteMX = 0
End If
Else
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.IVANoDeducible * PorcentajePago
ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.IVANoDeducible * PorcentajePago)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = (MovimientoPagar.IVANoDeducible * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.IVANoDeducible * PorcentajePago)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
End If End If
ImporteMovimiento = Math.Round(ImporteMovimiento, 2) ImporteMovimiento = Math.Round(ImporteMovimiento, 2)

View File

@@ -2062,7 +2062,7 @@ Partial Class Bancos_PopIEVentas
IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria
CveCuenta = UsuarioActual.Empresa.CveCuentaGananciaCambiaria CveCuenta = UsuarioActual.Empresa.CveCuentaGananciaCambiaria
tipoCambioVentaDiferenciaCambiaria = If(FechaVenta < FechaUltimaFluctuacion, TipoCambioFluctuacion, TipoCambioOriginal) tipoCambioVentaDiferenciaCambiaria = If(FechaVenta < FechaUltimaFluctuacion, TipoCambioFluctuacion, TipoCambioOriginal)
Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta) Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVentaDiferenciaCambiaria)
TimpocambioGeneral = TCImpuestos TimpocambioGeneral = TCImpuestos
Dim Diferencia As Decimal = ((MovimientoPagar.Total * PorcentajePago) * tipoCambioVentaValuacion) - ((MovimientoPagar.Total * PorcentajePago) * tipoCambioPago) 'Añadimos la diferencia de perdida en la venta Dim Diferencia As Decimal = ((MovimientoPagar.Total * PorcentajePago) * tipoCambioVentaValuacion) - ((MovimientoPagar.Total * PorcentajePago) * tipoCambioPago) 'Añadimos la diferencia de perdida en la venta
@@ -2090,7 +2090,7 @@ Partial Class Bancos_PopIEVentas
IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria
CveCuenta = UsuarioActual.Empresa.CveCuentaPerdidaCambiaria CveCuenta = UsuarioActual.Empresa.CveCuentaPerdidaCambiaria
tipoCambioVentaDiferenciaCambiaria = If(FechaVenta < FechaUltimaFluctuacion, TipoCambioFluctuacion, TipoCambioOriginal) tipoCambioVentaDiferenciaCambiaria = If(FechaVenta < FechaUltimaFluctuacion, TipoCambioFluctuacion, TipoCambioOriginal)
Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta) Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVentaDiferenciaCambiaria)
TimpocambioGeneral = TCImpuestos TimpocambioGeneral = TCImpuestos

View File

@@ -358,7 +358,7 @@
<asp:UpdatePanel ID="UPCompras" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UPCompras" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<asp:GridView ID="GvCxP" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Cuentas X Pagar Pendientes" <asp:GridView ID="GvCxP" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Cuentas X Pagar Pendientes"
DataKeyNames="CveCompra,ImporteProgramo,Saldo,SubTotal,IVA,IEPS,RetIVA,RetISR,Original,UUID,RFC,CveFactura,SerieFolio,Descripcion,CvePrePoliza,Fecha,EstatusInventario,CveProveedor,TipoCambio, CveMoneda,CveRetIVAConcepto,IVAPorPagar,IEPSPorPagar,CveRetISRConcepto,PorcentajeIVA" DataKeyNames="CveCompra,ImporteProgramo,Saldo,SubTotal,IVA,IVADeducible,IVANoDeducible,IEPS,RetIVA,RetISR,Original,UUID,RFC,CveFactura,SerieFolio,Descripcion,CvePrePoliza,Fecha,EstatusInventario,CveProveedor,TipoCambio, CveMoneda,CveRetIVAConcepto,IVAPorPagar,IVAPorPagarDeducible,IVAPorPagarNoDeducible,IEPSPorPagar,CveRetISRConcepto,PorcentajeIVA"
Width="100%" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" Style="text-align: center;" GridLines="None"> Width="100%" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" Style="text-align: center;" GridLines="None">
<Columns> <Columns>
<asp:TemplateField> <asp:TemplateField>

View File

@@ -310,7 +310,7 @@ Partial Class Bancos_ProveedoresAbonar
ViewState("CveCuentaRetISR") = 0 ViewState("CveCuentaRetISR") = 0
End If End If
If UsuarioActual.CveEmpresa.Contiene(1, 4, 5, 7, 11, 12, 72, 80, 126, 119, 122,145) Then If UsuarioActual.CveEmpresa.Contiene(1, 4, 5, 7, 11, 12, 72, 80, 126, 119, 122) Then
rowComisiones.Visible = True rowComisiones.Visible = True
End If End If
@@ -1506,16 +1506,16 @@ Partial Class Bancos_ProveedoresAbonar
'funcionalidad que toma el 100% del pago para acreditamiento de iva 'funcionalidad que toma el 100% del pago para acreditamiento de iva
If TotalImporte = gvr.DataKey("Saldo").ToDecimal Then If TotalImporte = gvr.DataKey("Saldo").ToDecimal Then
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = gvr.DataKey("IVA").ToDecimal ImporteMovimiento = gvr.DataKey("IVADeducible").ToDecimal
importeMX = ImporteMovimiento importeMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
ImporteMovimiento = gvr.DataKey("IVA").ToDecimal ImporteMovimiento = gvr.DataKey("IVADeducible").ToDecimal
importeMX = gvr.DataKey("IVA").ToDecimal * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) importeMX = gvr.DataKey("IVADeducible").ToDecimal * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = gvr.DataKey("IVA").ToDecimal ImporteMovimiento = gvr.DataKey("IVADeducible").ToDecimal
importeMX = ImporteMovimiento * tipoCambioCompra importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
ImporteMovimiento = gvr.DataKey("IVA").ToDecimal ImporteMovimiento = gvr.DataKey("IVADeducible").ToDecimal
importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
End If End If
ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero) ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero)
@@ -1528,16 +1528,79 @@ Partial Class Bancos_ProveedoresAbonar
End If End If
Else Else
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal AndAlso Math.Abs(Math.Round(gvr.DataKey("IVAPorPagar").ToDecimal - (gvr.DataKey("IVA").ToDecimal * PorcentajePago), 2)) <= 0.02, gvr.DataKey("IVAPorPagar").ToDecimal, gvr.DataKey("IVA").ToDecimal * PorcentajePago) ImporteMovimiento = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal AndAlso Math.Abs(Math.Round(gvr.DataKey("IVAPorPagarDeducible").ToDecimal - (gvr.DataKey("IVADeducible").ToDecimal * PorcentajePago), 2)) <= 0.02, gvr.DataKey("IVAPorPagarDeducible").ToDecimal, gvr.DataKey("IVADeducible").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento importeMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
ImporteMovimiento = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal AndAlso Math.Abs(Math.Round(gvr.DataKey("IVAPorPagar").ToDecimal - (gvr.DataKey("IVA").ToDecimal * PorcentajePago), 2)) <= 0.02, gvr.DataKey("IVAPorPagar").ToDecimal, gvr.DataKey("IVA").ToDecimal * PorcentajePago) ImporteMovimiento = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal AndAlso Math.Abs(Math.Round(gvr.DataKey("IVAPorPagarDeducible").ToDecimal - (gvr.DataKey("IVADeducible").ToDecimal * PorcentajePago), 2)) <= 0.02, gvr.DataKey("IVAPorPagarDeducible").ToDecimal, gvr.DataKey("IVADeducible").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal AndAlso Math.Abs(Math.Round(gvr.DataKey("IVAPorPagar").ToDecimal - (gvr.DataKey("IVA").ToDecimal * PorcentajePago), 2)) <= 0.02, gvr.DataKey("IVAPorPagar").ToDecimal, gvr.DataKey("IVA").ToDecimal * PorcentajePago) ImporteMovimiento = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal AndAlso Math.Abs(Math.Round(gvr.DataKey("IVAPorPagarDeducible").ToDecimal - (gvr.DataKey("IVADeducible").ToDecimal * PorcentajePago), 2)) <= 0.02, gvr.DataKey("IVAPorPagarDeducible").ToDecimal, gvr.DataKey("IVADeducible").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * tipoCambioCompra importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
ImporteMovimiento = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal AndAlso Math.Abs(Math.Round(gvr.DataKey("IVAPorPagar").ToDecimal - (gvr.DataKey("IVA").ToDecimal * PorcentajePago), 2)) <= 0.02, gvr.DataKey("IVAPorPagar").ToDecimal, gvr.DataKey("IVA").ToDecimal * PorcentajePago) ImporteMovimiento = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal AndAlso Math.Abs(Math.Round(gvr.DataKey("IVAPorPagarDeducible").ToDecimal - (gvr.DataKey("IVADeducible").ToDecimal * PorcentajePago), 2)) <= 0.02, gvr.DataKey("IVAPorPagarDeducible").ToDecimal, gvr.DataKey("IVADeducible").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
End If
ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero)
importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero)
If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
End If
TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
PorcentajeImpuesto = gvr.DataKey("PorcentajeIVA").ToDecimal
Dim IdCtaIVAXAcreditar As Integer = 0
Dim IdCtaIVAAcreditable As Integer = 0
If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows.Count > 0 Then
IdCtaIVAXAcreditar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero
IdCtaIVAAcreditable = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero
End If
IdCtaContable = If(IdCtaIVAAcreditable > 0, IdCtaIVAAcreditable, 0)
If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaIVAAcreditable").ToString.ToEntero
CveCuenta = ObjMov.DtResultados.Rows(0)("IdCuentaIVAAcreditableSIG").ToString.ToEntero
End If
End If
Case 280 'Iva Acreditado No Deducible
Dim TotalImporte As Decimal = gvr.FCTextBox("TxtAbonar").Text.ToDecimal
If UsuarioActual.Empresa.Funcionalidad(521) = "1" Then
'funcionalidad que toma el 100% del pago para acreditamiento de iva
If TotalImporte = gvr.DataKey("Saldo").ToDecimal Then
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = gvr.DataKey("IVANoDeducible").ToDecimal
importeMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
ImporteMovimiento = gvr.DataKey("IVANoDeducible").ToDecimal
importeMX = gvr.DataKey("IVANoDeducible").ToDecimal * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = gvr.DataKey("IVANoDeducible").ToDecimal
importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
ImporteMovimiento = gvr.DataKey("IVANoDeducible").ToDecimal
importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
End If
ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero)
importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero)
If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
Else
ImporteMovimiento = 0
importeMX = 0
End If
Else
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal AndAlso Math.Abs(Math.Round(gvr.DataKey("IVAPorPagarNoDeducible").ToDecimal - (gvr.DataKey("IVANoDeducible").ToDecimal * PorcentajePago), 2)) <= 0.02, gvr.DataKey("IVAPorPagarNoDeducible").ToDecimal, gvr.DataKey("IVANoDeducible").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
ImporteMovimiento = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal AndAlso Math.Abs(Math.Round(gvr.DataKey("IVAPorPagarNoDeducible").ToDecimal - (gvr.DataKey("IVANoDeducible").ToDecimal * PorcentajePago), 2)) <= 0.02, gvr.DataKey("IVAPorPagarNoDeducible").ToDecimal, gvr.DataKey("IVANoDeducible").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal AndAlso Math.Abs(Math.Round(gvr.DataKey("IVAPorPagarNoDeducible").ToDecimal - (gvr.DataKey("IVANoDeducible").ToDecimal * PorcentajePago), 2)) <= 0.02, gvr.DataKey("IVAPorPagarNoDeducible").ToDecimal, gvr.DataKey("IVANoDeducible").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
ImporteMovimiento = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal AndAlso Math.Abs(Math.Round(gvr.DataKey("IVAPorPagarNoDeducible").ToDecimal - (gvr.DataKey("IVANoDeducible").ToDecimal * PorcentajePago), 2)) <= 0.02, gvr.DataKey("IVAPorPagarNoDeducible").ToDecimal, gvr.DataKey("IVANoDeducible").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
End If End If
ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero) ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero)

View File

@@ -3,116 +3,175 @@
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server"> <asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content> </asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server"> <asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
.Widthall {
width: 100% !important;
}
.dataTables_scrollHeadInner {
width: 100% !important;
background-color: #dddddd;
padding-left: 0px !important;
}
.dataTables_scrollFoot {
display: none;
position: static;
}
.table-scrollable {
margin: 0px !important;
}
.dataTables_scroll {
margin-bottom: 0px;
}
.table.dataTable {
margin-top: 0px !important;
}
.dataTables_scrollBody table th {
padding: 0px !important;
padding-right: 4px !important;
padding-left: 4px !important;
}
.sinlink td a {
pointer-events: none;
cursor: default;
color: black;
font-size: small;
}
.white a {
color: white !important;
}
</style>
</asp:Content> </asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server"> <asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Catálogo de Tipos de Ordenes de Servicio Catálogo de Tipos de Ordenes de Servicio
</asp:Content> </asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server"> <asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content> <asp:UpdatePanel runat="server" ID="UpAgregar">
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<table class="table table-striped table-advance table-hover"> <li>
<thead> <asp:LinkButton runat="server" ID="BtnAgregarTiposOS" data-toggle="tooltip" data-placement="left" Text="<i class='fa fa-plus'></i> Agregar Tipo de OS"></asp:LinkButton>
<tr class="Titulos"> </li>
<th width="250px">
<asp:LinkButton ID="LbTipoOrdenServicio" runat="server" CausesValidation="false" Text="" CommandArgument="TipoOrdenServicio" OnClick="LbOrden_Click">
Tipo de Orden de Servicio
<asp:Literal ID="ImgTipoOrdenServicio" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbEstatus" runat="server" CausesValidation="false" Text="" CommandArgument="Estatus" OnClick="LbOrden_Click">
Estatus
<asp:Literal ID="ImgEstatus" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbFechaIng" runat="server" CausesValidation="false" Text="" CommandArgument="FechaIng" OnClick="LbOrden_Click">
Fecha Ing.
<asp:Literal ID="ImgFechaIng" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbUsuario" runat="server" CausesValidation="false" Text="" CommandArgument="Usuario" OnClick="LbOrden_Click">
Usuario
<asp:Literal ID="ImgUsuario" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="161px">Comandos</th>
</tr>
</thead>
<tr>
<td style="text-align: center">
<asp:TextBox ID="TxtTipoOrdenServicio" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardar" Width="234px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVTipoOrdenServicio" runat="server" ControlToValidate="TxtTipoOrdenServicio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo de Orden de Servicio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCTipoOrdenServicio" runat="server" HighlightCssClass="vco" TargetControlID="RFVTipoOrdenServicio" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td style="text-align: center">
<asp:LinkButton ID="LbAgregar" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardar"></asp:LinkButton></td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveOrdenServicioTipo" EmptyDataText="No se encontraron Tipos de Orden Servicios Registrados" ToolTip="Listado de Tipos de Ordenes de Servicios" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px;" GridLines="None">
<Columns>
<asp:TemplateField>
<ItemTemplate>
&nbsp;<asp:Literal ID="LtlTipoOrdenServicio" runat="server" Text='<%# Eval("OrdenServicioTipo", "{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtTipoOrdenServicio" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("OrdenServicioTipo") %>' ValidationGroup="GrpGV" Width="234px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVTipoOrdenServicio" runat="server" ControlToValidate="TxtTipoOrdenServicio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo de Orden de Servicio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCTipoOrdenServicio" runat="server" HighlightCssClass="vco" TargetControlID="RFVTipoOrdenServicio" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox ID="ChkEstatus" runat="server" Checked='<%# If (Eval("Estatus").ToString = "Activo", True, False) %>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlFechaIng" runat="server" Text='<%# Eval("FechaIng", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar">
<EditItemTemplate>
<center>
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpGV" />
&nbsp;<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
</center>
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar">
<ItemTemplate>
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" 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>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
</asp:Content> </asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server"> <asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content> </asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UpGral" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="Widthall" style="text-align: right!important; margin-top: 20px!important; margin-bottom: 2px!important">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvTiposOS.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvTiposOS.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
<div class="row" style="margin:5px">
<asp:UpdatePanel ID="UPGvTiposOS" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvTiposOS" runat="server" AutoGenerateColumns="False"
DataKeyNames="CveOrdenServicioTipo, OrdenServicioTipo, Estatus"
EmptyDataText="No se encontraron registros"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD"
data-sort="true"
data-freezerows="1"
GridLines="None">
<Columns>
<asp:TemplateField HeaderText="Tipo de Orden de Servicio">
<ItemTemplate>
&nbsp;<asp:Literal ID="LblTiposOS" runat="server" Text='<%# Eval("OrdenServicioTipo") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Estatus" ItemStyle-Width="150px">
<ItemTemplate>
&nbsp;<asp:Literal ID="LblPuntos" runat="server" Text='<%# Eval("Estatus")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Fecha Ing." ItemStyle-HorizontalAlign="Center" ItemStyle-Width="150px">
<ItemTemplate>
&nbsp;<asp:Literal ID="lblFecha" runat="server" Text='<%# Eval("FechaIng", "{0:d}")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="300px" HeaderText="Usuario">
<ItemTemplate>
<asp:Literal ID="lblUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Right" ItemStyle-Width="80px">
<ItemTemplate>
<asp:LinkButton ID="ImgE" OnClick="Edit_ClickTiposOS" runat="server" AlternateText="Editar" CausesValidation="False"
CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Left" ItemStyle-Width="40px">
<ItemTemplate>
<asp:LinkButton ID="imgD" OnClick="Remove_ClickTiposOS" runat="server" AlternateText="Eliminar" 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>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<br />
<br />
<div id="DivAgregarTiposOS" class="modal ADS fade" role="dialog">
<div class="modal-dialog" style="width: 450px;">
<asp:UpdatePanel runat="server" class="modal-content" ID="UpModalTiposOS" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">
<asp:Literal ID="LtlTituloModalTiposOS" runat="server">Agregar Tipo Defecto</asp:Literal></h4>
</div>
<div class="modal-body">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtTiposOS" CssClass="form-control " runat="server" MaxLength="70" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvTxtTiposOS" runat="server" ControlToValidate="TxtTiposOS" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpTiposOS"></asp:RequiredFieldValidator>
<label for="<%= TxtTiposOS.ClientID.ToString()%>">Tipo:</label>
<i></i>
</div>
<div ID="DivEstatus" runat="server" class="form-group form-md-line-input input-iconright" Visible="false">
<label for="<%= ChkEstatus.ClientID.ToString()%>">Activo:</label>&nbsp;
<asp:CheckBox ID="ChkEstatus" runat="server" CssClass="make-switchsd" data-size="small" Text=" " Checked="true" />
<i></i>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="BtnAgregarTiposOSModal" runat="server" class="btn btn-success" Text="Agregar" ValidationGroup="GrpTiposOS" />
<button id="Button3" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content9" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -6,179 +6,165 @@ Imports System.Linq
Imports Extensiones Imports Extensiones
Partial Class OS_CatTiposOrdenesServicios Partial Class OS_CatTiposOrdenesServicios
Inherits ClsPaginas Inherits ClsPaginas
Public Property PuedeEditar As Boolean Private Property CveOrdenServicioTipo As Integer
Get Get
Return CBool(ViewState("PuedeEditar")) If Not ViewState("CveOrdenServicioTipo") Is Nothing Then
End Get Return ViewState("CveOrdenServicioTipo").ToString.ToEntero
Set(value As Boolean) Else
ViewState("PuedeEditar") = value Return -1
End Set End If
End Property
Public Property PuedeEliminar As Boolean End Get
Get Set(value As Integer)
Return CBool(ViewState("PuedeEditar")) ViewState("CveOrdenServicioTipo") = value
End Get End Set
Set(value As Boolean)
ViewState("PuedeEditar") = value
End Set
End Property
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load End Property
If Not Page.IsPostBack Then
ViewState("Orden") = ""
CargaDatos()
End If
End Sub
Public Sub CargaDatos() Private Property Actualizar As Boolean
Dim ObjSubTipoOrdenServicios As New ClsOS Get
If Not ViewState("Actualizar") Is Nothing Then
Return DirectCast(ViewState("Actualizar"), Boolean)
Else
Return False
End If
End Get
Set(value As Boolean)
ViewState("Actualizar") = value
End Set
End Property
Private Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
CargadatosGvTiposOS()
End If
End Sub
Private Sub CargadatosGvTiposOS()
Dim ObjSubTipoOrdenServicios As New ClsOS
If ObjSubTipoOrdenServicios.GetTipoOrdenesServicios(-1) Then If ObjSubTipoOrdenServicios.GetTipoOrdenesServicios(-1) Then
ViewState("DTTipoOrdenServicios") = ObjSubTipoOrdenServicios.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) GvTiposOS.DataSource = ObjSubTipoOrdenServicios.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTSubTipoOrdenServicios = ObjSubTipoOrdenServicios.DtResultados GlobalDTSubTipoOrdenServicios = ObjSubTipoOrdenServicios.DtResultados
Else Else
Me.GvDatos.DataSource = Nothing GvTiposOS.DataSource = Nothing
End If End If
ObjSubTipoOrdenServicios.Dispose() ObjSubTipoOrdenServicios.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then GvTiposOS.DataBind()
CargaGrid(ViewState("Orden").ToString()) UpGral.Update()
Else
CargaGrid("")
End If
End Sub
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click End Sub
Dim ObjTipoOrdenServicios As New ClsOS
If ObjTipoOrdenServicios.AddTipoOrdenServicio(TxtTipoOrdenServicio.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
TxtTipoOrdenServicio.Text = ""
Alert("El nuevo Tipo de Orden de Servicio se guardó correctamente.", TipoMensaje.MsgInformacion)
UpTitulos.Update()
ViewState("DTTipoOrdenServicios") = ObjTipoOrdenServicios.DtResultados '.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
'GlobalDTTipoOrdenServicios(-1) = ObjTipoOrdenServicios.DtResultados
If ViewState("Orden").ToString() <> String.Empty Then Protected Sub BtnAgregarTiposOS_Click(sender As Object, e As EventArgs) Handles BtnAgregarTiposOS.Click
CargaGrid(ViewState("Orden").ToString()) LtlTituloModalTiposOS.Text = "Agregar Tipo de Orden de Servicio"
Else BtnAgregarTiposOSModal.Text = "Agregar"
CargaGrid("") DivEstatus.Visible = False
End If
End If
ObjTipoOrdenServicios.Dispose()
End Sub
#Region "G V D A T O S" TxtTiposOS.Text = ""
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then Actualizar = False
If e.Row.RowIndex = 0 Then UpGral.Update()
e.Row.Cells(0).Width = Unit.Pixel(250) RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposOS"))
e.Row.Cells(1).Width = Unit.Pixel(100)
e.Row.Cells(2).Width = Unit.Pixel(100) End Sub
e.Row.Cells(3).Width = Unit.Pixel(100)
e.Row.Cells(4).Width = Unit.Pixel(100) Protected Sub BtnAgregarTiposOSModal_Click(sender As Object, e As EventArgs) Handles BtnAgregarTiposOSModal.Click
e.Row.Cells(5).Width = Unit.Pixel(61)
Dim ObjTipoOrdenServicios As New ClsOS
If Not Actualizar Then
If ObjTipoOrdenServicios.AddTipoOrdenServicio(TxtTiposOS.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
TxtTiposOS.Text = ""
ChkEstatus.Checked = True
CargadatosGvTiposOS()
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposOS"), "jsHideModalTiposOS")
'GeneraGlobalDT()
UpGral.Update()
Alert("Tipo de Orden de Servicio Agregado Correctamente", TipoMensaje.MsgInformacion)
Else
Alert("Ocurrio un error al guardar el Tipo de Orden de Servicio", TipoMensaje.MsgError)
End If End If
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Center
End If
End Sub
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
Dim ObjTipoOrdenServicios As New ClsOS
If ObjTipoOrdenServicios.RemoveTipoOrdenServicio(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
GvDatos.EditIndex = -1
ViewState("DTTipoOrdenServicios") = ObjTipoOrdenServicios.DtResultados '.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
'GlobalDTTipoOrdenServicios(-1) = ObjTipoOrdenServicios.DtResultados
Alert("El Tipo de Orden de Servicio se eliminó correctamente.", TipoMensaje.MsgInformacion)
End If
ObjTipoOrdenServicios.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else Else
CargaGrid("") If ObjTipoOrdenServicios.UpdateTipoOrdenServicio(TxtTiposOS.Text.Trim, False, ChkEstatus.Checked, CveOrdenServicioTipo) Then
End If
End Sub
Protected Sub GvDatos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatos.RowCancelingEdit TxtTiposOS.Text = ""
GvDatos.EditIndex = -1 ChkEstatus.Checked = True
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating CargadatosGvTiposOS()
Dim ObjTipoOrdenServicios As New ClsOS 'GeneraGlobalDT()
Dim TipoOrdenServicio As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtTipoOrdenServicio"), TextBox).Text.Trim UpModalTiposOS.Update()
Dim Estatus As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
Dim CveTipoOrdenServicio As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero
If ObjTipoOrdenServicios.UpdateTipoOrdenServicio(TipoOrdenServicio, False, Estatus, CveTipoOrdenServicio) Then RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposOS"), "jsHideModalTiposOS")
GvDatos.EditIndex = -1
ViewState("DTTipoOrdenServicios") = ObjTipoOrdenServicios.DtResultados '.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) UpGral.Update()
'GlobalDTTipoOrdenServicios(-1) = ObjTipoOrdenServicios.DtResultados Alert("Tipo de Orden de Servicio Actualizado Correctamente", TipoMensaje.MsgInformacion)
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) Else
Alert("Ocurrio un error al Actualizar el Tipo de Orden de Servicio", TipoMensaje.MsgError)
End If
End If End If
CveOrdenServicioTipo = -1
Actualizar = False
ObjTipoOrdenServicios.Dispose() ObjTipoOrdenServicios.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub End Sub
Protected Sub GvDatos_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatos.RowEditing Public Sub Remove_ClickTiposOS(sender As Object, e As EventArgs)
GvDatos.EditIndex = e.NewEditIndex
If ViewState("Orden").ToString() <> String.Empty Then Dim ObjTipoOrdenServicios As New ClsOS
CargaGrid(ViewState("Orden").ToString()) Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Dim activo As Boolean = False
CveOrdenServicioTipo = GvRow.DataKey("CveOrdenServicioTipo").ToEntero
If ObjTipoOrdenServicios.RemoveTipoOrdenServicio(CveOrdenServicioTipo) Then
CargadatosGvTiposOS()
'GeneraGlobalDT()
Alert("El Tipo de Orden de Servicio se eliminó Correctamente ", TipoMensaje.MsgInformacion)
Else Else
CargaGrid("") Alert("Ocurrio un error al Eliminar el Tipo de Orden de Servicio", TipoMensaje.MsgError)
End If End If
End Sub
#End Region
#Region "O R D E N A M I E N T O" ObjTipoOrdenServicios.Dispose()
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim Orden As String = ""
Dim Campo As String = ""
Dim Literal As Literal = Nothing
Const OrdenInicial As String = ""
Dim Arg(2) As String
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c) CargadatosGvTiposOS()
Campo = Arg(0)
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal) CveOrdenServicioTipo = -1
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
Literal.Text = String.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>")
Else
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo)
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
End If
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
ViewState("Orden") = Orden
CargaGrid(Orden)
End Sub End Sub
Private Sub CargaGrid(Orden As String) Public Sub Edit_ClickTiposOS(sender As Object, e As EventArgs)
If Orden <> String.Empty Then
Dim DV As New DataView(CType(ViewState("DTTipoOrdenServicios"), DataTable), "", Orden, DataViewRowState.CurrentRows) Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
GvDatos.DataSource = DV.ToTable() Dim activo As Boolean = False
DV.Dispose()
Else LtlTituloModalTiposOS.Text = "Editar Tipo de Orden de Servicio"
GvDatos.DataSource = CType(ViewState("DTTipoOrdenServicios"), DataTable) Actualizar = True
End If DivEstatus.Visible = True
GvDatos.DataBind()
UpDatos.Update() CveOrdenServicioTipo = GvRow.DataKey("CveOrdenServicioTipo").ToEntero
TxtTiposOS.Text = GvRow.DataKey("OrdenServicioTipo")
ChkEstatus.Checked = If(GvRow.DataKey("Estatus") = "Activo", True, False)
BtnAgregarTiposOSModal.Text = "Actualizar"
UpModalTiposOS.Update()
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposOS"))
End Sub End Sub
#End Region
End Class End Class

View File

@@ -86,7 +86,7 @@
<div class="col-md-4"> <div class="col-md-4">
<asp:Label ID="LblCliente" runat="server"></asp:Label> <asp:Label ID="LblCliente" runat="server"></asp:Label>
</div> </div>
<div class="col-md-2"> <div class="col-md-2">
<b>Fecha Recibido:</b> <b>Fecha Recibido:</b>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
@@ -106,7 +106,7 @@
</div> </div>
<div class="row"> <div class="row">
<div id="DivClienteSucursal" runat="server" visible="false"> <div id="DivClienteSucursal" runat="server" visible="false">
<div class="col-md-2"> <div class="col-md-2">
<b>Sucursal del Cliente:</b> <b>Sucursal del Cliente:</b>
@@ -152,6 +152,8 @@
<div class="col-md-3" style="margin-top: 5px;"> <div class="col-md-3" style="margin-top: 5px;">
<asp:DropDownList ID="DdlTipoOrdenOS" CssClass="form-control input-sm select2me" runat="server" DataTextField="OrdenServicioTipo" DataValueField="CveOrdenServicioTipo" Width="100%" Height="30px"> <asp:DropDownList ID="DdlTipoOrdenOS" CssClass="form-control input-sm select2me" runat="server" DataTextField="OrdenServicioTipo" DataValueField="CveOrdenServicioTipo" Width="100%" Height="30px">
</asp:DropDownList> </asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVTipoOS" runat="server" CssClass="help-block errorimput" ControlToValidate="DdlTipoOrdenOS" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo de Orden''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCETipoOS" runat="server" HighlightCssClass="vco" TargetControlID="RFVTipoOS" Width="100px"></ajax:ValidatorCalloutExtender>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -87,10 +87,10 @@
</asp:Content> </asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server"> <asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
<li> <li>
<asp:LinkButton ID="ImgImprimir" runat="server"> <i class="fa fa-ad-pdf"></i> Generar PDF</asp:LinkButton> <asp:LinkButton ID="ImgImprimir" runat="server"> <i class="fa fa-file-pdf-o" style="font-weight:bold;"></i> PDF</asp:LinkButton>
</li> </li>
<li> <li>
<asp:LinkButton ID="ImgExcel" runat="server"><i class="fa fa-ad-excel"></i> Generar Excel</asp:LinkButton> <asp:LinkButton ID="ImgExcel" runat="server"><i class="fa fa-file-excel-o" style="font-weight:bold;"></i> Excel</asp:LinkButton>
</li> </li>
</asp:Content> </asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server"> <asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
@@ -164,9 +164,8 @@
Cliente: Cliente:
</div> </div>
<div class="col-md-2 "> <div class="col-md-2 ">
<asp:DropDownList ID="DdlClientes" runat="server" AppendDataBoundItems="true" DataTextField="Nombre" DataValueField="CveCliente" CssClass="form-control input-small input-sm select2me" Width="100%"> <ADS:Dropdownlost CssClassDdl="select2me" ID="DdlClientes" Width="100%" data-metodo="getcliente" runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width: 100%;">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem> </ADS:Dropdownlost>
</asp:DropDownList>
</div> </div>
<div class="col-md-1 truncate"> <div class="col-md-1 truncate">
@@ -232,8 +231,8 @@
<div id="dvCa" style="width: 100%; top: 40px"> <div id="dvCa" style="width: 100%; top: 40px">
<table id="dTable" class="correcto table Widthall Titulos"> <table id="dTable" class="correcto table Widthall Titulos">
<tr> <tr>
<td id="dvInv" runat="server" class="dataTables_scrollHead" style="text-align: center!important; width: 30.5%; font-size: 14px;"><b>Venta</b></td> <td id="dvInv" runat="server" class="dataTables_scrollHead" style="text-align: center!important; width: 42%; font-size: 14px;"><b>Venta</b></td>
<td id="dvVen" runat="server" class="dataTables_scrollHead" style="text-align: center!important; font-size: 14px; border-right-color: white!important; border-left-color: white!important; width: 32.5%; border-style: solid;"><b>Costo</b></td> <td id="dvVen" runat="server" class="dataTables_scrollHead" style="text-align: center!important; font-size: 14px; border-right-color: white!important; border-left-color: white!important; width: 25%; border-style: solid;"><b>Costo</b></td>
<td id="dvUt" runat="server" class="dataTables_scrollHead" style="text-align: center!important; width: 40%; font-size: 14px;"><b>Utilidad/Pérdida</b></td> <td id="dvUt" runat="server" class="dataTables_scrollHead" style="text-align: center!important; width: 40%; font-size: 14px;"><b>Utilidad/Pérdida</b></td>
</tr> </tr>
</table> </table>
@@ -250,6 +249,9 @@
<asp:HyperLinkField ItemStyle-HorizontalAlign="Center" HeaderText="Serie Folio" DataTextField="SerieFolio" DataTextFormatString="{0}" DataNavigateUrlFields="CveVenta,CveVendedor,FechaI,FechaF,CveCliente,Orden,CveSubProyecto,CvePS,CveClasificacion" DataNavigateUrlFormatString="RepVentasUtilidadDetalle.aspx?CveVenta={0}&CveVendedor={1}&&FechaI={2:d}&FechaF={3:d}&CveCliente={4}&Orden={5}&CveSubProyecto={6}&CvePS={7}&CveClasificacion={8}"/> <asp:HyperLinkField ItemStyle-HorizontalAlign="Center" HeaderText="Serie Folio" DataTextField="SerieFolio" DataTextFormatString="{0}" DataNavigateUrlFields="CveVenta,CveVendedor,FechaI,FechaF,CveCliente,Orden,CveSubProyecto,CvePS,CveClasificacion" DataNavigateUrlFormatString="RepVentasUtilidadDetalle.aspx?CveVenta={0}&CveVendedor={1}&&FechaI={2:d}&FechaF={3:d}&CveCliente={4}&Orden={5}&CveSubProyecto={6}&CvePS={7}&CveClasificacion={8}"/>
<asp:HyperLinkField ItemStyle-HorizontalAlign="Center" HeaderText="Fecha" DataTextField="FechaVenta" DataTextFormatString="{0:d}" DataNavigateUrlFields="CveVenta,CveVendedor,FechaI,FechaF,CveCliente,Orden,CveSubProyecto,CvePS,CveClasificacion" DataNavigateUrlFormatString="RepVentasUtilidadDetalle.aspx?CveVenta={0}&CveVendedor={1}&FechaI={2:d}&FechaF={3:d}&CveCliente={4}&Orden={5}&CveSubProyecto={6}&CvePS={7}&CveClasificacion={8}"/> <asp:HyperLinkField ItemStyle-HorizontalAlign="Center" HeaderText="Fecha" DataTextField="FechaVenta" DataTextFormatString="{0:d}" DataNavigateUrlFields="CveVenta,CveVendedor,FechaI,FechaF,CveCliente,Orden,CveSubProyecto,CvePS,CveClasificacion" DataNavigateUrlFormatString="RepVentasUtilidadDetalle.aspx?CveVenta={0}&CveVendedor={1}&FechaI={2:d}&FechaF={3:d}&CveCliente={4}&Orden={5}&CveSubProyecto={6}&CvePS={7}&CveClasificacion={8}"/>
<asp:HyperLinkField ItemStyle-HorizontalAlign="Right" HeaderText="SubTotal" DataTextField="SubTotal" DataTextFormatString="{0:N}" DataNavigateUrlFields="CveVenta,CveVendedor,FechaI,FechaF,CveCliente,Orden,CveSubProyecto,CvePS,CveClasificacion" DataNavigateUrlFormatString="RepVentasUtilidadDetalle.aspx?CveVenta={0}&CveVendedor={1}&FechaI={2:d}&FechaF={3:d}&CveCliente={4}&Orden={5}&CveSubProyecto={6}&CvePS={7}&CveClasificacion={8}"/> <asp:HyperLinkField ItemStyle-HorizontalAlign="Right" HeaderText="SubTotal" DataTextField="SubTotal" DataTextFormatString="{0:N}" DataNavigateUrlFields="CveVenta,CveVendedor,FechaI,FechaF,CveCliente,Orden,CveSubProyecto,CvePS,CveClasificacion" DataNavigateUrlFormatString="RepVentasUtilidadDetalle.aspx?CveVenta={0}&CveVendedor={1}&FechaI={2:d}&FechaF={3:d}&CveCliente={4}&Orden={5}&CveSubProyecto={6}&CvePS={7}&CveClasificacion={8}"/>
<asp:HyperLinkField ItemStyle-HorizontalAlign="Right" HeaderText="Descuento" DataTextField="Descuento" DataTextFormatString="{0:N}" DataNavigateUrlFields="CveVenta,CveVendedor,FechaI,FechaF,CveCliente,Orden,CveSubProyecto,CvePS,CveClasificacion" DataNavigateUrlFormatString="RepVentasUtilidadDetalle.aspx?CveVenta={0}&CveVendedor={1}&FechaI={2:d}&FechaF={3:d}&CveCliente={4}&Orden={5}&CveSubProyecto={6}&CvePS={7}&CveClasificacion={8}"/>
<asp:HyperLinkField ItemStyle-HorizontalAlign="Right" HeaderText="Bonificacion" DataTextField="Bonificacion" DataTextFormatString="{0:N}" DataNavigateUrlFields="CveVenta,CveVendedor,FechaI,FechaF,CveCliente,Orden,CveSubProyecto,CvePS,CveClasificacion" DataNavigateUrlFormatString="RepVentasUtilidadDetalle.aspx?CveVenta={0}&CveVendedor={1}&FechaI={2:d}&FechaF={3:d}&CveCliente={4}&Orden={5}&CveSubProyecto={6}&CvePS={7}&CveClasificacion={8}"/>
<asp:HyperLinkField ItemStyle-HorizontalAlign="Right" HeaderText="SubTotal2" DataTextField="SubTotal2" DataTextFormatString="{0:N}" DataNavigateUrlFields="CveVenta,CveVendedor,FechaI,FechaF,CveCliente,Orden,CveSubProyecto,CvePS,CveClasificacion" DataNavigateUrlFormatString="RepVentasUtilidadDetalle.aspx?CveVenta={0}&CveVendedor={1}&FechaI={2:d}&FechaF={3:d}&CveCliente={4}&Orden={5}&CveSubProyecto={6}&CvePS={7}&CveClasificacion={8}"/>
<asp:HyperLinkField Text="Ir" DataNavigateUrlFields="CveVenta" ItemStyle-Width="2.5%" ItemStyle-HorizontalAlign="Center" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" /> <asp:HyperLinkField Text="Ir" DataNavigateUrlFields="CveVenta" ItemStyle-Width="2.5%" ItemStyle-HorizontalAlign="Center" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" />
<asp:HyperLinkField ItemStyle-HorizontalAlign="Center" HeaderText="Folio" ItemStyle-CssClass="Texto" DataTextField="FolioMovto" DataTextFormatString="{0}" DataNavigateUrlFields="CveVenta,CveVendedor,FechaI,FechaF,CveCliente,Orden,CveSubProyecto,CvePS,CveClasificacion" DataNavigateUrlFormatString="RepVentasUtilidadDetalle.aspx?CveVenta={0}&CveVendedor={1}&FechaI={2:d}&FechaF={3:d}&CveCliente={4}&Orden={5}&CveSubProyecto={6}&CvePS={7}&CveClasificacion={8}"/> <asp:HyperLinkField ItemStyle-HorizontalAlign="Center" HeaderText="Folio" ItemStyle-CssClass="Texto" DataTextField="FolioMovto" DataTextFormatString="{0}" DataNavigateUrlFields="CveVenta,CveVendedor,FechaI,FechaF,CveCliente,Orden,CveSubProyecto,CvePS,CveClasificacion" DataNavigateUrlFormatString="RepVentasUtilidadDetalle.aspx?CveVenta={0}&CveVendedor={1}&FechaI={2:d}&FechaF={3:d}&CveCliente={4}&Orden={5}&CveSubProyecto={6}&CvePS={7}&CveClasificacion={8}"/>
<asp:HyperLinkField ItemStyle-HorizontalAlign="Center" HeaderText="Fecha" DataTextField="FechaMovto" DataTextFormatString="{0:d}" DataNavigateUrlFields="CveVenta,CveVendedor,FechaI,FechaF,CveCliente,Orden,CveSubProyecto,CvePS,CveClasificacion" DataNavigateUrlFormatString="RepVentasUtilidadDetalle.aspx?CveVenta={0}&CveVendedor={1}&FechaI={2:d}&FechaF={3:d}&CveCliente={4}&Orden={5}&CveSubProyecto={6}&CvePS={7}&CveClasificacion={8}"/> <asp:HyperLinkField ItemStyle-HorizontalAlign="Center" HeaderText="Fecha" DataTextField="FechaMovto" DataTextFormatString="{0:d}" DataNavigateUrlFields="CveVenta,CveVendedor,FechaI,FechaF,CveCliente,Orden,CveSubProyecto,CvePS,CveClasificacion" DataNavigateUrlFormatString="RepVentasUtilidadDetalle.aspx?CveVenta={0}&CveVendedor={1}&FechaI={2:d}&FechaF={3:d}&CveCliente={4}&Orden={5}&CveSubProyecto={6}&CvePS={7}&CveClasificacion={8}"/>

View File

@@ -38,8 +38,15 @@ Partial Class Ventas_RepVentasUtilidad
txtFechaF.Text = Now.LastDayOfMonth.ToShortDateString txtFechaF.Text = Now.LastDayOfMonth.ToShortDateString
'Carga Clientes 'Carga Clientes
DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa) Dim EsWS = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False)
DdlClientes.DataBind() If EsWS Then
DdlClientes.setEsWebService(True)
Else
DdlClientes.setEsWebService(False)
DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1)
DdlClientes.DataBind()
DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
End If
'CargaSubProyectos 'CargaSubProyectos
DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
@@ -84,7 +91,10 @@ Partial Class Ventas_RepVentasUtilidad
DdlSubProyecto.SelectedValuesIfExistM(CveSubProyecto) DdlSubProyecto.SelectedValuesIfExistM(CveSubProyecto)
DdlVendedor.SelectedValuesIfExistM(CveVendedor) DdlVendedor.SelectedValuesIfExistM(CveVendedor)
DdlClientes.SelectedValueExist(CveCliente) If CveCliente <> "-1" Then
DdlClientes.SelectedValue = CveCliente
DdlClientes.SelectedText = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltraParametros($"CveCliente = {CveCliente}").FiltroPrimeroValor("Nombre")
End If
DdlClasificacion.SelectedValueExist(CveClasificacion) DdlClasificacion.SelectedValueExist(CveClasificacion)
DdlPS.SelectedValue = CvePS DdlPS.SelectedValue = CvePS
If CvePS.ToEntero > 0 AndAlso GlobalDTPS(UsuarioActual.CveEmpresa, CvePS.ToEntero).Rows.Count > 0 Then If CvePS.ToEntero > 0 AndAlso GlobalDTPS(UsuarioActual.CveEmpresa, CvePS.ToEntero).Rows.Count > 0 Then
@@ -184,17 +194,25 @@ Partial Class Ventas_RepVentasUtilidad
End If End If
If e.Row.DBCampo("CveVenta") = "" Then
e.Row.Cells(6).Text = ""
e.Row.Cells(7).Text = ""
e.Row.Cells(8).Text = ""
e.Row.Cells(10).Text = ""
End If
If e.Row.DBCampo("CveMovimiento") = "" Then If e.Row.DBCampo("CveMovimiento") = "" Then
e.Row.Cells(3).Text = "" e.Row.Cells(7).Text = ""
e.Row.Cells(8).Text = ""
e.Row.Cells(10).Text = ""
End If End If
If e.Row.DBCampo("CveVenta") = "" Then If e.Row.DBCampo("CveVenta") = "" Then
e.Row.CssClass = "Totales" e.Row.CssClass = "Totales"
End If End If
If e.Row.DBCampo("CveVenta") = "" Then
e.Row.Cells(7).Text = ""
End If
Dim Liga As String = String.Format("/Ventas/RepVentasUtilidadDetalle.aspx?CveVenta={0}&CveVendedor={1}&FechaI={2:d}&FechaF={3:d}&CveCliente={4}&Orden={5}&CveSubProyecto={6}&CvePS={7}&CveClasificacion={8}", Dim Liga As String = String.Format("/Ventas/RepVentasUtilidadDetalle.aspx?CveVenta={0}&CveVendedor={1}&FechaI={2:d}&FechaF={3:d}&CveCliente={4}&Orden={5}&CveSubProyecto={6}&CvePS={7}&CveClasificacion={8}",
@@ -249,7 +267,7 @@ Partial Class Ventas_RepVentasUtilidad
If txtFechaI.Text = "" Then FechaI = MinFecha If txtFechaI.Text = "" Then FechaI = MinFecha
If txtFechaF.Text = "" Then FechaF = MaxFecha If txtFechaF.Text = "" Then FechaF = MaxFecha
Dim Cliente = If(DdlClientes.SelectedValue = "", "", $"&emsp;<b>Cliente:</b> {DdlClientes.SelectedItem.Text}") Dim Cliente = If(DdlClientes.SelectedValue = "", "", $"&emsp;<b>Cliente:</b> {DdlClientes.SelectedText}")
Dim Sucursal = If(DdlSubProyecto.GetSelectedText = "", "", $"&emsp;<b>Sucursal:</b> {DdlSubProyecto.GetSelectedText}") Dim Sucursal = If(DdlSubProyecto.GetSelectedText = "", "", $"&emsp;<b>Sucursal:</b> {DdlSubProyecto.GetSelectedText}")
Dim Vendedor = If(DdlVendedor.GetSelectedText = "", "", $"&emsp;<b>Vendedor:</b> {DdlVendedor.GetSelectedText}") Dim Vendedor = If(DdlVendedor.GetSelectedText = "", "", $"&emsp;<b>Vendedor:</b> {DdlVendedor.GetSelectedText}")
Dim PS = If(DdlPS.SelectedValue = "-1", "", $"&emsp;<b>P.S.:</b> {DdlPS.SelectedText}") Dim PS = If(DdlPS.SelectedValue = "-1", "", $"&emsp;<b>P.S.:</b> {DdlPS.SelectedText}")
@@ -305,7 +323,7 @@ Partial Class Ventas_RepVentasUtilidad
Dim Sucursal = If(DdlSubProyecto.GetSelectedText = "", "", $"&emsp;<b>Sucursal:</b> {DdlSubProyecto.GetSelectedText}") Dim Sucursal = If(DdlSubProyecto.GetSelectedText = "", "", $"&emsp;<b>Sucursal:</b> {DdlSubProyecto.GetSelectedText}")
Dim FechaIn As String = $"&emsp;<b>Fecha Inicio:</b> {txtFechaI.Text}" Dim FechaIn As String = $"&emsp;<b>Fecha Inicio:</b> {txtFechaI.Text}"
Dim FechaFn As String = $"&emsp;<b>Fecha Fin:</b> {txtFechaF.Text}" Dim FechaFn As String = $"&emsp;<b>Fecha Fin:</b> {txtFechaF.Text}"
Dim Cliente = If(DdlClientes.SelectedValue = "-1", "", $"&emsp;<b>Cliente:</b> {DdlClientes.SelectedItem.Text}") Dim Cliente = If(DdlClientes.SelectedValue = "-1", "", $"&emsp;<b>Cliente:</b> {DdlClientes.SelectedText}")
Dim Vendedor = If(DdlVendedor.GetSelectedText = "", "", $"&emsp;<b>Vendedor:</b> {DdlVendedor.GetSelectedText}") Dim Vendedor = If(DdlVendedor.GetSelectedText = "", "", $"&emsp;<b>Vendedor:</b> {DdlVendedor.GetSelectedText}")
Dim PS = If(DdlPS.SelectedValue = "-1", "", $"&emsp;<b>P.S.:</b> {DdlPS.SelectedText}") Dim PS = If(DdlPS.SelectedValue = "-1", "", $"&emsp;<b>P.S.:</b> {DdlPS.SelectedText}")
Dim Clasificacion = If(DdlClasificacion.SelectedValue = "-1", "", $"&emsp;<b>Clasificacion:</b> {DdlClasificacion.SelectedItem.Text}") Dim Clasificacion = If(DdlClasificacion.SelectedValue = "-1", "", $"&emsp;<b>Clasificacion:</b> {DdlClasificacion.SelectedItem.Text}")

View File

@@ -139,9 +139,7 @@
Cliente: Cliente:
</div> </div>
<div class="col-md-2 "> <div class="col-md-2 ">
<asp:DropDownList ID="DdlClientes" runat="server" AppendDataBoundItems="true" DataTextField="Nombre" DataValueField="CveCliente" CssClass="form-control input-small input-sm select2me" Width="100%"> <ADS:Dropdownlost CssClassDdl="select2me" ID="DdlClientesWS" data-metodo="getcliente" runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width:150px;"></ADS:Dropdownlost>
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div> </div>
<div class="col-md-1 truncate"> <div class="col-md-1 truncate">
Vendedor: Vendedor:

View File

@@ -44,8 +44,14 @@ Partial Class Ventas_RepVentasUtilidadPadre
txtFechaF.Text = Now.LastDayOfMonth.ToShortDateString txtFechaF.Text = Now.LastDayOfMonth.ToShortDateString
'Carga Clientes 'Carga Clientes
DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa) If UsuarioActual.CveEmpresa = 119 Then
DdlClientes.DataBind() DdlClientesWS.setEsWebService(True)
Else
DdlClientesWS.setEsWebService(False)
DdlClientesWS.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1)
DdlClientesWS.DataBind()
DdlClientesWS.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
End If
'CargaSubProyectos 'CargaSubProyectos
DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
@@ -100,7 +106,7 @@ Partial Class Ventas_RepVentasUtilidadPadre
Private Sub CargaDatos() Private Sub CargaDatos()
Dim ObjVentas As New ClsVentas Dim ObjVentas As New ClsVentas
If ObjVentas.GetReportePadreVentasUtilidad(If(DdlVendedor.GetSelectedValuesM = "", "-1", DdlVendedor.GetSelectedValuesM), DdlClientes.SelectedValue.ToEntero, If ObjVentas.GetReportePadreVentasUtilidad(If(DdlVendedor.GetSelectedValuesM = "", "-1", DdlVendedor.GetSelectedValuesM), DdlClientesWS.SelectedValue.ToEntero,
If(DdlSubProyecto.GetSelectedValuesM = "", "-1", DdlSubProyecto.GetSelectedValuesM), txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, If(DdlSubProyecto.GetSelectedValuesM = "", "-1", DdlSubProyecto.GetSelectedValuesM), txtFechaI.Text.ToDate, txtFechaF.Text.ToDate,
UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero, DdlPS.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero) Then UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero, DdlPS.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero) Then
GvDatos.DataSource = ObjVentas.DtResultados GvDatos.DataSource = ObjVentas.DtResultados
@@ -211,10 +217,10 @@ Partial Class Ventas_RepVentasUtilidadPadre
If txtFechaI.Text <> "" Then StrFiltro.AppendFormat("&emsp;<b>Fecha Inicio </b>: {0}", txtFechaI.Text.ToDate.ToShortDateString) If txtFechaI.Text <> "" Then StrFiltro.AppendFormat("&emsp;<b>Fecha Inicio </b>: {0}", txtFechaI.Text.ToDate.ToShortDateString)
If txtFechaF.Text <> "" Then StrFiltro.AppendFormat("&emsp;<b>Fecha Fin </b>: {0}", txtFechaF.Text.ToDate.ToShortDateString) If txtFechaF.Text <> "" Then StrFiltro.AppendFormat("&emsp;<b>Fecha Fin </b>: {0}", txtFechaF.Text.ToDate.ToShortDateString)
If DdlSubProyecto.GetSelectedText <> "" Then StrFiltro.AppendFormat("&emsp;<b>SubProyecto</b>: {0}", DdlSubProyecto.GetSelectedText) If DdlSubProyecto.GetSelectedText <> "" Then StrFiltro.AppendFormat("&emsp;<b>SubProyecto</b>: {0}", DdlSubProyecto.GetSelectedText)
If DdlClientes.SelectedValue <> "-1" Then StrFiltro.AppendFormat("&emsp;<b>Cliente</b>: {0}", DdlClientes.SelectedItem.Text) If DdlClientesWS.SelectedValue <> "-1" Then StrFiltro.AppendFormat("&emsp;<b>Cliente</b>: {0}", DdlClientesWS.SelectedText)
If DdlPS.SelectedValue <> "-1" Then StrFiltro.AppendFormat("&emsp;<b>P.S.</b>: {0}", DdlPS.SelectedText) If DdlPS.SelectedValue <> "-1" Then StrFiltro.AppendFormat("&emsp;<b>P.S.</b>: {0}", DdlPS.SelectedText)
If DdlClasificacion.SelectedValue <> "-1" Then StrFiltro.AppendFormat("&emsp;<b>Clasificación</b>: {0}", DdlClasificacion.SelectedItem.Text) If DdlClasificacion.SelectedValue <> "-1" Then StrFiltro.AppendFormat("&emsp;<b>Clasificación</b>: {0}", DdlClasificacion.SelectedItem.Text)
If DdlClientes.SelectedValue <> "-1" Then StrFiltro.AppendFormat("&emsp;<b>Cliente</b>: {0}", DdlClientes.SelectedItem.Text) If DdlClientesWS.SelectedValue <> "-1" Then StrFiltro.AppendFormat("&emsp;<b>Cliente</b>: {0}", DdlClientesWS.SelectedText)
If DdlVendedor.GetSelectedText <> "" Then StrFiltro.AppendFormat("&emsp;<b>Vendedor</b>: {0}", DdlVendedor.GetSelectedText) If DdlVendedor.GetSelectedText <> "" Then StrFiltro.AppendFormat("&emsp;<b>Vendedor</b>: {0}", DdlVendedor.GetSelectedText)
Dim params As List(Of ReportParameter) = New List(Of ReportParameter)() Dim params As List(Of ReportParameter) = New List(Of ReportParameter)()
Dim Imagen As System.IO.FileInfo = New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) Dim Imagen As System.IO.FileInfo = New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))

File diff suppressed because it is too large Load Diff

View File

@@ -9,7 +9,6 @@ Imports Microsoft.Reporting.WebForms
Imports System.Security.Cryptography.X509Certificates Imports System.Security.Cryptography.X509Certificates
Imports System.Globalization Imports System.Globalization
Partial Class Ventas Partial Class Ventas
Inherits ClsPaginas Inherits ClsPaginas
@@ -4318,9 +4317,7 @@ Partial Class Ventas
DdlMetodoPago33.DataBind() DdlMetodoPago33.DataBind()
DdlMetodoPago33.SelectedValue = "3" DdlMetodoPago33.SelectedValue = "3"
CargaFormaPago(DdlMetodoPago33.SelectedValue.ToEntero)
CargaFormaPago(DdlMetodoPago33.SelectedValue.ToEntero)
'End If 'End If
@@ -6559,7 +6556,7 @@ Partial Class Ventas
'ContPAQ El movimiento 1 es el de Venta 'ContPAQ El movimiento 1 es el de Venta
Dim AutoConta As Boolean = UsuarioActual.Empresa.Funcionalidad(200) = "1" Dim AutoConta As Boolean = UsuarioActual.Empresa.Funcionalidad(200) = "1"
If UsuarioActual.CveEmpresa = 119 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ant", "Rem", "Cot", "Ped", "Pd2", "PA") Then If UsuarioActual.CveEmpresa = 119 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ant", "Rem", "Cot", "Ped", "Pd2", "PA", "NC") Then
AutoConta = False AutoConta = False
End If End If
@@ -8803,7 +8800,7 @@ Partial Class Ventas
'Se agregan los PS 'Se agregan los PS
For Each Row As DataRow In TmpDTDetalle.Rows For Each Row As DataRow In TmpDTDetalle.Rows
If Not ObjVentas.AddVentaDetalle(ObjVentas.CveVenta, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("CveUM").ToString.ToEntero, If Not ObjVentas.AddVentaDetalle(ObjVentas.CveVenta, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("CveUM").ToString.ToEntero,
Row("PU").ToString.ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)), Row("IVA").ToString.ToDouble, Math.Round((Row("Total").ToString.ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)) * (1 + Row("IVA").ToString.ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)))), 6), Row("PU").ToString.ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)), Row("ImporteIVA").ToString.ToDouble, Math.Round((Row("Total").ToString.ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)) * (1 + Row("PorcentajeIVA").ToString.ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)))), 6),
Row("Obs").ToString, Row("Descuento").ToString.ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)), Row("TipoDescuento").ToString.ToEntero, Row("CveSubProyecto").ToString.ToEntero, Row("CvePresupuestoIngreso").ToString.ToEntero, Row("Obs").ToString, Row("Descuento").ToString.ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)), Row("TipoDescuento").ToString.ToEntero, Row("CveSubProyecto").ToString.ToEntero, Row("CvePresupuestoIngreso").ToString.ToEntero,
TiempoEntrega:=Row("TiempoEntrega").ToString, CveVentaDetallePadre:=Row("CveVentaDetalle").ToString.ToEntero, CveContratoDetalle:=Row("CveContratoDetalle").ToString.ToEntero, CvePromocionDetalle:=If(DtPromociones IsNot Nothing, DtPromociones.FiltroPrimeroValor("CvePromocionDetalle", $"CvePS={Row("CvePS").ToString}").ToEntero, -1), TiempoEntrega:=Row("TiempoEntrega").ToString, CveVentaDetallePadre:=Row("CveVentaDetalle").ToString.ToEntero, CveContratoDetalle:=Row("CveContratoDetalle").ToString.ToEntero, CvePromocionDetalle:=If(DtPromociones IsNot Nothing, DtPromociones.FiltroPrimeroValor("CvePromocionDetalle", $"CvePS={Row("CvePS").ToString}").ToEntero, -1),
IEPS:=Row("ImporteIEPS").ToString.ToDouble, CveMovimientoDetallePedido:=Row("CveMovimientoDetallePedido").ToString.ToEntero, IEPS:=Row("ImporteIEPS").ToString.ToDouble, CveMovimientoDetallePedido:=Row("CveMovimientoDetallePedido").ToString.ToEntero,
@@ -9352,7 +9349,7 @@ Partial Class Ventas
ImporteMN251 = Dr("Importe").ToString.ToDecimal * TCFluctuacion ImporteMN251 = Dr("Importe").ToString.ToDecimal * TCFluctuacion
ElseIf DdlMoneda.SelectedValue.ToEntero = 1 AndAlso Dr("TCCambioValuacion").ToString.ToDecimal > 1 Then ElseIf DdlMoneda.SelectedValue.ToEntero = 1 AndAlso Dr("TCCambioValuacion").ToString.ToDecimal > 1 Then
ImporteMN251 = Dr("Importe").ToString.ToDecimal / TipoCambioNC ImporteMN251 = Dr("Importe").ToString.ToDecimal / TipoCambioNC
Else Else
ImporteMN251 = Dr("Importe").ToString.ToDecimal ImporteMN251 = Dr("Importe").ToString.ToDecimal
End If End If
@@ -10191,8 +10188,8 @@ Partial Class Ventas
End If End If
End If End If
'REGRESA SALDO A LAS REMISIONES QUE SE FACTURARON EN EL INGRESO QUE SE ESTA CANCELANDO 'REGRESA SALDO A LAS REMISIONES QUE SE FACTURARON EN EL INGRESO QUE SE ESTA CANCELANDO
If ObjFactura.TipoDocto = "Ing" And ValorMultiplicador = -1 AndAlso NuevaFactura <> 1 AndAlso Not SeCancelaRemisionProceso Then ' se debe de excluir cuando es refacturación If ObjFactura.TipoDocto = "Ing" And ValorMultiplicador = -1 AndAlso NuevaFactura <> 1 AndAlso Not SeCancelaRemisionProceso Then ' se debe de excluir cuando es refacturación
If ObjVentas.GetRemisionesRelacionadas(ObjFactura.CveVenta, ObjFactura.TipoDocto) AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then If ObjVentas.GetRemisionesRelacionadas(ObjFactura.CveVenta, ObjFactura.TipoDocto) AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
For Each Dr As DataRow In ObjVentas.DtResultados.Rows For Each Dr As DataRow In ObjVentas.DtResultados.Rows
Dim Selecciono As Boolean = False Dim Selecciono As Boolean = False
@@ -14408,7 +14405,7 @@ Partial Class Ventas
If TotalAmortizacion > 0 AndAlso TotalSubTotal = TotalAmortizacion Then ' si se amortizó completa la factura, debe de limpiar los impuestos If TotalAmortizacion > 0 AndAlso TotalSubTotal = TotalAmortizacion Then ' si se amortizó completa la factura, debe de limpiar los impuestos
If DdlTipoAmortizacionAnticipo.SelectedValue.Contiene("3") Then If DdlTipoAmortizacionAnticipo.SelectedValue.Contiene("3") Then
For Each dr As DataRow In TmpDT.Rows For Each dr As DataRow In TmpDT.Rows
dr("ImporteIVA") = 0 : dr("ImporteIEPS") = 0 : dr("ImporteRetIVA") = 0 : dr("ImporteRetISR") = 0 dr("ImporteIVA") = 0 : dr("ImporteIEPS") = 0 : dr("ImporteRetIVA") = 0 : dr("ImporteRetISR") = 0 : dr("PorcentajeIVA") = 0 : dr("IVA") = 0
Next Next
If TmpDTImpuestos IsNot Nothing Then If TmpDTImpuestos IsNot Nothing Then
@@ -15823,7 +15820,7 @@ Partial Class Ventas
End If End If
Else Else
If Not ObjVentas.AddVentaDetalle(CveVenta, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("CveUM").ToString.ToEntero, If Not ObjVentas.AddVentaDetalle(CveVenta, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("CveUM").ToString.ToEntero,
Row("PU").ToString.ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), Row("IVA").ToString.ToDouble, Math.Round((Row("Total").ToString.ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)) * (1 + Row("IVA").ToString.ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)))), 6), Row("PU").ToString.ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), Row("ImporteIVA").ToString.ToDouble, Math.Round((Row("Total").ToString.ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)) * (1 + Row("PorcentajeIVA").ToString.ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)))), 6),
Row("Obs").ToString, Row("Descuento").ToString.ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), Row("TipoDescuento").ToString.ToEntero, Row("CveSubProyecto").ToString.ToEntero, Row("CvePresupuestoIngreso").ToString.ToEntero, PorcentajeIVA:=Row("PorcentajeIVA").ToString.ToDecimal, IEPS:=Row("IEPS").ToString.ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), PorcentajeIEPS:=Row("PorcentajeIEPS").ToString.ToDouble, TiempoEntrega:=Row("TiempoEntrega").ToString, Row("Obs").ToString, Row("Descuento").ToString.ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), Row("TipoDescuento").ToString.ToEntero, Row("CveSubProyecto").ToString.ToEntero, Row("CvePresupuestoIngreso").ToString.ToEntero, PorcentajeIVA:=Row("PorcentajeIVA").ToString.ToDecimal, IEPS:=Row("IEPS").ToString.ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), PorcentajeIEPS:=Row("PorcentajeIEPS").ToString.ToDouble, TiempoEntrega:=Row("TiempoEntrega").ToString,
CveVentaDetallePadre:=Row("CveVentaDetalle").ToString.ToEntero, CveContratoDetalle:=Row("CveContratoDetalle").ToString.ToEntero, CvePromocionDetalle:=If(DtPromociones IsNot Nothing, DtPromociones.FiltroPrimeroValor("CvePromocionDetalle", $"CvePS={Row("CvePS").ToString}").ToEntero, -1), CveVentaDetallePadre:=Row("CveVentaDetalle").ToString.ToEntero, CveContratoDetalle:=Row("CveContratoDetalle").ToString.ToEntero, CvePromocionDetalle:=If(DtPromociones IsNot Nothing, DtPromociones.FiltroPrimeroValor("CvePromocionDetalle", $"CvePS={Row("CvePS").ToString}").ToEntero, -1),
ImporteRetIVA:=Row("ImporteRetIVA").ToString.ToDouble, ImporteRetISR:=Row("ImporteRetISR").ToString.ToDouble, PorcentajeRetIVA:=Row("PorcentajeRetIVA").ToString.ToDouble, PorcentajeRetISR:=Row("PorcentajeRetISR").ToString.ToDouble, CuentaPredial:=Row("CuentaPredial").ToString) Then ImporteRetIVA:=Row("ImporteRetIVA").ToString.ToDouble, ImporteRetISR:=Row("ImporteRetISR").ToString.ToDouble, PorcentajeRetIVA:=Row("PorcentajeRetIVA").ToString.ToDouble, PorcentajeRetISR:=Row("PorcentajeRetISR").ToString.ToDouble, CuentaPredial:=Row("CuentaPredial").ToString) Then
@@ -16086,7 +16083,7 @@ Partial Class Ventas
Alert("El producto no fue encontrado.", TipoMensaje.MsgAdvertencia) Alert("El producto no fue encontrado.", TipoMensaje.MsgAdvertencia)
End If End If
End Sub End Sub
Private Sub DdlMoneda_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlMoneda.SelectedIndexChanged Private Sub DdlMoneda_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlMoneda.SelectedIndexChanged
CambiaMoneda() CambiaMoneda()
End Sub End Sub
Private Sub CambiaMoneda() Private Sub CambiaMoneda()
@@ -18330,7 +18327,9 @@ Partial Class Ventas
End If End If
End If End If
If Not ObjVentas.UpdateEstatusFactura(CveEstatus, FolioFiscal, CancelacionAcuse, CancelacionFecha, CveVenta, IDPoliza, CvePAC:=CvePACCancelacion, CveEstatusRefacturacion:=CveEstatusRefacturacion) Then
If Not ObjVentas.UpdateEstatusFactura(CveEstatus, FolioFiscal, CancelacionAcuse, CancelacionFecha, CveVenta, IDPoliza, CvePAC:=CvePACCancelacion, CveEstatusRefacturacion:=CveEstatusRefacturacion,
CveUsuarioCambiaEstatus:=UsuarioActual.CveUsuario, FechaCambioEstatus:=Now.ToString("yyyy-MM-dd hh:mm:ss.mmm")) Then
ErrorCancelar = True ErrorCancelar = True
MensajeError = "Ocurrió un error al guardar el estatus de cancelación." MensajeError = "Ocurrió un error al guardar el estatus de cancelación."
End If End If
@@ -20879,7 +20878,7 @@ Partial Class Ventas
If AplicaNCMasiva Then If AplicaNCMasiva Then
For Each Gvr As GridViewRow In GvCxC.Rows For Each Gvr As GridViewRow In GvCxC.Rows
If Gvr.FCCheckBox("ChkCxC").Checked Then If Gvr.FCCheckBox("ChkCxC").Checked Then
DtImpuestos.Merge(CargaDtImpuestosNC(Gvr.DataKey("CveVenta").ToString.ToEntero, Gvr.FCTextBox("TxtImporte").Text.ToString.ToDecimal)) DtImpuestos.Merge(CargaDtImpuestosNC(Gvr.DataKey("CveVenta").ToString.ToEntero, Gvr.FCTextBox("TxtImporte").Text.ToString.ToDecimal), True, MissingSchemaAction.Ignore)
'CARGA FACTURA A LA CUAL SE APLICA LA NC 'CARGA FACTURA A LA CUAL SE APLICA LA NC
CargaNCDT(Gvr.DataKey("CveVenta").ToString.ToEntero, Gvr.FCTextBox("TxtImporte").Text.ToString.ToDecimal) CargaNCDT(Gvr.DataKey("CveVenta").ToString.ToEntero, Gvr.FCTextBox("TxtImporte").Text.ToString.ToDecimal)
End If End If
@@ -21753,7 +21752,8 @@ Partial Class Ventas
CambiaMetodoPago33() CambiaMetodoPago33()
End Sub End Sub
Private Sub CambiaMetodoPago33() Private Sub CambiaMetodoPago33()
CargaFormaPago(DdlMetodoPago33.SelectedValue.ToEntero) CargaFormaPago(DdlMetodoPago33.SelectedValue.ToEntero)
End Sub End Sub
#End Region #End Region
@@ -21883,7 +21883,7 @@ Partial Class Ventas
'RE-INSERTA DETALLES 'RE-INSERTA DETALLES
For Each Row As DataRow In TmpDT.Rows For Each Row As DataRow In TmpDT.Rows
If Not ObjVentas.AddVentaDetalle(CveVenta, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("CveUM").ToString.ToEntero, If Not ObjVentas.AddVentaDetalle(CveVenta, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("CveUM").ToString.ToEntero,
Row("PU").ToString.ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), Row("IVA").ToString.ToDouble, Math.Round((Row("Total").ToString.ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)) * (1 + Row("IVA").ToString.ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)))), 6), Row("PU").ToString.ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), Row("ImporteIVA").ToString.ToDouble, Math.Round((Row("Total").ToString.ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)) * (1 + Row("PorcentajeIVA").ToString.ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)))), 6),
Row("Obs").ToString, Row("Descuento").ToString.ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), Row("TipoDescuento").ToString.ToEntero, Row("CveSubProyecto").ToString.ToEntero, Row("CvePresupuestoIngreso").ToString.ToEntero, Row("Obs").ToString, Row("Descuento").ToString.ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), Row("TipoDescuento").ToString.ToEntero, Row("CveSubProyecto").ToString.ToEntero, Row("CvePresupuestoIngreso").ToString.ToEntero,
PorcentajeIVA:=Row("PorcentajeIVA").ToString.ToDecimal, IEPS:=Row("IEPS").ToString.ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), PorcentajeIEPS:=Row("PorcentajeIEPS").ToString.ToDouble, TiempoEntrega:=Row("TiempoEntrega").ToString) Then PorcentajeIVA:=Row("PorcentajeIVA").ToString.ToDecimal, IEPS:=Row("IEPS").ToString.ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), PorcentajeIEPS:=Row("PorcentajeIEPS").ToString.ToDouble, TiempoEntrega:=Row("TiempoEntrega").ToString) Then
MensajeError = "Ocurrió un error al guardar las partidas de la cotización" MensajeError = "Ocurrió un error al guardar las partidas de la cotización"