+
-
+
|
diff --git a/Contratos/ContratoObra.aspx.vb b/Contratos/ContratoObra.aspx.vb
index e04960ae0..f627ea687 100644
--- a/Contratos/ContratoObra.aspx.vb
+++ b/Contratos/ContratoObra.aspx.vb
@@ -595,7 +595,20 @@ Partial Class Contratos_ContratoObra
TmpDT.Columns.Add("NoIdentificacion", GetType(String))
TmpDT.Columns.Add("LimitarCantidad", GetType(Integer))
TmpDT.Columns.Add("OCInterna", GetType(String))
- TmpDT.Columns.Add("Observacion", GetType(String))
+ TmpDT.Columns.Add("Observacion", GetType(String))
+
+
+ TmpDT.Columns.Add("CveRubro", GetType(Integer))
+ TmpDT.Columns.Add("CveActividad", GetType(Integer))
+ TmpDT.Columns.Add("CveSubTipoActivoFijo", GetType(Integer))
+
+ TmpDT.Columns.Add("Rubro", GetType(String))
+ TmpDT.Columns.Add("Actividad", GetType(String))
+ TmpDT.Columns.Add("SubTipoActivoFijo", GetType(String))
+
+ TmpDT.Columns.Add("Dias", GetType(Integer))
+
+
End Sub
Protected Sub Limpiar()
TxtNumeroContrato.Text = ""
@@ -1477,10 +1490,14 @@ Partial Class Contratos_ContratoObra
Row("LimitarCantidad") = False 'If(ChkLimitarVenta.Checked, 1, 0)
Row("Observacion") = "" 'TxtObservacionesDetalles.Text
+ Row("CveRubro") = 1
+
+
+
Dim ObjContratos As New ClsContratos
- If ObjContratos.AddContratosDetalle(CveContrato, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("PU").ToString.ToDouble, UsuarioActual.CveUsuario, Row("CveTipoPresupuesto").ToString.ToEntero, Row("NoIdentificacion").ToString, False, "", Observacion:=Row("Observacion").ToString) Then
+ If ObjContratos.AddContratosDetalle(CveContrato, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("PU").ToString.ToDouble, UsuarioActual.CveUsuario, Row("CveTipoPresupuesto").ToString.ToEntero, Row("NoIdentificacion").ToString, False, "", Observacion:=Row("Observacion").ToString, CveRubro:=1) Then
If Autorizado Then
Dim msj As String = String.Format("Se agregaron {0} {1} del producto {2} con un precio ${3}.", Row("Cantidad"), Row("UM"), Row("PS"), Row("PU"))
@@ -1535,7 +1552,7 @@ Partial Class Contratos_ContratoObra
Dim ObjContratos As New ClsContratos
- If ObjContratos.UpdateContratosDetalle(CveContratoDetalleEditar, CveContrato, CvePS, Cantidad, PU, UsuarioActual.CveUsuario, NoIdentificacion, False, "", Observaciones) Then
+ If ObjContratos.UpdateContratosDetalle(CveContratoDetalleEditar, CveContrato, CvePS, Cantidad, PU, UsuarioActual.CveUsuario, NoIdentificacion, False, "", Observaciones, CveRubro:=1) Then
If Autorizado Then
Dim msj As String = String.Format("Se realizaron los siguientes cambios, el Presupuesto Interno se modificó: {1} {0} {2:C2} a {3} {0} {4:C2}",
@@ -1796,25 +1813,59 @@ Partial Class Contratos_ContratoObra
Dim Row As DataRow = TmpDT.NewRow()
Row("Cantidad") = TxtCantidadInsumos.Text.ToDouble.FormatoNumero
Row("CantidadContratada") = TxtCantidadInsumos.Text.ToDouble.FormatoNumero
- Row("CveUM") = DdlUMInsumos.SelectedValue.ToEntero
- Row("UM") = DdlUMInsumos.SelectedItem
- Row("CveClasificacion") = DdlClasificacionAddInsumos.SelectedValue
- Row("Clasificacion") = DdlClasificacionAddInsumos.SelectedItem
- Row("CvePS") = DdlProductowsInsumos.SelectedValue.ToEntero
- Row("PS") = DdlProductowsInsumos.SelectedText
- Row("CodigoPS") = DdlProductowsInsumos.SelectedText
+
Row("PU") = TxtPUInsumos.Text.ToDouble.FormatoNumero
Row("Total") = (TxtCantidadInsumos.Text.ToDouble * TxtPUInsumos.Text.ToDouble).FormatoNumero
Row("CveTipoPresupuesto") = 1
Row("NoIdentificacion") = "" 'TxtNoIdentificacionvInsumos.Text.Trim
Row("LimitarCantidad") = False
+ Row("CveRubro") = DdlRubro.SelectedValue.ToEntero
+ Row("Rubro") = DdlRubro.SelectedItem.Text
+
+ If DdlRubro.SelectedValue.ToEntero = 3 Then
+ Row("CveActividad") = DdlActividades.SelectedValue.ToEntero
+ Row("Actividad") = DdlActividades.SelectedItem.Text
+ Row("Dias") = TxtDias.Text.ToEntero
+ Row("CveSubTipoActivoFijo") = -1
+
+
+ Row("CveUM") = -1
+ Row("UM") = ""
+ Row("CveClasificacion") = -1
+ Row("Clasificacion") = ""
+ Row("CvePS") = -1
+ Row("PS") = DdlActividades.SelectedItem.Text
+ Row("CodigoPS") = DdlActividades.SelectedItem.Text
+
+ Else
+ Row("CveActividad") = -1
+ Row("Actividad") = ""
+ Row("CveSubTipoActivoFijo") = -1
+ Row("Dias") = 0
+
+
+ Row("CveUM") = DdlUMInsumos.SelectedValue.ToEntero
+ Row("UM") = DdlUMInsumos.SelectedItem
+ Row("CveClasificacion") = DdlClasificacionAddInsumos.SelectedValue
+ Row("Clasificacion") = DdlClasificacionAddInsumos.SelectedItem
+ Row("CvePS") = DdlProductowsInsumos.SelectedValue.ToEntero
+ Row("PS") = DdlProductowsInsumos.SelectedText
+ Row("CodigoPS") = DdlProductowsInsumos.SelectedText
+
+
+
+ End If
+
+
Dim ObjContratos As New ClsContratos
- If ObjContratos.AddContratosDetalle(CveContrato, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("PU").ToString.ToDouble, UsuarioActual.CveUsuario, Row("CveTipoPresupuesto").ToString.ToEntero, Row("NoIdentificacion").ToString, False, "") Then
- If Autorizado Then
- Dim msj As String = String.Format("Se agregaron {0} {1} del producto {2} con un precio ${3}.", Row("Cantidad"), Row("UM"), Row("PS"), Row("PU"))
- guardarBitacora(msj)
- End If
+ If ObjContratos.AddContratosDetalle(CveContrato, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("PU").ToString.ToDouble, UsuarioActual.CveUsuario, Row("CveTipoPresupuesto").ToString.ToEntero, Row("NoIdentificacion").ToString, False, "",
+ CveRubro:=Row("CveRubro").ToString.ToEntero, CveActividad:=Row("CveActividad").ToString.ToEntero, CveSubTipoActivoFijo:=Row("CveSubTipoActivoFijo").ToString.ToEntero, Dias:=Row("Dias").ToString.ToEntero) Then
+ 'If Autorizado Then
+ ' Dim msj As String = String.Format("Se agregaron {0} {1} del producto {2} con un precio ${3}.", Row("Cantidad"), Row("UM"), Row("PS"), Row("PU"))
+ ' guardarBitacora(msj)
+ 'End If
+
Row("CveContratoDetalle") = ObjContratos.DtResultados.Rows(0)("CveContratoDetalle")
TmpDT.Rows.Add(Row)
Dim TotalRow = Row("Total").ToString.ToDouble
@@ -1843,22 +1894,34 @@ Partial Class Contratos_ContratoObra
Dim Cantidad, PU As Double
Dim CvePS, CveUM As Integer
- 'Dim NoIdentificacion As String = ""
- 'Dim LimitarCantidad As Boolean
+
+ Dim CveRubro As Integer = DdlRubro.SelectedValue.ToEntero
+
+ Dim CveActividad As Integer = -1
+ Dim CveSubTipoActivoFijo As Integer = -1
+ Dim Dias As Integer = 0
+
+ If CveRubro = 3 Then
+
+ CveActividad = DdlActividades.SelectedValue.ToEntero
+ Dias = TxtDias.Text.ToEntero
+
+ CvePS = -1
+ CveUM = -1
+ Else
+ CvePS = DdlProductowsInsumos.SelectedValue.ToEntero
+ CveUM = DdlUMInsumos.SelectedValue.ToEntero
+ End If
+
Cantidad = TxtCantidadInsumos.Text.ToDouble
PU = TxtPUInsumos.Text.ToDouble
- CvePS = DdlProductowsInsumos.SelectedValue.ToEntero
- CveUM = DdlUMInsumos.SelectedValue.ToEntero
- 'NoIdentificacion = TxtNoIdentificacionvInsumos.Text.Trim
- 'LimitarCantidad = If(ChkLimitarInsumos.Checked, True, False)
+
Dim row = TmpDT.Select(String.Format(" CveContratoDetalle={0}", CveContratoDetalleEditar))(0)
-
-
Dim ObjContratos As New ClsContratos
- If ObjContratos.UpdateContratosDetalle(CveContratoDetalleEditar, CveContrato, CvePS, Cantidad, PU, UsuarioActual.CveUsuario, "", False, "") Then
+ If ObjContratos.UpdateContratosDetalle(CveContratoDetalleEditar, CveContrato, CvePS, Cantidad, PU, UsuarioActual.CveUsuario, "", False, "", CveRubro:=CveRubro, CveActividad:=CveActividad, CveSubTipoActivoFijo:=CveSubTipoActivoFijo, Dias:=Dias) Then
If Autorizado Then
Dim msj As String = String.Format("Se realizaron los siguientes cambios, el Presupuesto Interno se modificó: {1} {0} {2:C2} a {3} {0} {4:C2}",
@@ -2194,9 +2257,6 @@ Partial Class Contratos_ContratoObra
End If
-
-
-
If ObjContratos.GetReporteContratosAvancesDetalleControl(CveContrato, UsuarioActual.CveEmpresa) Then
GvDatosAvanceControl.DataSource = ObjContratos.DtResultados
@@ -4008,17 +4068,10 @@ Partial Class Contratos_ContratoObra
Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
LimpiarModalVentas()
- 'CveContratoDetalle,CveUM,CvePS,Cantidad,PU,CveTipoPresupuesto,CveClasificacion,CodigoPS,LimitarCantidad
-
CveContratoDetalleEditar = GvRow.DataKey("CveContratoDetalle").ToEntero
-
- 'TxtOCInterna.Text = GvRow.DataKey("OCInterna")
TxtCantidad.Text = GvRow.DataKey("CantidadContratada").ToDouble.ToString
- 'ChkLimitarVenta.Checked = Boolean.Parse(GvRow.DataKey("LimitarCantidad"))
-
- 'TxtNoIdentificacionv.Text = GvRow.DataKey("NoIdentificacion").ToDouble.ToString
DdlClasificacionAdd.SelectedValueExist(GvRow.DataKey("CveClasificacion").ToEntero)
DdlProductows.txtText.Value = GvRow.DataKey("PS").ToString
@@ -4040,14 +4093,17 @@ Partial Class Contratos_ContratoObra
RegistraScript("$('#ModalVentasAddPS').modal('show')")
End Sub
Protected Sub LnkEditarPresupuestoControlDetalle_Click(sender As Object, e As EventArgs)
+
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
+
+ Dim CveRubro As Integer = gvRow.DataKey("CveRubro").ToEntero
+
LimpiarModalControl()
CveContratoDetalleEditar = gvRow.DataKey("CveContratoDetalle").ToEntero
TxtCantidadInsumos.Text = gvRow.DataKey("CantidadContratada").ToDouble.ToString
- 'ChkLimitarInsumos.Checked = Boolean.Parse(gvRow.DataKey("LimitarCantidad"))
- ' TxtNoIdentificacionvInsumos.Text = gvRow.DataKey("NoIdentificacion")
+
DdlClasificacionAddInsumos.SelectedValueExist(gvRow.DataKey("CveClasificacion").ToEntero)
@@ -4059,16 +4115,42 @@ Partial Class Contratos_ContratoObra
DdlUMInsumos.DataBind()
DdlUMInsumos.SelectedValueExist(gvRow.DataKey("CveUM").ToDouble.ToString)
-
-
TxtPUInsumos.Text = gvRow.DataKey("PU").ToDouble.ToString
+ DdlRubro.SelectedValueExist(gvRow.DataKey("CveRubro").ToString)
+
+ If CveRubro = 3 Then
+
+ DVDias.Visible = True
+ DVActividadesRH.Visible = True
+
+ DVClasificacion.Visible = False
+ DVPS.Visible = False
+ DVUM.Visible = False
+
+ DdlActividades.SelectedValueExist(gvRow.DataKey("CveActividad"))
+ TxtDias.Text = gvRow.DataKey("Dias")
+ Else
+ DVDias.Visible = False
+ DVActividadesRH.Visible = False
+
+ DVClasificacion.Visible = True
+ DVPS.Visible = True
+ DVUM.Visible = True
+
+ DdlActividades.SelectedValueExist(-1)
+ TxtDias.Text = "0"
+
+ End If
+
ModalControlPSAdd = False
ChkContinualAgregandoControl.Visible = False
ChkContinualAgregandoControl.Checked = False
+ UpModalControlAddPS.Update()
+
RegistraScript("$('#ModalControlAddPS').modal('show')")
End Sub
@@ -4098,7 +4180,12 @@ Partial Class Contratos_ContratoObra
End Sub
Private Sub LimpiarModalControl()
+ DdlActividades.Items.Clear()
+ DdlActividades.DataSource = GlobalDTRHActividades(UsuarioActual.CveEmpresa)
+ DdlActividades.DataBind()
+
+ DdlActividades.Items.Insert(0, New ListItem("Seleccione una", "-1"))
TxtCantidadInsumos.Text = ""
'ChkLimitarInsumos.Checked = False
@@ -4110,6 +4197,21 @@ Partial Class Contratos_ContratoObra
DdlUMInsumos.SelectedValueExist(-1)
TxtPUInsumos.Text = ""
+ DdlRubro.SelectedValue = "2"
+ ' DdlRubro_SelectedIndexChanged(Nothing, Nothing)
+
+
+ DVClasificacion.Visible = True
+ DVPS.Visible = True
+ DVUM.Visible = True
+
+ DVDias.Visible = False
+ DVActividadesRH.Visible = False
+
+ TxtDias.Text = ""
+ DdlActividades.SelectedValueExist(-1)
+
+
If ModalControlPSAdd = True Then
LtlModalControlPSTitulo.Text = "Agregar Producto Presupuesto Control"
@@ -4126,27 +4228,57 @@ Partial Class Contratos_ContratoObra
Protected Sub BtnCargaPresupuesto_Click(sender As Object, e As EventArgs)
Dim DTCargaPresupuesto As New DataTable
- DTCargaPresupuesto = CargaPreSupuestoExcel()
+ Dim DTCargaPresupuestoInsumos As New DataTable
+ Dim DTCargaPresupuestoManoObra As New DataTable
+ Dim DTCargaPresupuestoFlotillas As New DataTable
+
+
+ If TipoCargaPresupuesto = EnumTipoCargaPresupuesto.Ventas Then
+
+ DTCargaPresupuesto = CargaPreSupuestoExcel("Presupuesto")
+
+ If DTCargaPresupuesto.Rows.Count > 0 Then
+ ProcesaDatosCargaPresupuesto(DTCargaPresupuesto, Nothing, Nothing)
+ Else
+ Alert("No se encintraron partidas en el documento", TipoMensaje.MsgAdvertencia)
+ End If
- If DTCargaPresupuesto.Rows.Count > 0 Then
- ProcesaDatosCargaPresupuesto(DTCargaPresupuesto)
Else
- Alert("No se encintraron partidas en el documento", TipoMensaje.MsgAdvertencia)
+
+ DTCargaPresupuesto = CargaPreSupuestoExcel("Insumos")
+ DTCargaPresupuestoManoObra = CargaPreSupuestoExcel("ManoObra")
+ DTCargaPresupuestoFlotillas = CargaPreSupuestoExcel("Flotillas")
+
+ ProcesaDatosCargaPresupuesto(DTCargaPresupuesto, DTCargaPresupuestoManoObra, DTCargaPresupuestoFlotillas)
+
End If
+ TxtModalCargaPresupuesto.Text = ""
+
End Sub
Protected Sub BtnDecargaFormato_Click(sender As Object, e As EventArgs)
-
Dim FI As New IO.FileInfo($"{Extensiones.DirectorioBaseEmpresas}\Empresas\Grales\Formatos\FormatoPresupuestoObra.xlsx")
+ If TipoCargaPresupuesto = EnumTipoCargaPresupuesto.Ventas Then
+ FI = New IO.FileInfo($"{Extensiones.DirectorioBaseEmpresas}\Empresas\Grales\Formatos\FormatoPresupuestoObra.xlsx")
+ Else
+ FI = New IO.FileInfo($"{Extensiones.DirectorioBaseEmpresas}\Empresas\Grales\Formatos\FormatoPresupuestoObraInterno.xlsx")
+ End If
+
If FI.Exists Then
Response.ContentType = "application/octet-stream"
- Response.AppendHeader("Content-Disposition", $"attachment; filename=FormatoPresupuestoObra.xlsx")
+
+ If TipoCargaPresupuesto = EnumTipoCargaPresupuesto.Ventas Then
+ Response.AppendHeader("Content-Disposition", $"attachment; filename=FormatoPresupuestoObra.xlsx")
+ Else
+ Response.AppendHeader("Content-Disposition", $"attachment; filename=FormatoPresupuestoObraInterno.xlsx")
+ End If
+
Response.TransmitFile(FI.FullName)
Response.End()
@@ -4156,7 +4288,7 @@ Partial Class Contratos_ContratoObra
End Sub
- Private Function CargaPreSupuestoExcel() As DataTable
+ Private Function CargaPreSupuestoExcel(Hoja As String) As DataTable
Dim FileExtension As String = "-1"
Dim Filesgral As List(Of Archivo) = TxtModalCargaPresupuesto.getfiles().Archivos
@@ -4178,7 +4310,7 @@ Partial Class Contratos_ContratoObra
tempArray = fileItem.filename.ToString().Split("-".ToCharArray())
SpreadsheetInfo.SetLicense(Extensiones.SerialGemBoxSpreadsheet)
Dim workbook = ExcelFile.Load(fileItem.FileUrl)
- Dim worksheet = workbook.Worksheets(0)
+ Dim worksheet = workbook.Worksheets(Hoja)
DTPS = worksheet.CreateDataTable(New CreateDataTableOptions() With
{
.ColumnHeaders = True,
@@ -4190,7 +4322,7 @@ Partial Class Contratos_ContratoObra
Next
- TxtModalCargaPresupuesto.Text = ""
+
RegistraScript("$('#ModalUploadPresupuesto').modal('hide')")
@@ -4201,7 +4333,26 @@ Partial Class Contratos_ContratoObra
End Function
- Private Sub ProcesaDatosCargaPresupuesto(DTPresupuesto As DataTable)
+ Private Sub ProcesaDatosCargaPresupuesto(DTPresupuesto As DataTable, DTCargaPresupuestoManoObra As DataTable, DTCargaPresupuestoFlotillas As DataTable)
+
+
+ If Not DTPresupuesto Is Nothing Then
+ DTPresupuesto.CaseSensitive = False
+ End If
+
+ If Not DTCargaPresupuestoManoObra Is Nothing Then
+ DTCargaPresupuestoManoObra.CaseSensitive = False
+ End If
+
+ If Not DTCargaPresupuestoFlotillas Is Nothing Then
+ DTCargaPresupuestoFlotillas.CaseSensitive = False
+ End If
+
+ Dim ErrorProceso = False
+
+
+
+
Dim DTPS = New DataTable
DTPS.Columns.Add("CveContratoDetalle", GetType(Integer))
@@ -4228,151 +4379,287 @@ Partial Class Contratos_ContratoObra
DTPS.Columns.Add("OCInterna", GetType(String))
DTPS.Columns.Add("Observacion", GetType(String))
+ DTPS.Columns.Add("CveRubro", GetType(Integer))
+ DTPS.Columns.Add("CveActividad", GetType(Integer))
+ DTPS.Columns.Add("CveSubTipoActivoFijo", GetType(Integer))
+
+ DTPS.Columns.Add("Rubro", GetType(String))
+ DTPS.Columns.Add("Actividad", GetType(String))
+ DTPS.Columns.Add("SubTipoActivoFijo", GetType(String))
+ DTPS.Columns.Add("Dias", GetType(Integer))
+
Dim RowNoEncontrados As String = ""
- For Each DrowPS As DataRow In DTPresupuesto.Rows
+ If Not DTPresupuesto Is Nothing Then
+ For Each DrowPS As DataRow In DTPresupuesto.Rows
- Dim StrArray() As String = GetPS("PS", DrowPS("PS").ToString).Split("|"c)
- Dim CvePS As Integer
- Dim CveUM As Integer
+ Dim StrArray() As String = GetPS("PS", DrowPS("Producto").ToString).Split("|"c)
+ Dim CvePS As Integer
+ Dim CveUM As Integer
- If StrArray.Length > 0 Then
- If CBool(StrArray(0)) = True Then
- CvePS = StrArray(1).ToEntero
- Else
- RowNoEncontrados &= StrArray(1) & "<\BR>"
+ If StrArray.Length > 0 Then
+ If CBool(StrArray(0)) = True Then
+ CvePS = StrArray(1).ToEntero
+ Else
+ RowNoEncontrados &= StrArray(1) & "<\BR>"
+ End If
End If
- End If
- If CvePS > 0 And DrowPS("Cantidad").ToString.ToDouble > 0 Then
- CveUM = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("CveUnidadMedida", "").ToString.ToEntero
- Dim Row As DataRow = DTPS.NewRow()
- Row("Cantidad") = DrowPS("Cantidad").ToString.ToDouble
- Row("CantidadContratada") = DrowPS("Cantidad").ToString.ToDouble
- Row("CveUM") = CveUM
- Row("UM") = ""
- Row("CveClasificacion") = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("CveClasificacion", "").ToString.ToEntero
- Row("Clasificacion") = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = '{ Row("CveClasificacion").ToString }'").ToString
- Row("CvePS") = CvePS
- Row("PS") = DrowPS("PS").ToString
- Row("CodigoPS") = DrowPS("PS").ToString
- Row("PU") = DrowPS("PU").ToString.ToDouble
- Row("Total") = DrowPS("Cantidad").ToString.ToDouble * DrowPS("PU").ToString.ToDouble
+ If CvePS > 0 And DrowPS("Cantidad").ToString.ToDouble > 0 Then
+
+
+
+ CveUM = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveUnidadMedida", $" UnidadMedida = '{ DrowPS("UnidadMedida").ToString.Trim }' OR Abreviatura = '{ DrowPS("UnidadMedida").ToString.Trim }'").ToEntero
+
+ If CveUM <= 0 Then
+ CveUM = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("CveUnidadMedida", "").ToString.ToEntero
+ End If
+
+
+ Dim Row As DataRow = DTPS.NewRow()
+
+ Row("Cantidad") = DrowPS("Cantidad").ToString.ToDouble
+ Row("CantidadContratada") = DrowPS("Cantidad").ToString.ToDouble
+ Row("CveUM") = CveUM
+ Row("UM") = ""
+ Row("CveClasificacion") = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("CveClasificacion", "").ToString.ToEntero
+ Row("Clasificacion") = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = '{ Row("CveClasificacion").ToString }'").ToString
+ Row("CvePS") = CvePS
+ Row("PS") = DrowPS("Producto").ToString
+ Row("CodigoPS") = DrowPS("Producto").ToString
+ Row("PU") = DrowPS("PU").ToString.ToDouble
+ Row("Total") = DrowPS("Cantidad").ToString.ToDouble * DrowPS("PU").ToString.ToDouble
+
+ Select Case TipoCargaPresupuesto
+ Case EnumTipoCargaPresupuesto.Ventas
+
+ Row("CveTipoPresupuesto") = 2
+ Row("CveRubro") = 1
+ Row("CveActividad") = -1
+ Row("CveSubTipoActivoFijo") = -1
+ Row("Dias") = 0
+
+ Exit Select
+ Case EnumTipoCargaPresupuesto.Control
+ Row("CveTipoPresupuesto") = 1
+ Row("CveRubro") = 2
+ Row("CveActividad") = -1
+ Row("CveSubTipoActivoFijo") = -1
+ Row("Dias") = 0
+ Exit Select
+ Case Else
+ Row("CveTipoPresupuesto") = 1
+ Row("CveActividad") = -1
+ Row("CveSubTipoActivoFijo") = -1
+ Row("Dias") = 0
+ End Select
+
+
+ Row("NoIdentificacion") = ""
+ Row("OCInterna") = ""
+ Row("LimitarCantidad") = 0
+ Row("Observacion") = ""
+
+ DTPS.Rows.Add(Row)
+ Else
+ ErrorProceso = True
+ End If
+ Next
+
+ End If
+
+
+
+ If Not DTCargaPresupuestoManoObra Is Nothing And Not ErrorProceso Then
+
+
+ For Each DrowPS As DataRow In DTCargaPresupuestoManoObra.Rows
+
+ Dim CveActividad As Integer = 0
+ Dim Actividad As String
+
+
+ If DrowPS("Actividad").ToString.Trim.Length > 0 Then
+ GlobalDTRHActividades(UsuarioActual.CveEmpresa) = Nothing
+ CveActividad = GlobalDTRHActividades(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveActividad", $" Actividad = '{ DrowPS("Actividad").ToString.Trim }'").ToEntero
+
+ If CveActividad <= 0 Then
+
+
+ Dim ObjRH As New ClsRH()
+
+ If ObjRH.AddActividades(DrowPS("Actividad").ToString.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
+
+ CveActividad = ObjRH.CveActividad
+
+ If CveActividad <= 0 Then
+ ErrorProceso = True
+ End If
+
+ GlobalDTRHActividades(UsuarioActual.CveEmpresa) = Nothing
+
+ Else
+ ErrorProceso = True
+ End If
+
+ ObjRH.Dispose()
+
+ End If
+
+
+ If CveActividad > 0 And DrowPS("Cantidad").ToString.ToDouble > 0 And Not ErrorProceso Then
+
+ Actividad = GlobalDTRHActividades(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Actividad", $" CveActividad = {CveActividad}")
+
+ Dim Row As DataRow = DTPS.NewRow()
+ Row("Cantidad") = DrowPS("Cantidad").ToString.ToDouble
+ Row("CantidadContratada") = DrowPS("Cantidad").ToString.ToDouble
+ Row("CveUM") = -1
+ Row("UM") = "Actividad RH"
+ Row("CveClasificacion") = -1
+ Row("Clasificacion") = ""
+ Row("CvePS") = -1
+ Row("PS") = Actividad
+ Row("CodigoPS") = Actividad
+ Row("PU") = DrowPS("PU").ToString.ToDouble
+ Row("Total") = DrowPS("Cantidad").ToString.ToDouble * DrowPS("PU").ToString.ToDouble
+
+ Row("CveTipoPresupuesto") = 1
+ Row("CveRubro") = 3
+ Row("CveActividad") = CveActividad
+ Row("CveSubTipoActivoFijo") = -1
+ Row("Dias") = DrowPS("Dias").ToString.ToEntero
+
+ Row("NoIdentificacion") = ""
+ Row("OCInterna") = ""
+ Row("LimitarCantidad") = 0
+ Row("Observacion") = ""
+
+ DTPS.Rows.Add(Row)
+
+ End If
+ End If
+
+
+ Next
+
+ End If
+
+ If Not DTCargaPresupuestoFlotillas Is Nothing Then
+
+ End If
+
+
+ If Not ErrorProceso Then
+
+ Dim ObjContratos As New ClsContratos
+ Dim TotalRow As Double = 0
+ ObjContratos.IniciaTransacSQL()
+
+ For Each Row As DataRow In DTPS.Rows
+
+ If ObjContratos.AddContratosDetalle(CveContrato, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("PU").ToString.ToDouble, UsuarioActual.CveUsuario, Row("CveTipoPresupuesto").ToString.ToEntero,
+ Row("NoIdentificacion").ToString, Convert.ToBoolean(Row("LimitarCantidad")), Row("OCInterna").ToString, Observacion:=Row("Observacion").ToString, CveRubro:=Row("CveRubro").ToString.ToEntero,
+ CveActividad:=Row("CveActividad").ToString.ToEntero, CveSubTipoActivoFijo:=Row("CveSubTipoActivoFijo").ToString.ToEntero, Dias:=Row("Dias").ToString.ToEntero) Then
+
+ If Autorizado Then
+ Dim msj As String = String.Format("Se agregaron {0} {1} del producto {2} con rubro {4} con un precio ${3}.", Row("Cantidad"), Row("UM"), Row("PS"), Row("PU"), Row("CveRubro"))
+ guardarBitacora(msj)
+ End If
+
+ Dim NrowTmpDT As DataRow = TmpDT.NewRow
+
+
+ NrowTmpDT("Cantidad") = Row("Cantidad")
+ NrowTmpDT("CantidadContratada") = Row("CantidadContratada")
+ NrowTmpDT("CveUM") = Row("CveUM")
+ NrowTmpDT("UM") = Row("UM")
+ NrowTmpDT("CveClasificacion") = Row("CveClasificacion")
+ NrowTmpDT("Clasificacion") = Row("Clasificacion")
+ NrowTmpDT("CvePS") = Row("CvePS")
+
+
+ NrowTmpDT("PS") = Row("PS")
+ NrowTmpDT("CodigoPS") = Row("CodigoPS")
+
+
+
+
+ NrowTmpDT("PU") = Row("PU")
+ NrowTmpDT("Total") = Row("Total")
+ NrowTmpDT("CveTipoPresupuesto") = Row("CveTipoPresupuesto")
+ NrowTmpDT("NoIdentificacion") = Row("NoIdentificacion")
+ NrowTmpDT("OCInterna") = Row("OCInterna")
+ NrowTmpDT("LimitarCantidad") = Row("LimitarCantidad")
+ NrowTmpDT("Observacion") = Row("Observacion")
+
+ NrowTmpDT("CveRubro") = Row("CveRubro")
+ NrowTmpDT("CveActividad") = Row("CveActividad")
+ NrowTmpDT("CveSubTipoActivoFijo") = Row("CveSubTipoActivoFijo")
+
+ NrowTmpDT("Rubro") = Row("Rubro")
+ NrowTmpDT("Actividad") = Row("Actividad")
+ NrowTmpDT("SubTipoActivoFijo") = Row("SubTipoActivoFijo")
+
+
+ NrowTmpDT("CveContratoDetalle") = ObjContratos.DtResultados.Rows(0)("CveContratoDetalle")
+
+ TmpDT.Rows.Add(NrowTmpDT)
+ TmpDT.AcceptChanges()
+
+ TotalRow = TotalRow + NrowTmpDT("Total").ToString.ToDouble
+ Else
+ ErrorProceso = True
+ Exit For
+ End If
+ Next
+
+
+ If ErrorProceso Then
+ ObjContratos.RollBack()
+ Alert("Se presento un error al cargar el presupuesto.", TipoMensaje.MsgError)
+ Else
+
+ ObjContratos.Commit()
+ Alert("Presupuesto Cargado correctamente")
Select Case TipoCargaPresupuesto
Case EnumTipoCargaPresupuesto.Ventas
- Row("CveTipoPresupuesto") = 2
+ CargaGVPresupuestos(TmpDT.FiltraParametros("CveTipoPresupuesto=2"))
+ UpGV.Update()
Exit Select
Case EnumTipoCargaPresupuesto.Control
- Row("CveTipoPresupuesto") = 1
+ CargaGVPresupuestosInsumos(TmpDT.FiltraParametros("CveTipoPresupuesto=1"))
+ UpGVInsumos.Update()
Exit Select
Case Else
- Row("CveTipoPresupuesto") = 1
+
End Select
-
- Row("NoIdentificacion") = ""
- Row("OCInterna") = ""
- Row("LimitarCantidad") = 0
- Row("Observacion") = ""
-
- DTPS.Rows.Add(Row)
+ LbTotalGeneral.Text = (LbTotalGeneral.Text.ToDouble + TotalRow).ToString.FormatoNumero
+ LblImporte.Text = LbTotalGeneral.Text
+ UpGral.Update()
End If
- Next
+ ObjContratos.Dispose()
-
- Dim ErrorProceso = False
- Dim ObjContratos As New ClsContratos
- Dim TotalRow As Double = 0
- ObjContratos.IniciaTransacSQL()
-
- For Each Row As DataRow In DTPS.Rows
-
- If ObjContratos.AddContratosDetalle(CveContrato, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("PU").ToString.ToDouble, UsuarioActual.CveUsuario, Row("CveTipoPresupuesto").ToString.ToEntero, Row("NoIdentificacion").ToString, Convert.ToBoolean(Row("LimitarCantidad")), Row("OCInterna").ToString, Observacion:=Row("Observacion").ToString) Then
-
- If Autorizado Then
- Dim msj As String = String.Format("Se agregaron {0} {1} del producto {2} con un precio ${3}.", Row("Cantidad"), Row("UM"), Row("PS"), Row("PU"))
- guardarBitacora(msj)
- End If
-
- Dim NrowTmpDT As DataRow = TmpDT.NewRow
-
-
- NrowTmpDT("Cantidad") = Row("Cantidad")
- NrowTmpDT("CantidadContratada") = Row("CantidadContratada")
- NrowTmpDT("CveUM") = Row("CveUM")
- NrowTmpDT("UM") = Row("UM")
- NrowTmpDT("CveClasificacion") = Row("CveClasificacion")
- NrowTmpDT("Clasificacion") = Row("Clasificacion")
- NrowTmpDT("CvePS") = Row("CvePS")
- NrowTmpDT("PS") = Row("PS")
- NrowTmpDT("CodigoPS") = Row("CodigoPS")
- NrowTmpDT("PU") = Row("PU")
- NrowTmpDT("Total") = Row("Total")
- NrowTmpDT("CveTipoPresupuesto") = Row("CveTipoPresupuesto")
- NrowTmpDT("NoIdentificacion") = Row("NoIdentificacion")
- NrowTmpDT("OCInterna") = Row("OCInterna")
- NrowTmpDT("LimitarCantidad") = Row("LimitarCantidad")
- NrowTmpDT("Observacion") = Row("Observacion")
-
-
- NrowTmpDT("CveContratoDetalle") = ObjContratos.DtResultados.Rows(0)("CveContratoDetalle")
-
- TmpDT.Rows.Add(NrowTmpDT)
- TmpDT.AcceptChanges()
-
- TotalRow = TotalRow + NrowTmpDT("Total").ToString.ToDouble
- Else
- ErrorProceso = True
- Exit For
- End If
- Next
-
-
- If ErrorProceso Then
- ObjContratos.RollBack()
- Alert("Se presento un error al cargar el presupuesto.", TipoMensaje.MsgError)
- Else
-
- ObjContratos.Commit()
- Alert("Presupuesto Cargado correctamente")
-
-
- Select Case TipoCargaPresupuesto
- Case EnumTipoCargaPresupuesto.Ventas
- CargaGVPresupuestos(TmpDT.FiltraParametros("CveTipoPresupuesto=2"))
- UpGV.Update()
- Exit Select
- Case EnumTipoCargaPresupuesto.Control
- CargaGVPresupuestosInsumos(TmpDT.FiltraParametros("CveTipoPresupuesto=1"))
- UpGVInsumos.Update()
- Exit Select
- Case Else
-
- End Select
-
- LbTotalGeneral.Text = (LbTotalGeneral.Text.ToDouble + TotalRow).ToString.FormatoNumero
- LblImporte.Text = LbTotalGeneral.Text
- UpGral.Update()
-
End If
- ObjContratos.Dispose()
-
If RowNoEncontrados.Length > 0 Then
Alert($"Productos no encontrados
{RowNoEncontrados} ")
End If
+
+
End Sub
@@ -4606,42 +4893,34 @@ Partial Class Contratos_ContratoObra
Con.Dispose()
- If DTDatos.Rows.Count > 0 Then
+ Try
+ If DTDatos.Rows.Count > 0 Then
- Dim CantidadAvance As Decimal = DTDatos.Rows(0)("Cantidad").ToString.ToDecimal
- Dim ImporteAvance As Decimal = DTDatos.Rows(0)("AvanceImporte").ToString.ToDecimal
- Dim TotalAvancePorcentaje As Decimal = If(ImporteAvance > 0, (ImporteAvance * 100 / TotalAvanceVentas).RoundSQL(2), 0)
+ Dim CantidadAvance As Decimal = DTDatos.Rows(0)("Cantidad").ToString.ToDecimal
+ Dim ImporteAvance As Decimal = DTDatos.Rows(0)("AvanceImporte").ToString.ToDecimal
+ Dim TotalAvancePorcentaje As Decimal = If(ImporteAvance > 0, (ImporteAvance * 100 / TotalAvanceVentas).RoundSQL(2), 0)
- Dim CantidadInterno As Decimal = DTDatos.Rows(0)("CantidadInterno").ToString.ToDecimal
- Dim ImporteInterno As Decimal = DTDatos.Rows(0)("ImporteInterno").ToString.ToDecimal
- Dim TotalFaltantePorcentaje As Decimal = If(ImporteInterno > 0, (ImporteInterno * 100 / TotalAvanceInterno).RoundSQL(2), 0)
+ Dim CantidadInterno As Decimal = DTDatos.Rows(0)("CantidadInterno").ToString.ToDecimal
+ Dim ImporteInterno As Decimal = DTDatos.Rows(0)("ImporteInterno").ToString.ToDecimal
+ Dim TotalFaltantePorcentaje As Decimal = If(ImporteInterno > 0, (ImporteInterno * 100 / TotalAvanceInterno).RoundSQL(2), 0)
- LtlAvanceImporte.Text = $"$ { ImporteAvance.ToString("###,###,###.00") }"
- LtlAvanceImporteProcentaje1.Text = $"{TotalAvancePorcentaje.ToString("###.00")} %"
- LtlAvanceImporteProcentaje2.Text = $"{TotalAvancePorcentaje.ToString("###.00")}%"
- SPAvance1.Attributes.Add("style", $"width:{TotalAvancePorcentaje.ToString.ToEntero}%")
+ LtlAvanceImporte.Text = $"$ { ImporteAvance.ToString("###,###,###.00") }"
+ LtlAvanceImporteProcentaje1.Text = $"{TotalAvancePorcentaje.ToString("###.00")} %"
+ LtlAvanceImporteProcentaje2.Text = $"{TotalAvancePorcentaje.ToString("###.00")}%"
+ SPAvance1.Attributes.Add("style", $"width:{TotalAvancePorcentaje.ToString.ToEntero}%")
- LtlAvanceInternoImporte.Text = $"$ {DTDatos.Rows(0)("ImporteInterno").ToString.ToDecimal.ToString("###,###,###.00")}"
- LtlAvanceInternoImportePorcentaje1.Text = $"{TotalFaltantePorcentaje.ToString("###.00")} %"
- LtlAvanceInternoImportePorcentaje2.Text = $"{TotalFaltantePorcentaje.ToString("###.00")}%"
- SPFaltante.Attributes.Add("style", $"width:{TotalFaltantePorcentaje.ToString.ToEntero}%")
+ LtlAvanceInternoImporte.Text = $"$ {DTDatos.Rows(0)("ImporteInterno").ToString.ToDecimal.ToString("###,###,###.00")}"
+ LtlAvanceInternoImportePorcentaje1.Text = $"{TotalFaltantePorcentaje.ToString("###.00")} %"
+ LtlAvanceInternoImportePorcentaje2.Text = $"{TotalFaltantePorcentaje.ToString("###.00")}%"
+ SPFaltante.Attributes.Add("style", $"width:{TotalFaltantePorcentaje.ToString.ToEntero}%")
- End If
+ End If
+ Catch ex As Exception
- 'Dim TotalContratos As Decimal = DTDatos.SUM("Importe")
- 'Dim TotalAvance As Decimal = DTDatos.SUM("AvanceImporte")
- 'Dim TotalFaltante As Decimal = TotalContratos - TotalAvance
-
-
- 'Dim TotalAvancePorcentaje As Decimal = ((TotalAvance * 100) / TotalContratos).RoundAD(2)
- 'Dim TotalFaltantePorcentaje As Decimal = (100 - TotalAvancePorcentaje).RoundAD(2)
-
-
- ' LtlGrafNumeroContratos.Text = NumeroContratos.ToString
- 'LtlGrafTotal.Text = TotalContratos.ToString("###,###,###.00")
+ End Try
DVGraficas.Visible = True
@@ -4653,6 +4932,29 @@ Partial Class Contratos_ContratoObra
+ Protected Sub DdlRubro_SelectedIndexChanged(sender As Object, e As EventArgs)
+
+
+ If DdlRubro.SelectedValue.ToEntero = 3 Then
+ DVDias.Visible = True
+ DVActividadesRH.Visible = True
+
+ DVClasificacion.Visible = False
+ DVPS.Visible = False
+ DVUM.Visible = False
+ Else
+ DVDias.Visible = False
+ DVActividadesRH.Visible = False
+
+ DVClasificacion.Visible = True
+ DVPS.Visible = True
+ DVUM.Visible = True
+
+ End If
+
+ UpModalControlAddPS.Update()
+
+ End Sub
End Class
diff --git a/Inventarios/InventarioFisicoDetalle.aspx.vb b/Inventarios/InventarioFisicoDetalle.aspx.vb
index a5abf5a98..a3a248298 100644
--- a/Inventarios/InventarioFisicoDetalle.aspx.vb
+++ b/Inventarios/InventarioFisicoDetalle.aspx.vb
@@ -328,37 +328,37 @@ Partial Class Inventarios_InventarioFisicoDetalle
End If
FechaCaducidad = If(TxtFechaCaducidad.Text.Length > 0, TxtFechaCaducidad.Text, MinFecha.ToString)
End If
- If AplicaSeccion Then
- Dim ObjInv As New ClsInventarios
- Dim SeccionesAlmacenDelProducto As New DataTable
- If ObjInv.GetProductosServiciosAlmacenSeccion(CveProducto, -1, -1, UsuarioActual.CveEmpresa) Then
- SeccionesAlmacenDelProducto = ObjInv.DtResultados.FiltraParametros(String.Format("CveAlmacen IN ({0})", CveAlmacenes))
- End If
- 'Dim SeccionesAlmacenDelProducto As DataTable = (UsuarioActual.CveEmpresa, -1, CveProducto) '.FiltraParametros(String.Format("CveAlmacen IN ({0})", CveAlmacenes))
- 'Alert(SeccionesAlmacenDelProducto.Rows.Count.ToString)
- If SeccionesAlmacenDelProducto.Rows.Count = 1 Then
- CveSeccionAlmacen = SeccionesAlmacenDelProducto.FiltroPrimeroValor("CveSeccionAlmacen")
- Else
- divSeccion.Visible = AplicaSeccion
- If DdlSeccionAlmacen.Items.Count = 0 Then
- DdlSeccionAlmacen.DataSource = SeccionesAlmacenDelProducto
- DdlSeccionAlmacen.DataBind()
- DdlSeccionAlmacen.Items.Insert(0, New ListItem("Seleccione", "-1"))
- End If
+ 'If AplicaSeccion Then
+ ' Dim ObjInv As New ClsInventarios
+ ' Dim SeccionesAlmacenDelProducto As New DataTable
+ ' If ObjInv.GetProductosServiciosAlmacenSeccion(CveProducto, -1, -1, UsuarioActual.CveEmpresa) Then
+ ' SeccionesAlmacenDelProducto = ObjInv.DtResultados.FiltraParametros(String.Format("CveAlmacen IN ({0})", CveAlmacenes))
+ ' End If
+ ' 'Dim SeccionesAlmacenDelProducto As DataTable = (UsuarioActual.CveEmpresa, -1, CveProducto) '.FiltraParametros(String.Format("CveAlmacen IN ({0})", CveAlmacenes))
+ ' 'Alert(SeccionesAlmacenDelProducto.Rows.Count.ToString)
+ ' If SeccionesAlmacenDelProducto.Rows.Count = 1 Then
+ ' CveSeccionAlmacen = SeccionesAlmacenDelProducto.FiltroPrimeroValor("CveSeccionAlmacen")
+ ' Else
+ ' divSeccion.Visible = AplicaSeccion
+ ' If DdlSeccionAlmacen.Items.Count = 0 Then
+ ' DdlSeccionAlmacen.DataSource = SeccionesAlmacenDelProducto
+ ' DdlSeccionAlmacen.DataBind()
+ ' DdlSeccionAlmacen.Items.Insert(0, New ListItem("Seleccione", "-1"))
+ ' End If
- If DdlSeccionAlmacen.SelectedValue = "-1" Then
- RfvSeccionAlmacen.Enabled = True
- RfvSeccionAlmacen.Visible = True
- RfvSeccionAlmacen.SetFocusOnError = True
- RfvSeccionAlmacen.Validate()
- RfvSeccionAlmacen.ValidationGroup = " "
- Exit Sub
- End If
- CveSeccionAlmacen = DdlSeccionAlmacen.SelectedValue.ToEntero
- End If
- ObjInv.Dispose()
- SeccionAlmacen = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, -1).FiltroPrimeroValor("SeccionAlmacen", String.Format("CveSeccionAlmacen = {0}", CveSeccionAlmacen))
- End If
+ ' If DdlSeccionAlmacen.SelectedValue = "-1" Then
+ ' RfvSeccionAlmacen.Enabled = True
+ ' RfvSeccionAlmacen.Visible = True
+ ' RfvSeccionAlmacen.SetFocusOnError = True
+ ' RfvSeccionAlmacen.Validate()
+ ' RfvSeccionAlmacen.ValidationGroup = " "
+ ' Exit Sub
+ ' End If
+ ' CveSeccionAlmacen = DdlSeccionAlmacen.SelectedValue.ToEntero
+ ' End If
+ ' ObjInv.Dispose()
+ ' SeccionAlmacen = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, -1).FiltroPrimeroValor("SeccionAlmacen", String.Format("CveSeccionAlmacen = {0}", CveSeccionAlmacen))
+ 'End If
RFVSerie.ValidationGroup = "GrpIngresar"
RFVSerie.Enabled = False
diff --git a/Inventarios/RepAnomalias.aspx.vb b/Inventarios/RepAnomalias.aspx.vb
index 12433a1ec..57f6afc1a 100644
--- a/Inventarios/RepAnomalias.aspx.vb
+++ b/Inventarios/RepAnomalias.aspx.vb
@@ -194,9 +194,10 @@ Partial Class Inventarios_RepAnomalias
e.Row.Cells(8).Text = "0"
End If
- If e.Row.Cells(7).Text = MinFecha Then
+ If e.Row.Cells(7).Text = MinFecha.ToString Then
e.Row.Cells(7).Text = ""
End If
+
e.Row.FCLabel("Lblc").Text = e.Row.RowIndex + 1
End If
diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb
index 9ed386e6f..16b5dd100 100644
--- a/Inventarios/TraspasoAlmacen.aspx.vb
+++ b/Inventarios/TraspasoAlmacen.aspx.vb
@@ -1525,7 +1525,7 @@ Partial Class Inventarios_TraspasoAlmacen
FolioBusqueda = If(TxtFolioRecepcion.Text = "", -1, TxtFolioRecepcion.Text.ToEntero)
Dim ObjInventarios As New ClsInventarios
- If ObjInventarios.GetMovimientosTransitorios(DdlAlmacenRecepcion.SelectedValue.ToEntero, -1, DdlAlmacenTransitorioRecepcion.SelectedValue.ToEntero, -1, FolioBusqueda, UsuarioActual.CveEmpresa) Then
+ If ObjInventarios.GetMovimientosTransitorios(DdlAlmacenRecepcion.SelectedValue.ToEntero, -1, DdlAlmacenTransitorioRecepcion.SelectedValue.ToEntero, -1, FolioBusqueda, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) Then
Dtt = ObjInventarios.DtResultados.FiltraParametros(String.Format("CveTipoAlmacenDestino <> 4"))
Else
Alert("Ocurrió un error al consultar los movimientos transitorios. Por favor vuelva a intentar.", TipoMensaje.MsgAdvertencia)
@@ -1820,7 +1820,7 @@ Partial Class Inventarios_TraspasoAlmacen
Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL())
'' verifica que no se halla recibido previamente, si ya se recibió da salida
- If ObjInventario.GetMovimientosTransitorios(CveAlmacenDestino, -1, CveAlmacenTransitorio, -1, FolioBusqueda, UsuarioActual.CveEmpresa) Then
+ If ObjInventario.GetMovimientosTransitorios(CveAlmacenDestino, -1, CveAlmacenTransitorio, -1, FolioBusqueda, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) Then
Dtt = ObjInventario.DtResultados.FiltraParametros(String.Format("CveTipoAlmacenDestino <> 4"), "", {"CveMovimientoDetalle", "Codigo", "Cantidad"})
If Dtt IsNot Nothing AndAlso Dtt.FiltraParametros("Cantidad < 0").Rows.Count > 0 Then
diff --git a/Ventas/ClientesAbonar.aspx b/Ventas/ClientesAbonar.aspx
index b3a9d6d14..6887e39d7 100644
--- a/Ventas/ClientesAbonar.aspx
+++ b/Ventas/ClientesAbonar.aspx
@@ -261,7 +261,7 @@
@@ -358,7 +358,15 @@
CveVenta
-
+
+
+
+
+
+
+ Complemento Pago
+
+
diff --git a/Ventas/ClientesAbonar.aspx.vb b/Ventas/ClientesAbonar.aspx.vb
index 98735344f..8b4334e83 100644
--- a/Ventas/ClientesAbonar.aspx.vb
+++ b/Ventas/ClientesAbonar.aspx.vb
@@ -636,6 +636,17 @@ Partial Class Ventas_ClientesAbonar
e.Row.FCCheckBox("Chk").Visible = False
End If
+
+ If e.Row.DBCampo("CveVenta").ToEntero > 0 Then
+ If e.Row.DataKey("ClaveMetodoPagoSAT") = "PUE" Then
+ e.Row.FCLinkButton("LnkComplemento").Text = ""
+ e.Row.FCLinkButton("LnkComplemento").CssClass = "text-danger"
+ End If
+ Else
+ e.Row.FCLinkButton("LnkComplemento").Visible = False
+ End If
+
+
End If
End Sub
@@ -2505,6 +2516,18 @@ Partial Class Ventas_ClientesAbonar
'For i = 0 To CveVentas.Count - 1
Dim ObjBancos As New ClsBancos
+
+
+ If ObjBancos.GetComplementoPagosRep(-1, Now.AddYears(-2), Now, CveIE, -1, If(CveIESustitucion > 0, 2, 1), UsuarioActual.CveEmpresa, -1) Then
+ If Not ObjBancos.DtResultados.Rows.Count > 0 Then
+ ObjBancos.Dispose()
+ Alert("No se generaron complementos de pago porque no hay facturas con método de pago PPD", TipoMensaje.MsgAdvertencia)
+ Return ""
+ End If
+ End If
+
+
+
ObjBancos.IniciaTransacSQL()
If ObjBancos.GeneraTimbrePago(CveIE, -1, UsuarioActual, CveCliente, CFDIRelacionado:=CFDIRelacionadoSustitucion, EsRegeneracion:=If(CveIESustitucion > 0, True, False)) Then
diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx
index 08553cbad..4dc1dfa02 100644
--- a/Ventas/Ventas.aspx
+++ b/Ventas/Ventas.aspx
@@ -2822,9 +2822,9 @@
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb
index 0e702a088..bb45e35a0 100644
--- a/Ventas/Ventas.aspx.vb
+++ b/Ventas/Ventas.aspx.vb
@@ -9115,7 +9115,7 @@ Partial Class Ventas
ObjFactura.NumeroPersonas = 0
- If ObjFactura.TipoDocto = "Ant" And DdlContratosModal.SelectedValue.ToEntero > 0 Or ObjFactura.TipoDocto = "Ing" And DdlContratosModal.SelectedValue.ToEntero > 0 Then
+ If ObjFactura.TipoDocto = "Ant" And DdlContratosModal.SelectedValue.ToEntero > 0 Or ObjFactura.TipoDocto = "Ing" And DdlContratosModal.SelectedValue.ToEntero > 0 Or ObjFactura.TipoDocto = "Egs" And DdlContratosModal.SelectedValue.ToEntero > 0 Then
CveContrato = DdlContratosModal.SelectedValue.ToEntero
End If
@@ -16384,6 +16384,10 @@ Partial Class Ventas
Dim TotalCalculableImpuestosIVA As Decimal = 0
PU = PU.RoundAD(6) ' el precio unitario puede llevar hasta 6 decimales permitidos
+ If Not TmpDT.Columns.Contains("RetIVA") Then
+ TmpDT.Columns.Add("RetIVA", GetType(Decimal))
+ End If
+
Row = TmpDT.NewRow()
Row("CveProyecto") = CveProyecto
Row("Proyecto") = Proyecto
@@ -16510,7 +16514,11 @@ Partial Class Ventas
Row("IVA") = Row("PorcentajeIVA")
Row("ImporteIVA") = (Row("PorcentajeIVA").ToString().ToDecimal * TotalCalculableImpuestosIVA).RoundAD(NumeroDecimales)
Row("ImporteRetIVA") = (ClienteRetIVA * TotalCalculableImpuestos).RoundAD(NumeroDecimales)
+
+
+
Row("RetIVA") = (ClienteRetIVA * TotalCalculableImpuestos).RoundAD(NumeroDecimales)
+
Row("ImporteRetISR") = (ClienteRetISR * TotalCalculableImpuestos).RoundAD(NumeroDecimales)
Row("PorcentajeRetIVA") = ClienteRetIVA
Row("PorcentajeRetISR") = ClienteRetISR
@@ -28740,11 +28748,11 @@ Partial Class Ventas
Alert("Se selecciono un contrato de obra, para continuar seleccione una estimación.", TipoMensaje.MsgAdvertencia)
End If
- ElseIf DdlTipoComprobante.SelectedValue = "Ant" Then
+ ElseIf DdlTipoComprobante.SelectedValue = "Ant" Or DdlTipoComprobante.SelectedValue = "Egs" Then
Respuesta = True
Else
Alert("Tipo de documento no valido para contratos de obra.", TipoMensaje.MsgAdvertencia)
- Respuesta = True
+ Respuesta = False
End If
Else
diff --git a/vwd.webinfo b/vwd.webinfo
index ce767c892..02418376d 100644
--- a/vwd.webinfo
+++ b/vwd.webinfo
@@ -140,6 +140,10 @@
+
+
+
+