Ayven - Formato OC, tomando como base el de E72

This commit is contained in:
rakcsle
2024-06-07 22:16:53 -07:00
parent aa981bbc38
commit 9d7302846e
16 changed files with 852 additions and 315 deletions

View File

@@ -1539,6 +1539,7 @@ Public Class ClsMovimientos
Optional CveCondicionesPago As Integer = -1, Optional CveTipoTransaccion As Integer = -1, Optional CveMoneda As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_RepRecuperacion")
SqlAdapter.SelectCommand.CommandTimeout = 0
With SqlAdapter.SelectCommand.Parameters
.Add("@CveResponsable", SqlDbType.Int).Value = CveResponsable
.Add("@FechaI", SqlDbType.Date).Value = FechaI

View File

@@ -708,7 +708,7 @@ Public Class ClsOC
Optional PorcentajeIVA As Decimal = 0.16D, Optional IVA As Decimal = 0, Optional RetIVA As Decimal = 0, Optional RetISR As Decimal = 0, Optional FechaExpiracion As Date = Nothing, Optional CveCotizacion As Integer = -1,
Optional FolioAdicional As String = "", Optional EntregaDirecta As Integer = -1, Optional CveDireccionEnvio As Integer = -1, Optional Guia As String = "-1", Optional IEPS As Decimal = -1,
Optional CveIEAnticipo As Integer = -1, Optional ImporteAnticipo As Decimal = 0, Optional UsoCFDI As Integer = -1, Optional Promocion As String = "-1", Optional CveProveedorContacto As Integer = -1, Optional NumRemision As String = "-1",
Optional CveColectiva As Integer = -1, Optional MetodoPago As Integer = -1) As Boolean
Optional CveColectiva As Integer = -1, Optional MetodoPago As Integer = -1, Optional CveSubProyectoEntrega As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_OC_OrdenesCompraAdd")
@@ -754,6 +754,7 @@ Public Class ClsOC
.Add("@NumRemision", SqlDbType.VarChar).Value = NumRemision
.Add("@CveColectiva", SqlDbType.Int).Value = CveColectiva
.Add("@MetodoPago", SqlDbType.Int).Value = MetodoPago ' 0 Contado, 1 Credito
.Add("@CveSubProyectoEntrega", SqlDbType.Int).Value = CveSubProyectoEntrega ' 0 Contado, 1 Credito
.Add("@vCveOrdenCompra", SqlDbType.Int).Direction = ParameterDirection.Output
.Add("@vFolio", SqlDbType.Int).Direction = ParameterDirection.Output
@@ -917,7 +918,8 @@ Public Class ClsOC
pCveProveedor As Integer, pCveOrdenCompra As Integer, pCveUsuarioModifico As Integer, Optional CveCliente As Integer = -1, Optional CveVendedor As Integer = -1, Optional PrioridadObservacion As String = "",
Optional IVA As Decimal = 0, Optional RetIVA As Decimal = 0, Optional RetISR As Decimal = 0, Optional IDPoliza As Integer = -1, Optional FechaExpiracion As Date = Nothing, Optional FolioAdicional As String = "",
Optional EntregaDirecta As Integer = -1, Optional CveDireccionEnvio As Integer = -1, Optional Guia As String = "-1", Optional IEPS As Decimal = -1, Optional UsoCFDI As Integer = -1, Optional Promocion As String = "-1",
Optional pCveProveedorSucursal As Integer = -1, Optional CveProveedorContacto As Integer = -1, Optional PorcentajeIVA As Decimal = 0.16D, Optional NumRemision As String = "-1", Optional MetodoPago As Integer = -1) As Boolean
Optional pCveProveedorSucursal As Integer = -1, Optional CveProveedorContacto As Integer = -1, Optional PorcentajeIVA As Decimal = 0.16D, Optional NumRemision As String = "-1", Optional MetodoPago As Integer = -1,
Optional CveSubProyectoEntrega As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_OC_OrdenesCompraUpdate")
@@ -953,6 +955,8 @@ Public Class ClsOC
.Add("@PorcentajeIVA", SqlDbType.SmallMoney).Value = PorcentajeIVA
.Add("@NumRemision", SqlDbType.VarChar).Value = NumRemision
.Add("@MetodoPago", SqlDbType.Int).Value = MetodoPago ' 0 Contado, 1 Credito
.Add("@CveSubProyectoEntrega", SqlDbType.Int).Value = CveSubProyectoEntrega
End With
Try

View File

@@ -7632,8 +7632,67 @@ Public Class ClsPaginas
DtDetalle = ObjOC.DtResultados
End If
'Obtenemos la sucursal de la OC PARA COMPU PROVEEDORES
Dim DomicilioSucursal As String = ""
If UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso UsuarioActual.CveEmpresa = 197 Then
Dim SBDomicilioSucursal As New StringBuilder()
Dim CiudadSucursal As String = ""
Dim ObjClientes As New ClsClientes
params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("RFC", UsuarioActual.Empresa.RFC))
If ObjOC.GetSucursalOC(ObjOC.CveOrdenCompra) AndAlso ObjOC.DtResultados.Rows.Count > 0 Then
params.Add(New ReportParameter("Proyecto", ObjOC.SucSubProyecto.ToString))
params.Add(New ReportParameter("Telefono", ObjOC.SucTelefono.ToString))
CiudadSucursal = String.Format("{0},{1}", ObjOC.SucMunicipio, ObjOC.SucEstado)
SBDomicilioSucursal.AppendFormat("{0}", ObjOC.SucCalle)
If ObjOC.SucNoExt.Length > 0 Then SBDomicilioSucursal.AppendFormat(" No.Ext: {0}", ObjOC.SucNoExt)
If ObjOC.SucNoInt.Length > 0 Then SBDomicilioSucursal.AppendFormat(", No.Int: {0}", ObjOC.SucNoInt)
If ObjOC.SucColonia.Length > 0 Then SBDomicilioSucursal.AppendFormat(", Col: {0}", ObjOC.SucColonia)
If ObjOC.SucCP.Length > 0 Then SBDomicilioSucursal.AppendFormat(", CP: {0}", ObjOC.SucCP)
If CiudadSucursal.Length > 0 Then SBDomicilioSucursal.AppendFormat(", {0}", CiudadSucursal)
If ObjOC.SucPais.Length > 0 Then SBDomicilioSucursal.AppendFormat(", {0}", ObjOC.SucPais)
DomicilioSucursal = SBDomicilioSucursal.ToString
Dim DirecconSubProyectoEntrega As String = ""
Dim CveSubProyectoEntrega As Integer = dtOC(0)("CveSubProyectoEntrega").ToString.ToEntero
If CveSubProyectoEntrega > 0 Then
Dim DTSubProyectoEntrega As DataTable = GlobalDTSubProyectos(-1, CveSubProyectoEntrega)
params.Add(New ReportParameter("SubProyectoEntrega", DTSubProyectoEntrega(0)("SubProyecto").ToString))
Dim SubProyectoEntregaDir As String = $"Calle {DTSubProyectoEntrega(0)("Calle").ToString}"
SubProyectoEntregaDir = $"{SubProyectoEntregaDir} No. {DTSubProyectoEntrega(0)("NoExt").ToString()}"
If DTSubProyectoEntrega(0)("NoInt").ToString().Trim.Length > 0 Then
SubProyectoEntregaDir = $"{SubProyectoEntregaDir} No. int.{DTSubProyectoEntrega(0)("NoInt").ToString()}"
End If
SubProyectoEntregaDir = $"{SubProyectoEntregaDir}{vbCrLf}"
SubProyectoEntregaDir = $"{SubProyectoEntregaDir}{DTSubProyectoEntrega(0)("Colonia").ToString()} C.P. {DTSubProyectoEntrega(0)("CP").ToString()}{vbCrLf}"
SubProyectoEntregaDir = $"{SubProyectoEntregaDir}{DTSubProyectoEntrega(0)("Municipio").ToString()},{DTSubProyectoEntrega(0)("Estado").ToString()}{vbCrLf}Tel. { DTSubProyectoEntrega(0)("Telefono").ToString()}"
params.Add(New ReportParameter("SubProyectoEntregaDir", SubProyectoEntregaDir))
End If
End If
End If
Dim CveUsuarioSol As Integer = dtOC(0)("CveUsuarioSolicito").ToString.ToEntero
Dim CveUsuarioAut As Integer = dtOC(0)("CveUsuarioAutorizo").ToString.ToEntero
Dim drSol As DataRow = GlobalDTUsuarios(CveUsuarioSol, EmpresaActual.CveEmpresa).FiltroPrimero("") 'DataRow (incluye el NOMBRE de quien SOLICITÓ la OC)
@@ -7710,7 +7769,7 @@ Public Class ClsPaginas
params.Add(New ReportParameter("TipoOC", If(ObjOC.Tipo = "OC", "Orden de Compra", "Requisición")))
params.Add(New ReportParameter("UsoCFDI", ObjOC.UsoCFDI))
If UsuarioActual.CveEmpresa.Contiene(72, 80, 172) Then
If UsuarioActual.CveEmpresa.Contiene(72, 80, 172) Or (UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso UsuarioActual.CveEmpresa = 197) Then
params.Add(New ReportParameter("FolioAdicional", dtOC(0)("FolioAdicional").ToString))
params.Add(New ReportParameter("Vendedor", dtOC(0)("Vendedor").ToString))
params.Add(New ReportParameter("Observacion", dtOC(0)("PrioridadObservacion").ToString))
@@ -7723,6 +7782,7 @@ Public Class ClsPaginas
params.Add(New ReportParameter("ProveedorContacto", ObjOC.ProveedorContacto))
params.Add(New ReportParameter("Comprador", ObjOC.UsuarioAsignado))
End If
If UsuarioActual.CveEmpresa.Contiene(13, 83) Then
'Dim ObjCuentasBancos As New ClsGenerales()
'If ObjCuentasBancos.GetCuentasDepositos(CveProveedor:=ObjOC.CveProveedor) Then
@@ -7737,6 +7797,7 @@ Public Class ClsPaginas
'End If
'ObjCuentasBancos.Dispose()
End If
'params.Add(New ReportParameter("FechaOC", ObjOC.Fecha.ToShortDateString))
Dim RutaFisicaSol As String = String.Format("Empresas\{0}\Firmas\{1}.png", EmpresaActual.CveEmpresa, CveUsuarioSol)
Dim RutaVirtuaSol As String = String.Format("{0}://{1}:{2}/ashx/sigfiles.ashx?P={3}", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, Encripta(RutaFisicaSol))

