This commit is contained in:
Antonio Gonzalez
2020-12-01 13:11:49 -07:00
27 changed files with 2561 additions and 1283 deletions

View File

@@ -183,6 +183,11 @@ Public Class ClsContratos
Public Property Folio As Integer Public Property Folio As Integer
Public Property FechaVenc As Date Public Property FechaVenc As Date
Public Property AplicaImpuestosLocales As Boolean Public Property AplicaImpuestosLocales As Boolean
Public Property CveEstimacionActual As Integer
Public Property NumeroEstimacionActual As Integer
#End Region #End Region
@@ -1276,15 +1281,15 @@ Public Class ClsContratos
Return Retorno Return Retorno
End Function End Function
Public Function GetContratosAvanceAnexos(CveContratoDetalle As Integer, fecha As String, CveUsuario As Integer, Optional CveEstimacion As Integer = -1) As Boolean Public Function GetContratosAvanceAnexos(CveContratoDetalle As Integer, CveUsuario As Integer, Optional CveEstimacion As Integer = -1, Optional CveContratoAvance As Integer = -1) As Boolean
Dim Retorno = False Dim Retorno = False
DataAdapter("PA_Con_ContratosAvanceAnexos") DataAdapter("PA_Con_ContratosAvanceAnexos")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@CveContratoDetalle", SqlDbType.Int).Value = CveContratoDetalle .Add("@CveContratoDetalle", SqlDbType.Int).Value = CveContratoDetalle
.Add("@Fecha", SqlDbType.Date).Value = fecha
.Add("@CveUsuario", SqlDbType.Float).Value = CveUsuario .Add("@CveUsuario", SqlDbType.Float).Value = CveUsuario
.Add("@CveEstimacion", SqlDbType.Float).Value = CveEstimacion .Add("@CveEstimacion", SqlDbType.Float).Value = CveEstimacion
.Add("@CveContratoAvance", SqlDbType.Float).Value = CveContratoAvance
End With End With
Try Try
@@ -1300,13 +1305,49 @@ Public Class ClsContratos
#Region "ESTIMACION" #Region "ESTIMACION"
Public Function GetContratosAvanceEstimacion(CveContrato As Integer, CveEmpresa As Integer) As Boolean
Public Function AddContratosObraAvance(CveContrato As Integer, CveContratoDetalle As Integer, Cantidad As Double, Fecha As Date, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno = False
CveEstimacionActual = 0
DataAdapter("PA_Con_ContratosObraAvanceAdd")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveContrato", SqlDbType.Int).Value = CveContrato
.Add("@CveContratoDetalle", SqlDbType.Int).Value = CveContratoDetalle
.Add("@Cantidad", SqlDbType.Int).Value = Cantidad
.Add("@Fecha", SqlDbType.Date).Value = Fecha
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveEstimacionActual", SqlDbType.Int).Direction = ParameterDirection.Output
.Add("@NumeroEstimacionActual", SqlDbType.Int).Direction = ParameterDirection.Output
End With
Try
SqlAdapter.Fill(Data)
CveEstimacionActual = SqlAdapter.SelectCommand.Parameters("@CveEstimacionActual").Value.ToString.ToEntero
NumeroEstimacionActual = SqlAdapter.SelectCommand.Parameters("@NumeroEstimacionActual").Value.ToString.ToEntero
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al agregar el avance.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function GetContratosAvanceEstimacion(CveContrato As Integer, CveEmpresa As Integer, CveEstimacion As Integer) As Boolean
Dim Retorno = False Dim Retorno = False
DataAdapter("PA_Con_ContratosAvanceEstimacionGet") DataAdapter("PA_Con_ContratosAvanceEstimacionGet")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@CveContrato", SqlDbType.Int).Value = CveContrato .Add("@CveContrato", SqlDbType.Int).Value = CveContrato
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveEstimacion", SqlDbType.Int).Value = CveEstimacion
End With End With
Try Try
@@ -1374,6 +1415,54 @@ Public Class ClsContratos
Public Function UpdateContratosEstimacion(CveEstimacion As Integer, CveUsuario As Integer, CveEmpresa As Integer, CveEstimacionEstatus As Integer) As Boolean
Dim Retorno = False
DataAdapter("PA_Con_ContratosEstimacionUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveEstimacion", SqlDbType.Int).Value = CveEstimacion
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveEstimacionEstatus", SqlDbType.Int).Value = CveEstimacionEstatus
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al actualizar la estimacion.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function RemoveContratosAvance(CveContratoAvance As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno = False
DataAdapter("PA_Con_ContratosAvanceRemove")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveContratoAvance", SqlDbType.Int).Value = CveContratoAvance
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al eliminar el avance.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
#End Region #End Region
#Region "CONTRATOS OBRA COMPRAS" #Region "CONTRATOS OBRA COMPRAS"

View File

@@ -456,6 +456,26 @@ Public Class ClsMovimientos
Return Retorno Return Retorno
End Function End Function
Public Function GetRemisionesNCCliente(CveCliente As Integer, MostarDetalle As Boolean, Optional CveMoneda As Integer = -1, Optional CveClienteSucursal As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_ClienteRemisionesNC")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
.Add("@MostarDetalle", SqlDbType.Bit).Value = MostarDetalle
.Add("@CveClienteSucursal", SqlDbType.Int).Value = CveClienteSucursal
.Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As SqlException
OnError("Ocurrió un error al consultar los Anticipos del Cliente.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function GetAnticiposClienteAuxiliar(CveCliente As Integer, CveVenta As Integer) As Boolean Public Function GetAnticiposClienteAuxiliar(CveCliente As Integer, CveVenta As Integer) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False

View File

@@ -5020,6 +5020,9 @@ Public Class ClsPaginas
PaginaDict.Add("/Contratos/RepContratosObraAvances.aspx".ToUpper(), -1) PaginaDict.Add("/Contratos/RepContratosObraAvances.aspx".ToUpper(), -1)
PaginaDict.Add("/Contratos/RepContratosObraAvancesDetalle.aspx".ToUpper(), -1) PaginaDict.Add("/Contratos/RepContratosObraAvancesDetalle.aspx".ToUpper(), -1)
PaginaDict.Add("/Contratos/RepContratosObraAvancesPartida.aspx".ToUpper(), -1) PaginaDict.Add("/Contratos/RepContratosObraAvancesPartida.aspx".ToUpper(), -1)
PaginaDict.Add("/Contratos/ContratoObraAutorizacion.aspx".ToUpper(), -1)
'Orden Produccion' 'Orden Produccion'

View File

@@ -764,6 +764,25 @@ Public Class ClsVentas
Return Retorno Return Retorno
End Function End Function
Public Function UpdateVentaRNCUsado(CveVentaRNC As Integer, CveVenta As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentasRNCUsadosUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveVentaRNC", SqlDbType.Int).Value = CveVentaRNC
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al actualizar la relacion con el usado.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function UpdateCancelaVenta(CveVenta As Integer, FechaCancelacion As DateTime, SelloCancelacionSAT As String, CveEmpresa As Integer, Optional CvePAC As Integer = -1, Optional CveEstatusRefacturacion As Integer = 0) As Boolean Public Function UpdateCancelaVenta(CveVenta As Integer, FechaCancelacion As DateTime, SelloCancelacionSAT As String, CveEmpresa As Integer, Optional CvePAC As Integer = -1, Optional CveEstatusRefacturacion As Integer = 0) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
@@ -4788,6 +4807,26 @@ Public Class ClsVentas
Return Retorno Return Retorno
End Function End Function
Public Function AddVentaDetalleRNCFacturada(CveVentaDetalleRNC As Integer, CveVentaDetalle As Integer, CantidadFacturada As Decimal) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentaDetalleRNCFacturadaAdd")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveVentaDetalleRNC", SqlDbType.Int).Value = CveVentaDetalleRNC
.Add("@CveVentaDetalle", SqlDbType.Int).Value = CveVentaDetalle
.Add("@CantidadFacturada", SqlDbType.Float).Value = CantidadFacturada
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As SqlException
OnError("Ocurrió un error al agregar lo facturado de la RNC.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
#End Region #End Region

View File

@@ -74,17 +74,17 @@
<div id="DivDatos" style="overflow-y: auto; width: 750px; max-height: 360px;"> <div id="DivDatos" style="overflow-y: auto; width: 750px; max-height: 360px;">
<asp:GridView ID="GvDatos" ClientIDMode="Static" runat="server" CssClass="table table-striped table-advance table-hover Widthall" AutoGenerateColumns="False" GridLines="None"> <asp:GridView ID="GvDatos" ClientIDMode="Static" runat="server" CssClass="table table-striped table-advance table-hover Widthall" AutoGenerateColumns="False" GridLines="None">
<Columns> <Columns>
<asp:BoundField DataField="NumCuenta" ItemStyle-Width="100px" ItemStyle-HorizontalAlign="Center" HeaderText="Cuenta" /> <asp:BoundField DataField="NumCuenta" ItemStyle-Width="80px" HeaderText="Cuenta" />
<asp:BoundField DataField="FechaDocumento" DataFormatString="{0:d}" ItemStyle-Width="60px" ItemStyle-HorizontalAlign="Center" HeaderText="Fecha" /> <asp:BoundField DataField="FechaDocumento" DataFormatString="{0:d}" ItemStyle-Width="60px" HeaderText="Fecha" />
<asp:TemplateField HeaderText="Folio" ItemStyle-Width="80" ItemStyle-HorizontalAlign="Center"> <asp:TemplateField HeaderText="Folio" ItemStyle-Width="80" ItemStyle-HorizontalAlign="Center">
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="LtlFolio" runat="server"></asp:Literal> <asp:Literal ID="LtlFolio" runat="server"></asp:Literal>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:BoundField DataField="Importe" DataFormatString="{0:N2}" ItemStyle-Width="100px" ItemStyle-HorizontalAlign="Right" HeaderText="Importe" /> <asp:BoundField DataField="Importe" DataFormatString="{0:N2}" ItemStyle-Width="100px" ItemStyle-HorizontalAlign="Right" HeaderText="Importe" />
<asp:BoundField DataField="Moneda" ItemStyle-Width="40px" ItemStyle-HorizontalAlign="Center" HeaderText="Moneda" /> <asp:BoundField DataField="MonedaAbreviatura" ItemStyle-Width="40px" ItemStyle-HorizontalAlign="Center" HeaderText="Moneda" />
<asp:BoundField DataField="PagueseA" ItemStyle-Width="100px" ItemStyle-HorizontalAlign="Center" HeaderText="Beneficiario" /> <asp:BoundField DataField="PagueseA" HeaderText="Beneficiario" />
<asp:BoundField DataField="EstatusIE" ItemStyle-Width="100px" ItemStyle-HorizontalAlign="Center" HeaderText="Estatus" /> <asp:BoundField DataField="EstatusIE" ItemStyle-Width="50px" HeaderText="Estatus" />
</Columns> </Columns>
</asp:GridView> </asp:GridView>
</div> </div>

View File

@@ -632,6 +632,7 @@
<div class="btn btn-default btn-circle btn-xs " data-toggle="tooltip" data-placement="top" title="Cambiar sucursal"><i class="fa fa-arrow-circle-down" style="color: green" aria-hidden="true"></i></div> <div class="btn btn-default btn-circle btn-xs " data-toggle="tooltip" data-placement="top" title="Cambiar sucursal"><i class="fa fa-arrow-circle-down" style="color: green" aria-hidden="true"></i></div>
<asp:LinkButton ID="ImgSubProyecto" CssClass="btn btn-default btn-circle btn-xs " data-toggle="tooltip" data-placement="top" ToolTip="Aplicar SubProyecto a productos" runat="server" Style="display: none;"><i class="fa fa-arrow-circle-down" style="color:green" aria-hidden="true"></i></asp:LinkButton> <asp:LinkButton ID="ImgSubProyecto" CssClass="btn btn-default btn-circle btn-xs " data-toggle="tooltip" data-placement="top" ToolTip="Aplicar SubProyecto a productos" runat="server" Style="display: none;"><i class="fa fa-arrow-circle-down" style="color:green" aria-hidden="true"></i></asp:LinkButton>
</span> </span>
</th> </th>
<th style="width: 80px">Tipo de Gasto <th style="width: 80px">Tipo de Gasto
@@ -675,6 +676,7 @@
</asp:DropDownList> </asp:DropDownList>
</div> </div>
</div> </div>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
</th> </th>
@@ -4284,8 +4286,19 @@
<%--<asp:RequiredFieldValidator runat="server" Enabled="true" Display="None" ID="RFVSubProyecto" ControlToValidate="DdlSubProyecto" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''SubProyecto''</b> es necesario, por favor seleccione uno." ValidationGroup="GprAgregaPS"></asp:RequiredFieldValidator> <%--<asp:RequiredFieldValidator runat="server" Enabled="true" Display="None" ID="RFVSubProyecto" ControlToValidate="DdlSubProyecto" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''SubProyecto''</b> es necesario, por favor seleccione uno." ValidationGroup="GprAgregaPS"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCORVSubProyecto" runat="server" HighlightCssClass="vco" TargetControlID="RFVSubProyecto" Width="300px"></ajax:ValidatorCalloutExtender>--%> <ajax:ValidatorCalloutExtender ID="VCORVSubProyecto" runat="server" HighlightCssClass="vco" TargetControlID="RFVSubProyecto" Width="300px"></ajax:ValidatorCalloutExtender>--%>
<label runat="server" id="LblSubProyecto" for="<%= DdlSubProyecto.ClientID.ToString()%>">SubProyecto:</label> <label runat="server" id="LblSubProyecto" for="<%= DdlSubProyecto.ClientID.ToString()%>">SubProyecto:</label>
</div>
</div> </div>
<div class="col-md-3">
<div runat="server" id="DVCultivosCuadro" visible ="false" class="form-group form-md-line-input input-iconright" >
<asp:DropDownList ID="DdlCultivosCuadro" CssClass=" form-control input-sm select2me" runat="server" DataTextField="Cuadro" Style="width: 100%; max-width: 600px;"
DataValueField="CveCultivoCuadroDetalle" ValidationGroup="GrpDetalleGuardar">
</asp:DropDownList>
<label runat="server" id="Label9" for="<%= DdlCultivosCuadro.ClientID.ToString()%>">Cultivo:</label>
</div> </div>
</div>
</div> </div>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>

View File

@@ -1319,6 +1319,15 @@ Partial Class Compras_Compras
DdlPersonal.DataBind() DdlPersonal.DataBind()
DdlPersonalReembolso.DataBind() DdlPersonalReembolso.DataBind()
If UsuarioActual.Empresa.Funcionalidad(590).ToString.ToEntero = 1 Then
DVCultivosCuadro.Visible = True
DdlSubProyecto.AutoPostBack = True
DdlCultivosCuadro.DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros($"CveSubProyecto = {DdlSubProyecto.SelectedValue}")
DdlCultivosCuadro.DataBind()
DdlCultivosCuadro.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
End If
'Carga Proveedor 'Carga Proveedor
If Request("CveProveedor") IsNot Nothing AndAlso IsNumeric(Request("CveProveedor")) AndAlso Request("CveProveedor").ToEntero > 0 Then If Request("CveProveedor") IsNot Nothing AndAlso IsNumeric(Request("CveProveedor")) AndAlso Request("CveProveedor").ToEntero > 0 Then
@@ -17655,6 +17664,15 @@ Partial Class Compras_Compras
If Modalidad <> "U" Or Not CveFactura > 0 Then If Modalidad <> "U" Or Not CveFactura > 0 Then
DdlPSChange() DdlPSChange()
End If End If
If UsuarioActual.Empresa.Funcionalidad(590).ToString.ToEntero = 1 Then
DdlCultivosCuadro.Items.Clear()
DdlCultivosCuadro.DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros($" CveSubProyecto = {DdlSubProyecto.SelectedValue}")
DdlCultivosCuadro.DataBind()
DdlCultivosCuadro.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
End If
End Sub End Sub
Private Sub DdlPSChange() Private Sub DdlPSChange()
If CveProveedor > 0 Then If CveProveedor > 0 Then

View File

@@ -63,11 +63,11 @@
<label class="col-md-1 truncate">Contrato:</label> <label class="col-md-1 truncate">Contrato:</label>
<div class="col-md-6 col-lg-4"> <div class="col-md-6 col-lg-4">
<div class="ddls"> <div class="ddls">
<asp:DropDownList ID="DdlContratos" runat="server" AutoPostBack="true" DataTextField="ContratoCompleto" DataValueField="CveContrato" Class=" form-control input-inline select2me" Width="100%"> <asp:DropDownList ID="DdlContratos" runat="server" DataTextField="ContratoCompleto" DataValueField="CveContrato" Class=" form-control input-inline select2me" Width="100%">
</asp:DropDownList> </asp:DropDownList>
</div> </div>
</div> </div>
<div class="col-md-2 col-lg-2"> <div class="col-md-2 col-lg-2 " style="display:none!important">
<asp:DropDownList ID="DdlAvances" runat="server" DataTextField="Name" DataValueField="Fecha" Class=" form-control input-inline select2me" Width="100%"> <asp:DropDownList ID="DdlAvances" runat="server" DataTextField="Name" DataValueField="Fecha" Class=" form-control input-inline select2me" Width="100%">
</asp:DropDownList> </asp:DropDownList>
</div> </div>
@@ -117,6 +117,7 @@
<th style="width: 100px;"></th> <th style="width: 100px;"></th>
<th style="width: 100px;"></th> <th style="width: 100px;"></th>
<th style="width: 100px;"></th> <th style="width: 100px;"></th>
<th style="width: 100px;"></th>
</tr> </tr>
<tr> <tr>
<th>Producto / Servicio</th> <th>Producto / Servicio</th>
@@ -124,106 +125,114 @@
<th colspan="2">Ultimo Avance</th> <th colspan="2">Ultimo Avance</th>
<th colspan="2">Levantamiento</th> <th colspan="2">Levantamiento</th>
<th style="text-align: right;">Anexo</th> <th style="text-align: right;">Anexo</th>
<th style="text-align: right;"> </th>
</tr> </tr>
</table> </table>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<asp:GridView ID="Gv" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron partidas para levantar avance" <asp:GridView ID="Gv" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron partidas para levantar avance"
DataKeyNames="CveFamilias,CveSubFamilias,CveContratoDetalle,PS,Cantidad,Importe,Cantidad_Ultima,Importe_Ultima,PU,CantidadMax,Avance" DataKeyNames="CveFamilias,CveSubFamilias,CveContratoDetalle,PS,Cantidad,Importe,Cantidad_Ultima,Importe_Ultima,PU,CantidadMax,Avance"
CssClass="table GVEstimacion table-advance table-hover" GridLines="None"> CssClass="table GVEstimacion table-advance table-hover" GridLines="None">
<Columns> <Columns>
<asp:TemplateField HeaderText=""> <asp:TemplateField HeaderText="">
<ItemTemplate> <ItemTemplate>
<asp:LinkButton ID="Producto" runat="server" CssClass="Texto" Text='<%# Eval("PS")%>' Visible="false" ></asp:LinkButton> <asp:LinkButton ID="Producto" runat="server" CssClass="Texto" Text='<%# Eval("PS")%>' Visible="false"></asp:LinkButton>
<asp:Label ID="LinkButton1" runat="server" CssClass="Texto" Text='<%# Eval("PS")%>' ></asp:Label> <asp:Label ID="LinkButton1" runat="server" CssClass="Texto" Text='<%# Eval("PS")%>'></asp:Label>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Cantidad">
<ItemTemplate>
<span><%# Eval("Cantidad", "{0:N2}")%></span>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Importe">
<ItemTemplate>
<span><%# Eval("Importe", "{0:N2}")%></span>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cantidad">
<ItemTemplate>
<span><%# Eval("Cantidad_Ultima", "{0:N2}")%></span>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Importe">
<ItemTemplate>
<span><%# Eval("Importe_Ultima", "{0:N2}")%></span>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cantidad">
<ItemTemplate>
<asp:TextBox ID="TxtCantidad" Text="" CssClass="txtcant" onkeyup="ValidateCant(this)" type="number" step="any" data-cantidad='<%# Eval("CantidadMax")%>' data-pu='<%# Eval("PU")%>' data-cve='<%# Eval("CveContratoDetalle") %>' Width="90" runat="server"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Importe">
<ItemTemplate>
<asp:TextBox ID="TxtImporte" Text="" data-cve='<%# Eval("CveContratoDetalle") %>' CssClass="txtimporte" type="number" step="any" Width="90" runat="server"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText=" ">
<ItemTemplate>
<asp:LinkButton ID="LnkAnexo" runat="server" OnClick="GetAnexos" AlternateText="Agregar Anexo" CssClass="btn btn-circle btn-sm btn-success anexo" Text="<i class='fa fa-folder'></i>" /> <asp:TemplateField HeaderText="UM">
<asp:LinkButton runat="server" CssClass="btn btn-circle btn-sm btn-success" ID="LnkModalDropzone" Visible="false"> <i class='fa fa-plus'></i></asp:LinkButton> <ItemTemplate>
<%-- <a class="btn btn-circle btn-sm btn-success hidden linkfile"> <span><%# Eval("Abreviatura")%></span>
<i class='fa fa-plus'></i><asp:TextBox ID="TXTAnexo" CssClass="hidden" runat="server"></asp:TextBox> </ItemTemplate>
</a>--%> </asp:TemplateField>
<asp:TemplateField HeaderText="Cantidad">
<ItemTemplate>
<span><%# Eval("Cantidad", "{0:N2}")%></span>
</ItemTemplate>
</asp:TemplateField>
<div runat="server" id="ModalAnexoEvidencia" class="modal ADS fade" role="dialog"> <asp:TemplateField HeaderText="Importe">
<div class="modal-dialog"> <ItemTemplate>
<span><%# Eval("Importe", "{0:N2}")%></span>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cantidad">
<ItemTemplate>
<span><%# Eval("Cantidad_Ultima", "{0:N2}")%></span>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Importe">
<ItemTemplate>
<span><%# Eval("Importe_Ultima", "{0:N2}")%></span>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cantidad">
<ItemTemplate>
<asp:TextBox ID="TxtCantidad" Text="" CssClass="txtcant" onkeyup="ValidateCant(this)" type="number" step="any" data-cantidad='<%# Eval("CantidadMax")%>' data-pu='<%# Eval("PU")%>' data-cve='<%# Eval("CveContratoDetalle") %>' Width="90" runat="server"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Importe">
<ItemTemplate>
<asp:TextBox ID="TxtImporte" Text="" data-cve='<%# Eval("CveContratoDetalle") %>' CssClass="txtimporte" type="number" step="any" Width="90" runat="server"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText=" ">
<ItemTemplate>
<!-- Modal content--> <asp:LinkButton ID="LnkAnexo" runat="server" OnClick="GetAnexos" AlternateText="Agregar Anexo" CssClass="btn btn-circle btn-sm btn-success anexo" Text="<i class='fa fa-folder'></i>" />
<div class="modal-content"> <asp:LinkButton runat="server" CssClass="btn btn-circle btn-sm btn-success" ID="LnkModalDropzone" Visible="false"> <i class='fa fa-plus'></i></asp:LinkButton>
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Cargar Evidencia</h4>
</div>
<div class="modal-body"> <div runat="server" id="ModalAnexoEvidencia" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Cargar Evidencia</h4>
</div>
<div class="modal-body">
<div style="text-align:left"> <div style="text-align: left">
<asp:TextBox ID="TXTAnexo" CssClass="ADSdropzone hidden" data-maxFile="10" Text="" runat="server"></asp:TextBox> <asp:TextBox ID="TXTAnexo" CssClass="ADSdropzone hidden" data-maxFile="10" Text="" runat="server"></asp:TextBox>
</div> </div>
</div>
</div> <div class="modal-footer">
<div class="modal-footer"> <asp:UpdatePanel runat="server">
<asp:UpdatePanel runat="server"> <ContentTemplate>
<ContentTemplate> <button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button> </ContentTemplate>
</ContentTemplate> </asp:UpdatePanel>
</asp:UpdatePanel> </div>
</div>
</div> </div>
</div> </div>
</div>
</div> </ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="">
<ItemTemplate>
<asp:LinkButton ID="LnkGuardarAvance" Text="Guardar" CssClass="btn btn-primary" runat="server" OnClick="LnkGuardarAvance_Click" Visible="false" ValidationGroup="GrpGuardar" ></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</ItemTemplate> </Columns>
</asp:TemplateField> </asp:GridView>
</Columns>
</asp:GridView>
</div> </div>
</div> </div>
<div class="text-center"> <div class="text-center" runat="server" visible ="false">
<asp:Button id="BtnGuardar" CssClass="btn btn-primary" runat="server" Text="Guardar" Visible="false" ValidationGroup="GrpGuardar" /> <asp:Button id="BtnGuardar" CssClass="btn btn-primary" runat="server" Text="Guardar" Visible="false" ValidationGroup="GrpGuardar" />
</div> </div>
@@ -234,7 +243,7 @@
</ContentTemplate> </ContentTemplate>
</ajax:TabPanel> </ajax:TabPanel>
<ajax:TabPanel ID="TabEstimación" runat="server" HeaderText="Estimación"> <ajax:TabPanel ID="TabEstimación" runat="server" HeaderText="Estimación" visible ="false">
<ContentTemplate> <ContentTemplate>
<asp:UpdatePanel runat="server" ID="UpEstimaciones" UpdateMode="Conditional"> <asp:UpdatePanel runat="server" ID="UpEstimaciones" UpdateMode="Conditional">
@@ -254,7 +263,7 @@
<label class="col-md-1 truncate">Contrato:</label> <label class="col-md-1 truncate">Contrato:</label>
<div class="col-md-6 col-lg-4"> <div class="col-md-6 col-lg-4">
<div class="ddls"> <div class="ddls">
<asp:DropDownList ID="DDlContratosEstimaciones" runat="server" AutoPostBack="true" DataTextField="NumeroContrato" DataValueField="CveContrato" Class=" form-control input-inline select2me" Width="100%"> <asp:DropDownList ID="DDlContratosEstimaciones" runat="server" AutoPostBack="true" DataTextField="ContratoCompleto" DataValueField="CveContrato" Class=" form-control input-inline select2me" Width="100%">
</asp:DropDownList> </asp:DropDownList>
</div> </div>
</div> </div>

View File

@@ -91,16 +91,43 @@ Partial Class Contratos_ContratoAvance
End Property End Property
Property CveEstimacionActual As Integer
Get
If ViewState("CveEstimacionActual") Is Nothing Then
Return -1
Else
Return ViewState("CveEstimacionActual").ToString.ToEntero
End If
End Get
Set(value As Integer)
ViewState("CveEstimacionActual") = value
End Set
End Property
Property NuemeroEstimacionActual As Integer
Get
If ViewState("NuemeroEstimacionActual") Is Nothing Then
Return -1
Else
Return ViewState("NuemeroEstimacionActual").ToString.ToEntero
End If
End Get
Set(value As Integer)
ViewState("NuemeroEstimacionActual") = value
End Set
End Property
#End Region #End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then If Not IsPostBack Then
BtnGuardar.Visible = False BtnGuardar.Visible = False
CargaContrato() CargaContrato()
End If End If
End Sub End Sub
@@ -113,53 +140,33 @@ Partial Class Contratos_ContratoAvance
DDlContratosEstimaciones.DataSource = GlobalDTContratos.FiltraParametros(String.Format($"CveContratoTipo in (30,31) AND CveEmpresa = {UsuarioActual.CveEmpresa}")) DDlContratosEstimaciones.DataSource = GlobalDTContratos.FiltraParametros(String.Format($"CveContratoTipo in (30,31) AND CveEmpresa = {UsuarioActual.CveEmpresa}"))
DDlContratosEstimaciones.DataBind() DDlContratosEstimaciones.DataBind()
CargaddlAvance()
End Sub End Sub
Protected Sub DdlContratos_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlContratos.SelectedIndexChanged
CargaddlAvance()
End Sub
Private Sub CargaddlAvance()
DdlAvances.Items.Clear()
Dim ObjContratos As New ClsContratos()
If ObjContratos.GetContratosAvanceFecha(DdlContratos.SelectedValue.ToEntero, 2) Then
DdlAvances.DataSource = ObjContratos.DtResultados
End If
ObjContratos.Dispose()
DdlAvances.DataBind()
DdlAvances.Items.Insert(0, New ListItem(" ---- ", "-1"))
End Sub
#End Region #End Region
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
CveContrato = DdlContratos.SelectedValue.ToEntero CveContrato = DdlContratos.SelectedValue.ToEntero
CargaDatosAvance() CargaDatosAvance()
End Sub End Sub
Private Sub CargaDatosAvance() Private Sub CargaDatosAvance()
GvAnexos.Visible = False GvAnexos.Visible = False
Dim ObjContratos As New ClsContratos() Dim ObjContratos As New ClsContratos()
If DdlAvances.SelectedValue = "-1" Then
If ObjContratos.GetContratosAvanceTodos(CveContrato, 2) Then
fecha = ""
DtDatos = ObjContratos.DtResultados
If ObjContratos.DtResultados.Rows.Count > 0 Then
BtnGuardar.Visible = True
End If
End If
Else
If ObjContratos.GetContratosAvanceHistoricos(CveContrato, 2, DdlAvances.SelectedValue) Then
fecha = DdlAvances.SelectedValue
DtDatos = ObjContratos.DtResultados
BtnGuardar.Visible = False
If ObjContratos.GetContratosAvanceTodos(CveContrato, 2) Then
fecha = ""
DtDatos = ObjContratos.DtResultados
If ObjContratos.DtResultados.Rows.Count > 0 Then
BtnGuardar.Visible = True
End If End If
End If End If
ObjContratos.Dispose() ObjContratos.Dispose()
CargaGrid() CargaGrid()
End Sub End Sub
#Region "GV" #Region "GV"
@@ -176,6 +183,7 @@ Partial Class Contratos_ContratoAvance
End If End If
End Sub End Sub
Protected Sub GV_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs) Handles Gv.RowDataBound Protected Sub GV_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs) Handles Gv.RowDataBound
If e.Row.RowIndex > -1 Then If e.Row.RowIndex > -1 Then
e.Row.FCTextBox("TxtCantidad").Visible = (fecha = "") e.Row.FCTextBox("TxtCantidad").Visible = (fecha = "")
@@ -209,8 +217,10 @@ Partial Class Contratos_ContratoAvance
LnkAnexo.Visible = True LnkAnexo.Visible = True
End If End If
End If Dim LnkGuardarAvance As LinkButton = e.Row.FCLinkButton("LnkGuardarAvance")
LnkGuardarAvance.Visible = True
End If
End If End If
@@ -226,7 +236,7 @@ Partial Class Contratos_ContratoAvance
Dim gvr As GridViewRow = DirectCast(btn.NamingContainer, GridViewRow) Dim gvr As GridViewRow = DirectCast(btn.NamingContainer, GridViewRow)
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.GetContratosAvanceAnexos(CveContratoDetalle, fecha, UsuarioActual.CveUsuario) Then If objContrato.GetContratosAvanceAnexos(CveContratoDetalle, UsuarioActual.CveUsuario, -1) Then
GvAnexos.DataSource = objContrato.DtResultados GvAnexos.DataSource = objContrato.DtResultados
GvAnexos.DataBind() GvAnexos.DataBind()
GvAnexos.Visible = True GvAnexos.Visible = True
@@ -277,10 +287,13 @@ Partial Class Contratos_ContratoAvance
Dim ObjContratos As New ClsContratos Dim ObjContratos As New ClsContratos
ObjContratos.IniciaTransacSQL() ObjContratos.IniciaTransacSQL()
Dim TieneError = False Dim TieneError = False
Dim CveContratoDetalle As Integer Dim CveContratoDetalle As Integer
Dim Cantidad As Double Dim Cantidad As Double
'Dim filesgral As List(Of Archivo) = AnexoGral.getfiles().Archivos
Dim NumeroEstimacionActual As Integer = 0
Dim guardarArchivos As New List(Of Archivo) Dim guardarArchivos As New List(Of Archivo)
For Each gvr As GridViewRow In Gv.Rows For Each gvr As GridViewRow In Gv.Rows
@@ -292,19 +305,14 @@ Partial Class Contratos_ContratoAvance
Cantidad = gvr.FCTextBox("TxtCantidad").Text.ToDouble Cantidad = gvr.FCTextBox("TxtCantidad").Text.ToDouble
If Cantidad > 0 Then If Cantidad > 0 Then
If ObjContratos.AddContratosAvance(CveContratoDetalle, Cantidad, TxtFecha.Text.ToDateTime, UsuarioActual.CveUsuario) Then
If ObjContratos.AddContratosObraAvance(DdlContratos.SelectedValue.ToEntero, CveContratoDetalle, Cantidad, TxtFecha.Text.ToDateTime, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
NumeroEstimacionActual = ObjContratos.NumeroEstimacionActual
Dim CveContratoAvance As Integer = ObjContratos.DtResultados.Rows(0)("CveContratoAvance").ToString.ToEntero Dim CveContratoAvance As Integer = ObjContratos.DtResultados.Rows(0)("CveContratoAvance").ToString.ToEntero
Dim files As List(Of Archivo) = gvr.FCTextBox("TXTAnexo").getfiles().Archivos Dim files As List(Of Archivo) = gvr.FCTextBox("TXTAnexo").getfiles().Archivos
'For Each fileItem As Archivo In filesgral 'GENERAL
' guardarArchivos.Add(fileItem)
' If Not ObjContratos.AddContratosAvanceAnexo(CveContratoAvance, fileItem.filename, UsuarioActual.CveUsuario) Then
' TieneError = True
' Exit For
' End If
'Next
For Each fileItem As Archivo In files For Each fileItem As Archivo In files
guardarArchivos.Add(fileItem) guardarArchivos.Add(fileItem)
If Not ObjContratos.AddContratosAvanceAnexo(CveContratoAvance, fileItem.filename, UsuarioActual.CveUsuario) Then If Not ObjContratos.AddContratosAvanceAnexo(CveContratoAvance, fileItem.filename, UsuarioActual.CveUsuario) Then
@@ -327,25 +335,99 @@ Partial Class Contratos_ContratoAvance
ObjContratos.RollBack() ObjContratos.RollBack()
Alert("No se logro guardar el Presupuesto favor de intentarlo mas tarde o comuniquese con soporte", TipoMensaje.MsgAdvertencia) Alert("No se logro guardar el Presupuesto favor de intentarlo mas tarde o comuniquese con soporte", TipoMensaje.MsgAdvertencia)
Else Else
Dim urlsave As String = String.Format("Empresas\{0}\Contrato\{1}\Anexos", UsuarioActual.CveEmpresa, CveContrato)
'For Each fileItem As Archivo In filesgral Dim urlsave As String = String.Format("Empresas\{0}\Contrato\{1}\Anexos", UsuarioActual.CveEmpresa, CveContrato)
' fileItem.filename.FilesMove(fileItem.filename, urlsave)
'Next
For Each fileItem As Archivo In guardarArchivos For Each fileItem As Archivo In guardarArchivos
fileItem.filename.FilesMove(fileItem.filename.Replace($".{fileItem.Extencion}", ""), urlsave) fileItem.filename.FilesMove(fileItem.filename.Replace($".{fileItem.Extencion}", ""), urlsave)
Next Next
ObjContratos.Commit() ObjContratos.Commit()
Alert("se guardo Correctamente")
'Alert("se avance guardado correctamente")
Alert("se avance guardado correctamente en estimacion numero " & NumeroEstimacionActual)
End If End If
'AnexoGral.Text = "[]" 'AnexoGral.Text = "[]"
ObjContratos.Dispose() ObjContratos.Dispose()
CargaddlAvance() 'CargaddlAvance()
CargaDatosAvance() CargaDatosAvance()
End Sub End Sub
Protected Sub LnkGuardarAvance_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
Dim ObjContratos As New ClsContratos
ObjContratos.IniciaTransacSQL()
Dim TieneError = False
Dim CveContratoDetalle As Integer
Dim Cantidad As Double
Dim guardarArchivos As New List(Of Archivo)
Dim NumeroEstimacionActual As Integer = 0
CveContratoDetalle = GvRow.DataKey("CveContratoDetalle").ToEntero
If CveContratoDetalle > 0 Then
Cantidad = GvRow.FCTextBox("TxtCantidad").Text.ToDouble
If Cantidad > 0 Then
If ObjContratos.AddContratosObraAvance(DdlContratos.SelectedValue.ToEntero, CveContratoDetalle, Cantidad, TxtFecha.Text.ToDateTime, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
NumeroEstimacionActual = ObjContratos.NumeroEstimacionActual
Dim CveContratoAvance As Integer = ObjContratos.DtResultados.Rows(0)("CveContratoAvance").ToString.ToEntero
Dim files As List(Of Archivo) = GvRow.FCTextBox("TXTAnexo").getfiles().Archivos
For Each fileItem As Archivo In files
guardarArchivos.Add(fileItem)
If Not ObjContratos.AddContratosAvanceAnexo(CveContratoAvance, fileItem.filename, UsuarioActual.CveUsuario) Then
TieneError = True
Exit For
End If
Next
Else
TieneError = True
End If
If TieneError Then
ObjContratos.RollBack()
Alert("No se logro guardar el Presupuesto favor de intentarlo mas tarde o comuniquese con soporte", TipoMensaje.MsgAdvertencia)
Else
Dim urlsave As String = String.Format("Empresas\{0}\Contrato\{1}\Anexos", UsuarioActual.CveEmpresa, CveContrato)
For Each fileItem As Archivo In guardarArchivos
fileItem.filename.FilesMove(fileItem.filename.Replace($".{fileItem.Extencion}", ""), urlsave)
Next
ObjContratos.Commit()
'Alert("se avance guardado correctamente")
Alert("se avance guardado correctamente en estimacion numero " & NumeroEstimacionActual)
End If
End If
Else
ObjContratos.RollBack()
End If
ObjContratos.Dispose()
CargaDatosAvance()
End Sub
#Region "ESTIMACION" #Region "ESTIMACION"
@@ -355,9 +437,9 @@ Partial Class Contratos_ContratoAvance
Dim ObjContratos As New ClsContratos() Dim ObjContratos As New ClsContratos()
Dim DTEstimaciones As New DataTable Dim DTEstimaciones As New DataTable
Dim NumeroEstimacionActual As Integer = 0
If ObjContratos.GetContratosAvanceEstimacion(DDlContratosEstimaciones.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, -1) Then
If ObjContratos.GetContratosAvanceEstimacion(DDlContratosEstimaciones.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
DTEstimaciones = ObjContratos.DtResultados DTEstimaciones = ObjContratos.DtResultados
CveContratoEstimacion = DDlContratosEstimaciones.SelectedValue.ToEntero CveContratoEstimacion = DDlContratosEstimaciones.SelectedValue.ToEntero
@@ -465,7 +547,6 @@ Partial Class Contratos_ContratoAvance
End Sub End Sub
Private Sub GeneraAnexo(CveEstimacion As Integer, NumeroEstimacion As Integer, FechaEstimacion As Date, NumeroContrato As String) Private Sub GeneraAnexo(CveEstimacion As Integer, NumeroEstimacion As Integer, FechaEstimacion As Date, NumeroContrato As String)
Dim PlantillaAnexo As String = $"{UsuarioActual.Empresa.Ruta}\Formatos\Anexo.xlsx" Dim PlantillaAnexo As String = $"{UsuarioActual.Empresa.Ruta}\Formatos\Anexo.xlsx"
@@ -683,7 +764,7 @@ Partial Class Contratos_ContratoAvance
Dim objContrato As New ClsContratos Dim objContrato As New ClsContratos
Dim DTArchivos As New DataTable Dim DTArchivos As New DataTable
If objContrato.GetContratosAvanceAnexos(Drow("CveContratoDetalle").ToString.ToEntero, Drow("Fecha").ToString, UsuarioActual.CveUsuario, CveEstimacion:=CveEstimacion) Then If objContrato.GetContratosAvanceAnexos(Drow("CveContratoDetalle").ToString.ToEntero, UsuarioActual.CveUsuario, CveEstimacion:=CveEstimacion) Then
DTArchivos = objContrato.DtResultados DTArchivos = objContrato.DtResultados
End If End If
objContrato.Dispose() objContrato.Dispose()
@@ -748,6 +829,10 @@ Partial Class Contratos_ContratoAvance
#End Region #End Region
End Class End Class

View File

@@ -110,17 +110,7 @@
</ContentTemplate> </ContentTemplate>
<Triggers> <Triggers>
<%-- <asp:PostBackTrigger ControlID="LbDescargarExcel" />
<asp:PostBackTrigger ControlID="LBImprimir" />
<asp:PostBackTrigger ControlID="LBImprimirGastos" />
<asp:PostBackTrigger ControlID="LbImprimirSuministros" />
<asp:PostBackTrigger ControlID="LBImprimirInformacionG" />
<asp:PostBackTrigger ControlID="lbImprimirAvance" />
<asp:PostBackTrigger ControlID="LbImprimirPresupuesto" />
<asp:PostBackTrigger ControlID="LbImprmirAF" />
<asp:PostBackTrigger ControlID="LbImprmirAFExcel" />
<asp:PostBackTrigger ControlID="LbImprimirPedDev" />
<asp:PostBackTrigger ControlID="LbImprimirPedDevExcel" />--%>
</Triggers> </Triggers>
</asp:UpdatePanel> </asp:UpdatePanel>
</asp:Content> </asp:Content>
@@ -132,80 +122,169 @@
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server"> <asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<%-- <asp:UpdatePanel ID="UPTipo" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div id="DivTipoContrato" class="row" runat="server" visible="true">
<div class="col-md-12">
<div class="portlet light portlet-fit Withall">
<div class="portlet-title">
<div class="caption">
<span class="caption-subject font-green bold uppercase">
<h1>Tipo de Contrato</h1>
</span>
</div>
<div class="actions">
</div>
</div>
<div class="portlet-body">
<br />
<br />
<div class="row">
<div class="col-sm-6" style="text-align: right">
<asp:RadioButton ID="rdventa" runat="server" GroupName="rdTipo" AutoPostBack="true" Text="Venta" />
</div>
<div class="col-sm-6" style="text-align: left">
<asp:RadioButton ID="rpCompra" runat="server" GroupName="rdTipo" AutoPostBack="true" Text="Compra" />
</div>
</div>
<br />
<div class="row" id="dvDetContrato" runat="server" visible="false">
<div class="col-md-4" style="text-align: right!important">Tipo Contrato:</div>
<div class="col-md-4">
<asp:DropDownList ID="DdlTipoContrato" DataValueField="CveContratoTipo" DataTextField="ContratoTipo" runat="server" AutoPostBack="true" CssClass="select2me" Width="90%" OnSelectedIndexChanged="DdlTipoContrato_SelectedIndexChanged">
</asp:DropDownList>
</div>
<div class="row" style="text-align: center!important">
<br />
<br />
<br />
<asp:Button Text="Aceptar" runat="server" ID="BtnTipoContrato" Height="30px" Width="150px" class="btn btn-primary" />
<br />
<br />
<br />
<div style="width: 500px; margin: 0 auto;">
<asp:Label ID="TxtDescripcionTipoContrato" Text="" runat="server" />
</div>
</div>
</div>
<br />
<div class="row ">
<asp:TextBox Visible="false" runat="server" ID="TextBox5" TextMode="MultiLine" Rows="5" Enabled="false" Wrap="false" Width="500px" Height="50px" />
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>--%>
<asp:UpdatePanel UpdateMode="Conditional" ID="UpGral" runat="server"> <asp:UpdatePanel UpdateMode="Conditional" ID="UpGral" runat="server">
<ContentTemplate> <ContentTemplate>
<div runat="server" id="DivContent" visible="true" style="min-height: 500px"> <div runat="server" id="DivContent" visible="true" style="min-height: 500px">
<asp:UpdatePanel runat="server">
<asp:UpdatePanel ID="UpGrafica" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row" runat="server" id="DVGraficas" visible="false">
<div class="col-xs-3">
<div class="dashboard-stat2 " style="border: 2px solid #DDD; margin-bottom: 0px; height: 141.8px!important">
<div class="display">
<div class="number" style="display: none!important">
<small>Contratos</small>
<h3 class="font-purple-soft">
<span>
<asp:Literal Text="0" ID="LblImporteOculto" runat="server" /></span>
</h3>
</div>
<div class="number">
<small>Total Contratado</small>
<h3 class="font-purple-soft">
<span>$<asp:Literal Text="0" ID="LblImporte" runat="server" /></span>
</h3>
</div>
<div class="icon">
<i class="fa fa-list-ol"></i>
</div>
</div>
</div>
</div>
<div class="col-xs-3">
<div class="dashboard-stat2 " style="border: 2px solid #DDD; margin-bottom: 0px;">
<div class="display">
<div class="number" style="width: 80%!important">
<table style="width: 100%!important">
<td>
<small>Ventas</small>
<h3 class="font-green-sharp">
<span style="font-size: large">
<asp:Literal Text="0" ID="LtlAvanceImporte" runat="server" />
</span>
<small class="font-green-sharp"></small>
</h3>
</td>
<td>
<small>Porcentaje</small>
<h3 class="font-green-sharp">
<span style="font-size: large">
<asp:Literal Text="0" ID="LtlAvanceImporteProcentaje1" runat="server" />
</span>
<small class="font-green-sharp"></small>
</h3>
</td>
</table>
</div>
<div class="icon">
<i class="icon-pie-chart"></i>
</div>
</div>
<div class="progress-info">
<div class="progress">
<span runat="server" id="SPAvance1" style="width: 76%;" class="progress-bar progress-bar-success green-sharp">
<%--<span runat="server" id="SPAvance2" class="sr-only">76% Avance</span>--%>
</span>
</div>
<div class="status">
<div class="status-title">Avance </div>
<div class="status-number">
<asp:Literal Text="0" ID="LtlAvanceImporteProcentaje2" runat="server" />
</div>
</div>
</div>
</div>
</div>
<div class="col-xs-3">
<div class="dashboard-stat2 " style="border: 2px solid #DDD; margin-bottom: 0px;">
<div class="display">
<div class="number" style="width: 80%!important">
<table style="width: 100%!important">
<td>
<small>Interno</small>
<h3 class="font-red-haze">
<span style="font-size: large">
<asp:Literal Text="0" ID="LtlAvanceInternoImporte" runat="server" />
</span>
<small class="font-red-haze"></small>
</h3>
</td>
<td>
<small>Porcentaje</small>
<h3 class="font-red-haze">
<span style="font-size: large">
<asp:Literal Text="0" ID="LtlAvanceInternoImportePorcentaje1" runat="server" />
</span>
<small class="font-red-haze"></small>
</h3>
</td>
</table>
</div>
<div class="icon">
<i class="icon-pie-chart"></i>
</div>
</div>
<div class="progress-info">
<div class="progress">
<span runat="server" id="SPFaltante" style="width: 76%;" class="progress-bar progress-bar-success red-haze">
<%--<span class="sr-only">76% Avance</span>--%>
</span>
</div>
<div class="status">
<div class="status-title">Faltante </div>
<div class="status-number">
<asp:Literal Text="0" ID="LtlAvanceInternoImportePorcentaje2" runat="server" />
</div>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<%-- <asp:UpdatePanel runat="server">
<ContentTemplate> <ContentTemplate>
<table runat="server" id="TableDatosCabecera" visible="false" width="100%"> <table runat="server" id="TableDatosCabecera" visible="false" width="100%">
<tr> <tr>
<td style="width: 250px;">Importe Contratado: $ <td style="width: 250px;">Importe Contratado: $
<asp:Label ID="LblImporte" Font-Size="18px" Font-Bold="True" runat="server" Text=""></asp:Label></td> <asp:Label Font-Size="18px" Font-Bold="True" runat="server" Text=""></asp:Label></td>
<td style="width: 225px;">Facturado: $ <td style="width: 225px;">Facturado: $
<asp:Label ID="LblFacturado" Font-Size="18px" Font-Bold="True" runat="server" Text="0.00"></asp:Label></td> <asp:Label ID="LblFacturado" Font-Size="18px" Font-Bold="True" runat="server" Text="0.00"></asp:Label></td>
@@ -219,14 +298,20 @@
</tr> </tr>
</table> </table>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>--%>
<ajax:TabContainer ID="Tab" runat="server" Width="100%" CssClass="tabBodyOverride" ActiveTabIndex="0"> <ajax:TabContainer ID="Tab" runat="server" Width="100%" CssClass="tabBodyOverride" ActiveTabIndex="0">
<ajax:TabPanel ID="TabInformacionGeneral" runat="server" HeaderText="Información General"> <ajax:TabPanel ID="TabInformacionGeneral" runat="server" HeaderText="Información General">
<ContentTemplate> <ContentTemplate>
<div class="row"> <div class="row">
<div class="col-md-8"> <div class="col-md-6">
<div class="portlet smmallpadding light bordered"> <div class="portlet smmallpadding light bordered">
<div class="portlet-title"> <div class="portlet-title">
<div class="tools"> <div class="tools">
@@ -236,6 +321,12 @@
<div class="caption uppercase" style="position: relative;"><i class="fa fa-info-circle"></i>Datos del Contrato</div> <div class="caption uppercase" style="position: relative;"><i class="fa fa-info-circle"></i>Datos del Contrato</div>
</div> </div>
<div class="portlet-body rowpadding"> <div class="portlet-body rowpadding">
<div class="row"> <div class="row">
<label class="col-md-2 truncate">No. Contrato:</label> <label class="col-md-2 truncate">No. Contrato:</label>
<div class="col-md-10"> <div class="col-md-10">
@@ -306,187 +397,8 @@
</div> </div>
</div> </div>
<%-- <div class="row" id="RowFlexible" runat="server">
<label class="col-md-2 truncate ">Flexible:</label>
<div class="col-md-10">
<asp:CheckBox ID="chkDetalleContrato" AutoPostBack="True" OnCheckedChanged="chkDetalleContrato_CheckedChanged" runat="server"></asp:CheckBox>
</div>
</div>
<div class="row" runat="server" id="RowAlmacenOrigen" visible="False"> <div class="row">
<label class="col-md-2 truncate ">Almacén origen:</label>
<div class="col-md-10">
<asp:DropDownList ID="DdlAlmacenOrigen" runat="server" AppendDataBoundItems="True" DataTextField="Almacen" DataValueField="CveAlmacen" Class="form-control input-sm select2me" Width="400px" ValidationGroup="GrpGuardar"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVAlmacenOrigen" runat="server" ControlToValidate="DdlAlmacenOrigen" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Almacén''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEAlmacenOrigen" runat="server" HighlightCssClass="vco" TargetControlID="RFVAlmacenOrigen" Width="300px" BehaviorID="_content_VCEAlmacenOrigen"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="row" runat="server" id="RowAlmacen" visible="False">
<label class="col-md-2 truncate ">Almacén destino:</label>
<div class="col-md-10">
<asp:DropDownList ID="DdlAlmacenDestino" runat="server" AppendDataBoundItems="True" DataTextField="Almacen" DataValueField="CveAlmacen" Class="form-control input-sm select2me" Width="400px" ValidationGroup="GrpGuardar"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVAlmacenDestino" runat="server" ControlToValidate="DdlAlmacenDestino" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Almacén''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEAlmacenDestino" runat="server" HighlightCssClass="vco" TargetControlID="RFVAlmacenDestino" Width="300px" BehaviorID="_content_VCEAlmacenDestino"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="row" runat="server" id="RowPorcentajeComision" visible="False">
<label class="col-md-2 truncate ">Porcentaje de Comisión:</label>
<div class="col-md-10">
<asp:TextBox runat="server" Text="" ID="TxtPorcentajeComision" MaxLength="2"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender9" runat="server" TargetControlID="TxtPorcentajeComision" FilterType="Numbers" BehaviorID="_content_SoloNumeros" />
</div>
</div>--%>
</div>
</div>
</div>
<div class="col-md-4">
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpProyecto">
<ContentTemplate>
<div class="portlet smmallpadding light bordered">
<div class="portlet-title">
<div class="tools">
<a href="javascript;" data-idchekbox="C_chkexpand3" class=" collapse" data-original-title="" title=""></a><span class="hidden">
<input id="C_chkexpand3" type="checkbox" name="ctl00$C$chkexpand" checked="checked"></span>
</div>
<div class="caption uppercase" style="position: relative;"><i class="fa fa-info-circle"></i> <asp:Label runat="server" ID="LblCentroCosto"></asp:Label> </div>
</div>
<div class="portlet-body rowpadding">
<div class="row" id="DVddlproyecto" runat="server">
<asp:Label runat="server" ID="LblProyecto" class="col-md-4 truncate">Proyecto:</asp:Label>
<div class="col-md-8">
<asp:DropDownList ID="DdlProyecto" runat="server" AppendDataBoundItems="true" DataTextField="Proyecto" DataValueField="CveProyecto" Class="table-group-action-input form-control input-inline input-sm select2me" Style="width: 200px;" ValidationGroup="GrpGuardar">
<asp:ListItem Selected="True" Text="Sin Proyecto asignado" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVDdlProyecto" runat="server" ControlToValidate="DdlProyecto" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="CVERFVDdlProyecto" runat="server" HighlightCssClass="vco" TargetControlID="RFVDdlProyecto" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="row" id="DVSubProyecto" runat="server" visible ="false">
<asp:Label runat="server" ID="LblSubProyectoTitulo" class="col-md-4 truncate"></asp:Label>
<asp:Label runat="server" ID="LblSubProyecto" class="col-md-8 truncate">:</asp:Label>
</div>
<%-- <div class="row">
<label class="col-md-4 truncate">
<asp:Label ID="lblsubproyecto" runat="server" Text="Proyecto Contrato:"></asp:Label></label><div class="col-md-8">
<asp:DropDownList ID="DdlProyectoContrato" runat="server" AppendDataBoundItems="true" AutoPostBack="false" DataTextField="Proyecto" DataValueField="CveProyecto" Class="table-group-action-input form-control input-inline input-sm select2me" Style="width: 200px;" ValidationGroup="GrpGuardar">
<asp:ListItem Selected="True" Text="Sin SubProyectoContrato asignado" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVProyecto" runat="server" ControlToValidate="DdlProyectoContrato" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCERFVProyecto" runat="server" HighlightCssClass="vco" TargetControlID="RFVProyecto" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
</div>--%>
<%-- <div class="row" runat="server" id="dvAddendum">
<label class="col-md-4 truncate">Addendum:</label>
<div class="col-md-8">
<asp:DropDownList ID="DdlContratoPadre" runat="server" AppendDataBoundItems="true" AutoPostBack="false" DataTextField="NumeroContrato" DataValueField="CveContrato" Class="table-group-action-input form-control input-inline input-sm select2me" Style="width: 200px;" ValidationGroup="GrpGuardar"></asp:DropDownList>
</div>
</div>--%>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<div class="row">
<div class="col-md-8">
<div class="portlet smmallpadding light bordered">
<div class="portlet-title">
<div class="tools">
<a href="javascript;" data-idchekbox="C_chkexpand2" class=" collapse" data-original-title="" title=""></a><span class="hidden">
<input id="C_chkexpand2" type="checkbox" name="ctl00$C$chkexpand" checked="checked"></span>
</div>
<div class="caption uppercase" style="position: relative;"><i class="fa fa-info-circle"></i>Información</div>
</div>
<div class="portlet-body rowpadding">
<div class="row" id="TrCliente" runat="server" visible="False">
<label class="col-md-2 truncate">
<asp:Label ID="Label1" runat="server" Text="Cliente:"></asp:Label></label><div class="col-md-10">
</div>
</div>
<asp:UpdatePanel runat="server">
<ContentTemplate>
<div class="row" id="TrClienteSucursal" runat="server" visible="False">
<label class="col-md-2 truncate">
<asp:Label ID="Label2" runat="server" Text="Sucursal Cliente:"></asp:Label></label><div class="col-md-10">
<asp:DropDownList ID="DdlSucursalCliente" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" DataTextField="SucursalCliente" DataValueField="CveClienteSucursal" Width="75%">
<asp:ListItem Selected="true" Text="Matriz" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<%-- <asp:UpdatePanel runat="server">
<ContentTemplate>
<div class="row" id="DivVendedor" runat="server">
<label class="col-md-2 truncate">
<asp:Label ID="LblVendedor" runat="server" Text="Vendedor:"></asp:Label></label><div class="col-md-10">
<asp:DropDownList ID="DdlVendedor" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" DataTextField="Vendedor" DataValueField="CveVendedor" Width="75%">
<asp:ListItem Selected="true" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>--%>
<%-- <asp:UpdatePanel runat="server">
<ContentTemplate>
<div class="row" id="DivClienteDireccion" runat="server" visible="false">
<label class="col-md-2 truncate">
<asp:Label ID="LblClienteDireccion" runat="server" Text="Dirección Envío:"></asp:Label></label><div class="col-md-10">
<asp:DropDownList ID="DdlClienteDireccionEnvio" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" DataTextField="DireccionEnvio" DataValueField="CveDireccionEnvio" Width="75%">
<asp:ListItem Selected="true" Text="-" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div class="row" id="TrCtaEquipo" runat="server" visible="False">
<label class="col-md-2 truncate">
<asp:Label ID="Label3" runat="server" Text="Cuenta Equipo:"></asp:Label></label><div class="col-md-10">
<asp:DropDownList ID="DdlCuentaEquipo" runat="server" AppendDataBoundItems="True" DataTextField="devID" DataValueField="CveDispositivo" Class="table-group-action-input form-control input-inline input-sm select2me" Width="75%">
<asp:ListItem Selected="true" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
<div class="row" id="TrContratoPlantilla" runat="server" visible="False">
<label class="col-md-2 truncate">
<asp:Label ID="Label4" runat="server" Text="Plantilla de Contrato:"></asp:Label></label><div class="col-md-10">
<asp:DropDownList ID="DdlPlantillaContrato" AppendDataBoundItems="true" runat="server" DataValueField="CveContratoPlantilla" DataTextField="NombrePlantilla" CssClass="form-control select2me js-Impuesto-programmatic" Width="75%">
<asp:ListItem Selected="true" Value="-1" Text="Seleccione"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
<div class="row" id="TrPeriodo" runat="server" visible="False">
<label class="col-md-2 truncate">
<asp:Label ID="Label5" runat="server" Text="Periodo:"></asp:Label></label><div class="col-md-10">
<asp:DropDownList ID="DdlPeriodo" runat="server" AppendDataBoundItems="True" DataTextField="Nombre" DataValueField="CvePeriodo" Class="table-group-action-input form-control input-inline input-sm select2me" Width="75%">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
</div>--%>
<div class="row">
<label class="col-md-2 truncate">Tipo Contrato:</label> <label class="col-md-2 truncate">Tipo Contrato:</label>
<div class="col-md-10"> <div class="col-md-10">
@@ -526,6 +438,81 @@
<ajax:ValidatorCalloutExtender ID="VCOFechaFinal2" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaFinal" Width="350px" BehaviorID="_content_VCOFechaFinal2"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="VCOFechaFinal2" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaFinal" Width="350px" BehaviorID="_content_VCOFechaFinal2"></ajax:ValidatorCalloutExtender>
</div> </div>
</div> </div>
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpProyecto">
<ContentTemplate>
<div class="row" id="DVddlproyecto" runat="server">
<asp:Label runat="server" ID="LblProyecto" class="col-md-2 truncate">Proyecto:</asp:Label>
<div class="col-md-10">
<asp:DropDownList ID="DdlProyecto" runat="server" AppendDataBoundItems="true" DataTextField="Proyecto" DataValueField="CveProyecto" Class="table-group-action-input form-control input-inline input-sm select2me" Style="width: 200px;" ValidationGroup="GrpGuardar">
<asp:ListItem Selected="True" Text="Sin Proyecto asignado" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVDdlProyecto" runat="server" ControlToValidate="DdlProyecto" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="CVERFVDdlProyecto" runat="server" HighlightCssClass="vco" TargetControlID="RFVDdlProyecto" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="row" id="DVSubProyecto" runat="server" visible="false">
<asp:Label runat="server" ID="LblSubProyectoTitulo" class="col-md-2 truncate"></asp:Label>
<asp:Label runat="server" ID="LblSubProyecto" class="col-md-10 truncate"></asp:Label>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
<div class="col-md-6">
<div class="portlet smmallpadding light bordered">
<div class="portlet-title">
<div class="tools">
<a href="javascript;" data-idchekbox="C_chkexpand2" class=" collapse" data-original-title="" title=""></a><span class="hidden">
<input id="C_chkexpand2" type="checkbox" name="ctl00$C$chkexpand" checked="checked"></span>
</div>
<div class="caption uppercase" style="position: relative;"><i class="fa fa-info-circle"></i>Información</div>
</div>
<div class="portlet-body rowpadding">
<div class="row" id="TrCliente" runat="server" visible="False">
<label class="col-md-2 truncate">
<asp:Label ID="Label1" runat="server" Text="Cliente:"></asp:Label></label><div class="col-md-10">
</div>
</div>
<asp:UpdatePanel runat="server">
<ContentTemplate>
<div class="row" id="TrClienteSucursal" runat="server" visible="False">
<label class="col-md-2 truncate">
<asp:Label ID="Label2" runat="server" Text="Sucursal Cliente:"></asp:Label></label><div class="col-md-10">
<asp:DropDownList ID="DdlSucursalCliente" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" DataTextField="SucursalCliente" DataValueField="CveClienteSucursal" Width="75%">
<asp:ListItem Selected="true" Text="Matriz" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div class="row"> <div class="row">
<label class="col-md-2 truncate">Moneda:</label> <label class="col-md-2 truncate">Moneda:</label>
<div class="col-md-10"> <div class="col-md-10">
@@ -563,18 +550,7 @@
<asp:TextBox ID="TxtPorGarantia" runat="server" MaxLength="12" Width="150px"></asp:TextBox> <asp:TextBox ID="TxtPorGarantia" runat="server" MaxLength="12" Width="150px"></asp:TextBox>
</div> </div>
</div> </div>
<%-- <div class="row" id="DvMin" runat="server">
<label class="col-md-2 truncate ">Minimo:</label>
<div class="col-md-10">
<asp:TextBox ID="txtMinimo" runat="server" MaxLength="12" Width="150px"></asp:TextBox><ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender3" runat="server" TargetControlID="txtMinimo" FilterType="Custom, Numbers" ValidChars=",." BehaviorID="_content_SoloNumeros" />
</div>
</div>
<div class="row" id="DvMax" runat="server">
<label class="col-md-2 truncate ">Maximo:</label>
<div class="col-md-10">
<asp:TextBox ID="txtMaximo" runat="server" MaxLength="12" Width="150px"></asp:TextBox><ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender4" runat="server" TargetControlID="txtMaximo" FilterType="Custom, Numbers" ValidChars=",." BehaviorID="_content_SoloNumeros" />
</div>
</div>--%>
<div class="row" runat="server"> <div class="row" runat="server">
<label class="col-md-2 truncate ">% Limite de Gastos:</label> <label class="col-md-2 truncate ">% Limite de Gastos:</label>
@@ -604,9 +580,17 @@
</div> </div>
</div> </div>
<div class="col-md-4">
<div class="row" runat="server" id="RowEstatus">
</div>
<div class="row">
<div class="col-md-6" runat="server" id="RowEstatus" >
<div class="row" >
<div class="col-md-12"> <div class="col-md-12">
<div class="portlet smmallpadding light bordered"> <div class="portlet smmallpadding light bordered">
<div class="portlet-title"> <div class="portlet-title">
@@ -624,54 +608,6 @@
</div> </div>
</div> </div>
<%-- <div class="row" runat="server" id="DivTipoGarantia">
<label class="col-md-4 truncate">Tipo Garantía:</label>
<div class="col-md-8">
<asp:DropDownList ID="DdlTipoGarantia" runat="server" AppendDataBoundItems="True" Class="table-group-action-input form-control input-inline input-sm select2me" Style="width: 200px;" ValidationGroup="GrpGuardar">
<asp:ListItem Text="Ninguno" Value="-1" Selected="True"></asp:ListItem>
<asp:ListItem Text="Fianza" Value="1"></asp:ListItem>
<asp:ListItem Text="Cheque" Value="2"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="DdlTipoGarantia" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo Garantía''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator><ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="RFVEstatus" Width="300px" BehaviorID="_content_VCOEstatus"></ajax:ValidatorCalloutExtender>
</div>
</div>--%>
<%-- <div class="row" style="display: none;">
<label class="col-md-4 truncate">Estatus Fianza:</label>
<div class="col-md-8">
<asp:DropDownList ID="DdlEstatusFianza" runat="server" AppendDataBoundItems="True" Class="table-group-action-input form-control input-inline input-sm select2me" Style="width: 200px;" ValidationGroup="GrpGuardar">
<asp:ListItem Text="Activa" Value="1" Selected="True"></asp:ListItem>
<asp:ListItem Text="Liberada" Value="2"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
<div class="row" style="display: none;">
<label class="col-md-4 truncate">Folio:</label>
<div class="col-md-8">
<asp:TextBox runat="server" ID="TxtFolio"></asp:TextBox>
</div>
</div>
<div class="row" style="display: none;">
<div class="col-md-4 truncate">
Fecha Venc.:
</div>
<div class="col-md-8">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
<asp:TextBox Width="110px" ID="txtFechaVenc" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaVenc" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaVenc" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaVenc" Display="None" ErrorMessage="El campo <b>''Fecha Venc.''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaVenc" Display="None" ErrorMessage="El campo <b>''Fecha Venc.''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>--%>
</div> </div>
@@ -679,59 +615,25 @@
</div> </div>
</div> </div>
<%-- AGREGAR FIANZA --%>
<%-- <div class="row" runat="server" id="DivFianzas">
<div class="col-md-12">
<div class="portlet smmallpadding light bordered">
<div class="portlet-title">
<div class="tools">
<a href="javascript;" data-idchekbox="C_chkexpand6" class=" collapse" data-original-title="" title=""></a><span class="hidden">
<input id="C_chkexpand6" type="checkbox" name="ctl00$C$chkexpand" checked="checked"></span>
</div>
<div class="caption uppercase" style="position: relative;"><i class="fa fa-info-circle"></i>Fianzas</div>
<div class="actions">
<div class="btn-group">
<asp:LinkButton ID="btnAgregarFianza" runat="server" OnClick="btnAgregarFianza_Click" data-toggle="tooltip" data-placement="right" title="" CssClass="btn btn-circle btn-default" Text="<i class='fa fa-plus'></i> Agregar"></asp:LinkButton>
</div>
</div>
</div>
<div class="portlet-body rowpadding">
<div class="row">
<div class="col-md-12" style="text-align: center;">
<asp:UpdatePanel ID="UpGvFianzas" runat="server" UpdateMode="Conditional">
<ContentTemplate> <%-- <div class="row">
<div class="col-md-12" style="vertical-align: middle;" align="center">
<asp:GridView ID="GvFianzas" runat="server" OnRowDataBound="GvFianzas_RowDataBound" DataKeyNames="CveContratoFianza, Folio, CveEstatusFianza, EstatusFianza, FechaVencimiento,Adjunto" GridLines="None" CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" OnRowDeleting="GvFianzas_RowDeleting"> <div style="z-index: 5; position: relative;">
<Columns> <div id="DivAdvertencia" clientidmode="Static" runat="server" class="alert alert-warning" style="padding: 5px; margin-bottom: 5px; padding-right: 25px;">
<asp:BoundField DataField="Folio" HeaderText="Folio" ItemStyle-Width="25%" ItemStyle-HorizontalAlign="Left" /> <button type="button" class="close" data-dismiss="alert" style="margin-top: 5px;" aria-hidden="true"></button>
<asp:BoundField DataField="EstatusFianza" HeaderText="Estatus" ItemStyle-Width="25%" ItemStyle-HorizontalAlign="Left" /> <asp:Literal Text="En las observaciones se puede generar una plantilla a partir de diferentes etiquetas: {DIA},{MES},{AÑO},{TC}" runat="server" ID="LtlAdvertencia"></asp:Literal>
<asp:BoundField DataField="FechaVencimiento" HeaderText="Fecha Ven." ItemStyle-Width="25%" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:TemplateField ItemStyle-Width="25%" HeaderText="Acciones" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:LinkButton ID="imgEFianzaGv" runat="server" Visible="true" AlternateText="Editar" OnClick="imgEFianzaGv_Click" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
<asp:LinkButton ID="imgD" runat="server" Visible="true" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Desea eliminar esta fianza?" data-btn-ok-label="si" />
<asp:LinkButton data-toggle="tooltip" ClientIDMode="AutoID" title="Descargar Adjunto" ToolTip="Descargar Adjunto" Visible="false" ID="LnkDescargaAdjunto" OnClick="LnkDescargaAdjunto_Click" CssClass="btn btn-circle btn-xs green " runat="server"><i class="fa fa-arrow-circle-down" aria-hidden="true"></i></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
</div>--%> </div>--%>
<%-- --%>
<div class="row" runat="server" id="Div4"> </div>
<div class="col-md-12">
<div runat="server" id="Div4" class="col-md-6" >
<div class="portlet smmallpadding light bordered"> <div class="portlet smmallpadding light bordered">
<div class="portlet-title"> <div class="portlet-title">
<div class="tools"> <div class="tools">
@@ -751,14 +653,7 @@
<button type="button" class="btn btn-primary" runat="server" clientidmode="Static" id="A1" data-toggle="modal" data-target="#ModalUpload" visible="true"><i class="fa fa-upload" aria-hidden="true"></i>Subir Archivo</button> <button type="button" class="btn btn-primary" runat="server" clientidmode="Static" id="A1" data-toggle="modal" data-target="#ModalUpload" visible="true"><i class="fa fa-upload" aria-hidden="true"></i>Subir Archivo</button>
<%-- <a class="Texto" runat="server" clientidmode="Static" id="A1" data-toggle="modal" data-target="#ModalUpload" visible="true">
<img id="ImgArchivo" runat="server" alt="Archivo" src="/Imagenes/attachment_icon.gif" style="width: 16px; height: 16px; border: 0px none white" />
</a>--%>
<%-- <a class="Texto" runat="server" clientidmode="Static" id="A2" target="_blank" visible="false">
<img id="Img1" alt="Archivo" src="/Imagenes/descargar.png" style="width: 16px; height: 16px; border: 0px none white" />
</a>--%>
</ContentTemplate> </ContentTemplate>
<Triggers> <Triggers>
<asp:PostBackTrigger ControlID="BtnDescargar" /> <asp:PostBackTrigger ControlID="BtnDescargar" />
@@ -768,73 +663,11 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</div>
<div class="row">
<div class="col-md-12" style="vertical-align: middle;" align="center">
<div style="z-index: 5; position: relative;">
<div id="DivAdvertencia" clientidmode="Static" runat="server" class="alert alert-warning" style="padding: 5px; margin-bottom: 5px; padding-right: 25px;">
<button type="button" class="close" data-dismiss="alert" style="margin-top: 5px;" aria-hidden="true"></button>
<asp:Literal Text="En las observaciones se puede generar una plantilla a partir de diferentes etiquetas: {DIA},{MES},{AÑO},{TC}" runat="server" ID="LtlAdvertencia"></asp:Literal>
</div>
</div>
</div>
</div>
<%-- <div class="row" runat="server" id="DivImpuestosLocales">
<div class="col-md-12">
<div class="portlet smmallpadding light bordered">
<div class="portlet-title">
<div class="tools">
<a href="javascript;" data-idchekbox="C_chkexpand4" class=" collapse" data-original-title="" title=""></a>
<span class="hidden">
<input id="C_chkexpand7" type="checkbox" name="ctl00$C$chkexpand" checked="checked">
</span>
</div>
<div class="caption uppercase" style="position: relative;">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Impuestos Locales:</span>
<div class="row" id="RowImpuestosLocales" runat="server"> </div>
<div class="col-md-10">
<asp:CheckBox ID="ChkImpuestosLocales" AutoPostBack="True" OnCheckedChanged="ChkImpuestosLocales_CheckedChanged" runat="server"></asp:CheckBox>
</div>
</div>
</div>
</div>
<div class="portlet-body rowpadding">
<div class="row">
<div class="col-md-12">
<asp:UpdatePanel ID="UpImpuestos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvImpuestosLocales" ShowHeader="true" runat="server" horizontal-align="Right" GridLines="None" DataKeyNames="CveImpuestoLocal" CssClass="table table-striped table-hover Widthall" Visible="false" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros">
<Columns>
<asp:TemplateField HeaderText="" ItemStyle-Width="25px">
<ItemTemplate>
<asp:CheckBox runat="server" ID="ChkDeduccion" Checked='<%# Eval("Seleccionado") %>'></asp:CheckBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Impuesto" ItemStyle-Width="300px">
<ItemTemplate>
<asp:Literal ID="LtDeduccion" runat="server" Text='<%# Eval("ImpuestoLocal")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Porcentaje" ItemStyle-Width="90px" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Literal ID="LtPorcentaje" runat="server" Text='<%# Eval("Porcentaje", "{0:N4}%") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</div>
</div>
</div>--%>
</div>
</div> </div>
</div> </div>

View File

@@ -357,6 +357,40 @@ Partial Class Contratos_ContratoObra
End Property End Property
Property TotalAvanceVentas As Decimal
Get
If ViewState("TotalAvanceVentas") Is Nothing Then
Return 0D
Else
Return ViewState("TotalAvanceVentas").ToString.ToDecimal
End If
End Get
Set(value As Decimal)
ViewState("TotalAvanceVentas") = value
End Set
End Property
Property TotalAvanceInterno As Decimal
Get
If ViewState("TotalAvanceInterno") Is Nothing Then
Return 0D
Else
Return ViewState("TotalAvanceInterno").ToString.ToDecimal
End If
End Get
Set(value As Decimal)
ViewState("TotalAvanceInterno") = value
End Set
End Property
#End Region #End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
@@ -417,6 +451,8 @@ Partial Class Contratos_ContratoObra
End If End If
Indicadores()
Else Else
'Configuración de Modalidad Insert 'Configuración de Modalidad Insert
LblFechaCaptura.Text = Now.ToShortDateString() LblFechaCaptura.Text = Now.ToShortDateString()
@@ -440,7 +476,7 @@ Partial Class Contratos_ContratoObra
CargaPS() CargaPS()
CargaPSInsumos() CargaPSInsumos()
ConfiguraTipos() ConfiguraTipos()
CargaDatosEncabezado() 'CargaDatosEncabezado()
End If End If
@@ -620,9 +656,9 @@ Partial Class Contratos_ContratoObra
DvTotal.Visible = True DvTotal.Visible = True
If CveContrato > 0 AndAlso CveTipoContrato <> 25 Then 'If CveContrato > 0 AndAlso CveTipoContrato <> 25 Then
TableDatosCabecera.Visible = True ' TableDatosCabecera.Visible = True
End If 'End If
If CveTipoContrato = 25 Then If CveTipoContrato = 25 Then
@@ -638,9 +674,9 @@ Partial Class Contratos_ContratoObra
DvTotal.Visible = True DvTotal.Visible = True
If CveContrato > 0 AndAlso CveTipoContrato <> 25 Then 'If CveContrato > 0 AndAlso CveTipoContrato <> 25 Then
TableDatosCabecera.Visible = True ' TableDatosCabecera.Visible = True
End If 'End If
@@ -668,8 +704,8 @@ Partial Class Contratos_ContratoObra
msjpresupuestos.Visible = False msjpresupuestos.Visible = False
If ArchivoUpdate = ObjContratos.Archivo.ToString Then If ArchivoUpdate = ObjContratos.Archivo.ToString Then
LinkArchivo.Visible = True 'LinkArchivo.Visible = True
LinkArchivo.HRef = String.Format("{0}{1}", Ruta, ObjContratos.Archivo.ToString) 'LinkArchivo.HRef = String.Format("{0}{1}", Ruta, ObjContratos.Archivo.ToString)
End If End If
Titulo = $"{ObjContratos.NumeroContrato} - {ObjContratos.DescripcionContrato} ({ObjContratos.DtResultados.Rows(0)("ContratoTipo")})" Titulo = $"{ObjContratos.NumeroContrato} - {ObjContratos.DescripcionContrato} ({ObjContratos.DtResultados.Rows(0)("ContratoTipo")})"
TituloCorto = $"{ObjContratos.NumeroContrato} - {ObjContratos.DescripcionContrato} " TituloCorto = $"{ObjContratos.NumeroContrato} - {ObjContratos.DescripcionContrato} "
@@ -719,7 +755,7 @@ Partial Class Contratos_ContratoObra
TabPVInsumos.Visible = False TabPVInsumos.Visible = False
RowEstatus.Visible = False RowEstatus.Visible = False
TabPres.HeaderText = "Partidas" TabPres.HeaderText = "Partidas"
TableDatosCabecera.Visible = False 'TableDatosCabecera.Visible = False
TabAvanveDocumento.Visible = False TabAvanveDocumento.Visible = False
TabSistema.Visible = False TabSistema.Visible = False
TabContratosGastos.Visible = False TabContratosGastos.Visible = False
@@ -863,8 +899,14 @@ Partial Class Contratos_ContratoObra
UpGV.Update() UpGV.Update()
UpGVInsumos.Update() UpGVInsumos.Update()
UPGVInt.Update() UPGVInt.Update()
TotalAvanceVentas = TmpDT.FiltraParametros("CveTipoPresupuesto=2").SUM("Total").ToDecimal
TotalAvanceInterno = TmpDT.FiltraParametros("CveTipoPresupuesto=1").SUM("Total").ToDecimal
LbTotalGeneral.Text = TmpDT.FiltraParametros("CveTipoPresupuesto=2").SUM("Total").FormatoNumero() LbTotalGeneral.Text = TmpDT.FiltraParametros("CveTipoPresupuesto=2").SUM("Total").FormatoNumero()
LbTotalGeneralInsumos.Text = TmpDT.FiltraParametros("CveTipoPresupuesto=1").SUM("Total").FormatoNumero() LbTotalGeneralInsumos.Text = TmpDT.FiltraParametros("CveTipoPresupuesto=1").SUM("Total").FormatoNumero()
LbTotalGeneralInt.Text = TmpDT.FiltraParametros("CveTipoPresupuesto=1").SUM("Total").FormatoNumero() LbTotalGeneralInt.Text = TmpDT.FiltraParametros("CveTipoPresupuesto=1").SUM("Total").FormatoNumero()
'LblImporte.Text = "$" & TmpDT.FiltraParametros("CveTipoPresupuesto=2").SUM("Total").FormatoNumero() 'LblImporte.Text = "$" & TmpDT.FiltraParametros("CveTipoPresupuesto=2").SUM("Total").FormatoNumero()
End If End If
@@ -1116,7 +1158,7 @@ Partial Class Contratos_ContratoObra
LblProyecto.Visible = True LblProyecto.Visible = True
LblCentroCosto.Text = LblSubProyectoTitulo.Text 'LblCentroCosto.Text = LblSubProyectoTitulo.Text
LblSubProyectoTitulo.Text = LblSubProyectoTitulo.Text & ":" LblSubProyectoTitulo.Text = LblSubProyectoTitulo.Text & ":"
'If UsuarioActual.Empresa.GralSoloProyecto Then 'If UsuarioActual.Empresa.GralSoloProyecto Then
@@ -2846,16 +2888,16 @@ Partial Class Contratos_ContratoObra
Public Sub CargaDatosEncabezado() 'Public Sub CargaDatosEncabezado()
TablaUtilidad.Visible = True ' TablaUtilidad.Visible = True
LblUtilidad.Text = $"$ {(SumaAvance - SumaGasto).ToString.FormatoNumero()}" ' LblUtilidad.Text = $"$ {(SumaAvance - SumaGasto).ToString.FormatoNumero()}"
If (SumaAvance - SumaGasto) < 0 Then LblUtilidad.ForeColor = Drawing.Color.Red ' If (SumaAvance - SumaGasto) < 0 Then LblUtilidad.ForeColor = Drawing.Color.Red
LblFacturado.Text = SumaAvance.FormatoNumero ' LblFacturado.Text = SumaAvance.FormatoNumero
LblPorFacturar.Text = (LblImporte.Text.ToDouble - SumaAvance).FormatoNumero ' LblPorFacturar.Text = (LblImporte.Text.ToDouble - SumaAvance).FormatoNumero
End Sub 'End Sub
#End Region #End Region
@@ -3065,173 +3107,7 @@ Partial Class Contratos_ContratoObra
Return dataTable Return dataTable
End Function End Function
'Private Sub CargarArchivo(Ruta As String, FileName As String, Tipo As String)
' Dim dt As New DataTable
' dt = ReadExcelFile(Ruta + FileName, True)
' Dim ErrorArchivo = False
' 'Dim Conexion As Odbc.OdbcConnection = Nothing
' 'Try
' ' Select Case Tipo
' ' Case "EXCEL"
' ' Conexion = New Odbc.OdbcConnection("Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ=" + Ruta + FileName + ";")
' ' Conexion.Open()
' ' Dim cmd = Conexion.CreateCommand()
' ' cmd.CommandType = CommandType.Text
' ' cmd.CommandText = "SELECT * FROM [Hoja1$]"
' ' Dim DataAdapter = New Odbc.OdbcDataAdapter(cmd)
' ' DataAdapter.Fill(dt)
' ' Case Else
' ' Alert("El archivo no tiene el formato correcto", TipoMensaje.MsgError)
' ' Exit Sub
' ' End Select
' 'Catch ex As Exception
' ' ErrorArchivo = True
' ' OnError("Ocurrio un error al leer el archivo <br/>" & ex.Message, ex)
' 'End Try
' 'Conexion.Close()
' If Not ErrorArchivo AndAlso dt IsNot Nothing Then
' If Not dt.Columns(0).ColumnName = "OC Interna" Then
' Alert("El nombre de la primera columna debe ser 'OC Interna'. Favor de corregirlo", TipoMensaje.MsgError)
' Exit Sub
' End If
' If Not dt.Columns(1).ColumnName = "Cantidad" Then
' Alert("El nombre de la primera columna debe ser 'Cantidad'. Favor de corregirlo", TipoMensaje.MsgError)
' Exit Sub
' End If
' If Not dt.Columns(2).ColumnName = "Clave Interna Cliente" Then
' Alert("El nombre de la segunda columna debe ser 'Clave Interna'. Favor de corregirlo", TipoMensaje.MsgError)
' Exit Sub
' End If
' If Not dt.Columns(3).ColumnName = "Código" Then
' Alert("El nombre de la tercera columna debe ser 'Código'. Favor de corregirlo", TipoMensaje.MsgError)
' Exit Sub
' End If
' If Not dt.Columns(4).ColumnName = "Código Barras" Then
' Alert("El nombre de la cuarta columna debe ser 'Código Barras'. Favor de corregirlo", TipoMensaje.MsgError)
' Exit Sub
' End If
' If Not dt.Columns(5).ColumnName = "Producto/Servicio" Then
' Alert("El nombre de la quinta columna debe ser 'Producto/Servicio'. Favor de corregirlo", TipoMensaje.MsgError)
' Exit Sub
' End If
' If Not dt.Columns(6).ColumnName = "UM" Then
' Alert("El nombre de la sexta columna debe ser 'U.M'. Favor de corregirlo", TipoMensaje.MsgError)
' Exit Sub
' End If
' If Not dt.Columns(7).ColumnName = "Precio Unitario" Then
' Alert("El nombre de la septima columna debe ser 'Precio Unitario'. Favor de corregirlo", TipoMensaje.MsgError)
' Exit Sub
' End If
' dt.TableName = "Datos"
' If Not ErrorArchivo Then
' NumRow = 1
' Dim RowNoEncontrados As String = String.Empty
' Dim NumAgregados As Integer = 0
' For Each Row As DataRow In dt.Rows
' Dim Cantidad As Integer = Row("Cantidad").ToString.ToEntero
' Dim Codigo As String = Row("Código").ToString.Trim.ToUpper
' Dim CodigoBarras As String = Row("Código Barras").ToString.Trim.ToUpper
' Dim UM As String = Row("UM").ToString
' Dim ClaveInterna As String = Row("Clave Interna Cliente").ToString.Trim.ToUpper
' Dim OCInterna As String = Row("OC Interna").ToString.Trim.ToUpper
' Dim ProductoServicio As String = Row("Producto/Servicio").ToString.Trim.ToUpper
' Dim PrecioUnitario As Double = Row("Precio Unitario").ToString.ToDouble
' Dim CvePS As Integer = 0
' Dim CveUM As Integer = 0 ' GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveUnidadMedida", $"CvePS = '{CvePS}'").ToString.ToEntero
' Dim CodigoPS As Integer = 0
' Dim Total As Double = (Cantidad * PrecioUnitario)
' NumRow = NumRow + 1
' If Codigo.Length > 0 Then
' Dim StrArray() As String = GetPS("Codigo", Codigo).Split("|"c)
' If StrArray.Length > 0 Then
' If CBool(StrArray(0)) = True Then
' CvePS = StrArray(1).ToEntero
' Else
' RowNoEncontrados &= StrArray(1) & "<\BR>"
' End If
' End If
' ElseIf CodigoBarras.Length > 0 Then
' Dim StrArray() As String = GetPS("CodigoBarras", CodigoBarras).Split("|"c)
' If StrArray.Length > 0 Then
' If CBool(StrArray(0)) = True Then
' CvePS = StrArray(1).ToEntero
' Else
' RowNoEncontrados &= StrArray(1) & "<\BR>"
' End If
' End If
' ElseIf ProductoServicio.Length > 0 Then
' Dim StrArray() As String = GetPS("PS", ProductoServicio).Split("|"c)
' If StrArray.Length > 0 Then
' If CBool(StrArray(0)) = True Then
' CvePS = StrArray(1).ToEntero
' Else
' RowNoEncontrados &= StrArray(1) & "<\BR>"
' End If
' End If
' Else
' RowNoEncontrados &= "<\BR>&nbsp;&nbsp;&nbsp;&nbsp;- En la fila " & NumRow & " no se especificó código, código de barras ó descripción."
' End If
' CveUM = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("CveUnidadMedida", "").ToString.ToEntero
' If TmpDT IsNot Nothing AndAlso CvePS > 0 Then
' Dim dr As DataRow = TmpDT.NewRow
' dr("Cantidad") = Cantidad
' dr("CantidadContratada") = Cantidad
' dr("CveUM") = CveUM
' dr("UM") = UM
' dr("CveClasificacion") = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("CveClasificacion", "").ToString.ToEntero
' dr("Clasificacion") = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = '{dr("CveClasificacion")}'").ToString
' dr("CvePS") = CvePS
' dr("PS") = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=dr("CvePS").ToString.ToEntero).FiltroPrimeroValor("PS", "").ToString
' dr("CodigoPS") = dr("PS")
' dr("PU") = PrecioUnitario
' dr("Total") = Cantidad * PrecioUnitario
' dr("CveTipoPresupuesto") = 2
' dr("NoIdentificacion") = ClaveInterna
' dr("OCInterna") = OCInterna
' dr("LimitarCantidad") = 0
' If CvePS > 0 Then
' Dim ObjContratos As New ClsContratos
' If ObjContratos.AddContratosDetalle(CveContrato, dr("CvePS").ToString.ToEntero, dr("Cantidad").ToString.ToDouble, dr("PU").ToString.ToDouble, UsuarioActual.CveUsuario, dr("CveTipoPresupuesto").ToString.ToEntero, dr("NoIdentificacion").ToString, dr("LimitarCantidad").ToString.ToEntero = 1, dr("OCInterna").ToString) Then
' Dim msj As String = String.Format("Se agregaron {0} {1} del producto {2} con un precio ${3}.", dr("Cantidad"), dr("UM"), dr("PS"), dr("PU"))
' guardarBitacora(msj)
' dr("CveContratoDetalle") = ObjContratos.DtResultados.Rows(0)("CveContratoDetalle")
' TmpDT.Rows.Add(dr)
' Dim TotalRow = dr("Total").ToString.ToDouble
' CargaGVPresupuestos(TmpDT.FiltraParametros("CveTipoPresupuesto=2"))
' LbTotalGeneral.Text = (LbTotalGeneral.Text.ToDouble + TotalRow).ToString.FormatoNumero
' LblImporte.Text = LbTotalGeneral.Text
' Else
' Alert("Ocurrio un error al agregar el detalle", TipoMensaje.MsgError)
' End If
' ObjContratos.Dispose()
' End If
' End If
' Next
' 'Cargo el GridView
' Gv.DataSource = TmpDT
' Gv.DataBind()
' UpGV.Update()
' If RowNoEncontrados.Length > 0 Then
' Alert("Los siguientes Productos o Servicios no se encontraron en la Base de Datos.<\BR>" & RowNoEncontrados, TipoMensaje.MsgAdvertencia)
' Else
' Alert("Se Cargaron " & NumRow & " Productos o Servicios correctamente.")
' End If
' End If
' End If
'End Sub
Private Function GetPS(Opt As String, Valor As String) As String Private Function GetPS(Opt As String, Valor As String) As String
Dim StrReturn As String = String.Empty Dim StrReturn As String = String.Empty
@@ -3260,34 +3136,7 @@ Partial Class Contratos_ContratoObra
#End Region #End Region
#Region " GPS "
'Private Sub CargaCuentasEquipos()
' Dim GPS As New ClsGPS
' If GPS.DispositivosGet(-1, -1, DdlCliente.SelectedValue.ToEntero) Then
' DdlCuentaEquipo.DataSource = GPS.DtResultados
' Else
' DdlCuentaEquipo.DataSource = Nothing
' End If
' GPS.Dispose()
' DdlCuentaEquipo.DataBind()
' UpGral.Update()
'End Sub
'Private Sub CargaPeriodos()
' Dim ObjContratos As New ClsContratos
' If ObjContratos.GetPeriodos(-1, UsuarioActual.CveEmpresa) Then
' DtPeriodo = ObjContratos.DtResultados
' Else
' DtPeriodo = Nothing
' End If
' DdlPeriodo.DataSource = DtPeriodo
' ObjContratos.Dispose()
' DdlPeriodo.DataBind()
' UpGral.Update()
'End Sub
#End Region
#Region " IMPRESION " #Region " IMPRESION "
@@ -3322,57 +3171,7 @@ Partial Class Contratos_ContratoObra
ImprimirPDF("Empresas/Grales/Formatos/RepContratoAvanceDocumento.rdlc", dt, params, $"{Nombre}-AvanceDocumento", Formato:=Formato) ImprimirPDF("Empresas/Grales/Formatos/RepContratoAvanceDocumento.rdlc", dt, params, $"{Nombre}-AvanceDocumento", Formato:=Formato)
End Sub End Sub
'Private Sub LBImprimirInformacionG_Click(sender As Object, e As EventArgs) Handles LBImprimirInformacionG.Click
' Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
' Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
' Dim dt As DataTable = DtAvanceDocumento
' Dim params As New List(Of ReportParameter)
' params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
' params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
' params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
' params.Add(New ReportParameter("Contrato", Titulo))
' 'DATOS DEL CONTRATO
' params.Add(New ReportParameter("NoContrato", TxtNumeroContrato.Text.Trim))
' params.Add(New ReportParameter("Descripcion", TxtDescripcionContrato.Text.Trim))
' params.Add(New ReportParameter("Proveedor", If(TrProveedor.Visible = True, DdlContratista.SelectedItem.Text.Trim, "-")))
' params.Add(New ReportParameter("Ubicacion", TxtUbicacion.Text.Trim))
' params.Add(New ReportParameter("Responsable", TxtResponsable.Text.Trim))
' params.Add(New ReportParameter("Almacen", "-"))
' params.Add(New ReportParameter("Porcentaje", "-"))
' 'CENTRO DE COSTOS
' params.Add(New ReportParameter("Proyecto", If(DVddlproyecto.Visible = True, DdlProyecto.SelectedItem.Text.Trim, "-")))
' params.Add(New ReportParameter("SubProyecto", CveSubProyecto.ToString))
' params.Add(New ReportParameter("Addendum", ""))
' 'INFORMACION
' params.Add(New ReportParameter("Cliente", If(TrCliente.Visible = True, DdlCliente.SelectedItem.Text.Trim, "-")))
' params.Add(New ReportParameter("Sucursal", If(TrClienteSucursal.Visible = True, DdlSucursalCliente.SelectedItem.Text.Trim, "-")))
' params.Add(New ReportParameter("FechaInicial", TxtFechaInicial.Text.Trim))
' params.Add(New ReportParameter("FechaFinal", TxtFechaFinal.Text.Trim))
' params.Add(New ReportParameter("Moneda", DdlMoneda.SelectedItem.Text.Trim))
' params.Add(New ReportParameter("TipoCambio", If(tipoCambio.Visible = True, TxtTipoCambio.Text.Trim, "-")))
' params.Add(New ReportParameter("IVA", TxtPorIVA.Text.Trim))
' params.Add(New ReportParameter("Anticipo", TxtPorAnticipo.Text.Trim))
' params.Add(New ReportParameter("Amortizacion", TxtPorAmortizacionAnticipo.Text.Trim))
' params.Add(New ReportParameter("Garantia", TxtPorGarantia.Text.Trim))
' params.Add(New ReportParameter("Minimo", "-"))
' params.Add(New ReportParameter("Maximo", "-"))
' params.Add(New ReportParameter("Total", If(DvTotal.Visible = True, TxtTotal.Text.Trim, "-")))
' 'Estatus
' params.Add(New ReportParameter("Estatus", DdlEstatus.SelectedItem.Text.Trim))
' params.Add(New ReportParameter("TipoGarantia", ""))
' params.Add(New ReportParameter("EstatusFianza", ""))
' params.Add(New ReportParameter("Folio", "0"))
' params.Add(New ReportParameter("FechaVencimiento", ""))
' If Imagen.Exists Then
' params.Add(New ReportParameter("LogoPath", logouri))
' Else
' params.Add(New ReportParameter("LogoPath", ""))
' End If
' ImprimirPDF("Empresas/Grales/Formatos/Contrato.rdlc", dt, params, $"Contrato-{Titulo}", Formato:="PDF")
'End Sub
#End Region #End Region
@@ -3385,7 +3184,7 @@ Partial Class Contratos_ContratoObra
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
Dim UtilidadGastos As String = IIf(LblUtilidad.Text <> "", LblUtilidad.Text, "-").ToString ' Dim UtilidadGastos As String = IIf(LblUtilidad.Text <> "", LblUtilidad.Text, "-").ToString
Dim dt As DataTable = DtGastos Dim dt As DataTable = DtGastos
@@ -3401,7 +3200,7 @@ Partial Class Contratos_ContratoObra
params.Add(New ReportParameter("FechaFin", TxtFechaFinal.Text.Trim)) params.Add(New ReportParameter("FechaFin", TxtFechaFinal.Text.Trim))
params.Add(New ReportParameter("TipoContrato", TipoDocumento)) params.Add(New ReportParameter("TipoContrato", TipoDocumento))
params.Add(New ReportParameter("TotalContrato", LblImporte.Text)) params.Add(New ReportParameter("TotalContrato", LblImporte.Text))
params.Add(New ReportParameter("Utilidad", UtilidadGastos)) ' params.Add(New ReportParameter("Utilidad", UtilidadGastos))
If Imagen.Exists Then If Imagen.Exists Then
params.Add(New ReportParameter("LogoPath", logouri)) params.Add(New ReportParameter("LogoPath", logouri))
@@ -3899,55 +3698,8 @@ Partial Class Contratos_ContratoObra
'BtnGuardarFianza.Text = "Guardar" 'BtnGuardarFianza.Text = "Guardar"
UPModalFianza.Update() UPModalFianza.Update()
Me.RegistraScript("$('#DvModalFianza').modal();") Me.RegistraScript("$('#DvModalFianza').modal();")
'GvFianzas.DataSource = DtTmpFianzas
'GvFianzas.DataBind()
'UpGvFianzas.Update()
End Sub End Sub
'Protected Sub BtnGuardarFianza_Click(sender As Object, e As EventArgs)
' Dim dr As DataRow = DtTmpFianzas.NewRow()
' Dim Folio As String = txtFolioFianza.Text
' Dim CveEstatus As Integer = DdlFianza.SelectedValue.ToEntero()
' Dim Estatus As String = DdlFianza.SelectedItem.Text
' Dim TieneError As Boolean = False
' Dim Adjunto As String = ""
' If TxtModalAdjuntoArchivo.getfiles.Archivos.Count > 0 Then
' Dim ArchivoAdjunto As Archivo = TxtModalAdjuntoArchivo.getfiles.Archivos(0)
' Adjunto = ArchivoAdjunto.filenameO
' End If
' If EsEditarFianza Then
' DtTmpFianzas.Rows.RemoveAt(IndexFianzaEditar)
' dr("CveContratoFianza") = GvFianzas.Rows(IndexFianzaEditar).DataKey("CveContratoFianza").ToString
' dr("Folio") = Folio
' dr("EstatusFianza") = Estatus
' dr("CveEstatusFianza") = CveEstatus
' dr("FechaVencimiento") = txtFechaVenFianza.Text
' dr("Adjunto") = If(Adjunto = "", GvFianzas.Rows(IndexFianzaEditar).DataKey("Adjunto").ToString, Adjunto)
' Else
' dr("CveContratoFianza") = "-1"
' dr("Folio") = Folio
' dr("EstatusFianza") = Estatus
' dr("CveEstatusFianza") = CveEstatus
' dr("FechaVencimiento") = txtFechaVenFianza.Text
' dr("Adjunto") = Adjunto
' End If
' DtTmpFianzas.Rows.Add(dr)
' GuardaAdjunto($"{Folio} - {txtFechaVenFianza.Text}")
' GvFianzas.DataSource = DtTmpFianzas
' GvFianzas.DataBind()
' UpGvFianzas.Update()
' LimpiarCamposModalFianzas()
' Me.RegistraScript("$('#DvModalFianza').modal('hide');")
'End Sub
@@ -3973,38 +3725,12 @@ Partial Class Contratos_ContratoObra
Alert("Ocurrió un error al guardar el archivo Adjunto. Por favor vuelva a intentar.", TipoMensaje.MsgError) Alert("Ocurrió un error al guardar el archivo Adjunto. Por favor vuelva a intentar.", TipoMensaje.MsgError)
End Try End Try
End Sub End Sub
'Private Sub DescargarAdjunto()
' Dim filename As String = GvFianzas.Rows(IndexFianzaEditar).DataKey("Adjunto").ToString
' If Not String.IsNullOrEmpty(filename) Then
' Dim rutaAplicacion As String = HttpContext.Current.Server.MapPath(HttpContext.Current.Request.ApplicationPath)
' Dim Path As String = String.Format("{0}\\{1}\\{2}\\{3}", UsuarioActual.Empresa.Ruta, "Contratos", "Fianzas", $"{GvFianzas.Rows(IndexFianzaEditar).DataKey("Folio").ToString} - {GvFianzas.Rows(IndexFianzaEditar).DataKey("FechaVencimiento").ToDate.ToShortDateString}")
' Dim ArchivoDestino As String = String.Format("{0}\\{1}", Path, GvFianzas.Rows(IndexFianzaEditar).DataKey("Adjunto").ToString)
' Dim toDownload As System.IO.FileInfo = New System.IO.FileInfo(ArchivoDestino)
' If toDownload.Exists Then
' Response.ClearContent()
' Response.ClearHeaders()
' Response.AddHeader("Content-Disposition", "attachment; filename=" + filename)
' Response.ContentType = "application/octet-stream"
' Response.WriteFile(ArchivoDestino)
' Response.Flush()
' Response.Close()
' Response.End()
' HttpContext.Current.ApplicationInstance.CompleteRequest()
' End If
' End If
'End Sub
Protected Sub LnkDescargar_Click(sender As Object, e As EventArgs) Protected Sub LnkDescargar_Click(sender As Object, e As EventArgs)
'DescargarAdjunto() 'DescargarAdjunto()
End Sub End Sub
'Protected Sub GvFianzas_RowDeleting(sender As Object, e As GridViewDeleteEventArgs)
' DtTmpFianzas.Rows.RemoveAt(e.RowIndex)
' GvFianzas.DataSource = DtTmpFianzas
' GvFianzas.DataBind()
' UpGvFianzas.Update()
'End Sub
Protected Sub imgEFianzaGv_Click(sender As Object, e As EventArgs) Protected Sub imgEFianzaGv_Click(sender As Object, e As EventArgs)
LimpiarCamposModalFianzas() LimpiarCamposModalFianzas()
EsEditarFianza = True EsEditarFianza = True
@@ -4019,12 +3745,10 @@ Partial Class Contratos_ContratoObra
LnkDescargar.Visible = GvRow.DataKey("Adjunto").ToString <> "" LnkDescargar.Visible = GvRow.DataKey("Adjunto").ToString <> ""
txth4Fianza.InnerText = "Editar Fianza" txth4Fianza.InnerText = "Editar Fianza"
'BtnGuardarFianza.Text = "Actualizar"
UPModalFianza.Update() UPModalFianza.Update()
Me.RegistraScript("$('#DvModalFianza').modal();") Me.RegistraScript("$('#DvModalFianza').modal();")
'GvFianzas.DataSource = DtTmpFianzas
'GvFianzas.DataBind()
'UpGvFianzas.Update()
End Sub End Sub
Protected Sub CreaDtTmpFianzas() Protected Sub CreaDtTmpFianzas()
DtTmpFianzas = New DataTable() DtTmpFianzas = New DataTable()
@@ -4039,9 +3763,6 @@ Partial Class Contratos_ContratoObra
DtTmpFianzasInicial = DtTmpFianzas.Copy DtTmpFianzasInicial = DtTmpFianzas.Copy
'GvFianzas.DataSource = DtTmpFianzas
'GvFianzas.DataBind()
'UpGvFianzas.Update()
End Sub End Sub
Protected Function GuardaFianzas(ObjContrato As ClsContratos) As Boolean Protected Function GuardaFianzas(ObjContrato As ClsContratos) As Boolean
@@ -4853,9 +4574,65 @@ Partial Class Contratos_ContratoObra
End Sub End Sub
Private Sub Indicadores()
Dim Con As New ClsContratos
Dim DTDatos As New DataTable
If Con.GetContratosObraRepAvances(MinFecha, MaxFecha, DdlCliente.SelectedValue.ToEntero, CveContrato, UsuarioActual.CveEmpresa) Then
DTDatos = Con.DtResultados
End If
Con.Dispose()
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 = (ImporteAvance * 100 / TotalAvanceVentas).RoundSQL(2)
Dim CantidadInterno As Decimal = DTDatos.Rows(0)("CantidadInterno").ToString.ToDecimal
Dim ImporteInterno As Decimal = DTDatos.Rows(0)("ImporteInterno").ToString.ToDecimal
Dim TotalFaltantePorcentaje As Decimal = (ImporteInterno * 100 / TotalAvanceInterno).RoundSQL(2)
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}%")
End If
'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")
DVGraficas.Visible = True
UpGrafica.Update()
End Sub
End Class End Class

View File

@@ -0,0 +1,324 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="ContratoObraAutorizacion.aspx.vb" Inherits="Contratos_ContratoObraAutorizacion" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" Runat="Server">
<style>
table.GVEstimacion{
width:100%;
}
.txtimporte{
background: transparent;
border: none;
}
.txtcant,.txtimporte,
table.GVEstimacion > tbody > tr > td,
table.GVEstimacion > tbody > tr > th{
text-align:right;
}
table.GVEstimacion > tbody > tr > th,
table.GVEstimacion > tbody > tr > td{
width:100px;
}
table.GVEstimacion > tbody > tr > th:nth-child(1),
table.GVEstimacion > tbody > tr > td:nth-child(1){
width:300px;
text-align:left;
}
.ddls {
max-width:220px;
}
.linkfile input{
display:none
}
</style>
<link href="/Metronic/assets/global/plugins/dropzone/css/dropzone.css" rel="stylesheet"/>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<ajax:TabContainer ID="Tab" runat="server" Width="100%" CssClass="tabBodyOverride" ActiveTabIndex="0">
<ajax:TabPanel ID="TabEstimación" runat="server" HeaderText="Estimación">
<ContentTemplate>
<asp:UpdatePanel runat="server" ID="UpEstimaciones" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultarEstimaciones" runat="server" Text="Consultar" class="btn btn-default" />
</div>
<div class="titlefiltros caption" style="position: relative;">
<asp:UpdatePanel class="row" ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<label class="col-md-1 truncate">Contrato:</label>
<div class="col-md-6 col-lg-4">
<div class="ddls">
<asp:DropDownList ID="DDlContratosEstimaciones" runat="server" DataTextField="ContratoCompleto" DataValueField="CveContrato" Class=" form-control input-inline select2me" Width="100%">
</asp:DropDownList>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<asp:GridView ID="GvEstimaciones" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron partidas para levantar avance"
DataKeyNames="CveContratoAvance,CveFamilias,CveSubFamilias,CveContratoDetalle,PS,Cantidad,Importe,Cantidad_Ultima,Importe_Ultima,PU,CantidadMax,Avance,Fecha,CveEstimacion"
CssClass="table GVEstimacion table-advance table-hover mysmallbtn" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="" ItemStyle-Width="60%">
<ItemTemplate>
<asp:LinkButton ID="Producto" runat="server" CssClass="Texto" Text='<%# Eval("PS")%>' Visible="false" ></asp:LinkButton>
<asp:Label ID="LinkButton1" runat="server" CssClass="Texto" Text='<%# Eval("PS")%>' ></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cantidad">
<ItemTemplate>
<span><%# Eval("Cantidad", "{0:N2}")%></span>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Importe">
<ItemTemplate>
<span><%# Eval("Importe", "{0:N2}")%></span>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cantidad">
<ItemTemplate>
<span><%# Eval("Cantidad_Ultima", "{0:N2}")%></span>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Importe">
<ItemTemplate>
<span><%# Eval("Importe_Ultima", "{0:N2}")%></span>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Acciones">
<ItemTemplate>
<table style="width:120px!important">
<tr>
<td>
<asp:LinkButton ID="LnkAnexo" runat="server" OnClick="GetAnexos" AlternateText="Agregar Anexo" CssClass="btn btn-circle btn-sm btn-success anexo" Text="<i class='fa fa-folder'></i>" Visible="false" />
</td>
<td>
<asp:LinkButton ID="LnkEliminarAvance" runat="server" OnClick="LnkEliminarAvance_Click" AlternateText="Agregar Anexo" Visible="false"
CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Confimra la elimiancion del avance?" data-btn-ok-label="si"
/>
</td>
</tr>
</table>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="text-center">
<asp:Button id="BtnAutoriza" CssClass="btn btn-primary" runat="server" Text="Autorizar" Visible="false" OnClick="BtnAutoriza_Click" />
<asp:Button id="BtnGuardarEstimacion" CssClass="btn btn-primary" runat="server" Text="Generar Estimacion" Visible="false"/>
<asp:Button id="BtnDescargarGenerado" CssClass="btn btn-primary" runat="server" Text="Descarga Generador" Visible="false"/>
</div>
</div>
</div>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="BtnDescargarGenerado" />
</Triggers>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>
<div class="modal fade " id="dropmodal">
<div class="modal-dialog">
<div class="modal-content ">
<div class="portlet light smmallpadding bordered ">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Cargar Evidencia</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
<a href="javascript:$('#dropmodal').modal('hide');" style="color:gray;" ><i class="fa fa-remove"></i></a>
</div>
</div>
<div class="portlet-body ">
<div id="my-dropzone" class="">
</div>
</div>
<div style="text-align: center!important">
<br />
<button id="btnCerrarModal" runat="server" type="button" class="btn default" data-dismiss="modal">Cerrar</button>
<br />
</div>
</div>
</div>
</div>
</div>
<div id="ModalAnexos" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<asp:UpdatePanel ID="UpModalAnexos" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">
<asp:Label runat="server" ID="LblTituloModalAnexo"></asp:Label></h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12" style="text-align:center!important;text-align:center!important" >
<asp:GridView ID="GvAnexos" AutoGenerateColumns="false" runat="server" ShowHeaderWhenEmpty="true" EmptyDataText="No se encontraron archivos" Width="250px"
DataKeyNames="Archivo" CssClass="table GVEstimacion table-advance table-hover" GridLines ="None">
<Columns>
<asp:TemplateField HeaderText="Anexos">
<ItemTemplate>
<asp:LinkButton ID="LnkArchivo" runat="server" OnClick="LnkArchivo_Click"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</div>
<div class="modal-footer">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<script src="/Metronic/assets/global/plugins/dropzone/dropzone.js"></script>
<%--<script src="../Scripts/dropzone/dropzone.min.js"></script>--%>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" Runat="Server">
<script>
jQuery(document).ready(function () {
$(".linkfile").click(function () {
showmodalFile($(this).find('input').attr('id'));
});
Sys.Application.add_load(function (s, e) {
$(".linkfile").click(function () {
showmodalFile($(this).find('input').attr('id'));
});
});
});
function showmodalFile(obj) {
$('#' + obj).data("append", 'my-dropzone');<% Dim url = Request.Url.AbsoluteUri.Replace(Request.Url.AbsolutePath, "")%>
$('#' + obj).data("urlup", '<%= url%>/Ashx/SIGWeb.ashx?Metodo=Uploadfile');
$('#' + obj).data("urldown", '<%= url%>/Ashx/SIGWeb.ashx');
$('#' + obj).data("urlget", '<%= url %>/Temp/');
ADDropzone(obj);
$('#dropmodal').modal();
}
function ValidateCant(variable) {
var txt = $(variable);
var max = txt.data('cantidad');
var value = parseInt(txt.val());
if (value > max) {
txt.val(max);
}
if (value < 0) {
txt.val(0);
}
var importe = $('.txtimporte[data-cve="' + txt.data('cve') + '"]');
importe.val(parseFloat(txt.val()) * parseFloat(txt.data('pu')));
//FormatoMoneda2(importe);
//if (parseInt(txt.val()) > 0) {
// $($(txt.parent()).parent()).find(".linkfile").removeClass("hidden");
//} else {
// var ocultar = $($(txt.parent()).parent()).find(".linkfile");
// if (!ocultar.hasClass("hidden")) {
// ocultar.addClass("hidden");
// }
//}
}
//);
</script>
</asp:Content>

View File

@@ -0,0 +1,690 @@
Option Explicit On
Option Strict On
Imports Extensiones
Imports System.IO
Imports System.Data
Imports Newtonsoft.Json
Imports ClosedXML.Excel
Partial Class Contratos_ContratoObraAutorizacion
Inherits ClsPaginas
#Region "Propiedades"
Private Property DtDatos As DataTable
Get
If ViewState("DtDatos") Is Nothing Then
Return Nothing
Else
Return CType(ViewState("DtDatos"), DataTable)
End If
End Get
Set(value As DataTable)
ViewState("DtDatos") = value
End Set
End Property
Private Property CveContrato As Integer
Get
If ViewState("CveContrato") Is Nothing Then
Return Nothing
Else
Return ViewState("CveContrato").ToString.ToEntero
End If
End Get
Set(value As Integer)
ViewState("CveContrato") = value
End Set
End Property
Private Property CveContratoEstimacion As Integer
Get
If ViewState("CveContratoEstimacion") Is Nothing Then
Return Nothing
Else
Return ViewState("CveContratoEstimacion").ToString.ToEntero
End If
End Get
Set(value As Integer)
ViewState("CveContratoEstimacion") = value
End Set
End Property
'fecha seleccionada del historico de avances
Private Property fecha As String
Get
If ViewState("fecha") Is Nothing Then
Return ""
Else
Return ViewState("fecha").ToString
End If
End Get
Set(value As String)
ViewState("fecha") = value
End Set
End Property
Property CveEstimacionNueva As Integer
Get
If ViewState("CveEstimacionNueva") Is Nothing Then
Return -1
Else
Return ViewState("CveEstimacionNueva").ToString.ToEntero
End If
End Get
Set(value As Integer)
ViewState("CveEstimacionNueva") = value
End Set
End Property
Property NuemeroEstimacionNuevo As Integer
Get
If ViewState("NuemeroEstimacionNuevo") Is Nothing Then
Return -1
Else
Return ViewState("NuemeroEstimacionNuevo").ToString.ToEntero
End If
End Get
Set(value As Integer)
ViewState("NuemeroEstimacionNuevo") = value
End Set
End Property
Property CveEstimacionActual As Integer
Get
If ViewState("CveEstimacionActual") Is Nothing Then
Return -1
Else
Return ViewState("CveEstimacionActual").ToString.ToEntero
End If
End Get
Set(value As Integer)
ViewState("CveEstimacionActual") = value
End Set
End Property
Property NuemeroEstimacionActual As Integer
Get
If ViewState("NuemeroEstimacionActual") Is Nothing Then
Return -1
Else
Return ViewState("NuemeroEstimacionActual").ToString.ToEntero
End If
End Get
Set(value As Integer)
ViewState("NuemeroEstimacionActual") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
CargaContrato()
End If
End Sub
Private Sub CargaContrato()
DDlContratosEstimaciones.DataSource = GlobalDTContratos.FiltraParametros(String.Format($"CveContratoTipo in (30,31) AND CveEmpresa = {UsuarioActual.CveEmpresa}"))
DDlContratosEstimaciones.DataBind()
End Sub
Protected Sub GetAnexos(sender As Object, e As System.EventArgs)
Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
LblTituloModalAnexo.Text = "Anexo " & GvRow.DataKey("PS")
'Get the button that raised the event
Dim btn As LinkButton = DirectCast(sender, LinkButton)
Dim gvr As GridViewRow = DirectCast(btn.NamingContainer, GridViewRow)
Dim CveContratoDetalle As Integer = gvr.DataKey("CveContratoDetalle").ToString.ToEntero
Dim CveContratoAvance As Integer = gvr.DataKey("CveContratoAvance").ToEntero
Dim Fecha As Date = gvr.DataKey("Fecha").ToDate
Dim objContrato As New ClsContratos
If objContrato.GetContratosAvanceAnexos(CveContratoDetalle, UsuarioActual.CveUsuario, CveContratoAvance:=CveContratoAvance) Then
GvAnexos.DataSource = objContrato.DtResultados
GvAnexos.DataBind()
GvAnexos.Visible = True
Else
GvAnexos.Visible = False
End If
objContrato.Dispose()
UpModalAnexos.Update()
RegistraScript("$('#ModalAnexos').modal('show');")
End Sub
Protected Sub GvAnexos_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs) Handles GvAnexos.RowDataBound
If e.Row.RowIndex > -1 Then
Dim Archivo As String = e.Row.DBCampo("Archivo").ToString
Dim start As Integer = Len(Archivo.Split("-"c)(0))
Dim LnkArchivo As LinkButton = e.Row.FCLinkButton("LnkArchivo")
LnkArchivo.Text = Archivo.Substring(start + 1)
ScriptManager.GetCurrent(Me).RegisterPostBackControl(LnkArchivo)
End If
End Sub
Protected Sub LnkArchivo_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
Dim Archivo As String = GvRow.DataKey("Archivo").ToString
Response.ContentType = "application/octet-stream"
Response.AppendHeader("Content-Disposition", $"attachment; filename={Archivo}")
Response.TransmitFile($"{UsuarioActual.Empresa.Ruta}\Contrato\{DDlContratosEstimaciones.SelectedValue.ToEntero}\Anexos\{Archivo}")
Response.End()
End Sub
#Region "ESTIMACION"
Private Sub CargaAvancesParaEstimar()
CveContratoEstimacion = -1
Dim ObjContratos As New ClsContratos()
Dim DTEstimaciones As New DataTable
Dim NumeroEstimacionActual As Integer = 0
If ObjContratos.GetContratosAvanceEstimacion(DDlContratosEstimaciones.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, -1) Then
DTEstimaciones = ObjContratos.DtResultados
CveContratoEstimacion = DDlContratosEstimaciones.SelectedValue.ToEntero
If DTEstimaciones.Rows.Count > 0 Then
CveEstimacionActual = DTEstimaciones.FiltroPrimeroValor("CveEstimacion", "CveEstimacion > 0").ToString.ToEntero
End If
End If
ObjContratos.Dispose()
If DTEstimaciones.Rows.Count > 0 Then
GvEstimaciones.DataSource = DTEstimaciones
' BtnGuardarEstimacion.Visible = True
BtnAutoriza.Visible = True
Else
GvEstimaciones.DataSource = Nothing
BtnGuardarEstimacion.Visible = False
End If
GvEstimaciones.DataBind()
UpEstimaciones.Update()
End Sub
Private Sub BtnConsultarEstimaciones_Click(sender As Object, e As EventArgs) Handles BtnConsultarEstimaciones.Click
CargaAvancesParaEstimar()
End Sub
Private Sub GvEstimaciones_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvEstimaciones.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("CveContratoDetalle").ToString.ToEntero = 0 Then
If e.Row.DBCampo("CveSubFamilias").ToString.ToEntero = 0 Then
If e.Row.DBCampo("CveFamilias").ToString.ToEntero = 0 Then
e.Row.CssClass = "SubTotales"
Else
e.Row.CssClass = "SubTotales2"
End If
Else
e.Row.CssClass = "SubTotales3"
End If
End If
If e.Row.DBCampo("CveContratoDetalle").ToString.ToEntero > 0 Then
Dim LnkAnexo As LinkButton = e.Row.FCLinkButton("LnkAnexo")
Dim LnkEliminarAvance As LinkButton = e.Row.FCLinkButton("LnkEliminarAvance")
LnkAnexo.Visible = True
LnkEliminarAvance.Visible = True
End If
End If
End Sub
Private Sub BtnGuardarEstimacion_Click(sender As Object, e As EventArgs) Handles BtnGuardarEstimacion.Click
CveEstimacionNueva = -1
NuemeroEstimacionNuevo = -1
Dim ObjContratos As New ClsContratos()
Dim ErrorProceso As Boolean = False
ObjContratos.IniciaTransacSQL()
If ObjContratos.AddContratosAvanceEstimacion(CveContratoEstimacion, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
CveEstimacionNueva = ObjContratos.CveEstimacionNueva
NuemeroEstimacionNuevo = ObjContratos.NumeroEstimacionNueva
For Each GvRow As GridViewRow In GvEstimaciones.Rows
If GvRow.DataKey("CveContratoAvance").ToEntero > 0 Then
If Not ObjContratos.UpdateContratosAvanceEstimacion(GvRow.DataKey("CveContratoAvance").ToEntero, ObjContratos.CveEstimacionNueva, UsuarioActual.CveEmpresa) Then
ErrorProceso = True
Exit For
End If
End If
Next
Else
ErrorProceso = True
End If
'AddContratosAvanceEstimacion
'UpdateContratosAvanceEstimacion
If Not ErrorProceso Then
ObjContratos.Commit()
Alert($"Estimación {NuemeroEstimacionNuevo} agregada correctamente.")
BtnGuardarEstimacion.Visible = False
BtnDescargarGenerado.Visible = True
Else
ObjContratos.RollBack()
End If
ObjContratos.Dispose()
UpEstimaciones.Update()
End Sub
Private Sub BtnDescargarGenerado_Click(sender As Object, e As EventArgs) Handles BtnDescargarGenerado.Click
GeneraAnexo(CveEstimacionNueva, NuemeroEstimacionNuevo, Now, DDlContratosEstimaciones.SelectedItem.Text)
End Sub
Private Sub GeneraAnexo(CveEstimacion As Integer, NumeroEstimacion As Integer, FechaEstimacion As Date, NumeroContrato As String)
Dim PlantillaAnexo As String = $"{UsuarioActual.Empresa.Ruta}\Formatos\Anexo.xlsx"
If Not System.IO.File.Exists(PlantillaAnexo) Then
Alert("No se encuentra la platilla de anexos.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim DtControl As New DataTable
Dim ObjContratos As New ClsContratos
Dim Lugar As String = ""
Dim DescripcionContrato As String = ""
If ObjContratos.GetContratosObraAvancesControlAcumulativo(CveContrato, CveEstimacion, UsuarioActual.CveEmpresa) Then
DtControl = ObjContratos.DtResultados
If DtControl.Rows.Count > 0 Then
Lugar = DtControl(0)("Lugar").ToString
DescripcionContrato = DtControl(0)("DescripcionContrato").ToString
End If
End If
ObjContratos.Dispose()
If DtControl.Rows.Count > 0 Then
Dim WBAnexo = New ClosedXML.Excel.XLWorkbook(PlantillaAnexo)
Dim WBAnexoSalvar = New ClosedXML.Excel.XLWorkbook
Dim WSControl = WBAnexo.Worksheet(1)
Dim WSDetalle = WBAnexo.Worksheet(2)
Dim CuerrentRow As Integer = 28
WSControl.Cell(17, 2).Value = NumeroEstimacion 'Estimacion
WSControl.Cell(20, 9).Value = FechaEstimacion.ToString("dd/MM/yyyy") 'Fecha estimacion
WSControl.Cell(19, 8).Value = "$ " & DtControl.SUM("Importe").ToString("###,###,###.00") 'Total
WSControl.Cell(19, 8).Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Right)
WSControl.Cell(20, 6).Value = NumeroContrato
WSControl.Cell(18, 2).Value = Lugar
WSControl.Cell(18, 2).Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Left)
WSControl.Cell(18, 2).Style.Alignment.SetVertical(XLAlignmentVerticalValues.Top)
WSControl.Cell(17, 6).Value = "" 'Periodo Fecha Inicial
WSControl.Cell(17, 7).Value = "" 'Periuodo Fecha Final
WSControl.Cell(20, 2).Value = DescripcionContrato
WSControl.Cell(20, 2).Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Left)
WSControl.Cell(20, 2).Style.Alignment.SetVertical(XLAlignmentVerticalValues.Top)
WSControl.Cell(22, 7).Value = "" 'Presupuesto segun contrato
WSControl.Cell(19, 5).Value = "" 'Contrtatista
Dim RowCountControl As Integer = 1
For Each Drow As DataRow In DtControl.Rows
WSControl.Cell(CuerrentRow, 1).Value = Drow("Codigo").ToString
WSControl.Cell(CuerrentRow, 2).Value = Drow("PS").ToString
WSControl.Cell(CuerrentRow, 3).Value = Drow("Abreviatura").ToString
WSControl.Cell(CuerrentRow, 4).Value = Drow("Cantidad").ToString.ToDecimal
WSControl.Cell(CuerrentRow, 5).Value = Drow("AcumuladoTotal").ToString.ToDecimal
WSControl.Cell(CuerrentRow, 6).Value = Drow("AcumuladoAnterior").ToString.ToDecimal
WSControl.Cell(CuerrentRow, 7).Value = Drow("CantidadActual").ToString.ToDecimal
WSControl.Cell(CuerrentRow, 8).Value = Drow("PU").ToString.ToDecimal
WSControl.Cell(CuerrentRow, 9).Value = Drow("Total").ToString.ToDecimal
WSControl.Cell(CuerrentRow, 9).Style.NumberFormat.Format = "$ ###,###,###.00"
WSControl.Cell(CuerrentRow, 1).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 2).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 3).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 4).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 5).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 6).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 7).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 8).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 9).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 1).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 2).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 3).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 4).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 5).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 6).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 7).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 8).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 9).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Medium
'ultimo Row
If DtControl.Rows.Count = RowCountControl Then
WSControl.Cell(CuerrentRow + 1, 1).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 2).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 3).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 4).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 5).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 6).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 7).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 8).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 9).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 1).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 2).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 3).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 4).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 5).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 6).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 7).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 8).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 9).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Medium
WSControl.Cell(CuerrentRow + 1, 8).Value = "Total:"
WSControl.Cell(CuerrentRow + 1, 8).Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Right)
WSControl.Cell(CuerrentRow + 1, 8).Style.Font.Bold = True
WSControl.Cell(CuerrentRow + 1, 9).Value = DtControl.SUM("Total")
WSControl.Cell(CuerrentRow + 1, 9).Style.Font.Bold = True
WSControl.Cell(CuerrentRow + 1, 9).Style.NumberFormat.Format = "$ ###,###,###.00"
Dim range = WSControl.Range($"A{CuerrentRow + 3}:D{CuerrentRow + 3}")
range.Merge()
range.Style.Border.TopBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
range.Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
range.Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
range.Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Center)
range = WSControl.Range($"E{CuerrentRow + 3}:I{CuerrentRow + 3}")
range.Merge()
range.Style.Border.TopBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
range.Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
range.Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Medium
range.Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Center)
range = WSControl.Range($"A{CuerrentRow + 4}:D{CuerrentRow + 4}")
range.Merge()
range.Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
range.Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
range.Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Center)
range.Value = "ING. WALTER ROBERTO VILLEGAS LARES"
range = WSControl.Range($"E{CuerrentRow + 4}:I{CuerrentRow + 4}")
range.Merge()
range.Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
range.Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Medium
range.Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Center)
range.Value = "C. SALVADOR SUAREZ"
range = WSControl.Range($"A{CuerrentRow + 5}:D{CuerrentRow + 5}")
range.Merge()
range.Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
range.Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
range.Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Center)
range.Value = "SERVICIOS ELECTRICOS Y CONTROL DE HERMOSILLO S.A. DE C.V."
range.Style.Font.Bold = True
range = WSControl.Range($"E{CuerrentRow + 5}:I{CuerrentRow + 5}")
range.Merge()
range.Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
range.Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Medium
range.Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Center)
range.Value = "GASERVICIO MATAMOROS SA DE CV"
range.Style.Font.Bold = True
End If
CuerrentRow = CuerrentRow + 1
RowCountControl = RowCountControl + 1
Next
WBAnexo.Worksheet(1).CopyTo(WBAnexoSalvar, "CONTROL")
For Each Drow As DataRow In DtControl.Rows
If Drow("CantidadActual").ToString.ToDecimal > 0 Then
WSDetalle.Cell(3, 6).Value = NumeroContrato
WSDetalle.Cell(4, 9).Value = "" 'Fecha de
WSDetalle.Cell(4, 10).Value = "" 'Fecha a
WSDetalle.Cell(4, 11).Value = NumeroEstimacion
WSDetalle.Cell(6, 6).Value = DescripcionContrato
WSDetalle.Cell(14, 2).Value = Drow("Codigo").ToString
WSDetalle.Cell(14, 3).Value = Drow("PS").ToString
WSDetalle.Cell(14, 4).Value = Drow("Abreviatura").ToString
WSDetalle.Cell(12, 3).Value = "" 'Concepto
WSDetalle.Cell(14, 10).Value = Drow("CantidadActual").ToString.ToDecimal
WSDetalle.Cell(14, 11).Value = Drow("CantidadActual").ToString.ToDecimal
'WSDetalle.Cell(61, 6).Value = "" 'Empresario
WSDetalle.Cell(61, 9).Value = Drow("Nombre").ToString 'Cliente
Dim objContrato As New ClsContratos
Dim DTArchivos As New DataTable
If objContrato.GetContratosAvanceAnexos(Drow("CveContratoDetalle").ToString.ToEntero, UsuarioActual.CveUsuario, CveEstimacion:=CveEstimacion) Then
DTArchivos = objContrato.DtResultados
End If
objContrato.Dispose()
Dim Imagenes As New List(Of ClosedXML.Excel.Drawings.IXLPicture)
Dim CurrectRowImg As Integer = 19 'Row 19 primera imggen
Dim RowH As Double = WSDetalle.Row(19).Height
For Each drowArchivos As DataRow In DTArchivos.Rows
Dim Archivo As String = ""
Archivo = drowArchivos("Archivo").ToString
Dim RutaArchivo As String = $"{UsuarioActual.Empresa.Ruta}\Contrato\{CveContrato}\Anexos\{Archivo}"
If File.Exists(RutaArchivo) Then
Dim Imagen = WSDetalle.AddPicture(RutaArchivo).MoveTo(WSDetalle.Cell(CurrectRowImg, 3))
Imagen.Scale(WSDetalle.Column(3).Width / (Imagen.OriginalWidth * 0.145D))
Dim ImgWidth As Double = Imagen.Height
Dim nRowmas As Integer = (ImgWidth / RowH).ToEntero
CurrectRowImg = CurrectRowImg + nRowmas
Imagenes.Add(Imagen)
End If
Next
WBAnexo.Worksheet(2).CopyTo(WBAnexoSalvar, If(Drow("Codigo").ToString.Trim.Length > 0, Drow("Codigo").ToString, Drow("CvePS").ToString))
For Each img As ClosedXML.Excel.Drawings.IXLPicture In Imagenes
img.Delete()
Next
End If
Next
Dim msB = New MemoryStream()
WBAnexoSalvar.SaveAs(msB)
Dim BB As Byte() = msB.ToArray
msB.Dispose()
Response.Clear()
Response.Buffer = True
Response.AddHeader("content-disposition", "attachment; filename=Anexo_Estimacion" & NumeroEstimacion & ".xlsx")
Response.ContentType = "application/vnd.ms-excel"
Response.BinaryWrite(BB)
Response.End()
Else
Alert("No se encontraron datos des control", TipoMensaje.MsgAdvertencia)
End If
End Sub
#End Region
Protected Sub LnkEliminarAvance_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
Dim CveContratoAvance As Integer = GvRow.DataKey("CveContratoAvance").ToEntero
Dim ErrorProceso As Boolean = True
Dim ObjContrato As New ClsContratos
If ObjContrato.RemoveContratosAvance(CveContratoAvance, UsuarioActual.CveEmpresa) Then
ErrorProceso = False
End If
ObjContrato.Dispose()
If Not ErrorProceso Then
CargaAvancesParaEstimar()
Alert("Avance elimiando correctamente.")
End If
End Sub
Protected Sub BtnAutoriza_Click(sender As Object, e As EventArgs)
Dim ErrorProceso As Boolean = True
Dim ObjContrato As New ClsContratos
If ObjContrato.UpdateContratosEstimacion(CveEstimacionActual, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 3) Then
ErrorProceso = False
End If
ObjContrato.Dispose()
If Not ErrorProceso Then
CveEstimacionActual = -1
CargaAvancesParaEstimar()
Alert("Avance autorizado correctamente.")
End If
End Sub
End Class

