-cambios de double a decimal

This commit is contained in:
2022-04-25 20:31:09 -07:00
parent 8e51992194
commit 5a5a82e176

View File

@@ -518,32 +518,32 @@ Partial Class OC
Private Property NumRow As Integer Private Property NumRow As Integer
Private Property SaldoOCAnticipo As Double Private Property SaldoOCAnticipo As Decimal
Get Get
If ViewState("SaldoOCAnticipo") Is Nothing Then If ViewState("SaldoOCAnticipo") Is Nothing Then
Return 0 Return 0
Else Else
Return ViewState("SaldoOCAnticipo").ToString.ToDouble Return ViewState("SaldoOCAnticipo").ToString.ToDecimal
End If End If
End Get End Get
Set(value As Double) Set(value As Decimal)
ViewState("SaldoOCAnticipo") = value ViewState("SaldoOCAnticipo") = value
End Set End Set
End Property End Property
Private Property ImporteAnticipos As Double Private Property ImporteAnticipos As Decimal
Get Get
If ViewState("ImporteAnticipos") Is Nothing Then If ViewState("ImporteAnticipos") Is Nothing Then
Return 0 Return 0
Else Else
Return ViewState("ImporteAnticipos").ToString.ToDouble Return ViewState("ImporteAnticipos").ToString.ToDecimal
End If End If
End Get End Get
Set(value As Double) Set(value As Decimal)
ViewState("ImporteAnticipos") = value ViewState("ImporteAnticipos") = value
End Set End Set
End Property End Property
@@ -924,18 +924,18 @@ Partial Class OC
Exit Sub Exit Sub
End If 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) Alert("Para aplicar un IVA, debe de seleccionar un porcentaje en el combo de IVA.", TipoMensaje.MsgAdvertencia)
TxtIVA.Text = "0.00" TxtIVA.Text = "0.00"
CalculaGenerales() CalculaGenerales()
Exit Sub Exit Sub
End If End If
Dim Total As Double = 0 Dim Total As Decimal = 0
For Each Dr As DataRow In DtDetalle.Rows For Each Dr As DataRow In DtDetalle.Rows
Dim DrPS = GlobalDTPS(CveEmpresaActual, CvePS:=Dr("CvePS").ToString.ToEntero).FiltroPrimero("") Dim DrPS = GlobalDTPS(CveEmpresaActual, CvePS:=Dr("CvePS").ToString.ToEntero).FiltroPrimero("")
If DrPS IsNot Nothing AndAlso DrPS("IVA").ToString.ToEntero = -1 Then If DrPS IsNot Nothing AndAlso DrPS("IVA").ToString.ToEntero = -1 Then
Total += Dr("Total").ToString.ToDouble Total += Dr("Total").ToString.ToDecimal
End If End If
Next Next
@@ -1056,21 +1056,21 @@ Partial Class OC
Private Sub CreaDTDetalles() Private Sub CreaDTDetalles()
DtDetalle = New DataTable DtDetalle = New DataTable
DtDetalle.Columns.Add("Cantidad", GetType(Double)) DtDetalle.Columns.Add("Cantidad", GetType(Decimal))
DtDetalle.Columns.Add("CveUnidadMedida", GetType(Integer)) DtDetalle.Columns.Add("CveUnidadMedida", GetType(Integer))
DtDetalle.Columns.Add("UM", GetType(String)) DtDetalle.Columns.Add("UM", GetType(String))
DtDetalle.Columns.Add("CvePS", GetType(Integer)) DtDetalle.Columns.Add("CvePS", GetType(Integer))
DtDetalle.Columns.Add("PS", GetType(String)) DtDetalle.Columns.Add("PS", GetType(String))
DtDetalle.Columns.Add("IVA", GetType(Double)) DtDetalle.Columns.Add("IVA", GetType(Decimal))
DtDetalle.Columns.Add("IVAPorcentaje", GetType(Double)) DtDetalle.Columns.Add("IVAPorcentaje", GetType(Decimal))
DtDetalle.Columns.Add("IEPSPS", GetType(Double)) DtDetalle.Columns.Add("IEPSPS", GetType(Decimal))
DtDetalle.Columns.Add("IEPSPSPorcentaje", GetType(Double)) DtDetalle.Columns.Add("IEPSPSPorcentaje", GetType(Decimal))
DtDetalle.Columns.Add("IEPSPSIVA", GetType(Double)) DtDetalle.Columns.Add("IEPSPSIVA", GetType(Decimal))
DtDetalle.Columns.Add("IEPSPSIVAPorcentaje", GetType(Double)) DtDetalle.Columns.Add("IEPSPSIVAPorcentaje", GetType(Decimal))
DtDetalle.Columns.Add("RetIVA", GetType(Double)) DtDetalle.Columns.Add("RetIVA", GetType(Decimal))
DtDetalle.Columns.Add("RetIVAPorcentaje", GetType(Double)) DtDetalle.Columns.Add("RetIVAPorcentaje", GetType(Decimal))
DtDetalle.Columns.Add("RetISR", GetType(Double)) DtDetalle.Columns.Add("RetISR", GetType(Decimal))
DtDetalle.Columns.Add("RetISRPorcentaje", GetType(Double)) DtDetalle.Columns.Add("RetISRPorcentaje", GetType(Decimal))
DtDetalle.Columns.Add("Observacion", GetType(String)) DtDetalle.Columns.Add("Observacion", GetType(String))
DtDetalle.Columns.Add("CveClasificacion", GetType(Integer)) DtDetalle.Columns.Add("CveClasificacion", GetType(Integer))
DtDetalle.Columns.Add("Clasificacion", GetType(String)) DtDetalle.Columns.Add("Clasificacion", GetType(String))
@@ -1081,9 +1081,9 @@ Partial Class OC
DtDetalle.Columns.Add("Proyecto", GetType(String)) DtDetalle.Columns.Add("Proyecto", GetType(String))
DtDetalle.Columns.Add("CveSubProyecto", GetType(Integer)) DtDetalle.Columns.Add("CveSubProyecto", GetType(Integer))
DtDetalle.Columns.Add("SubProyecto", GetType(String)) DtDetalle.Columns.Add("SubProyecto", GetType(String))
DtDetalle.Columns.Add("Importe", GetType(Double)) DtDetalle.Columns.Add("Importe", GetType(Decimal))
DtDetalle.Columns.Add("Descuento", GetType(Double)) DtDetalle.Columns.Add("Descuento", GetType(Decimal))
DtDetalle.Columns.Add("Total", GetType(Double)) DtDetalle.Columns.Add("Total", GetType(Decimal))
DtDetalle.Columns.Add("Codigo", GetType(String)) DtDetalle.Columns.Add("Codigo", GetType(String))
DtDetalle.Columns.Add("CodigoAF", GetType(String)) DtDetalle.Columns.Add("CodigoAF", GetType(String))
@@ -1112,7 +1112,7 @@ Partial Class OC
DtDetalle.Columns.Add("CveProveedor", GetType(Integer)) DtDetalle.Columns.Add("CveProveedor", GetType(Integer))
DtDetalle.Columns.Add("CveContratoDetalle", 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)) DtDetalle.Columns.Add("CveVentaDetalleCotizacion", GetType(Integer))
@@ -1146,15 +1146,15 @@ Partial Class OC
dr("CvePS") = RowV("CvePS") dr("CvePS") = RowV("CvePS")
dr("PS") = RowV("CodigoPS") dr("PS") = RowV("CodigoPS")
dr("IVA") = 0 dr("IVA") = 0
dr("IVAPorcentaje") = DrPS("IVA").ToString.ToDouble dr("IVAPorcentaje") = DrPS("IVA").ToString.ToDecimal
dr("RetIVA") = 0 dr("RetIVA") = 0
dr("RetIVAPorcentaje") = DrPS("RetIVA").ToString.ToDouble dr("RetIVAPorcentaje") = DrPS("RetIVA").ToString.ToDecimal
dr("RetISR") = 0 dr("RetISR") = 0
dr("RetISRPorcentaje") = DrPS("RetISR").ToString.ToDouble dr("RetISRPorcentaje") = DrPS("RetISR").ToString.ToDecimal
dr("IEPSPS") = 0 dr("IEPSPS") = 0
dr("IEPSPSPorcentaje") = DrPS("IEPSPorcentaje").ToString.ToDouble dr("IEPSPSPorcentaje") = DrPS("IEPSPorcentaje").ToString.ToDecimal
dr("IEPSPSIVA") = 0 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("Observacion") = RowV("Obs")
dr("CveClasificacion") = RowV("CveClasificacion") dr("CveClasificacion") = RowV("CveClasificacion")
dr("Clasificacion") = RowV("Clasificacion") dr("Clasificacion") = RowV("Clasificacion")
@@ -1377,7 +1377,7 @@ Partial Class OC
TxtJustificacion.Text = objOC.Justificacion TxtJustificacion.Text = objOC.Justificacion
DdlMoneda.SelectedValueExist(objOC.CveMoneda.ToString) DdlMoneda.SelectedValueExist(objOC.CveMoneda.ToString)
MonedaTexto = DdlMoneda.SelectedItem.Text MonedaTexto = DdlMoneda.SelectedItem.Text
Select Case objOC.PorcentajeIVA.ToString.ToDouble Select Case objOC.PorcentajeIVA.ToString.ToDecimal
Case 0 Case 0
DdlIVA.SelectedValue = "1" DdlIVA.SelectedValue = "1"
Case 0.16 Case 0.16
@@ -1385,7 +1385,7 @@ Partial Class OC
Case 0.08 Case 0.08
DdlIVA.SelectedValue = "1.08" DdlIVA.SelectedValue = "1.08"
End Select 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) DdlPrioridad.SelectedValueExist(objOC.Prioridad.ToString)
ChkCotizacion.Checked = objOC.RequiereCotizacion ChkCotizacion.Checked = objOC.RequiereCotizacion
@@ -1656,7 +1656,7 @@ Partial Class OC
If objOC.CveEstatus = 0 Then If objOC.CveEstatus = 0 Then
CboE.Items.Add(New ListItem("Pre Solicitud", "0")) CboE.Items.Add(New ListItem("Pre Solicitud", "0"))
ElseIf objOC.TipoTermino = 0 Then ' no autorizada, está en proceso ElseIf objOC.TipoTermino = 0 AndAlso objOC.Tipo = "REQ" Then ' no autorizada, está en proceso
CboE.Items.Add(New ListItem("Pre Solicitud", "0")) CboE.Items.Add(New ListItem("Pre Solicitud", "0"))
End If End If
CboE.SelectedValueExist(objOC.CveEstatus.ToString) CboE.SelectedValueExist(objOC.CveEstatus.ToString)
@@ -2148,21 +2148,21 @@ Partial Class OC
If UsuarioActual.Empresa.Funcionalidad(532) = "1" Then If UsuarioActual.Empresa.Funcionalidad(532) = "1" Then
Dim ObjCon As New ClsContratos Dim ObjCon As New ClsContratos
Dim CvePresupuesto As Integer = 0 Dim CvePresupuesto As Integer = 0
Dim Autorizado As Double = 0 Dim Autorizado As Decimal = 0
Dim Ejercido As Double = 0 Dim Ejercido As Decimal = 0
If ObjCon.GetPresupuestos(-1, "-1", DdlSubProyecto.SelectedValue.ToEntero, 2, -1, UsuarioActual.CveEmpresa) Then If ObjCon.GetPresupuestos(-1, "-1", DdlSubProyecto.SelectedValue.ToEntero, 2, -1, UsuarioActual.CveEmpresa) Then
If ObjCon.DtResultados.Rows.Count > 0 Then If ObjCon.DtResultados.Rows.Count > 0 Then
CvePresupuesto = ObjCon.DtResultados.Rows(0)("CvePresupuesto").ToString.ToEntero CvePresupuesto = ObjCon.DtResultados.Rows(0)("CvePresupuesto").ToString.ToEntero
If CvePresupuesto > 0 Then If CvePresupuesto > 0 Then
If ObjCon.GetPresupuestosDetalle(CvePresupuesto, -1, UsuarioActual.CveEmpresa) Then If ObjCon.GetPresupuestosDetalle(CvePresupuesto, -1, UsuarioActual.CveEmpresa) Then
If ObjCon.DtResultados.FiltraParametros($"CveClasificacion = {DdlClasificacion.SelectedValue.ToEntero} AND Importe > 0").Rows.Count > 0 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
End If End If
If ObjCon.GetPresupuestosRep(CvePresupuesto, -1, 1, $"01/09/{DateTime.Now.Year - 1}".ToDate, Now, UsuarioActual.CveEmpresa, DdlProyecto.SelectedValue.ToEntero, 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 DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveUsuario, DdlClasificacion.SelectedValue.ToEntero) Then
If ObjCon.DtResultados.Rows.Count > 0 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 End If
End If End If
@@ -2171,7 +2171,7 @@ Partial Class OC
ObjCon.Dispose() ObjCon.Dispose()
If CvePresupuesto > 0 And Autorizado > 0 Then 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 If Diferencia > 0 Then
Alert($"No hay presupuesto disponible en el subproyecto <b>{DdlSubProyecto.SelectedItem.Text}</b> y la clasificación <b>{DdlClasificacion.SelectedItem.Text}</b> se excede por <b>{Diferencia.FormatoNumero}</b>", TipoMensaje.MsgAdvertencia) Alert($"No hay presupuesto disponible en el subproyecto <b>{DdlSubProyecto.SelectedItem.Text}</b> y la clasificación <b>{DdlClasificacion.SelectedItem.Text}</b> se excede por <b>{Diferencia.FormatoNumero}</b>", TipoMensaje.MsgAdvertencia)
Exit Sub Exit Sub
@@ -2180,22 +2180,22 @@ Partial Class OC
End If End If
Dim RetISR As Double = DrPS("RetISR").ToString.ToDouble Dim RetISR As Decimal = DrPS("RetISR").ToString.ToDecimal
Dim RetIVA As Double = DrPS("RetIVA").ToString.ToDouble Dim RetIVA As Decimal = DrPS("RetIVA").ToString.ToDecimal
Dim IvaPS As Double = DrPS("IVA").ToString.ToDouble Dim IvaPS As Decimal = DrPS("IVA").ToString.ToDecimal
'If IvaPS = -1 Then 'IVA DE LA SUCURSAL '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 'End If
Dim IEPSPS As Double = DrPS("IEPSPorcentaje").ToString.ToDouble Dim IEPSPS As Decimal = DrPS("IEPSPorcentaje").ToString.ToDecimal
Dim IEPSPSIVA As Double = If(DrPS("IEPSGrabaIVA").ToString = "True", DrPS("IEPSPorcentaje").ToString.ToDouble, 0) 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 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 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 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 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 TotalPS As Decimal = If(txtPrecioUnitario.Text.ToDecimal > 0, (txtPrecioUnitario.Text.ToDecimal * TxtCant.Text.ToDecimal) - TxtDescuentoAdd.Text.ToDecimal, 0)
Dim ImportePS As Double = If(txtPrecioUnitario.Text.ToDouble > 0, txtPrecioUnitario.Text.ToDouble, 0) Dim ImportePS As Decimal = If(txtPrecioUnitario.Text.ToDecimal > 0, txtPrecioUnitario.Text.ToDecimal, 0)
Dim CveOrdenCompraDetalle As Integer = DtDetalle.MAX("CveOrdenCompraDetalle").ToEntero + 100 Dim CveOrdenCompraDetalle As Integer = DtDetalle.MAX("CveOrdenCompraDetalle").ToEntero + 100
Dim CantidadVentaMinima As Decimal = DrPS("VentaMinima").ToString.ToDecimal Dim CantidadVentaMinima As Decimal = DrPS("VentaMinima").ToString.ToDecimal
@@ -2211,7 +2211,7 @@ Partial Class OC
IvaPS = 0 IvaPS = 0
End If 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, 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, 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, IdCuentaComprometido, DdlACGeneral1.SelectedValue.ToEntero, DdlACGeneral2.SelectedValue.ToEntero, DdlACGeneral3.SelectedValue.ToEntero, DdlACGeneral4.SelectedValue.ToEntero,
@@ -2239,10 +2239,10 @@ Partial Class OC
UPPDetalle.Update() UPPDetalle.Update()
End Sub 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, 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, 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 = "") Optional Cuadro As String = "")
If DtDetalle IsNot Nothing Then If DtDetalle IsNot Nothing Then
@@ -2260,10 +2260,10 @@ Partial Class OC
dr("IEPSPS") = Math.Round(IEPSPS * Total, 2) dr("IEPSPS") = Math.Round(IEPSPS * Total, 2)
dr("IEPSPSIVAPorcentaje") = IEPSPSIVA dr("IEPSPSIVAPorcentaje") = IEPSPSIVA
dr("IEPSPSIVA") = Math.Round(IEPSPSIVA * Total, 2) 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 Dim TotalGravado As Decimal = Total
If IEPSPSIVA > 0 Then TotalGravado = Total * (1 + IEPSPSIVA) 'grava para iva, el importe del IEPS 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("RetIVAPorcentaje") = RetIVA
dr("RetIVA") = Math.Round(RetIVA * Total, 2) dr("RetIVA") = Math.Round(RetIVA * Total, 2)
dr("RetISRPorcentaje") = RetISR dr("RetISRPorcentaje") = RetISR
@@ -2592,19 +2592,19 @@ Partial Class OC
If Not TieneError Then ' AGREGAR REQUISICION 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), 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, 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, 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 IEPS:=TxtIEPS.Text.ToDecimal, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero, Promocion:=Promocion, CveProveedorContacto:=CveProveedorContacto) Then
CveOrdenCompraPadre = OC.CveOrdenCompra CveOrdenCompraPadre = OC.CveOrdenCompra
If CveOrdenCompraPadre > 0 Then If CveOrdenCompraPadre > 0 Then
For Each dr As DataRow In DtDetalle.Rows 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, 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.ToDouble, dr("CveSubProyecto").ToString.ToEntero(), dr("CveActivoFijo").ToString.ToEntero, dr("Observacion").ToString, UsuarioActual.CveUsuario, Descuento:=dr("Descuento").ToString.ToDecimal,
IEPSPS:=dr("IEPSPS").ToString.ToDouble, IEPSPSIVA:=dr("IEPSPSIVA").ToString.ToDouble, IVA:=dr("IVA").ToString.ToDouble, RetIVA:=dr("RetIVA").ToString.ToDouble, IEPSPS:=dr("IEPSPS").ToString.ToDecimal, IEPSPSIVA:=dr("IEPSPSIVA").ToString.ToDecimal, IVA:=dr("IVA").ToString.ToDecimal, RetIVA:=dr("RetIVA").ToString.ToDecimal,
RetISR:=dr("RetISR").ToString.ToDouble, Total:=dr("Total").ToString.ToDouble, CveContratoDetalle:=dr("CveContratoDetalle").ToString.ToEntero, IVAPorcentaje:=dr("IVAPorcentaje").ToString.ToDouble, RetISR:=dr("RetISR").ToString.ToDecimal, Total:=dr("Total").ToString.ToDecimal, CveContratoDetalle:=dr("CveContratoDetalle").ToString.ToEntero, IVAPorcentaje:=dr("IVAPorcentaje").ToString.ToDecimal,
RetIVAPorcentaje:=dr("RetIVAPorcentaje").ToString.ToDouble, RetISRPorcentaje:=dr("RetISRPorcentaje").ToString.ToDouble, IEPSPSPorcentaje:=dr("IEPSPSPorcentaje").ToString.ToDouble, RetIVAPorcentaje:=dr("RetIVAPorcentaje").ToString.ToDecimal, RetISRPorcentaje:=dr("RetISRPorcentaje").ToString.ToDecimal, IEPSPSPorcentaje:=dr("IEPSPSPorcentaje").ToString.ToDecimal,
IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDouble, CveTipoGastoObra:=dr("CveTipoGastoObra").ToString.ToEntero, CveCultivoCuadroDetalle:=dr("CveCultivoCuadroDetalle").ToString.ToEntero) Then IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDecimal, CveTipoGastoObra:=dr("CveTipoGastoObra").ToString.ToEntero, CveCultivoCuadroDetalle:=dr("CveCultivoCuadroDetalle").ToString.ToEntero) Then
TieneError = True TieneError = True
Exit For Exit For
End If End If
@@ -2627,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), 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, 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, 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, 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 Promocion:=Promocion, CveProveedorContacto:=CveProveedorContacto) Then
CveOrdenCompra = OC.CveOrdenCompra CveOrdenCompra = OC.CveOrdenCompra
@@ -2678,11 +2678,11 @@ Partial Class OC
For Each dr As DataRow In DtDetalle.Rows 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, 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.ToDouble, IEPSPS:=dr("IEPSPS").ToString.ToDouble, 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.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, 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.ToDouble, RetIVAPorcentaje:=dr("RetIVAPorcentaje").ToString.ToDouble, RetISRPorcentaje:=dr("RetISRPorcentaje").ToString.ToDouble, IEPSPSPorcentaje:=dr("IEPSPSPorcentaje").ToString.ToDouble, IVAPorcentaje:=dr("IVAPorcentaje").ToString.ToDecimal, RetIVAPorcentaje:=dr("RetIVAPorcentaje").ToString.ToDecimal, RetISRPorcentaje:=dr("RetISRPorcentaje").ToString.ToDecimal, IEPSPSPorcentaje:=dr("IEPSPSPorcentaje").ToString.ToDecimal,
IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDouble, CveVentaDetalleCotizacion:=dr("CveVentaDetalleCotizacion").ToString().ToEntero(), CveTipoGastoObra:=dr("CveTipoGastoObra").ToString.ToEntero, CveCultivoCuadroDetalle:=dr("CveCultivoCuadroDetalle").ToString.ToEntero) Then IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDecimal, CveVentaDetalleCotizacion:=dr("CveVentaDetalleCotizacion").ToString().ToEntero(), CveTipoGastoObra:=dr("CveTipoGastoObra").ToString.ToEntero, CveCultivoCuadroDetalle:=dr("CveCultivoCuadroDetalle").ToString.ToEntero) Then
TieneError = True TieneError = True
Exit For Exit For
End If End If
@@ -2793,7 +2793,7 @@ Partial Class OC
LugarEntrega, DdlMoneda.SelectedValue.ToEntero, CveProveedor, CveOrdenCompra, UsuarioActual.CveUsuario, Ddlcliente.txtValue.Value.ToEntero, 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), 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, 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 CveProveedorOriginal <> CveProveedor Then
If Not ObjConta.UpdateProveedorPoliza(CveOrdenCompra, CveProveedor, Proveedor) Then If Not ObjConta.UpdateProveedorPoliza(CveOrdenCompra, CveProveedor, Proveedor) Then
TieneError = True TieneError = True
@@ -2818,7 +2818,7 @@ Partial Class OC
'inserto los nuevos detalles 'inserto los nuevos detalles
If Not TieneError Then If Not TieneError Then
For Each dr As DataRow In DtDetalle.FiltraParametros("TipoDato = 0").Rows 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 TieneError = True
Exit For Exit For
Else Else
@@ -2835,10 +2835,10 @@ Partial Class OC
DtInvOCDiferencias.Columns.Add("CveOrdenCompraDetalle", GetType(Integer)) DtInvOCDiferencias.Columns.Add("CveOrdenCompraDetalle", GetType(Integer))
DtInvOCDiferencias.Columns.Add("CveAlmacen", GetType(Integer)) DtInvOCDiferencias.Columns.Add("CveAlmacen", GetType(Integer))
DtInvOCDiferencias.Columns.Add("CveMovimiento", GetType(Integer)) DtInvOCDiferencias.Columns.Add("CveMovimiento", GetType(Integer))
DtInvOCDiferencias.Columns.Add("Diferencia", GetType(Double)) DtInvOCDiferencias.Columns.Add("Diferencia", GetType(Decimal))
DtInvOCDiferencias.Columns.Add("ImporteMovto", GetType(Double)) DtInvOCDiferencias.Columns.Add("ImporteMovto", GetType(Decimal))
DtInvOCDiferencias.Columns.Add("ImporteMovtoDLLS", GetType(Double)) DtInvOCDiferencias.Columns.Add("ImporteMovtoDLLS", GetType(Decimal))
DtInvOCDiferencias.Columns.Add("TipoCambioAjuste", GetType(Double)) DtInvOCDiferencias.Columns.Add("TipoCambioAjuste", GetType(Decimal))
DtInvOCDiferencias.Columns.Add("ConceptoSalida", GetType(Integer)) DtInvOCDiferencias.Columns.Add("ConceptoSalida", GetType(Integer))
DtInvOCDiferencias.Columns.Add("PS", GetType(String)) DtInvOCDiferencias.Columns.Add("PS", GetType(String))
@@ -2848,9 +2848,9 @@ Partial Class OC
If Not TieneError Then If Not TieneError Then
For Each dr As DataRow In DtDetalle.FiltraParametros("TipoDato IN (1)").Rows 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, 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.ToDouble, 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.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 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 TieneError = True
Exit For Exit For
Else Else
@@ -2860,12 +2860,12 @@ Partial Class OC
Dim DrInvOCDiferencias As DataRow Dim DrInvOCDiferencias As DataRow
For Each DrInv As DataRow In DtInvOC.FiltraParametros($"CveOrdenCompraDetalle = {dr("CveOrdenCompraDetalle").ToString.ToEntero} AND CveCompraDetalle < 1").Rows For Each DrInv As DataRow In DtInvOC.FiltraParametros($"CveOrdenCompraDetalle = {dr("CveOrdenCompraDetalle").ToString.ToEntero} AND CveCompraDetalle < 1").Rows
DrInvOCDiferencias = DtInvOCDiferencias.NewRow DrInvOCDiferencias = DtInvOCDiferencias.NewRow
DrInvOCDiferencias("TipoCambioAjuste") = DrInv("TipoCambioAjuste").ToString.ToDouble DrInvOCDiferencias("TipoCambioAjuste") = DrInv("TipoCambioAjuste").ToString.ToDecimal
DrInvOCDiferencias("Diferencia") = ((dr("Importe").ToString.ToDouble * DrInv("TipoCambioAjuste").ToString.ToDouble) - DrInv("PUOriginal").ToString.ToDouble) * DrInv("Cantidad").ToString.ToDouble 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("CveAlmacen") = DrInv("CveAlmacen").ToString.ToEntero
DrInvOCDiferencias("CveOrdenCompraDetalle") = DrInv("CveOrdenCompraDetalle").ToString.ToEntero DrInvOCDiferencias("CveOrdenCompraDetalle") = DrInv("CveOrdenCompraDetalle").ToString.ToEntero
DrInvOCDiferencias("ImporteMovto") = dr("Importe").ToString.ToDouble * DrInv("TipoCambioAjuste").ToString.ToDouble DrInvOCDiferencias("ImporteMovto") = dr("Importe").ToString.ToDecimal * DrInv("TipoCambioAjuste").ToString.ToDecimal
DrInvOCDiferencias("ImporteMovtoDLLS") = If(DrInv("TipoCambioAjuste").ToString.ToDouble > 1, dr("Importe").ToString.ToDouble, -1) DrInvOCDiferencias("ImporteMovtoDLLS") = If(DrInv("TipoCambioAjuste").ToString.ToDecimal > 1, dr("Importe").ToString.ToDecimal, -1)
DrInvOCDiferencias("CveMovimiento") = DrInv("CveMovimiento").ToString.ToEntero DrInvOCDiferencias("CveMovimiento") = DrInv("CveMovimiento").ToString.ToEntero
DrInvOCDiferencias("ConceptoSalida") = DrInv("ConceptoSalida").ToString.ToEntero DrInvOCDiferencias("ConceptoSalida") = DrInv("ConceptoSalida").ToString.ToEntero
DrInvOCDiferencias("PS") = dr("PS").ToString DrInvOCDiferencias("PS") = dr("PS").ToString
@@ -3034,7 +3034,7 @@ Partial Class OC
' 'MODIFICACIÓN CONCEPTO ' 'MODIFICACIÓN CONCEPTO
' If ConceptoSalida = 0 Then ' If ConceptoSalida = 0 Then
' For Each DrAjuste As DataRow In DtInvOC.FiltraParametros($"CveMovimiento = {CveMovimientoAlmacen} And ConceptoSalida = 0").Rows ' 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 ' TieneError = True
' Exit For ' Exit For
' End If ' End If
@@ -3045,7 +3045,7 @@ Partial Class OC
' If ConceptoSalida = 2 Then ' 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") ' 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 ' 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 ' TieneError = True
' Exit For ' Exit For
' End If ' End If
@@ -3053,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") ' 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 ' If ObjInventarios.GetMovimientosDetalle(CveMovimientoSalidaAjuste, UsuarioActual.CveEmpresa) Then
' For Each Dr As DataRow In ObjInventarios.DtResultados.Rows ' 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 ' TieneError = True
' Exit For ' Exit For
' End If ' End If
@@ -3257,7 +3257,7 @@ Partial Class OC
CveProveedor = dr("CveProveedor").ToString.ToEntero 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 IVACot = IVA '(DtDetalle.SUM("Total", String.Format("CveProveedor = {0}", CveProveedor)) * PorIVA).ToString.ToDecimal
RetIVA = TxtRetIVA.Text.ToDecimal RetIVA = TxtRetIVA.Text.ToDecimal
RetISR = TxtRetISR.Text.ToDecimal RetISR = TxtRetISR.Text.ToDecimal
@@ -3301,15 +3301,15 @@ Partial Class OC
End If End If
'AGREGA DETALLES 'AGREGA DETALLES
If Not objOrdenCompra.AddOrdenCompraDetalle(objOrdenCompra.CveOrdenCompra, dr("Cantidad").ToString.ToDouble(), dr("CveUnidadMedida").ToString.ToEntero, If Not objOrdenCompra.AddOrdenCompraDetalle(objOrdenCompra.CveOrdenCompra, dr("Cantidad").ToString.ToDecimal(), dr("CveUnidadMedida").ToString.ToEntero,
dr("CvePS").ToString.ToEntero, dr("Importe").ToString.ToDouble, dr("CveSubProyecto").ToString.ToEntero(), dr("CvePS").ToString.ToEntero, dr("Importe").ToString.ToDecimal, dr("CveSubProyecto").ToString.ToEntero(),
dr("CveActivoFijo").ToString.ToEntero, dr("Observacion").ToString, UsuarioActual.CveUsuario, CveOrdenCompra, dr("CveActivoFijo").ToString.ToEntero, dr("Observacion").ToString, UsuarioActual.CveUsuario, CveOrdenCompra,
CvePresupuestoEgreso:=dr("CvePresupuestoEgreso").ToString.ToEntero, Descuento:=dr("Descuento").ToString.ToDouble, CvePresupuestoEgreso:=dr("CvePresupuestoEgreso").ToString.ToEntero, Descuento:=dr("Descuento").ToString.ToDecimal,
IEPSPS:=dr("IEPSPS").ToString.ToDouble, IEPSPSIVA:=dr("IEPSPSIVA").ToString.ToDouble, IVA:=dr("IVA").ToString.ToDouble, IEPSPS:=dr("IEPSPS").ToString.ToDecimal, IEPSPSIVA:=dr("IEPSPSIVA").ToString.ToDecimal, IVA:=dr("IVA").ToString.ToDecimal,
RetIVA:=dr("RetIVA").ToString.ToDouble, RetISR:=dr("RetISR").ToString.ToDouble, Total:=dr("Total").ToString.ToDouble, RetIVA:=dr("RetIVA").ToString.ToDecimal, RetISR:=dr("RetISR").ToString.ToDecimal, Total:=dr("Total").ToString.ToDecimal,
CveContratoDetalle:=dr("CveContratoDetalle").ToString.ToEntero, IVAPorcentaje:=dr("IVAPorcentaje").ToString.ToDouble, CveContratoDetalle:=dr("CveContratoDetalle").ToString.ToEntero, IVAPorcentaje:=dr("IVAPorcentaje").ToString.ToDecimal,
RetIVAPorcentaje:=dr("RetIVAPorcentaje").ToString.ToDouble, RetISRPorcentaje:=dr("RetISRPorcentaje").ToString.ToDouble, RetIVAPorcentaje:=dr("RetIVAPorcentaje").ToString.ToDecimal, RetISRPorcentaje:=dr("RetISRPorcentaje").ToString.ToDecimal,
IEPSPSPorcentaje:=dr("IEPSPSPorcentaje").ToString.ToDouble, IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDouble, IEPSPSPorcentaje:=dr("IEPSPSPorcentaje").ToString.ToDecimal, IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDecimal,
CveTipoGastoObra:=dr("CveTipoGastoObra").ToString.ToEntero, CveCultivoCuadroDetalle:=dr("CveCultivoCuadroDetalle").ToString.ToEntero) Then CveTipoGastoObra:=dr("CveTipoGastoObra").ToString.ToEntero, CveCultivoCuadroDetalle:=dr("CveCultivoCuadroDetalle").ToString.ToEntero) Then
HuboError = True HuboError = True
Exit For Exit For
@@ -3332,7 +3332,7 @@ Partial Class OC
Else Else
If objOrdenCompra.AddOrdenCompra("OC", -1, TxtDescrip.Text, TxtJustificacion.Text, DdlPrioridad.SelectedValue.ToEntero, TxtFecha.Text.ToDate, DdlMoneda.SelectedValue.ToEntero, CveEstatusInicialOC, TxtFechaEstimadaEntrega.Text, LugarEntrega, 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, 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, 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 Promocion:=Promocion) Then
@@ -3351,7 +3351,7 @@ Partial Class OC
'CveOrdenCompra = objOrdenCompra.CveOrdenCompra 'CveOrdenCompra = objOrdenCompra.CveOrdenCompra
If Not HuboError Then If Not HuboError Then
For Each dr As DataRow In DtDetalle.Rows 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 HuboError = True
Exit For Exit For
End If End If
@@ -3764,7 +3764,7 @@ Partial Class OC
Drr = GlobalDTOCEstatus(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveEstatus = {0}", CveEstatus))(0) 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 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.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").Enabled = False
e.Row.FCLinkButton("imgE").ToolTip = "El concepto no se puede editar porque ya esta asignado a una compra" e.Row.FCLinkButton("imgE").ToolTip = "El concepto no se puede editar porque ya esta asignado a una compra"
e.Row.FCLinkButton("imgD").Enabled = False e.Row.FCLinkButton("imgD").Enabled = False
@@ -3774,7 +3774,7 @@ Partial Class OC
End If End If
'SI EL CONCEPTO YA TIENE ALGUNA RECEPCIÓN A ALMACÉN O VINCULACIÓN A COMPRA NO SE PUEDE ELIMINAR '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").Enabled = False
e.Row.FCLinkButton("imgD").ToolTip = "El concepto no se puede eliminar porque ya esta asignado a una compra" 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") e.Row.FCLinkButton("imgD").Attributes.Remove("Data-toggle")
@@ -3799,12 +3799,12 @@ Partial Class OC
FiltroClasificacion = String.Format("CveClasificacion = {0}", e.Row.DBCampo("CveClasificacion")) FiltroClasificacion = String.Format("CveClasificacion = {0}", e.Row.DBCampo("CveClasificacion"))
End If 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("DdlPS").Enabled = False
e.Row.FCDropDownList("DdlClasificacion").Enabled = False e.Row.FCDropDownList("DdlClasificacion").Enabled = False
e.Row.FCDropDownList("CboUnidadMedidaEdit").Enabled = False e.Row.FCDropDownList("CboUnidadMedidaEdit").Enabled = False
'que tenga el permiso que no bloquee '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("TxtImporteEdit").Enabled = False
e.Row.FCTextBox("TxtDescuentoEdit").Enabled = False e.Row.FCTextBox("TxtDescuentoEdit").Enabled = False
End If End If
@@ -3880,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("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("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 End If
@@ -3930,14 +3930,14 @@ Partial Class OC
End Sub End Sub
Protected Sub GvD_RowUpdating(sender As Object, e As GridViewUpdateEventArgs) Handles GvD.RowUpdating 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 CveUnidad, CveClasificacion, CveActivoFijo, CvePS, CveSubProyecto, CveProyecto, CveCultivoCuadroDetalle As Integer
Dim Obs, UM, Clasificacion, Codigo, PS, SubProyecto, Proyecto, Cuadro As String Dim Obs, UM, Clasificacion, Codigo, PS, SubProyecto, Proyecto, Cuadro As String
Dim gvr As GridViewRow = GvD.Rows(e.RowIndex) Dim gvr As GridViewRow = GvD.Rows(e.RowIndex)
Cantidad = gvr.FCTextBox("TxtCantEdit").Text.Trim.ToDouble Cantidad = gvr.FCTextBox("TxtCantEdit").Text.Trim.ToDecimal
Importe = gvr.FCTextBox("TxtImporteEdit").Text.Trim.ToDouble Importe = gvr.FCTextBox("TxtImporteEdit").Text.Trim.ToDecimal
Descuento = gvr.FCTextBox("TxtDescuentoEdit").Text.Trim.ToDouble Descuento = gvr.FCTextBox("TxtDescuentoEdit").Text.Trim.ToDecimal
Obs = gvr.FCTextBox("TxtObsPS").Text.Trim Obs = gvr.FCTextBox("TxtObsPS").Text.Trim
CveUnidad = gvr.FCDropDownList("CboUnidadMedidaEdit").SelectedValue.ToEntero CveUnidad = gvr.FCDropDownList("CboUnidadMedidaEdit").SelectedValue.ToEntero
UM = gvr.FCDropDownList("CboUnidadMedidaEdit").SelectedItem.Text UM = gvr.FCDropDownList("CboUnidadMedidaEdit").SelectedItem.Text
@@ -3947,11 +3947,11 @@ Partial Class OC
'SE TOMAN VALORES EN CASO DE QUE LA CvePS SEA DIFERENTE DE LA ANTERIOR 'SE TOMAN VALORES EN CASO DE QUE LA CvePS SEA DIFERENTE DE LA ANTERIOR
Dim CvePSAnterior = gvr.DataKey("CvePS").ToEntero Dim CvePSAnterior = gvr.DataKey("CvePS").ToEntero
PS = gvr.DataKey("PS").ToString PS = gvr.DataKey("PS").ToString
Dim RetISR = gvr.DataKey("RetISRPorcentaje").ToDouble Dim RetISR = gvr.DataKey("RetISRPorcentaje").ToDecimal
Dim RetIVA = gvr.DataKey("RetIVAPorcentaje").ToDouble Dim RetIVA = gvr.DataKey("RetIVAPorcentaje").ToDecimal
'Dim IvaPS = gvr.DataKey("IVAPorcentaje").ToDouble 'Dim IvaPS = gvr.DataKey("IVAPorcentaje").ToDecimal
Dim IEPSPS = gvr.DataKey("IEPSPSPorcentaje").ToDouble Dim IEPSPS = gvr.DataKey("IEPSPSPorcentaje").ToDecimal
Dim IEPSPSIVA = gvr.DataKey("IEPSPSIVAPorcentaje").ToDouble Dim IEPSPSIVA = gvr.DataKey("IEPSPSIVAPorcentaje").ToDecimal
Dim Total = Importe * Cantidad - Descuento Dim Total = Importe * Cantidad - Descuento
@@ -3965,17 +3965,17 @@ Partial Class OC
Exit Sub Exit Sub
End If End If
Dim IvaPS = DrPS("IVA").ToString.ToDecimal 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) IEPSPSIVA = If(DrPS("IEPSGrabaIVA").ToString = "True", DrPS("IEPSPorcentaje").ToString.ToDecimal, 0)
If CvePS <> CvePSAnterior Or Not CveOrdenCompra > 0 Then If CvePS <> CvePSAnterior Or Not CveOrdenCompra > 0 Then
RetISR = DrPS("RetISR").ToString.ToDouble RetISR = DrPS("RetISR").ToString.ToDecimal
RetIVA = DrPS("RetIVA").ToString.ToDouble RetIVA = DrPS("RetIVA").ToString.ToDecimal
'If IvaPS = -1 Then 'IVA DE LA SUCURSAL '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 '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 End If
@@ -4003,21 +4003,21 @@ Partial Class OC
If UsuarioActual.Empresa.Funcionalidad(532) = "1" Then If UsuarioActual.Empresa.Funcionalidad(532) = "1" Then
Dim ObjCon As New ClsContratos Dim ObjCon As New ClsContratos
Dim CvePresupuesto As Integer = 0 Dim CvePresupuesto As Integer = 0
Dim Autorizado As Double = 0 Dim Autorizado As Decimal = 0
Dim Ejercido As Double = 0 Dim Ejercido As Decimal = 0
If ObjCon.GetPresupuestos(-1, "-1", CveSubProyecto, 2, -1, UsuarioActual.CveEmpresa) Then If ObjCon.GetPresupuestos(-1, "-1", CveSubProyecto, 2, -1, UsuarioActual.CveEmpresa) Then
If ObjCon.DtResultados.Rows.Count > 0 Then If ObjCon.DtResultados.Rows.Count > 0 Then
CvePresupuesto = ObjCon.DtResultados.Rows(0)("CvePresupuesto").ToString.ToEntero CvePresupuesto = ObjCon.DtResultados.Rows(0)("CvePresupuesto").ToString.ToEntero
If CvePresupuesto > 0 Then If CvePresupuesto > 0 Then
If ObjCon.GetPresupuestosDetalle(CvePresupuesto, -1, UsuarioActual.CveEmpresa) Then If ObjCon.GetPresupuestosDetalle(CvePresupuesto, -1, UsuarioActual.CveEmpresa) Then
If ObjCon.DtResultados.FiltraParametros($"CveClasificacion = {CveClasificacion} And Importe > 0").Rows.Count > 0 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
End If End If
If ObjCon.GetPresupuestosRep(CvePresupuesto, -1, 1, $"01/09/{DateTime.Now.Year - 1}".ToDate, Now, UsuarioActual.CveEmpresa, CveProyecto, If ObjCon.GetPresupuestosRep(CvePresupuesto, -1, 1, $"01/09/{DateTime.Now.Year - 1}".ToDate, Now, UsuarioActual.CveEmpresa, CveProyecto,
CveSubProyecto, UsuarioActual.CveUsuario, CveClasificacion) Then CveSubProyecto, UsuarioActual.CveUsuario, CveClasificacion) Then
If ObjCon.DtResultados.Rows.Count > 0 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 End If
End If End If
@@ -4026,7 +4026,7 @@ Partial Class OC
ObjCon.Dispose() ObjCon.Dispose()
If CvePresupuesto > 0 And Autorizado > 0 Then 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 If Diferencia > 0 Then
Alert($"No hay presupuesto disponible en el subproyecto <b>{SubProyecto}</b> y la clasificación <b>{Clasificacion}</b> se excede por <b>{Diferencia.FormatoNumero}</b>", TipoMensaje.MsgAdvertencia) Alert($"No hay presupuesto disponible en el subproyecto <b>{SubProyecto}</b> y la clasificación <b>{Clasificacion}</b> se excede por <b>{Diferencia.FormatoNumero}</b>", TipoMensaje.MsgAdvertencia)
Exit Sub Exit Sub
@@ -4073,11 +4073,11 @@ Partial Class OC
dr(0)("IEPSPSIVA") = IEPSPSIVA * Total dr(0)("IEPSPSIVA") = IEPSPSIVA * Total
dr(0)("IEPSPSIVAPorcentaje") = IEPSPSIVA dr(0)("IEPSPSIVAPorcentaje") = IEPSPSIVA
'If DdlIVA.SelectedValue.ToDouble = 1 Then dr(0)("IVA") = 0 Else dr(0)("IVA") = IvaPS * Total '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.ToDouble - 1, 2), 0) dr(0)("IVAPorcentaje") = If(IvaPS = -1, Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2), 0)
Dim TotalGravado As Decimal = Total Dim TotalGravado As Decimal = Total
If IEPSPSIVA > 0 Then TotalGravado = Total * (1 + IEPSPSIVA) 'grava para iva, el importe del IEPS 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)("RetIVA") = RetIVA * Total
dr(0)("RetIVAPorcentaje") = RetIVA dr(0)("RetIVAPorcentaje") = RetIVA
@@ -4480,7 +4480,7 @@ Partial Class OC
If UsuarioActual.Empresa.UsaAC And VerificaPresupuesto Then If UsuarioActual.Empresa.UsaAC And VerificaPresupuesto Then
Dim ContPaq As New ClsContPAQi(UsuarioActual.Empresa) Dim ContPaq As New ClsContPAQi(UsuarioActual.Empresa)
Dim disponible As Double Dim disponible As Decimal
Dim ErrorPresupuesto = False Dim ErrorPresupuesto = False
Dim Ddl1 As DropDownList Dim Ddl1 As DropDownList
@@ -4488,7 +4488,7 @@ Partial Class OC
Dim Ddl3 As DropDownList Dim Ddl3 As DropDownList
Dim Ddl4 As DropDownList Dim Ddl4 As DropDownList
Dim Ddl5 As DropDownList Dim Ddl5 As DropDownList
Dim Total As Double Dim Total As Decimal
Dim DtPresupuestosTemp As DataTable Dim DtPresupuestosTemp As DataTable
Dim Filtro As New StringBuilder Dim Filtro As New StringBuilder
@@ -4499,7 +4499,7 @@ Partial Class OC
Ddl3 = grid.FCDropDownList("DdlAC3") Ddl3 = grid.FCDropDownList("DdlAC3")
Ddl4 = grid.FCDropDownList("DdlAC4") Ddl4 = grid.FCDropDownList("DdlAC4")
Ddl5 = grid.FCDropDownList("DdlAC5") Ddl5 = grid.FCDropDownList("DdlAC5")
Total = grid.FCLiteral("LtlTotal").Text.ToDouble Total = grid.FCLiteral("LtlTotal").Text.ToDecimal
'OBTENEMOS EL REGISTRO DEL PE SELECCIONADO '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)) 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))
@@ -4644,8 +4644,8 @@ Partial Class OC
End If End If
'ACTUALIZO DATO EN DB '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, 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.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 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 TieneError = True
End If End If
@@ -4692,31 +4692,31 @@ Partial Class OC
e.Row.CssClass = "SubTotales" e.Row.CssClass = "SubTotales"
For i As Integer = 1 To NumCotizaciones For i As Integer = 1 To NumCotizaciones
Dim Btn As Button = e.Row.FCButton(String.Format("Btn{0}", i)) 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.Visible = True
'Btn.Enabled = True 'Btn.Enabled = True
'Btn.OnClientClick = "return false;" '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 Next
Else Else
Dim CellMasBarato As Integer = -1 Dim CellMasBarato As Integer = -1
Dim Monto As Double = -1 Dim Monto As Decimal = -1
For i As Integer = 1 To NumCotizaciones For i As Integer = 1 To NumCotizaciones
Dim Btn As Button = e.Row.FCButton(String.Format("Btn{0}", i)) 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.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") 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 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 CellMasBarato = i
End If 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 CellMasBarato = i
Monto = e.Row.DBCampo(String.Format("PU{0}", i)).ToDouble Monto = e.Row.DBCampo(String.Format("PU{0}", i)).ToDecimal
End If End If
Else Else
Btn.Text = "Sin captura" Btn.Text = "Sin captura"
@@ -4739,7 +4739,7 @@ Partial Class OC
Dim i As Integer = 1 Dim i As Integer = 1
For Each dr As DataRow In DtCotizaciones.Rows For Each dr As DataRow In DtCotizaciones.Rows
Dim Btn As Button = e.Row.FCButton("Btn" & i) 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 If e.Row.DBCampo("EsGanadora" & i).ToString = "True" Then
@@ -5268,7 +5268,7 @@ Partial Class OC
Dim TieneError = False 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 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 TieneError = True
End If End If
Else Else
@@ -5382,7 +5382,7 @@ Partial Class OC
strBody.Append(" <div class=""portlet box red"">") strBody.Append(" <div class=""portlet box red"">")
strBody.Append(" <div class=""portlet-title"">") strBody.Append(" <div class=""portlet-title"">")
strBody.Append(" <div class=""caption"">") strBody.Append(" <div class=""caption"">")
strBody.Append($" <i class=""fa fa-cart-plus""></i>Solicitud de anticipo {If(importe.ToDouble > 0, "", " <b>CANCELADA</b> ")}") strBody.Append($" <i class=""fa fa-cart-plus""></i>Solicitud de anticipo {If(importe.ToDecimal > 0, "", " <b>CANCELADA</b> ")}")
strBody.Append(" </div>") strBody.Append(" </div>")
strBody.Append(" </div>") strBody.Append(" </div>")
strBody.Append(" <div class=""portlet-body "">") strBody.Append(" <div class=""portlet-body "">")
@@ -5419,13 +5419,13 @@ Partial Class OC
strBody.Append(" <td>") strBody.Append(" <td>")
strBody.Append(folio) strBody.Append(folio)
strBody.Append("</td> </tr>") strBody.Append("</td> </tr>")
If importe.ToDouble > 0 Then If importe.ToDecimal > 0 Then
strBody.Append(" <td>Importe Anticipo:</td>") strBody.Append(" <td>Importe Anticipo:</td>")
strBody.Append(" <td>") strBody.Append(" <td>")
strBody.AppendFormat("{0} {1}", importe, Abreviatura) strBody.AppendFormat("{0} {1}", importe, Abreviatura)
strBody.Append("</td> </tr>") strBody.Append("</td> </tr>")
End If End If
If LblTotal.Text.Trim.ToDouble > 0 Then If LblTotal.Text.Trim.ToDecimal > 0 Then
strBody.Append(" <td>Importe OC:</td>") strBody.Append(" <td>Importe OC:</td>")
strBody.Append(" <td>") strBody.Append(" <td>")
strBody.AppendFormat("{0} {1}", LblTotal.Text, Abreviatura) strBody.AppendFormat("{0} {1}", LblTotal.Text, Abreviatura)
@@ -5560,7 +5560,7 @@ Partial Class OC
If dtpresupuestos.Rows.Count > 0 AndAlso dtpresupuestos.Select(psclasificacion).Count > 0 Then If dtpresupuestos.Rows.Count > 0 AndAlso dtpresupuestos.Select(psclasificacion).Count > 0 Then
Dim rowpresupuesto As DataRow = dtpresupuestos.Select(psclasificacion)(0) Dim rowpresupuesto As DataRow = dtpresupuestos.Select(psclasificacion)(0)
rowpresupuesto("Importe") = rowpresupuesto("Importe").ToString.ToDouble - dr("Total").ToString.ToDouble() rowpresupuesto("Importe") = rowpresupuesto("Importe").ToString.ToDecimal - dr("Total").ToString.ToDecimal()
Else Else
If subproyectos.Contains(dr("CveSubProyecto").ToString.ToEntero) Then If subproyectos.Contains(dr("CveSubProyecto").ToString.ToEntero) Then
notienerecursos = True notienerecursos = True
@@ -5574,7 +5574,7 @@ Partial Class OC
dtpresupuestos.AcceptChanges() dtpresupuestos.AcceptChanges()
' '
For Each rowpresupuesto As DataRow In dtpresupuestos.Rows For Each rowpresupuesto As DataRow In dtpresupuestos.Rows
If (rowpresupuesto("Importe").ToString.ToDouble() < 0) Then If (rowpresupuesto("Importe").ToString.ToDecimal() < 0) Then
If Not subproyectosSr.Contains(rowpresupuesto("CveSubProyecto").ToString.ToEntero) Then If Not subproyectosSr.Contains(rowpresupuesto("CveSubProyecto").ToString.ToEntero) Then
subproyectosSr.Add(rowpresupuesto("CveSubProyecto").ToString.ToEntero) subproyectosSr.Add(rowpresupuesto("CveSubProyecto").ToString.ToEntero)
SinRecursos.AppendFormat(",{0}", rowpresupuesto("SubProyecto").ToString) SinRecursos.AppendFormat(",{0}", rowpresupuesto("SubProyecto").ToString)
@@ -6526,7 +6526,7 @@ Partial Class OC
Dim Proyecto As String = Row("Proyecto").ToString.Trim.ToUpper Dim Proyecto As String = Row("Proyecto").ToString.Trim.ToUpper
Dim Observaciones As String = Row("Observaciones").ToString Dim Observaciones As String = Row("Observaciones").ToString
Dim PrecioUnitario As String = Row("PU").ToString Dim PrecioUnitario As String = Row("PU").ToString
Dim Descuento As Double = Row("Descuento").ToString.ToDouble * Cantidad.ToDouble 'RMF, cambio a multiplicar por cantidad 2018.04.21 Dim Descuento As Decimal = Row("Descuento").ToString.ToDecimal * Cantidad.ToDecimal 'RMF, cambio a multiplicar por cantidad 2018.04.21
Dim CvePS As Integer = 0 Dim CvePS As Integer = 0
Dim CveProyecto As Integer = 0 Dim CveProyecto As Integer = 0
Dim CveSubProyecto As Integer = 0 Dim CveSubProyecto As Integer = 0
@@ -6594,19 +6594,19 @@ Partial Class OC
Alert("Ocurrió un error al cargar la información de los productos del archivo. Por favor vuelva a intentar.", TipoMensaje.MsgAdvertencia) Alert("Ocurrió un error al cargar la información de los productos del archivo. Por favor vuelva a intentar.", TipoMensaje.MsgAdvertencia)
Continue For Continue For
End If End If
Dim RetIVA As Double = DrPS("RetIVA").ToString.ToDouble Dim RetIVA As Decimal = DrPS("RetIVA").ToString.ToDecimal
Dim RetISR As Double = DrPS("RetISR").ToString.ToDouble Dim RetISR As Decimal = DrPS("RetISR").ToString.ToDecimal
Dim PS As String = DrPS("PS").ToString Dim PS As String = DrPS("PS").ToString
Dim TotalPS As Double = If(PrecioUnitario.ToDouble > 0, PrecioUnitario.ToDouble * Cantidad.ToDouble - Descuento, 0) Dim TotalPS As Decimal = If(PrecioUnitario.ToDecimal > 0, PrecioUnitario.ToDecimal * Cantidad.ToDecimal - Descuento, 0)
Dim CveUnidadMedida As Integer = DrPS("CveUnidadMedida").ToString.ToEntero Dim CveUnidadMedida As Integer = DrPS("CveUnidadMedida").ToString.ToEntero
Dim UM As String = DrPS("UnidadMedida").ToString Dim UM As String = DrPS("UnidadMedida").ToString
Dim IvaPS As Double = DrPS("IVA").ToString.ToDouble Dim IvaPS As Decimal = DrPS("IVA").ToString.ToDecimal
'If IvaPS = -1 Then 'If IvaPS = -1 Then
' Dim Drr As DataRow = GlobalDTSubProyectos(-1, DdlSubProyecto.SelectedValue.ToEntero())(0) ' Dim Drr As DataRow = GlobalDTSubProyectos(-1, DdlSubProyecto.SelectedValue.ToEntero())(0)
' IvaPS = Drr("IVA").ToString().ToDouble() ' IvaPS = Drr("IVA").ToString().ToDecimal()
'End If 'End If
Dim IEPSPS As Double = DrPS("IEPSPorcentaje").ToString.ToDouble Dim IEPSPS As Decimal = DrPS("IEPSPorcentaje").ToString.ToDecimal
Dim IEPSPSIVA As Double = If(DrPS("IEPSGrabaIVA").ToString = "True", DrPS("IEPSPorcentaje").ToString.ToDouble, 0) Dim IEPSPSIVA As Decimal = If(DrPS("IEPSGrabaIVA").ToString = "True", DrPS("IEPSPorcentaje").ToString.ToDecimal, 0)
Dim CveClasificacion As Integer = DrPS("CveClasificacion").ToString.ToEntero Dim CveClasificacion As Integer = DrPS("CveClasificacion").ToString.ToEntero
Dim Clasificacion As String = DrPS("Clasificacion").ToString Dim Clasificacion As String = DrPS("Clasificacion").ToString
Dim CveActivoFijo = HdnCveActivoFijo.Value.ToEntero Dim CveActivoFijo = HdnCveActivoFijo.Value.ToEntero
@@ -6614,7 +6614,7 @@ Partial Class OC
Dim IdCuentaComprometido As Integer = If(HdnCveCuentaComprometido.Value = String.Empty, -1, HdnCveCuentaComprometido.Value.ToEntero) Dim IdCuentaComprometido As Integer = If(HdnCveCuentaComprometido.Value = String.Empty, -1, HdnCveCuentaComprometido.Value.ToEntero)
Dim CveOrdenCompraDetalle As Integer = DtDetalle.MAX("CveOrdenCompraDetalle").ToEntero + 100 Dim CveOrdenCompraDetalle As Integer = DtDetalle.MAX("CveOrdenCompraDetalle").ToEntero + 100
AddPS(Cantidad, CvePS, PS, Observaciones, PrecioUnitario.ToDouble, Descuento, TotalPS, CveUnidadMedida, IvaPS, IEPSPS, IEPSPSIVA, CveClasificacion, UM, Clasificacion, CveSubProyecto, Proyecto, CveSubProyecto, SubProyecto, LblCodigo.Text, AddPS(Cantidad, CvePS, PS, Observaciones, PrecioUnitario.ToDecimal, Descuento, TotalPS, CveUnidadMedida, IvaPS, IEPSPS, IEPSPSIVA, CveClasificacion, UM, Clasificacion, CveSubProyecto, Proyecto, CveSubProyecto, SubProyecto, LblCodigo.Text,
CveActivoFijo, 0, CveOrdenCompraDetalle, CveOrdenCompra, IdCuentaPorEjercer, IdCuentaComprometido, DdlACGeneral1.SelectedValue.ToEntero, DdlACGeneral2.SelectedValue.ToEntero, DdlACGeneral3.SelectedValue.ToEntero, DdlACGeneral4.SelectedValue.ToEntero, CveActivoFijo, 0, CveOrdenCompraDetalle, CveOrdenCompra, IdCuentaPorEjercer, IdCuentaComprometido, DdlACGeneral1.SelectedValue.ToEntero, DdlACGeneral2.SelectedValue.ToEntero, DdlACGeneral3.SelectedValue.ToEntero, DdlACGeneral4.SelectedValue.ToEntero,
DdlACGeneral5.SelectedValue.ToEntero, RetIVA, RetISR) DdlACGeneral5.SelectedValue.ToEntero, RetIVA, RetISR)
@@ -7183,13 +7183,13 @@ Partial Class OC
'SE ACTUALIZA EL IVA DEL DtDetalle SI ES QUE AHORA SE VA A TOMAR EN CUENTA EL IVA 'SE ACTUALIZA EL IVA DEL DtDetalle SI ES QUE AHORA SE VA A TOMAR EN CUENTA EL IVA
For Each Row As DataRow In DtDetalle.Rows For Each Row As DataRow In DtDetalle.Rows
If Not Math.Round(DdlIVA.SelectedValue.ToDouble, 2) = 1 Then If Not Math.Round(DdlIVA.SelectedValue.ToDecimal, 2) = 1 Then
Dim DrPS = GlobalDTPS(CveEmpresaActual, CvePS:=Row("CvePS").ToString.ToEntero).FiltroPrimero("") Dim DrPS = GlobalDTPS(CveEmpresaActual, CvePS:=Row("CvePS").ToString.ToEntero).FiltroPrimero("")
If DrPS IsNot Nothing Then If DrPS IsNot Nothing Then
Row("IVAPorcentaje") = If(DrPS("IVA").ToString.ToEntero = -1, Math.Round(DdlIVA.SelectedValue.ToDouble - 1, 2), 0) Row("IVAPorcentaje") = If(DrPS("IVA").ToString.ToEntero = -1, Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2), 0)
Row("IVA") = Row("IVAPorcentaje").ToString.ToDouble * Row("Total").ToString.ToDouble Row("IVA") = Row("IVAPorcentaje").ToString.ToDecimal * Row("Total").ToString.ToDecimal
Row("RetIVAPorcentaje") = DrPS("RetIVA").ToString.ToDouble Row("RetIVAPorcentaje") = DrPS("RetIVA").ToString.ToDecimal
Row("RetIVA") = Row("RetIVAPorcentaje").ToString.ToDouble * Row("Total").ToString.ToDouble Row("RetIVA") = Row("RetIVAPorcentaje").ToString.ToDecimal * Row("Total").ToString.ToDecimal
End If End If
Else Else
Row("IVA") = 0 Row("IVA") = 0
@@ -7203,13 +7203,13 @@ Partial Class OC
End Sub End Sub
Private Sub CalculaGenerales() Private Sub CalculaGenerales()
Dim Subtotal As Double = DtDetalle.SUM("Total", "Total > 0") + DtDetalle.SUM("Descuento") Dim Subtotal As Decimal = DtDetalle.SUM("Total", "Total > 0") + DtDetalle.SUM("Descuento")
Dim Descuento As Double = DtDetalle.SUM("Descuento") Dim Descuento As Decimal = DtDetalle.SUM("Descuento")
Dim SubTotalIEPSIVA As Double = DtDetalle.SUM("IEPSPSIVA") Dim SubTotalIEPSIVA As Decimal = DtDetalle.SUM("IEPSPSIVA")
Dim IVA As Double = DtDetalle.SUM("IVA") + SubTotalIEPSIVA Dim IVA As Decimal = DtDetalle.SUM("IVA") + SubTotalIEPSIVA
Dim SubTotalIEPS As Double = DtDetalle.SUM("IEPSPS") Dim SubTotalIEPS As Decimal = DtDetalle.SUM("IEPSPS")
Dim SubTotalRetIVA As Double = DtDetalle.SUM("RetIVA") Dim SubTotalRetIVA As Decimal = DtDetalle.SUM("RetIVA")
Dim SubTotalRetISR As Double = DtDetalle.SUM("RetISR") Dim SubTotalRetISR As Decimal = DtDetalle.SUM("RetISR")
'SUBTOTAL 'SUBTOTAL
LblSubTotal.Text = (Subtotal).FormatoNumero LblSubTotal.Text = (Subtotal).FormatoNumero
@@ -7271,9 +7271,9 @@ Partial Class OC
TrIEPS.Visible = True TrIEPS.Visible = True
Else Else
ImgAplicaRetenciones.ImageUrl = "/Metronic/assets/global/img/portlet-collapse-icon.png" ImgAplicaRetenciones.ImageUrl = "/Metronic/assets/global/img/portlet-collapse-icon.png"
If Not TxtRetIVA.Text.ToDouble > 0 Then TrRetIVA.Visible = False If Not TxtRetIVA.Text.ToDecimal > 0 Then TrRetIVA.Visible = False
If Not TxtRetISR.Text.ToDouble > 0 Then TrRetISR.Visible = False If Not TxtRetISR.Text.ToDecimal > 0 Then TrRetISR.Visible = False
If Not TxtIEPS.Text.ToDouble > 0 Then TrIEPS.Visible = False If Not TxtIEPS.Text.ToDecimal > 0 Then TrIEPS.Visible = False
End If End If
'ImgAplicaRetenciones.ImageUrl = If(TrRetIVA.Visible, "/Metronic/assets/global/img/portlet-collapse-icon.png", "/Metronic/assets/global/img/portlet-expand-icon.png") 'ImgAplicaRetenciones.ImageUrl = If(TrRetIVA.Visible, "/Metronic/assets/global/img/portlet-collapse-icon.png", "/Metronic/assets/global/img/portlet-expand-icon.png")
@@ -7283,15 +7283,15 @@ Partial Class OC
TxtRetISR.Text = TxtRetISR.Text.FormatoNumero TxtRetISR.Text = TxtRetISR.Text.FormatoNumero
TxtIEPS.Text = TxtIEPS.Text.FormatoNumero TxtIEPS.Text = TxtIEPS.Text.FormatoNumero
End Sub End Sub
Private Sub CargaRetenciones(RetIVA As Double, RetISR As Double, IEPS As Double) Private Sub CargaRetenciones(RetIVA As Decimal, RetISR As Decimal, IEPS As Decimal)
If RetIVA > 0 Or RetISR > 0 Or IEPS > 0 Then If RetIVA > 0 Or RetISR > 0 Or IEPS > 0 Then
TrRetIVA.Visible = True TrRetIVA.Visible = True
TxtRetIVA.Text = RetIVA.ToString.ToDouble.FormatoNumero TxtRetIVA.Text = RetIVA.ToString.ToDecimal.FormatoNumero
TrRetISR.Visible = True TrRetISR.Visible = True
TxtRetISR.Text = RetISR.ToString.ToDouble.FormatoNumero TxtRetISR.Text = RetISR.ToString.ToDecimal.FormatoNumero
TrIEPS.Visible = True TrIEPS.Visible = True
TxtIEPS.Text = IEPS.ToString.ToDouble.FormatoNumero TxtIEPS.Text = IEPS.ToString.ToDecimal.FormatoNumero
End If End If
End Sub End Sub
@@ -7370,7 +7370,7 @@ Partial Class OC
Dim Retorno = True Dim Retorno = True
Dim DescuentoConceptos = DtDetalle.SUM("Descuento") Dim DescuentoConceptos = DtDetalle.SUM("Descuento")
Dim DescuentoGeneral = TxtDescuento.Text.ToDouble Dim DescuentoGeneral = TxtDescuento.Text.ToDecimal
If DescuentoConceptos <> DescuentoGeneral Then If DescuentoConceptos <> DescuentoGeneral Then
Alert(String.Format("Los descuentos no cuadran. Por favor de verificar.({0}-{1})", DescuentoConceptos, DescuentoGeneral), TipoMensaje.MsgAdvertencia) Alert(String.Format("Los descuentos no cuadran. Por favor de verificar.({0}-{1})", DescuentoConceptos, DescuentoGeneral), TipoMensaje.MsgAdvertencia)
@@ -7575,7 +7575,7 @@ Partial Class OC
End If End If
For Each row As GridViewRow In GvContratos.Rows For Each row As GridViewRow In GvContratos.Rows
If row.FCTextBox("TxtCantContrato").Text.Trim.ToDouble > 0 And row.FCTextBox("TxtPrecioContrato").Text.Trim.ToDouble > 0 Then If row.FCTextBox("TxtCantContrato").Text.Trim.ToDecimal > 0 And row.FCTextBox("TxtPrecioContrato").Text.Trim.ToDecimal > 0 Then
Selecciono = True Selecciono = True
Exit For Exit For
End If End If
@@ -7588,9 +7588,9 @@ Partial Class OC
DtDetalle.Rows.Clear() DtDetalle.Rows.Clear()
For Each row As GridViewRow In GvContratos.Rows For Each row As GridViewRow In GvContratos.Rows
If row.FCTextBox("TxtCantContrato").Text.Trim.ToDouble > 0 And row.FCTextBox("TxtPrecioContrato").Text.Trim.ToDouble > 0 Then If row.FCTextBox("TxtCantContrato").Text.Trim.ToDecimal > 0 And row.FCTextBox("TxtPrecioContrato").Text.Trim.ToDecimal > 0 Then
Dim Cantidad As Double = row.FCTextBox("TxtCantContrato").Text.Trim.ToDouble Dim Cantidad As Decimal = row.FCTextBox("TxtCantContrato").Text.Trim.ToDecimal
Dim Importe As Double = row.FCTextBox("TxtPrecioContrato").Text.Trim.ToDouble Dim Importe As Decimal = row.FCTextBox("TxtPrecioContrato").Text.Trim.ToDecimal
Dim DrPS = GlobalDTPS(CveEmpresaActual, CvePS:=row.DataKey("CvePS").ToEntero).FiltroPrimero("") Dim DrPS = GlobalDTPS(CveEmpresaActual, CvePS:=row.DataKey("CvePS").ToEntero).FiltroPrimero("")
If DrPS Is Nothing Then If DrPS Is Nothing Then
@@ -7598,20 +7598,20 @@ Partial Class OC
Exit Sub Exit Sub
End If End If
Dim RetISR As Double = DrPS("RetISR").ToString.ToDouble Dim RetISR As Decimal = DrPS("RetISR").ToString.ToDecimal
Dim RetIVA As Double = DrPS("RetIVA").ToString.ToDouble Dim RetIVA As Decimal = DrPS("RetIVA").ToString.ToDecimal
Dim IvaPS As Double = DrPS("IVA").ToString.ToDouble Dim IvaPS As Decimal = DrPS("IVA").ToString.ToDecimal
'If IvaPS = -1 Then 'IVA DE LA SUCURSAL '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 'End If
Dim IEPSPS As Double = DrPS("IEPSPorcentaje").ToString.ToDouble Dim IEPSPS As Decimal = DrPS("IEPSPorcentaje").ToString.ToDecimal
Dim IEPSPSIVA As Double = If(DrPS("IEPSGrabaIVA").ToString = "True", DrPS("IEPSPorcentaje").ToString.ToDouble, 0) 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 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 IdCuentaComprometido As Integer = If(HdnCveCuentaComprometido.Value = String.Empty, -1, HdnCveCuentaComprometido.Value.ToEntero)
Dim TotalPS As Double = If(Importe > 0, (Importe * Cantidad), 0) Dim TotalPS As Decimal = If(Importe > 0, (Importe * Cantidad), 0)
Dim ImportePS As Double = If(Importe > 0, Importe, 0) Dim ImportePS As Decimal = If(Importe > 0, Importe, 0)
Dim CveOrdenCompraDetalle As Integer = DtDetalle.MAX("CveOrdenCompraDetalle").ToEntero + 100 Dim CveOrdenCompraDetalle As Integer = DtDetalle.MAX("CveOrdenCompraDetalle").ToEntero + 100
@@ -7960,8 +7960,8 @@ Partial Class OC
Dim CveUnidadMedida As Integer = RowPS("CveUnidadMedida").ToString().ToEntero() Dim CveUnidadMedida As Integer = RowPS("CveUnidadMedida").ToString().ToEntero()
Dim Fecha As String = If(String.IsNullOrEmpty(dr("FechaEntrega").ToString()), "", If(IsDate(dr("FechaEntrega").ToString()), dr("FechaEntrega").ToString(), "")) Dim Fecha As String = If(String.IsNullOrEmpty(dr("FechaEntrega").ToString()), "", If(IsDate(dr("FechaEntrega").ToString()), dr("FechaEntrega").ToString(), ""))
TieneError = Not objCotizacion.AddCotizacionDetalle(objCotizacion.CveCotizacion, CvePS, dr("PrecioUnitario").ToString().ToDecimal(), dr("Cantidad").ToString().ToDouble, CveUnidadMedida, TieneError = Not objCotizacion.AddCotizacionDetalle(objCotizacion.CveCotizacion, CvePS, dr("PrecioUnitario").ToString().ToDecimal(), dr("Cantidad").ToString().ToDecimal, CveUnidadMedida,
dr("Cantidad").ToString().ToDouble, Fecha, dr("Observacion").ToString(), CveOrdenCompraDetalle) dr("Cantidad").ToString().ToDecimal, Fecha, dr("Observacion").ToString(), CveOrdenCompraDetalle)
If TieneError = True Then Exit For If TieneError = True Then Exit For
Next Next
End If End If
@@ -8183,7 +8183,7 @@ Partial Class OC
' Dim Promocion = TxtPromocion.Text.Trim ' Dim Promocion = TxtPromocion.Text.Trim
' Dim TCDecimal As Decimal = TxtTCCambioMoneda.Text.ToDecimal ' Dim TCDecimal As Decimal = TxtTCCambioMoneda.Text.ToDecimal
' Dim TCDouble As Double = TxtTCCambioMoneda.Text.ToDouble ' Dim TCDouble As Double = TxtTCCambioMoneda.Text.ToDecimal
' If TipoMoneda = "2" Then ' If TipoMoneda = "2" Then
' Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("OC/OC-(OCAlmacen)", 74, 0.0D, 0.0D, 1, Now, DdlProveedores.SelectedText, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) ' Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("OC/OC-(OCAlmacen)", 74, 0.0D, 0.0D, 1, Now, DdlProveedores.SelectedText, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
@@ -8200,16 +8200,16 @@ Partial Class OC
' LugarEntrega, 1, CveProveedor, CveOrdenCompra, UsuarioActual.CveUsuario, Ddlcliente.txtValue.Value.ToEntero, DdlVendedor.SelectedValue.ToEntero, txtobsprioridad.Text, IVA:=(IVA * TCDecimal), RetIVA:=(TxtRetIVA.Text.ToDecimal * TCDecimal), ' LugarEntrega, 1, CveProveedor, CveOrdenCompra, UsuarioActual.CveUsuario, Ddlcliente.txtValue.Value.ToEntero, DdlVendedor.SelectedValue.ToEntero, txtobsprioridad.Text, IVA:=(IVA * TCDecimal), RetIVA:=(TxtRetIVA.Text.ToDecimal * TCDecimal),
' RetISR:=(TxtRetISR.Text.ToDecimal * TCDecimal), FolioAdicional:=TxtFolioAdicional.Text, EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), ' RetISR:=(TxtRetISR.Text.ToDecimal * TCDecimal), 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, ' 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
' Err = True ' Err = True
' Else ' Else
' For Each dr As DataRow In DtDetalle.FiltraParametros("TipoDato IN (1)").Rows ' 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 * TCDouble), dr("CveSubProyecto").ToString.ToEntero, ' If OC.UpdateOrdenCompraDetalle(dr("Cantidad").ToString.ToDecimal, dr("CveUnidadMedida").ToString.ToEntero, dr("CvePS").ToString.ToEntero, (dr("Importe").ToString.ToDecimal * TCDouble), 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("CveActivoFijo").ToString.ToEntero, dr("Observacion").ToString, UsuarioActual.CveUsuario, dr("CveOrdenCompraDetalle").ToString.ToEntero, If(TipoOC = "REQ", -1, dr("CvePresupuestoEgreso").ToString.ToEntero),
' (dr("Descuento").ToString.ToDouble * TCDouble), IEPSPS:=(dr("IEPSPS").ToString.ToDouble * TCDouble), IEPSPSIVA:=(dr("IEPSPSIVA").ToString.ToDouble * TCDouble), IVA:=(dr("IVA").ToString.ToDouble * TCDouble), ' (dr("Descuento").ToString.ToDecimal * TCDouble), IEPSPS:=(dr("IEPSPS").ToString.ToDecimal * TCDouble), IEPSPSIVA:=(dr("IEPSPSIVA").ToString.ToDecimal * TCDouble), IVA:=(dr("IVA").ToString.ToDecimal * TCDouble),
' RetIVA:=(dr("RetIVA").ToString.ToDouble * TCDouble), RetISR:=(dr("RetISR").ToString.ToDouble * TCDouble), Total:=(dr("Total").ToString.ToDouble * TCDouble), CveContratoDetalle:=dr("CveContratoDetalle").ToString.ToEntero, ' RetIVA:=(dr("RetIVA").ToString.ToDecimal * TCDouble), RetISR:=(dr("RetISR").ToString.ToDecimal * TCDouble), Total:=(dr("Total").ToString.ToDecimal * TCDouble), 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, ' IVAPorcentaje:=dr("IVAPorcentaje").ToString.ToDecimal, RetIVAPorcentaje:=dr("RetIVAPorcentaje").ToString.ToDecimal, RetISRPorcentaje:=dr("RetISRPorcentaje").ToString.ToDecimal, IEPSPSPorcentaje:=dr("IEPSPSPorcentaje").ToString.ToDecimal,
' IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDouble) <= 0 Then ' IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDecimal) <= 0 Then
' Err = True ' Err = True
' Exit For ' Exit For
' End If ' End If
@@ -8237,16 +8237,16 @@ Partial Class OC
' LugarEntrega, 2, CveProveedor, CveOrdenCompra, UsuarioActual.CveUsuario, Ddlcliente.txtValue.Value.ToEntero, DdlVendedor.SelectedValue.ToEntero, txtobsprioridad.Text, IVA:=(IVA / TCDecimal), ' LugarEntrega, 2, CveProveedor, CveOrdenCompra, UsuarioActual.CveUsuario, Ddlcliente.txtValue.Value.ToEntero, DdlVendedor.SelectedValue.ToEntero, txtobsprioridad.Text, IVA:=(IVA / TCDecimal),
' RetIVA:=(TxtRetIVA.Text.ToDecimal / TCDecimal), RetISR:=(TxtRetISR.Text.ToDecimal / TCDecimal), FolioAdicional:=TxtFolioAdicional.Text, EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), ' RetIVA:=(TxtRetIVA.Text.ToDecimal / TCDecimal), RetISR:=(TxtRetISR.Text.ToDecimal / TCDecimal), 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, ' 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
' Err = True ' Err = True
' Else ' Else
' For Each dr As DataRow In DtDetalle.FiltraParametros("TipoDato IN (1)").Rows ' 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 / TCDouble), dr("CveSubProyecto").ToString.ToEntero, ' If OC.UpdateOrdenCompraDetalle(dr("Cantidad").ToString.ToDecimal, dr("CveUnidadMedida").ToString.ToEntero, dr("CvePS").ToString.ToEntero, (dr("Importe").ToString.ToDecimal / TCDouble), 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("CveActivoFijo").ToString.ToEntero, dr("Observacion").ToString, UsuarioActual.CveUsuario, dr("CveOrdenCompraDetalle").ToString.ToEntero, If(TipoOC = "REQ", -1, dr("CvePresupuestoEgreso").ToString.ToEntero),
' (dr("Descuento").ToString.ToDouble / TCDouble), IEPSPS:=(dr("IEPSPS").ToString.ToDouble / TCDouble), IEPSPSIVA:=(dr("IEPSPSIVA").ToString.ToDouble / TCDouble), IVA:=(dr("IVA").ToString.ToDouble / TCDouble), ' (dr("Descuento").ToString.ToDecimal / TCDouble), IEPSPS:=(dr("IEPSPS").ToString.ToDecimal / TCDouble), IEPSPSIVA:=(dr("IEPSPSIVA").ToString.ToDecimal / TCDouble), IVA:=(dr("IVA").ToString.ToDecimal / TCDouble),
' RetIVA:=(dr("RetIVA").ToString.ToDouble / TCDouble), RetISR:=(dr("RetISR").ToString.ToDouble / TCDouble), Total:=(dr("Total").ToString.ToDouble / TCDouble), CveContratoDetalle:=dr("CveContratoDetalle").ToString.ToEntero, ' RetIVA:=(dr("RetIVA").ToString.ToDecimal / TCDouble), RetISR:=(dr("RetISR").ToString.ToDecimal / TCDouble), Total:=(dr("Total").ToString.ToDecimal / TCDouble), 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, ' IVAPorcentaje:=dr("IVAPorcentaje").ToString.ToDecimal, RetIVAPorcentaje:=dr("RetIVAPorcentaje").ToString.ToDecimal, RetISRPorcentaje:=dr("RetISRPorcentaje").ToString.ToDecimal, IEPSPSPorcentaje:=dr("IEPSPSPorcentaje").ToString.ToDecimal,
' IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDouble) <= 0 Then ' IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDecimal) <= 0 Then
' Err = True ' Err = True
' Exit For ' Exit For
' End If ' End If
@@ -8429,7 +8429,7 @@ Partial Class OC
Dim CvePS As Integer = DRow("CvePS").ToString.ToEntero Dim CvePS As Integer = DRow("CvePS").ToString.ToEntero
Dim PrecioUnitario As Double = 0 Dim PrecioUnitario As Decimal = 0
Dim dr As DataRow = DtDetalle.NewRow Dim dr As DataRow = DtDetalle.NewRow
Dim DrPS = GlobalDTPS(CveEmpresaActual, CvePS:=CvePS).FiltroPrimero("") Dim DrPS = GlobalDTPS(CveEmpresaActual, CvePS:=CvePS).FiltroPrimero("")
@@ -8437,19 +8437,19 @@ Partial Class OC
Alert("Ocurrió un error al cargar la información de los productos del archivo. Por favor vuelva a intentar.", TipoMensaje.MsgAdvertencia) Alert("Ocurrió un error al cargar la información de los productos del archivo. Por favor vuelva a intentar.", TipoMensaje.MsgAdvertencia)
Continue For Continue For
End If End If
Dim RetIVA As Double = DrPS("RetIVA").ToString.ToDouble Dim RetIVA As Decimal = DrPS("RetIVA").ToString.ToDecimal
Dim RetISR As Double = DrPS("RetISR").ToString.ToDouble Dim RetISR As Decimal = DrPS("RetISR").ToString.ToDecimal
Dim PS As String = DrPS("PS").ToString Dim PS As String = DrPS("PS").ToString
Dim TotalPS As Double = If(PrecioUnitario > 0, PrecioUnitario * Cantidad, 0) Dim TotalPS As Decimal = If(PrecioUnitario > 0, PrecioUnitario * Cantidad, 0)
Dim CveUnidadMedida As Integer = DrPS("CveUnidadMedida").ToString.ToEntero Dim CveUnidadMedida As Integer = DrPS("CveUnidadMedida").ToString.ToEntero
Dim UM As String = DrPS("UnidadMedida").ToString Dim UM As String = DrPS("UnidadMedida").ToString
Dim IvaPS As Double = DrPS("IVA").ToString.ToDouble Dim IvaPS As Decimal = DrPS("IVA").ToString.ToDecimal
'If IvaPS = -1 Then 'If IvaPS = -1 Then
' Dim Drr As DataRow = GlobalDTSubProyectos(-1, DdlSubProyecto.SelectedValue.ToEntero())(0) ' Dim Drr As DataRow = GlobalDTSubProyectos(-1, DdlSubProyecto.SelectedValue.ToEntero())(0)
' IvaPS = Drr("IVA").ToString().ToDouble() ' IvaPS = Drr("IVA").ToString().ToDecimal()
'End If 'End If
Dim IEPSPS As Double = DrPS("IEPSPorcentaje").ToString.ToDouble Dim IEPSPS As Decimal = DrPS("IEPSPorcentaje").ToString.ToDecimal
Dim IEPSPSIVA As Double = If(DrPS("IEPSGrabaIVA").ToString = "True", DrPS("IEPSPorcentaje").ToString.ToDouble, 0) Dim IEPSPSIVA As Decimal = If(DrPS("IEPSGrabaIVA").ToString = "True", DrPS("IEPSPorcentaje").ToString.ToDecimal, 0)
Dim CveClasificacion As Integer = DrPS("CveClasificacion").ToString.ToEntero Dim CveClasificacion As Integer = DrPS("CveClasificacion").ToString.ToEntero
Dim Clasificacion As String = DrPS("Clasificacion").ToString Dim Clasificacion As String = DrPS("Clasificacion").ToString
Dim CveActivoFijo = HdnCveActivoFijo.Value.ToEntero Dim CveActivoFijo = HdnCveActivoFijo.Value.ToEntero
@@ -8551,11 +8551,11 @@ Partial Class OC
Dim CveContratoDetalle As Integer = GvRow.DataKey("CveContratoDetalle").ToEntero Dim CveContratoDetalle As Integer = GvRow.DataKey("CveContratoDetalle").ToEntero
Dim Cantidad As Double = GvRow.FCTextBox("TxtCantidad").Text.ToDouble Dim Cantidad As Decimal = GvRow.FCTextBox("TxtCantidad").Text.ToDecimal
Dim CvePS As Integer = GvRow.DataKey("CvePS").ToEntero Dim CvePS As Integer = GvRow.DataKey("CvePS").ToEntero
Dim PS As String = GvRow.DataKey("PS") Dim PS As String = GvRow.DataKey("PS")
Dim PU As Double = GvRow.DataKey("PU").ToDouble Dim PU As Decimal = GvRow.DataKey("PU").ToDecimal
Dim TotalPS As Double = GvRow.FCTextBox("TxtImporte").Text.ToDouble Dim TotalPS As Decimal = GvRow.FCTextBox("TxtImporte").Text.ToDecimal
Dim CveUnidadMedida As Integer = GvRow.DataKey("CveUnidadMedida") Dim CveUnidadMedida As Integer = GvRow.DataKey("CveUnidadMedida")
Dim UMAbreviatura As String = GvRow.DataKey("Abreviatura").ToString Dim UMAbreviatura As String = GvRow.DataKey("Abreviatura").ToString
@@ -8566,16 +8566,16 @@ Partial Class OC
Dim Proyecto As String = GvRow.DataKey("Proyecto") Dim Proyecto As String = GvRow.DataKey("Proyecto")
Dim CveProyecto As Integer = GvRow.DataKey("CveProyecto").ToEntero Dim CveProyecto As Integer = GvRow.DataKey("CveProyecto").ToEntero
Dim RetISR As Double = GvRow.DataKey("RetISR").ToString.ToDouble Dim RetISR As Decimal = GvRow.DataKey("RetISR").ToString.ToDecimal
Dim RetIVA As Double = GvRow.DataKey("RetIVA").ToString.ToDouble Dim RetIVA As Decimal = GvRow.DataKey("RetIVA").ToString.ToDecimal
Dim IvaPS As Double = GvRow.DataKey("IVA").ToString.ToDouble Dim IvaPS As Decimal = GvRow.DataKey("IVA").ToString.ToDecimal
Dim CveClasificacion As Integer = GvRow.DataKey("CveClasificacion").ToString.ToEntero Dim CveClasificacion As Integer = GvRow.DataKey("CveClasificacion").ToString.ToEntero
Dim Clasificacion As String = GvRow.DataKey("Clasificacion") Dim Clasificacion As String = GvRow.DataKey("Clasificacion")
Dim IEPSPS As Double = GvRow.DataKey("IEPSPorcentaje").ToString.ToDouble Dim IEPSPS As Decimal = GvRow.DataKey("IEPSPorcentaje").ToString.ToDecimal
Dim IEPSPSIVA As Double = If(GvRow.DataKey("IEPSGrabaIVA").ToString = "True", IEPSPS, 0) Dim IEPSPSIVA As Decimal = If(GvRow.DataKey("IEPSGrabaIVA").ToString = "True", IEPSPS, 0)
Dim IdCuentaPorEjercer As Integer = -1 Dim IdCuentaPorEjercer As Integer = -1
Dim IdCuentaComprometido As Integer = -1 Dim IdCuentaComprometido As Integer = -1