View File

@@ -7,10 +7,21 @@
.row {
margin: 0 -10px;
}
.calendar-extender-popup {
/*.calendar-extender-popup {
position: absolute;
z-index: 10000; /* Asegura que se muestre sobre otros elementos */
z-index: 10000;*/ /* Asegura que se muestre sobre otros elementos */
/*}*/
#C_CETxtFechaEmision_popupDiv{
z-index: 10000; /* Asegura que el calendario se muestre sobre otros elementos */
margin-top:-160px!important;
position: absolute; /* Asegura que el calendario no desplace otros elementos */
}
#C_Calendario_popupDiv{
z-index: 10000; /* Asegura que el calendario se muestre sobre otros elementos */
margin-left:-50px!important;
position: absolute; /* Asegura que el calendario no desplace otros elementos */
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
@@ -559,7 +570,7 @@
</span>
</div>
<ajax:MaskedEditExtender ID="METxtFechaEmision" runat="server" TargetControlID="TxtFechaEmision" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left" ></ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="CETxtFechaEmision" runat="server" TargetControlID="TxtFechaEmision" PopupButtonID="LnkImgTxtFechaEmision" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<ajax:CalendarExtender ID="CETxtFechaEmision" runat="server" TargetControlID="TxtFechaEmision" PopupButtonID="LnkImgTxtFechaEmision" PopupPosition="TopLeft" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RfvTxtFechaEmision" runat="server" ControlToValidate="TxtFechaEmision" Display="None" ErrorMessage="El campo <b>''Fecha de Emisión''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CVTxtFechaEmision" runat="server" ControlToValidate="TxtFechaEmision" Display="None" ErrorMessage="El campo <b>''Fecha de Emisión''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender4" runat="server" HighlightCssClass="vco" TargetControlID="RfvTxtFechaEmision" Width="350px"></ajax:ValidatorCalloutExtender>

View File

@@ -1112,7 +1112,7 @@ Partial Class Bancos_PopIEVentas
Dim FechaEmision As Date = MinFecha
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
If ChkComplementoPago.Checked AndAlso UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
FechaEmision = TxtFechaEmision.Text.ToDate
If FechaEmision <= MinFecha Then

View File

@@ -2053,7 +2053,7 @@
<asp:UpdatePanel runat="server" ID="UpDocumentos" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDocs" AutoGenerateColumns="false" runat="server" GridLines="none"
DataKeyNames="CveDocumentacion,Documentacion,Orden,CveDocumentacionElectronica,Adjunto,Estatus,Observacion,Fecha,FechaIng,Usuario,FechaLimite,FechaVigencia,DiasLimite,AplicaDiasLimite,AplicaFechaVencimiento">
DataKeyNames="CveDocumentacion,Documentacion,Orden,CveDocumentacionElectronica,Adjunto,Estatus,Observacion,Fecha,FechaIng,Usuario,FechaLimite,FechaVigencia,DiasLimite,AplicaDiasLimite,AplicaFechaVencimiento">
<Columns>
<asp:TemplateField ItemStyle-HorizontalAlign="center" ItemStyle-Width="60px">
<ItemTemplate>
@@ -2093,11 +2093,17 @@
CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-upload' ></i>" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Left" ItemStyle-Width="50px">
<asp:TemplateField ItemStyle-HorizontalAlign="Left" ItemStyle-Width="50px" Visible="false">
<ItemTemplate>
<asp:Literal ID="ImgDownLoad" runat="server"></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Right" ItemStyle-Width="50px">
<ItemTemplate>
<asp:LinkButton ID="LnkDownLoadDoc" CssClass="btn btn-circle btn-sm blue" OnClick="LnkDownLoadDoc_Click" runat="server"
Text="<i class='fa fa-download' style='color:white' title='Descargar Documento'></i>" CausesValidation="False" Visible="false" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Right" ItemStyle-Width="50px" Visible="false">
<ItemTemplate>
<asp:LinkButton ID="LnkGVEliminar" runat="server" AlternateText="Editar" CausesValidation="False" OnClick="LnkGVEliminar_Click"

View File

@@ -2526,6 +2526,8 @@ Partial Class Compras_Proveedores
Dim AplicaDiasLimite As Boolean = If(e.Row.DataKey("AplicaDiasLimite").ToString = "1", True, False)
Dim AplicaFechaVencimiento As Boolean = If(e.Row.DataKey("AplicaFechaVencimiento").ToString = "1", True, False)
Dim LnkDownLoadDoc As LinkButton = e.Row.FCLinkButton("LnkDownLoadDoc")
txtFechaLimite.Visible = If(AplicaDiasLimite, True, False)
' txtFechaVigencia.Visible = If(AplicaFechaVencimiento, True, False)
@@ -2569,19 +2571,25 @@ Partial Class Compras_Proveedores
Dim linkDescargaArchivo As String = UsuarioActual.Empresa.Ruta & "Edoc/Proveedor/" & CveProveedor & "/" & Adjunto
If File.Exists(linkDescargaArchivo) Then
ImgDownLoad.Visible = True
If extencion.Length > 0 Then
ImgDownLoad.Text = String.Format(" <a class='btn btn-circle btn-sm blue' href='{0}' target='_black' download='{1}'><i class='fa fa-download' title='Descargar documento'></i></a>", linkDescarga, CveDocumentacionElectronica & "." & extencion)
Else
ImgDownLoad.Text = String.Format(" <a class='btn btn-circle btn-sm blue' href='{0}' target='_black' download='{1}'><i class='fa fa-download' title='Descargar documento'></i></a>", linkDescarga, CveDocumentacionElectronica)
End If
'ImgDownLoad.Visible = True
LnkDownLoadDoc.Visible = True
ScriptManager.GetCurrent(Me).RegisterPostBackControl(LnkDownLoadDoc)
'If extencion.Length > 0 Then
' ImgDownLoad.Text = String.Format(" <a class='btn btn-circle btn-sm blue' href='{0}' target='_black' download='{1}'><i class='fa fa-download' title='Descargar documento'></i></a>", linkDescarga, CveDocumentacionElectronica & "." & extencion)
'Else
' ImgDownLoad.Text = String.Format(" <a class='btn btn-circle btn-sm blue' href='{0}' target='_black' download='{1}'><i class='fa fa-download' title='Descargar documento'></i></a>", linkDescarga, CveDocumentacionElectronica)
'End If
Else
ImgDownLoad.Visible = False
'ImgDownLoad.Visible = False
End If
Else
ImgDownLoad.Visible = False
'ImgDownLoad.Visible = False
End If
If requerido Then
@@ -5835,6 +5843,28 @@ Partial Class Compras_Proveedores
End Sub
#End Region
Protected Sub LnkDownLoadDoc_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Dim Adjunto As String = GvRow.DataKey("Adjunto")
Dim stringDescargaDocumento As String = UsuarioActual.Empresa.Ruta & String.Format("Edoc\\Proveedor\{0}\{1}", CveProveedor, Adjunto)
Dim File As New FileInfo(stringDescargaDocumento)
If File.Exists Then
Response.Clear()
Response.AddHeader("Content-Disposition", "attachment; filename=" + File.Name)
Response.AddHeader("Content-Length", File.Length.ToString())
Response.ContentType = "text/octet-stream"
Response.Flush()
Response.TransmitFile(File.FullName)
Response.End()
End If
End Sub
End Class

View File