View File

@@ -43,7 +43,7 @@
<div class="col-md-12"> <div class="col-md-12">
<asp:GridView ID="GVDatos" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron contratos con los Filtros seleccionados" <asp:GridView ID="GVDatos" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron contratos con los Filtros seleccionados"
DataKeyNames="CveContrato,CveEstimacion,Fecha,PS,CveContratoDetalle" ShowHeader="True" DataKeyNames="CveContrato,CveContratoAvance,CveEstimacion,Fecha,PS,CveContratoDetalle" ShowHeader="True"
CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn" GridLines="None"> CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn" GridLines="None">
<Columns> <Columns>
<asp:TemplateField HeaderText="Producto"> <asp:TemplateField HeaderText="Producto">

View File

@@ -113,8 +113,10 @@ Partial Class RepContratosObraAvancesPartida
Dim CveEstimacion As Integer = GvRow.DataKey("CveEstimacion").ToEntero Dim CveEstimacion As Integer = GvRow.DataKey("CveEstimacion").ToEntero
Dim CveContratoDetalle As Integer = GvRow.DataKey("CveContratoDetalle").ToEntero Dim CveContratoDetalle As Integer = GvRow.DataKey("CveContratoDetalle").ToEntero
Dim CveContratoAvance As Integer = GvRow.DataKey("CveContratoAvance").ToEntero
Dim objContrato As New ClsContratos Dim objContrato As New ClsContratos
If objContrato.GetContratosAvanceAnexos(CveContratoDetalle, Fecha, UsuarioActual.CveUsuario, CveEstimacion:=CveEstimacion) Then If objContrato.GetContratosAvanceAnexos(CveContratoDetalle, Fecha, UsuarioActual.CveUsuario, CveEstimacion:=CveEstimacion, CveContratoAvance:=CveContratoAvance) Then
GvAnexos.DataSource = objContrato.DtResultados GvAnexos.DataSource = objContrato.DtResultados
GvAnexos.DataBind() GvAnexos.DataBind()
GvAnexos.Visible = True GvAnexos.Visible = True
@@ -150,11 +152,18 @@ Partial Class RepContratosObraAvancesPartida
Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow) Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
Dim Archivo As String = GvRow.DataKey("Archivo").ToString Dim Archivo As String = GvRow.DataKey("Archivo").ToString
Dim FI As New IO.FileInfo($"{UsuarioActual.Empresa.Ruta}\Contrato\{CveContrato}\Anexos\{Archivo}")
If FI.Exists Then
Response.ContentType = "application/octet-stream"
Response.AppendHeader("Content-Disposition", $"attachment; filename={Archivo}")
Response.TransmitFile(FI.FullName)
Response.End()
End If
Response.ContentType = "application/octet-stream"
Response.AppendHeader("Content-Disposition", $"attachment; filename={Archivo}")
Response.TransmitFile($"{UsuarioActual.Empresa.Ruta}\Contrato\{CveContrato}\Anexos\{Archivo}")
Response.End()
End Sub End Sub

