option strict on

This commit is contained in:
2023-08-24 11:30:17 -07:00
parent d094d993a2
commit 0811636213

View File

@@ -507,7 +507,7 @@ Partial Class OC_OC
If ViewState("MonedaTexto") Is Nothing Then
Return ""
Else
Return ViewState("MonedaTexto").ToString.ToEntero
Return ViewState("MonedaTexto").ToString
End If
End Get
Set(value As String)
@@ -1402,7 +1402,7 @@ Partial Class OC_OC
DdlVendedor.SelectedValueExist(objOC.CveVendedor.ToString)
If DdlVendedor.SelectedValue <> objOC.CveVendedor.ToString Then
DdlVendedor.Items.Insert(1, New ListItem(GlobalDTVendedores(UsuarioActual.CveEmpresa, False).FiltroPrimeroValor("Vendedor", $"CveVendedor = {objOC.CveVendedor}"), objOC.CveVendedor.ToString))
DdlVendedor.Items.Insert(1, New ListItem(GlobalDTVendedores(UsuarioActual.CveEmpresa, -1).FiltroPrimeroValor("Vendedor", $"CveVendedor = {objOC.CveVendedor}"), objOC.CveVendedor.ToString))
End If
End If
@@ -1427,9 +1427,9 @@ Partial Class OC_OC
Select Case objOC.PorcentajeIVA.ToString.ToDecimal
Case 0
DdlIVA.SelectedValue = "1"
Case 0.16
Case 0.16D
DdlIVA.SelectedValue = "1.16"
Case 0.08
Case 0.08D
DdlIVA.SelectedValue = "1.08"
End Select
'If objOC.PorcentajeIVA.ToString.ToDecimal = 0 Then DdlIVA.SelectedValue = "1" Else DdlIVA.SelectedValue = "1.16"
@@ -2273,12 +2273,12 @@ Partial Class OC_OC
If drProv IsNot Nothing Then
If drProv("CodigoRegimenFiscal").ToString = "626" Then 'simplificado lleva retencion de 1.25 de isr
RetISR = 0.0125
RetISR = 0.0125D
End If
End If
End If
AddPS(TxtCant.Text, DdlP2.SelectedValue.ToEntero, DdlP2.SelectedText, TxtObsPS.Text, ImportePS, TxtDescuentoAdd.Text.ToDecimal, TotalPS,
AddPS(TxtCant.Text.ToDecimal, DdlP2.SelectedValue.ToEntero, DdlP2.SelectedText, TxtObsPS.Text, ImportePS, TxtDescuentoAdd.Text.ToDecimal, TotalPS,
CboUnidadMedida.SelectedValue.ToEntero, IvaPS, IEPSPS, IEPSPSIVA, DdlClasificacion.SelectedValue.ToEntero, CboUnidadMedida.SelectedItem.Text, DdlClasificacion.SelectedItem.Text, DdlProyecto.SelectedValue.ToEntero, Proyecto,
DdlSubProyecto.SelectedValue.ToEntero, SubProyecto, LblCodigo.Text, HdnCveActivoFijo.Value.ToEntero, 0, CveOrdenCompraDetalle, CveOrdenCompra, IdCuentaPorEjercer,
IdCuentaComprometido, DdlACGeneral1.SelectedValue.ToEntero, DdlACGeneral2.SelectedValue.ToEntero, DdlACGeneral3.SelectedValue.ToEntero, DdlACGeneral4.SelectedValue.ToEntero,
@@ -2306,7 +2306,7 @@ Partial Class OC_OC
UPPDetalle.Update()
End Sub
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,
Private Sub AddPS(Cantidad As Decimal, CvePS As Integer, PS As String, Observaciones As String, Importe As Decimal, Descuento As Decimal, Total As Decimal, CveUnidadMedida As Integer, IVAPS As Decimal, IEPSPS As Decimal, IEPSPSIVA As Decimal, CveClasificacion As Integer,
UM As String, Clasificacion As String, CveProyecto As Integer, Proyecto As String, CveSubProyecto As Integer, SubProyecto As String, CodigoAF As String, CveActivoFijo As Integer, TipoDato As Integer,
CveOrdenCompraDetalle As Integer, CveOrdenCompra As Integer, IdCuentaPorEjercer As Integer, IdCuentaComprometido As Integer, CveProgramaOperativo As Integer, CveUnidadAdministrativa As Integer,
CveFuenteFinanciamiento As Integer, CveTipoGasto As Integer, CveClasificacionOG As Integer, RetIVA As Decimal, RetISR As Decimal, Optional CveContratoDetalle As Integer = -1, Optional CveTipoGastoObra As Integer = -1, Optional CveCultivoCuadroDetalle As Integer = -1,
@@ -3318,7 +3318,8 @@ Partial Class OC_OC
If ChkCotizacion.Checked AndAlso NoProveedoresCot > 0 AndAlso (NumCotizacionesGanadoras > 0 OrElse Not (NumCotizacionesGanadoras <= 0 AndAlso CveConfianzaProveedor = 1)) Then
Dim CveProveedor = -1
Dim TotalCot = 0.0, IVACot = 0D, RetIVA = 0.0, RetISR = 0.0, PorIVA = 0.0
Dim TotalCot = 0.0, IVACot = 0D, RetIVA = 0.0, RetISR = 0.0
Dim PorIVA As Decimal = 0
Dim IdPoliza = -1
@@ -3329,7 +3330,7 @@ Partial Class OC_OC
CveProveedor = dr("CveProveedor").ToString.ToEntero
PorIVA = Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2) 'GlobalDTCompProveedores(CveEmpresaActual).FiltraParametros(String.Format("CveProveedor = {0}", CveProveedor)).Rows(0)("IVA").ToString.ToDecimal
PorIVA = (DdlIVA.SelectedValue.ToDecimal - 1D).RoundSQL 'GlobalDTCompProveedores(CveEmpresaActual).FiltraParametros(String.Format("CveProveedor = {0}", CveProveedor)).Rows(0)("IVA").ToString.ToDecimal
IVACot = IVA '(DtDetalle.SUM("Total", String.Format("CveProveedor = {0}", CveProveedor)) * PorIVA).ToString.ToDecimal
RetIVA = TxtRetIVA.Text.ToDecimal
RetISR = TxtRetISR.Text.ToDecimal
@@ -4059,7 +4060,7 @@ Partial Class OC_OC
Dim drProv As DataRow = GlobalDTCompProveedores(CveEmpresaActual, CveProveedor:=DdlProveedores.SelectedValue.ToEntero).FiltroPrimero("")
If drProv IsNot Nothing Then
If drProv("CodigoRegimenFiscal").ToString = "626" Then 'simplificado lleva retencion de 1.25 de isr
RetISR = 0.0125
RetISR = 0.0125D
End If
End If
End If
@@ -4070,7 +4071,7 @@ Partial Class OC_OC
If Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2) = 0.08 Then
RetIVA = RetIVA / 2
End If
IvaPS = -1
If IvaPS <> 0 Then IvaPS = -1
End If
CveSubProyecto = gvr.FCDropDownList("DdlSubProyectoEdit").SelectedValue.ToEntero
@@ -4594,7 +4595,7 @@ Partial Class OC_OC
Filtro.Clear()
If DtPresupuestosTemp.Rows.Count > 0 Then
disponible = ContPaq.GetSaldoCuenta(DtPresupuestosTemp.Rows(0)("IdCuentaPorEjercer").ToString.ToEntero, 0, TxtFecha.Text.ToDate.Year)
disponible = ContPaq.GetSaldoCuenta(DtPresupuestosTemp.Rows(0)("IdCuentaPorEjercer").ToString.ToEntero, 0, TxtFecha.Text.ToDate.Year).ToDecimal
If disponible > 0 AndAlso disponible > Total Then
'Alert("Si hay dinero: ")
@@ -5593,15 +5594,15 @@ Partial Class OC_OC
Dim PorcentajeIVA As Decimal = 0D
If DrPS("IVA").ToString().Contiene("-1", "") Then
PorcentajeIVA = Row("IVAPorcentaje")
PorcentajeIVA = Row("IVAPorcentaje").ToString.ToDecimal
Else
PorcentajeIVA = DrPS("IVA")
PorcentajeIVA = DrPS("IVA").ToString.ToDecimal
End If
Dim ImporteIEPS As Decimal = (TotalCalculableImpuestos * PorcentajeIEPS).RoundSQL(2)
Dim ImporteIVA As Decimal = (TotalCalculableImpuestosIVA * PorcentajeIVA).RoundSQL(2)
If Not ObjVentas.UpdateVentaDetalleRemision(Row("CveVentaDetalleCotizacion").ToString.ToEntero, CvePS, Cantidad, PU, ImporteIEPS, PorcentajeIEPS, ImporteIVA, PorcentajeIVA, "", UsuarioActual.CveUsuario) Then
If Not ObjVentas.UpdateVentaDetalleRemision(Row("CveVentaDetalleCotizacion").ToString.ToEntero, CvePS, Cantidad, PU, ImporteIEPS, PorcentajeIEPS, ImporteIVA, PorcentajeIVA, 0, "", UsuarioActual.CveUsuario) Then
OcurrioError = True
Exit For
End If
@@ -6606,14 +6607,14 @@ Partial Class OC_OC
Dim RowNoEncontrados As String = String.Empty
Dim NumAgregados As Integer = 0
For Each Row As DataRow In dt.Rows
Dim Cantidad As String = Row("Cantidad").ToString
Dim Cantidad As Decimal = Row("Cantidad").ToString.ToDecimal
Dim Codigo As String = Row("Código").ToString.Trim.ToUpper
Dim CodigoBarras As String = Row("Código de Barras").ToString.Trim.ToUpper
Dim ProductoServicio As String = Row("Producto/Servicio").ToString.Trim.ToUpper
Dim Proyecto As String = Row("Proyecto").ToString.Trim.ToUpper
Dim Observaciones As String = Row("Observaciones").ToString
Dim PrecioUnitario As String = Row("PU").ToString
Dim Descuento As Decimal = Row("Descuento").ToString.ToDecimal * Cantidad.ToDecimal 'RMF, cambio a multiplicar por cantidad 2018.04.21
Dim Descuento As Decimal = Row("Descuento").ToString.ToDecimal * Cantidad 'RMF, cambio a multiplicar por cantidad 2018.04.21
Dim CvePS As Integer = 0
Dim CveProyecto As Integer = 0
Dim CveSubProyecto As Integer = 0
@@ -6684,7 +6685,7 @@ Partial Class OC_OC
Dim RetIVA As Decimal = DrPS("RetIVA").ToString.ToDecimal
Dim RetISR As Decimal = DrPS("RetISR").ToString.ToDecimal
Dim PS As String = DrPS("PS").ToString
Dim TotalPS As Decimal = If(PrecioUnitario.ToDecimal > 0, PrecioUnitario.ToDecimal * Cantidad.ToDecimal - Descuento, 0)
Dim TotalPS As Decimal = If(PrecioUnitario.ToDecimal > 0, PrecioUnitario.ToDecimal * Cantidad - Descuento, 0)
Dim CveUnidadMedida As Integer = DrPS("CveUnidadMedida").ToString.ToEntero
Dim UM As String = DrPS("UnidadMedida").ToString
Dim IvaPS As Decimal = DrPS("IVA").ToString.ToDecimal
@@ -7297,13 +7298,13 @@ Partial Class OC_OC
End Sub
Private Sub CalculaGenerales()
Dim Subtotal As Decimal = DtDetalle.SUM("Total", "Total > 0") + DtDetalle.SUM("Descuento")
Dim Descuento As Decimal = DtDetalle.SUM("Descuento")
Dim SubTotalIEPSIVA As Decimal = DtDetalle.SUM("IEPSPSIVA")
Dim IVA As Decimal = DtDetalle.SUM("IVA") + SubTotalIEPSIVA
Dim SubTotalIEPS As Decimal = DtDetalle.SUM("IEPSPS")
Dim SubTotalRetIVA As Decimal = DtDetalle.SUM("RetIVA")
Dim SubTotalRetISR As Decimal = DtDetalle.SUM("RetISR")
Dim Subtotal As Decimal = DtDetalle.SUMD("Total", "Total > 0") + DtDetalle.SUMD("Descuento")
Dim Descuento As Decimal = DtDetalle.SUMD("Descuento")
Dim SubTotalIEPSIVA As Decimal = DtDetalle.SUMD("IEPSPSIVA")
Dim IVA As Decimal = DtDetalle.SUMD("IVA") + SubTotalIEPSIVA
Dim SubTotalIEPS As Decimal = DtDetalle.SUMD("IEPSPS")
Dim SubTotalRetIVA As Decimal = DtDetalle.SUMD("RetIVA")
Dim SubTotalRetISR As Decimal = DtDetalle.SUMD("RetISR")
'SUBTOTAL
LblSubTotal.Text = (Subtotal).FormatoNumero
@@ -7513,7 +7514,7 @@ Partial Class OC_OC
TxtRetIVA.Text = TxtRetIVA.Text.FormatoNumero
HdnRetIVA.Value = TxtRetIVA.Text
Dim Porcentaje As Decimal = TxtRetIVA.Text.ToDecimal / DtDetalle.SUM("Total")
Dim Porcentaje As Decimal = TxtRetIVA.Text.ToDecimal / DtDetalle.SUMD("Total")
Dim LastDr As DataRow = Nothing
For Each Dr As DataRow In DtDetalle.Rows
'Dr("RetIVA") = (Math.Truncate((Dr("Total").ToString.ToDecimal * Porcentaje) * 100)) / 100
@@ -7709,7 +7710,7 @@ Partial Class OC_OC
Dim CveOrdenCompraDetalle As Integer = DtDetalle.MAX("CveOrdenCompraDetalle").ToEntero + 100
AddPS(Cantidad.ToString, row.DataKey("CvePS").ToEntero, row.DataKey("CodigoPS").ToString, "", ImportePS, 0, TotalPS,
AddPS(Cantidad, row.DataKey("CvePS").ToEntero, row.DataKey("CodigoPS").ToString, "", ImportePS, 0, TotalPS,
row.DataKey("CveUM").ToEntero, IvaPS, IEPSPS, IEPSPSIVA, row.DataKey("CveClasificacion").ToEntero, row.DataKey("UM"), row.DataKey("ClasificacionPS"), 0, "Sin Proyecto",
DdlSubProyectoContrato.SelectedValue.ToEntero, DdlSubProyectoContrato.SelectedItem.Text, "", -1, 0, CveOrdenCompraDetalle, -1, -1,
-1, -1, -1, -1, -1, -1, RetIVA, RetISR, CveContratoDetalle:=row.DataKey("CveContratoDetalle").ToEntero)
@@ -7930,7 +7931,7 @@ Partial Class OC_OC
'cantidad, Producto, Precio Unitario, Fecha Entrega, Observación
Dim DtPS As DataTable = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
Dim DtExcel As DataTable = (From row As GridViewRow In GvD.Rows
Dim DtExcel As DataTable = (From row As GridViewRow In GvD.Rows.Cast(Of GridViewRow)()
Join rowPS In DtPS On rowPS("CvePS").ToString().ToEntero() Equals row.DataKey("CvePS").ToEntero()
Where row.RowType = DataControlRowType.DataRow
Select New With
@@ -8028,7 +8029,7 @@ Partial Class OC_OC
Try
Dim DtPS As DataTable = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
Dim DtOCDetalle As DataTable = (From row As GridViewRow In GvD.Rows
Dim DtOCDetalle As DataTable = (From row As GridViewRow In GvD.Rows.Cast(Of GridViewRow)()
Join rowPS In DtPS On rowPS("CvePS").ToString().ToEntero() Equals row.DataKey("CvePS").ToEntero()
Where row.RowType = DataControlRowType.DataRow
Select New With
@@ -8129,12 +8130,12 @@ Partial Class OC_OC
PU = ObjOC.DtResultados.FiltroPrimeroValor("Importe228").ToDecimal * TCAjuste
ImporteCI176 = ObjOC.DtResultados.FiltroPrimeroValor("ImporteCI228").ToDecimal
Importe176 = Importe228 + Importe229
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, 1, -Importe228, -Importe228, 228, lblFolio.Text, Concepto, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteME:=-Importe228, CveOCDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToString.ToEntero, TipoCambio:=TCAjuste, CveMovimientoAlmacen:=CveMovimientoAlmacen) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, 1, -Importe229, -Importe229, 229, lblFolio.Text, Concepto, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteME:=-Importe228, CveOCDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToString.ToEntero, TipoCambio:=TCAjuste, CveMovimientoAlmacen:=CveMovimientoAlmacen) Then
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -Importe228, -Importe228, 228, lblFolio.Text, Concepto, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteME:=-Importe228, CveOCDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToString.ToEntero, TipoCambio:=TCAjuste, CveMovimientoAlmacen:=CveMovimientoAlmacen) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -Importe229, -Importe229, 229, lblFolio.Text, Concepto, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteME:=-Importe228, CveOCDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToString.ToEntero, TipoCambio:=TCAjuste, CveMovimientoAlmacen:=CveMovimientoAlmacen) Then
ErrorPrepoliza = True
Exit For
Else
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, 1, Importe176, Importe176, 176, lblFolio.Text, Concepto, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteME:=Importe176, CveOCDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimientoAlmacen) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Importe176, Importe176, 176, lblFolio.Text, Concepto, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteME:=Importe176, CveOCDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimientoAlmacen) Then
ErrorPrepoliza = True
Exit For
Else
@@ -8412,7 +8413,7 @@ Partial Class OC_OC
PorletIEAnticipo.Visible = True
GvAnticpos.DataSource = objbancos.DtResultados
ImporteAnticipos = objbancos.DtResultados.SUM("Importe")
ImporteAnticipos = objbancos.DtResultados.SUMD("Importe")
End If
@@ -8635,7 +8636,7 @@ Partial Class OC_OC
Dim PS As String = GvRow.DataKey("PS")
Dim PU As Decimal = GvRow.DataKey("PU").ToDecimal
Dim TotalPS As Decimal = GvRow.FCTextBox("TxtImporte").Text.ToDecimal
Dim CveUnidadMedida As Integer = GvRow.DataKey("CveUnidadMedida")
Dim CveUnidadMedida As Integer = GvRow.DataKey("CveUnidadMedida").ToEntero
Dim UMAbreviatura As String = GvRow.DataKey("Abreviatura").ToString
Dim SubProyecto As String = GvRow.DataKey("SubProyecto")