@@ -552,22 +552,15 @@
<td style="text-align: left;"><asp:CheckBox ID="ChkObservaciones" runat="server" Text="Observaciones" Checked="false" /></td>
</tr>
<tr>
<td style="text-align: left;">
<asp:CheckBox ID="ChkSubTotalPend" runat="server" Text="&nbsp;SubTotal Pendiente" Checked="false" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkIVAPend" runat="server" Text="&nbsp;IVA Pendiente" Checked="false" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkIEPSPend" runat="server" Text="&nbsp;IEPS Pendiente" Checked="false" Visible="false" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkSubTotalPend" runat="server" Text="&nbsp;SubTotal Pendiente" Checked="false" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkIVAPend" runat="server" Text="&nbsp;IVA Pendiente" Checked="false" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkIEPSPend" runat="server" Text="&nbsp;IEPS Pendiente" Checked="false" Visible="false" /></td>
<td style="text-align: left;"></td>
</tr>
<tr>
<td style="text-align: left;">
<asp:CheckBox ID="ChkIEPSP" runat="server" Text="&nbsp; IEPS Pendiente" Checked="False" Visible="false" TextAlign="Right" />
</td><td style="text-align: left;">
<asp:CheckBox ID="ChkRetIVAPendiente" runat="server" Text="&nbsp; Ret IVA Pendiente" Checked="False" TextAlign="Right" />
</td><td style="text-align: left;">
<asp:CheckBox ID="ChkRetISRPendiente" runat="server" Text="&nbsp; Ret ISR Pendiente" Checked="False" TextAlign="Right" />
</td>
<td style="text-align: left;"><asp:CheckBox ID="ChkIEPSP" runat="server" Text="&nbsp; IEPS Pendiente" Checked="False" Visible="false" TextAlign="Right" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkRetIVAPendiente" runat="server" Text="&nbsp; Ret IVA Pendiente" Checked="False" TextAlign="Right" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkRetISRPendiente" runat="server" Text="&nbsp; Ret ISR Pendiente" Checked="False" TextAlign="Right" /></td>
</tr>
</table>

View File

@@ -157,48 +157,42 @@
<asp:UpdatePanel runat="server" ID="Upsaldar" UpdateMode="Conditional">
<ContentTemplate>
<div class="row" runat="server" id="DvSaldar">
<div class="col-md-1" style="text-align: left">Fecha:</div>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;">
<asp:TextBox ID="TxtFecha" CssClass="form-control input-sm ADSMaskDate" Style="width: 118px" runat="server"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="LnkCortfecha" class="btn default " Text=" <i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEECortfecha" runat="server" TargetControlID="TxtFecha" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEECortfecha" TargetControlID="TxtFecha" PopupButtonID="LnkCortfecha" PopupPosition="BottomRight" Enabled="True" Format="dd/MM/yyyy"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RfvCortfecha" runat="server" ControlToValidate="TxtFecha" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> es necesario, por favor ingréselo." ValidationGroup="VgGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VcoCortfecha" runat="server" HighlightCssClass="vco" TargetControlID="RfvCortfecha"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="col-md-1" style="text-align: left">Centro Costo:</div>
<div class="col-md-1" style="text-align: left">
<asp:DropDownList ID="DdlSubProyectoSaldar" runat="server" DataTextField="SubProyecto" DataValueField="CveSubProyecto" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100%">
</asp:DropDownList>
</div>
<div class="col-md-1" style="text-align: left">Concepto:</div>
<div class="col-md-1" style="text-align: left">
<asp:TextBox ID="TxtConcepto" CssClass="form-control" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvConcepto" runat="server" ControlToValidate="TxtConcepto" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Concepto''</b> es necesario, por favor ingréselo." ValidationGroup="VgGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VcoConcepto" runat="server" HighlightCssClass="vco" TargetControlID="RfvConcepto"></ajax:ValidatorCalloutExtender>
</div>
<div class="col-md-1" >
<asp:Button ID="BtnSaldar" OnClick="BtnSaldar_Click" runat="server" Text="Saldar" CssClass="btn btn-primary" ValidationGroup="VgGuardar" />
</div>
<div class="row" runat="server" id="DvSaldar" visible="false">
<div class="col-md-1" style="text-align: left">Fecha:</div>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;">
<asp:TextBox ID="TxtFecha" CssClass="form-control input-sm ADSMaskDate" Style="width: 118px" runat="server"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="LnkCortfecha" class="btn default " Text=" <i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEECortfecha" runat="server" TargetControlID="TxtFecha" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEECortfecha" TargetControlID="TxtFecha" PopupButtonID="LnkCortfecha" PopupPosition="BottomRight" Enabled="True" Format="dd/MM/yyyy"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RfvCortfecha" runat="server" ControlToValidate="TxtFecha" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> es necesario, por favor ingréselo." ValidationGroup="VgGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VcoCortfecha" runat="server" HighlightCssClass="vco" TargetControlID="RfvCortfecha"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="col-md-1" style="text-align: left">Centro Costo:</div>
<div class="col-md-1" style="text-align: left">
<asp:DropDownList ID="DdlSubProyectoSaldar" runat="server" DataTextField="SubProyecto" DataValueField="CveSubProyecto" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100%">
</asp:DropDownList>
</div>
<div class="col-md-1" style="text-align: left">Concepto:</div>
<div class="col-md-1" style="text-align: left">
<asp:TextBox ID="TxtConcepto" CssClass="form-control" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvConcepto" runat="server" ControlToValidate="TxtConcepto" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Concepto''</b> es necesario, por favor ingréselo." ValidationGroup="VgGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VcoConcepto" runat="server" HighlightCssClass="vco" TargetControlID="RfvConcepto"></ajax:ValidatorCalloutExtender>
</div>
<div class="col-md-1">
<asp:Button ID="BtnSaldar" OnClick="BtnSaldar_Click" runat="server" Text="Saldar" CssClass="btn btn-primary" ValidationGroup="VgGuardar" />
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
@@ -206,7 +200,7 @@
<ajax:TabContainer runat="server" ID="Tabs">
<ajax:TabPanel ID="TabIndicadores" runat="server" HeaderText="Indicadores" ClientIDMode="Static">
<ajax:TabPanel ID="TabIXC" runat="server" HeaderText="IXC" ClientIDMode="Static">
<ContentTemplate>
<div class="row">
@@ -271,7 +265,8 @@
<div class="modal-body">
<asp:UpdatePanel runat="server" ID="UpBodyTipoCambio" UpdateMode="Conditional">
<ContentTemplate>
<asp:RadioButtonList runat="server" ID="RblTipoCambio" OnSelectedIndexChanged="RblTipoCambio_SelectedIndexChanged" AutoPostBack="true">
<%-- <asp:RadioButtonList runat="server" ID="RblTipoCambio" OnSelectedIndexChanged="RblTipoCambio_SelectedIndexChanged" AutoPostBack="true">
<asp:ListItem Selected="true" Text="Moneda Original" Value="1"></asp:ListItem>
<asp:ListItem Text="Dólares en Tipo Cambio de la Fecha Venta" Value="2"></asp:ListItem>
<asp:ListItem Text="Tipo Cambio Especifico" Value="3"></asp:ListItem>
@@ -279,13 +274,14 @@
<div class="row" style="margin-left: 10px;" runat="server" id="LiEspecifico" visible="false">
Especifico:
<asp:TextBox ID="TxtEspecifico" runat="server" Width="55px" />
</div>
</div>--%>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="modal-footer">
<asp:Button ID="BtnTipoCambio" runat="server" OnClick="BtnTipoCambio_Click" Text="Aceptar" class="btn btn-primary" />
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
<%-- <asp:Button ID="BtnTipoCambio" runat="server" OnClick="BtnTipoCambio_Click" Text="Aceptar" class="btn btn-primary" />
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>--%>
</div>
</div>
</div>

View File