View File

@@ -311,8 +311,7 @@ Partial Class GPS_RepCombustible
End Sub End Sub
Protected Sub Lnkreportegral_Click(sender As Object, e As EventArgs) Protected Sub Lnkreportegral_Click(sender As Object, e As EventArgs)
Dim GloBalFileUrl As String = HttpContext.Current.Server.MapPath("~") Dim file As String = $"{DirectorioBaseEmpresas}Empresas\Grales\Formatos\CombustibleGeneral.xlsx"
Dim file As String = $"{GloBalFileUrl}Empresas\Grales\Formatos\CombustibleGeneral.xlsx"
Try Try
Dim wb As New ClosedXML.Excel.XLWorkbook(file) Dim wb As New ClosedXML.Excel.XLWorkbook(file)
Dim libro = wb.Worksheets(0) Dim libro = wb.Worksheets(0)

View File

@@ -27,6 +27,7 @@
CssClass="table table-striped table-advance table-hover ScrollAD mysmallbtn" data-sort="true" Width="100%" GridLines="None"> CssClass="table table-striped table-advance table-hover ScrollAD mysmallbtn" data-sort="true" Width="100%" GridLines="None">
<Columns> <Columns>
<asp:BoundField DataField="Codigo" HeaderText="Código" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField DataField="Codigo" HeaderText="Código" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Marca" HeaderText="Marca" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Modelo" HeaderText="Modelo" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField DataField="Modelo" HeaderText="Modelo" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="EstatusTexto" HeaderText="Estatus" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField DataField="EstatusTexto" HeaderText="Estatus" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="FechaIng" ItemStyle-Width="15%" HeaderText="Fecha de Ingreso" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" /> <asp:BoundField DataField="FechaIng" ItemStyle-Width="15%" HeaderText="Fecha de Ingreso" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />

