This commit is contained in:
rrene
2020-12-09 19:53:44 -07:00
5 changed files with 233 additions and 134 deletions

View File

@@ -1309,8 +1309,14 @@ Public Class ClsInventarios
Retorno = True Retorno = True
End If End If
Catch Ex1 As SqlException Catch Ex1 As SqlException
If Ex1.Message.Contains("50019") Then If Ex1.Message.Contains("50019") Then
Me.OnError(" El producto no tiene existencia.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) Me.OnError(" El producto no tiene existencia.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
ElseIf Ex1.Message.Contains("CK_Inv_MovimientosDetalle_MetodoInventario") Then
Me.OnError("El movimiento debe de tener una Serie.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Else Else
If Ex1.Message.Contains("50021") Then If Ex1.Message.Contains("50021") Then
Me.OnError(" El producto ingresado previamente.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) Me.OnError(" El producto ingresado previamente.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
@@ -1437,7 +1443,7 @@ Public Class ClsInventarios
Return Retorno Return Retorno
End Function End Function
Public Function GetMovimientosTransitorios(CveAlmacenDestino As Integer, CveTipoAlmacenDestino As Integer, CveAlmacenTransitorio As Integer, CveUsuarioResponsable As Integer, Folio As Integer, CveEmpresa As Integer) As Boolean Public Function GetMovimientosTransitorios(CveAlmacenDestino As Integer, CveTipoAlmacenDestino As Integer, CveAlmacenTransitorio As Integer, CveUsuarioResponsable As Integer, Folio As Integer, CveEmpresa As Integer, CveUsuario As Integer) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Inv_MovimientosTransitoriosGet") DataAdapter("PA_Inv_MovimientosTransitoriosGet")
@@ -1448,6 +1454,7 @@ Public Class ClsInventarios
.Add("@Folio", SqlDbType.Int).Value = Folio .Add("@Folio", SqlDbType.Int).Value = Folio
.Add("@CveUsuarioResponsable", SqlDbType.Int).Value = CveUsuarioResponsable .Add("@CveUsuarioResponsable", SqlDbType.Int).Value = CveUsuarioResponsable
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
End With End With
Try Try
SqlAdapter.Fill(Data) SqlAdapter.Fill(Data)

View File

@@ -1,4 +1,4 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepEstadoResultadosHorizontal.aspx.vb" Inherits="Contabilidad_RepEstadoResultadosHorizontal" %> <%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepEstadoResultadosHorizontal.aspx.vb" Inherits="Contabilidad_RepEstadoResultadosHorizontal" EnableEventValidation="false" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server"> <asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content> </asp:Content>
@@ -1048,6 +1048,28 @@
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" /> <asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<%--<asp:TemplateField HeaderText="Período Actual"> <%--<asp:TemplateField HeaderText="Período Actual">
<ItemTemplate> <ItemTemplate>
<asp:HyperLink ID="HLActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink> <asp:HyperLink ID="HLActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
@@ -1120,6 +1142,30 @@
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" /> <asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<%-- <asp:TemplateField HeaderText="Período Actual"> <%-- <asp:TemplateField HeaderText="Período Actual">
<ItemTemplate> <ItemTemplate>
<asp:HyperLink ID="HLActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink> <asp:HyperLink ID="HLActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
@@ -1192,6 +1238,30 @@
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" /> <asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:TemplateField HeaderText="Acumulado"> <asp:TemplateField HeaderText="Acumulado">
<ItemTemplate> <ItemTemplate>
<asp:HyperLink ID="HLAnterior" runat="server" Text='<%# Eval("ImporteAcumulado", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink> <asp:HyperLink ID="HLAnterior" runat="server" Text='<%# Eval("ImporteAcumulado", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>

View File

@@ -1821,7 +1821,7 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
Row = DtGastosSubProyectoH.NewRow Row = DtGastosSubProyectoH.NewRow
If DtGastosSubProyectoH.Rows.Count > 0 Then If DtGastosSubProyectoH.Rows.Count > 1 Then
IndexData = 0 IndexData = 0

View File

@@ -2793,10 +2793,14 @@
<asp:UpdatePanel runat="server"> <asp:UpdatePanel runat="server">
<ContentTemplate> <ContentTemplate>
<asp:LinkButton ID="BtnDecargaFormato" runat="server" ClientIDMode="Static" Text="<i class='fa fa-download' aria-hidden='true'></i> Formato" CssClass="btn btn-warning" OnClick="BtnDecargaFormato_Click" />
<asp:Button ID="BtnCargaPresupuesto" runat="server" ClientIDMode="Static" Text="Guardar" CssClass="btn btn-primary" OnClick="BtnCargaPresupuesto_Click" /> <asp:Button ID="BtnCargaPresupuesto" runat="server" ClientIDMode="Static" Text="Guardar" CssClass="btn btn-primary" OnClick="BtnCargaPresupuesto_Click" />
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button> <button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</ContentTemplate> </ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="BtnDecargaFormato" />
</Triggers>
</asp:UpdatePanel> </asp:UpdatePanel>
</div> </div>
</div> </div>

View File

@@ -4129,13 +4129,31 @@ Partial Class Contratos_ContratoObra
DTCargaPresupuesto = CargaPreSupuestoExcel() DTCargaPresupuesto = CargaPreSupuestoExcel()
If DTCargaPresupuesto.Rows.Count > 0 Then If DTCargaPresupuesto.Rows.Count > 0 Then
' ProcesaDatosCargaPresupuesto(DTCargaPresupuesto) ProcesaDatosCargaPresupuesto(DTCargaPresupuesto)
Else Else
Alert("No se encintraron partidas en el documento", TipoMensaje.MsgAdvertencia) Alert("No se encintraron partidas en el documento", TipoMensaje.MsgAdvertencia)
End If End If
End Sub 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 FI.Exists Then
Response.ContentType = "application/octet-stream"
Response.AppendHeader("Content-Disposition", $"attachment; filename=FormatoPresupuestoObra.xlsx")
Response.TransmitFile(FI.FullName)
Response.End()
End If
End Sub
Private Function CargaPreSupuestoExcel() As DataTable Private Function CargaPreSupuestoExcel() As DataTable
@@ -4183,179 +4201,179 @@ Partial Class Contratos_ContratoObra
End Function End Function
'Private Sub ProcesaDatosCargaPresupuesto(DTPresupuesto As DataTable) Private Sub ProcesaDatosCargaPresupuesto(DTPresupuesto As DataTable)
' Dim DTPS = New DataTable Dim DTPS = New DataTable
' DTPS.Columns.Add("CveContratoDetalle", GetType(Integer)) DTPS.Columns.Add("CveContratoDetalle", GetType(Integer))
' DTPS.Columns.Add("Cantidad", GetType(Double)) DTPS.Columns.Add("Cantidad", GetType(Double))
' DTPS.Columns.Add("CantidadContratada", GetType(Double)) DTPS.Columns.Add("CantidadContratada", GetType(Double))
' DTPS.Columns.Add("CveUM", GetType(Integer)) DTPS.Columns.Add("CveUM", GetType(Integer))
' DTPS.Columns.Add("UM", GetType(String)) DTPS.Columns.Add("UM", GetType(String))
' DTPS.Columns.Add("CveClasificacion", GetType(Integer)) DTPS.Columns.Add("CveClasificacion", GetType(Integer))
' DTPS.Columns.Add("Clasificacion", GetType(String)) DTPS.Columns.Add("Clasificacion", GetType(String))
' DTPS.Columns.Add("CvePS", GetType(Integer)) DTPS.Columns.Add("CvePS", GetType(Integer))
' DTPS.Columns.Add("PS", GetType(String)) DTPS.Columns.Add("PS", GetType(String))
' DTPS.Columns.Add("CodigoPS", GetType(String)) DTPS.Columns.Add("CodigoPS", GetType(String))
' DTPS.Columns.Add("PU", GetType(Double)) DTPS.Columns.Add("PU", GetType(Double))
' DTPS.Columns.Add("Total", GetType(Double)) DTPS.Columns.Add("Total", GetType(Double))
' DTPS.Columns.Add("CveTipoPresupuesto", GetType(Integer)) DTPS.Columns.Add("CveTipoPresupuesto", GetType(Integer))
' DTPS.Columns.Add("PermitirAvance", GetType(Integer)) DTPS.Columns.Add("PermitirAvance", GetType(Integer))
' DTPS.Columns.Add("PermitirEstimacion", GetType(Integer)) DTPS.Columns.Add("PermitirEstimacion", GetType(Integer))
' DTPS.Columns.Add("UsuarioAvance", GetType(Integer)) DTPS.Columns.Add("UsuarioAvance", GetType(Integer))
' DTPS.Columns.Add("Cantidad_Original", GetType(Double)) DTPS.Columns.Add("Cantidad_Original", GetType(Double))
' DTPS.Columns.Add("PU_Original", GetType(Double)) DTPS.Columns.Add("PU_Original", GetType(Double))
' DTPS.Columns.Add("Total_Original", GetType(Double)) DTPS.Columns.Add("Total_Original", GetType(Double))
' DTPS.Columns.Add("NoIdentificacion", GetType(String)) DTPS.Columns.Add("NoIdentificacion", GetType(String))
' DTPS.Columns.Add("LimitarCantidad", GetType(Integer)) DTPS.Columns.Add("LimitarCantidad", GetType(Integer))
' DTPS.Columns.Add("OCInterna", GetType(String)) DTPS.Columns.Add("OCInterna", GetType(String))
' DTPS.Columns.Add("Observacion", GetType(String)) DTPS.Columns.Add("Observacion", GetType(String))
' Dim RowNoEncontrados As String = "" Dim RowNoEncontrados As String = ""
' For Each DrowPS As DataRow In DTPresupuesto.Rows For Each DrowPS As DataRow In DTPresupuesto.Rows
' Dim StrArray() As String = GetPS("PS", DrowPS("PS").ToString).Split("|"c) Dim StrArray() As String = GetPS("PS", DrowPS("PS").ToString).Split("|"c)
' Dim CvePS As Integer Dim CvePS As Integer
' Dim CveUM As Integer Dim CveUM As Integer
' If StrArray.Length > 0 Then If StrArray.Length > 0 Then
' If CBool(StrArray(0)) = True Then If CBool(StrArray(0)) = True Then
' CvePS = StrArray(1).ToEntero CvePS = StrArray(1).ToEntero
' Else Else
' RowNoEncontrados &= StrArray(1) & "<\BR>" RowNoEncontrados &= StrArray(1) & "<\BR>"
' End If End If
' End If End If
' If CvePS > 0 And DrowPS("Cantidad").ToString.ToDouble > 0 Then If CvePS > 0 And DrowPS("Cantidad").ToString.ToDouble > 0 Then
' CveUM = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("CveUnidadMedida", "").ToString.ToEntero CveUM = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("CveUnidadMedida", "").ToString.ToEntero
' Dim Row As DataRow = DTPS.NewRow() Dim Row As DataRow = DTPS.NewRow()
' Row("Cantidad") = DrowPS("Cantidad").ToString.ToDouble Row("Cantidad") = DrowPS("Cantidad").ToString.ToDouble
' Row("CantidadContratada") = DrowPS("Cantidad").ToString.ToDouble Row("CantidadContratada") = DrowPS("Cantidad").ToString.ToDouble
' Row("CveUM") = CveUM Row("CveUM") = CveUM
' Row("UM") = "" Row("UM") = ""
' Row("CveClasificacion") = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("CveClasificacion", "").ToString.ToEntero Row("CveClasificacion") = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("CveClasificacion", "").ToString.ToEntero
' Row("Clasificacion") = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = '{ Row("CveClasificacion").ToString }'").ToString Row("Clasificacion") = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = '{ Row("CveClasificacion").ToString }'").ToString
' Row("CvePS") = CvePS Row("CvePS") = CvePS
' Row("PS") = DrowPS("PS").ToString Row("PS") = DrowPS("PS").ToString
' Row("CodigoPS") = DrowPS("PS").ToString Row("CodigoPS") = DrowPS("PS").ToString
' Row("PU") = DrowPS("PU").ToString.ToDouble Row("PU") = DrowPS("PU").ToString.ToDouble
' Row("Total") = DrowPS("Cantidad").ToString.ToDouble * DrowPS("PU").ToString.ToDouble Row("Total") = DrowPS("Cantidad").ToString.ToDouble * DrowPS("PU").ToString.ToDouble
' Select Case TipoCargaPresupuesto Select Case TipoCargaPresupuesto
' Case EnumTipoCargaPresupuesto.Ventas Case EnumTipoCargaPresupuesto.Ventas
' Row("CveTipoPresupuesto") = 2 Row("CveTipoPresupuesto") = 2
' Exit Select Exit Select
' Case EnumTipoCargaPresupuesto.Control Case EnumTipoCargaPresupuesto.Control
' Row("CveTipoPresupuesto") = 1 Row("CveTipoPresupuesto") = 1
' Exit Select Exit Select
' Case Else Case Else
' Row("CveTipoPresupuesto") = 1 Row("CveTipoPresupuesto") = 1
' End Select End Select
' Row("NoIdentificacion") = "" Row("NoIdentificacion") = ""
' Row("OCInterna") = "" Row("OCInterna") = ""
' Row("LimitarCantidad") = 0 Row("LimitarCantidad") = 0
' Row("Observacion") = "" Row("Observacion") = ""
' DTPS.Rows.Add(Row) DTPS.Rows.Add(Row)
' End If End If
' Next Next
' Dim ErrorProceso = False Dim ErrorProceso = False
' Dim ObjContratos As New ClsContratos Dim ObjContratos As New ClsContratos
' Dim TotalRow As Double = 0 Dim TotalRow As Double = 0
' ObjContratos.IniciaTransacSQL() ObjContratos.IniciaTransacSQL()
' For Each Row As DataRow In DTPS.Rows 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 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 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")) 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) guardarBitacora(msj)
' End If End If
' Dim NrowTmpDT As DataRow = TmpDT.NewRow Dim NrowTmpDT As DataRow = TmpDT.NewRow
' NrowTmpDT("Cantidad") = Row("Cantidad") NrowTmpDT("Cantidad") = Row("Cantidad")
' NrowTmpDT("CantidadContratada") = Row("CantidadContratada") NrowTmpDT("CantidadContratada") = Row("CantidadContratada")
' NrowTmpDT("CveUM") = Row("CveUM") NrowTmpDT("CveUM") = Row("CveUM")
' NrowTmpDT("UM") = Row("UM") NrowTmpDT("UM") = Row("UM")
' NrowTmpDT("CveClasificacion") = Row("CveClasificacion") NrowTmpDT("CveClasificacion") = Row("CveClasificacion")
' NrowTmpDT("Clasificacion") = Row("Clasificacion") NrowTmpDT("Clasificacion") = Row("Clasificacion")
' NrowTmpDT("CvePS") = Row("CvePS") NrowTmpDT("CvePS") = Row("CvePS")
' NrowTmpDT("PS") = Row("PS") NrowTmpDT("PS") = Row("PS")
' NrowTmpDT("CodigoPS") = Row("CodigoPS") NrowTmpDT("CodigoPS") = Row("CodigoPS")
' NrowTmpDT("PU") = Row("PU") NrowTmpDT("PU") = Row("PU")
' NrowTmpDT("Total") = Row("Total") NrowTmpDT("Total") = Row("Total")
' NrowTmpDT("CveTipoPresupuesto") = Row("CveTipoPresupuesto") NrowTmpDT("CveTipoPresupuesto") = Row("CveTipoPresupuesto")
' NrowTmpDT("NoIdentificacion") = Row("NoIdentificacion") NrowTmpDT("NoIdentificacion") = Row("NoIdentificacion")
' NrowTmpDT("OCInterna") = Row("OCInterna") NrowTmpDT("OCInterna") = Row("OCInterna")
' NrowTmpDT("LimitarCantidad") = Row("LimitarCantidad") NrowTmpDT("LimitarCantidad") = Row("LimitarCantidad")
' NrowTmpDT("Observacion") = Row("Observacion") NrowTmpDT("Observacion") = Row("Observacion")
' NrowTmpDT("CveContratoDetalle") = ObjContratos.DtResultados.Rows(0)("CveContratoDetalle") NrowTmpDT("CveContratoDetalle") = ObjContratos.DtResultados.Rows(0)("CveContratoDetalle")
' TmpDT.Rows.Add(NrowTmpDT) TmpDT.Rows.Add(NrowTmpDT)
' TmpDT.AcceptChanges() TmpDT.AcceptChanges()
' TotalRow = TotalRow + NrowTmpDT("Total").ToString.ToDouble TotalRow = TotalRow + NrowTmpDT("Total").ToString.ToDouble
' Else Else
' ErrorProceso = True ErrorProceso = True
' Exit For Exit For
' End If End If
' Next Next
' If ErrorProceso Then If ErrorProceso Then
' ObjContratos.RollBack() ObjContratos.RollBack()
' Alert("Se presento un error al cargar el presupuesto.", TipoMensaje.MsgError) Alert("Se presento un error al cargar el presupuesto.", TipoMensaje.MsgError)
' Else Else
' ObjContratos.Commit() ObjContratos.Commit()
' Alert("Presupuesto Cargado correctamente") Alert("Presupuesto Cargado correctamente")
' Select Case TipoCargaPresupuesto Select Case TipoCargaPresupuesto
' Case EnumTipoCargaPresupuesto.Ventas Case EnumTipoCargaPresupuesto.Ventas
' CargaGVPresupuestos(TmpDT.FiltraParametros("CveTipoPresupuesto=2")) CargaGVPresupuestos(TmpDT.FiltraParametros("CveTipoPresupuesto=2"))
' UpGV.Update() UpGV.Update()
' Exit Select Exit Select
' Case EnumTipoCargaPresupuesto.Control Case EnumTipoCargaPresupuesto.Control
' CargaGVPresupuestosInsumos(TmpDT.FiltraParametros("CveTipoPresupuesto=1")) CargaGVPresupuestosInsumos(TmpDT.FiltraParametros("CveTipoPresupuesto=1"))
' UpGVInsumos.Update() UpGVInsumos.Update()
' Exit Select Exit Select
' Case Else Case Else
' End Select End Select
' LbTotalGeneral.Text = (LbTotalGeneral.Text.ToDouble + TotalRow).ToString.FormatoNumero LbTotalGeneral.Text = (LbTotalGeneral.Text.ToDouble + TotalRow).ToString.FormatoNumero
' LblImporte.Text = LbTotalGeneral.Text LblImporte.Text = LbTotalGeneral.Text
' UpGral.Update() UpGral.Update()
' End If End If
' ObjContratos.Dispose() ObjContratos.Dispose()
' If RowNoEncontrados.Length > 0 Then If RowNoEncontrados.Length > 0 Then
' Alert($"Productos no encontrados <br> {RowNoEncontrados} ") Alert($"Productos no encontrados <br> {RowNoEncontrados} ")
' End If End If
'End Sub End Sub