@@ -9,7 +9,7 @@ Partial Public Class General_SaldosMenores
Inherits ClsPaginas
#Region "PROPIEDADES"
Private Property DtDatos As DataTable
Private Property DtDatosIXC As DataTable
Get
Return DirectCast(ViewState("DtDatos"), DataTable)
End Get
@@ -61,6 +61,114 @@ Partial Public Class General_SaldosMenores
End If
End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
DvSaldar.Visible = False
If Tabs.ActiveTab Is TabIXC Then
CargaDatosIXC()
If DtDatosIXC.Rows.Count > 0 Then
DvSaldar.Visible = True
End If
End If
Upsaldar.Update()
End Sub
Protected Sub BtnSaldar_Click(sender As Object, e As EventArgs)
If Tabs.ActiveTab Is TabIXC Then
Dim ObjConta As New ClsContabilidad()
ObjConta.IniciaTransacSQL()
Dim CvePrePoliza As Integer = 0, CveVenta As Integer = -1, CveIE As Integer = -1
Dim Saldo As Decimal = 0
Dim SaldoAdmin As Decimal = 0
Dim ImporteTotalGasto As Decimal = 0
Dim MsgError As String = ""
CvePrePoliza = ObjConta.AddPrePolizas("Bancos/RepNCXAplicar", 6, 0, 0, 1, TxtFecha.Text.ToDate(), TxtConcepto.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 3)
Dim tMovto As Boolean = True
Dim tConceptoSaldar As Integer = 78
If CvePrePoliza > 0 Then
For Each Gv As GridViewRow In GvDatosIXC.Rows
Dim ConPreP As New ConceptosTipoSaldo()
If Gv.FCCheckBox("Chk").Checked Then
If Gv.DataKey("CveVenta").ToEntero > 0 Then
ConPreP = ClsPaginas.ObtenerCveConceptoPrePoliza(6, Gv.DataKey("CveMoneda").ToEntero(), False, 2)
ElseIf Gv.DataKey("CveIE").ToEntero > 0 Then
ConPreP.CveConcepto = 3
End If
'If Tipo = 1 OrElse Tipo = 2 Then
If Gv.DataKey("CveVenta").ToEntero() > 0 Then
CveVenta = Gv.DataKey("CveVenta").ToEntero()
Saldo = -Gv.DataKey("Saldo").ToDecimal()
SaldoAdmin = Saldo
ElseIf Gv.DataKey("CveIE").ToEntero() > 0 Then
'ElseIf Tipo = 3 Then
ConPreP = ClsPaginas.ObtenerCveConceptoPrePoliza(18, Gv.DataKey("CveMoneda").ToEntero(), True, 2)
CveIE = Gv.DataKey("CveIE").ToEntero()
Saldo = Gv.DataKey("Saldo").ToDecimal()
SaldoAdmin = Saldo
End If
Saldo = -Saldo ' invertimos el saldo para que se haga negativo para que sea Abono
ImporteTotalGasto += Saldo
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, tMovto, SaldoAdmin, Saldo, ConPreP.CveConcepto, Gv.DataKey("SerieFolio").ToString(), TxtConcepto.Text, CveIE, CveVenta, CveCliente:=Gv.DataKey("CveCliente").ToEntero()) Then
MsgError = "Ocurrio un error al saldar el movimiento"
Exit For
End If
If Gv.DataKey("CveMoneda").ToEntero() > 1 Then
Dim ImporteMN As Decimal = (Saldo * Gv.DataKey("TipoCambio").ToDecimal() - Saldo).RoundSQL()
ImporteTotalGasto += ImporteMN
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, tMovto, Saldo, ImporteMN, ConPreP.CveConceptoComplementario, Gv.DataKey("SerieFolio").ToString(), TxtConcepto.Text, CveIE, CveVenta, CveCliente:=Gv.DataKey("CveCliente").ToEntero(), ImporteME:=Saldo, TipoCambio:=Gv.DataKey("TipoCambio").ToDecimal()) Then
MsgError = "Ocurrio un error al saldar el movimiento"
Exit For
End If
End If
End If
Next
If ImporteTotalGasto <> 0 Then
ImporteTotalGasto *= -1 ' se invierte el valor, para cuadre de prepoliza
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, tMovto, ImporteTotalGasto, ImporteTotalGasto, tConceptoSaldar, "", TxtConcepto.Text, CveIE, CveVenta, CveSubProyecto:=DdlSubProyectoSaldar.SelectedValue.ToEntero()) Then
MsgError = "Ocurrio un error al saldar el movimiento"
End If
Else
MsgError = "Poliza no insertada"
End If
End If
If MsgError = "" Then
ObjConta.Commit()
Dim Msg As String = "Los movimientos se saldaron correctamente."
Msg &= $"<br/><br/><a Class='Texto' target='_blank' href='/Contabilidad/RegPrePolizaS.aspx?CvePrePoliza={CvePrePoliza}'>Ver Póliza</a>&nbsp;&nbsp; "
Alert(Msg)
Else
ObjConta.RollBack()
Alert(MsgError, ModExtensiones.TipoMensaje.MsgError)
End If
CargaDatosIXC()
ObjConta.Dispose()
End If
TxtFecha.Text = DateTime.Today.ToString()
Upsaldar.Update()
End Sub
#Region "I X C"
@@ -82,55 +190,45 @@ Partial Public Class General_SaldosMenores
txtFechaF.Text = If(Request("FechaF") Is Nothing, NowADS().ToString(), Request("FechaF").ToString())
TipoCambio = If(Request("TipoCambio") Is Nothing, 1, Request("TipoCambio").ToString().ToEntero())
TCEspecifico = If(Request("TCEspecifico") Is Nothing, -1, Request("TCEspecifico").ToString().ToDouble())
RblTipoCambio.SelectedValue = TipoCambio.ToString()
LiEspecifico.InnerText = TCEspecifico.FormatoNumero()
'RblTipoCambio.SelectedValue = TipoCambio.ToString()
'LiEspecifico.InnerText = TCEspecifico.FormatoNumero()
Dim FechaICorte As DateTime
FechaICorte = If(Request("FechaICorte") Is Nothing, DateTime.MinValue, Request("FechaICorte").ToString().ToDate())
CargaDatos()
Tipo = -1
End Sub
Protected Sub CargaSucursales()
'DdlSucursal.DataSource = GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa)
'DdlSucursal.DataBind()
'DdlSucursal.Items.Insert(0, New ListItem("Todos", "-1"))
'DdlSucursal.SelectedValue = "-1"
DdlSubProyectoSaldar.DataSource = GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa)
DdlSubProyectoSaldar.DataBind()
End Sub
'Protected Sub CargaVendedores()
' DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
' DdlVendedor.DataBind()
' DdlVendedor.Items.Insert(0, New ListItem("Todos", "-1"))
'End Sub
Protected Sub CargaDatos()
If TipoCambio = 3 AndAlso TxtEspecifico.Text <> "" Then
TCEspecifico = TxtEspecifico.Text.ToDouble()
Else
TCEspecifico = -1
End If
If TipoCambio <> 1 Then
CveMoneda = -1
End If
Protected Sub CargaDatosIXC()
'If TipoCambio = 3 AndAlso TxtEspecifico.Text <> "" Then
' TCEspecifico = TxtEspecifico.Text.ToDouble()
'Else
' TCEspecifico = -1
'End If
'If TipoCambio <> 1 Then
' CveMoneda = -1
'End If
Dim FechaICorte As DateTime = MinFecha
'If TxtFechaICorte.Text <> "" Then
' FechaICorte = TxtFechaICorte.Text.ToDate()
'Else
' FechaICorte = DateTime.MinValue
'End If
Dim FechaFCorte As DateTime = MaxFecha
'If TxtFechaFCorte.Text <> "" Then
' FechaFCorte = TxtFechaFCorte.Text.ToDate()
'Else
' FechaFCorte = DateTime.MaxValue
'End If
Dim ObjVenta As New ClsVentas()
Dim CveCliente As Integer = -1
@@ -140,30 +238,18 @@ Partial Public Class General_SaldosMenores
If ObjVenta.GetRepAnticiposNCIXCDetalle(CveCliente, -1, txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), UsuarioActual.CveEmpresa, 1, -1, CveMoneda, FechaICorte, FechaFCorte, TipoCambio, TCEspecifico,
SaldoMayorA:=TxtSaldoMayorA.Text.ToDecimal, SaldoMenorA:=TxtSaldoMenorA.Text.ToDecimal) Then
GvDatosIXC.DataSource = ObjVenta.DtResultados
DtDatos = ObjVenta.DtResultados
DtDatosIXC = ObjVenta.DtResultados
End If
ObjVenta.Dispose()
GvDatosIXC.DataBind()
UpDatos.Update()
'If TxtFechaFCorte.Text <> NowADS().ToShortDateString() AndAlso txtFechaI.Text <> "" Then
' LnkHabilitarSaldar.Visible = False
' LnkSaldar.Visible = False
'Else
'LnkHabilitarSaldar.Visible = True
''End If
'If LnkSaldar.Visible Then
' HabilitarCheckbox()
'End If
Tipo = -1
End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
CargaDatos()
End Sub
Protected Sub LnkExcel_Click(sender As Object, e As EventArgs) Handles LnkExcel.Click
'GenerarPDF("EXCEL")
@@ -173,80 +259,7 @@ Partial Public Class General_SaldosMenores
'GenerarPDF("PDF")
End Sub
'Protected Sub GenerarPDF(Opcion As String)
' Dim FechaI As String
' If txtFechaI.Text = "" OrElse txtFechaI.Text = "__/__/____" Then
' FechaI = "-1"
' Else
' FechaI = $"&emsp;<b>Fecha Inicial:</b> {txtFechaI.Text}"
' End If
' Dim FechaF As String
' If txtFechaF.Text = "" OrElse txtFechaF.Text = "__/__/____" Then
' FechaF = "-1"
' Else
' FechaF = $"&emsp;<b>Fecha Final:</b> {txtFechaF.Text}"
' End If
' Dim FechaICorte As String
' If TxtFechaICorte.Text = "" OrElse TxtFechaICorte.Text = "__/__/____" Then
' FechaICorte = ""
' Else
' FechaICorte = $"&emsp;<b>Fecha Inicial Corte:</b> {TxtFechaICorte.Text}"
' End If
' Dim FechaFCorte As String
' If TxtFechaFCorte.Text = "" OrElse TxtFechaFCorte.Text = "__/__/____" Then
' FechaFCorte = ""
' Else
' FechaFCorte = $"&emsp;<b>Fecha Final Corte:</b> {TxtFechaFCorte.Text}"
' End If
' Dim Sucursal As String
' If DdlSucursal.SelectedValue <> "-1" Then
' Sucursal = $"&emsp;<b>Sucursal:</b> {DdlSucursal.SelectedItem.Text}"
' Else
' Sucursal = ""
' End If
' Dim Cliente As String = ""
' Dim ConSaldo As String
' If DdlConSaldo.SelectedValue <> "-1" Then
' ConSaldo = $"&emsp;<b>Con Saldo:</b> {DdlConSaldo.SelectedItem.Text}"
' Else
' ConSaldo = ""
' End If
' Dim Tipo2 As String
' If DdlTipo.SelectedValue <> "-1" Then
' Tipo2 = $"&emsp;<b>Tipo:</b> {DdlTipo.SelectedItem.Text}"
' Else
' Tipo2 = ""
' End If
' If DtDatos.Rows.Count > 0 Then
' Dim Imagen As New System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png")
' Dim logouri As String = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
' Dim para As New List(Of ReportParameter) From {
' New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa),
' New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre),
' New ReportParameter("FechaImpresion", NowADS().ToString()),
' New ReportParameter("Tipo", Tipo.ToString()),
' New ReportParameter("AgrupadoPor", $"<b>Agrupado Por:</b> {Cliente}{Sucursal}{ConSaldo}{Tipo2}{FechaI}{FechaF}{FechaICorte}{FechaFCorte}")
' }
' If Imagen.Exists Then
' para.Add(New ReportParameter("LogoPath", logouri))
' Else
' para.Add(New ReportParameter("LogoPath", ""))
' End If
' ImprimirPDF("Empresas/Grales/Formatos/RepAnt-NC-IXCDetalle.rdlc", DtDatos, para, "Reporte de Anticipos - NCXAplicar - IXC Detalle", Opcion)
' Else
' Alert("No hay datos consultados", ModExtensiones.TipoMensaje.MsgAdvertencia)
' End If
'End Sub
Protected Sub GvDatosIXC_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatosIXC.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
@@ -338,120 +351,10 @@ Partial Public Class General_SaldosMenores
RegistraScript("$('#DivModalSaldar').modal();")
End Sub
Protected Sub BtnSaldar_Click(sender As Object, e As EventArgs) Handles BtnSaldar.Click
Dim ObjConta As New ClsContabilidad()
ObjConta.IniciaTransacSQL()
Dim CvePrePoliza As Integer = 0, CveVenta As Integer = -1, CveIE As Integer = -1
Dim Saldo As Decimal = 0
Dim SaldoAdmin As Decimal = 0
Dim ImporteTotalGasto As Decimal = 0
Dim MsgError As String = ""
CvePrePoliza = ObjConta.AddPrePolizas("Bancos/RepNCXAplicar", 6, 0, 0, 1, TxtFecha.Text.ToDate(), TxtConcepto.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 3)
Dim tMovto As Boolean = True
Dim tConceptoSaldar As Integer = 78
If CvePrePoliza > 0 Then
For Each Gv As GridViewRow In GvDatosIXC.Rows
Dim ConPreP As New ConceptosTipoSaldo()
If Gv.FCCheckBox("Chk").Checked Then
If Tipo = 2 Then
ConPreP = ClsPaginas.ObtenerCveConceptoPrePoliza(6, Gv.DataKey("CveMoneda").ToEntero(), False, 2)
ElseIf Tipo = 1 Then
ConPreP.CveConcepto = 3
End If
'If Tipo = 1 OrElse Tipo = 2 Then
If Gv.DataKey("CveVenta").ToEntero() > 0 Then
CveVenta = Gv.DataKey("CveVenta").ToEntero()
Saldo = -Gv.DataKey("Saldo").ToDecimal()
SaldoAdmin = Saldo
ElseIf Gv.DataKey("CveIE").ToEntero() > 0 Then
'ElseIf Tipo = 3 Then
ConPreP = ClsPaginas.ObtenerCveConceptoPrePoliza(18, Gv.DataKey("CveMoneda").ToEntero(), True, 2)
CveIE = Gv.DataKey("CveIE").ToEntero()
Saldo = Gv.DataKey("Saldo").ToDecimal()
SaldoAdmin = Saldo
End If
Saldo = -Saldo ' invertimos el saldo para que se haga negativo para que sea Abono
ImporteTotalGasto += Saldo
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, tMovto, SaldoAdmin, Saldo, ConPreP.CveConcepto, Gv.DataKey("SerieFolio").ToString(), TxtConcepto.Text, CveIE, CveVenta, CveCliente:=Gv.DataKey("CveCliente").ToEntero()) Then
MsgError = "Ocurrio un error al saldar el movimiento"
Exit For
End If
If Gv.DataKey("CveMoneda").ToEntero() > 1 Then
Dim ImporteMN As Decimal = (Saldo * Gv.DataKey("TipoCambio").ToDecimal() - Saldo).RoundSQL()
ImporteTotalGasto += ImporteMN
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, tMovto, Saldo, ImporteMN, ConPreP.CveConceptoComplementario, Gv.DataKey("SerieFolio").ToString(), TxtConcepto.Text, CveIE, CveVenta, CveCliente:=Gv.DataKey("CveCliente").ToEntero(), ImporteME:=Saldo, TipoCambio:=Gv.DataKey("TipoCambio").ToDecimal()) Then
MsgError = "Ocurrio un error al saldar el movimiento"
Exit For
End If
End If
End If
Next
If ImporteTotalGasto <> 0 Then
ImporteTotalGasto *= -1 ' se invierte el valor, para cuadre de prepoliza
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, tMovto, ImporteTotalGasto, ImporteTotalGasto, tConceptoSaldar, "", TxtConcepto.Text, CveIE, CveVenta, CveSubProyecto:=DdlSubProyectoSaldar.SelectedValue.ToEntero()) Then
MsgError = "Ocurrio un error al saldar el movimiento"
End If
Else
MsgError = "Poliza no insertada"
End If
End If
If MsgError = "" Then
ObjConta.Commit()
Dim Msg As String = "Los movimientos se saldaron correctamente."
Msg &= $"<br/><br/><a Class='Texto' target='_blank' href='/Contabilidad/RegPrePolizaS.aspx?CvePrePoliza={CvePrePoliza}'>Ver Póliza</a>&nbsp;&nbsp; "
Alert(Msg)
Else
ObjConta.RollBack()
Alert(MsgError, ModExtensiones.TipoMensaje.MsgError)
End If
'LnkSaldar.Visible = False
'LnkHabilitarSaldar.Visible = True
CargaDatos()
'UpLnkAgregar.Update()
ObjConta.Dispose()
'RegistraScript("$('#DivModalSaldar').modal('hide');")
TxtFecha.Text = DateTime.Today.ToString()
Upsaldar.Update()
End Sub
#End Region
#Region "TIPO DE CAMBIO"
Protected Sub BtnTipoCambio_Click(sender As Object, e As EventArgs) Handles BtnTipoCambio.Click
CargaDatos()
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivTipoCambio"))
End Sub
Protected Sub RblTipoCambio_SelectedIndexChanged(sender As Object, e As EventArgs) Handles RblTipoCambio.SelectedIndexChanged
TipoCambio = RblTipoCambio.SelectedValue.ToEntero()
If TipoCambio = 3 Then
LiEspecifico.Visible = True
TCEspecifico = GlobalTipoCambio(NowADS()).ToString().ToDouble()
TxtEspecifico.Text = TCEspecifico.ToString()
Else
LiEspecifico.Visible = False
End If
UpBodyTipoCambio.Update()
End Sub
#End Region
#End Region