View File

@@ -853,7 +853,7 @@ Partial Class General_SaldosIniciales
If Codigo.Length > 0 Then If Codigo.Length > 0 Then
If ObjPS.AddPS(CveClasificacion, 1, CveUnidadMedida, Codigo, "", CodigoBarras, Descripcion, Precio, 0, 0, False, 0, False, True, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, 1, If ObjPS.AddPS(CveClasificacion, 1, CveUnidadMedida, Codigo, "", CodigoBarras, Descripcion, Precio, -1, 0, False, 0, False, True, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, 1,
CveTipoPS:=CveTipoPS, CveSATPS:=CveSATPS, CveMarca:=CveMarca, CveTamaño:=CveTamaño, CveMedida:=CveMedida, CveRinTamaño:=CveRinTamaño, CveTipoPS:=CveTipoPS, CveSATPS:=CveSATPS, CveMarca:=CveMarca, CveTamaño:=CveTamaño, CveMedida:=CveMedida, CveRinTamaño:=CveRinTamaño,
CveModelo:=CveModelo, Litraje:=Litraje, IEPSPorcentaje:=IEPS, CveClasificacion2:=CveClasificacion2, CveClasificacionDetalle:=CveClasificacionDetalle) <= 0 Then CveModelo:=CveModelo, Litraje:=Litraje, IEPSPorcentaje:=IEPS, CveClasificacion2:=CveClasificacion2, CveClasificacionDetalle:=CveClasificacionDetalle) <= 0 Then
'If ObjPS.AddPS(CveClasificacion, 1, CveUnidadMedida, Codigo, "", "", Descripcion, 0, 0, 0, False, 0, False, True, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, 1, 'If ObjPS.AddPS(CveClasificacion, 1, CveUnidadMedida, Codigo, "", "", Descripcion, 0, 0, 0, False, 0, False, True, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, 1,

View File

@@ -2525,8 +2525,14 @@ Partial Class Inventarios_RecepcionUsados
If RblUsadosAjuste.SelectedValue = "1" Then If RblUsadosAjuste.SelectedValue = "1" Then
'agrego un registro extra del importe de ajuste 'agrego un registro extra del importe de ajuste
Dim PU As Decimal = TxtImporteAjuste.Text.ToDecimal Dim PU As Decimal = TxtImporteAjuste.Text.ToDecimal
Dim CveSATNC As String = "84111506" 'CONSULTA EL CONCEPTO DE NC
Dim Dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, SATClavePS:=CveSATNC, AplicaParaVenta:=1).FiltroPrimero("") Dim ArrayNC As String() = UsuarioActual.Empresa.Funcionalidad(591).Split(",".ToCharArray())
Dim NCAjuste As Integer = -1
If ArrayNC.Length > 5 Then
NCAjuste = ArrayNC(5).ToEntero()
End If
Dim Dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=NCAjuste, AplicaParaVenta:=1).FiltroPrimero("")
If Dr IsNot Nothing Then If Dr IsNot Nothing Then
Dim CveUnidadMedida, CveClasificacion, CvePS As Integer Dim CveUnidadMedida, CveClasificacion, CvePS As Integer
@@ -2534,7 +2540,7 @@ Partial Class Inventarios_RecepcionUsados
CveClasificacion = Dr("CveClasificacion").ToString.ToEntero CveClasificacion = Dr("CveClasificacion").ToString.ToEntero
CvePS = Dr("CvePS").ToString.ToEntero CvePS = Dr("CvePS").ToString.ToEntero
Dim PorcentajeIVA As Decimal = 0.16D Dim PorcentajeIVA As Decimal = 0.16D
Dim Obs As String = "Descuento por garantía" Dim Obs As String = $"Descuento por garantía. BCI: {DdlBCIAjuste.SelectedValue}"
AddPSRNC(ObjRemisionNC.DtDetalle, 1, CveUnidadMedida, "", CveClasificacion, "", CvePS, "", Obs, PU, 0, -1, "", AddPSRNC(ObjRemisionNC.DtDetalle, 1, CveUnidadMedida, "", CveClasificacion, "", CvePS, "", Obs, PU, 0, -1, "",
ObjRemisionNC.CveSubProyecto, ObjRemisionNC.SubProyecto.SubProyecto, PorcentajeIVA:=PorcentajeIVA) ObjRemisionNC.CveSubProyecto, ObjRemisionNC.SubProyecto.SubProyecto, PorcentajeIVA:=PorcentajeIVA)
@@ -2806,13 +2812,6 @@ Partial Class Inventarios_RecepcionUsados
Dim ClasificacionPS As String = GlobalDTClasificaciones(CveEmpresa:=UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacionPS).FiltroPrimeroValor("Clasificacion").ToString() Dim ClasificacionPS As String = GlobalDTClasificaciones(CveEmpresa:=UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacionPS).FiltroPrimeroValor("Clasificacion").ToString()
Select Case TipoFolio Select Case TipoFolio
Case "GENERAL" Case "GENERAL"
'20520 ACUM. AUTOMOTRIZ
'20522 ACUM. ESPECIALES
'20513 ACUM. ESTANDAR
'20521 ACUM. PESADO
'20512 ACUM. PREMIUM
'20514 ACUM. VALUE
'20229 Acumulador
ListaClasificacionesPermitidas.Add(20520) 'ACUM. AUTOMOTRIZ ListaClasificacionesPermitidas.Add(20520) 'ACUM. AUTOMOTRIZ
ListaClasificacionesPermitidas.Add(20522) 'ACUM. ESPECIALES ListaClasificacionesPermitidas.Add(20522) 'ACUM. ESPECIALES
ListaClasificacionesPermitidas.Add(20513) 'ACUM. ESTANDAR ListaClasificacionesPermitidas.Add(20513) 'ACUM. ESTANDAR

