diff --git a/App_Code/ClsOC.vb b/App_Code/ClsOC.vb index a2a007864..628310288 100644 --- a/App_Code/ClsOC.vb +++ b/App_Code/ClsOC.vb @@ -33,7 +33,7 @@ Public Class ClsOC Public Property CveIEAnticipo As Integer Public Property CveProveedorAnticipo As Integer Public Property FolioIEAnticipo As Integer - Public Property ImporteAnticipo As Double + Public Property ImporteAnticipo As Decimal Public Property FolioAdicional As String Public Property EntregaDirecta As Boolean @@ -79,16 +79,16 @@ Public Class ClsOC Public Property RFC As String Public Property LugarEntrega As String Public Property Cancelacion As String - Public Property PorcentajeIVA As Double + Public Property PorcentajeIVA As Decimal Public Property CveCliente As Integer Public Property CveVendedor As Integer Public Property PrioridadObservacion As String - Public Property SubTotal As Double - Public Property IVA As Double - Public Property RetIVA As Double - Public Property RetISR As Double - Public Property IEPS As Double - Public Property Total As Double + Public Property SubTotal As Decimal + Public Property IVA As Decimal + Public Property RetIVA As Decimal + Public Property RetISR As Decimal + Public Property IEPS As Decimal + Public Property Total As Decimal Public Property CvePresupuestoEgreso As Integer Public Property RequiereCotizacion As Boolean Public Property CveActivoFijo As Integer @@ -98,8 +98,8 @@ Public Class ClsOC Public Property SubProyecto As String Public Property UsuarioSolicito As String Public Property UsuarioAutorizo As String - Public Property Descuento As Double - Public Property Pendiente As Double + Public Property Descuento As Decimal + Public Property Pendiente As Decimal Public Property NombreCliente As String Public Property SucCalle As String Public Property SucNoExt As String @@ -274,7 +274,7 @@ Public Class ClsOC Extension = Data.Rows(0)("Extension").ToString Usuario = Data.Rows(0)("Usuario").ToString Me.CveUsuario = Data.Rows(0)("CveUsuario").ToString.ToEntero - Me.Total = Data.Rows(0)("Total").ToString.ToDouble + Me.Total = Data.Rows(0)("Total").ToString.ToDecimal Me.CveEmpresa = Data.Rows(0)("CveEmpresa").ToString.ToEntero @@ -416,7 +416,7 @@ Public Class ClsOC Return Retorno End Function - Public Function AddCotizacionDetalle(pCveCotizacion As Integer, pCvePS As Integer, pPrecioUnitario As Double, pCantidad As Double, pCveUM As Integer, pCantidadSurtir As Double, pFechaEntrega As String, pObservacion As String, pCveOrdenCompraDetalle As Integer) As Boolean + Public Function AddCotizacionDetalle(pCveCotizacion As Integer, pCvePS As Integer, pPrecioUnitario As Decimal, pCantidad As Decimal, pCveUM As Integer, pCantidadSurtir As Decimal, pFechaEntrega As String, pObservacion As String, pCveOrdenCompraDetalle As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_OC_CotizacionesDetalleAdd") @@ -425,9 +425,9 @@ Public Class ClsOC .Add("@CveCotizacion", SqlDbType.Int).Value = pCveCotizacion .Add("@CvePS", SqlDbType.Int).Value = pCvePS .Add("@PU", SqlDbType.Money).Value = pPrecioUnitario - .Add("@Cantidad", SqlDbType.Float).Value = pCantidad + .Add("@Cantidad", SqlDbType.Decimal).Value = pCantidad .Add("@CveUM", SqlDbType.Int).Value = pCveUM - .Add("@CantidadSurtir", SqlDbType.Float).Value = pCantidadSurtir + .Add("@CantidadSurtir", SqlDbType.Decimal).Value = pCantidadSurtir .Add("@FechaEntrega", SqlDbType.VarChar).Value = pFechaEntrega .Add("@Observacion", SqlDbType.VarChar).Value = pObservacion .Add("@CveOrdenCompraDetalle", SqlDbType.Int).Value = pCveOrdenCompraDetalle @@ -452,14 +452,14 @@ Public Class ClsOC Return Retorno End Function - Public Function UpdateCotizacionDetalle(pCveCotizacionDetalle As Integer, pPrecioUnitario As Double, pCantidadSurtir As Double, pFechaEntrega As String, pObservacion As String) As Boolean + Public Function UpdateCotizacionDetalle(pCveCotizacionDetalle As Integer, pPrecioUnitario As Decimal, pCantidadSurtir As Decimal, pFechaEntrega As String, pObservacion As String) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_OC_CotizacionesDetalleUpdate") With SqlAdapter.SelectCommand.Parameters .Add("@PU", SqlDbType.Money).Value = pPrecioUnitario - .Add("@CantidadSurtir", SqlDbType.Float).Value = pCantidadSurtir + .Add("@CantidadSurtir", SqlDbType.Decimal).Value = pCantidadSurtir .Add("@FechaEntrega", SqlDbType.VarChar).Value = pFechaEntrega .Add("@Observacion", SqlDbType.VarChar).Value = pObservacion .Add("@CveCotizacionDetalle", SqlDbType.Int).Value = pCveCotizacionDetalle @@ -546,107 +546,6 @@ Public Class ClsOC End Function #End Region - 'Public Function GetEstatusCompra(ByVal CveEstatusCompra As Integer, ByVal EstatusCompra As String) As Boolean - ' Dim Retorno As Boolean = False - - ' DataAdapter("PA_OC_EstatusOrdenCompraGet") - ' Try - ' SqlAdapter.Fill(Data) - - ' If Data.Rows.Count = 1 Then - ' _CveEstatusCompra = Data.Rows(0)("CveEstatusCompra").ToString().ToEntero() - ' _EstatusCompra = Data.Rows(0)("EstatusCompra").ToString() - ' _Estatus = Data.Rows(0)("Estatus").ToString = "True" - ' _FechaIng = Data.Rows(0)("FechaIng").ToString().ToDate() - ' _CveUsuario = Data.Rows(0)("CveUsuario").ToString().ToEntero() - ' _NombreUsuario = Data.Rows(0)("Nombre").ToString() - ' End If - - ' Retorno = True - ' Catch ex As Exception - ' OnError("Ocurrió un error al obtener el Catálogo de Estatus de compra.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - ' End Try - - ' Return Retorno - 'End Function - - 'Public Function AddEstatusCompra(ByVal Descripcion As String, Estatus As Boolean, ByVal CveUsuario As Integer) As Boolean - ' Dim Retorno As Boolean = False - - ' DataAdapter("PA_OC_EstatusOrdenCompraAdd") - - ' With SqlAdapter.SelectCommand.Parameters - ' .Add("@EstatusOrdenCompra", SqlDbType.VarChar).Value = Descripcion - ' .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - ' End With - - ' Try - ' SqlAdapter.Fill(Data) - - ' Retorno = True - ' Catch ex As SqlException - ' If ex.Number = 2627 Then - ' Alert("La Clave o Descripción del EstatusCompra ya existe.", TipoMensaje.MsgAdvertencia) - ' Else - ' OnError("Ocurrió un error al guardar el nuevo estatus de compra.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - ' End If - ' Catch ex As Exception - ' OnError("Ocurrió un error al guardar el nuevo estatus de compra.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - ' End Try - - ' Return Retorno - 'End Function - - 'Public Function UpdateEstatusCompra(ByVal Descripcion As String, Estatus As Boolean, ByVal CveEstatusCompra As Integer, ByVal CveUsuario As Integer) As Boolean - ' Dim Retorno As Boolean = False - - ' DataAdapter("PA_OC_EstatusOrdenCompraUpdate") - - ' With SqlAdapter.SelectCommand.Parameters - ' .Add("@EstatusOrdenCompra", SqlDbType.VarChar).Value = Descripcion - ' '.Add("@pCveUsuario", SqlDbType.Int).Value = CveUsuario - ' .Add("@Estatus", SqlDbType.Bit).Value = Estatus - ' .Add("@CveEstatusOrdenCompra", SqlDbType.Int).Value = CveEstatusCompra - ' End With - - ' Try - ' SqlAdapter.Fill(Data) - - ' Retorno = True - ' Catch ex As SqlException - ' If ex.Number = 2627 Then - ' Alert("La Clave o Descripción del Estatus de Compra ya existe.", TipoMensaje.MsgAdvertencia) - ' Else - ' OnError("Ocurrió un error al guardar los cambios en el estatus de compra", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - ' End If - ' Catch ex As Exception - ' OnError("Ocurrió un error al guardar los cambios en el estatus de compra.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - ' End Try - - ' Return Retorno - 'End Function - - 'Public Function RemoveEstatusCompra(ByVal CveEstatusCompra As Integer) As Boolean - ' Dim Retorno As Boolean = False - - ' DataAdapter("PA_OC_EstatusOrdenCompraRemove") - - ' With SqlAdapter.SelectCommand.Parameters - ' .Add("@CveEstatusOrdenCompra", SqlDbType.Int).Value = CveEstatusCompra - ' End With - - ' Try - ' SqlAdapter.Fill(Data) - - ' Retorno = True - ' Catch ex As Exception - ' OnError("Ocurrió un error al eliminar el estatus de compra.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - ' End Try - - ' Return Retorno - 'End Function - - #Region "O R D E N E S - D E - C O M P R A S" Public Function GetOC(ObjOrdenCompra As Modelos.OrdenCompra) As Boolean @@ -707,7 +606,7 @@ Public Class ClsOC _Folio = dr("Folio").ToString.ToEntero _CveIEAnticipo = dr("CveIEAnticipo").ToString.ToEntero _FolioIEAnticipo = dr("FolioIEAnticipo").ToString.ToEntero - _ImporteAnticipo = dr("ImporteAnticipo").ToString.ToDouble + _ImporteAnticipo = dr("ImporteAnticipo").ToString.ToDecimal _CveProveedorAnticipo = dr("CveProveedorAnticipo").ToString.ToEntero _CveEmpresa = dr("CveEmpresa").ToString.ToEntero _CveProyecto = dr("CveProyecto").ToString.ToEntero @@ -752,32 +651,15 @@ Public Class ClsOC Me.SucursalTelefono = If(Not IsDBNull(dr("TelefonoSucursal")), dr("TelefonoSucursal").ToString, "") ProveedorContacto = dr("ContactoNombre").ToString - PorcentajeIVA = dr("PorcentajeIVA").ToString.ToDouble - SubTotal = dr("SubTotal").ToString.ToDouble - Descuento = dr("Descuento").ToString.ToDouble - IVA = dr("IVA").ToString.ToDouble - RetIVA = dr("RetIVA").ToString.ToDouble - RetISR = dr("RetISR").ToString.ToDouble - IEPS = dr("IEPS").ToString.ToDouble - Total = dr("Total").ToString.ToDouble - Pendiente = dr("Pendiente").ToString.ToDouble - 'If Not IsDBNull(dr("SubTotal")) Then - ' SubTotal = dr("SubTotal").ToString.ToDouble - ' If IVA <= 0 Then - ' _IVA = _SubTotal * dr("PorcentajeIVA").ToString.ToDouble - ' End If - ' _Total = _SubTotal + _IVA - _Descuento - _RetIVA - _RetISR - 'End If - - '_CveSupervisara = dr("CveSupervisara").ToString.ToEntero - '_CveAutoriza = dr("CveAutoriza").ToString.ToEntero - '_CveAutorizara = dr("CveAutorizara").ToString.ToEntero - - '_NombreSupervisa = dr("NombreSupervisa").ToString - - '_NombreAutoriza = dr("NombreAutoriza").ToString - '_FechaSupervisa = dr("FechaSupervisa").ToString.ToDate - '_FechaAutoriza = dr("FechaAutoriza").ToString.ToDate + PorcentajeIVA = dr("PorcentajeIVA").ToString.ToDecimal + SubTotal = dr("SubTotal").ToString.ToDecimal + Descuento = dr("Descuento").ToString.ToDecimal + IVA = dr("IVA").ToString.ToDecimal + RetIVA = dr("RetIVA").ToString.ToDecimal + RetISR = dr("RetISR").ToString.ToDecimal + IEPS = dr("IEPS").ToString.ToDecimal + Total = dr("Total").ToString.ToDecimal + Pendiente = dr("Pendiente").ToString.ToDecimal 'RequiereCotizacion = CType(dr("RequiereCotizacion"), Boolean) SubProyecto = dr("SubProyecto").ToString @@ -820,9 +702,9 @@ Public Class ClsOC pFechaEstimadaEntrega As String, pLugarEntrega As String, pCveUsuario As Integer, pCveEmpresa As Integer, pCvePresupuestoEgreso As Integer, Optional pCveProveedor As Integer = -1, Optional pCveProveedorSucursal As Integer = -1, Optional IDPoliza As Integer = -1, Optional RequiereCotizacion As Boolean = False, Optional CveUsuarioAsignado As Integer = -1, Optional CveCliente As Integer = -1, Optional CveVendedor As Integer = -1, Optional PrioridadObservacion As String = "", - Optional PorcentajeIVA As Double = 0.16, Optional IVA As Decimal = 0, Optional RetIVA As Decimal = 0, Optional RetISR As Decimal = 0, Optional FechaExpiracion As Date = Nothing, Optional CveCotizacion As Integer = -1, + Optional PorcentajeIVA As Decimal = 0.16, Optional IVA As Decimal = 0, Optional RetIVA As Decimal = 0, Optional RetISR As Decimal = 0, Optional FechaExpiracion As Date = Nothing, Optional CveCotizacion As Integer = -1, Optional FolioAdicional As String = "", Optional EntregaDirecta As Integer = -1, Optional CveDireccionEnvio As Integer = -1, Optional Guia As String = "-1", Optional IEPS As Decimal = -1, - Optional CveIEAnticipo As Integer = -1, Optional ImporteAnticipo As Double = 0, Optional UsoCFDI As Integer = -1, Optional Promocion As String = "-1", Optional CveProveedorContacto As Integer = -1) As Boolean + Optional CveIEAnticipo As Integer = -1, Optional ImporteAnticipo As Decimal = 0, Optional UsoCFDI As Integer = -1, Optional Promocion As String = "-1", Optional CveProveedorContacto As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_OC_OrdenesCompraAdd") @@ -971,7 +853,7 @@ Public Class ClsOC Return Retorno End Function - Public Function UpdateOrdenCompraDetalleAjuste(CveOrdenCompra As Integer, CveOrdenCompraDetalle As Integer, Diferencia As Double, CveUsuarioModifico As Integer) As Boolean + Public Function UpdateOrdenCompraDetalleAjuste(CveOrdenCompra As Integer, CveOrdenCompraDetalle As Integer, Diferencia As Decimal, CveUsuarioModifico As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_OC_OrdenesCompraDetalleAjusteUpdate") With SqlAdapter.SelectCommand.Parameters @@ -1028,7 +910,7 @@ Public Class ClsOC pCveProveedor As Integer, pCveOrdenCompra As Integer, pCveUsuarioModifico As Integer, Optional CveCliente As Integer = -1, Optional CveVendedor As Integer = -1, Optional PrioridadObservacion As String = "", Optional IVA As Decimal = 0, Optional RetIVA As Decimal = 0, Optional RetISR As Decimal = 0, Optional IDPoliza As Integer = -1, Optional FechaExpiracion As Date = Nothing, Optional FolioAdicional As String = "", Optional EntregaDirecta As Integer = -1, Optional CveDireccionEnvio As Integer = -1, Optional Guia As String = "-1", Optional IEPS As Decimal = -1, Optional UsoCFDI As Integer = -1, Optional Promocion As String = "-1", - Optional pCveProveedorSucursal As Integer = -1, Optional CveProveedorContacto As Integer = -1, Optional PorcentajeIVA As Double = 0.16) As Boolean + Optional pCveProveedorSucursal As Integer = -1, Optional CveProveedorContacto As Integer = -1, Optional PorcentajeIVA As Decimal = 0.16) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_OC_OrdenesCompraUpdate") @@ -1266,18 +1148,18 @@ Public Class ClsOC Return Retorno End Function - Public Function AddOrdenCompraDetalle(pCveOrdenCompra As Integer, pCantidad As Double, pCveUnidadMedida As Integer, pCvePS As Integer, pImporte As Double, pCveSubProyecto As Integer, pCveActivoFijo As Integer, - pObservacion As String, pCveUsuario As Integer, Optional pCveOrdenCompraPadre As Integer = -1, Optional CvePresupuestoEgreso As Integer = -1, Optional Descuento As Double = 0, - Optional IEPSPS As Double = 0, Optional IEPSPSIVA As Double = 0, Optional IVA As Double = 0, Optional RetIVA As Double = 0, Optional RetISR As Double = 0, Optional Total As Double = 0, - Optional CveContratoDetalle As Integer = -1, Optional IVAPorcentaje As Double = 0, Optional RetIVAPorcentaje As Double = 0, Optional RetISRPorcentaje As Double = 0, Optional IEPSPSPorcentaje As Double = 0, - Optional IEPSPSIVAPorcentaje As Double = 0, Optional CveVentaDetalleCotizacion As Integer = -1, Optional CveTipoGastoObra As Integer = -1, Optional CveCultivoCuadroDetalle As Integer = -1) As Boolean + Public Function AddOrdenCompraDetalle(pCveOrdenCompra As Integer, pCantidad As Decimal, pCveUnidadMedida As Integer, pCvePS As Integer, pImporte As Decimal, pCveSubProyecto As Integer, pCveActivoFijo As Integer, + pObservacion As String, pCveUsuario As Integer, Optional pCveOrdenCompraPadre As Integer = -1, Optional CvePresupuestoEgreso As Integer = -1, Optional Descuento As Decimal = 0, + Optional IEPSPS As Decimal = 0, Optional IEPSPSIVA As Decimal = 0, Optional IVA As Decimal = 0, Optional RetIVA As Decimal = 0, Optional RetISR As Decimal = 0, Optional Total As Decimal = 0, + Optional CveContratoDetalle As Integer = -1, Optional IVAPorcentaje As Decimal = 0, Optional RetIVAPorcentaje As Decimal = 0, Optional RetISRPorcentaje As Decimal = 0, Optional IEPSPSPorcentaje As Decimal = 0, + Optional IEPSPSIVAPorcentaje As Decimal = 0, Optional CveVentaDetalleCotizacion As Integer = -1, Optional CveTipoGastoObra As Integer = -1, Optional CveCultivoCuadroDetalle As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_OC_OrdenesCompraDetalleAdd") With SqlAdapter.SelectCommand.Parameters .Add("@CveOrdenCompra", SqlDbType.Int).Value = pCveOrdenCompra - .Add("@Cantidad", SqlDbType.Float).Value = pCantidad - .Add("@Descuento", SqlDbType.Float).Value = Descuento + .Add("@Cantidad", SqlDbType.Decimal).Value = pCantidad + .Add("@Descuento", SqlDbType.Decimal).Value = Descuento .Add("@Importe", SqlDbType.Float).Value = pImporte .Add("@CveUnidadMedida", SqlDbType.Int).Value = pCveUnidadMedida .Add("@CvePS", SqlDbType.Int).Value = pCvePS @@ -1290,16 +1172,16 @@ Public Class ClsOC .Add("@vCveOrdenCompraDetalle", SqlDbType.Int).Direction = ParameterDirection.Output .Add("@IEPSPS", SqlDbType.Money).Value = IEPSPS .Add("@IEPSPSIVA", SqlDbType.Money).Value = IEPSPSIVA - .Add("@IVA", SqlDbType.Float).Value = IVA - .Add("@RetIVA", SqlDbType.Float).Value = RetIVA - .Add("@RetISR", SqlDbType.Float).Value = RetISR - .Add("@Total", SqlDbType.Float).Value = Total + .Add("@IVA", SqlDbType.Decimal).Value = IVA + .Add("@RetIVA", SqlDbType.Decimal).Value = RetIVA + .Add("@RetISR", SqlDbType.Decimal).Value = RetISR + .Add("@Total", SqlDbType.Decimal).Value = Total .Add("@CveContratoDetalle", SqlDbType.Int).Value = CveContratoDetalle - .Add("@IVAPorcentaje", SqlDbType.Float).Value = IVAPorcentaje - .Add("@RetIVAPorcentaje", SqlDbType.Float).Value = RetIVAPorcentaje - .Add("@RetISRPorcentaje", SqlDbType.Float).Value = RetISRPorcentaje - .Add("@IEPSPSPorcentaje", SqlDbType.Float).Value = IEPSPSPorcentaje - .Add("@IEPSPSIVAPorcentaje", SqlDbType.Float).Value = IEPSPSIVAPorcentaje + .Add("@IVAPorcentaje", SqlDbType.Decimal).Value = IVAPorcentaje + .Add("@RetIVAPorcentaje", SqlDbType.Decimal).Value = RetIVAPorcentaje + .Add("@RetISRPorcentaje", SqlDbType.Decimal).Value = RetISRPorcentaje + .Add("@IEPSPSPorcentaje", SqlDbType.Decimal).Value = IEPSPSPorcentaje + .Add("@IEPSPSIVAPorcentaje", SqlDbType.Decimal).Value = IEPSPSIVAPorcentaje .Add("@CveVentaDetalleCotizacion", SqlDbType.Int).Value = CveVentaDetalleCotizacion .Add("@CveTipoGastoObra", SqlDbType.Int).Value = CveTipoGastoObra .Add("@CveCultivoCuadroDetalle", SqlDbType.Int).Value = CveCultivoCuadroDetalle @@ -1322,11 +1204,11 @@ Public Class ClsOC Return Retorno End Function - Public Function UpdateOrdenCompraDetalle(pCantidad As Double, pCveUnidadMedida As Integer, pCvePS As Integer, pImporte As Double, pCveSubProyecto As Integer, pCveActivoFijo As Integer, - pObservacion As String, pCveUsuario As Integer, pCveOrdenCompraDetalle As Integer, Optional CvePresupuestoEgreso As Integer = -1, Optional Descuento As Double = 0, - Optional IEPSPS As Double = 0, Optional IEPSPSIVA As Double = 0, Optional IVA As Double = 0, Optional RetIVA As Double = 0, Optional RetISR As Double = 0, Optional Total As Double = 0, - Optional CveContratoDetalle As Integer = -1, Optional IVAPorcentaje As Double = 0, Optional RetIVAPorcentaje As Double = 0, Optional RetISRPorcentaje As Double = 0, Optional IEPSPSPorcentaje As Double = 0, - Optional IEPSPSIVAPorcentaje As Double = 0, Optional CveTipoGastoObra As Integer = -1) As Integer + Public Function UpdateOrdenCompraDetalle(pCantidad As Decimal, pCveUnidadMedida As Integer, pCvePS As Integer, pImporte As Decimal, pCveSubProyecto As Integer, pCveActivoFijo As Integer, + pObservacion As String, pCveUsuario As Integer, pCveOrdenCompraDetalle As Integer, Optional CvePresupuestoEgreso As Integer = -1, Optional Descuento As Decimal = 0, + Optional IEPSPS As Decimal = 0, Optional IEPSPSIVA As Decimal = 0, Optional IVA As Decimal = 0, Optional RetIVA As Decimal = 0, Optional RetISR As Decimal = 0, Optional Total As Decimal = 0, + Optional CveContratoDetalle As Integer = -1, Optional IVAPorcentaje As Decimal = 0, Optional RetIVAPorcentaje As Decimal = 0, Optional RetISRPorcentaje As Decimal = 0, Optional IEPSPSPorcentaje As Decimal = 0, + Optional IEPSPSIVAPorcentaje As Decimal = 0, Optional CveTipoGastoObra As Integer = -1) As Integer Dim Retorno As Integer = -1 DataAdapter("PA_OC_OrdenesCompraDetalleUpdate") @@ -1336,8 +1218,8 @@ Public Class ClsOC .Add("@Cantidad", SqlDbType.Float).Value = pCantidad .Add("@CveUnidadMedida", SqlDbType.Int).Value = pCveUnidadMedida .Add("@CvePS", SqlDbType.Int).Value = pCvePS - .Add("@Descuento", SqlDbType.Float).Value = Descuento - .Add("@Importe", SqlDbType.Float).Value = pImporte + .Add("@Descuento", SqlDbType.Decimal).Value = Descuento + .Add("@Importe", SqlDbType.Decimal).Value = pImporte .Add("@CveSubProyecto", SqlDbType.Int).Value = pCveSubProyecto .Add("@CveOrdenCompraDetalle", SqlDbType.Int).Value = pCveOrdenCompraDetalle .Add("@CveActivoFijo", SqlDbType.Int).Value = pCveActivoFijo @@ -1346,16 +1228,16 @@ Public Class ClsOC .Add("@CveUsuario", SqlDbType.Int).Value = pCveUsuario .Add("@IEPSPS", SqlDbType.Money).Value = IEPSPS .Add("@IEPSPSIVA", SqlDbType.Money).Value = IEPSPSIVA - .Add("@IVA", SqlDbType.Float).Value = IVA - .Add("@RetIVA", SqlDbType.Float).Value = RetIVA - .Add("@RetISR", SqlDbType.Float).Value = RetISR - .Add("@Total", SqlDbType.Float).Value = Total + .Add("@IVA", SqlDbType.Decimal).Value = IVA + .Add("@RetIVA", SqlDbType.Decimal).Value = RetIVA + .Add("@RetISR", SqlDbType.Decimal).Value = RetISR + .Add("@Total", SqlDbType.Decimal).Value = Total .Add("@CveContratoDetalle", SqlDbType.Int).Value = CveContratoDetalle - .Add("@IVAPorcentaje", SqlDbType.Float).Value = IVAPorcentaje - .Add("@RetIVAPorcentaje", SqlDbType.Float).Value = RetIVAPorcentaje - .Add("@RetISRPorcentaje", SqlDbType.Float).Value = RetISRPorcentaje - .Add("@IEPSPSPorcentaje", SqlDbType.Float).Value = IEPSPSPorcentaje - .Add("@IEPSPSIVAPorcentaje", SqlDbType.Float).Value = IEPSPSIVAPorcentaje + .Add("@IVAPorcentaje", SqlDbType.Decimal).Value = IVAPorcentaje + .Add("@RetIVAPorcentaje", SqlDbType.Decimal).Value = RetIVAPorcentaje + .Add("@RetISRPorcentaje", SqlDbType.Decimal).Value = RetISRPorcentaje + .Add("@IEPSPSPorcentaje", SqlDbType.Decimal).Value = IEPSPSPorcentaje + .Add("@IEPSPSIVAPorcentaje", SqlDbType.Decimal).Value = IEPSPSIVAPorcentaje .Add("@CveTipoGastoObra", SqlDbType.Int).Value = CveTipoGastoObra End With @@ -2412,7 +2294,7 @@ Public Class ClsOC Return Retorno End Function - Public Function AddSolicitudAnticipo(CveOrdenCompra As Integer, Importe As Double, CveEmpresa As Integer) As Boolean + Public Function AddSolicitudAnticipo(CveOrdenCompra As Integer, Importe As Decimal, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_OC_SolicitudAnticipoAdd") @@ -2496,16 +2378,16 @@ Public Class ClsOC End Function #Region " OC DETALLE - SALDOS [ SURTIDO INV | VINCULADO COMP ]" - Public Function OrdenesCompraDetalleSaldosInvCompraAdd(CveOCDetalle As Integer, CveInvDetalle As Integer, CantidadSurtida As Double, CveCompraDetalle As Integer, CantidadVinculada As Double) As Boolean + Public Function OrdenesCompraDetalleSaldosInvCompraAdd(CveOCDetalle As Integer, CveInvDetalle As Integer, CantidadSurtida As Decimal, CveCompraDetalle As Integer, CantidadVinculada As Decimal) As Boolean Dim Retorno As Boolean = False DataAdapter("OC_OrdenesCompraDetalleSaldosInvCompraAdd") With SqlAdapter.SelectCommand.Parameters .Add("@CveOCDetalle", SqlDbType.Int).Value = CveOCDetalle .Add("@CveInvDetalle", SqlDbType.Int).Value = CveInvDetalle - .Add("@CantidadSurtida", SqlDbType.Float).Value = CantidadSurtida + .Add("@CantidadSurtida", SqlDbType.Decimal).Value = CantidadSurtida .Add("@CveCompraDetalle", SqlDbType.Int).Value = CveCompraDetalle - .Add("@CantidadVinculada", SqlDbType.Float).Value = CantidadVinculada + .Add("@CantidadVinculada", SqlDbType.Decimal).Value = CantidadVinculada End With Try diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index ae57244f9..21be0f560 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -838,7 +838,7 @@ Public Class ClsVentas Return Retorno End Function - Public Function UpdateEstatusVenta(CveVenta As Integer, CveEstatusFactura As Integer, CveEmpresa As Integer, Optional Num2 As Integer = -1) As Boolean + Public Function UpdateEstatusVenta(CveVenta As Integer, CveEstatusFactura As Integer, CveEmpresa As Integer, Optional Num2 As Integer = -1, Optional CveEstatusRefacturacion As Integer = -1, Optional CveMotivoCancelacion As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_VentasEstatusUpdate") @@ -848,6 +848,8 @@ Public Class ClsVentas .Add("@CveEstatusFactura", SqlDbType.Int).Value = CveEstatusFactura .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@Num2", SqlDbType.Float).Value = Num2 + .Add("@CveEstatusRefacturacion", SqlDbType.Int).Value = CveEstatusRefacturacion + .Add("@CveMotivoCancelacion", SqlDbType.Int).Value = CveMotivoCancelacion End With Try diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index b49be482e..e6fbe82fd 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -4845,7 +4845,8 @@ Namespace Modelos End If 'SI YA ESTA TIMBRADA, NUEVO PROCESO REFACTURACION, ASIGNA LA CANCELACION PENDIENTE - If EsRefacturacion AndAlso Me.CveEstatusFactura = 3 AndAlso CveMotivoCancelacion > 0 Then + 'EL ESTATUS REFACTURACION 4 ES PARA LAS QUE NO SE PUDIERON CANCELAR, DEBE OBLIGAR A CANCELAR ANTE EL SAT + If EsRefacturacion AndAlso Me.CveEstatusFactura = 3 AndAlso CveMotivoCancelacion > 0 AndAlso CveEstatusRefacturacion <> 4 Then CveEstatusFacturaAsignado = 23 End If diff --git a/Bancos/DepositosCaja.aspx b/Bancos/DepositosCaja.aspx index abcf5dcf1..028df676e 100644 --- a/Bancos/DepositosCaja.aspx +++ b/Bancos/DepositosCaja.aspx @@ -562,8 +562,8 @@ function txtSumaTntermediario(txt) { var comision2 = ToDouble($('#C_TxtComisionIntermediario').val()); if (comision2 > ValorTotalSeleccionado) { - $('#C_TxtComisionIntermediario').val(ComisionIntermediario); - alert("No es posible poner un importe superior a lo seleccionado"); + //$('#C_TxtComisionIntermediario').val(ComisionIntermediario); + //alert("No es posible poner un importe superior a lo seleccionado"); } else { saldo = ValorTotalSeleccionado - descuento + comision - comision2 - IVA; $('#C_lblValorTotal').text(FormatoNumero(saldo, 2)); diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 52bbddd73..399a06781 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -2149,18 +2149,8 @@ Partial Class Compras_Compras Private Sub CargaRetIVAConcepto(Optional Cambio As Boolean = False) - - - - If TrRetIVA.Visible Then TdRetIVAConcepto.Visible = True - - - - - - End If If Cambio Then @@ -2174,15 +2164,12 @@ Partial Class Compras_Compras End If DdlRetIVAConcepto.Items.Add(New ListItem("Arrendamiento", "4")) - - 'If UsuarioActual.Empresa.Funcionalidad(577).ToEntero = 1 Then - DdlRetIVAConcepto.Items.Add(New ListItem("Ret IVA Servicios", "5")) - 'End If - + ''If UsuarioActual.Empresa.Funcionalidad(577).ToEntero = 1 Then + 'DdlRetIVAConcepto.Items.Add(New ListItem("Ret IVA Servicios", "5")) + ''End If End If - UpPS.Update() End Sub @@ -5262,7 +5249,7 @@ Partial Class Compras_Compras 'QUEMA SALDOS DE INV-COMPRA | MERCANCIA RECIBIDA POR ADELANTADO (OC) | PP 176 If OCVinculada And Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" Then For Each Row As DataRow In TmpDT.FiltraParametros("CveTipoPS = 2").Rows - If Not ObjOC.OrdenesCompraDetalleSaldosInvCompraAdd(Row("CveOrdenCompraDetalle").ToString.ToEntero, -1, -1, Row("CveCompraDetalle").ToString.ToEntero, Row("Cantidad").ToString.ToDouble) Then + If Not ObjOC.OrdenesCompraDetalleSaldosInvCompraAdd(Row("CveOrdenCompraDetalle").ToString.ToEntero, -1, -1, Row("CveCompraDetalle").ToString.ToEntero, Row("Cantidad").ToString.ToDecimal) Then ErrorSaldosInvComp = True Exit For End If diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index 70fed873b..e18d8db03 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -1011,14 +1011,17 @@ Partial Class PopUpVerFactura Dim Usuario As String = $" Usuario: {Nombre}" If DtCortesVentas.Rows.Count > 0 Or DtCortesVentasResumen.Rows.Count > 0 Then Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) - Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + + + 'params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, ImageToBase64(Drawing.Image.FromFile(Imagen.FullName), Drawing.Imaging.ImageFormat.Png), ""))) + Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) Dim params As New List(Of ReportParameter) params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString)) params.Add(New ReportParameter("AgrupoPor", $"{FechaCorte}{Usuario}")) If Imagen.Exists Then - params.Add(New ReportParameter("LogoPath", logouri)) + params.Add(New ReportParameter("LogoPath", LogoRuta)) Else params.Add(New ReportParameter("LogoPath", "")) End If @@ -1124,7 +1127,7 @@ Partial Class PopUpVerFactura Private Sub ImprimeGastoContrato(CveContrato As Integer, CveContratoGasto As Integer) Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) - Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + 'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) Dim Dr As DataRow = Nothing Dim ObjContratos As New ClsContratos @@ -1158,7 +1161,9 @@ Partial Class PopUpVerFactura End If params.Add(New ReportParameter("Utilidad", $"$ {(SumaUtilidad - SumaGasto).ToString.FormatoNumero()}")) If Imagen.Exists Then - params.Add(New ReportParameter("LogoPath", logouri)) + + Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) + params.Add(New ReportParameter("LogoPath", LogoRuta)) Else params.Add(New ReportParameter("LogoPath", "")) End If @@ -1306,14 +1311,9 @@ Partial Class PopUpVerFactura If Dt.Rows.Count > 0 Then Dim params As New List(Of ReportParameter) Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) - Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) - - 'params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, ImageToBase64(Drawing.Image.FromFile(Imagen.FullName), Drawing.Imaging.ImageFormat.Png), ""))) Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) - - If Imagen.Exists Then params.Add(New ReportParameter("LogoPath", LogoRuta)) Else @@ -1733,7 +1733,7 @@ Partial Class PopUpVerFactura If DtConceptos.Rows.Count > 0 Then Dim params As New List(Of ReportParameter) Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) - Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + 'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) If Imagen.Exists Then Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) @@ -3250,8 +3250,15 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("NombreEntrego", Personal)) params.Add(New ReportParameter("Responsable", Personal)) params.Add(New ReportParameter("NombreRecibio", Capturo.ToUpper)) - Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) - params.Add(New ReportParameter("LogoPath", logouri)) + 'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) + If Imagen.Exists Then + Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) + params.Add(New ReportParameter("LogoPath", LogoRuta)) + Else + params.Add(New ReportParameter("LogoPath", "")) + End If + If DtMovimientos.COUNT("Serie") > 0 Then params.Add(New ReportParameter("MostrarSerieLote", "1")) Else @@ -3336,8 +3343,14 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("NombreEntrego", Capturo.ToUpper)) params.Add(New ReportParameter("Responsable", Personal)) params.Add(New ReportParameter("NombreRecibio", Personal)) - Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) - params.Add(New ReportParameter("LogoPath", logouri)) + 'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) + If Imagen.Exists Then + Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) + params.Add(New ReportParameter("LogoPath", LogoRuta)) + Else + params.Add(New ReportParameter("LogoPath", "")) + End If If DtMovimientos.COUNT("Serie") > 0 Then params.Add(New ReportParameter("MostrarSerieLote", "1")) Else @@ -4775,7 +4788,8 @@ Partial Class PopUpVerFactura End If Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) - Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + 'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + 'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) If Not ReporteEmpresa.Exists Then params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) @@ -4783,7 +4797,8 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString)) If Imagen.Exists Then - params.Add(New ReportParameter("LogoPath", logouri)) + Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) + params.Add(New ReportParameter("LogoPath", LogoRuta)) Else params.Add(New ReportParameter("LogoPath", "")) End If @@ -4979,10 +4994,9 @@ Partial Class PopUpVerFactura ObjAF.Dispose() Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) - Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) - If Imagen.Exists Then - params.Add(New ReportParameter("LogoPath", logouri)) + Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) + params.Add(New ReportParameter("LogoPath", LogoRuta)) Else params.Add(New ReportParameter("LogoPath", "")) End If @@ -6070,7 +6084,9 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("CodigoTD", CodigoTD)) If Imagen.Exists Then - params.Add(New ReportParameter("LogoPath", logouri)) + + Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) + params.Add(New ReportParameter("LogoPath", LogoRuta)) Else params.Add(New ReportParameter("LogoPath", "")) End If @@ -6128,7 +6144,7 @@ Partial Class PopUpVerFactura ObjPS.Dispose() Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) - Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + 'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) Dim DtDatos As New DataTable Dim params As New List(Of ReportParameter) @@ -6207,7 +6223,9 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("CodigoTD", CodigoTD)) If Imagen.Exists Then - params.Add(New ReportParameter("LogoPath", logouri)) + + Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) + params.Add(New ReportParameter("LogoPath", LogoRuta)) Else params.Add(New ReportParameter("LogoPath", "")) End If diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index e5bf7f1a8..d3aa6c1f6 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -1777,7 +1777,7 @@ Partial Class Inventarios_EntradasSalidas If OrigenMov = 1 Then TipoMovtoAlmacen = False Else TipoMovtoAlmacen = True TipoMovtoOtro = Not TipoMovtoAlmacen - Dim CveConceptoContable As Integer = 78 + Dim CveConceptoContable As Integer = 260 Dim CveClasificacion As Integer = -1 Select Case DdlConcepto.SelectedValue.ToEntero Case 28, 31 diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb index 39c4acfad..2c7a86278 100644 --- a/Inventarios/RecepcionAlmacen.aspx.vb +++ b/Inventarios/RecepcionAlmacen.aspx.vb @@ -533,11 +533,7 @@ Partial Class Inventarios_RecepcionAlmacen Private Sub CargaAlmacenes(CveSubProyecto As Integer, Optional CveTiposAlmacen As String = "", Optional CveTipoCompra As Integer = -1) Dim StrAlmacenes As String = "" - If UsuarioActual.CveSubProyecto = 8804 Then 'AGS - StrAlmacenes = $"CveTipoAlmacen IN ({If(CveTiposAlmacen.Length > 0, CveTiposAlmacen, "1,2,12,15")}) {If(CveSubProyecto > 0, $"And CveSubProyecto = {CveSubProyecto}", "")}" - Else - StrAlmacenes = $"CveTipoAlmacen IN ({If(CveTiposAlmacen.Length > 0, CveTiposAlmacen, "1,2,15,14")}) {If(CveSubProyecto > 0, $"And CveSubProyecto = {CveSubProyecto}", "")}" - End If + StrAlmacenes = $"CveTipoAlmacen IN ({If(CveTiposAlmacen.Length > 0, CveTiposAlmacen, "1,2,15,14,19")}) {If(CveSubProyecto > 0, $"And CveSubProyecto = {CveSubProyecto}", "")}" If CveTipoCompra = 10 Then StrAlmacenes = $"Modalidad = 0" @@ -3693,7 +3689,7 @@ Partial Class Inventarios_RecepcionAlmacen If Not ErrorMovInv And CveOCSurtir > 0 Then If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then For Each Dr As DataRow In ObjInventario.DtResultados.Rows - If Not ObjOC.OrdenesCompraDetalleSaldosInvCompraAdd(Dr("CveOrdenCompraDetalle").ToString.ToEntero, Dr("CveMovimientoDetalle").ToString.ToEntero, Dr("Cantidad").ToString.ToDouble, -1, -1) Then + If Not ObjOC.OrdenesCompraDetalleSaldosInvCompraAdd(Dr("CveOrdenCompraDetalle").ToString.ToEntero, Dr("CveMovimientoDetalle").ToString.ToEntero, Dr("Cantidad").ToString.ToDecimal, -1, -1) Then ErrorMovInv = True Exit For End If diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb index d9425c0b0..ea04c720e 100644 --- a/OC/OC.aspx.vb +++ b/OC/OC.aspx.vb @@ -518,32 +518,32 @@ Partial Class OC Private Property NumRow As Integer - Private Property SaldoOCAnticipo As Double + Private Property SaldoOCAnticipo As Decimal Get If ViewState("SaldoOCAnticipo") Is Nothing Then Return 0 Else - Return ViewState("SaldoOCAnticipo").ToString.ToDouble + Return ViewState("SaldoOCAnticipo").ToString.ToDecimal End If End Get - Set(value As Double) + Set(value As Decimal) ViewState("SaldoOCAnticipo") = value End Set End Property - Private Property ImporteAnticipos As Double + Private Property ImporteAnticipos As Decimal Get If ViewState("ImporteAnticipos") Is Nothing Then Return 0 Else - Return ViewState("ImporteAnticipos").ToString.ToDouble + Return ViewState("ImporteAnticipos").ToString.ToDecimal End If End Get - Set(value As Double) + Set(value As Decimal) ViewState("ImporteAnticipos") = value End Set End Property @@ -924,18 +924,18 @@ Partial Class OC Exit Sub End If - If Math.Round(DdlIVA.SelectedValue.ToDouble, 2) = 1 Then + If Math.Round(DdlIVA.SelectedValue.ToDecimal, 2) = 1 Then Alert("Para aplicar un IVA, debe de seleccionar un porcentaje en el combo de IVA.", TipoMensaje.MsgAdvertencia) TxtIVA.Text = "0.00" CalculaGenerales() Exit Sub End If - Dim Total As Double = 0 + Dim Total As Decimal = 0 For Each Dr As DataRow In DtDetalle.Rows Dim DrPS = GlobalDTPS(CveEmpresaActual, CvePS:=Dr("CvePS").ToString.ToEntero).FiltroPrimero("") If DrPS IsNot Nothing AndAlso DrPS("IVA").ToString.ToEntero = -1 Then - Total += Dr("Total").ToString.ToDouble + Total += Dr("Total").ToString.ToDecimal End If Next @@ -1056,21 +1056,21 @@ Partial Class OC Private Sub CreaDTDetalles() DtDetalle = New DataTable - DtDetalle.Columns.Add("Cantidad", GetType(Double)) + DtDetalle.Columns.Add("Cantidad", GetType(Decimal)) DtDetalle.Columns.Add("CveUnidadMedida", GetType(Integer)) DtDetalle.Columns.Add("UM", GetType(String)) DtDetalle.Columns.Add("CvePS", GetType(Integer)) DtDetalle.Columns.Add("PS", GetType(String)) - DtDetalle.Columns.Add("IVA", GetType(Double)) - DtDetalle.Columns.Add("IVAPorcentaje", GetType(Double)) - DtDetalle.Columns.Add("IEPSPS", GetType(Double)) - DtDetalle.Columns.Add("IEPSPSPorcentaje", GetType(Double)) - DtDetalle.Columns.Add("IEPSPSIVA", GetType(Double)) - DtDetalle.Columns.Add("IEPSPSIVAPorcentaje", GetType(Double)) - DtDetalle.Columns.Add("RetIVA", GetType(Double)) - DtDetalle.Columns.Add("RetIVAPorcentaje", GetType(Double)) - DtDetalle.Columns.Add("RetISR", GetType(Double)) - DtDetalle.Columns.Add("RetISRPorcentaje", GetType(Double)) + DtDetalle.Columns.Add("IVA", GetType(Decimal)) + DtDetalle.Columns.Add("IVAPorcentaje", GetType(Decimal)) + DtDetalle.Columns.Add("IEPSPS", GetType(Decimal)) + DtDetalle.Columns.Add("IEPSPSPorcentaje", GetType(Decimal)) + DtDetalle.Columns.Add("IEPSPSIVA", GetType(Decimal)) + DtDetalle.Columns.Add("IEPSPSIVAPorcentaje", GetType(Decimal)) + DtDetalle.Columns.Add("RetIVA", GetType(Decimal)) + DtDetalle.Columns.Add("RetIVAPorcentaje", GetType(Decimal)) + DtDetalle.Columns.Add("RetISR", GetType(Decimal)) + DtDetalle.Columns.Add("RetISRPorcentaje", GetType(Decimal)) DtDetalle.Columns.Add("Observacion", GetType(String)) DtDetalle.Columns.Add("CveClasificacion", GetType(Integer)) DtDetalle.Columns.Add("Clasificacion", GetType(String)) @@ -1081,9 +1081,9 @@ Partial Class OC DtDetalle.Columns.Add("Proyecto", GetType(String)) DtDetalle.Columns.Add("CveSubProyecto", GetType(Integer)) DtDetalle.Columns.Add("SubProyecto", GetType(String)) - DtDetalle.Columns.Add("Importe", GetType(Double)) - DtDetalle.Columns.Add("Descuento", GetType(Double)) - DtDetalle.Columns.Add("Total", GetType(Double)) + DtDetalle.Columns.Add("Importe", GetType(Decimal)) + DtDetalle.Columns.Add("Descuento", GetType(Decimal)) + DtDetalle.Columns.Add("Total", GetType(Decimal)) DtDetalle.Columns.Add("Codigo", GetType(String)) DtDetalle.Columns.Add("CodigoAF", GetType(String)) @@ -1112,7 +1112,7 @@ Partial Class OC DtDetalle.Columns.Add("CveProveedor", GetType(Integer)) DtDetalle.Columns.Add("CveContratoDetalle", GetType(Integer)) - DtDetalle.Columns.Add("CantidadNoEditable", GetType(Double)) + DtDetalle.Columns.Add("CantidadNoEditable", GetType(Decimal)) DtDetalle.Columns.Add("CveVentaDetalleCotizacion", GetType(Integer)) @@ -1146,15 +1146,15 @@ Partial Class OC dr("CvePS") = RowV("CvePS") dr("PS") = RowV("CodigoPS") dr("IVA") = 0 - dr("IVAPorcentaje") = DrPS("IVA").ToString.ToDouble + dr("IVAPorcentaje") = DrPS("IVA").ToString.ToDecimal dr("RetIVA") = 0 - dr("RetIVAPorcentaje") = DrPS("RetIVA").ToString.ToDouble + dr("RetIVAPorcentaje") = DrPS("RetIVA").ToString.ToDecimal dr("RetISR") = 0 - dr("RetISRPorcentaje") = DrPS("RetISR").ToString.ToDouble + dr("RetISRPorcentaje") = DrPS("RetISR").ToString.ToDecimal dr("IEPSPS") = 0 - dr("IEPSPSPorcentaje") = DrPS("IEPSPorcentaje").ToString.ToDouble + dr("IEPSPSPorcentaje") = DrPS("IEPSPorcentaje").ToString.ToDecimal dr("IEPSPSIVA") = 0 - dr("IEPSPSIVAPorcentaje") = If(DrPS("IEPSGrabaIVA").ToString = "True", DrPS("IEPSPorcentaje").ToString.ToDouble, 0) + dr("IEPSPSIVAPorcentaje") = If(DrPS("IEPSGrabaIVA").ToString = "True", DrPS("IEPSPorcentaje").ToString.ToDecimal, 0) dr("Observacion") = RowV("Obs") dr("CveClasificacion") = RowV("CveClasificacion") dr("Clasificacion") = RowV("Clasificacion") @@ -1377,7 +1377,7 @@ Partial Class OC TxtJustificacion.Text = objOC.Justificacion DdlMoneda.SelectedValueExist(objOC.CveMoneda.ToString) MonedaTexto = DdlMoneda.SelectedItem.Text - Select Case objOC.PorcentajeIVA.ToString.ToDouble + Select Case objOC.PorcentajeIVA.ToString.ToDecimal Case 0 DdlIVA.SelectedValue = "1" Case 0.16 @@ -1385,7 +1385,7 @@ Partial Class OC Case 0.08 DdlIVA.SelectedValue = "1.08" End Select - 'If objOC.PorcentajeIVA.ToString.ToDouble = 0 Then DdlIVA.SelectedValue = "1" Else DdlIVA.SelectedValue = "1.16" + 'If objOC.PorcentajeIVA.ToString.ToDecimal = 0 Then DdlIVA.SelectedValue = "1" Else DdlIVA.SelectedValue = "1.16" DdlPrioridad.SelectedValueExist(objOC.Prioridad.ToString) ChkCotizacion.Checked = objOC.RequiereCotizacion @@ -1654,7 +1654,11 @@ Partial Class OC UPProv.Update() End If - If objOC.CveEstatus = 0 Then CboE.Items.Add(New ListItem("Pre Solicitud", "0")) + If objOC.CveEstatus = 0 Then + CboE.Items.Add(New ListItem("Pre Solicitud", "0")) + ElseIf objOC.TipoTermino = 0 AndAlso objOC.Tipo = "REQ" Then ' no autorizada, está en proceso + CboE.Items.Add(New ListItem("Pre Solicitud", "0")) + End If CboE.SelectedValueExist(objOC.CveEstatus.ToString) 'es decir, si tiene permiso por ser el usuario que aprueba en el estatus actual o tiene el permiso para cancelar en el catalogo @@ -2144,21 +2148,21 @@ Partial Class OC 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 + Dim Autorizado As Decimal = 0 + Dim Ejercido As Decimal = 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 + Autorizado = ObjCon.DtResultados.FiltraParametros($"CveClasificacion = {DdlClasificacion.SelectedValue.ToEntero} AND Importe > 0").Rows(0)("Importe").ToString.ToDecimal 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 + Ejercido = ObjCon.DtResultados.Rows(0)("Ejercido").ToString.ToDecimal End If End If End If @@ -2167,7 +2171,7 @@ Partial Class OC 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 + Dim Diferencia As Decimal = (Ejercido + If(txtPrecioUnitario.Text.ToDecimal > 0, (txtPrecioUnitario.Text.ToDecimal * TxtCant.Text.ToDecimal) - TxtDescuentoAdd.Text.ToDecimal, 0)) - Autorizado If Diferencia > 0 Then Alert($"No hay presupuesto disponible en el subproyecto {DdlSubProyecto.SelectedItem.Text} y la clasificación {DdlClasificacion.SelectedItem.Text} se excede por {Diferencia.FormatoNumero}", TipoMensaje.MsgAdvertencia) Exit Sub @@ -2176,22 +2180,22 @@ Partial Class OC 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 + Dim RetISR As Decimal = DrPS("RetISR").ToString.ToDecimal + Dim RetIVA As Decimal = DrPS("RetIVA").ToString.ToDecimal + Dim IvaPS As Decimal = DrPS("IVA").ToString.ToDecimal 'If IvaPS = -1 Then 'IVA DE LA SUCURSAL - ' IvaPS = GlobalDTSubProyectos(-1, DdlSubProyecto.SelectedValue.ToEntero).FiltroPrimeroValor("IVA").ToDouble + ' IvaPS = GlobalDTSubProyectos(-1, DdlSubProyecto.SelectedValue.ToEntero).FiltroPrimeroValor("IVA").ToDecimal '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 IEPSPS As Decimal = DrPS("IEPSPorcentaje").ToString.ToDecimal + Dim IEPSPSIVA As Decimal = If(DrPS("IEPSGrabaIVA").ToString = "True", DrPS("IEPSPorcentaje").ToString.ToDecimal, 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 TotalPS As Decimal = If(txtPrecioUnitario.Text.ToDecimal > 0, (txtPrecioUnitario.Text.ToDecimal * TxtCant.Text.ToDecimal) - TxtDescuentoAdd.Text.ToDecimal, 0) + Dim ImportePS As Decimal = If(txtPrecioUnitario.Text.ToDecimal > 0, txtPrecioUnitario.Text.ToDecimal, 0) Dim CveOrdenCompraDetalle As Integer = DtDetalle.MAX("CveOrdenCompraDetalle").ToEntero + 100 Dim CantidadVentaMinima As Decimal = DrPS("VentaMinima").ToString.ToDecimal @@ -2204,41 +2208,41 @@ Partial Class OC '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 + IvaPS = 0 + End If - AddPS(TxtCant.Text, DdlP2.SelectedValue.ToEntero, DdlP2.SelectedText, TxtObsPS.Text, ImportePS, TxtDescuentoAdd.Text.ToDouble, TotalPS, + AddPS(TxtCant.Text, DdlP2.SelectedValue.ToEntero, DdlP2.SelectedText, TxtObsPS.Text, ImportePS, TxtDescuentoAdd.Text.ToDecimal, 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() + 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" + Total.Text = "0.00" + TxtDescuentoAdd.Text = "0.00" - End If + End If - CargaSuperior() + 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, + Private Sub AddPS(Cantidad As String, CvePS As Integer, PS As String, Observaciones As String, Importe As Decimal, Descuento As Decimal, Total As Decimal, CveUnidadMedida As Integer, IVAPS As Decimal, IEPSPS As Decimal, IEPSPSIVA As Decimal, 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, CveOrdenCompraDetalle As Integer, CveOrdenCompra As Integer, IdCuentaPorEjercer As Integer, IdCuentaComprometido As Integer, CveProgramaOperativo As Integer, CveUnidadAdministrativa As Integer, - CveFuenteFinanciamiento As Integer, CveTipoGasto As Integer, CveClasificacionOG As Integer, RetIVA As Double, RetISR As Double, Optional CveContratoDetalle As Integer = -1, Optional CveTipoGastoObra As Integer = -1, Optional CveCultivoCuadroDetalle As Integer = -1, + CveFuenteFinanciamiento As Integer, CveTipoGasto As Integer, CveClasificacionOG As Integer, RetIVA As Decimal, RetISR As Decimal, Optional CveContratoDetalle As Integer = -1, Optional CveTipoGastoObra As Integer = -1, Optional CveCultivoCuadroDetalle As Integer = -1, Optional Cuadro As String = "") If DtDetalle IsNot Nothing Then @@ -2256,10 +2260,10 @@ Partial Class OC dr("IEPSPS") = Math.Round(IEPSPS * Total, 2) dr("IEPSPSIVAPorcentaje") = IEPSPSIVA dr("IEPSPSIVA") = Math.Round(IEPSPSIVA * Total, 2) - dr("IVAPorcentaje") = If(IVAPS = -1, Math.Round(DdlIVA.SelectedValue.ToDouble - 1, 2), IVAPS) + dr("IVAPorcentaje") = If(IVAPS = -1, Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2), IVAPS) Dim TotalGravado As Decimal = Total If IEPSPSIVA > 0 Then TotalGravado = Total * (1 + IEPSPSIVA) 'grava para iva, el importe del IEPS - dr("IVA") = Math.Round(dr("IVAPorcentaje").ToString.ToDouble * TotalGravado, 2) + dr("IVA") = Math.Round(dr("IVAPorcentaje").ToString.ToDecimal * TotalGravado, 2) dr("RetIVAPorcentaje") = RetIVA dr("RetIVA") = Math.Round(RetIVA * Total, 2) dr("RetISRPorcentaje") = RetISR @@ -2588,19 +2592,19 @@ Partial Class OC If Not TieneError Then ' AGREGAR REQUISICION If OC.AddOrdenCompra("REQ", -1, TxtDescrip.Text, TxtJustificacion.Text, DdlPrioridad.SelectedValue.ToEntero, TxtFecha.Text.ToDate, DdlMoneda.SelectedValue.ToEntero, CboE.SelectedValue.ToEntero, If(TxtFechaEstimadaEntrega.Text.Trim = "", "-1", TxtFechaEstimadaEntrega.Text.Trim), LugarEntrega, UsuarioActual.CveUsuario, CveEmpresaActual, GvD.Rows(0).FCHiddenField("HdnCvePresupuestoEgreso").Value.ToString.ToEntero, pCveProveedor:=CveProveedor, pCveProveedorSucursal:=CveProveedorSucursal, - RequiereCotizacion:=ChkCotizacion.Checked, CveCliente:=Ddlcliente.txtValue.Value.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PrioridadObservacion:=txtobsprioridad.Text, PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDouble - 1, 2), IVA:=IVA, RetIVA:=TxtRetIVA.Text.ToDecimal, + RequiereCotizacion:=ChkCotizacion.Checked, CveCliente:=Ddlcliente.txtValue.Value.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PrioridadObservacion:=txtobsprioridad.Text, PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2), IVA:=IVA, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, CveCotizacion:=CveCotizacion, FolioAdicional:=TxtFolioAdicional.Text, EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), Guia:=TxtGuia.Text.Trim, IEPS:=TxtIEPS.Text.ToDecimal, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero, Promocion:=Promocion, CveProveedorContacto:=CveProveedorContacto) Then CveOrdenCompraPadre = OC.CveOrdenCompra If CveOrdenCompraPadre > 0 Then For Each dr As DataRow In DtDetalle.Rows - If Not OC.AddOrdenCompraDetalle(CveOrdenCompraPadre, dr("Cantidad").ToString.ToDouble(), dr("CveUnidadMedida").ToString.ToEntero, dr("CvePS").ToString.ToEntero, dr("Importe").ToString.ToDouble, - dr("CveSubProyecto").ToString.ToEntero(), dr("CveActivoFijo").ToString.ToEntero, dr("Observacion").ToString, UsuarioActual.CveUsuario, Descuento:=dr("Descuento").ToString.ToDouble, - IEPSPS:=dr("IEPSPS").ToString.ToDouble, IEPSPSIVA:=dr("IEPSPSIVA").ToString.ToDouble, IVA:=dr("IVA").ToString.ToDouble, RetIVA:=dr("RetIVA").ToString.ToDouble, - RetISR:=dr("RetISR").ToString.ToDouble, Total:=dr("Total").ToString.ToDouble, CveContratoDetalle:=dr("CveContratoDetalle").ToString.ToEntero, IVAPorcentaje:=dr("IVAPorcentaje").ToString.ToDouble, - RetIVAPorcentaje:=dr("RetIVAPorcentaje").ToString.ToDouble, RetISRPorcentaje:=dr("RetISRPorcentaje").ToString.ToDouble, IEPSPSPorcentaje:=dr("IEPSPSPorcentaje").ToString.ToDouble, - IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDouble, CveTipoGastoObra:=dr("CveTipoGastoObra").ToString.ToEntero, CveCultivoCuadroDetalle:=dr("CveCultivoCuadroDetalle").ToString.ToEntero) Then + If Not OC.AddOrdenCompraDetalle(CveOrdenCompraPadre, dr("Cantidad").ToString.ToDecimal(), dr("CveUnidadMedida").ToString.ToEntero, dr("CvePS").ToString.ToEntero, dr("Importe").ToString.ToDecimal, + dr("CveSubProyecto").ToString.ToEntero(), dr("CveActivoFijo").ToString.ToEntero, dr("Observacion").ToString, UsuarioActual.CveUsuario, Descuento:=dr("Descuento").ToString.ToDecimal, + IEPSPS:=dr("IEPSPS").ToString.ToDecimal, IEPSPSIVA:=dr("IEPSPSIVA").ToString.ToDecimal, IVA:=dr("IVA").ToString.ToDecimal, RetIVA:=dr("RetIVA").ToString.ToDecimal, + RetISR:=dr("RetISR").ToString.ToDecimal, Total:=dr("Total").ToString.ToDecimal, CveContratoDetalle:=dr("CveContratoDetalle").ToString.ToEntero, IVAPorcentaje:=dr("IVAPorcentaje").ToString.ToDecimal, + RetIVAPorcentaje:=dr("RetIVAPorcentaje").ToString.ToDecimal, RetISRPorcentaje:=dr("RetISRPorcentaje").ToString.ToDecimal, IEPSPSPorcentaje:=dr("IEPSPSPorcentaje").ToString.ToDecimal, + IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDecimal, CveTipoGastoObra:=dr("CveTipoGastoObra").ToString.ToEntero, CveCultivoCuadroDetalle:=dr("CveCultivoCuadroDetalle").ToString.ToEntero) Then TieneError = True Exit For End If @@ -2623,7 +2627,7 @@ Partial Class OC If OC.AddOrdenCompra(If(TipoOS, "OS", TipoOC), -1, TxtDescrip.Text, TxtJustificacion.Text, DdlPrioridad.SelectedValue.ToEntero, TxtFecha.Text.ToDate, DdlMoneda.SelectedValue.ToEntero, CveEstatusNuevo, If(TxtFechaEstimadaEntrega.Text.Trim = "", "-1", TxtFechaEstimadaEntrega.Text.Trim), LugarEntrega, UsuarioActual.CveUsuario, CveEmpresaActual, GvD.Rows(0).FCHiddenField("HdnCvePresupuestoEgreso").Value.ToString.ToEntero, pCveProveedor:=CveProveedor, pCveProveedorSucursal:=CveProveedorSucursal, RequiereCotizacion:=ChkCotizacion.Checked, CveUsuarioAsignado:=DdlUsuariosAsignado.SelectedValue.ToEntero, CveCliente:=Ddlcliente.txtValue.Value.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PrioridadObservacion:=txtobsprioridad.Text, - PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDouble - 1, 2), IVA:=IVA, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, CveCotizacion:=CveCotizacion, FolioAdicional:=TxtFolioAdicional.Text, EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), + PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2), IVA:=IVA, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, CveCotizacion:=CveCotizacion, FolioAdicional:=TxtFolioAdicional.Text, EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), Guia:=TxtGuia.Text.Trim, IEPS:=TxtIEPS.Text.ToDecimal, CveIEAnticipo:=CveIEAnticipo, ImporteAnticipo:=ImporteAnticipos, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero, Promocion:=Promocion, CveProveedorContacto:=CveProveedorContacto) Then CveOrdenCompra = OC.CveOrdenCompra @@ -2674,11 +2678,11 @@ Partial Class OC For Each dr As DataRow In DtDetalle.Rows - If Not OC.AddOrdenCompraDetalle(CveOrdenCompra, dr("Cantidad").ToString.ToDouble(), dr("CveUnidadMedida").ToString.ToEntero, dr("CvePS").ToString.ToEntero, dr("Importe").ToString.ToDouble, dr("CveSubProyecto").ToString.ToEntero(), dr("CveActivoFijo").ToString.ToEntero, - dr("Observacion").ToString, UsuarioActual.CveUsuario, CvePresupuestoEgreso:=dr("CvePresupuestoEgreso").ToString.ToEntero, pCveOrdenCompraPadre:=CveOrdenCompraPadre, Descuento:=dr("Descuento").ToString.ToDouble, IEPSPS:=dr("IEPSPS").ToString.ToDouble, - IEPSPSIVA:=dr("IEPSPSIVA").ToString.ToDouble, IVA:=dr("IVA").ToString.ToDouble, RetIVA:=dr("RetIVA").ToString.ToDouble, RetISR:=dr("RetISR").ToString.ToDouble, Total:=dr("Total").ToString.ToDouble, CveContratoDetalle:=dr("CveContratoDetalle").ToString.ToEntero, - IVAPorcentaje:=dr("IVAPorcentaje").ToString.ToDouble, RetIVAPorcentaje:=dr("RetIVAPorcentaje").ToString.ToDouble, RetISRPorcentaje:=dr("RetISRPorcentaje").ToString.ToDouble, IEPSPSPorcentaje:=dr("IEPSPSPorcentaje").ToString.ToDouble, - IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDouble, CveVentaDetalleCotizacion:=dr("CveVentaDetalleCotizacion").ToString().ToEntero(), CveTipoGastoObra:=dr("CveTipoGastoObra").ToString.ToEntero, CveCultivoCuadroDetalle:=dr("CveCultivoCuadroDetalle").ToString.ToEntero) Then + If Not OC.AddOrdenCompraDetalle(CveOrdenCompra, dr("Cantidad").ToString.ToDecimal(), dr("CveUnidadMedida").ToString.ToEntero, dr("CvePS").ToString.ToEntero, dr("Importe").ToString.ToDecimal, dr("CveSubProyecto").ToString.ToEntero(), dr("CveActivoFijo").ToString.ToEntero, + dr("Observacion").ToString, UsuarioActual.CveUsuario, CvePresupuestoEgreso:=dr("CvePresupuestoEgreso").ToString.ToEntero, pCveOrdenCompraPadre:=CveOrdenCompraPadre, Descuento:=dr("Descuento").ToString.ToDecimal, IEPSPS:=dr("IEPSPS").ToString.ToDecimal, + IEPSPSIVA:=dr("IEPSPSIVA").ToString.ToDecimal, IVA:=dr("IVA").ToString.ToDecimal, RetIVA:=dr("RetIVA").ToString.ToDecimal, RetISR:=dr("RetISR").ToString.ToDecimal, Total:=dr("Total").ToString.ToDecimal, CveContratoDetalle:=dr("CveContratoDetalle").ToString.ToEntero, + IVAPorcentaje:=dr("IVAPorcentaje").ToString.ToDecimal, RetIVAPorcentaje:=dr("RetIVAPorcentaje").ToString.ToDecimal, RetISRPorcentaje:=dr("RetISRPorcentaje").ToString.ToDecimal, IEPSPSPorcentaje:=dr("IEPSPSPorcentaje").ToString.ToDecimal, + IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDecimal, CveVentaDetalleCotizacion:=dr("CveVentaDetalleCotizacion").ToString().ToEntero(), CveTipoGastoObra:=dr("CveTipoGastoObra").ToString.ToEntero, CveCultivoCuadroDetalle:=dr("CveCultivoCuadroDetalle").ToString.ToEntero) Then TieneError = True Exit For End If @@ -2789,7 +2793,7 @@ Partial Class OC LugarEntrega, DdlMoneda.SelectedValue.ToEntero, CveProveedor, CveOrdenCompra, UsuarioActual.CveUsuario, Ddlcliente.txtValue.Value.ToEntero, DdlVendedor.SelectedValue.ToEntero, txtobsprioridad.Text, IVA:=IVA, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, FolioAdicional:=TxtFolioAdicional.Text, EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), Guia:=TxtGuia.Text.Trim, IEPS:=TxtIEPS.Text.ToDecimal, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero, Promocion:=Promocion, pCveProveedorSucursal:=DdlProveedorSucursal.SelectedValue.ToEntero, CveProveedorContacto:=CveProveedorContacto, - PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDouble - 1, 2)) Then + PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2)) Then If CveProveedorOriginal <> CveProveedor Then If Not ObjConta.UpdateProveedorPoliza(CveOrdenCompra, CveProveedor, Proveedor) Then TieneError = True @@ -2814,7 +2818,7 @@ Partial Class OC 'inserto los nuevos detalles If Not TieneError Then For Each dr As DataRow In DtDetalle.FiltraParametros("TipoDato = 0").Rows - If Not OC.AddOrdenCompraDetalle(CveOrdenCompra, dr("Cantidad").ToString.ToDouble(), dr("CveUnidadMedida").ToString.ToEntero, dr("CvePS").ToString.ToEntero, dr("Importe").ToString.ToDouble, dr("CveSubProyecto").ToString.ToEntero, dr("CveActivoFijo").ToString.ToEntero, dr("Observacion").ToString, UsuarioActual.CveUsuario, CvePresupuestoEgreso:=If(TipoOC = "REQ", -1, dr("CvePresupuestoEgreso").ToString.ToEntero), Descuento:=dr("Descuento").ToString.ToDouble, IEPSPS:=dr("IEPSPS").ToString.ToDouble, IEPSPSIVA:=dr("IEPSPSIVA").ToString.ToDouble, IVA:=dr("IVA").ToString.ToDouble, RetIVA:=dr("RetIVA").ToString.ToDouble, RetISR:=dr("RetISR").ToString.ToDouble, Total:=dr("Total").ToString.ToDouble, CveContratoDetalle:=dr("CveContratoDetalle").ToString.ToEntero, IVAPorcentaje:=dr("IVAPorcentaje").ToString.ToDouble, RetIVAPorcentaje:=dr("RetIVAPorcentaje").ToString.ToDouble, RetISRPorcentaje:=dr("RetISRPorcentaje").ToString.ToDouble, IEPSPSPorcentaje:=dr("IEPSPSPorcentaje").ToString.ToDouble, IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDouble, CveTipoGastoObra:=dr("CveTipoGastoObra").ToString.ToEntero, CveCultivoCuadroDetalle:=dr("CveCultivoCuadroDetalle").ToString.ToEntero) Then + If Not OC.AddOrdenCompraDetalle(CveOrdenCompra, dr("Cantidad").ToString.ToDecimal(), dr("CveUnidadMedida").ToString.ToEntero, dr("CvePS").ToString.ToEntero, dr("Importe").ToString.ToDecimal, dr("CveSubProyecto").ToString.ToEntero, dr("CveActivoFijo").ToString.ToEntero, dr("Observacion").ToString, UsuarioActual.CveUsuario, CvePresupuestoEgreso:=If(TipoOC = "REQ", -1, dr("CvePresupuestoEgreso").ToString.ToEntero), Descuento:=dr("Descuento").ToString.ToDecimal, IEPSPS:=dr("IEPSPS").ToString.ToDecimal, IEPSPSIVA:=dr("IEPSPSIVA").ToString.ToDecimal, IVA:=dr("IVA").ToString.ToDecimal, RetIVA:=dr("RetIVA").ToString.ToDecimal, RetISR:=dr("RetISR").ToString.ToDecimal, Total:=dr("Total").ToString.ToDecimal, CveContratoDetalle:=dr("CveContratoDetalle").ToString.ToEntero, IVAPorcentaje:=dr("IVAPorcentaje").ToString.ToDecimal, RetIVAPorcentaje:=dr("RetIVAPorcentaje").ToString.ToDecimal, RetISRPorcentaje:=dr("RetISRPorcentaje").ToString.ToDecimal, IEPSPSPorcentaje:=dr("IEPSPSPorcentaje").ToString.ToDecimal, IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDecimal, CveTipoGastoObra:=dr("CveTipoGastoObra").ToString.ToEntero, CveCultivoCuadroDetalle:=dr("CveCultivoCuadroDetalle").ToString.ToEntero) Then TieneError = True Exit For Else @@ -2831,10 +2835,10 @@ Partial Class OC DtInvOCDiferencias.Columns.Add("CveOrdenCompraDetalle", GetType(Integer)) DtInvOCDiferencias.Columns.Add("CveAlmacen", GetType(Integer)) DtInvOCDiferencias.Columns.Add("CveMovimiento", GetType(Integer)) - DtInvOCDiferencias.Columns.Add("Diferencia", GetType(Double)) - DtInvOCDiferencias.Columns.Add("ImporteMovto", GetType(Double)) - DtInvOCDiferencias.Columns.Add("ImporteMovtoDLLS", GetType(Double)) - DtInvOCDiferencias.Columns.Add("TipoCambioAjuste", GetType(Double)) + DtInvOCDiferencias.Columns.Add("Diferencia", GetType(Decimal)) + DtInvOCDiferencias.Columns.Add("ImporteMovto", GetType(Decimal)) + DtInvOCDiferencias.Columns.Add("ImporteMovtoDLLS", GetType(Decimal)) + DtInvOCDiferencias.Columns.Add("TipoCambioAjuste", GetType(Decimal)) DtInvOCDiferencias.Columns.Add("ConceptoSalida", GetType(Integer)) DtInvOCDiferencias.Columns.Add("PS", GetType(String)) @@ -2844,9 +2848,9 @@ Partial Class OC If Not TieneError Then For Each dr As DataRow In DtDetalle.FiltraParametros("TipoDato IN (1)").Rows - If OC.UpdateOrdenCompraDetalle(dr("Cantidad").ToString.ToDouble, dr("CveUnidadMedida").ToString.ToEntero, dr("CvePS").ToString.ToEntero, dr("Importe").ToString.ToDouble, dr("CveSubProyecto").ToString.ToEntero, - dr("CveActivoFijo").ToString.ToEntero, dr("Observacion").ToString, UsuarioActual.CveUsuario, dr("CveOrdenCompraDetalle").ToString.ToEntero, If(TipoOC = "REQ", -1, dr("CvePresupuestoEgreso").ToString.ToEntero), dr("Descuento").ToString.ToDouble, - IEPSPS:=dr("IEPSPS").ToString.ToDouble, IEPSPSIVA:=dr("IEPSPSIVA").ToString.ToDouble, IVA:=dr("IVA").ToString.ToDouble, RetIVA:=dr("RetIVA").ToString.ToDouble, RetISR:=dr("RetISR").ToString.ToDouble, Total:=dr("Total").ToString.ToDouble, CveContratoDetalle:=dr("CveContratoDetalle").ToString.ToEntero, IVAPorcentaje:=dr("IVAPorcentaje").ToString.ToDouble, RetIVAPorcentaje:=dr("RetIVAPorcentaje").ToString.ToDouble, RetISRPorcentaje:=dr("RetISRPorcentaje").ToString.ToDouble, IEPSPSPorcentaje:=dr("IEPSPSPorcentaje").ToString.ToDouble, IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDouble) <= 0 Then + If OC.UpdateOrdenCompraDetalle(dr("Cantidad").ToString.ToDecimal, dr("CveUnidadMedida").ToString.ToEntero, dr("CvePS").ToString.ToEntero, dr("Importe").ToString.ToDecimal, dr("CveSubProyecto").ToString.ToEntero, + dr("CveActivoFijo").ToString.ToEntero, dr("Observacion").ToString, UsuarioActual.CveUsuario, dr("CveOrdenCompraDetalle").ToString.ToEntero, If(TipoOC = "REQ", -1, dr("CvePresupuestoEgreso").ToString.ToEntero), dr("Descuento").ToString.ToDecimal, + IEPSPS:=dr("IEPSPS").ToString.ToDecimal, IEPSPSIVA:=dr("IEPSPSIVA").ToString.ToDecimal, IVA:=dr("IVA").ToString.ToDecimal, RetIVA:=dr("RetIVA").ToString.ToDecimal, RetISR:=dr("RetISR").ToString.ToDecimal, Total:=dr("Total").ToString.ToDecimal, CveContratoDetalle:=dr("CveContratoDetalle").ToString.ToEntero, IVAPorcentaje:=dr("IVAPorcentaje").ToString.ToDecimal, RetIVAPorcentaje:=dr("RetIVAPorcentaje").ToString.ToDecimal, RetISRPorcentaje:=dr("RetISRPorcentaje").ToString.ToDecimal, IEPSPSPorcentaje:=dr("IEPSPSPorcentaje").ToString.ToDecimal, IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDecimal) <= 0 Then TieneError = True Exit For Else @@ -2856,12 +2860,12 @@ Partial Class OC Dim DrInvOCDiferencias As DataRow For Each DrInv As DataRow In DtInvOC.FiltraParametros($"CveOrdenCompraDetalle = {dr("CveOrdenCompraDetalle").ToString.ToEntero} AND CveCompraDetalle < 1").Rows DrInvOCDiferencias = DtInvOCDiferencias.NewRow - DrInvOCDiferencias("TipoCambioAjuste") = DrInv("TipoCambioAjuste").ToString.ToDouble - DrInvOCDiferencias("Diferencia") = ((dr("Importe").ToString.ToDouble * DrInv("TipoCambioAjuste").ToString.ToDouble) - DrInv("PUOriginal").ToString.ToDouble) * DrInv("Cantidad").ToString.ToDouble + DrInvOCDiferencias("TipoCambioAjuste") = DrInv("TipoCambioAjuste").ToString.ToDecimal + DrInvOCDiferencias("Diferencia") = ((dr("Importe").ToString.ToDecimal * DrInv("TipoCambioAjuste").ToString.ToDecimal) - DrInv("PUOriginal").ToString.ToDecimal) * DrInv("Cantidad").ToString.ToDecimal DrInvOCDiferencias("CveAlmacen") = DrInv("CveAlmacen").ToString.ToEntero DrInvOCDiferencias("CveOrdenCompraDetalle") = DrInv("CveOrdenCompraDetalle").ToString.ToEntero - DrInvOCDiferencias("ImporteMovto") = dr("Importe").ToString.ToDouble * DrInv("TipoCambioAjuste").ToString.ToDouble - DrInvOCDiferencias("ImporteMovtoDLLS") = If(DrInv("TipoCambioAjuste").ToString.ToDouble > 1, dr("Importe").ToString.ToDouble, -1) + DrInvOCDiferencias("ImporteMovto") = dr("Importe").ToString.ToDecimal * DrInv("TipoCambioAjuste").ToString.ToDecimal + DrInvOCDiferencias("ImporteMovtoDLLS") = If(DrInv("TipoCambioAjuste").ToString.ToDecimal > 1, dr("Importe").ToString.ToDecimal, -1) DrInvOCDiferencias("CveMovimiento") = DrInv("CveMovimiento").ToString.ToEntero DrInvOCDiferencias("ConceptoSalida") = DrInv("ConceptoSalida").ToString.ToEntero DrInvOCDiferencias("PS") = dr("PS").ToString @@ -3030,7 +3034,7 @@ Partial Class OC ' 'MODIFICACIÓN CONCEPTO ' If ConceptoSalida = 0 Then ' For Each DrAjuste As DataRow In DtInvOC.FiltraParametros($"CveMovimiento = {CveMovimientoAlmacen} And ConceptoSalida = 0").Rows - ' If Not ObjInventarios.UpdateMovimientoDetalle(DrAjuste("Cantidad").ToString.ToDouble, DrAjuste("CveUM").ToString.ToEntero, DrAjuste("CvePS").ToString.ToEntero, DtInvOCDiferencias.FiltroPrimeroValor("ImporteMovto", $"CveOrdenCompraDetalle = {DrAjuste("CveOrdenCompraDetalle").ToString.ToEntero}").ToDouble, -1, DrAjuste("CveMovimientoDetalle").ToString.ToEntero, PUTC:=DtInvOCDiferencias.FiltroPrimeroValor("ImporteMovtoDLLS", $"CveOrdenCompraDetalle = {DrAjuste("CveOrdenCompraDetalle").ToString.ToEntero}").ToDouble) Then + ' If Not ObjInventarios.UpdateMovimientoDetalle(DrAjuste("Cantidad").ToString.ToDecimal, DrAjuste("CveUM").ToString.ToEntero, DrAjuste("CvePS").ToString.ToEntero, DtInvOCDiferencias.FiltroPrimeroValor("ImporteMovto", $"CveOrdenCompraDetalle = {DrAjuste("CveOrdenCompraDetalle").ToString.ToEntero}").ToDecimal, -1, DrAjuste("CveMovimientoDetalle").ToString.ToEntero, PUTC:=DtInvOCDiferencias.FiltroPrimeroValor("ImporteMovtoDLLS", $"CveOrdenCompraDetalle = {DrAjuste("CveOrdenCompraDetalle").ToString.ToEntero}").ToDecimal) Then ' TieneError = True ' Exit For ' End If @@ -3041,7 +3045,7 @@ Partial Class OC ' If ConceptoSalida = 2 Then ' Dim CveMovimientoSalidaAjuste = ObjInventarios.AddMovimiento(CveAlmacen, 3, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, MovimientoFijo:=True, Modulo:="OC/G") ' For Each DrAjuste As DataRow In DtInvOC.FiltraParametros($"CveMovimiento = {CveMovimientoAlmacen} And ConceptoSalida = 2").Rows - ' If Not ObjInventarios.AddMovimientoDetalle(CveMovimientoSalidaAjuste, DrAjuste("Cantidad").ToString.ToDouble, DrAjuste("CveUM").ToString.ToEntero, DrAjuste("CveUM").ToString.ToEntero, DrAjuste("PU").ToString.ToDouble, -1, CveOrdenCompraDetalle:=DrAjuste("CveOrdenCompraDetalle").ToString.ToEntero) Then + ' If Not ObjInventarios.AddMovimientoDetalle(CveMovimientoSalidaAjuste, DrAjuste("Cantidad").ToString.ToDecimal, DrAjuste("CveUM").ToString.ToEntero, DrAjuste("CveUM").ToString.ToEntero, DrAjuste("PU").ToString.ToDecimal, -1, CveOrdenCompraDetalle:=DrAjuste("CveOrdenCompraDetalle").ToString.ToEntero) Then ' TieneError = True ' Exit For ' End If @@ -3049,7 +3053,7 @@ Partial Class OC ' Dim CveMovimientoEntradaAjuste = ObjInventarios.AddMovimiento(CveAlmacen, 2, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Modulo:="OC/G") ' If ObjInventarios.GetMovimientosDetalle(CveMovimientoSalidaAjuste, UsuarioActual.CveEmpresa) Then ' For Each Dr As DataRow In ObjInventarios.DtResultados.Rows - ' If Not ObjInventarios.AddMovimientoDetalle(CveMovimientoEntradaAjuste, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, DtInvOCDiferencias.FiltroPrimeroValor("ImporteMovto", $"CveOrdenCompraDetalle = {Dr("CveOrdenCompraDetalle").ToString.ToEntero}").ToDouble, Dr("CveAF").ToString.ToEntero, -1, Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveOrdenCompraDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then + ' If Not ObjInventarios.AddMovimientoDetalle(CveMovimientoEntradaAjuste, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, DtInvOCDiferencias.FiltroPrimeroValor("ImporteMovto", $"CveOrdenCompraDetalle = {Dr("CveOrdenCompraDetalle").ToString.ToEntero}").ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveOrdenCompraDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then ' TieneError = True ' Exit For ' End If @@ -3253,7 +3257,7 @@ Partial Class OC CveProveedor = dr("CveProveedor").ToString.ToEntero - PorIVA = Math.Round(DdlIVA.SelectedValue.ToDouble - 1, 2) 'GlobalDTCompProveedores(CveEmpresaActual).FiltraParametros(String.Format("CveProveedor = {0}", CveProveedor)).Rows(0)("IVA").ToString.ToDouble + PorIVA = Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2) 'GlobalDTCompProveedores(CveEmpresaActual).FiltraParametros(String.Format("CveProveedor = {0}", CveProveedor)).Rows(0)("IVA").ToString.ToDecimal IVACot = IVA '(DtDetalle.SUM("Total", String.Format("CveProveedor = {0}", CveProveedor)) * PorIVA).ToString.ToDecimal RetIVA = TxtRetIVA.Text.ToDecimal RetISR = TxtRetISR.Text.ToDecimal @@ -3297,15 +3301,15 @@ Partial Class OC End If 'AGREGA DETALLES - If Not objOrdenCompra.AddOrdenCompraDetalle(objOrdenCompra.CveOrdenCompra, dr("Cantidad").ToString.ToDouble(), dr("CveUnidadMedida").ToString.ToEntero, - dr("CvePS").ToString.ToEntero, dr("Importe").ToString.ToDouble, dr("CveSubProyecto").ToString.ToEntero(), + If Not objOrdenCompra.AddOrdenCompraDetalle(objOrdenCompra.CveOrdenCompra, dr("Cantidad").ToString.ToDecimal(), dr("CveUnidadMedida").ToString.ToEntero, + dr("CvePS").ToString.ToEntero, dr("Importe").ToString.ToDecimal, dr("CveSubProyecto").ToString.ToEntero(), dr("CveActivoFijo").ToString.ToEntero, dr("Observacion").ToString, UsuarioActual.CveUsuario, CveOrdenCompra, - CvePresupuestoEgreso:=dr("CvePresupuestoEgreso").ToString.ToEntero, Descuento:=dr("Descuento").ToString.ToDouble, - IEPSPS:=dr("IEPSPS").ToString.ToDouble, IEPSPSIVA:=dr("IEPSPSIVA").ToString.ToDouble, IVA:=dr("IVA").ToString.ToDouble, - RetIVA:=dr("RetIVA").ToString.ToDouble, RetISR:=dr("RetISR").ToString.ToDouble, Total:=dr("Total").ToString.ToDouble, - CveContratoDetalle:=dr("CveContratoDetalle").ToString.ToEntero, IVAPorcentaje:=dr("IVAPorcentaje").ToString.ToDouble, - RetIVAPorcentaje:=dr("RetIVAPorcentaje").ToString.ToDouble, RetISRPorcentaje:=dr("RetISRPorcentaje").ToString.ToDouble, - IEPSPSPorcentaje:=dr("IEPSPSPorcentaje").ToString.ToDouble, IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDouble, + CvePresupuestoEgreso:=dr("CvePresupuestoEgreso").ToString.ToEntero, Descuento:=dr("Descuento").ToString.ToDecimal, + IEPSPS:=dr("IEPSPS").ToString.ToDecimal, IEPSPSIVA:=dr("IEPSPSIVA").ToString.ToDecimal, IVA:=dr("IVA").ToString.ToDecimal, + RetIVA:=dr("RetIVA").ToString.ToDecimal, RetISR:=dr("RetISR").ToString.ToDecimal, Total:=dr("Total").ToString.ToDecimal, + CveContratoDetalle:=dr("CveContratoDetalle").ToString.ToEntero, IVAPorcentaje:=dr("IVAPorcentaje").ToString.ToDecimal, + RetIVAPorcentaje:=dr("RetIVAPorcentaje").ToString.ToDecimal, RetISRPorcentaje:=dr("RetISRPorcentaje").ToString.ToDecimal, + IEPSPSPorcentaje:=dr("IEPSPSPorcentaje").ToString.ToDecimal, IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDecimal, CveTipoGastoObra:=dr("CveTipoGastoObra").ToString.ToEntero, CveCultivoCuadroDetalle:=dr("CveCultivoCuadroDetalle").ToString.ToEntero) Then HuboError = True Exit For @@ -3328,7 +3332,7 @@ Partial Class OC Else If objOrdenCompra.AddOrdenCompra("OC", -1, TxtDescrip.Text, TxtJustificacion.Text, DdlPrioridad.SelectedValue.ToEntero, TxtFecha.Text.ToDate, DdlMoneda.SelectedValue.ToEntero, CveEstatusInicialOC, TxtFechaEstimadaEntrega.Text, LugarEntrega, CveUsuario, CveEmpresaActual, 0, pCveProveedor:=DdlProveedores.SelectedValue.ToEntero, pCveProveedorSucursal:=DdlProveedorSucursal.SelectedValue.ToEntero, CveUsuarioAsignado:=DdlUsuariosAsignado.SelectedValue.ToEntero(), CveCliente:=Ddlcliente.txtValue.Value.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PrioridadObservacion:=txtobsprioridad.Text, - PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDouble - 1, 2), IVA:=IVA, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, IDPoliza:=IDPolizaPresupuestal, CveCotizacion:=CveCotizacion, FolioAdicional:=TxtFolioAdicional.Text, + PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2), IVA:=IVA, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, IDPoliza:=IDPolizaPresupuestal, CveCotizacion:=CveCotizacion, FolioAdicional:=TxtFolioAdicional.Text, EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), IEPS:=TxtIEPS.Text.ToDecimal, CveIEAnticipo:=CveIEAnticipo, ImporteAnticipo:=ImporteAnticipos, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero, Promocion:=Promocion) Then @@ -3347,7 +3351,7 @@ Partial Class OC 'CveOrdenCompra = objOrdenCompra.CveOrdenCompra If Not HuboError Then For Each dr As DataRow In DtDetalle.Rows - If Not objOrdenCompra.AddOrdenCompraDetalle(objOrdenCompra.CveOrdenCompra, dr("Cantidad").ToString.ToDouble(), dr("CveUnidadMedida").ToString.ToEntero, dr("CvePS").ToString.ToEntero, dr("Importe").ToString.ToDouble, dr("CveSubProyecto").ToString.ToEntero(), dr("CveActivoFijo").ToString.ToEntero, dr("Observacion").ToString, UsuarioActual.CveUsuario, CveOrdenCompra, CvePresupuestoEgreso:=dr("CvePresupuestoEgreso").ToString.ToEntero, Descuento:=dr("Descuento").ToString.ToDouble, IEPSPS:=dr("IEPSPS").ToString.ToDouble, IEPSPSIVA:=dr("IEPSPSIVA").ToString.ToDouble, IVA:=dr("IVA").ToString.ToDouble, RetIVA:=dr("RetIVA").ToString.ToDouble, RetISR:=dr("RetISR").ToString.ToDouble, Total:=dr("Total").ToString.ToDouble, CveContratoDetalle:=dr("CveContratoDetalle").ToString.ToEntero, IVAPorcentaje:=dr("IVAPorcentaje").ToString.ToDouble, RetIVAPorcentaje:=dr("RetIVAPorcentaje").ToString.ToDouble, RetISRPorcentaje:=dr("RetISRPorcentaje").ToString.ToDouble, IEPSPSPorcentaje:=dr("IEPSPSPorcentaje").ToString.ToDouble, IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDouble, CveTipoGastoObra:=dr("CveTipoGastoObra").ToString.ToEntero, CveCultivoCuadroDetalle:=dr("CveCultivoCuadroDetalle").ToString.ToEntero) Then + If Not objOrdenCompra.AddOrdenCompraDetalle(objOrdenCompra.CveOrdenCompra, dr("Cantidad").ToString.ToDecimal(), dr("CveUnidadMedida").ToString.ToEntero, dr("CvePS").ToString.ToEntero, dr("Importe").ToString.ToDecimal, dr("CveSubProyecto").ToString.ToEntero(), dr("CveActivoFijo").ToString.ToEntero, dr("Observacion").ToString, UsuarioActual.CveUsuario, CveOrdenCompra, CvePresupuestoEgreso:=dr("CvePresupuestoEgreso").ToString.ToEntero, Descuento:=dr("Descuento").ToString.ToDecimal, IEPSPS:=dr("IEPSPS").ToString.ToDecimal, IEPSPSIVA:=dr("IEPSPSIVA").ToString.ToDecimal, IVA:=dr("IVA").ToString.ToDecimal, RetIVA:=dr("RetIVA").ToString.ToDecimal, RetISR:=dr("RetISR").ToString.ToDecimal, Total:=dr("Total").ToString.ToDecimal, CveContratoDetalle:=dr("CveContratoDetalle").ToString.ToEntero, IVAPorcentaje:=dr("IVAPorcentaje").ToString.ToDecimal, RetIVAPorcentaje:=dr("RetIVAPorcentaje").ToString.ToDecimal, RetISRPorcentaje:=dr("RetISRPorcentaje").ToString.ToDecimal, IEPSPSPorcentaje:=dr("IEPSPSPorcentaje").ToString.ToDecimal, IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDecimal, CveTipoGastoObra:=dr("CveTipoGastoObra").ToString.ToEntero, CveCultivoCuadroDetalle:=dr("CveCultivoCuadroDetalle").ToString.ToEntero) Then HuboError = True Exit For End If @@ -3760,7 +3764,7 @@ Partial Class OC Drr = GlobalDTOCEstatus(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveEstatus = {0}", CveEstatus))(0) If Drr IsNot Nothing AndAlso UsuarioActual.TienePermisoProceso(203) AndAlso Drr("TipoTermino").ToString.ToEntero = 3 AndAlso Drr("Tipo").ToString = "OC" Then If e.Row.DataKey("CveCompra").ToEntero > 0 Then - If e.Row.DBCampo("CantidadNoEditable").ToDouble >= e.Row.DBCampo("Cantidad").ToDouble Then '[IPP] PARA PODER EDITAR + If e.Row.DBCampo("CantidadNoEditable").ToDecimal >= e.Row.DBCampo("Cantidad").ToDecimal Then '[IPP] PARA PODER EDITAR e.Row.FCLinkButton("imgE").Enabled = False e.Row.FCLinkButton("imgE").ToolTip = "El concepto no se puede editar porque ya esta asignado a una compra" e.Row.FCLinkButton("imgD").Enabled = False @@ -3770,7 +3774,7 @@ Partial Class OC End If 'SI EL CONCEPTO YA TIENE ALGUNA RECEPCIÓN A ALMACÉN O VINCULACIÓN A COMPRA NO SE PUEDE ELIMINAR - If e.Row.DBCampo("CantidadNoEditable").ToDouble > 0 Then + If e.Row.DBCampo("CantidadNoEditable").ToDecimal > 0 Then e.Row.FCLinkButton("imgD").Enabled = False e.Row.FCLinkButton("imgD").ToolTip = "El concepto no se puede eliminar porque ya esta asignado a una compra" e.Row.FCLinkButton("imgD").Attributes.Remove("Data-toggle") @@ -3795,12 +3799,12 @@ Partial Class OC FiltroClasificacion = String.Format("CveClasificacion = {0}", e.Row.DBCampo("CveClasificacion")) End If - If CveOrdenCompra > 0 AndAlso (e.Row.DBCampo("CantidadVinculadaCompra").ToDouble > 0 OrElse e.Row.DBCampo("CantidadSurtidaAlmacen").ToDouble > 0 OrElse e.Row.DBCampo("CantidadVinculada").ToDouble > 0) Then + If CveOrdenCompra > 0 AndAlso (e.Row.DBCampo("CantidadVinculadaCompra").ToDecimal > 0 OrElse e.Row.DBCampo("CantidadSurtidaAlmacen").ToDecimal > 0 OrElse e.Row.DBCampo("CantidadVinculada").ToDecimal > 0) Then e.Row.FCDropDownList("DdlPS").Enabled = False e.Row.FCDropDownList("DdlClasificacion").Enabled = False e.Row.FCDropDownList("CboUnidadMedidaEdit").Enabled = False 'que tenga el permiso que no bloquee - If Not UsuarioActual.TienePermisoProceso(329) AndAlso e.Row.DBCampo("CantidadVinculadaCompra").ToDouble = 0 Then 'permite editar pu, aun estando recibida + If Not UsuarioActual.TienePermisoProceso(329) AndAlso e.Row.DBCampo("CantidadVinculadaCompra").ToDecimal = 0 Then 'permite editar pu, aun estando recibida e.Row.FCTextBox("TxtImporteEdit").Enabled = False e.Row.FCTextBox("TxtDescuentoEdit").Enabled = False End If @@ -3876,7 +3880,7 @@ Partial Class OC e.Row.FCTextBox("TxtDescuentoEdit").Attributes.Add("onkeyup", String.Format("FormatoMoneda(this);ValidaDescuentoDetalle(this,{0});", e.Row.FCTextBox("TxtImporteEdit").ClientID)) e.Row.FCTextBox("TxtImporteEdit").Attributes.Add("onkeyup", String.Format("ValidaDescuentoDetalle({0},this);", e.Row.FCTextBox("TxtImporteEdit").ClientID)) - e.Row.FCTextBox("TxtCantEdit").Attributes.Add("onblur", $"ValidarCantidadMenor(this,{e.Row.DBCampo("CantidadNoEditable").ToDouble});") + e.Row.FCTextBox("TxtCantEdit").Attributes.Add("onblur", $"ValidarCantidadMenor(this,{e.Row.DBCampo("CantidadNoEditable").ToDecimal});") End If @@ -3926,14 +3930,14 @@ Partial Class OC End Sub Protected Sub GvD_RowUpdating(sender As Object, e As GridViewUpdateEventArgs) Handles GvD.RowUpdating - Dim Cantidad, Importe, Descuento As Double + Dim Cantidad, Importe, Descuento As Decimal Dim CveUnidad, CveClasificacion, CveActivoFijo, CvePS, CveSubProyecto, CveProyecto, CveCultivoCuadroDetalle As Integer Dim Obs, UM, Clasificacion, Codigo, PS, SubProyecto, Proyecto, Cuadro As String Dim gvr As GridViewRow = GvD.Rows(e.RowIndex) - Cantidad = gvr.FCTextBox("TxtCantEdit").Text.Trim.ToDouble - Importe = gvr.FCTextBox("TxtImporteEdit").Text.Trim.ToDouble - Descuento = gvr.FCTextBox("TxtDescuentoEdit").Text.Trim.ToDouble + Cantidad = gvr.FCTextBox("TxtCantEdit").Text.Trim.ToDecimal + Importe = gvr.FCTextBox("TxtImporteEdit").Text.Trim.ToDecimal + Descuento = gvr.FCTextBox("TxtDescuentoEdit").Text.Trim.ToDecimal Obs = gvr.FCTextBox("TxtObsPS").Text.Trim CveUnidad = gvr.FCDropDownList("CboUnidadMedidaEdit").SelectedValue.ToEntero UM = gvr.FCDropDownList("CboUnidadMedidaEdit").SelectedItem.Text @@ -3943,11 +3947,11 @@ Partial Class OC 'SE TOMAN VALORES EN CASO DE QUE LA CvePS SEA DIFERENTE DE LA ANTERIOR Dim CvePSAnterior = gvr.DataKey("CvePS").ToEntero PS = gvr.DataKey("PS").ToString - Dim RetISR = gvr.DataKey("RetISRPorcentaje").ToDouble - Dim RetIVA = gvr.DataKey("RetIVAPorcentaje").ToDouble - 'Dim IvaPS = gvr.DataKey("IVAPorcentaje").ToDouble - Dim IEPSPS = gvr.DataKey("IEPSPSPorcentaje").ToDouble - Dim IEPSPSIVA = gvr.DataKey("IEPSPSIVAPorcentaje").ToDouble + Dim RetISR = gvr.DataKey("RetISRPorcentaje").ToDecimal + Dim RetIVA = gvr.DataKey("RetIVAPorcentaje").ToDecimal + 'Dim IvaPS = gvr.DataKey("IVAPorcentaje").ToDecimal + Dim IEPSPS = gvr.DataKey("IEPSPSPorcentaje").ToDecimal + Dim IEPSPSIVA = gvr.DataKey("IEPSPSIVAPorcentaje").ToDecimal Dim Total = Importe * Cantidad - Descuento @@ -3961,17 +3965,17 @@ Partial Class OC Exit Sub End If Dim IvaPS = DrPS("IVA").ToString.ToDecimal - IEPSPS = DrPS("IEPSPorcentaje").ToString.ToDouble + IEPSPS = DrPS("IEPSPorcentaje").ToString.ToDecimal IEPSPSIVA = If(DrPS("IEPSGrabaIVA").ToString = "True", DrPS("IEPSPorcentaje").ToString.ToDecimal, 0) If CvePS <> CvePSAnterior Or Not CveOrdenCompra > 0 Then - RetISR = DrPS("RetISR").ToString.ToDouble - RetIVA = DrPS("RetIVA").ToString.ToDouble + RetISR = DrPS("RetISR").ToString.ToDecimal + RetIVA = DrPS("RetIVA").ToString.ToDecimal 'If IvaPS = -1 Then 'IVA DE LA SUCURSAL - ' IvaPS = GlobalDTSubProyectos(-1, gvr.FCDropDownList("DdlSubProyectoEdit").SelectedValue.ToEntero).FiltroPrimeroValor("IVA").ToDouble + ' IvaPS = GlobalDTSubProyectos(-1, gvr.FCDropDownList("DdlSubProyectoEdit").SelectedValue.ToEntero).FiltroPrimeroValor("IVA").ToDecimal 'End If - ' IEPSPSIVA = If(DrPS("IEPSGrabaIVA").ToString = "True", DrPS("IEPSPorcentaje").ToString.ToDouble, 0) + ' IEPSPSIVA = If(DrPS("IEPSGrabaIVA").ToString = "True", DrPS("IEPSPorcentaje").ToString.ToDecimal, 0) End If @@ -3999,21 +4003,21 @@ Partial Class OC 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 + Dim Autorizado As Decimal = 0 + Dim Ejercido As Decimal = 0 If ObjCon.GetPresupuestos(-1, "-1", CveSubProyecto, 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 = {CveClasificacion} And Importe > 0").Rows.Count > 0 Then - Autorizado = ObjCon.DtResultados.FiltraParametros($"CveClasificacion = {CveClasificacion} And Importe > 0").Rows(0)("Importe").ToString.ToDouble + Autorizado = ObjCon.DtResultados.FiltraParametros($"CveClasificacion = {CveClasificacion} And Importe > 0").Rows(0)("Importe").ToString.ToDecimal End If End If If ObjCon.GetPresupuestosRep(CvePresupuesto, -1, 1, $"01/09/{DateTime.Now.Year - 1}".ToDate, Now, UsuarioActual.CveEmpresa, CveProyecto, CveSubProyecto, UsuarioActual.CveUsuario, CveClasificacion) Then If ObjCon.DtResultados.Rows.Count > 0 Then - Ejercido = ObjCon.DtResultados.Rows(0)("Ejercido").ToString.ToDouble + Ejercido = ObjCon.DtResultados.Rows(0)("Ejercido").ToString.ToDecimal End If End If End If @@ -4022,7 +4026,7 @@ Partial Class OC ObjCon.Dispose() If CvePresupuesto > 0 And Autorizado > 0 Then - Dim Diferencia As Double = (Ejercido + Total) - Autorizado + Dim Diferencia As Decimal = (Ejercido + Total) - Autorizado If Diferencia > 0 Then Alert($"No hay presupuesto disponible en el subproyecto {SubProyecto} y la clasificación {Clasificacion} se excede por {Diferencia.FormatoNumero}", TipoMensaje.MsgAdvertencia) Exit Sub @@ -4069,11 +4073,11 @@ Partial Class OC dr(0)("IEPSPSIVA") = IEPSPSIVA * Total dr(0)("IEPSPSIVAPorcentaje") = IEPSPSIVA - 'If DdlIVA.SelectedValue.ToDouble = 1 Then dr(0)("IVA") = 0 Else dr(0)("IVA") = IvaPS * Total - dr(0)("IVAPorcentaje") = If(IvaPS = -1, Math.Round(DdlIVA.SelectedValue.ToDouble - 1, 2), 0) + 'If DdlIVA.SelectedValue.ToDecimal = 1 Then dr(0)("IVA") = 0 Else dr(0)("IVA") = IvaPS * Total + dr(0)("IVAPorcentaje") = If(IvaPS = -1, Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2), 0) Dim TotalGravado As Decimal = Total If IEPSPSIVA > 0 Then TotalGravado = Total * (1 + IEPSPSIVA) 'grava para iva, el importe del IEPS - dr(0)("IVA") = Math.Round(dr(0)("IVAPorcentaje").ToString.ToDouble * TotalGravado, 2) + dr(0)("IVA") = Math.Round(dr(0)("IVAPorcentaje").ToString.ToDecimal * TotalGravado, 2) dr(0)("RetIVA") = RetIVA * Total dr(0)("RetIVAPorcentaje") = RetIVA @@ -4476,7 +4480,7 @@ Partial Class OC If UsuarioActual.Empresa.UsaAC And VerificaPresupuesto Then Dim ContPaq As New ClsContPAQi(UsuarioActual.Empresa) - Dim disponible As Double + Dim disponible As Decimal Dim ErrorPresupuesto = False Dim Ddl1 As DropDownList @@ -4484,7 +4488,7 @@ Partial Class OC Dim Ddl3 As DropDownList Dim Ddl4 As DropDownList Dim Ddl5 As DropDownList - Dim Total As Double + Dim Total As Decimal Dim DtPresupuestosTemp As DataTable Dim Filtro As New StringBuilder @@ -4495,7 +4499,7 @@ Partial Class OC Ddl3 = grid.FCDropDownList("DdlAC3") Ddl4 = grid.FCDropDownList("DdlAC4") Ddl5 = grid.FCDropDownList("DdlAC5") - Total = grid.FCLiteral("LtlTotal").Text.ToDouble + Total = grid.FCLiteral("LtlTotal").Text.ToDecimal 'OBTENEMOS EL REGISTRO DEL PE SELECCIONADO Filtro.AppendFormat("CveProgramaOperativo = {0} and CveUnidadAdministrativa = {1} and CveFuenteFinanciamiento = {2} and CveTipoGasto= {3} and CveClasificacion = {4}", If(Ddl1.SelectedValue.ToString = "", "-1", Ddl1.SelectedValue.ToString), If(Ddl2.SelectedValue.ToString = "", "-1", Ddl2.SelectedValue.ToString), If(Ddl3.SelectedValue.ToString = "", "-1", Ddl3.SelectedValue.ToString), If(Ddl4.SelectedValue.ToString = "", "-1", Ddl4.SelectedValue.ToString), If(Ddl5.SelectedValue.ToString = "", "-1", Ddl5.SelectedValue.ToString)) @@ -4640,8 +4644,8 @@ Partial Class OC End If 'ACTUALIZO DATO EN DB - If OC.UpdateOrdenCompraDetalle(dr("Cantidad").ToString.ToDouble, dr("CveUnidadMedida").ToString.ToEntero, dr("CvePS").ToString.ToEntero, dr("Importe").ToString.ToDouble, dr("CveSubProyecto").ToString.ToEntero, dr("CveActivoFijo").ToString.ToEntero, - dr("Observacion").ToString.ToString, UsuarioActual.CveUsuario, dr("CveOrdenCompraDetalle").ToString.ToEntero, dr("CvePresupuestoEgreso").ToString.ToEntero, dr("Descuento").ToString.ToDouble, IEPSPS:=dr("IEPSPS").ToString.ToDouble, IEPSPSIVA:=dr("IEPSPSIVA").ToString.ToDouble, IVA:=dr("IVA").ToString.ToDouble, RetIVA:=dr("RetIVA").ToString.ToDouble, RetISR:=dr("RetISR").ToString.ToDouble, Total:=dr("Total").ToString.ToDouble, CveContratoDetalle:=dr("CveContratoDetalle").ToString.ToEntero, IVAPorcentaje:=dr("IVAPorcentaje").ToString.ToDouble, RetIVAPorcentaje:=dr("RetIVAPorcentaje").ToString.ToDouble, RetISRPorcentaje:=dr("RetISRPorcentaje").ToString.ToDouble, IEPSPSPorcentaje:=dr("IEPSPSPorcentaje").ToString.ToDouble, IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDouble) <= 0 Then + If OC.UpdateOrdenCompraDetalle(dr("Cantidad").ToString.ToDecimal, dr("CveUnidadMedida").ToString.ToEntero, dr("CvePS").ToString.ToEntero, dr("Importe").ToString.ToDecimal, dr("CveSubProyecto").ToString.ToEntero, dr("CveActivoFijo").ToString.ToEntero, + dr("Observacion").ToString.ToString, UsuarioActual.CveUsuario, dr("CveOrdenCompraDetalle").ToString.ToEntero, dr("CvePresupuestoEgreso").ToString.ToEntero, dr("Descuento").ToString.ToDecimal, IEPSPS:=dr("IEPSPS").ToString.ToDecimal, IEPSPSIVA:=dr("IEPSPSIVA").ToString.ToDecimal, IVA:=dr("IVA").ToString.ToDecimal, RetIVA:=dr("RetIVA").ToString.ToDecimal, RetISR:=dr("RetISR").ToString.ToDecimal, Total:=dr("Total").ToString.ToDecimal, CveContratoDetalle:=dr("CveContratoDetalle").ToString.ToEntero, IVAPorcentaje:=dr("IVAPorcentaje").ToString.ToDecimal, RetIVAPorcentaje:=dr("RetIVAPorcentaje").ToString.ToDecimal, RetISRPorcentaje:=dr("RetISRPorcentaje").ToString.ToDecimal, IEPSPSPorcentaje:=dr("IEPSPSPorcentaje").ToString.ToDecimal, IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDecimal) <= 0 Then TieneError = True End If @@ -4688,31 +4692,31 @@ Partial Class OC e.Row.CssClass = "SubTotales" For i As Integer = 1 To NumCotizaciones Dim Btn As Button = e.Row.FCButton(String.Format("Btn{0}", i)) - Btn.Text = e.Row.DBCampo(String.Format("PU{0}", i)).ToDouble.ToString("N2") + Btn.Text = e.Row.DBCampo(String.Format("PU{0}", i)).ToDecimal.ToString("N2") Btn.Visible = True 'Btn.Enabled = True 'Btn.OnClientClick = "return false;" - e.Row.Cells(2 + i).Text = String.Format("{0}", e.Row.DBCampo(String.Format("PU{0}", i)).ToDouble.ToString("N2")) + e.Row.Cells(2 + i).Text = String.Format("{0}", e.Row.DBCampo(String.Format("PU{0}", i)).ToDecimal.ToString("N2")) Next Else Dim CellMasBarato As Integer = -1 - Dim Monto As Double = -1 + Dim Monto As Decimal = -1 For i As Integer = 1 To NumCotizaciones Dim Btn As Button = e.Row.FCButton(String.Format("Btn{0}", i)) - Btn.Text = e.Row.DBCampo("PU" & i).ToDouble.ToString("N2") + Btn.Text = e.Row.DBCampo("PU" & i).ToDecimal.ToString("N2") Btn.CommandArgument = String.Format("{0}|{1}|{2}", e.Row.DBCampo(String.Format("CveCotizacionDetalle{0}", i)), False, DtCotizaciones.Rows(i - 1)("CveProveedor").ToString) Btn.Style.Add("cursor:", "pointer") - If e.Row.DBCampo(String.Format("PU{0}", i)).ToDouble > 0 Then + If e.Row.DBCampo(String.Format("PU{0}", i)).ToDecimal > 0 Then If Monto.ToString = "-1" Then - Monto = e.Row.DBCampo(String.Format("PU{0}", i)).ToDouble + Monto = e.Row.DBCampo(String.Format("PU{0}", i)).ToDecimal CellMasBarato = i End If - If e.Row.DBCampo(String.Format("PU{0}", i)).ToDouble < Monto Then + If e.Row.DBCampo(String.Format("PU{0}", i)).ToDecimal < Monto Then CellMasBarato = i - Monto = e.Row.DBCampo(String.Format("PU{0}", i)).ToDouble + Monto = e.Row.DBCampo(String.Format("PU{0}", i)).ToDecimal End If Else Btn.Text = "Sin captura" @@ -4735,7 +4739,7 @@ Partial Class OC Dim i As Integer = 1 For Each dr As DataRow In DtCotizaciones.Rows Dim Btn As Button = e.Row.FCButton("Btn" & i) - ' Btn.Text = e.Row.DBCampo("PU" & i).ToDouble.ToString("N2") + ' Btn.Text = e.Row.DBCampo("PU" & i).ToDecimal.ToString("N2") If e.Row.DBCampo("EsGanadora" & i).ToString = "True" Then @@ -5264,7 +5268,7 @@ Partial Class OC Dim TieneError = False If ObjOI.AddEventoTarea(Asunto, Descripcion.ToString, 1, UsuarioActual.CveUsuario, DdlSAUsuario.SelectedValue.ToString.ToEntero, DateTime.Now, DateTime.Now.AddMinutes(15), -1, 1, -1, "-1", -1, -1, -1, -1, -1, CveOrdenCompra.ToEntero, -1, -1, UsuarioActual.CveUsuario, -1, CveEmpresaActual) Then - If Not ObjOC.AddSolicitudAnticipo(CveOrdenCompra, TxtSAImporte.Text.ToDouble, CveEmpresaActual) Then + If Not ObjOC.AddSolicitudAnticipo(CveOrdenCompra, TxtSAImporte.Text.ToDecimal, CveEmpresaActual) Then TieneError = True End If Else @@ -5378,7 +5382,7 @@ Partial Class OC strBody.Append("