View File

@@ -272,7 +272,11 @@
</div>
<label class="col-md-2" runat="server" id="DivLugarEntrega1">Lugar Entrega:</label>
<div class="col-md-4" runat="server" id="DivLugarEntrega2">
<asp:TextBox ID="txtLugarEntrega" runat="server" MaxLength="100" Width="100%"></asp:TextBox>
<asp:CheckBox runat="server" ID="chkSubProyectoEntrega" Visible="false" AutoPostBack="true" OnCheckedChanged="chkSubProyectoEntrega_CheckedChanged" />
<asp:DropDownList ID="DdlSubProyectoEntrega" CssClass=" form-control input-sm select2me" runat="server" DataTextField="SubProyecto" Style="width: 80%;" DataValueField="CveSubProyecto" Visible="false" >
<asp:ListItem Selected="true" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:TextBox ID="txtLugarEntrega" runat="server" MaxLength="100" Width="80%"></asp:TextBox>
</div>
<div class="row" runat="server" visible="False" id="TrCancelacion">
<label class="col-md-2">Cancelacion:</label>

View File

@@ -629,6 +629,8 @@ Partial Class OC_OC
TxtFecha.Enabled = False
End If
CargarCentrosDeCosto(Nothing, DdlSubProyectoEntrega, Nothing, Nothing, "Seleccione")
'CARGA YA REGISTRADO
If Request("OC") IsNot Nothing AndAlso IsNumeric(Request("OC")) AndAlso Request("OC").ToEntero > 0 Then
@@ -831,14 +833,21 @@ Partial Class OC_OC
' aqui tiene otras condiciones especiales
If CveOrdenCompra <> Nothing AndAlso CveOrdenCompra > 0 Then
DdlSubProyecto.DataSource = DtEstatusUsuarios.FiltraParametros("", "", {"CveSubProyecto", "SubProyecto"})
'DdlSubProyectoEntrega.DataSource = DtEstatusUsuarios.FiltraParametros("", "", {"CveSubProyecto", "SubProyecto"})
Else
DdlSubProyecto.DataSource = DtEstatusUsuarios.FiltraParametros(" SPEstatus = 1 ", "", {"CveSubProyecto", "SubProyecto"})
'DdlSubProyectoEntrega.DataSource = DtEstatusUsuarios.FiltraParametros(" SPEstatus = 1 ", "", {"CveSubProyecto", "SubProyecto"})
End If
DdlSubProyecto.DataBind()
DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1"))
'DdlSubProyectoEntrega.DataBind()
'DdlSubProyectoEntrega.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlSubProyectoContrato.Items.Clear()
DdlSubProyectoContrato.DataSource = DtEstatusUsuarios.FiltraParametros("", "", {"CveSubProyecto", "SubProyecto"}) 'If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110), GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, CveEmpresaActual, -1, 1), GlobalDTSubProyectos(-1, -1, CveEmpresaActual, 1)) ' DtEstatusUsuarios.FiltraParametros("", "", {"CveSubProyecto", "SubProyecto"})
DdlSubProyectoContrato.DataBind()
@@ -933,6 +942,11 @@ Partial Class OC_OC
' End If
'End If
If UsuarioActual.CveRol = 1 Then
chkSubProyectoEntrega.Visible = True
End If
End If
MostrarUsuarioAsignado()
@@ -1359,6 +1373,19 @@ Partial Class OC_OC
TieneInventario = CBool(objOC.DtResultados.Rows(0)("TieneInvOC"))
DdlMetodoPago.SelectedValueExist(objOC.DtResultados.Rows(0)("MetodoPago"))
If objOC.DtResultados.Rows(0)("CveSubProyectoEntrega").ToString.ToEntero > 0 Then
DdlSubProyectoEntrega.SelectedValueExist(objOC.DtResultados.Rows(0)("CveSubProyectoEntrega").ToString)
txtLugarEntrega.Visible = False
chkSubProyectoEntrega.Checked = True
DdlSubProyectoEntrega.Visible = True
End If
'PROMOCIONES
TxtPromocion.Text = objOC.Promocion
ChkPromocion.Checked = TxtPromocion.Text.Trim.Length > 0
@@ -1593,6 +1620,9 @@ Partial Class OC_OC
EditarOC = False
End Select
End If
'If objOC.TipoTermino = 2 Then
@@ -2608,6 +2638,11 @@ Partial Class OC_OC
TieneError = True
End If
If chkSubProyectoEntrega.Checked AndAlso DdlSubProyectoEntrega.SelectedValue.ToEntero <= 0 Then
Alert("Debe seleccionar un lugar de entrega", TipoMensaje.MsgAdvertencia)
TieneError = True
End If
Return TieneError
End Function
@@ -2697,7 +2732,8 @@ Partial Class OC_OC
LugarEntrega, UsuarioActual.CveUsuario, CveEmpresaActual, GvD.Rows(0).FCHiddenField("HdnCvePresupuestoEgreso").Value.ToString.ToEntero, pCveProveedor:=CveProveedor, pCveProveedorSucursal:=CveProveedorSucursal,
RequiereCotizacion:=ChkCotizacion.Checked, CveCliente:=Ddlcliente.txtValue.Value.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PrioridadObservacion:=txtobsprioridad.Text, PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2), IVA:=IVA, RetIVA:=TxtRetIVA.Text.ToDecimal,
RetISR:=TxtRetISR.Text.ToDecimal, CveCotizacion:=CveCotizacion, FolioAdicional:=TxtFolioAdicional.Text, EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), Guia:=TxtGuia.Text.Trim,
IEPS:=TxtIEPS.Text.ToDecimal, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero, Promocion:=Promocion, CveProveedorContacto:=CveProveedorContacto, NumRemision:=TxtNumRemision.Text.Trim(), MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero()) Then
IEPS:=TxtIEPS.Text.ToDecimal, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero, Promocion:=Promocion, CveProveedorContacto:=CveProveedorContacto, NumRemision:=TxtNumRemision.Text.Trim(), MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero(),
CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero) Then
CveOrdenCompraPadre = OC.CveOrdenCompra
If CveOrdenCompraPadre > 0 Then
@@ -2738,7 +2774,7 @@ Partial Class OC_OC
RequiereCotizacion:=ChkCotizacion.Checked, CveUsuarioAsignado:=DdlUsuariosAsignado.SelectedValue.ToEntero, CveCliente:=Ddlcliente.txtValue.Value.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PrioridadObservacion:=txtobsprioridad.Text,
PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2), IVA:=IVA, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, CveCotizacion:=CveCotizacion, FolioAdicional:=TxtFolioAdicional.Text, EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1),
CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), Guia:=TxtGuia.Text.Trim, IEPS:=TxtIEPS.Text.ToDecimal, CveIEAnticipo:=CveIEAnticipo, ImporteAnticipo:=ImporteAnticipos, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero,
Promocion:=Promocion, CveProveedorContacto:=CveProveedorContacto, NumRemision:=TxtNumRemision.Text, MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero()) Then
Promocion:=Promocion, CveProveedorContacto:=CveProveedorContacto, NumRemision:=TxtNumRemision.Text, MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero(), CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero) Then
CveOrdenCompra = OC.CveOrdenCompra
CveEstatus = CboE.SelectedValue.ToEntero
@@ -2925,7 +2961,7 @@ Partial Class OC_OC
LugarEntrega, DdlMoneda.SelectedValue.ToEntero, CveProveedor, CveOrdenCompra, UsuarioActual.CveUsuario, Ddlcliente.txtValue.Value.ToEntero,
DdlVendedor.SelectedValue.ToEntero, txtobsprioridad.Text, IVA:=IVA, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, FolioAdicional:=TxtFolioAdicional.Text, EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1),
Guia:=TxtGuia.Text.Trim, IEPS:=TxtIEPS.Text.ToDecimal, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero, Promocion:=Promocion, pCveProveedorSucursal:=DdlProveedorSucursal.SelectedValue.ToEntero, CveProveedorContacto:=CveProveedorContacto,
PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2), NumRemision:=TxtNumRemision.Text, MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero()) Then
PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2), NumRemision:=TxtNumRemision.Text, MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero(), CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero) Then
If CveProveedorOriginal <> CveProveedor Then
If Not ObjConta.UpdateProveedorPoliza(CveOrdenCompra, CveProveedor, Proveedor) Then
TieneError = True
@@ -3395,8 +3431,9 @@ Partial Class OC_OC
If (Not HuboError) AndAlso objOrdenCompra.AddOrdenCompra("OC", -1, TxtDescrip.Text, TxtJustificacion.Text, DdlPrioridad.SelectedValue.ToEntero, TxtFecha.Text.ToDate, DdlMoneda.SelectedValue.ToEntero, CveEstatusInicialOC, TxtFechaEstimadaEntrega.Text, LugarEntrega,
CveUsuario, CveEmpresaActual, 0, pCveProveedor:=CveProveedor, CveCliente:=Ddlcliente.txtValue.Value.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PrioridadObservacion:=txtobsprioridad.Text,
PorcentajeIVA:=PorIVA, IVA:=IVACot, RetIVA:=RetIVA.ToString.ToDecimal, RetISR:=RetISR.ToString.ToDecimal, IDPoliza:=IdPoliza, CveCotizacion:=CveCotizacion, FolioAdicional:=TxtFolioAdicional.Text,
EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), IEPS:=TxtIEPS.Text.ToDecimal,
CveIEAnticipo:=CveIEAnticipo, ImporteAnticipo:=ImporteAnticipos, Promocion:=Promocion, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero, NumRemision:=TxtNumRemision.Text.Trim, MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero()) Then
EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), IEPS:=TxtIEPS.Text.ToDecimal,
CveIEAnticipo:=CveIEAnticipo, ImporteAnticipo:=ImporteAnticipos, Promocion:=Promocion, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero, NumRemision:=TxtNumRemision.Text.Trim, MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero(),
CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero) Then
'CREA POLIZA POR CADA PROVEEDOR
@@ -3472,7 +3509,7 @@ Partial Class OC_OC
CveUsuario, CveEmpresaActual, 0, pCveProveedor:=DdlProveedores.SelectedValue.ToEntero, pCveProveedorSucursal:=DdlProveedorSucursal.SelectedValue.ToEntero, CveUsuarioAsignado:=DdlUsuariosAsignado.SelectedValue.ToEntero(), CveCliente:=Ddlcliente.txtValue.Value.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PrioridadObservacion:=txtobsprioridad.Text,
PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2), IVA:=IVA, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, IDPoliza:=IDPolizaPresupuestal, CveCotizacion:=CveCotizacion, FolioAdicional:=TxtFolioAdicional.Text,
EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), IEPS:=TxtIEPS.Text.ToDecimal, CveIEAnticipo:=CveIEAnticipo, ImporteAnticipo:=ImporteAnticipos, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero,
Promocion:=Promocion, NumRemision:=TxtNumRemision.Text.Trim, MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero()) Then
Promocion:=Promocion, NumRemision:=TxtNumRemision.Text.Trim, MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero(), CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero) Then
'USA AC
@@ -9218,5 +9255,13 @@ Partial Class OC_OC
Protected Sub chkSubProyectoEntrega_CheckedChanged(sender As Object, e As EventArgs)
DdlSubProyectoEntrega.Visible = chkSubProyectoEntrega.Checked
txtLugarEntrega.Visible = Not chkSubProyectoEntrega.Checked
UPPEmp.Update()
End Sub
End Class