View File

@@ -72,11 +72,11 @@ Partial Class OC_CatEstatus
CargaUsuarios() CargaUsuarios()
'SOLO MUESTRA SUBPROYECTO 'SOLO MUESTRA SUBPROYECTO
If UsuarioActual.Empresa.GralSoloProyecto Then
'TdProyecto.Visible = False
'TdSubProyectoTitulo.Visible = False
DivProyecto.Visible = False 'TdProyecto.Visible = False
'TdSubProyectoTitulo.Visible = False
DivProyecto.Visible = False
LblSubproyecto.Visible = False LblSubproyecto.Visible = False
@@ -85,7 +85,7 @@ Partial Class OC_CatEstatus
CboSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1")) CboSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1"))
CboSubProyecto_SelectedIndexChanged(CboSubProyecto, EventArgs.Empty) CboSubProyecto_SelectedIndexChanged(CboSubProyecto, EventArgs.Empty)
End If
chkMostrarLimites.Attributes.Add("onchange", "javascript:chkMostrarLimitesCambio();") chkMostrarLimites.Attributes.Add("onchange", "javascript:chkMostrarLimitesCambio();")
MaintainScrollPositionOnPostBack = True MaintainScrollPositionOnPostBack = True
@@ -614,7 +614,7 @@ Partial Class OC_CatEstatus
'Insertar el nuevo registro 'Insertar el nuevo registro
Else Else
If Not objEstatusOC.AddEstatusUsuarios(CveEstatus, CveSubProyecto, Row.DataKey("CveUsuario").ToString.ToEntero, True) Then If Not objEstatusOC.AddEstatusUsuarios(CveEstatus, CveSubProyecto, Row.DataKey("CveUsuario").ToString.ToEntero, True, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
HuboErrores = True HuboErrores = True
Exit For Exit For
End If End If
@@ -699,6 +699,7 @@ Partial Class OC_CatEstatus
If Not HuboErrores Then If Not HuboErrores Then
objEstatusOC.Commit() objEstatusOC.Commit()
GlobalDTSubProyectosUsuarios(-1, -1, UsuarioActual.CveEmpresa) = Nothing
Alert("Se guardaron los Cambios exitosamente", TipoMensaje.MsgInformacion) Alert("Se guardaron los Cambios exitosamente", TipoMensaje.MsgInformacion)
Else Else
objEstatusOC.RollBack() objEstatusOC.RollBack()

View File

@@ -811,6 +811,7 @@
<ajax:ValidatorCalloutExtender ID="VCORFVSubProyecto" runat="server" HighlightCssClass="vco" TargetControlID="RFVSubProyecto" Width="300px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="VCORFVSubProyecto" runat="server" HighlightCssClass="vco" TargetControlID="RFVSubProyecto" Width="300px"></ajax:ValidatorCalloutExtender>
<div runat="server" id="DVCultivosCuadro" visible ="false"> <div runat="server" id="DVCultivosCuadro" visible ="false">
Cultivo:
<asp:DropDownList ID="DdlCultivosCuadro" CssClass=" form-control input-sm select2me" runat="server" DataTextField="Cuadro" Style="width: 100%; max-width: 600px;" <asp:DropDownList ID="DdlCultivosCuadro" CssClass=" form-control input-sm select2me" runat="server" DataTextField="Cuadro" Style="width: 100%; max-width: 600px;"
DataValueField="CveCultivoCuadroDetalle" ValidationGroup="GrpDetalleGuardar"> DataValueField="CveCultivoCuadroDetalle" ValidationGroup="GrpDetalleGuardar">
</asp:DropDownList> </asp:DropDownList>
@@ -942,8 +943,6 @@
<asp:Literal ID="LtlSubProyecto" runat="server" Text='<%# String.Format("{0}<br/>{1}{2}", Eval("Proyecto"), Eval("SubProyecto"), If(Eval("CveCultivoCuadroDetalle").ToString <> "" And Eval("CveCultivoCuadroDetalle").ToString <> "0" And Eval("CveCultivoCuadroDetalle").ToString <> "-1", String.Format("<br/>{0}", Eval("Cuadro")), "")) %>'></asp:Literal> <asp:Literal ID="LtlSubProyecto" runat="server" Text='<%# String.Format("{0}<br/>{1}{2}", Eval("Proyecto"), Eval("SubProyecto"), If(Eval("CveCultivoCuadroDetalle").ToString <> "" And Eval("CveCultivoCuadroDetalle").ToString <> "0" And Eval("CveCultivoCuadroDetalle").ToString <> "-1", String.Format("<br/>{0}", Eval("Cuadro")), "")) %>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
<EditItemTemplate> <EditItemTemplate>

View File

@@ -801,6 +801,9 @@ Partial Class OC
If UsuarioActual.Empresa.Funcionalidad(590).ToString.ToEntero = 1 Then If UsuarioActual.Empresa.Funcionalidad(590).ToString.ToEntero = 1 Then
DVCultivosCuadro.Visible = True DVCultivosCuadro.Visible = True
DdlSubProyecto.AutoPostBack = True
DdlCultivosCuadro.DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros($"CveSubProyecto = {DdlSubProyecto.SelectedValue}")
DdlCultivosCuadro.DataBind()
DdlCultivosCuadro.Items.Insert(0, New ListItem("Seleccione uno", "-1")) DdlCultivosCuadro.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
End If End If
@@ -3562,7 +3565,9 @@ Partial Class OC
If e.Row.RowState = DataControlRowState.Normal Or e.Row.RowState = DataControlRowState.Alternate Then If e.Row.RowState = DataControlRowState.Normal Or e.Row.RowState = DataControlRowState.Alternate Then
If UsuarioActual.Empresa.Tipo_CentroCosto = 1 Or UsuarioActual.Empresa.Tipo_CentroCosto = 2 Then If UsuarioActual.Empresa.Tipo_CentroCosto = 1 Or UsuarioActual.Empresa.Tipo_CentroCosto = 2 Then
e.Row.FCLiteral("LtlSubProyecto").Text = e.Row.DBCampo("SubProyecto") Dim Str As String = e.Row.DBCampo("SubProyecto")
If e.Row.DBCampo("Cuadro") <> "" Then Str = String.Format("{0}<br/>{1}", Str, e.Row.DBCampo("Cuadro"))
e.Row.FCLiteral("LtlSubProyecto").Text = Str
End If End If
End If End If

View File

@@ -17,7 +17,7 @@ Partial Class Site
Return Convert.ToBoolean(HdnEsPopup.Value) Return Convert.ToBoolean(HdnEsPopup.Value)
End Get End Get
Set(value As Boolean) Set(value As Boolean)
HdnEsPopup.Value = value.ToString HdnEsPopup.Value = value.ToString()
End Set End Set
End Property End Property
@@ -26,7 +26,7 @@ Partial Class Site
Return HdnPopUpWidth.Value.ToEntero Return HdnPopUpWidth.Value.ToEntero
End Get End Get
Set(value As Integer) Set(value As Integer)
HdnPopUpWidth.Value = value.ToString HdnPopUpWidth.Value = value.ToString()
End Set End Set
End Property End Property
Public Property userx As Usuario Public Property userx As Usuario
@@ -39,7 +39,7 @@ Partial Class Site
End Property End Property
Public Property countNotificaciones As Integer Public Property countNotificaciones As Integer
Get Get
countNotificaciones = If(IsNothing(ViewState("countNotificaciones")), 0, ViewState("countNotificaciones").ToString.ToEntero) countNotificaciones = If(IsNothing(ViewState("countNotificaciones")), 0, ViewState("countNotificaciones").ToString().ToEntero)
End Get End Get
Set(value As Integer) Set(value As Integer)
ViewState("countNotificaciones") = value ViewState("countNotificaciones") = value
@@ -64,10 +64,10 @@ Partial Class Site
lblFecha.Text = DateTime.Now.ToString("dd.MMMyyyy HH:mm tt") lblFecha.Text = DateTime.Now.ToString("dd.MMMyyyy HH:mm tt")
MasterChat.Visible = False MasterChat.Visible = False
If Request("Masterimpoup") IsNot Nothing AndAlso Request("Masterimpoup").ToString = "true" Then EsPopup = True If Request("Masterimpoup") IsNot Nothing AndAlso Request("Masterimpoup").ToString() = "true" Then EsPopup = True
If UsuarioActual IsNot Nothing Then If UsuarioActual IsNot Nothing Then
HdnCveE.Value = UsuarioActual.CveEmpresa.ToString HdnCveE.Value = UsuarioActual.CveEmpresa.ToString()
HdnCveU.Value = UsuarioActual.CveUsuario.ToString HdnCveU.Value = UsuarioActual.CveUsuario.ToString()
LitTit.Text = UsuarioActual.Empresa.EmpresaEncabezado LitTit.Text = UsuarioActual.Empresa.EmpresaEncabezado
If UsuarioActual.CveUsuario = 100 Then If UsuarioActual.CveUsuario = 100 Then
LitTit.Text = String.Format("<span style='color:white; font-size:x-large'></span>&nbsp;<span style='color: #32A1CF; font-size:x-large'>Mi Empresa de Ventas ({0})</span> ", UsuarioActual.CveEmpresa) LitTit.Text = String.Format("<span style='color:white; font-size:x-large'></span>&nbsp;<span style='color: #32A1CF; font-size:x-large'>Mi Empresa de Ventas ({0})</span> ", UsuarioActual.CveEmpresa)
@@ -81,7 +81,7 @@ Partial Class Site
userx = New Usuario userx = New Usuario
userx.Empresa = New Empresa userx.Empresa = New Empresa
userx.Referencia = Encripta(UsuarioActual.CveUsuario.ToString) userx.Referencia = Encripta(UsuarioActual.CveUsuario.ToString())
userx.Usuario = Encripta(UsuarioActual.Usuario) userx.Usuario = Encripta(UsuarioActual.Usuario)
userx.Liga = Encripta(UsuarioActual.Rol) userx.Liga = Encripta(UsuarioActual.Rol)
@@ -143,7 +143,7 @@ Partial Class Site
Else Else
'VALIDACION DE SEGURIDAD, EN LA QUE SE VALIDA QUE LA EMPRESA EN LA QUE SE GENERO LA PAGINA SEA LA MISMA A LA DE LA SESION, 'VALIDACION DE SEGURIDAD, EN LA QUE SE VALIDA QUE LA EMPRESA EN LA QUE SE GENERO LA PAGINA SEA LA MISMA A LA DE LA SESION,
'DE NO SER ASI, SE REDIRECCIONA A INICIO. 'DE NO SER ASI, SE REDIRECCIONA A INICIO.
If UsuarioActual IsNot Nothing AndAlso (HdnCveE.Value <> UsuarioActual.CveEmpresa.ToString OrElse HdnCveU.Value <> UsuarioActual.CveUsuario.ToString) Then If UsuarioActual IsNot Nothing AndAlso (HdnCveE.Value <> UsuarioActual.CveEmpresa.ToString() OrElse HdnCveU.Value <> UsuarioActual.CveUsuario.ToString()) Then
Response.Redirect(FormsAuthentication.DefaultUrl) Response.Redirect(FormsAuthentication.DefaultUrl)
End If End If
End If End If
@@ -186,7 +186,7 @@ Partial Class Site
' userstring.AppendFormat("{0}{1} ", prefix, item) ' userstring.AppendFormat("{0}{1} ", prefix, item)
' prefix = "," ' prefix = ","
' Next ' Next
' stringusers = userstring.ToString ' stringusers = userstring.ToString()
' If userconectedlist.Count > 0 Then ' If userconectedlist.Count > 0 Then
' GlobalDTUsuarios = GlobalDTUsuarios.FiltraParametros(String.Format("CveUsuario in ({0})", userstring)) ' GlobalDTUsuarios = GlobalDTUsuarios.FiltraParametros(String.Format("CveUsuario in ({0})", userstring))
' RptChatEmpresa.DataSource = GlobalDTUsuarios.FiltraParametros("CveEmpresa >1", "", {"CveEmpresa", "Empresa"}) ' RptChatEmpresa.DataSource = GlobalDTUsuarios.FiltraParametros("CveEmpresa >1", "", {"CveEmpresa", "Empresa"})
@@ -198,7 +198,7 @@ Partial Class Site
'End Sub 'End Sub
'Private stringusers As String = "0" 'Private stringusers As String = "0"
'Private Sub RptChatEmpresa_ItemDataBound(sender As Object, e As RepeaterItemEventArgs) Handles RptChatEmpresa.ItemDataBound 'Private Sub RptChatEmpresa_ItemDataBound(sender As Object, e As RepeaterItemEventArgs) Handles RptChatEmpresa.ItemDataBound
' Dim CveEmpresa As Integer = e.Item.DataItem("CveEmpresa").ToString.ToEntero ' Dim CveEmpresa As Integer = e.Item.DataItem("CveEmpresa").ToString().ToEntero
' Dim GlobalDTUsuarios As DataTable = DirectCast(Application("GlobalDTUsuarios"), DataTable).FiltraParametros(String.Format("CveUsuario in ({0}) AND CveEmpresa ={1}", stringusers, CveEmpresa)) ' Dim GlobalDTUsuarios As DataTable = DirectCast(Application("GlobalDTUsuarios"), DataTable).FiltraParametros(String.Format("CveUsuario in ({0}) AND CveEmpresa ={1}", stringusers, CveEmpresa))
' Dim rpthijo As Repeater = DirectCast(e.Item.FindControl("RPTChatuser"), Repeater) ' Dim rpthijo As Repeater = DirectCast(e.Item.FindControl("RPTChatuser"), Repeater)
@@ -312,61 +312,73 @@ Partial Class Site
Dim LinkNieto = "" Dim LinkNieto = ""
Dim ClassActive As String Dim ClassActive As String
CveModuloPadreSeleccionado = 0 : CveModuloHijoSeleccionado = 0 : CveModuloNietoSeleccionado = 0 CveModuloPadreSeleccionado = 0 : CveModuloHijoSeleccionado = 0 : CveModuloNietoSeleccionado = 0
Dim strdomain = Request.Url.AbsoluteUri.Replace(Request.Url.PathAndQuery, "")
If Request.Url.Port <> 80 Then
strdomain = strdomain.Replace(String.Format(":{0}", Request.Url.Port), "")
End If
Dim MenuHTML As New StringBuilder Dim MenuHTML As New StringBuilder
For Each drP As DataRow In Inicio For Each drP As DataRow In Inicio
CveModuloPadre = drP("CveModulo").ToString.ToEntero CveModuloPadre = drP("CveModulo").ToString().ToEntero
LinkPadre = drP("LIGA").ToString LinkPadre = drP("LIGA").ToString()
If drP("PopUp").ToString = "S" Then LinkPadre = String.Format("javascript:AbrirVentana('{0}',{1},{2},'N');", drP("LIGA"), drP("ANCHO"), drP("ALTO")) If drP("PopUp").ToString() = "S" Then LinkPadre = String.Format("javascript:AbrirVentana('{0}',{1},{2},'N');", drP("LIGA"), drP("ANCHO"), drP("ALTO"))
Dim Hijos = From h In dt.AsEnumerable Where h!CvePadre.Equals(CveModuloPadre) Order By h!Orden Dim Hijos = From h In dt.AsEnumerable Where h!CvePadre.Equals(CveModuloPadre) Order By h!Orden
If CveModulo = drP("CveModulo").ToString.ToEntero Then If CveModulo = drP("CveModulo").ToString().ToEntero Then
HeaderBar.AppendFormat("<i class='fa fa-angle-right'></i></li> <li><a href='{0}'>{1}</a>", LinkPadre, drP("Modulo").ToString) HeaderBar.AppendFormat("<i class='fa fa-angle-right'></i></li> <li><a href='{0}'>{1}</a>", LinkPadre, drP("Modulo").ToString())
ScriptColorGrupoModulo = ColorPage(drP("CveGrupoModulo").ToString.ToEntero) ScriptColorGrupoModulo = ColorPage(drP("CveGrupoModulo").ToString().ToEntero)
End If End If
If Hijos.Count > 0 Then If Hijos.Count > 0 Then
Linkpapa = LinkPadre Linkpapa = LinkPadre
LinkPadre = LinkBase LinkPadre = LinkBase
MenuHTML.AppendFormat("<li id='m{3}'><a href='{0}'>{2}<span class='title'>{1}</span><span id='j{3}' ></span><span class='arrow '></span></a><ul class='sub-menu'>", LinkPadre, drP("Modulo"), If(drP("Estilo").ToString <> "", String.Format("<i class='{0}'></i>", drP("Estilo")), ""), drP("CveModulo")) MenuHTML.AppendFormat("<li id='m{3}'><a href='{0}'>{2}<span class='title'>{1}</span><span id='j{3}' ></span><span class='arrow '></span></a><ul class='sub-menu'>", LinkPadre, drP("Modulo"), If(drP("Estilo").ToString() <> "", String.Format("<i class='{0}'></i>", drP("Estilo")), ""), drP("CveModulo"))
For Each drH As DataRow In Hijos For Each drH As DataRow In Hijos
Dim CveModuloHijo As Integer = drH("CveModulo").ToString.ToEntero Dim CveModuloHijo As Integer = drH("CveModulo").ToString().ToEntero
LinkHijo = drH("LIGA").ToString LinkHijo = drH("LIGA").ToString()
If CveModulo = drH("CveModulo").ToString.ToEntero Then If (drH("IsAngular").ToString() = "1") Then
LinkHijo = String.Format("{1}:84{0}", drH("LIGA"), strdomain)
End If
If CveModulo = drH("CveModulo").ToString().ToEntero Then
CveModuloPadreSeleccionado = CveModuloPadre CveModuloPadreSeleccionado = CveModuloPadre
ClassActive = "class='active'" ClassActive = "class='active'"
HeaderBar.AppendFormat("<i class='fa fa-angle-right'></i> </li><li><a href='{0}'>{1}</a> <i class='fa fa-angle-right'></i> </li><li><a href='{2}'>{3}</a>", Linkpapa, drP("Modulo").ToString, LinkHijo, drH("Modulo").ToString) HeaderBar.AppendFormat("<i class='fa fa-angle-right'></i> </li><li><a href='{0}'>{1}</a> <i class='fa fa-angle-right'></i> </li><li><a href='{2}'>{3}</a>", Linkpapa, drP("Modulo").ToString(), LinkHijo, drH("Modulo").ToString())
ScriptColorGrupoModulo = ColorPage(drH("CveGrupoModulo").ToString.ToEntero) ScriptColorGrupoModulo = ColorPage(drH("CveGrupoModulo").ToString().ToEntero)
Else Else
ClassActive = "" ClassActive = ""
End If End If
If drH("PopUp").ToString = "S" Then LinkHijo = String.Format("javascript:AbrirVentana('{0}',{1},{2},'N');", drH("LIGA"), drH("ANCHO"), drH("ALTO")) If drH("PopUp").ToString() = "S" Then LinkHijo = String.Format("javascript:AbrirVentana('{0}',{1},{2},'N');", drH("LIGA"), drH("ANCHO"), drH("ALTO"))
Dim Nietos = From h In dt.AsEnumerable Where h!CvePadre.Equals(CveModuloHijo) Order By h!Orden Dim Nietos = From h In dt.AsEnumerable Where h!CvePadre.Equals(CveModuloHijo) Order By h!Orden
If Nietos.Count > 0 Then If Nietos.Count > 0 Then
Linkson = LinkHijo Linkson = LinkHijo
LinkHijo = LinkBase LinkHijo = LinkBase
MenuHTML.AppendFormat("<li id='m{3}'><a href='{0}'>{2}{1}<span class='arrow '></span> </a><ul class='sub-menu'>", LinkHijo, drH("Modulo"), If(drP("Estilo").ToString <> "", String.Format("<i class='{0}'></i>", drH("Estilo")), ""), drH("CveModulo")) MenuHTML.AppendFormat("<li id='m{3}'><a href='{0}'>{2}{1}<span class='arrow '></span> </a><ul class='sub-menu'>", LinkHijo, drH("Modulo"), If(drP("Estilo").ToString() <> "", String.Format("<i class='{0}'></i>", drH("Estilo")), ""), drH("CveModulo"))
For Each drN As DataRow In Nietos For Each drN As DataRow In Nietos
LinkNieto = drN("LIGA").ToString LinkNieto = drN("LIGA").ToString()
If CveModulo = drN("CveModulo").ToString.ToEntero Then If (drH("IsAngular").ToString() = "1") Then
LinkNieto = String.Format("{1}:4200{0}", drN("LIGA"), strdomain)
End If
If CveModulo = drN("CveModulo").ToString().ToEntero Then
CveModuloPadreSeleccionado = CveModuloPadre : CveModuloHijoSeleccionado = CveModuloHijo CveModuloPadreSeleccionado = CveModuloPadre : CveModuloHijoSeleccionado = CveModuloHijo
ClassActive = "class='active'" ClassActive = "class='active'"
HeaderBar.AppendFormat("<i class='fa fa-angle-right'></i> </li><li><a href='{0}'>{1}</a> <i class='fa fa-angle-right'></i> </li><li><a href='{2}'>{3}</a> <i class='fa fa-angle-right'></i> </li><li><a href='{4}'>{5}</a>", Linkpapa, drP("Modulo").ToString, Linkson, drH("Modulo").ToString, LinkNieto, drN("Modulo")) HeaderBar.AppendFormat("<i class='fa fa-angle-right'></i> </li><li><a href='{0}'>{1}</a> <i class='fa fa-angle-right'></i> </li><li><a href='{2}'>{3}</a> <i class='fa fa-angle-right'></i> </li><li><a href='{4}'>{5}</a>", Linkpapa, drP("Modulo").ToString(), Linkson, drH("Modulo").ToString(), LinkNieto, drN("Modulo"))
ScriptColorGrupoModulo = ColorPage(drN("CveGrupoModulo").ToString.ToEntero) ScriptColorGrupoModulo = ColorPage(drN("CveGrupoModulo").ToString().ToEntero)
Else Else
ClassActive = "" ClassActive = ""
End If End If
If drN("PopUp").ToString = "S" Then LinkNieto = String.Format("javascript:AbrirVentana('{0}',{1},{2},'N');", drN("LIGA"), drN("ANCHO"), drN("ALTO")) If drN("PopUp").ToString() = "S" Then LinkNieto = String.Format("javascript:AbrirVentana('{0}',{1},{2},'N');", drN("LIGA"), drN("ANCHO"), drN("ALTO"))
MenuHTML.AppendFormat("<li {3}><a href=""{0}"">{2}{1}</a></li>", LinkNieto, drN("Modulo"), If(drP("Estilo").ToString <> "", String.Format("<i class='{0}'></i>", drN("Estilo")), ""), ClassActive) MenuHTML.AppendFormat("<li {3}><a href=""{0}"">{2}{1}</a></li>", LinkNieto, drN("Modulo"), If(drP("Estilo").ToString() <> "", String.Format("<i class='{0}'></i>", drN("Estilo")), ""), ClassActive)
Next Next
MenuHTML.AppendFormat("</ul></li>") MenuHTML.AppendFormat("</ul></li>")
Else Else
MenuHTML.AppendFormat("<li {3}><a href=""{0}"">{2}{1}</a></li>", LinkHijo, drH("Modulo"), If(drP("Estilo").ToString <> "", String.Format("<i class='{0}'></i>", drH("Estilo")), ""), ClassActive) MenuHTML.AppendFormat("<li {3}><a href=""{0}"">{2}{1}</a></li>", LinkHijo, drH("Modulo"), If(drP("Estilo").ToString() <> "", String.Format("<i class='{0}'></i>", drH("Estilo")), ""), ClassActive)
End If End If
Next Next
MenuHTML.AppendFormat("</ul></li>") MenuHTML.AppendFormat("</ul></li>")
Else Else
MenuHTML.AppendFormat("<li><a href=""{0}"">{2}<span class='title'>{1}</span></a></li>", LinkPadre, drP("Modulo"), If(drP("Estilo").ToString <> "", String.Format("<i class='{0}'></i>", drP("Estilo")), "")) MenuHTML.AppendFormat("<li><a href=""{0}"">{2}<span class='title'>{1}</span></a></li>", LinkPadre, drP("Modulo"), If(drP("Estilo").ToString() <> "", String.Format("<i class='{0}'></i>", drP("Estilo")), ""))
End If End If
Next Next
@@ -380,9 +392,9 @@ Partial Class Site
MenuHTML = MenuHTML.Replace(String.Format("id='j{0}'", CveModuloHijoSeleccionado), String.Format("id='j{0}' class='selected'", CveModuloHijoSeleccionado)) MenuHTML = MenuHTML.Replace(String.Format("id='j{0}'", CveModuloHijoSeleccionado), String.Format("id='j{0}' class='selected'", CveModuloHijoSeleccionado))
End If End If
HeaderBar.AppendFormat("</li>{0}", ScriptColorGrupoModulo) HeaderBar.AppendFormat("</li>{0}", ScriptColorGrupoModulo)
BarraNavegacion.Text = HeaderBar.ToString BarraNavegacion.Text = HeaderBar.ToString()
'CargaMenu(MenuHTML) 'CargaMenu(MenuHTML)
Menu.Text = MenuHTML.ToString Menu.Text = MenuHTML.ToString()
MenuHTML.Clear() MenuHTML.Clear()
HeaderBar.Clear() HeaderBar.Clear()
End Sub End Sub
@@ -417,7 +429,7 @@ Partial Class Site
End Function End Function
'Private Sub CargaMenu(Texto As StringBuilder) 'Private Sub CargaMenu(Texto As StringBuilder)
' Menu.Text = Texto.ToString ' Menu.Text = Texto.ToString()
'End Sub 'End Sub
#Region "Notificaciones" #Region "Notificaciones"
@@ -474,7 +486,7 @@ Partial Class Site
'End If 'End If
'OC.Dispose() 'OC.Dispose()
LtlMNotificaciones.Text = String.Format("{0}{1}", LtlMNotificaciones.Text, Notificaciones.ToString) LtlMNotificaciones.Text = String.Format("{0}{1}", LtlMNotificaciones.Text, Notificaciones.ToString())
Notificaciones.Clear() Notificaciones.Clear()
End Sub End Sub
@@ -484,7 +496,7 @@ Partial Class Site
Dim Archivo As String = String.Format("{0}Empresas\{1}\Certificados\{2}", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, UsuarioActual.Empresa.ArchivoCer) Dim Archivo As String = String.Format("{0}Empresas\{1}\Certificados\{2}", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, UsuarioActual.Empresa.ArchivoCer)
If File.Exists(Archivo) Then If File.Exists(Archivo) Then
Dim CerFile As New FileStream(Archivo, FileMode.Open, FileAccess.Read) Dim CerFile As New FileStream(Archivo, FileMode.Open, FileAccess.Read)
Dim Size As Integer = CerFile.Length.ToString.ToEntero() Dim Size As Integer = CerFile.Length.ToString().ToEntero()
Dim Data As Byte() = New Byte(Size - 1) {} Dim Data As Byte() = New Byte(Size - 1) {}
Size = CerFile.Read(Data, 0, Size) Size = CerFile.Read(Data, 0, Size)
CerFile.Close() CerFile.Close()

View File

@@ -9161,7 +9161,7 @@ Partial Class Clientes
End If End If
If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa, TxtFechaIUsados.Text.ToDate, TxtFechaFUsados.Text.ToDate) Then If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then
GvUsadosResumen.DataSource = ObjAcum.DtResultados GvUsadosResumen.DataSource = ObjAcum.DtResultados
End If End If
GvUsadosResumen.DataBind() GvUsadosResumen.DataBind()

