-option explicit

This commit is contained in:
2023-11-25 12:37:16 -07:00
parent 40b414f98e
commit 4fabaf9783

View File

@@ -590,8 +590,8 @@ Partial Class Contratos_Default
'TabContratosGastos.Visible = False 'TabContratosGastos.Visible = False
'DONDE OCUPA ALMACEN 'DONDE OCUPA ALMACEN
Dim CveTipoAlmacenOrigen = "12,15" Dim CveTipoAlmacenOrigen As String = "12,15"
Dim CveTipoAlmacenDestino = "11,12" Dim CveTipoAlmacenDestino As String = "11,12"
If TipoContrato.Contiene({7, 9, 13, 16, 18, 21, 27}) Then If TipoContrato.Contiene({7, 9, 13, 16, 18, 21, 27}) Then
RowAlmacen.Visible = True RowAlmacen.Visible = True
If TipoContrato.Contiene(7, 9, 13, 21, 27) Then If TipoContrato.Contiene(7, 9, 13, 21, 27) Then
@@ -603,7 +603,7 @@ Partial Class Contratos_Default
End If End If
End If End If
Dim CveOrigen = DdlAlmacenOrigen.SelectedValue Dim CveOrigen As String = DdlAlmacenOrigen.SelectedValue
DdlAlmacenOrigen.Items.Clear() DdlAlmacenOrigen.Items.Clear()
DdlAlmacenOrigen.SelectedValue = "-1" DdlAlmacenOrigen.SelectedValue = "-1"
DdlAlmacenOrigen.Items.Insert(0, New ListItem("Seleccione", "-1")) DdlAlmacenOrigen.Items.Insert(0, New ListItem("Seleccione", "-1"))
@@ -616,7 +616,7 @@ Partial Class Contratos_Default
DdlAlmacenOrigen.SelectedValueExist(CveOrigen) DdlAlmacenOrigen.SelectedValueExist(CveOrigen)
End If End If
Dim CveDestino = DdlAlmacenDestino.SelectedValue Dim CveDestino As String = DdlAlmacenDestino.SelectedValue
DdlAlmacenDestino.Items.Clear() DdlAlmacenDestino.Items.Clear()
DdlAlmacenDestino.SelectedValue = "-1" DdlAlmacenDestino.SelectedValue = "-1"
DdlAlmacenDestino.Items.Insert(0, New ListItem("Seleccione", "-1")) DdlAlmacenDestino.Items.Insert(0, New ListItem("Seleccione", "-1"))
@@ -935,7 +935,7 @@ Partial Class Contratos_Default
#Region " CARGA DATOS " #Region " CARGA DATOS "
Private Sub CargaDatos() Private Sub CargaDatos()
Dim ObjContratos As New ClsContratos() Dim ObjContratos As New ClsContratos()
Dim Ruta = Request.ApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\Contratos\" Dim Ruta As String = Request.ApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\Contratos\"
DivTipoContrato.Visible = False DivTipoContrato.Visible = False
If ObjContratos.GetContratos(CveContrato, UsuarioActual.CveEmpresa) Then If ObjContratos.GetContratos(CveContrato, UsuarioActual.CveEmpresa) Then
@@ -1339,11 +1339,11 @@ Partial Class Contratos_Default
Exit Sub Exit Sub
End If End If
Dim TieneError = False Dim TieneError As Boolean = False
Dim Modificado = False Dim Modificado As Boolean = False
' Dim Extension = Session("FileExtension").ToString ' Dim Extension = Session("FileExtension").ToString
Dim Archivo = Session("FileUpload").ToString Dim Archivo As String = Session("FileUpload").ToString
Dim Ruta = Session("FileFolder").ToString Dim Ruta As String = Session("FileFolder").ToString
Dim Minimo, Maximo, Total As Double Dim Minimo, Maximo, Total As Double
'If txtMinimo.Text.ToDouble > 0 Then Minimo = txtMinimo.Text.ToDouble Else Minimo = -1 'If txtMinimo.Text.ToDouble > 0 Then Minimo = txtMinimo.Text.ToDouble Else Minimo = -1
@@ -1612,11 +1612,11 @@ Partial Class Contratos_Default
For Ciclo As Integer = 1 To CiclosComercialesEnMeses For Ciclo As Integer = 1 To CiclosComercialesEnMeses
Dim FechaRef As DateTime = FechaI.AddMonths(PeriodoMeses * Ciclo) Dim FechaRef As DateTime = FechaI.AddMonths(PeriodoMeses * Ciclo)
Dim lastDayOfMonth = DateTime.DaysInMonth(FechaRef.Year, FechaRef.Month) Dim lastDayOfMonth As Integer = DateTime.DaysInMonth(FechaRef.Year, FechaRef.Month)
Dim DiaMes As Integer = If(lastDayOfMonth < DdlDiaFact.SelectedValue.ToEntero(), lastDayOfMonth, DdlDiaFact.SelectedValue.ToEntero()) Dim DiaMes As Integer = If(lastDayOfMonth < DdlDiaFact.SelectedValue.ToEntero(), lastDayOfMonth, DdlDiaFact.SelectedValue.ToEntero())
Dim FechaFact = New DateTime(FechaRef.Year, FechaRef.Month, DiaMes) Dim FechaFact As Date = New DateTime(FechaRef.Year, FechaRef.Month, DiaMes)
FechaFact = If(FechaFact > FechaF, FechaF, FechaFact) FechaFact = If(FechaFact > FechaF, FechaF, FechaFact)
If Not ObjContratos.CicloComercialAdd(CveContrato, -1, DdlCliente.SelectedValue.ToEntero, False, -1, 1, UsuarioActual.CveEmpresa, FechaFact) Then TieneError = True : Exit For If Not ObjContratos.CicloComercialAdd(CveContrato, -1, DdlCliente.SelectedValue.ToEntero, False, -1, 1, UsuarioActual.CveEmpresa, FechaFact) Then TieneError = True : Exit For
@@ -1644,7 +1644,7 @@ Partial Class Contratos_Default
Dim DiaAnterior As Integer = 0 Dim DiaAnterior As Integer = 0
For CicloDias = 1 To CiclosPorMes For CicloDias As Integer = 1 To CiclosPorMes
Dim DiaMes As Integer = 0 Dim DiaMes As Integer = 0
If CicloDias = 1 Then If CicloDias = 1 Then
@@ -1994,8 +1994,8 @@ Partial Class Contratos_Default
UpGV.Update() UpGV.Update()
End Sub End Sub
Protected Sub BtnAutorizar_Click(sender As Object, e As EventArgs) Handles BtnAutorizar.Click Protected Sub BtnAutorizar_Click(sender As Object, e As EventArgs) Handles BtnAutorizar.Click
Dim pinterno = TmpDT.SUM("Total", "CveTipoPresupuesto=1").ToString.ToDouble Dim pinterno As Double = TmpDT.SUM("Total", "CveTipoPresupuesto=1").ToString.ToDouble
Dim pventas = TmpDT.SUM("Total", "CveTipoPresupuesto=2").ToString.ToDouble Dim pventas As Double = TmpDT.SUM("Total", "CveTipoPresupuesto=2").ToString.ToDouble
If (pinterno < pventas) Then If (pinterno < pventas) Then
Dim objContrato As New ClsContratos Dim objContrato As New ClsContratos
@@ -2038,7 +2038,7 @@ Partial Class Contratos_Default
Row("CveContratoDetalle") = ObjContratos.DtResultados.Rows(0)("CveContratoDetalle") Row("CveContratoDetalle") = ObjContratos.DtResultados.Rows(0)("CveContratoDetalle")
TmpDT.Rows.Add(Row) TmpDT.Rows.Add(Row)
TmpDT.AcceptChanges() TmpDT.AcceptChanges()
Dim TotalRow = Row("Total").ToString.ToDouble Dim TotalRow As Double = Row("Total").ToString.ToDouble
CargaGVPresupuestos(TmpDT.FiltraParametros("CveTipoPresupuesto=2")) CargaGVPresupuestos(TmpDT.FiltraParametros("CveTipoPresupuesto=2"))
@@ -2086,7 +2086,7 @@ Partial Class Contratos_Default
Dim CveContratoDetalle As Integer = gvr.DataKey("CveContratoDetalle").ToString.ToEntero Dim CveContratoDetalle As Integer = gvr.DataKey("CveContratoDetalle").ToString.ToEntero
Dim objContrato As New ClsContratos Dim objContrato As New ClsContratos
If objContrato.UpdateContratosDetalleEstimacion(CveContratoDetalle, IIf(btn.Checked, 1, 0).ToString.ToEntero) Then If objContrato.UpdateContratosDetalleEstimacion(CveContratoDetalle, IIf(btn.Checked, 1, 0).ToString.ToEntero) Then
Dim row = TmpDT.Select(String.Format("CveContratoDetalle={0}", CveContratoDetalle))(0) Dim row As DataRow = TmpDT.Select(String.Format("CveContratoDetalle={0}", CveContratoDetalle))(0)
row("PermitirEstimacion") = IIf(btn.Checked, 1, 0).ToString.ToEntero row("PermitirEstimacion") = IIf(btn.Checked, 1, 0).ToString.ToEntero
Alert("Se ha permitido estimar", TipoMensaje.MsgInformacion) Alert("Se ha permitido estimar", TipoMensaje.MsgInformacion)
Else Else
@@ -2103,7 +2103,7 @@ Partial Class Contratos_Default
Dim CveContratoDetalle As Integer = gvr.DataKey("CveContratoDetalle").ToString.ToEntero Dim CveContratoDetalle As Integer = gvr.DataKey("CveContratoDetalle").ToString.ToEntero
Dim objContrato As New ClsContratos Dim objContrato As New ClsContratos
If objContrato.UpdateContratosDetalleAvance(CveContratoDetalle, IIf(btn.Checked, 1, 0).ToString.ToEntero) Then If objContrato.UpdateContratosDetalleAvance(CveContratoDetalle, IIf(btn.Checked, 1, 0).ToString.ToEntero) Then
Dim row = TmpDT.Select(String.Format("CveContratoDetalle={0}", CveContratoDetalle))(0) Dim row As DataRow = TmpDT.Select(String.Format("CveContratoDetalle={0}", CveContratoDetalle))(0)
row("PermitirAvance") = IIf(btn.Checked, 1, 0).ToString.ToEntero row("PermitirAvance") = IIf(btn.Checked, 1, 0).ToString.ToEntero
@@ -2169,7 +2169,7 @@ Partial Class Contratos_Default
OCInterna = Gv.Rows(e.RowIndex).FCTextBox("TxtOCInternaEdit").Text.ToString OCInterna = Gv.Rows(e.RowIndex).FCTextBox("TxtOCInternaEdit").Text.ToString
LimitarCantidad = Gv.Rows(e.RowIndex).FCCheckBox("ChkLimitarCantidad").Checked LimitarCantidad = Gv.Rows(e.RowIndex).FCCheckBox("ChkLimitarCantidad").Checked
Observaciones = Gv.Rows(e.RowIndex).FCTextBox("TxtObservacion").Text.ToString Observaciones = Gv.Rows(e.RowIndex).FCTextBox("TxtObservacion").Text.ToString
Dim row = TmpDT.Select(String.Format(" CveContratoDetalle={0}", CveContratoDetalle))(0) Dim row As DataRow = TmpDT.Select(String.Format(" CveContratoDetalle={0}", CveContratoDetalle))(0)
Dim LimitarCantidadValidator As Boolean = row("LimitarCantidad").ToString = "True" Dim LimitarCantidadValidator As Boolean = row("LimitarCantidad").ToString = "True"
If row("CantidadContratada").ToString.ToEntero <> Cantidad OrElse row("PU").ToString.ToEntero <> PU OrElse CveUM <> row("CveUM").ToString.ToEntero OrElse row("NoIdentificacion").ToString <> NoIdentificacion OrElse row("OCInterna").ToString <> OCInterna OrElse LimitarCantidadValidator <> LimitarCantidad Then If row("CantidadContratada").ToString.ToEntero <> Cantidad OrElse row("PU").ToString.ToEntero <> PU OrElse CveUM <> row("CveUM").ToString.ToEntero OrElse row("NoIdentificacion").ToString <> NoIdentificacion OrElse row("OCInterna").ToString <> OCInterna OrElse LimitarCantidadValidator <> LimitarCantidad Then
@@ -2284,7 +2284,7 @@ Partial Class Contratos_Default
End If End If
Row("CveContratoDetalle") = ObjContratos.DtResultados.Rows(0)("CveContratoDetalle") Row("CveContratoDetalle") = ObjContratos.DtResultados.Rows(0)("CveContratoDetalle")
TmpDT.Rows.Add(Row) TmpDT.Rows.Add(Row)
Dim TotalRow = Row("Total").ToString.ToDouble Dim TotalRow As Double = Row("Total").ToString.ToDouble
CargaGVPresupuestosInsumos(TmpDT.FiltraParametros("CveTipoPresupuesto=1")) CargaGVPresupuestosInsumos(TmpDT.FiltraParametros("CveTipoPresupuesto=1"))
@@ -2354,7 +2354,7 @@ Partial Class Contratos_Default
NoIdentificacion = GvInsumos.Rows(e.RowIndex).FCTextBox("TxtNoIdentificacion").Text.ToString NoIdentificacion = GvInsumos.Rows(e.RowIndex).FCTextBox("TxtNoIdentificacion").Text.ToString
LimitarCantidad = GvInsumos.Rows(e.RowIndex).FCCheckBox("ChkLimitarCantidad").Checked LimitarCantidad = GvInsumos.Rows(e.RowIndex).FCCheckBox("ChkLimitarCantidad").Checked
Dim row = TmpDT.Select(String.Format(" CveContratoDetalle={0}", CveContratoDetalle))(0) Dim row As DataRow = TmpDT.Select(String.Format(" CveContratoDetalle={0}", CveContratoDetalle))(0)
If row("Cantidad").ToString.ToEntero <> Cantidad OrElse row("PU").ToString.ToEntero <> PU OrElse CveUM <> row("CveUM").ToString.ToEntero OrElse row("NoIdentificacion").ToString <> NoIdentificacion OrElse (row("LimitarCantidad").ToString = "True") <> LimitarCantidad Then If row("Cantidad").ToString.ToEntero <> Cantidad OrElse row("PU").ToString.ToEntero <> PU OrElse CveUM <> row("CveUM").ToString.ToEntero OrElse row("NoIdentificacion").ToString <> NoIdentificacion OrElse (row("LimitarCantidad").ToString = "True") <> LimitarCantidad Then
@@ -2453,7 +2453,7 @@ Partial Class Contratos_Default
End If End If
Row("CveContratoDetalle") = ObjContratos.DtResultados.Rows(0)("CveContratoDetalle") Row("CveContratoDetalle") = ObjContratos.DtResultados.Rows(0)("CveContratoDetalle")
TmpDT.Rows.Add(Row) TmpDT.Rows.Add(Row)
Dim TotalRow = Row("Total").ToString.ToDouble Dim TotalRow As Double = Row("Total").ToString.ToDouble
GvInt.DataSource = TmpDT.FiltraParametros("CveTipoPresupuesto=1") GvInt.DataSource = TmpDT.FiltraParametros("CveTipoPresupuesto=1")
GvInt.DataBind() GvInt.DataBind()
@@ -2494,10 +2494,10 @@ Partial Class Contratos_Default
CveUM = GvInt.Rows(e.RowIndex).FCDropDownList("DdlUMEdit").SelectedValue.ToEntero CveUM = GvInt.Rows(e.RowIndex).FCDropDownList("DdlUMEdit").SelectedValue.ToEntero
'NoIdentificacion = GvInt.Rows(e.RowIndex).FCDropDownList("NoIdentificacion").ToString 'NoIdentificacion = GvInt.Rows(e.RowIndex).FCDropDownList("NoIdentificacion").ToString
Dim row = TmpDT.Select(String.Format(" CveContratoDetalle={0}", CveContratoDetalle))(0) Dim row As DataRow = TmpDT.Select(String.Format(" CveContratoDetalle={0}", CveContratoDetalle))(0)
Dim c1 = row("Cantidad").ToString.ToEntero Dim c1 As Integer = row("Cantidad").ToString.ToEntero
Dim p1 = row("PU").ToString.ToEntero Dim p1 As Decimal = row("PU").ToString.ToDecimal
Dim cvum1 = row("CveUM").ToString.ToEntero Dim cvum1 As Integer = row("CveUM").ToString.ToEntero
If c1 <> Cantidad OrElse p1 <> PU OrElse CveUM <> cvum1 Then If c1 <> Cantidad OrElse p1 <> PU OrElse CveUM <> cvum1 Then
Dim ObjContratos As New ClsContratos Dim ObjContratos As New ClsContratos
@@ -2573,7 +2573,7 @@ Partial Class Contratos_Default
TabReporteAvance.Visible = True TabReporteAvance.Visible = True
lbImprimirAvance.Visible = True lbImprimirAvance.Visible = True
Dim Modalidad = IfNull(Request("Tipo"), 1, 2) Dim Modalidad As Integer = IfNull(Request("Tipo"), 1, 2).ToString.ToEntero
If Modalidad.ToString.ToEntero = 2 Then If Modalidad.ToString.ToEntero = 2 Then
Tab.ActiveTabIndex = 2 Tab.ActiveTabIndex = 2
@@ -2613,19 +2613,19 @@ Partial Class Contratos_Default
e.Row.CssClass = "SubTotales" e.Row.CssClass = "SubTotales"
End If End If
Dim Liga1 = $"{e.Row.DBCampo("CveClasificacion").ToEntero}|{e.Row.DBCampo("Clasificacion")}|{e.Row.DBCampo("CvePS").ToEntero}|{e.Row.DBCampo("CodigoPS")}|1" Dim Liga1 As String = $"{e.Row.DBCampo("CveClasificacion").ToEntero}|{e.Row.DBCampo("Clasificacion")}|{e.Row.DBCampo("CvePS").ToEntero}|{e.Row.DBCampo("CodigoPS")}|1"
e.Row.FCLinkButton("LBAvanceCantidad").CommandArgument = Liga1 e.Row.FCLinkButton("LBAvanceCantidad").CommandArgument = Liga1
e.Row.FCLinkButton("LBAvanceImporte").CommandArgument = Liga1 e.Row.FCLinkButton("LBAvanceImporte").CommandArgument = Liga1
Dim Liga2 = $"{e.Row.DBCampo("CveClasificacion").ToEntero}|{e.Row.DBCampo("Clasificacion")}|{e.Row.DBCampo("CvePS").ToEntero}|{e.Row.DBCampo("CodigoPS")}|2" Dim Liga2 As String = $"{e.Row.DBCampo("CveClasificacion").ToEntero}|{e.Row.DBCampo("Clasificacion")}|{e.Row.DBCampo("CvePS").ToEntero}|{e.Row.DBCampo("CodigoPS")}|2"
e.Row.FCLinkButton("LBAvanceXFacturarCantidad").CommandArgument = Liga2 e.Row.FCLinkButton("LBAvanceXFacturarCantidad").CommandArgument = Liga2
e.Row.FCLinkButton("LBAvanceXFacturarImporte").CommandArgument = Liga2 e.Row.FCLinkButton("LBAvanceXFacturarImporte").CommandArgument = Liga2
End If End If
End Sub End Sub
Protected Sub MuestaModalVentasAvance(sender As Object, e As EventArgs) Protected Sub MuestaModalVentasAvance(sender As Object, e As EventArgs)
Dim Btn = CType(sender, LinkButton) Dim Btn As LinkButton = CType(sender, LinkButton)
Dim Parametros = Btn.CommandArgument.Split("|"c) Dim Parametros As String() = Btn.CommandArgument.Split("|"c)
Dim ObjContratos As New ClsContratos Dim ObjContratos As New ClsContratos
@@ -2987,7 +2987,7 @@ Partial Class Contratos_Default
e.Row.Cells(4).Text = "" e.Row.Cells(4).Text = ""
e.Row.Cells(5).Text = "" e.Row.Cells(5).Text = ""
Dim Texto = $"Pedido: <b><a href='/Ventas/Ventas.aspx?CveVenta={e.Row.DBCampo("CveVenta")}' target='_blank'>{e.Row.DBCampo("SerieFolio")}</a></b> | " Dim Texto As String = $"Pedido: <b><a href='/Ventas/Ventas.aspx?CveVenta={e.Row.DBCampo("CveVenta")}' target='_blank'>{e.Row.DBCampo("SerieFolio")}</a></b> | "
Texto += If(e.Row.DBCampo("CveMovimiento").ToString = "", " SIN MOVIMIENTO DE ALMACÉN", $"Folio Almacén: <b><a href ='/Inventarios/EntradasSalidas.aspx?CveMovimiento={e.Row.DBCampo("CveMovimiento")}' target='_blank'>{e.Row.DBCampo("Folio")}</a></b>") Texto += If(e.Row.DBCampo("CveMovimiento").ToString = "", " SIN MOVIMIENTO DE ALMACÉN", $"Folio Almacén: <b><a href ='/Inventarios/EntradasSalidas.aspx?CveMovimiento={e.Row.DBCampo("CveMovimiento")}' target='_blank'>{e.Row.DBCampo("Folio")}</a></b>")
e.Row.Cells(0).ColumnSpan = 2 e.Row.Cells(0).ColumnSpan = 2
@@ -3014,7 +3014,7 @@ Partial Class Contratos_Default
e.Row.Cells(4).Text = "" e.Row.Cells(4).Text = ""
e.Row.Cells(5).Text = "" e.Row.Cells(5).Text = ""
Dim Texto = $"Devolución: <b><a href='/Ventas/Ventas.aspx?CveVenta={e.Row.DBCampo("CveVenta")}' target='_blank'>{e.Row.DBCampo("SerieFolio")}</a></b> | " Dim Texto As String = $"Devolución: <b><a href='/Ventas/Ventas.aspx?CveVenta={e.Row.DBCampo("CveVenta")}' target='_blank'>{e.Row.DBCampo("SerieFolio")}</a></b> | "
Texto += If(e.Row.DBCampo("CveMovimiento").ToString = "", " SIN MOVIMIENTO DE ALMACÉN", $"Folio Almacén: <b><a href ='/Inventarios/EntradasSalidas.aspx?CveMovimiento={e.Row.DBCampo("CveMovimiento")}' target='_blank'>{e.Row.DBCampo("Folio")}</a></b>") Texto += If(e.Row.DBCampo("CveMovimiento").ToString = "", " SIN MOVIMIENTO DE ALMACÉN", $"Folio Almacén: <b><a href ='/Inventarios/EntradasSalidas.aspx?CveMovimiento={e.Row.DBCampo("CveMovimiento")}' target='_blank'>{e.Row.DBCampo("Folio")}</a></b>")
e.Row.Cells(0).ColumnSpan = 2 e.Row.Cells(0).ColumnSpan = 2
@@ -3102,7 +3102,7 @@ Partial Class Contratos_Default
LBLAFValorActivo.Text = DT.SUM("ValorImporte", "CveMovimientoDetalle > 0").ToString("###,###,###.00") LBLAFValorActivo.Text = DT.SUM("ValorImporte", "CveMovimientoDetalle > 0").ToString("###,###,###.00")
Dim Total = DT.SUM("Cantidad", "CveMovimientoDetalle > 0 AND TipoDocto = 'Ped'") - DT.SUM("Cantidad", "TipoDocto = 'DPe'") Dim Total As Decimal = DT.SUM("Cantidad", "CveMovimientoDetalle > 0 AND TipoDocto = 'Ped'") - DT.SUM("Cantidad", "TipoDocto = 'DPe'")
LBLAFTotal.Text = DT.SUM("Cantidad", "CveMovimientoDetalle > 0").ToString() LBLAFTotal.Text = DT.SUM("Cantidad", "CveMovimientoDetalle > 0").ToString()
UPAFResumen.Update() UPAFResumen.Update()
@@ -3119,7 +3119,7 @@ Partial Class Contratos_Default
e.Row.Cells(4).Text = "" e.Row.Cells(4).Text = ""
e.Row.Cells(5).Text = "" e.Row.Cells(5).Text = ""
Dim Texto = $"{If(e.Row.DBCampo("TipoDocto") = "Ped", "Pedido", "Devolución") }: <b><a href='/Ventas/Ventas.aspx?CveVenta={e.Row.DBCampo("CveVenta")}' target='_blank'>{e.Row.DBCampo("SerieFolio")}</a></b> | " Dim Texto As String = $"{If(e.Row.DBCampo("TipoDocto") = "Ped", "Pedido", "Devolución") }: <b><a href='/Ventas/Ventas.aspx?CveVenta={e.Row.DBCampo("CveVenta")}' target='_blank'>{e.Row.DBCampo("SerieFolio")}</a></b> | "
Texto += If(e.Row.DBCampo("CveMovimiento").ToString = "", " SIN MOVIMIENTO DE ALMACÉN", $"Folio Almacén: <b><a href ='/Inventarios/EntradasSalidas.aspx?CveMovimiento={e.Row.DBCampo("CveMovimiento")}' target='_blank'>{e.Row.DBCampo("Folio")}</a></b>") Texto += If(e.Row.DBCampo("CveMovimiento").ToString = "", " SIN MOVIMIENTO DE ALMACÉN", $"Folio Almacén: <b><a href ='/Inventarios/EntradasSalidas.aspx?CveMovimiento={e.Row.DBCampo("CveMovimiento")}' target='_blank'>{e.Row.DBCampo("Folio")}</a></b>")
@@ -3169,7 +3169,7 @@ Partial Class Contratos_Default
For Each GRow As GridViewRow In GvDatosAlmacen.Rows For Each GRow As GridViewRow In GvDatosAlmacen.Rows
Dim CveMovimientoDetalle As Integer = GRow.DataKey("CveMovimientoDetalle").ToEntero Dim CveMovimientoDetalle As Integer = GRow.DataKey("CveMovimientoDetalle").ToEntero
Dim ChkEsInterno = GRow.FCCheckBox("ChkEsInterno") Dim ChkEsInterno As CheckBox = GRow.FCCheckBox("ChkEsInterno")
If CveMovimientoDetalle > 0 And ChkEsInterno.Checked And DdlEsInterno.SelectedValue.ToEntero > 0 Then If CveMovimientoDetalle > 0 And ChkEsInterno.Checked And DdlEsInterno.SelectedValue.ToEntero > 0 Then
Dim EsInterno As Boolean Dim EsInterno As Boolean
@@ -3221,7 +3221,7 @@ Partial Class Contratos_Default
Protected Sub BtnDevolucionAlmacen_Click(sender As Object, e As EventArgs) Protected Sub BtnDevolucionAlmacen_Click(sender As Object, e As EventArgs)
Dim ObjVentas As New ClsVentas Dim ObjVentas As New ClsVentas
ObjVentas.IniciaTransacSQL() ObjVentas.IniciaTransacSQL()
Dim TieneError = False Dim TieneError As Boolean = False
For Each Dr As DataRow In DtMovimientos.FiltraParametros("CveVenta IS NOT NULL AND CveMovimiento IS NOT NULL AND EsDevolucionVenta = 0", "", {"CveVenta"}).Rows For Each Dr As DataRow In DtMovimientos.FiltraParametros("CveVenta IS NOT NULL AND CveMovimiento IS NOT NULL AND EsDevolucionVenta = 0", "", {"CveVenta"}).Rows
If Not ObjVentas.UpdateVentasDevolucionAlmacen(1, Dr("CveVenta").ToString.ToEntero) Then If Not ObjVentas.UpdateVentasDevolucionAlmacen(1, Dr("CveVenta").ToString.ToEntero) Then
@@ -3229,7 +3229,6 @@ Partial Class Contratos_Default
End If End If
Next Next
If Not TieneError Then If Not TieneError Then
ObjVentas.Commit() ObjVentas.Commit()
Alert("La solicitud de devolución se guardo correctamente.", TipoMensaje.MsgInformacion) Alert("La solicitud de devolución se guardo correctamente.", TipoMensaje.MsgInformacion)
@@ -3241,9 +3240,6 @@ Partial Class Contratos_Default
ObjVentas.Dispose() ObjVentas.Dispose()
End Sub End Sub
Public Sub CargaDatosEncabezado() Public Sub CargaDatosEncabezado()
TablaUtilidad.Visible = True TablaUtilidad.Visible = True
@@ -3466,7 +3462,7 @@ Partial Class Contratos_Default
Private Sub CargarArchivo(Ruta As String, FileName As String, Tipo As String) Private Sub CargarArchivo(Ruta As String, FileName As String, Tipo As String)
Dim dt As New DataTable Dim dt As New DataTable
dt = ReadExcelFile(Ruta + FileName, True) dt = ReadExcelFile(Ruta + FileName, True)
Dim ErrorArchivo = False Dim ErrorArchivo As Boolean = False
'Dim Conexion As Odbc.OdbcConnection = Nothing 'Dim Conexion As Odbc.OdbcConnection = Nothing
'Try 'Try
@@ -3602,7 +3598,7 @@ Partial Class Contratos_Default
guardarBitacora(msj) guardarBitacora(msj)
dr("CveContratoDetalle") = ObjContratos.DtResultados.Rows(0)("CveContratoDetalle") dr("CveContratoDetalle") = ObjContratos.DtResultados.Rows(0)("CveContratoDetalle")
TmpDT.Rows.Add(dr) TmpDT.Rows.Add(dr)
Dim TotalRow = dr("Total").ToString.ToDouble Dim TotalRow As Double = dr("Total").ToString.ToDouble
CargaGVPresupuestos(TmpDT.FiltraParametros("CveTipoPresupuesto=2")) CargaGVPresupuestos(TmpDT.FiltraParametros("CveTipoPresupuesto=2"))
LbTotalGeneral.Text = (LbTotalGeneral.Text.ToDouble + TotalRow).ToString.FormatoNumero LbTotalGeneral.Text = (LbTotalGeneral.Text.ToDouble + TotalRow).ToString.FormatoNumero
@@ -3708,7 +3704,7 @@ Partial Class Contratos_Default
End Sub End Sub
Private Sub CargaDiasMes(Optional NumMaxDias As Integer = 31) Private Sub CargaDiasMes(Optional NumMaxDias As Integer = 31)
DdlDiaFact.Items.Clear() DdlDiaFact.Items.Clear()
For i = 1 To NumMaxDias For i As Integer = 1 To NumMaxDias
DdlDiaFact.Items.Add(New ListItem(i.ToString(), i.ToString())) DdlDiaFact.Items.Add(New ListItem(i.ToString(), i.ToString()))
Next Next
End Sub End Sub
@@ -4019,7 +4015,7 @@ Partial Class Contratos_Default
End Sub End Sub
Private Function GetDatosTagsDocumentos() As List(Of TagsDocumentos) Private Function GetDatosTagsDocumentos() As List(Of TagsDocumentos)
Dim ListaTagsDocumentost = New List(Of TagsDocumentos) Dim ListaTagsDocumentost As New List(Of TagsDocumentos)
Dim ObjContratos As New ClsContratos Dim ObjContratos As New ClsContratos
If CveContrato <> -1 Then If CveContrato <> -1 Then
If ObjContratos.GetContratos(CveContrato, UsuarioActual.CveEmpresa) Then If ObjContratos.GetContratos(CveContrato, UsuarioActual.CveEmpresa) Then
@@ -4072,7 +4068,7 @@ Partial Class Contratos_Default
#Region "CREAR A PARTIR DE" #Region "CREAR A PARTIR DE"
Private Sub BtnAgregarContratoHijo_Click(sender As Object, e As EventArgs) Handles BtnAgregarContratoHijo.Click Private Sub BtnAgregarContratoHijo_Click(sender As Object, e As EventArgs) Handles BtnAgregarContratoHijo.Click
Dim TieneError = False Dim TieneError As Boolean = False
Dim ObjContratos As New ClsContratos Dim ObjContratos As New ClsContratos
ObjContratos.IniciaTransacSQL() ObjContratos.IniciaTransacSQL()
@@ -4131,9 +4127,8 @@ Partial Class Contratos_Default
End Sub End Sub
Private Function AgregarDetalleHijo(CveContratoHijo As Integer, ByRef ObjContratos As ClsContratos) As Boolean Private Function AgregarDetalleHijo(CveContratoHijo As Integer, ByRef ObjContratos As ClsContratos) As Boolean
Dim TieneError = False Dim TieneError As Boolean = False
Dim Cantidades As Double Dim Cantidades As Double
For Each Row As DataRow In TmpDT.Rows For Each Row As DataRow In TmpDT.Rows
@@ -4600,8 +4595,8 @@ Partial Class Contratos_Default
If Plantilla.Contains("{MES}") Then If Plantilla.Contains("{MES}") Then
Dim fecha As DateTime = NowADS() Dim fecha As DateTime = NowADS()
Dim formatoFecha = Globalization.CultureInfo.CurrentCulture.DateTimeFormat Dim formatoFecha As DateTimeFormatInfo = Globalization.CultureInfo.CurrentCulture.DateTimeFormat
Dim nombreMes = formatoFecha.GetMonthName(fecha.Month).ToUpper() Dim nombreMes As String = formatoFecha.GetMonthName(fecha.Month).ToUpper()
Plantilla = Plantilla.ToString().Replace("{MES}", nombreMes) Plantilla = Plantilla.ToString().Replace("{MES}", nombreMes)
End If End If
@@ -4616,16 +4611,16 @@ Partial Class Contratos_Default
If Plantilla.Contains("{MESANTERIOR}") Then If Plantilla.Contains("{MESANTERIOR}") Then
Dim fecha As DateTime = NowADS().AddMonths(-1) Dim fecha As DateTime = NowADS().AddMonths(-1)
Dim formatoFecha = Globalization.CultureInfo.CurrentCulture.DateTimeFormat Dim formatoFecha As DateTimeFormatInfo = Globalization.CultureInfo.CurrentCulture.DateTimeFormat
Dim nombreMes = formatoFecha.GetMonthName(fecha.Month).ToUpper() Dim nombreMes As String = formatoFecha.GetMonthName(fecha.Month).ToUpper()
Plantilla = Plantilla.ToString().Replace("{MESANTERIOR}", nombreMes) Plantilla = Plantilla.ToString().Replace("{MESANTERIOR}", nombreMes)
End If End If
If Plantilla.Contains("{INICIOMESANTERIOR}") Then If Plantilla.Contains("{INICIOMESANTERIOR}") Then
Dim fecha As DateTime = NowADS().AddMonths(-1) Dim fecha As DateTime = NowADS().AddMonths(-1)
Dim formatoFecha = Globalization.CultureInfo.CurrentCulture.DateTimeFormat Dim formatoFecha As DateTimeFormatInfo = Globalization.CultureInfo.CurrentCulture.DateTimeFormat
Dim nombreMes = formatoFecha.GetMonthName(fecha.Month).ToUpper() Dim nombreMes As String = formatoFecha.GetMonthName(fecha.Month).ToUpper()
Dim mesAnterior As String = String.Format("01 {0} {1}", nombreMes, fecha.Year) Dim mesAnterior As String = String.Format("01 {0} {1}", nombreMes, fecha.Year)
@@ -4634,10 +4629,10 @@ Partial Class Contratos_Default
If Plantilla.Contains("{FINMESANTERIOR}") Then If Plantilla.Contains("{FINMESANTERIOR}") Then
Dim fecha As DateTime = NowADS().AddMonths(-1) Dim fecha As DateTime = NowADS().AddMonths(-1)
Dim formatoFecha = Globalization.CultureInfo.CurrentCulture.DateTimeFormat Dim formatoFecha As DateTimeFormatInfo = Globalization.CultureInfo.CurrentCulture.DateTimeFormat
Dim nombreMes = formatoFecha.GetMonthName(fecha.Month).ToUpper() Dim nombreMes As String = formatoFecha.GetMonthName(fecha.Month).ToUpper()
Dim LastDayOfMonth = DateTime.DaysInMonth(fecha.Year, fecha.Month) Dim LastDayOfMonth As Integer = DateTime.DaysInMonth(fecha.Year, fecha.Month)
Dim mesAnterior As String = String.Format("{0} {1} {2}", LastDayOfMonth, nombreMes, fecha.Year) Dim mesAnterior As String = String.Format("{0} {1} {2}", LastDayOfMonth, nombreMes, fecha.Year)
@@ -4655,8 +4650,8 @@ Partial Class Contratos_Default
If Plantilla.Contains("{MES}") Then If Plantilla.Contains("{MES}") Then
Dim fecha As DateTime = NowADS() Dim fecha As DateTime = NowADS()
Dim formatoFecha = Globalization.CultureInfo.CurrentCulture.DateTimeFormat Dim formatoFecha As DateTimeFormatInfo = Globalization.CultureInfo.CurrentCulture.DateTimeFormat
Dim nombreMes = formatoFecha.GetMonthName(fecha.Month).ToUpper() Dim nombreMes As String = formatoFecha.GetMonthName(fecha.Month).ToUpper()
Plantilla = Plantilla.ToString().Replace("{MES}", nombreMes) Plantilla = Plantilla.ToString().Replace("{MES}", nombreMes)
End If End If
@@ -4671,16 +4666,16 @@ Partial Class Contratos_Default
If Plantilla.Contains("{MESANTERIOR}") Then If Plantilla.Contains("{MESANTERIOR}") Then
Dim fecha As DateTime = NowADS().AddMonths(-1) Dim fecha As DateTime = NowADS().AddMonths(-1)
Dim formatoFecha = Globalization.CultureInfo.CurrentCulture.DateTimeFormat Dim formatoFecha As DateTimeFormatInfo = Globalization.CultureInfo.CurrentCulture.DateTimeFormat
Dim nombreMes = formatoFecha.GetMonthName(fecha.Month).ToUpper() Dim nombreMes As String = formatoFecha.GetMonthName(fecha.Month).ToUpper()
Plantilla = Plantilla.ToString().Replace("{MESANTERIOR}", nombreMes) Plantilla = Plantilla.ToString().Replace("{MESANTERIOR}", nombreMes)
End If End If
If Plantilla.Contains("{INICIOMESANTERIOR}") Then If Plantilla.Contains("{INICIOMESANTERIOR}") Then
Dim fecha As DateTime = NowADS().AddMonths(-1) Dim fecha As DateTime = NowADS().AddMonths(-1)
Dim formatoFecha = Globalization.CultureInfo.CurrentCulture.DateTimeFormat Dim formatoFecha As DateTimeFormatInfo = Globalization.CultureInfo.CurrentCulture.DateTimeFormat
Dim nombreMes = formatoFecha.GetMonthName(fecha.Month).ToUpper() Dim nombreMes As String = formatoFecha.GetMonthName(fecha.Month).ToUpper()
Dim mesAnterior As String = String.Format("01 {0} {1}", nombreMes, fecha.Year) Dim mesAnterior As String = String.Format("01 {0} {1}", nombreMes, fecha.Year)
@@ -4689,10 +4684,10 @@ Partial Class Contratos_Default
If Plantilla.Contains("{FINMESANTERIOR}") Then If Plantilla.Contains("{FINMESANTERIOR}") Then
Dim fecha As DateTime = NowADS().AddMonths(-1) Dim fecha As DateTime = NowADS().AddMonths(-1)
Dim formatoFecha = Globalization.CultureInfo.CurrentCulture.DateTimeFormat Dim formatoFecha As DateTimeFormatInfo = Globalization.CultureInfo.CurrentCulture.DateTimeFormat
Dim nombreMes = formatoFecha.GetMonthName(fecha.Month).ToUpper() Dim nombreMes As String = formatoFecha.GetMonthName(fecha.Month).ToUpper()
Dim LastDayOfMonth = DateTime.DaysInMonth(fecha.Year, fecha.Month) Dim LastDayOfMonth As Integer = DateTime.DaysInMonth(fecha.Year, fecha.Month)
Dim mesAnterior As String = String.Format("{0} {1} {2}", LastDayOfMonth, nombreMes, fecha.Year) Dim mesAnterior As String = String.Format("{0} {1} {2}", LastDayOfMonth, nombreMes, fecha.Year)