View File

@@ -346,7 +346,7 @@
<table>
<td style="white-space: nowrap;">Fecha Emisión:</td>
<td>
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px;">
<asp:TextBox ID="TxtFechaEmision" runat="server" CssClass="form-control"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton runat="server" ID="LnkImgTxtFechaEmision" class="btn default"><i class="fa fa-calendar"></i></asp:LinkButton>

View File

@@ -618,7 +618,7 @@ Partial Class Ventas_ClientesAbonar
Dim FechaEmision As Date = MinFecha
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
If ChkComplementoPago.Checked AndAlso UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
FechaEmision = TxtFechaEmision.Text.ToDate
If FechaEmision <= MinFecha Then

View File

@@ -24,6 +24,16 @@
<li>
<asp:HyperLink NavigateUrl="javascript:;" data-toggle="modal" data-target="#DivTipoCambio" ID="ImgTipoCambio" runat="server"> <i class="fa fa-money"></i> Ver Dlls en pesos</asp:HyperLink>
</li>
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpAccionezPersonalizar">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkPErsonalizar" OnClick="LnkPErsonalizar_Click" runat="server"><i class="fa fa-pencil"></i>Personalizar Columnas</asp:LinkButton>
</li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
@@ -210,7 +220,7 @@
<ajax:ValidatorCalloutExtender ID="vcoCvFAplicadoF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaAplicadoF" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="row">
<div class="row">
<label id="lblEsDistribuidor" runat="server" visible="false" class="col-md-1 truncate">Es Distribuidor:</label>
<div class="col-md-2" id="divEsDistribuidor" runat="server" visible="false">
<asp:DropDownList ID="DdlDistribuidor" runat="server" AppendDataBoundItems="true" CssClass="form-control input-small input-sm select2me" Width="100%">
@@ -269,10 +279,13 @@
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" Width="99%" EmptyDataText="No se encontraron Ventas con los filtros especificados" ToolTip="Listado de Ventas" CssClass="ScrollAD table table-striped table-hover Widthall" data-heighterror="320" data-freezecols="0" data-freezerows="0" GridLines="None"
DataKeyNames="CveVenta">
<Columns>
@@ -291,10 +304,27 @@
<asp:BoundField HeaderText="Dias Pago" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:#,##0.##}" DataField="DiasPagados" />
<asp:BoundField HeaderText="Forma Pago" DataField="TipoTransaccion" />
<asp:BoundField HeaderText="MSI" DataField="MesesSinIntereses" />
<asp:BoundField HeaderText="Sucursal Cliente" DataField="SucursalCliente" />
<asp:BoundField HeaderText="Observaciones" DataField="Observaciones" />
<asp:BoundField HeaderText="Descuento" DataField="Descuento" DataFormatString="{0:N2}" />
<asp:BoundField HeaderText="Vendedor" DataField="Vendedor" />
<asp:BoundField HeaderText="Codigo" DataField="Codigo" />
<asp:BoundField HeaderText="Limite Credito" DataField="LimiteCredito" DataFormatString="{0:N2}" />
<asp:BoundField HeaderText="Ret IVA" DataField="RetIVA" DataFormatString="{0:N2}" />
<asp:BoundField HeaderText="Ret ISR" DataField="RetISR" DataFormatString="{0:N2}" />
<asp:BoundField HeaderText="Sub Total" DataField="SubTotal" DataFormatString="{0:N2}" />
<asp:BoundField HeaderText="T.C." DataField="TipoCambio" DataFormatString="{0:N2}" />
<asp:BoundField HeaderText="DescripcionVenta" DataField="DescripcionVenta" />
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel runat="server" ID="UpTipoCambio" UpdateMode="Conditional">
<ContentTemplate>
<div id="DivTipoCambio" class="modal fade" role="dialog">
@@ -329,6 +359,108 @@
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel runat="server" ID="UPPersonalizar" UpdateMode="Conditional">
<ContentTemplate>
<div id="DivPersonalizar" class="modal fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">
<asp:Label ID="Label3" runat="server" ClientIDMode="Static" Text="Personalizar Columnas"></asp:Label></h4>
</div>
<div class="modal-body">
<table class="table table-striped nobordertop table-advance table-hover">
<tbody>
<tr>
<td style="text-align: left;">
<asp:CheckBox ID="ChkFolio" runat="server" Text="&nbsp;Folio" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkFecha" runat="server" Text="&nbsp;Fecha" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkSubTotal" runat="server" Text="&nbsp;SubTotal" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkObservaciones" runat="server" Text="&nbsp;Observaciones" /></td>
</tr>
<tr>
<td style="text-align: left;">
<asp:CheckBox ID="ChkDescuento" runat="server" Text="&nbsp;Descuento" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkVendedor" runat="server" Text="&nbsp;Vendedor" Checked="false" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkSucursal" runat="server" Text="&nbsp;Sucursal" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkCodigo" runat="server" Text="&nbsp;Código Cliente"/></td>
</tr>
<tr>
<td style="text-align: left;">
<asp:CheckBox ID="ChkLimiteCredito" runat="server" Text="&nbsp;Limite Credito" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkRetIVA" runat="server" Text="&nbsp;Ret. IVA" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkCliente" runat="server" Text="&nbsp;Cliente" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkRetISR" runat="server" Text="&nbsp;Ret. ISR" /></td>
</tr>
<tr>
<td style="text-align: left;">
<asp:CheckBox ID="ChkSucursalCliente" runat="server" Text="&nbsp;Sucursal Cliente" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkTotal" runat="server" Text="&nbsp;Total" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkDiasTranscurridos" runat="server" Text="&nbsp;Días Transcurridos" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkDiasPago" runat="server" Text="&nbsp;Dias Pago" /></td>
</tr>
<tr>
<td style="text-align: left;">
<asp:CheckBox ID="ChkTC" runat="server" Text="&nbsp;Tipo Cambio" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkMostrarDescripcionVenta" runat="server" Text="&nbsp;Descripción Venta" Checked="false" /></td>
</tr>
</tbody>
</table>
</div>
<div class="modal-footer">
<div class="row">
<div class="col-md-6" style="text-align: left">
<asp:CheckBox ID="ChkGuardarPersonalizacion" runat="server" Text=" Guarda Personalización" TextAlign="Right" />
</div>
<div class="col-md-6">
<button type="button" class="btn btn-success" data-dismiss="modal" onclick="$('#BtnPersonalizar').click();">Personalizar</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
</div>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel runat="server" ID="UpBtnPersonalizar" UpdateMode="Conditional">
<ContentTemplate>
<asp:Button ID="BtnPersonalizar" Style="display: none" ClientIDMode="Static" runat="server" Text="Personalizar" class="btn btn-success" OnClick="BtnPersonalizar_Click" />
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
<script type="text/javascript">