View File

@@ -1257,7 +1257,7 @@ Partial Class ProductosyServicios
End If End If
Next Next
End If End If
If UsuarioActual.Empresa.Funcionalidad(563) <> "" Then If UsuarioActual.Empresa.Funcionalidad(563) <> "" AndAlso ChkAplicaParaVenta.Checked Then
TieneError = GuardarProductoEnFranquicia(ObjProductosServicios, PSS, CveMetodoInv, EsPaquete, True) TieneError = GuardarProductoEnFranquicia(ObjProductosServicios, PSS, CveMetodoInv, EsPaquete, True)
End If End If
@@ -1323,7 +1323,7 @@ Partial Class ProductosyServicios
Next Next
End If End If
If UsuarioActual.Empresa.Funcionalidad(563) <> "" Then If UsuarioActual.Empresa.Funcionalidad(563) <> "" AndAlso ChkAplicaParaVenta.Checked Then
TieneError = GuardarProductoEnFranquicia(ObjProductosServicios, PSS, CveMetodoInv, EsPaquete, False) TieneError = GuardarProductoEnFranquicia(ObjProductosServicios, PSS, CveMetodoInv, EsPaquete, False)
End If End If

View File

@@ -2746,7 +2746,8 @@
<table> <table>
<tr> <tr>
<td>Contrato:</td> <td>Contrato:</td>
<td><asp:DropDownList ID="DdlContrato" runat="server" AppendDataBoundItems="true" Width="350px" AutoPostBack="true" DataTextField="NumeroContrato" DataValueField="CveContrato" CssClass="select2me" ></asp:DropDownList></td> <td>
<asp:DropDownList ID="DdlContrato" runat="server" AppendDataBoundItems="true" Width="350px" AutoPostBack="true" DataTextField="NumeroContrato" DataValueField="CveContrato" CssClass="select2me"></asp:DropDownList></td>
</tr> </tr>
</table> </table>
@@ -2793,14 +2794,18 @@
<div class="row" style="margin-bottom: 10px;"> <div class="row" style="margin-bottom: 10px;">
<div class="col-md-6"> <div class="col-md-6">
<table> <table>
<tr> <tr>
<td><asp:Label runat="server" Text="Contrato:"></asp:Label></td> <td>
<td><asp:DropDownList runat="server" ID="DdlContratosModal" AutoPostBack="true" CssClass=" form-control input-sm select2me text-left" Width="400px" DataTextField="ContratoCompleto" DataValueField="CveContrato" /></td> <asp:Label runat="server" Text="Contrato:"></asp:Label></td>
<td>
<asp:DropDownList runat="server" ID="DdlContratosModal" AutoPostBack="true" CssClass=" form-control input-sm select2me text-left" Width="400px" DataTextField="ContratoCompleto" DataValueField="CveContrato" /></td>
</tr> </tr>
<tr runat="server" id="DVEstimacionesObra" visible="false"> <tr runat="server" id="DVEstimacionesObra" visible="false">
<td> Estimacion:</td> <td>Estimacion:</td>
<td> <asp:DropDownList ID="DdlEstimacionesObra" runat="server" AppendDataBoundItems="true" Width="400px" AutoPostBack="true" DataTextField="NumeroEstimacion" DataValueField="CveEstimacion" CssClass="select2me"></asp:DropDownList> </td> <td>
<asp:DropDownList ID="DdlEstimacionesObra" runat="server" AppendDataBoundItems="true" Width="400px" AutoPostBack="true" DataTextField="NumeroEstimacion" DataValueField="CveEstimacion" CssClass="select2me"></asp:DropDownList>
</td>
</tr> </tr>
</table> </table>
</div> </div>
@@ -2819,7 +2824,7 @@
<asp:ListItem Text="Venta" Value="2" Selected="True" /> <asp:ListItem Text="Venta" Value="2" Selected="True" />
<asp:ListItem Text="Suministro" Value="1" /> <asp:ListItem Text="Suministro" Value="1" />
<%--<asp:ListItem Text="Consignación" Value="3" Enabled="false" />--%> <%--<asp:ListItem Text="Consignación" Value="3" Enabled="false" />--%>
<asp:ListItem Text="Obra" Value="4" /> <asp:ListItem Text="Obra" Value="4" />
</asp:RadioButtonList> </asp:RadioButtonList>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
@@ -6289,6 +6294,11 @@
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaRNCCargos','{0}')", GvRemisionesNC.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a> <a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaRNCCargos','{0}')", GvRemisionesNC.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-12">
<asp:CheckBox ID="ChkMostarProductosRNC" runat="server" AutoPostBack="true" Text="Mostrar Productos" OnCheckedChanged="ChkMostarProductosRNC_CheckedChanged" />
</div>
</div>
<div class="row" id="DivRNCCargos" runat="server" visible="false">
<div class="col-md-12" style="max-height: 440px; overflow: auto"> <div class="col-md-12" style="max-height: 440px; overflow: auto">
<asp:GridView ID="GvRemisionesNC" runat="server" AutoGenerateColumns="False" <asp:GridView ID="GvRemisionesNC" runat="server" AutoGenerateColumns="False"
DataKeyNames="CveVenta" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn" GridLines="None"> DataKeyNames="CveVenta" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn" GridLines="None">
@@ -6320,6 +6330,35 @@
</asp:GridView> </asp:GridView>
</div> </div>
</div> </div>
<div class="row" id="DivRNCCargosDetalle" runat="server" visible="false">
<div class="col-md-12" style="max-height: 440px; overflow: auto">
<asp:GridView ID="GvRemisionesNCDetalle" runat="server" AutoGenerateColumns="False"
DataKeyNames="CveVenta,CveVentaDetalleRNC,CvePS,PU,PorcentajeIVA" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn" GridLines="None">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="ChkAplicar" runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cantidad">
<ItemTemplate>
<asp:TextBox ID="TxtCantidadRNC" runat="server" Text='<%#Eval("CantidadPendiente").ToString%>' MaxLength="12" Width="46px" Height="24px"></asp:TextBox>
<asp:RangeValidator ID="RVCantRNC" runat="server" Type="Double" MinimumValue="0" MaximumValue='<%#Eval("CantidadPendiente").ToString%>' ErrorMessage="Cantidad Excedida" ControlToValidate="TxtCantidadRNC" Display="None" ValidationGroup="VGAplicarRNC"></asp:RangeValidator>
<ajax:ValidatorCalloutExtender ID="VCECantidad3" runat="server" HighlightCssClass="vco" TargetControlID="RVCantRNC" Width="300px"></ajax:ValidatorCalloutExtender>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Producto" DataField="CodigoPS" ItemStyle-HorizontalAlign="Left" />
<asp:HyperLinkField DataNavigateUrlFields="CveVenta" Target="_blank" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" DataTextField="Folio" HeaderText="Folio" ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Fecha" DataField="Fecha" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" />
<asp:TemplateField HeaderText="Total" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Literal ID="TtlTotal" runat="server" Text='<%# Eval("Total", "{0:N2}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
<div class="row" id="DivSMU" runat="server" visible="false"> <div class="row" id="DivSMU" runat="server" visible="false">
<div class="col-md-12"> <div class="col-md-12">
<table border="0" rules="none" class="well TextTab" style="float: right;" runat="server"> <table border="0" rules="none" class="well TextTab" style="float: right;" runat="server">
@@ -6439,7 +6478,7 @@
<div class="col-md-2"> <div class="col-md-2">
<asp:Button ID="BtnCalcularPenalizacion" runat="server" CssClass="btn btn-primary btn-sm" Text="Calcular" OnClick="BtnCalcularPenalizacion_Click" /> <asp:Button ID="BtnCalcularPenalizacion" runat="server" CssClass="btn btn-primary btn-sm" Text="Calcular" OnClick="BtnCalcularPenalizacion_Click" />
</div> </div>
<div class="col-md-6"> </div> <div class="col-md-6"></div>
</div> </div>
<div class="row" style="margin-bottom: 10px;"> <div class="row" style="margin-bottom: 10px;">
<div class="text-right col-md-offset-8 col-md-4"> <div class="text-right col-md-offset-8 col-md-4">
@@ -7988,65 +8027,65 @@
} }
function FnCambiaAnt(chk, txt, saldo) { function FnCambiaAnt(chk, txt, saldo) {
debugger; debugger;
var Total = ToDouble($get('TxtSubTotal').value); var Total = ToDouble($get('TxtSubTotal').value);
let TipoAnticipo = $('#<%= DdlTipoAmortizacionAnticipo.ClientID %>').val(); let TipoAnticipo = $('#<%= DdlTipoAmortizacionAnticipo.ClientID %>').val();
let importeTxt = parseFloat(txt.value.replace(/,/g, '')); let importeTxt = parseFloat(txt.value.replace(/,/g, ''));
if (isNaN(importeTxt)) { if (isNaN(importeTxt)) {
importeTxt = 0;
} else {
if (importeTxt <= 0) {
importeTxt = 0; importeTxt = 0;
chk.checked = false; } else {
return; if (importeTxt <= 0) {
importeTxt = 0;
chk.checked = false;
return;
}
} }
saldo = (importeTxt > saldo) ? saldo : importeTxt;
var SaldoCompra = (Total - FnSumaValoresAnt() + ToDouble(txt.value)).toFixed(2); // le agrego lo del valor actual para validarlo //parseFloat(parseFloat($get('HdnVentaSaldo').value).toFixed(2));
if (SaldoCompra < 0) txt.value = SaldoCompra - txt.value;
//minimo entre saldocompra y el saldoanticipo
if (SaldoCompra < saldo) saldo = SaldoCompra;
if (ToDouble(txt.value) > 0) {
chk.checked = true;
} else {
chk.checked = false;
}
if (ToDouble(txt.value) > saldo) {
txt.value = saldo;
alert("El Importe no debe de exceder a el saldo");
}
$("#LblTotalAnticipos").text(FormatoNumero(FnSumaValoresAnt(), 2));
$get('HdnVentaSaldo').value = Total - FnSumaValoresAnt();
} }
saldo = (importeTxt > saldo) ? saldo : importeTxt; function FnSumaValoresAnt() {
debugger;
var totalPoints = 0;
var t = '';
$('input[name*=TxtAnticipo]').each(function () {
totalPoints += ToDouble($(this).val());
});
var SaldoCompra = (Total - FnSumaValoresAnt() + ToDouble(txt.value)).toFixed(2); // le agrego lo del valor actual para validarlo //parseFloat(parseFloat($get('HdnVentaSaldo').value).toFixed(2));
if (SaldoCompra < 0) txt.value = SaldoCompra - txt.value;
//minimo entre saldocompra y el saldoanticipo
if (SaldoCompra < saldo) saldo = SaldoCompra;
if (ToDouble(txt.value) > 0) { return Math.round(totalPoints * 100) / 100;
chk.checked = true;
} else {
chk.checked = false;
} }
if (ToDouble(txt.value) > saldo) { function LimpiaModal() {
txt.value = saldo; $('#<%= TxtDireccion.ClientID %>').val('');
alert("El Importe no debe de exceder a el saldo");
}
$("#LblTotalAnticipos").text(FormatoNumero(FnSumaValoresAnt(), 2));
$get('HdnVentaSaldo').value = Total - FnSumaValoresAnt();
}
function FnSumaValoresAnt() {
debugger;
var totalPoints = 0;
var t = '';
$('input[name*=TxtAnticipo]').each(function () {
totalPoints += ToDouble($(this).val());
});
return Math.round(totalPoints * 100) / 100;
}
function LimpiaModal() {
$('#<%= TxtDireccion.ClientID %>').val('');
$('#<%= TxtColonia.ClientID %>').val(''); $('#<%= TxtColonia.ClientID %>').val('');
$('#<%= TxtCiudad.ClientID %>').val(''); $('#<%= TxtCiudad.ClientID %>').val('');
$('#<%= TxtEstado.ClientID %>').val(''); $('#<%= TxtEstado.ClientID %>').val('');
@@ -8271,68 +8310,68 @@
function ConvertirDolares(ChkConvertirDolares) { function ConvertirDolares(ChkConvertirDolares) {
//LIMPIA //LIMPIA
$('#<%= LblDolaresConvertidos.ClientID %>').text(''); $('#<%= LblDolaresConvertidos.ClientID %>').text('');
$("#TrConversionDolaresTexto").hide(); $("#TrConversionDolaresTexto").hide();
//CALCULA //CALCULA
if (ChkConvertirDolares.checked) { if (ChkConvertirDolares.checked) {
ConvertirPesosDlls(); ConvertirPesosDlls();
} }
} }
//FUNCIONES PARA MODAL "ModalAplicarNC" //FUNCIONES PARA MODAL "ModalAplicarNC"
function CalculaImporteNC() { function CalculaImporteNC() {
var ImporteReferencia = (($('#C_DdlNCNivelImporte').val() == "1") ? ToDouble($get('TxtTotal').value) : ToDouble($get('TxtSubTotal').value)); var ImporteReferencia = (($('#C_DdlNCNivelImporte').val() == "1") ? ToDouble($get('TxtTotal').value) : ToDouble($get('TxtSubTotal').value));
//var ImporteReferencia = ToDouble($get('TxtTotal').value); //var ImporteReferencia = ToDouble($get('TxtTotal').value);
$get('TxtNCImporte').value = FormatoNumero((ToDouble($get('TxtNCPorcentaje').value) * ImporteReferencia) / 100, 2); $get('TxtNCImporte').value = FormatoNumero((ToDouble($get('TxtNCPorcentaje').value) * ImporteReferencia) / 100, 2);
} }
function CalculaPorcentajeNC() { function CalculaPorcentajeNC() {
var ImporteReferencia = (($('#C_DdlNCNivelImporte').val() == "1") ? ToDouble($get('TxtTotal').value) : ToDouble($get('TxtSubTotal').value)); var ImporteReferencia = (($('#C_DdlNCNivelImporte').val() == "1") ? ToDouble($get('TxtTotal').value) : ToDouble($get('TxtSubTotal').value));
//var ImporteReferencia = ToDouble($get('TxtTotal').value); //var ImporteReferencia = ToDouble($get('TxtTotal').value);
$get('TxtNCPorcentaje').value = FormatoNumero((ToDouble($get('TxtNCImporte').value) * 100) / ImporteReferencia, 4); $get('TxtNCPorcentaje').value = FormatoNumero((ToDouble($get('TxtNCImporte').value) * 100) / ImporteReferencia, 4);
} }
function CambioTipoMoneda(chk, saldo, txt, tipocambio, CveMoneda) { function CambioTipoMoneda(chk, saldo, txt, tipocambio, CveMoneda) {
debugger; debugger;
if (tipocambio.value.length > 0) { if (tipocambio.value.length > 0) {
if (CveMoneda == 1) { if (CveMoneda == 1) {
txt.value = FormatoNumero(ToDouble(saldo / tipocambio.value), 2); txt.value = FormatoNumero(ToDouble(saldo / tipocambio.value), 2);
} else { } else {
txt.value = FormatoNumero(ToDouble(saldo * tipocambio.value), 2); txt.value = FormatoNumero(ToDouble(saldo * tipocambio.value), 2);
} }
} }
} }
function BuscarOCRegistrada() { function BuscarOCRegistrada() {
$('#btnBuscarOCRegistrada').click(); $('#btnBuscarOCRegistrada').click();
} }
function ValidaAnticipoBoton() { function ValidaAnticipoBoton() {
var Descuentototal = ToDouble($('#LblDescuentos').text()).toFixed(2); var Descuentototal = ToDouble($('#LblDescuentos').text()).toFixed(2);
var TotalAnticipos = ToDouble($('#LblTotalAnticipos').text()).toFixed(2); var TotalAnticipos = ToDouble($('#LblTotalAnticipos').text()).toFixed(2);
var IndexActualDdl = parseInt($('#<%= DdlTipoAmortizacionAnticipo.ClientID %>').prop('selectedIndex')); var IndexActualDdl = parseInt($('#<%= DdlTipoAmortizacionAnticipo.ClientID %>').prop('selectedIndex'));
if (IndexActualDdl == 1 && IndexActualDd2 > 0 && TotalAnticipos > 0) { if (IndexActualDdl == 1 && IndexActualDd2 > 0 && TotalAnticipos > 0) {
if (TotalAnticipos > 0) { if (TotalAnticipos > 0) {
$('#<%= BtnAceptarAnticipos.ClientID %>').prop('disabled', false); $('#<%= BtnAceptarAnticipos.ClientID %>').prop('disabled', false);
} else { } else {
$('#<%= BtnAceptarAnticipos.ClientID %>').prop('disabled', true); $('#<%= BtnAceptarAnticipos.ClientID %>').prop('disabled', true);
} }
} else { } else {
$('#<%= BtnAceptarAnticipos.ClientID %>').prop('disabled', true); $('#<%= BtnAceptarAnticipos.ClientID %>').prop('disabled', true);
} }
} }
function showDivEC() { function showDivEC() {
$('#<%= TxtRFCCliente.ClientID %>').val(''); $('#<%= TxtRFCCliente.ClientID %>').val('');
$('#<%= TxtNombreCliente.ClientID %>').val(''); $('#<%= TxtNombreCliente.ClientID %>').val('');
$('#<%= TxtDireccionCliente.ClientID %>').val(''); $('#<%= TxtDireccionCliente.ClientID %>').val('');
$('#<%= TxtNumExtCliente.ClientID %>').val(''); $('#<%= TxtNumExtCliente.ClientID %>').val('');

View File

@@ -144,6 +144,22 @@ Partial Class Ventas
ViewState("TmpDTRNCBonificacionesSeleccionadas") = value ViewState("TmpDTRNCBonificacionesSeleccionadas") = value
End Set End Set
End Property End Property
Private Property TmpDTRNCDetalle As DataTable
Get
Return If(IsNothing(ViewState("TmpDTRNCDetalle")), Nothing, CType(ViewState("TmpDTRNCDetalle"), DataTable))
End Get
Set(value As DataTable)
ViewState("TmpDTRNCDetalle") = value
End Set
End Property
Private Property TmpDTRNCDetalleSelecciondas As DataTable
Get
Return If(IsNothing(ViewState("TmpDTRNCDetalleSelecciondas")), Nothing, CType(ViewState("TmpDTRNCDetalleSelecciondas"), DataTable))
End Get
Set(value As DataTable)
ViewState("TmpDTRNCDetalleSelecciondas") = value
End Set
End Property
Private Property TmpDTError As DataTable Private Property TmpDTError As DataTable
Get Get
Return If(IsNothing(ViewState("TmpDTError")), Nothing, CType(ViewState("TmpDTError"), DataTable)) Return If(IsNothing(ViewState("TmpDTError")), Nothing, CType(ViewState("TmpDTError"), DataTable))
@@ -1861,6 +1877,22 @@ Partial Class Ventas
ViewState("SerieVenta") = value ViewState("SerieVenta") = value
End Set End Set
End Property End Property
Private Property AplicaDocumentoNuevoNC As Boolean
Get
Return CBool(IfNull(ViewState("AplicaDocumentoNuevoNC"), "False", ViewState("AplicaDocumentoNuevoNC")))
End Get
Set(value As Boolean)
ViewState("AplicaDocumentoNuevoNC") = value
End Set
End Property
Private Property AplicaRNCXDetalle As Boolean
Get
Return CBool(IfNull(ViewState("AplicaRNCXDetalle"), "False", ViewState("AplicaRNCXDetalle")))
End Get
Set(value As Boolean)
ViewState("AplicaRNCXDetalle") = value
End Set
End Property
#End Region #End Region
@@ -3928,6 +3960,7 @@ Partial Class Ventas
TmpDT = ObjVentas.DtResultados TmpDT = ObjVentas.DtResultados
TmpDT.Columns.Add("EntregaDirecta", GetType(Integer)) TmpDT.Columns.Add("EntregaDirecta", GetType(Integer))
TmpDT.Columns.Add("CveMovimientoDetallePedido", GetType(Integer)) TmpDT.Columns.Add("CveMovimientoDetallePedido", GetType(Integer))
TmpDT.Columns.Add("CveVentaDetalleRNC", GetType(Integer))
GvPS.DataSource = ObjVentas.DtResultados GvPS.DataSource = ObjVentas.DtResultados
GvPS.DataBind() GvPS.DataBind()
@@ -5233,6 +5266,7 @@ Partial Class Ventas
ChkEnviarFactura.Checked = False ChkEnviarFactura.Checked = False
ChkEnviarFactura.Visible = True ChkEnviarFactura.Visible = True
LblEnviarMail.Visible = True LblEnviarMail.Visible = True
If CveVenta > 0 AndAlso EnviarCorreoCliente Then ChkEnviarFactura.Checked = EnviarCorreoCliente
Else Else
ChkEnviarFactura.Checked = EnviarCorreoCliente ChkEnviarFactura.Checked = EnviarCorreoCliente
ChkEnviarFactura.Visible = True ChkEnviarFactura.Visible = True
@@ -5617,7 +5651,7 @@ Partial Class Ventas
Dim ObjClientes As New ClsClientes Dim ObjClientes As New ClsClientes
If ObjClientes.GetHistorialVentas(CveCliente, 1000, CveClienteSucursal:=-1, TipoDocto:="Ing", CveEstatusFactura:=-1, FechaI:=Now.AddMonths(-1)) Then If ObjClientes.GetHistorialVentas(CveCliente, 1000, CveClienteSucursal:=-1, TipoDocto:="Ing", CveEstatusFactura:=-1, FechaI:=Now.AddMonths(-1)) Then
DdlVentaUsado.DataSource = ObjClientes.DtResultados DdlVentaUsado.DataSource = ObjClientes.DtResultados.FiltraParametros("UsadoMarcado = 0")
End If End If
ObjClientes.Dispose() ObjClientes.Dispose()
@@ -5863,6 +5897,7 @@ Partial Class Ventas
ChkEnviarFactura.Checked = False ChkEnviarFactura.Checked = False
ChkEnviarFactura.Visible = True ChkEnviarFactura.Visible = True
LblEnviarMail.Visible = True LblEnviarMail.Visible = True
If CveVenta > 0 AndAlso EnviarCorreoCliente Then ChkEnviarFactura.Checked = EnviarCorreoCliente
Else Else
ChkEnviarFactura.Checked = EnviarCorreoCliente ChkEnviarFactura.Checked = EnviarCorreoCliente
ChkEnviarFactura.Visible = True ChkEnviarFactura.Visible = True
@@ -6662,6 +6697,7 @@ Partial Class Ventas
TmpDT.Rows(e.RowIndex)("ImporteIVA") = (TmpDT.Rows(e.RowIndex)("PorcentajeIVA").ToString().ToDecimal * TotalCalculableImpuestosIVA).RoundSQL(NumeroDecimales) TmpDT.Rows(e.RowIndex)("ImporteIVA") = (TmpDT.Rows(e.RowIndex)("PorcentajeIVA").ToString().ToDecimal * TotalCalculableImpuestosIVA).RoundSQL(NumeroDecimales)
TmpDT.Rows(e.RowIndex)("ImporteIEPS") = (TmpDT.Rows(e.RowIndex)("PorcentajeIEPS").ToString().ToDecimal * TotalCalculableImpuestos).RoundSQL(NumeroDecimales) TmpDT.Rows(e.RowIndex)("ImporteIEPS") = (TmpDT.Rows(e.RowIndex)("PorcentajeIEPS").ToString().ToDecimal * TotalCalculableImpuestos).RoundSQL(NumeroDecimales)
TmpDT.Rows(e.RowIndex)("ImporteRetIVA") = (ClienteRetIVA * TotalCalculableImpuestos).RoundSQL(NumeroDecimales) TmpDT.Rows(e.RowIndex)("ImporteRetIVA") = (ClienteRetIVA * TotalCalculableImpuestos).RoundSQL(NumeroDecimales)
TmpDT.Rows(e.RowIndex)("RetIVA") = (ClienteRetIVA * TotalCalculableImpuestos).RoundSQL(NumeroDecimales)
TmpDT.Rows(e.RowIndex)("ImporteRetISR") = (ClienteRetISR * TotalCalculableImpuestos).RoundSQL(NumeroDecimales) TmpDT.Rows(e.RowIndex)("ImporteRetISR") = (ClienteRetISR * TotalCalculableImpuestos).RoundSQL(NumeroDecimales)
TmpDT.Rows(e.RowIndex)("PorcentajeRetIVA") = ClienteRetIVA TmpDT.Rows(e.RowIndex)("PorcentajeRetIVA") = ClienteRetIVA
TmpDT.Rows(e.RowIndex)("PorcentajeRetISR") = ClienteRetISR TmpDT.Rows(e.RowIndex)("PorcentajeRetISR") = ClienteRetISR
@@ -8575,7 +8611,7 @@ Partial Class Ventas
End If End If
'SI NO ES REFACTURACION 'SI NO ES REFACTURACION
If NuevaFactura <> 1 Then If NuevaFactura <> 1 AndAlso Not AplicaDocumentoNuevoNC Then
If DtVentasNC Is Nothing Then InicializaDTVentasNC() If DtVentasNC Is Nothing Then InicializaDTVentasNC()
Dim Drt = DtVentasNC.NewRow Dim Drt = DtVentasNC.NewRow
Drt("CveVenta") = ObjFactura.CveVenta Drt("CveVenta") = ObjFactura.CveVenta
@@ -10497,6 +10533,15 @@ Partial Class Ventas
Catch ex As Exception Catch ex As Exception
End Try End Try
'SI SE FACTURA UNA RNC SE MUESTRA
If UsuarioActual.CveEmpresa = 140 AndAlso factura.TipoDocto = "Egs" Then
If Row("CveVentaDetalleRNC").ToString().ToEntero() > 0 Then
If Not ObjVentas.AddVentaDetalleRNCFacturada(Row("CveVentaDetalleRNC").ToString().ToEntero(), ObjVentas.CveVentaDetalle, Row("Cantidad").ToString().ToDecimal()) Then
ErrorList.Add("Ocurrió un error al agregar la venta detalle devolución.")
End If
End If
End If
End If End If
Next Next
@@ -11589,6 +11634,13 @@ Partial Class Ventas
CveCuenta = ObjFactura.Cliente.CveCuentaMonedaExtranjera CveCuenta = ObjFactura.Cliente.CveCuentaMonedaExtranjera
End If End If
'ACTUALIZA SI LA VENTA FUE MARCADA CON OTRA PARA EL FILTRO DE USADOS
If ObjRNC.Num3 > 0 Then
If Not ObjVentas.UpdateVentaRNCUsado(ObjRNC.CveVenta, ObjRNC.Num3.ToEntero()) Then
ErrorPrepoliza = True
End If
End If
IdCtaContableCliente = IdCtaContable IdCtaContableCliente = IdCtaContable
CveCuentaCliente = CveCuenta CveCuentaCliente = CveCuenta
@@ -16257,6 +16309,7 @@ Partial Class Ventas
Row("IVA") = Row("PorcentajeIVA") Row("IVA") = Row("PorcentajeIVA")
Row("ImporteIVA") = (Row("PorcentajeIVA").ToString().ToDecimal * TotalCalculableImpuestosIVA).RoundAD(NumeroDecimales) Row("ImporteIVA") = (Row("PorcentajeIVA").ToString().ToDecimal * TotalCalculableImpuestosIVA).RoundAD(NumeroDecimales)
Row("ImporteRetIVA") = (ClienteRetIVA * TotalCalculableImpuestos).RoundAD(NumeroDecimales) Row("ImporteRetIVA") = (ClienteRetIVA * TotalCalculableImpuestos).RoundAD(NumeroDecimales)
Row("RetIVA") = (ClienteRetIVA * TotalCalculableImpuestos).RoundAD(NumeroDecimales)
Row("ImporteRetISR") = (ClienteRetISR * TotalCalculableImpuestos).RoundAD(NumeroDecimales) Row("ImporteRetISR") = (ClienteRetISR * TotalCalculableImpuestos).RoundAD(NumeroDecimales)
Row("PorcentajeRetIVA") = ClienteRetIVA Row("PorcentajeRetIVA") = ClienteRetIVA
Row("PorcentajeRetISR") = ClienteRetISR Row("PorcentajeRetISR") = ClienteRetISR
@@ -16508,6 +16561,7 @@ Partial Class Ventas
TmpDT.Columns.Add("EsOutSourcing", GetType(Boolean)) TmpDT.Columns.Add("EsOutSourcing", GetType(Boolean))
TmpDT.Columns.Add("EsCargo", GetType(Boolean)) TmpDT.Columns.Add("EsCargo", GetType(Boolean))
TmpDT.Columns.Add("CveVentaDetalleRNC", GetType(Integer))
TmpDT.Columns("EsOutSourcing").DefaultValue = False TmpDT.Columns("EsOutSourcing").DefaultValue = False
TmpDT.Columns("EsCargo").DefaultValue = False TmpDT.Columns("EsCargo").DefaultValue = False
@@ -23570,6 +23624,18 @@ Partial Class Ventas
ObjMovtos.Dispose() ObjMovtos.Dispose()
GvCxC.DataBind() GvCxC.DataBind()
End Sub End Sub
Protected Sub ChkMostarProductosRNC_CheckedChanged(sender As Object, e As EventArgs)
If ChkMostarProductosRNC.Checked Then
DivRNCCargos.Visible = False
DivRNCCargosDetalle.Visible = True
CargaRNCDetalle(DdlVentaUsado.SelectedValue.ToEntero())
Else
DivRNCCargos.Visible = True
DivRNCCargosDetalle.Visible = False
CargaRNC(DdlVentaUsado.SelectedValue.ToEntero())
End If
UpModalRemisionesNC.Update()
End Sub
Private Sub CargaRNC(Optional CveVentaUsado As Integer = -1) Private Sub CargaRNC(Optional CveVentaUsado As Integer = -1)
Dim DtNC As DataTable = Nothing Dim DtNC As DataTable = Nothing
@@ -23603,8 +23669,58 @@ Partial Class Ventas
If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then
Dim RowUsadosNC As DataRow = ObjAcum.DtResultados.Rows(2) Dim RowUsadosNC As DataRow = ObjAcum.DtResultados.Rows(2)
DivSMU.Visible = True DivSMU.Visible = True
HdnSaldoMaximoUsados.Value = RowUsadosNC("Valor").ToString() HdnSaldoMaximoUsados.Value = RowUsadosNC("ValorConImpuestos").ToString()
LtlSMU.Text = RowUsadosNC("Valor").ToString().ToDecimal().FormatoNumero(2) LtlSMU.Text = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal().FormatoNumero(2)
Else
DivSMU.Visible = False
HdnSaldoMaximoUsados.Value = "0"
LtlSMU.Text = "0"
End If
ObjAcum.Dispose()
End If
UpModalRemisionesNC.Update()
UpDescNC.Update()
End Sub
Private Sub CargaRNCDetalle(Optional CveVentaUsado As Integer = -1)
Dim DtNC As DataTable = Nothing
Dim ObjMovtos As New ClsMovimientos()
If ObjMovtos.GetRemisionesNCCliente(CveCliente, True, CveMoneda:=-1, CveClienteSucursal:=DdlSucursalCliente.SelectedValue.ToEntero()) Then
Me.TmpDTRNCDetalle = ObjMovtos.DtResultados.Copy()
End If
ObjMovtos.Dispose()
Me.TmpDTRNCDetalle.Columns.Add(New DataColumn("CveVentaDetalleNCGenerada", GetType(Integer)))
Me.TmpDTRNCDetalleSelecciondas = Nothing
Me.TmpDTRNCDetalleSelecciondas = TmpDTRNCDetalle.Clone()
Me.TmpDTRNCDetalleSelecciondas.Clear()
GvRemisionesNCDetalle.DataSource = TmpDTRNCDetalle.FiltraParametros("TipoRNC = 1")
'GvRemisionesNCBon.DataSource = TmpDTRNCBonificacionesSeleccionadas
'Me.TmpDTRNCBonificacionesCliente = DtNC.FiltraParametros("TipoRNC = 2")
'Me.TmpDTRNCBonificacionesCliente.Columns.Add("ImporteBonificacion", GetType(Decimal))
'Me.TmpDTRNCBonificacionesCliente.Columns.Add("IVABonificacion", GetType(Decimal))
'Me.TmpDTRNCBonificacionesCliente.Columns.Add("CveVentaRNCCargo", GetType(Integer))
GvRemisionesNCDetalle.DataBind()
'GvRemisionesNCBon.DataBind()
If CveVentaUsado > 0 Then
DivSMU.Visible = True
Dim FacUsado As New Modelos.Factura(UsuarioActual, CveVentaUsado, UsuarioActual.CveEmpresa)
Dim SaldoMaximoUsados As Decimal = FacUsado.DtDetalle.SUM("Total", "EsCargo = True").ToDecimal() + FacUsado.DtDetalle.SUM("ImporteIVA", "EsCargo = True").ToDecimal()
HdnSaldoMaximoUsados.Value = SaldoMaximoUsados.ToString()
LtlSMU.Text = String.Format("{0:N2}", SaldoMaximoUsados)
Else
Dim ObjAcum As New ClsAcumuladores
If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then
Dim RowUsadosNC As DataRow = ObjAcum.DtResultados.Rows(2)
DivSMU.Visible = True
HdnSaldoMaximoUsados.Value = RowUsadosNC("ValorConImpuestos").ToString()
LtlSMU.Text = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal().FormatoNumero(2)
Else Else
DivSMU.Visible = False DivSMU.Visible = False
HdnSaldoMaximoUsados.Value = "0" HdnSaldoMaximoUsados.Value = "0"
@@ -23814,6 +23930,15 @@ Partial Class Ventas
e.Row.FCTextBox("TxtImporte").Attributes.Add("onkeyup", $"LimitaSaldoRNCChk({e.Row.FCTextBox("TxtImporte").ClientID},{e.Row.DBCampo("Saldo").ToDouble}, this);") e.Row.FCTextBox("TxtImporte").Attributes.Add("onkeyup", $"LimitaSaldoRNCChk({e.Row.FCTextBox("TxtImporte").ClientID},{e.Row.DBCampo("Saldo").ToDouble}, this);")
End If End If
End Sub End Sub
Protected Sub GvRemisionesNCDetalle_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvRemisionesNCDetalle.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("CveVentaDetalleRNC").ToEntero() = 0 Then
e.Row.CssClass = "Totales"
e.Row.FCCheckBox("ChkAplicar").Visible = False
e.Row.FCTextBox("TxtCantidadRNC").Visible = False
End If
End If
End Sub
Protected Sub DdlNCNivelImporte_SelectedIndexChanged(sender As Object, e As EventArgs) Protected Sub DdlNCNivelImporte_SelectedIndexChanged(sender As Object, e As EventArgs)
Dim ImporteReferencia As Double = 0, PorcentajeMaximo As Double = 0 Dim ImporteReferencia As Double = 0, PorcentajeMaximo As Double = 0
@@ -23842,7 +23967,7 @@ Partial Class Ventas
'SOLO APLICA SI NO HAY DOCUMENTOS QUE SELECCIONAR 'SOLO APLICA SI NO HAY DOCUMENTOS QUE SELECCIONAR
If UsuarioActual.CveEmpresa = 140 Then If UsuarioActual.CveEmpresa = 140 Then
If GvCxC.Rows.Count = 0 OrElse GvCxC.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("ChkCxC").Checked) = 0 Then If GvCxC.Rows.Count = 0 OrElse GvCxC.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("ChkCxC").Checked) = 0 Then
Alert("No se ha seleccionado ninguna nota de crédito, en caso de no seleccionar ninguna se creará una nueva nota de crédito. ¿Está seguro de realizar esta acción?", TipoMensaje.MsgConfirmacion, JSBtnAceptar:="BtnAplicaNuevaNC();", TextoConfirmacion:="&nbsp;&nbsp;&nbsp;&nbsp;Si&nbsp;&nbsp;&nbsp;&nbsp;", TextoCancelacion:="&nbsp;&nbsp;&nbsp;&nbsp;No&nbsp;&nbsp;&nbsp;&nbsp;") Alert("No se ha seleccionado ninguna factura, en caso de no seleccionar ninguna se creará una nueva nota de crédito. ¿Está seguro de realizar esta acción?", TipoMensaje.MsgConfirmacion, JSBtnAceptar:="BtnAplicaNuevaNC();", TextoConfirmacion:="&nbsp;&nbsp;&nbsp;&nbsp;Si&nbsp;&nbsp;&nbsp;&nbsp;", TextoCancelacion:="&nbsp;&nbsp;&nbsp;&nbsp;No&nbsp;&nbsp;&nbsp;&nbsp;")
Else Else
AplicarNotaCreditoDesdeVenta() AplicarNotaCreditoDesdeVenta()
End If End If
@@ -23898,6 +24023,7 @@ Partial Class Ventas
Private Sub AplicarNC(CvePS As Integer, Optional NCDescuento As Boolean = False, Optional EsNCAmortizacion As Boolean = False, Optional AplicaImpuestosLocales As Boolean = True, Optional AplicaNuevoDocumento As Boolean = False, Optional AplicoNCFacturaActual As Boolean = False) Private Sub AplicarNC(CvePS As Integer, Optional NCDescuento As Boolean = False, Optional EsNCAmortizacion As Boolean = False, Optional AplicaImpuestosLocales As Boolean = True, Optional AplicaNuevoDocumento As Boolean = False, Optional AplicoNCFacturaActual As Boolean = False)
Try Try
Me.AplicaDocumentoNuevoNC = AplicaNuevoDocumento
Dim DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("") Dim DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
If DrPS Is Nothing Then If DrPS Is Nothing Then
Alert("Ocurrió un error al cargar la información del producto. Por favor comuniquese con asistencia SIG", TipoMensaje.MsgError) Alert("Ocurrió un error al cargar la información del producto. Por favor comuniquese con asistencia SIG", TipoMensaje.MsgError)
@@ -24066,11 +24192,22 @@ Partial Class Ventas
TmpDTDescNC.Clear() TmpDTDescNC.Clear()
If UsuarioActual.CveEmpresa = 140 Then If UsuarioActual.CveEmpresa = 140 Then
If AplicaRNCXDetalle Then
CrearDTNCCargoDetalle(ListaNCDesc, TmpDTDescNC, DrPS, CveProyecto, Proyecto, CveSubProyecto, SubProyecto)
Else
CrearDTNCCargo(ListaNCDesc, TmpDTDescNC, DrPS, CveProyecto, Proyecto, CveSubProyecto, SubProyecto)
End If
CrearDTNCCargo(ListaNCDesc, DtImpuestos, TmpDTDescNC, DrPS, CveProyecto, Proyecto, CveSubProyecto, SubProyecto)
'CONSULTA EL CONCEPTO DE NC
Dim ArrayNC As String() = UsuarioActual.Empresa.Funcionalidad(591).Split(",".ToCharArray())
Dim NCBonificacion As Integer = 0
If ArrayNC.Length > 4 Then
NCBonificacion = ArrayNC(4).ToEntero()
End If
'EN LA NC DE BONIFICACION EL CONCEPTO DEBE SER SIEMPRE 'BONIFICACION POR USADO' 'EN LA NC DE BONIFICACION EL CONCEPTO DEBE SER SIEMPRE 'BONIFICACION POR USADO'
Dim DrPSBonificacion = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=360481).FiltroPrimero("") Dim DrPSBonificacion = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=NCBonificacion).FiltroPrimero("")
If DrPSBonificacion IsNot Nothing Then If DrPSBonificacion IsNot Nothing Then
CrearDTNCBonificacion(ListaNCDesc, DtImpuestosBonificacion, TmpDTDescNC, DrPSBonificacion, CveProyecto, Proyecto, CveSubProyecto, SubProyecto) CrearDTNCBonificacion(ListaNCDesc, DtImpuestosBonificacion, TmpDTDescNC, DrPSBonificacion, CveProyecto, Proyecto, CveSubProyecto, SubProyecto)
Else Else
@@ -24107,9 +24244,20 @@ Partial Class Ventas
'DEBE AGREGAR LOS USADOS DE LA REMISION EN LA NOTA DE CREDITO 'DEBE AGREGAR LOS USADOS DE LA REMISION EN LA NOTA DE CREDITO
If UsuarioActual.CveEmpresa = 140 AndAlso (ListaRemisionesNC IsNot Nothing AndAlso ListaRemisionesNC.Count > 0) Then If UsuarioActual.CveEmpresa = 140 AndAlso (ListaRemisionesNC IsNot Nothing AndAlso ListaRemisionesNC.Count > 0) Then
CrearDTNCCargo(ListaRemisionesNC, DtImpuestos, TmpDT, DrPS, CveProyecto, Proyecto, CveSubProyecto, SubProyecto) If AplicaRNCXDetalle Then
CrearDTNCCargoDetalle(ListaRemisionesNC, TmpDT, DrPS, CveProyecto, Proyecto, CveSubProyecto, SubProyecto)
Else
CrearDTNCCargo(ListaRemisionesNC, TmpDT, DrPS, CveProyecto, Proyecto, CveSubProyecto, SubProyecto)
End If
'EN LA NC DE BONIFICACION EL CONCEPTO DEBE SER SIEMPRE 'BONIFICACION POR USADO' 'EN LA NC DE BONIFICACION EL CONCEPTO DEBE SER SIEMPRE 'BONIFICACION POR USADO'
Dim DrPSBonificacion = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=360481).FiltroPrimero("") 'CONSULTA EL CONCEPTO DE NC
Dim ArrayNC As String() = UsuarioActual.Empresa.Funcionalidad(591).Split(",".ToCharArray())
Dim NCBonificacion As Integer = 0
If ArrayNC.Length > 4 Then
NCBonificacion = ArrayNC(4).ToEntero()
End If
Dim DrPSBonificacion = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=NCBonificacion).FiltroPrimero("")
If DrPSBonificacion IsNot Nothing Then If DrPSBonificacion IsNot Nothing Then
CrearDTNCBonificacion(ListaRemisionesNC, DtImpuestosBonificacion, TmpDT, DrPSBonificacion, CveProyecto, Proyecto, CveSubProyecto, SubProyecto) CrearDTNCBonificacion(ListaRemisionesNC, DtImpuestosBonificacion, TmpDT, DrPSBonificacion, CveProyecto, Proyecto, CveSubProyecto, SubProyecto)
Else Else
@@ -24170,42 +24318,104 @@ Partial Class Ventas
UPCondicionesPago.Update() UPCondicionesPago.Update()
End Sub End Sub
Private Sub CrearDTNCCargo(ListaNC As List(Of Modelos.Factura), DtImpuestos As DataTable, ByRef TmpDTCargo As DataTable, DrPS As DataRow, CveProyecto As Integer, Proyecto As String, CveSubProyecto As Integer, SubProyecto As String) Private Sub CrearDTNCCargo(ListaNC As List(Of Modelos.Factura), ByRef TmpDTCargo As DataTable, DrPS As DataRow, CveProyecto As Integer, Proyecto As String, CveSubProyecto As Integer, SubProyecto As String)
For Each Dr As DataRow In DtImpuestos.Rows For Each RNC In ListaNC
For Each RNC In ListaNC Dim UltimoRenglonRNC As Integer = 1
Dim UltimoRenglonRNC As Integer = 1 Dim TotalAcumuladoRNC As Decimal = 0
For Each RowUsado As DataRow In RNC.DtDetalle.Rows
Dim PorcentajeUsado = ((RowUsado("Total").ToString().ToDecimal() - RowUsado("Descuento").ToString().ToDecimal() + RowUsado("ImporteIVA").ToString().ToDecimal() + RowUsado("ImporteIEPS").ToString().ToDecimal() - RowUsado("ImporteRetIVA").ToString().ToDecimal() - RowUsado("ImporteRetISR").ToString().ToDecimal()) / RNC.Total) / ListaNC.Count For Each RowUsado As DataRow In RNC.DtDetalle.Rows
Dim Obs = RowUsado("CodigoPS").ToString()
If Not String.IsNullOrEmpty(TxtNCObservaciones.Text.Trim()) Then Dim PorcentajeAplicado = (RNC.TotalRemNCAplicado / RNC.Total)
Obs = String.Format("{0} - {1}", Obs, TxtNCObservaciones.Text.Trim())
Dim Cantidad As Decimal = RowUsado("Cantidad").ToString().ToDecimal() * PorcentajeAplicado
Dim Obs = RowUsado("CodigoPS").ToString()
If Not String.IsNullOrEmpty(TxtNCObservaciones.Text.Trim()) Then
Obs = String.Format("{0} - {1}", Obs, TxtNCObservaciones.Text.Trim())
End If
Dim ImportePU = RowUsado("PU").ToString().ToDecimal
Dim TotalCalculableImpuestos As Decimal = (Cantidad * ImportePU)
Dim ImporteIVA = (TotalCalculableImpuestos * RowUsado("PorcentajeIVA").ToString().ToDecimal).RoundSQL(2)
Dim ImporteIEPS = (TotalCalculableImpuestos * RowUsado("PorcentajeIEPS").ToString().ToDecimal).RoundSQL(2)
Dim ImporteRetIVA = (TotalCalculableImpuestos * RowUsado("PorcentajeRetIVA").ToString().ToDecimal).RoundSQL(2)
Dim ImporteRetISR = (TotalCalculableImpuestos * RowUsado("PorcentajeRetISR").ToString().ToDecimal).RoundSQL(2)
Dim ImporteTotal = TotalCalculableImpuestos
TotalAcumuladoRNC += (TotalCalculableImpuestos + ImporteIVA + ImporteIEPS - ImporteRetIVA - ImporteRetISR)
'SI ES EL ULTIMO REGLON REALIZA UN AJUSTE
If UltimoRenglonRNC = RNC.DtDetalle.Rows.Count Then
Dim Ajuste As Decimal = 0
If Math.Abs(RNC.TotalRemNCAplicado - TotalAcumuladoRNC) > 0.00 Then
Ajuste = RNC.TotalRemNCAplicado - TotalAcumuladoRNC
ImporteIVA += Ajuste
End If End If
End If
UltimoRenglonRNC += 1
Dim ImportePU = Dr("ImportePU").ToString().ToDecimal * PorcentajeUsado AgregaTempDT(TmpDTCargo, DrPS("CvePS").ToString().ToEntero(), DrPS("PS").ToString(), DrPS("Codigo").ToString(), DrPS("PSCodigo").ToString(), DrPS("CveTipoPS").ToString().ToEntero(), DrPS("Inv_CveMetodoInventario").ToString().ToEntero(),
Dim ImporteIVA = Dr("ImporteIVA").ToString().ToDecimal * PorcentajeUsado
Dim ImporteRetIVA = Dr("ImporteRetIVA").ToString().ToDecimal * PorcentajeUsado
Dim ImporteRetISR = Dr("ImporteRetISR").ToString().ToDecimal * PorcentajeUsado
Dim ImporteIEPS = Dr("ImporteIEPS").ToString().ToDecimal * PorcentajeUsado
Dim ImporteTotal = Dr("ImporteTotal").ToString().ToDecimal * PorcentajeUsado
'If UltimoRenglonRNC = RNC.DtDetalle.Rows.Count Then
' ImportePU += Ajuste
'End If
AgregaTempDT(TmpDTCargo, DrPS("CvePS").ToString().ToEntero(), DrPS("PS").ToString(), DrPS("Codigo").ToString(), DrPS("PSCodigo").ToString(), DrPS("CveTipoPS").ToString().ToEntero(), DrPS("Inv_CveMetodoInventario").ToString().ToEntero(),
DrPS("CveUM").ToString().ToEntero(), DrPS("UnidadMedida").ToString(), DrPS("CveClasificacion").ToString().ToEntero(), DrPS("Clasificacion").ToString(), CveProyecto, Proyecto, CveSubProyecto, SubProyecto, DrPS("CveUM").ToString().ToEntero(), DrPS("UnidadMedida").ToString(), DrPS("CveClasificacion").ToString().ToEntero(), DrPS("Clasificacion").ToString(), CveProyecto, Proyecto, CveSubProyecto, SubProyecto,
Obs, 1, ImportePU, Dr("PorcentajeIVA").ToString().ToDecimal, ImporteIVA, Dr("PorcentajeRetIVA").ToString().ToDecimal, ImporteRetIVA, Obs, Cantidad, ImportePU, RowUsado("PorcentajeIVA").ToString().ToDecimal, ImporteIVA, RowUsado("PorcentajeRetIVA").ToString().ToDecimal, ImporteRetIVA,
Dr("PorcentajeRetISR").ToString().ToDecimal, ImporteRetISR, Dr("PorcentajeIEPS").ToString().ToDecimal, ImporteIEPS, -1, 0.0, ImporteTotal, "", "", -1, -1, RowUsado("PorcentajeRetISR").ToString().ToDecimal, ImporteRetISR, RowUsado("PorcentajeIEPS").ToString().ToDecimal, ImporteIEPS, -1, 0.0, ImporteTotal, "", "", -1, -1,
DrPS("SATClavePS").ToString(), DrPS("SATClaveUnidadMedida").ToString(), -1, -1, -1, -1, -1, -1) DrPS("SATClavePS").ToString(), DrPS("SATClaveUnidadMedida").ToString(), -1, -1, -1, -1, -1, -1, CveVentaDetalleRNC:=RowUsado("CveVentaDetalle").ToString().ToEntero())
UltimoRenglonRNC += 1
Next
Next Next
Next Next
End Sub End Sub
Private Sub CrearDTNCCargoDetalle(ListaNC As List(Of Modelos.Factura), ByRef TmpDTCargo As DataTable, DrPS As DataRow, CveProyecto As Integer, Proyecto As String, CveSubProyecto As Integer, SubProyecto As String)
For Each RNC In ListaNC
Dim UltimoRenglonRNC As Integer = 1
Dim TotalAcumuladoRNC As Decimal = 0
For Each RowUsado As DataRow In Me.TmpDTRNCDetalleSelecciondas.FiltraParametros($"CveVenta={RNC.CveVenta}").Rows
Dim Cantidad As Decimal = RowUsado("Cantidad").ToString().ToDecimal()
Dim Obs = RowUsado("CodigoPS").ToString()
If Not String.IsNullOrEmpty(TxtNCObservaciones.Text.Trim()) Then
Obs = String.Format("{0} - {1}", Obs, TxtNCObservaciones.Text.Trim())
End If
Dim ImportePU = RowUsado("PU").ToString().ToDecimal
Dim TotalCalculableImpuestos As Decimal = (Cantidad * ImportePU)
Dim ImporteIVA = (TotalCalculableImpuestos * RowUsado("PorcentajeIVA").ToString().ToDecimal).RoundSQL(2)
Dim ImporteIEPS = 0 '(TotalCalculableImpuestos * RowUsado("PorcentajeIEPS").ToString().ToDecimal).RoundSQL(2)
Dim ImporteRetIVA = 0 ' (TotalCalculableImpuestos * RowUsado("PorcentajeRetIVA").ToString().ToDecimal).RoundSQL(2)
Dim ImporteRetISR = 0 ' (TotalCalculableImpuestos * RowUsado("PorcentajeRetISR").ToString().ToDecimal).RoundSQL(2)
Dim ImporteTotal = TotalCalculableImpuestos
TotalAcumuladoRNC += (TotalCalculableImpuestos + ImporteIVA)
'SI ES EL ULTIMO REGLON REALIZA UN AJUSTE
If UltimoRenglonRNC = RNC.DtDetalle.Rows.Count Then
Dim Ajuste As Decimal = 0
If Math.Abs(RNC.TotalRemNCAplicado - TotalAcumuladoRNC) > 0.00 Then
Ajuste = RNC.TotalRemNCAplicado - TotalAcumuladoRNC
ImporteIVA += Ajuste
End If
End If
UltimoRenglonRNC += 1
AgregaTempDT(TmpDTCargo, DrPS("CvePS").ToString().ToEntero(), DrPS("PS").ToString(), DrPS("Codigo").ToString(), DrPS("PSCodigo").ToString(), DrPS("CveTipoPS").ToString().ToEntero(), DrPS("Inv_CveMetodoInventario").ToString().ToEntero(),
DrPS("CveUM").ToString().ToEntero(), DrPS("UnidadMedida").ToString(), DrPS("CveClasificacion").ToString().ToEntero(), DrPS("Clasificacion").ToString(), CveProyecto, Proyecto, CveSubProyecto, SubProyecto,
Obs, Cantidad, ImportePU, RowUsado("PorcentajeIVA").ToString().ToDecimal, ImporteIVA, 0, ImporteRetIVA,
0, ImporteRetISR, 0, ImporteIEPS, -1, 0.0, ImporteTotal, "", "", -1, -1,
DrPS("SATClavePS").ToString(), DrPS("SATClaveUnidadMedida").ToString(), -1, -1, -1, -1, -1, -1, CveVentaDetalleRNC:=RowUsado("CveVentaDetalleRNC").ToString().ToEntero())
Next
Next
End Sub
Private Sub CrearDTNCBonificacion(ListaNC As List(Of Modelos.Factura), DtImpuestosBonificacion As DataTable, ByRef TmpDTNC As DataTable, DrPS As DataRow, CveProyecto As Integer, Proyecto As String, CveSubProyecto As Integer, SubProyecto As String) Private Sub CrearDTNCBonificacion(ListaNC As List(Of Modelos.Factura), DtImpuestosBonificacion As DataTable, ByRef TmpDTNC As DataTable, DrPS As DataRow, CveProyecto As Integer, Proyecto As String, CveSubProyecto As Integer, SubProyecto As String)
'SI TIENE DE BONIFICACION LOS AGREGA 'SI TIENE DE BONIFICACION LOS AGREGA
If DtImpuestosBonificacion IsNot Nothing AndAlso ListaNCBonificacion IsNot Nothing AndAlso ListaNCBonificacion.Count > 0 Then If DtImpuestosBonificacion IsNot Nothing AndAlso ListaNCBonificacion IsNot Nothing AndAlso ListaNCBonificacion.Count > 0 Then
@@ -24213,39 +24423,54 @@ Partial Class Ventas
TmpDTDescNCBonificacion = TmpDTNC.Clone() TmpDTDescNCBonificacion = TmpDTNC.Clone()
TmpDTDescNCBonificacion.Clear() TmpDTDescNCBonificacion.Clear()
For Each Dr As DataRow In DtImpuestosBonificacion.Rows For Each RNCBonificacion In ListaNCBonificacion
For Each RNC In ListaNCBonificacion Dim UltimoRenglonRNC As Integer = 1
Dim UltimoRenglonRNC As Integer = 1 Dim TotalAcumuladoRNC As Decimal = 0
Dim RNCCargo = ListaNC.Where(Function(f) f.CveVenta = RNC.CveVentaRNCCargo).FirstOrDefault() Dim RNCCargo = ListaNC.Where(Function(f) f.CveVenta = RNCBonificacion.CveVentaRNCCargo).FirstOrDefault()
For Each RowCargo As DataRow In RNCCargo.DtDetalle.Rows For Each RowCargo As DataRow In RNCCargo.DtDetalle.Rows
Dim PorcentajeCargo = ((RowCargo("Total").ToString().ToDecimal() - RowCargo("Descuento").ToString().ToDecimal() + RowCargo("ImporteIVA").ToString().ToDecimal() + RowCargo("ImporteIEPS").ToString().ToDecimal() - RowCargo("ImporteRetIVA").ToString().ToDecimal() - RowCargo("ImporteRetISR").ToString().ToDecimal()) / RNCCargo.Total) / ListaNCBonificacion.Count Dim PorcentajeAplicado = (RNCBonificacion.TotalRemNCAplicado / RNCBonificacion.Total)
Dim Obs = RowCargo("CodigoPS").ToString() Dim Cantidad As Decimal = RowCargo("Cantidad").ToString().ToDecimal() * PorcentajeAplicado
If Not String.IsNullOrEmpty(TxtNCObservaciones.Text.Trim()) Then Dim Obs = RowCargo("CodigoPS").ToString()
Obs = String.Format("{0} - {1}", Obs, TxtNCObservaciones.Text.Trim())
If Not String.IsNullOrEmpty(TxtNCObservaciones.Text.Trim()) Then
Obs = String.Format("{0} - {1}", Obs, TxtNCObservaciones.Text.Trim())
End If
Dim ImportePU = RowCargo("PUBonificacion").ToString().ToDecimal
Dim TotalCalculableImpuestos As Decimal = (Cantidad * ImportePU)
Dim ImporteIVA = (TotalCalculableImpuestos * RowCargo("PorcentajeIVA").ToString().ToDecimal).RoundSQL(2)
Dim ImporteIEPS = (TotalCalculableImpuestos * RowCargo("PorcentajeIEPS").ToString().ToDecimal).RoundSQL(2)
Dim ImporteRetIVA = (TotalCalculableImpuestos * RowCargo("PorcentajeRetIVA").ToString().ToDecimal).RoundSQL(2)
Dim ImporteRetISR = (TotalCalculableImpuestos * RowCargo("PorcentajeRetISR").ToString().ToDecimal).RoundSQL(2)
Dim ImporteTotal = TotalCalculableImpuestos
TotalAcumuladoRNC += (TotalCalculableImpuestos + ImporteIVA + ImporteIEPS - ImporteRetIVA - ImporteRetISR)
'SI ES EL ULTIMO REGLON REALIZA UN AJUSTE
If UltimoRenglonRNC = RNCCargo.DtDetalle.Rows.Count Then
Dim Ajuste As Decimal = 0
If Math.Abs(RNCBonificacion.TotalRemNCAplicado - TotalAcumuladoRNC) > 0.00 Then
Ajuste = RNCBonificacion.TotalRemNCAplicado - TotalAcumuladoRNC
ImporteIVA += Ajuste
End If End If
End If
UltimoRenglonRNC += 1
Dim ImportePU = Dr("ImportePU").ToString().ToDecimal * PorcentajeCargo AgregaTempDT(TmpDTDescNCBonificacion, DrPS("CvePS").ToString().ToEntero(), DrPS("PS").ToString(), DrPS("Codigo").ToString(), DrPS("PSCodigo").ToString(), DrPS("CveTipoPS").ToString().ToEntero(), DrPS("Inv_CveMetodoInventario").ToString().ToEntero(),
Dim ImporteIVA = Dr("ImporteIVA").ToString().ToDecimal * PorcentajeCargo
Dim ImporteRetIVA = Dr("ImporteRetIVA").ToString().ToDecimal * PorcentajeCargo
Dim ImporteRetISR = Dr("ImporteRetISR").ToString().ToDecimal * PorcentajeCargo
Dim ImporteIEPS = Dr("ImporteIEPS").ToString().ToDecimal * PorcentajeCargo
Dim ImporteTotal = Dr("ImporteTotal").ToString().ToDecimal * PorcentajeCargo
AgregaTempDT(TmpDTDescNCBonificacion, DrPS("CvePS").ToString().ToEntero(), DrPS("PS").ToString(), DrPS("Codigo").ToString(), DrPS("PSCodigo").ToString(), DrPS("CveTipoPS").ToString().ToEntero(), DrPS("Inv_CveMetodoInventario").ToString().ToEntero(),
DrPS("CveUM").ToString().ToEntero(), DrPS("UnidadMedida").ToString(), DrPS("CveClasificacion").ToString().ToEntero(), DrPS("Clasificacion").ToString(), CveProyecto, Proyecto, CveSubProyecto, SubProyecto, DrPS("CveUM").ToString().ToEntero(), DrPS("UnidadMedida").ToString(), DrPS("CveClasificacion").ToString().ToEntero(), DrPS("Clasificacion").ToString(), CveProyecto, Proyecto, CveSubProyecto, SubProyecto,
Obs, 1, ImportePU, Dr("PorcentajeIVA").ToString().ToDecimal, ImporteIVA, Dr("PorcentajeRetIVA").ToString().ToDecimal, ImporteRetIVA, Obs, Cantidad, ImportePU, RowCargo("PorcentajeIVA").ToString().ToDecimal, ImporteIVA, RowCargo("PorcentajeRetIVA").ToString().ToDecimal, ImporteRetIVA,
Dr("PorcentajeRetISR").ToString().ToDecimal, ImporteRetISR, Dr("PorcentajeIEPS").ToString().ToDecimal, ImporteIEPS, -1, 0.0, ImporteTotal, "", "", -1, -1, RowCargo("PorcentajeRetISR").ToString().ToDecimal, ImporteRetISR, RowCargo("PorcentajeIEPS").ToString().ToDecimal, ImporteIEPS, -1, 0.0, ImporteTotal, "", "", -1, -1,
DrPS("SATClavePS").ToString(), DrPS("SATClaveUnidadMedida").ToString(), -1, -1, -1, -1, -1, -1) DrPS("SATClavePS").ToString(), DrPS("SATClaveUnidadMedida").ToString(), -1, -1, -1, -1, -1, -1)
UltimoRenglonRNC += 1
Next
Next Next
Next Next
End If End If
End Sub End Sub
@@ -24360,7 +24585,7 @@ Partial Class Ventas
PorcentajeRetISR As Double, ImporteRetISR As Double, PorcentajeIEPS As Double, ImporteIEPS As Double, TipoDescuento As Integer, Descuento As Double, PorcentajeRetISR As Double, ImporteRetISR As Double, PorcentajeIEPS As Double, ImporteIEPS As Double, TipoDescuento As Integer, Descuento As Double,
Total As Double, Serie As String, TiempoEntrega As String, CvePresupuestoIngreso As Integer, EntregaDirecta As Integer, SATClaveProdServ As String, Total As Double, Serie As String, TiempoEntrega As String, CvePresupuestoIngreso As Integer, EntregaDirecta As Integer, SATClaveProdServ As String,
SATClaveUM As String, CveContratoDetalle As Integer, CveVentaDetalle As Integer, CveMovimientoDetallePedido As Integer, CveOrdenCompraDetalle As Integer, SATClaveUM As String, CveContratoDetalle As Integer, CveVentaDetalle As Integer, CveMovimientoDetallePedido As Integer, CveOrdenCompraDetalle As Integer,
CveVentaDetalleRemision As Integer, CveVentaDetalleCotizacion As Integer, Optional CveTamaño As Integer = -1) CveVentaDetalleRemision As Integer, CveVentaDetalleCotizacion As Integer, Optional CveTamaño As Integer = -1, Optional CveVentaDetalleRNC As Integer = -1)
Dim Row As DataRow = Nothing Dim Row As DataRow = Nothing
Row = TmpDT.NewRow() Row = TmpDT.NewRow()
@@ -24420,6 +24645,7 @@ Partial Class Ventas
Row("CveVentaDetalleCotizacion") = CveVentaDetalleCotizacion Row("CveVentaDetalleCotizacion") = CveVentaDetalleCotizacion
Row("CveTamaño") = CveTamaño Row("CveTamaño") = CveTamaño
Row("CveVentaDetalleRNC") = CveVentaDetalleRNC
TmpDT.Rows.Add(Row) TmpDT.Rows.Add(Row)
End Sub End Sub
@@ -25467,7 +25693,8 @@ Partial Class Ventas
If Not ObjVentas.AddVentaDetalle(CveVenta, Row("CvePS").ToString().ToEntero(), Row("Cantidad").ToString().ToDouble, Row("CveUM").ToString().ToEntero(), If Not ObjVentas.AddVentaDetalle(CveVenta, Row("CvePS").ToString().ToEntero(), Row("Cantidad").ToString().ToDouble, Row("CveUM").ToString().ToEntero(),
Row("PU").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), Row("ImporteIVA").ToString().ToDouble, Math.Round((Row("Total").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)) * (1 + Row("PorcentajeIVA").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)))), 6), Row("PU").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), Row("ImporteIVA").ToString().ToDouble, Math.Round((Row("Total").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)) * (1 + Row("PorcentajeIVA").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)))), 6),
Row("Obs").ToString(), Row("Descuento").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), Row("TipoDescuento").ToString().ToEntero(), Row("CveSubProyecto").ToString().ToEntero(), Row("CvePresupuestoIngreso").ToString().ToEntero(), Row("Obs").ToString(), Row("Descuento").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), Row("TipoDescuento").ToString().ToEntero(), Row("CveSubProyecto").ToString().ToEntero(), Row("CvePresupuestoIngreso").ToString().ToEntero(),
PorcentajeIVA:=Row("PorcentajeIVA").ToString().ToDecimal, IEPS:=Row("ImporteIEPS").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), PorcentajeIEPS:=Row("PorcentajeIEPS").ToString().ToDouble, TiempoEntrega:=Row("TiempoEntrega").ToString()) Then PorcentajeIVA:=Row("PorcentajeIVA").ToString().ToDecimal, IEPS:=Row("ImporteIEPS").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), PorcentajeIEPS:=Row("PorcentajeIEPS").ToString().ToDouble, TiempoEntrega:=Row("TiempoEntrega").ToString(),
PorcentajeRetIVA:=Row("PorcentajeRetIVA").ToString().ToDecimal, ImporteRetIVA:=Row("ImporteRetIVA").ToString().ToDecimal) Then
MensajeError = "Ocurrió un error al guardar las partidas de la cotización" MensajeError = "Ocurrió un error al guardar las partidas de la cotización"
OcurrioError = True OcurrioError = True
Exit For Exit For
@@ -27235,6 +27462,8 @@ Partial Class Ventas
#Region "D E S C U E N T O S X R E M I S I O N D E N O T A D E C R E D I T O" #Region "D E S C U E N T O S X R E M I S I O N D E N O T A D E C R E D I T O"
Protected Sub BtnAplicarRemisionNC_Click(sender As Object, e As EventArgs) Protected Sub BtnAplicarRemisionNC_Click(sender As Object, e As EventArgs)
Me.AplicaRNCXDetalle = False
If ListaRemisionesNC Is Nothing Then If ListaRemisionesNC Is Nothing Then
ListaRemisionesNC = New List(Of Modelos.Factura) ListaRemisionesNC = New List(Of Modelos.Factura)
Else Else
@@ -27248,69 +27477,139 @@ Partial Class Ventas
End If End If
Dim TotalRemNCAplicado As Decimal = 0 Dim TotalRemNCAplicado As Decimal = 0
For Each GvRow As GridViewRow In GvRemisionesNC.Rows
If GvRow.RowType = DataControlRowType.DataRow Then
If GvRow.FCCheckBox("ChkAplicar").Checked Then
Dim RemNC As New Modelos.Factura(UsuarioActual, GvRow.DataKey("CveVenta").ToEntero(), UsuarioActual.CveEmpresa)
RemNC.TotalRemNCAplicado = GvRow.FCTextBox("TxtImporte").Text.ToDecimal()
TotalRemNCAplicado += RemNC.TotalRemNCAplicado
If RemNC.TotalRemNCAplicado <= 0 Then If ChkMostarProductosRNC.Checked Then
Alert($"Debe asignar un importe en la siguiente remisión: <b>{RemNC.SerieFolio}</b>", TipoMensaje.MsgAdvertencia)
ListaRemisionesNC.Clear() Me.AplicaRNCXDetalle = True
Exit Sub
For Each GvRow As GridViewRow In GvRemisionesNCDetalle.Rows
If GvRow.RowType = DataControlRowType.DataRow Then
If GvRow.FCCheckBox("ChkAplicar").Checked Then
Dim Rows = TmpDTRNCDetalle.Select($"CveVentaDetalleRNC = {GvRow.DataKey("CveVentaDetalleRNC").ToEntero()}")
For Each row In Rows
row("Cantidad") = GvRow.FCTextBox("TxtCantidadRNC").Text.ToEntero()
TmpDTRNCDetalleSelecciondas.Rows.Add(row.ItemArray)
Next
End If End If
ListaRemisionesNC.Add(RemNC)
End If
End If
Next
'SI TIENE ALGUN AJUSTE O GARANTIA
If ListaRemisionesNC.Any(Function(RNC) RNC.Num2 = 1) Then
For Each RNC In ListaRemisionesNC.Where(Function(x) x.Num2 = 1)
Dim Salir As Boolean = False
Using ObjAcum As New ClsAcumuladores
If ObjAcum.GetGarantiasDetalle(RNC.CveVenta) Then
'SI ES GARANTIA TOTAL
If ObjAcum.DtResultados.MAX("PorcentajeAjuste") = "1" Then
DdlNCPS.SelectedValueExist(443174)
DdlNCPS.Enabled = False
Salir = True
Else
DdlNCPS.SelectedValueExist(443173)
DdlNCPS.Enabled = False
End If
End If
End Using
If Salir Then
Exit For
End If End If
Next Next
For Each Dr As DataRow In TmpDTRNCDetalleSelecciondas.FiltraParametros("", DistinctColumns:={"CveVenta"}).Rows
Dim RemNC As New Modelos.Factura(UsuarioActual, Dr("CveVenta").ToString().ToEntero(), UsuarioActual.CveEmpresa)
Dim TotalRNC As Decimal = 0
For Each GvRow As GridViewRow In GvRemisionesNCDetalle.Rows
If GvRow.RowType = DataControlRowType.DataRow Then
If GvRow.FCCheckBox("ChkAplicar").Checked AndAlso GvRow.DataKey("CveVenta").ToEntero() = Dr("CveVenta").ToString().ToEntero() Then
Dim Cantidad As Decimal = GvRow.FCTextBox("TxtCantidadRNC").Text.ToDecimal()
Dim PU = GvRow.DataKey("PU").ToDecimal()
Dim PorcentajeIVA As Decimal = GvRow.DataKey("PorcentajeIVA").ToDecimal()
Dim TotalCalculableImpuestos As Decimal = (Cantidad * PU)
Dim ImporteIVA As Decimal = (TotalCalculableImpuestos * PorcentajeIVA).RoundSQL(2)
Dim TotalRNCDetalle As Decimal = (TotalCalculableImpuestos + ImporteIVA)
TotalRNC += TotalRNCDetalle
End If
End If
Next
RemNC.TotalRemNCAplicado = TotalRNC
'MARCA LA VENTA QUE FUE USADA PARA EL FILTRO
RemNC.Num3 = DdlVentaUsado.SelectedValue.ToEntero()
TotalRemNCAplicado += RemNC.TotalRemNCAplicado
If RemNC.TotalRemNCAplicado <= 0 Then
Alert($"Debe asignar un importe en la siguiente remisión: <b>{RemNC.SerieFolio}</b>", TipoMensaje.MsgAdvertencia)
ListaRemisionesNC.Clear()
Exit Sub
End If
ListaRemisionesNC.Add(RemNC)
Next
Else Else
DdlNCPS.Enabled = True
End If
For Each GvRow As GridViewRow In GvRemisionesNC.Rows
If GvRow.RowType = DataControlRowType.DataRow Then
If GvRow.FCCheckBox("ChkAplicar").Checked Then
Dim RemNC As New Modelos.Factura(UsuarioActual, GvRow.DataKey("CveVenta").ToEntero(), UsuarioActual.CveEmpresa)
RemNC.TotalRemNCAplicado = GvRow.FCTextBox("TxtImporte").Text.ToDecimal()
'MARCA LA VENTA QUE FUE USADA PARA EL FILTRO
RemNC.Num3 = DdlVentaUsado.SelectedValue.ToEntero()
TotalRemNCAplicado += RemNC.TotalRemNCAplicado
For Each GvRow As GridViewRow In GvRemisionesNCBon.Rows If RemNC.TotalRemNCAplicado <= 0 Then
If GvRow.RowType = DataControlRowType.DataRow Then Alert($"Debe asignar un importe en la siguiente remisión: <b>{RemNC.SerieFolio}</b>", TipoMensaje.MsgAdvertencia)
If GvRow.FCCheckBox("ChkAplicar").Checked Then ListaRemisionesNC.Clear()
Dim RemNC As New Modelos.Factura(UsuarioActual, GvRow.DataKey("CveVenta").ToEntero(), UsuarioActual.CveEmpresa) Exit Sub
RemNC.TotalRemNCAplicado = GvRow.FCTextBox("TxtImporte").Text.ToDecimal() End If
RemNC.CveVentaRNCCargo = GvRow.DataKey("CveVentaRNCCargo").ToEntero()
TotalRemNCAplicado += RemNC.TotalRemNCAplicado
If RemNC.TotalRemNCAplicado <= 0 Then ListaRemisionesNC.Add(RemNC)
Alert($"Debe asignar un importe en la siguiente remisión: <b>{RemNC.SerieFolio}</b>", TipoMensaje.MsgAdvertencia) End If
ListaNCBonificacion.Clear() End If
Exit Sub Next
'SI TIENE ALGUN AJUSTE O GARANTIA
If ListaRemisionesNC.Any(Function(RNC) RNC.Num2 = 1) Then
For Each RNC In ListaRemisionesNC.Where(Function(x) x.Num2 = 1)
Dim Salir As Boolean = False
Dim ArrayNC As String() = UsuarioActual.Empresa.Funcionalidad(591).Split(",".ToCharArray())
Dim NCAjuste As Integer = -1
Dim NCGarantiaTotal As Integer = -1
If ArrayNC.Length > 2 Then
NCAjuste = ArrayNC(1).ToEntero()
NCGarantiaTotal = ArrayNC(2).ToEntero()
End If End If
ListaNCBonificacion.Add(RemNC) Using ObjAcum As New ClsAcumuladores
End If If ObjAcum.GetGarantiasDetalle(RNC.CveVenta) Then
'SI ES GARANTIA TOTAL
If ObjAcum.DtResultados.MAX("PorcentajeAjuste") = "1" Then
DdlNCPS.SelectedValueExist(NCGarantiaTotal)
DdlNCPS.Enabled = False
Salir = True
Else
DdlNCPS.SelectedValueExist(NCAjuste)
DdlNCPS.Enabled = False
End If
End If
End Using
If Salir Then
Exit For
End If
Next
Else
DdlNCPS.Enabled = True
End If End If
Next
For Each GvRow As GridViewRow In GvRemisionesNCBon.Rows
If GvRow.RowType = DataControlRowType.DataRow Then
If GvRow.FCCheckBox("ChkAplicar").Checked Then
Dim RemNC As New Modelos.Factura(UsuarioActual, GvRow.DataKey("CveVenta").ToEntero(), UsuarioActual.CveEmpresa)
RemNC.TotalRemNCAplicado = GvRow.FCTextBox("TxtImporte").Text.ToDecimal()
RemNC.CveVentaRNCCargo = GvRow.DataKey("CveVentaRNCCargo").ToEntero()
TotalRemNCAplicado += RemNC.TotalRemNCAplicado
If RemNC.TotalRemNCAplicado <= 0 Then
Alert($"Debe asignar un importe en la siguiente remisión: <b>{RemNC.SerieFolio}</b>", TipoMensaje.MsgAdvertencia)
ListaNCBonificacion.Clear()
Exit Sub
End If
ListaNCBonificacion.Add(RemNC)
End If
End If
Next
End If
TxtImportesRemisionesNC.Text = TotalRemNCAplicado.FormatoNumero TxtImportesRemisionesNC.Text = TotalRemNCAplicado.FormatoNumero
TxtNCImporte.Text = TotalRemNCAplicado.FormatoNumero TxtNCImporte.Text = TotalRemNCAplicado.FormatoNumero
@@ -27330,6 +27629,12 @@ Partial Class Ventas
Dim CveSATNC = "84111506" Dim CveSATNC = "84111506"
Dim DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, SATClavePS:=CveSATNC, AplicaParaVenta:=1).Rows(0) Dim DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, SATClavePS:=CveSATNC, AplicaParaVenta:=1).Rows(0)
Dim ArrayNC As String() = UsuarioActual.Empresa.Funcionalidad(591).Split(",".ToCharArray())
If ArrayNC.Length > 0 Then
Dim CvePSNC As Integer = ArrayNC(0).ToEntero()
DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSNC, AplicaParaVenta:=1).Rows(0)
End If
If DrPS Is Nothing Then If DrPS Is Nothing Then
Alert("Ocurrió un error al cargar la información del Producto. Por favor vuelva a intentar.", TipoMensaje.MsgError) Alert("Ocurrió un error al cargar la información del Producto. Por favor vuelva a intentar.", TipoMensaje.MsgError)
Exit Sub Exit Sub
@@ -27372,14 +27677,22 @@ Partial Class Ventas
If ListaNCDesc.Any(Function(RNC) RNC.Num2 = 1) Then If ListaNCDesc.Any(Function(RNC) RNC.Num2 = 1) Then
For Each RNC In ListaRemisionesNC.Where(Function(x) x.Num2 = 1) For Each RNC In ListaRemisionesNC.Where(Function(x) x.Num2 = 1)
Dim Salir As Boolean = False Dim Salir As Boolean = False
Dim NCAjuste As Integer = -1
Dim NCGarantiaTotal As Integer = -1
If ArrayNC.Length > 2 Then
NCAjuste = ArrayNC(1).ToEntero()
NCGarantiaTotal = ArrayNC(2).ToEntero()
End If
Using ObjAcum As New ClsAcumuladores Using ObjAcum As New ClsAcumuladores
If ObjAcum.GetGarantiasDetalle(RNC.CveVenta) Then If ObjAcum.GetGarantiasDetalle(RNC.CveVenta) Then
'SI ES GARANTIA TOTAL 'SI ES GARANTIA TOTAL
If ObjAcum.DtResultados.MAX("PorcentajeAjuste") = "1" Then If ObjAcum.DtResultados.MAX("PorcentajeAjuste") = "1" Then
DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=443174, AplicaParaVenta:=1).Rows(0) DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=NCGarantiaTotal, AplicaParaVenta:=1).Rows(0)
Salir = True Salir = True
Else Else
DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=443173, AplicaParaVenta:=1).Rows(0) DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=NCAjuste, AplicaParaVenta:=1).Rows(0)
End If End If
End If End If
End Using End Using
@@ -27499,7 +27812,7 @@ Partial Class Ventas
#End Region #End Region
Protected Sub BtnModalAplicarRemisionesNC_Click(sender As Object, e As EventArgs) Protected Sub BtnModalAplicarRemisionesNC_Click(sender As Object, e As EventArgs)
CargaRNC() ChkMostarProductosRNC_CheckedChanged(ChkMostarProductosRNC, EventArgs.Empty)
RegistraScript("$('#ModalAplicarRemisionesNC').modal({backdrop: 'static', keyboard: false });") RegistraScript("$('#ModalAplicarRemisionesNC').modal({backdrop: 'static', keyboard: false });")
End Sub End Sub
@@ -28096,4 +28409,5 @@ Partial Class Ventas
Public ImporteBonificacion As Decimal = 0 Public ImporteBonificacion As Decimal = 0
Public IVABonificacion As Decimal = 0 Public IVABonificacion As Decimal = 0
End Class End Class
End Class End Class