View File

@@ -71,11 +71,22 @@ Partial Class Ventas_RepRecuperacionDetalle
End Set
End Property
Private Property Personalizo As Integer
Get
Return ViewState("Personalizo").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("Personalizo") = 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
CargaCombos()
CargaPersonalizacion()
CargaDatos()
End If
End Sub
@@ -373,5 +384,345 @@ Partial Class Ventas_RepRecuperacionDetalle
Else
LiEspecifico.Visible = False
End If
End Sub
End Sub
#Region "PERSONALIZAR"
Protected Sub LnkPErsonalizar_Click(sender As Object, e As EventArgs)
ChkGuardarPersonalizacion.Checked = False
RegistraScript("$('#DivPersonalizar').modal('show')")
End Sub
Protected Sub BtnPersonalizar_Click(sender As Object, e As System.EventArgs)
If ChkGuardarPersonalizacion.Checked Then
GuardaPersonalizacion()
End If
Personaliza()
CargaDatos()
'GvDatosDataBind()
End Sub
Private Sub Personaliza()
GvDatos.Columns(0).Visible = True
GvDatos.Columns(1).Visible = ChkFecha.Checked
GvDatos.Columns(2).Visible = ChkFolio.Checked
GvDatos.Columns(3).Visible = True
GvDatos.Columns(4).Visible = ChkTotal.Checked
GvDatos.Columns(5).Visible = True
GvDatos.Columns(6).Visible = ChkSucursal.Checked
GvDatos.Columns(7).Visible = True
GvDatos.Columns(8).Visible = ChkCliente.Checked
GvDatos.Columns(9).Visible = True
GvDatos.Columns(10).Visible = True
GvDatos.Columns(11).Visible = ChkDiasTranscurridos.Checked
GvDatos.Columns(12).Visible = ChkDiasPago.Checked
GvDatos.Columns(13).Visible = True
GvDatos.Columns(14).Visible = True
GvDatos.Columns(15).Visible = ChkSucursalCliente.Checked
GvDatos.Columns(16).Visible = ChkObservaciones.Checked
GvDatos.Columns(17).Visible = ChkDescuento.Checked
GvDatos.Columns(18).Visible = ChkVendedor.Checked
GvDatos.Columns(19).Visible = ChkCodigo.Checked
GvDatos.Columns(20).Visible = ChkLimiteCredito.Checked
GvDatos.Columns(21).Visible = ChkRetIVA.Checked
GvDatos.Columns(22).Visible = ChkRetISR.Checked
GvDatos.Columns(23).Visible = ChkSubTotal.Checked
GvDatos.Columns(24).Visible = ChkTC.Checked
GvDatos.Columns(25).Visible = ChkMostrarDescripcionVenta.Checked
Personalizo = 1
If Personalizo = 1 Then
'ImgExcelPersonalizado.Visible = True
Else
'ImgExcelPersonalizado.Visible = False
End If
UpDatos.Update()
End Sub
Private Sub GuardaPersonalizacion()
Dim objUsuario As New ClsSisUsuarios
Dim ListPersonalizada As New List(Of String)
If ChkFolio.Checked Then
ListPersonalizada.Add("Folio")
End If
If ChkFecha.Checked Then
ListPersonalizada.Add("Fecha")
End If
If ChkSubTotal.Checked Then
ListPersonalizada.Add("SubTotal")
End If
If ChkObservaciones.Checked Then
ListPersonalizada.Add("Observaciones")
End If
If ChkDescuento.Checked Then
ListPersonalizada.Add("Descuento")
End If
If ChkVendedor.Checked Then
ListPersonalizada.Add("Vendedor")
End If
If ChkSucursal.Checked Then
ListPersonalizada.Add("Sucursal")
End If
If ChkCodigo.Checked Then
ListPersonalizada.Add("Codigo")
End If
If ChkLimiteCredito.Checked Then
ListPersonalizada.Add("LimiteCredito")
End If
If ChkRetIVA.Checked Then
ListPersonalizada.Add("RetIVA")
End If
If ChkCliente.Checked Then
ListPersonalizada.Add("Cliente")
End If
If ChkRetISR.Checked Then
ListPersonalizada.Add("RetISR")
End If
If ChkSucursalCliente.Checked Then
ListPersonalizada.Add("SucursalCliente")
End If
If ChkTotal.Checked Then
ListPersonalizada.Add("Total")
End If
If ChkDiasTranscurridos.Checked Then
ListPersonalizada.Add("DiasTranscurridos")
End If
If ChkDiasPago.Checked Then
ListPersonalizada.Add("DiasPago")
End If
If ChkTC.Checked Then
ListPersonalizada.Add("TC")
End If
If ChkMostrarDescripcionVenta.Checked Then
ListPersonalizada.Add("MostrarDescripcionVenta")
End If
If objUsuario.AddUsuariosPersonalizaciones(UsuarioActual, "RepRecuperacionDetalle.aspx", String.Join("|", ListPersonalizada)) Then
'Alert("Personalizacion guardada")
End If
objUsuario.Dispose()
End Sub
Private Sub CargaPersonalizacion()
Dim strBasePersonalizacion As String = UsuarioActual.Personalizaciones("RepRecuperacionDetalle.aspx")
If strBasePersonalizacion.Trim.Length > 0 Then
Dim Personalizaciones As String() = strBasePersonalizacion.Split("|"c)
For Each personalizacion As String In Personalizaciones
Select Case personalizacion
Case "Folio"
ChkFolio.Checked = True
Case "Fecha"
ChkFecha.Checked = True
Case "SubTotal"
ChkSubTotal.Checked = True
Case "Observaciones"
ChkObservaciones.Checked = True
Case "Descuento"
ChkDescuento.Checked = True
Case "Vendedor"
ChkVendedor.Checked = True
Case "Sucursal"
ChkSucursal.Checked = True
Case "Codigo"
ChkCodigo.Checked = True
Case "LimiteCredito"
ChkLimiteCredito.Checked = True
Case "RetIVA"
ChkRetIVA.Checked = True
Case "Cliente"
ChkCliente.Checked = True
Case "RetISR"
ChkRetISR.Checked = True
Case "SucursalCliente"
ChkSucursalCliente.Checked = True
Case "Total"
ChkTotal.Checked = True
Case "DiasTranscurridos"
ChkDiasTranscurridos.Checked = True
Case "DiasPago"
ChkDiasPago.Checked = True
Case "TC"
ChkTC.Checked = True
Case "MostrarDescripcionVenta"
ChkMostrarDescripcionVenta.Checked = True
Case Else
' Do nothing
End Select
Next
Personaliza()
Else
PersonalizaDefault()
End If
UPPersonalizar.Update()
End Sub
Private Sub PersonalizaDefault()
ChkFolio.Checked = True
ChkFecha.Checked = True
ChkTotal.Checked = True
ChkSucursal.Checked = True
ChkCliente.Checked = True
ChkDiasTranscurridos.Checked = True
ChkDiasPago.Checked = True
ChkSucursalCliente.Checked = False
ChkSubTotal.Checked = False
ChkObservaciones.Checked = False
ChkDescuento.Checked = False
ChkVendedor.Checked = False
ChkCodigo.Checked = False
ChkLimiteCredito.Checked = False
ChkRetIVA.Checked = False
ChkRetISR.Checked = False
ChkTC.Checked = False
ChkMostrarDescripcionVenta.Checked = False
GvDatos.Columns(0).Visible = True
GvDatos.Columns(1).Visible = True
GvDatos.Columns(2).Visible = True
GvDatos.Columns(3).Visible = True
GvDatos.Columns(4).Visible = True
GvDatos.Columns(5).Visible = True
GvDatos.Columns(6).Visible = True
GvDatos.Columns(7).Visible = True
GvDatos.Columns(8).Visible = True
GvDatos.Columns(9).Visible = True
GvDatos.Columns(10).Visible = True
GvDatos.Columns(11).Visible = True
GvDatos.Columns(12).Visible = True
GvDatos.Columns(13).Visible = True
GvDatos.Columns(14).Visible = True
GvDatos.Columns(15).Visible = False
GvDatos.Columns(16).Visible = False
GvDatos.Columns(17).Visible = False
GvDatos.Columns(18).Visible = False
GvDatos.Columns(19).Visible = False
GvDatos.Columns(20).Visible = False
GvDatos.Columns(21).Visible = False
GvDatos.Columns(22).Visible = False
GvDatos.Columns(23).Visible = False
GvDatos.Columns(24).Visible = False
GvDatos.Columns(25).Visible = False
End Sub
'Private Sub GuardaPersonalizacion()
' Dim objUsuario As New ClsSisUsuarios
' Dim ListPersonalizada As New List(Of String)
' If ChkCantidad.Checked Then
' ListPersonalizada.Add("Cantidad")
' End If
' If ChkSubTotal.Checked Then
' ListPersonalizada.Add("Subtotal")
' End If
' If ChkDescuentos.Checked Then
' ListPersonalizada.Add("Descuentos")
' End If
' If ChkIVA.Checked Then
' ListPersonalizada.Add("IVA")
' End If
' If ChkTotal.Checked Then
' ListPersonalizada.Add("Total")
' End If
' If ChkSubTotal2.Checked Then
' ListPersonalizada.Add("SubTotal2")
' End If
' If ChkIEPS.Checked Then
' ListPersonalizada.Add("IEPS")
' End If
' If ChkRetIVA.Checked Then
' ListPersonalizada.Add("RetIVA")
' End If
' If ChkRetISR.Checked Then
' ListPersonalizada.Add("RetISR")
' End If
' If ChkImpLoc.Checked Then
' ListPersonalizada.Add("ImpLoc")
' End If
' If ChkMinSub.Checked Then
' ListPersonalizada.Add("MinSub")
' End If
' If ChkAVGSub.Checked Then
' ListPersonalizada.Add("AVGSub")
' End If
' If ChkMaxSub.Checked Then
' ListPersonalizada.Add("MaxSub")
' End If
' If ChkMaxTot.Checked Then
' ListPersonalizada.Add("MaxTot")
' End If
' If ChkAvgTot.Checked Then
' ListPersonalizada.Add("AvgTot")
' End If
' If ChkMinTot.Checked Then
' ListPersonalizada.Add("MinTot")
' End If
' If CheckRefacturado.Checked Then
' ListPersonalizada.Add("CheckRefacturado")
' End If
' If ChkCantidad.Checked Then
' ListPersonalizada.Add("Cantidad")
' End If
' If objUsuario.AddUsuariosPersonalizaciones(UsuarioActual, "RepVentas.aspx", String.Join("|", ListPersonalizada)) Then
' 'Alert("Personalizacion guardada")
' End If
' objUsuario.Dispose()
'End Sub
Private Sub GvDatosDataBind()
GvDatos.DataSource = DtDatos
GvDatos.DataBind()
UpDatos.Update()
End Sub
#End Region
End Class