This commit is contained in:
2020-06-15 15:22:09 -07:00
30 changed files with 2800 additions and 1781 deletions

View File

@@ -22,6 +22,8 @@ Public Class ClsClasificaciones
Private disposedValue As Boolean = False ' Para detectar llamadas redundantes Private disposedValue As Boolean = False ' Para detectar llamadas redundantes
'REGISTRAR CONEXIÓN 'REGISTRAR CONEXIÓN
Private CveConexion As Integer = 0 Private CveConexion As Integer = 0
Private EsTransaccionCompartida As Boolean = False
#End Region #End Region
#Region "Propiedades" #Region "Propiedades"
@@ -47,6 +49,7 @@ Public Class ClsClasificaciones
Else Else
SqlConexion = TransaccionCompartida.Connection SqlConexion = TransaccionCompartida.Connection
SqlTransacc = TransaccionCompartida SqlTransacc = TransaccionCompartida
EsTransaccionCompartida = True
End If End If
SqlCommand = New SqlCommand("", SqlConexion) SqlCommand = New SqlCommand("", SqlConexion)
@@ -67,7 +70,7 @@ Public Class ClsClasificaciones
#Region "Conexiones" #Region "Conexiones"
Private Sub ConexionAdd() Private Sub ConexionAdd()
If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then If Not EsTransaccionCompartida AndAlso ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
Try Try
DataAdapter("PA_Sis_RegistrarConexion") DataAdapter("PA_Sis_RegistrarConexion")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters

View File

@@ -1506,7 +1506,7 @@ Public Class ClsGenerales
Return Retorno Return Retorno
End Function End Function
Public Function UpdateCuentasDepositosEstatusPagoElectronicoGrupos(CveCuentaDeposito As Integer, EstatusPagoElectronicoGrupos As Boolean) As Boolean Public Function UpdateCuentasDepositosEstatusPagoElectronicoGrupos(CveCuentaDeposito As Integer, EstatusPagoElectronicoGrupos As Boolean, CveSATBanco As Integer, BBVAAlias As String) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
@@ -1515,6 +1515,8 @@ Public Class ClsGenerales
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@CveCuentaDeposito", SqlDbType.VarChar).Value = CveCuentaDeposito .Add("@CveCuentaDeposito", SqlDbType.VarChar).Value = CveCuentaDeposito
.Add("@EstatusPagoElectronicoGrupos", SqlDbType.Bit).Value = EstatusPagoElectronicoGrupos .Add("@EstatusPagoElectronicoGrupos", SqlDbType.Bit).Value = EstatusPagoElectronicoGrupos
.Add("@CveSATBanco", SqlDbType.Int).Value = CveSATBanco
.Add("@BBVAAlias", SqlDbType.VarChar).Value = BBVAAlias
End With End With
@@ -2724,7 +2726,8 @@ Public Class ClsGenerales
Public Function GetPaqueteriasGuias(CvePaqueteriaGuia As Integer, CvePaqueteriaGuiaTipo As Integer, CvePaqueteria As Integer, CveEstatus As Integer, CveSubProyecto As Integer, Public Function GetPaqueteriasGuias(CvePaqueteriaGuia As Integer, CvePaqueteriaGuiaTipo As Integer, CvePaqueteria As Integer, CveEstatus As Integer, CveSubProyecto As Integer,
CveEmpresa As Integer, Guia As String, FechaInicio As String, FechaFin As String, Optional FechaIngInicio As String = "-1", CveEmpresa As Integer, Guia As String, FechaInicio As String, FechaFin As String, Optional FechaIngInicio As String = "-1",
Optional FechaIngFin As String = "-1", Optional Filtro As Integer = -1, Optional CveUsuarioEntrega As Integer = -1) As Boolean Optional FechaIngFin As String = "-1", Optional Filtro As Integer = -1, Optional CveUsuarioEntrega As Integer = -1,
Optional EsEntregaInterna As Boolean = False) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
@@ -2744,6 +2747,7 @@ Public Class ClsGenerales
.Add("@FechaIngFin", SqlDbType.VarChar).Value = FechaIngFin .Add("@FechaIngFin", SqlDbType.VarChar).Value = FechaIngFin
.Add("@Filtro", SqlDbType.Int).Value = Filtro .Add("@Filtro", SqlDbType.Int).Value = Filtro
.Add("@CveUsuarioEntrega", SqlDbType.Int).Value = CveUsuarioEntrega .Add("@CveUsuarioEntrega", SqlDbType.Int).Value = CveUsuarioEntrega
.Add("@EsEntregaInterna", SqlDbType.Bit).Value = EsEntregaInterna
End With End With
Try Try
SqlAdapter.Fill(Data) SqlAdapter.Fill(Data)
@@ -2833,7 +2837,7 @@ Public Class ClsGenerales
DataAdapter("PA_Gral_AsignarEntregasPorRealizar") DataAdapter("PA_Gral_AsignarEntregasPorRealizar")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@CvePaqueteriaGuia", SqlDbType.Int).Value = CvePaqueteriaGuia .Add("@CvePaqueteriaGuia", SqlDbType.Int).Value = CvePaqueteriaGuia
.Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal .Add("@CveUsuarioAsignado", SqlDbType.Int).Value = CvePersonal
End With End With
Try Try
SqlAdapter.Fill(Data) SqlAdapter.Fill(Data)

View File

@@ -542,7 +542,10 @@ Public Class ClsMovimientos
End With End With
Try Try
SqlAdapter.SelectCommand.CommandTimeout = 0
SqlAdapter.Fill(Data) SqlAdapter.Fill(Data)
Retorno = True Retorno = True
Catch ex As SqlException Catch ex As SqlException

View File

@@ -1730,7 +1730,7 @@ Public Class ClsPaginas
End Set End Set
End Property End Property
Property GlobalDTAlmacen(CveEmpresa As Integer, Optional CveTipoAlmacen As Integer = -1, Optional CveEstatus As Integer = 1) As DataTable Property GlobalDTAlmacen(CveEmpresa As Integer, Optional CveTipoAlmacen As Integer = -1, Optional CveEstatus As Integer = 1, Optional CveAlmacen As Integer = -1) As DataTable
Get Get
Dim Str As New StringBuilder Dim Str As New StringBuilder
@@ -1738,6 +1738,7 @@ Public Class ClsPaginas
If CveEmpresa <> -1 Then Str.AppendFormat(" CveEmpresa = {0} ", CveEmpresa) If CveEmpresa <> -1 Then Str.AppendFormat(" CveEmpresa = {0} ", CveEmpresa)
If CveTipoAlmacen > 0 Then Str.AppendFormat("AND CveTipoAlmacen = {0}", CveTipoAlmacen) If CveTipoAlmacen > 0 Then Str.AppendFormat("AND CveTipoAlmacen = {0}", CveTipoAlmacen)
If CveEstatus > 0 Then Str.AppendFormat("AND CveEstatus = {0}", CveEstatus) If CveEstatus > 0 Then Str.AppendFormat("AND CveEstatus = {0}", CveEstatus)
If CveAlmacen > 0 Then Str.AppendFormat("AND CveAlmacen = {0}", CveAlmacen)
Dim Dv As New DataView(DirectCast(Application("GlobalDTAlmacen"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) Dim Dv As New DataView(DirectCast(Application("GlobalDTAlmacen"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
GlobalDTAlmacen = Dv.ToTable GlobalDTAlmacen = Dv.ToTable

View File

@@ -19,6 +19,7 @@ Public Class ClsUnidadesMedida
Private disposedValue As Boolean = False Private disposedValue As Boolean = False
'PARA REGISTRAR CONEXION 'PARA REGISTRAR CONEXION
Private CveConexion As Integer = 0 Private CveConexion As Integer = 0
Private EsTransaccionCompartida As Boolean = False
#End Region #End Region
#Region "Propiedades" #Region "Propiedades"
@@ -69,6 +70,7 @@ Public Class ClsUnidadesMedida
Else Else
SqlConexion = TransaccionCompartida.Connection SqlConexion = TransaccionCompartida.Connection
SqlTransacc = TransaccionCompartida SqlTransacc = TransaccionCompartida
EsTransaccionCompartida = True
End If End If
SqlAdapter = New SqlDataAdapter("", SqlConexion) SqlAdapter = New SqlDataAdapter("", SqlConexion)
@@ -86,7 +88,7 @@ Public Class ClsUnidadesMedida
#Region "Conexiones" #Region "Conexiones"
Private Sub ConexionAdd() Private Sub ConexionAdd()
If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then If Not EsTransaccionCompartida AndAlso ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
Try Try
'DataAdapter(String.Format("INSERT INTO Sis_Conexiones (Clase,Modulo) VALUES ('ClsRH','{0}')", "RH/CatMotivosBaja"), CommandType.Text) ' pendiente de terminar parra registrar el cveconexion, falta el rarámetro de módulo 'DataAdapter(String.Format("INSERT INTO Sis_Conexiones (Clase,Modulo) VALUES ('ClsRH','{0}')", "RH/CatMotivosBaja"), CommandType.Text) ' pendiente de terminar parra registrar el cveconexion, falta el rarámetro de módulo

View File

@@ -341,7 +341,7 @@ Public Class ClsVentas
Optional CveFormaPago33 As Integer = -1, Optional CveMetodoPago33 As Integer = -1, Optional CveUsoCFDI As Integer = -1, Optional OrdenCompra As String = "-1", Optional CveCuentaTerminal As Integer = -1, Optional CveTipoRelacion As Integer = -1, Optional ImpuestoLocal As Double = 0, Optional CveFormaPago33 As Integer = -1, Optional CveMetodoPago33 As Integer = -1, Optional CveUsoCFDI As Integer = -1, Optional OrdenCompra As String = "-1", Optional CveCuentaTerminal As Integer = -1, Optional CveTipoRelacion As Integer = -1, Optional ImpuestoLocal As Double = 0,
Optional CveTipoAmortizacionAnticipo As Integer = -1, Optional CveVentaRelacion As Integer = -1, Optional ImporteRelacion As Decimal = -1, Optional CveEmpresaCRM As Integer = -1, Optional EsInterno As Integer = -1, Optional CveAcercamientoCRM As Integer = -1, Optional CveTipoAmortizacionAnticipo As Integer = -1, Optional CveVentaRelacion As Integer = -1, Optional ImporteRelacion As Decimal = -1, Optional CveEmpresaCRM As Integer = -1, Optional EsInterno As Integer = -1, Optional CveAcercamientoCRM As Integer = -1,
Optional DiasCredito As Integer = 0, Optional EsDiasCreditoFijo As Boolean = False, Optional AnticipoEspecial As Boolean = False, Optional Kilometraje As Double = 0, Optional EsAmortizacion As Boolean = False, Optional CveTipoRetencion As Integer = 0, Optional DiasCredito As Integer = 0, Optional EsDiasCreditoFijo As Boolean = False, Optional AnticipoEspecial As Boolean = False, Optional Kilometraje As Double = 0, Optional EsAmortizacion As Boolean = False, Optional CveTipoRetencion As Integer = 0,
Optional CorreoNotificacion As String = "") As Boolean Optional CorreoNotificacion As String = "", Optional FormaPaqueteria As Integer = 1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_VentasAdd") DataAdapter("PA_VentasAdd")
@@ -431,6 +431,7 @@ Public Class ClsVentas
.Add("@EsAmortizacion", SqlDbType.Bit).Value = EsAmortizacion .Add("@EsAmortizacion", SqlDbType.Bit).Value = EsAmortizacion
.Add("@CveTipoRetencion", SqlDbType.TinyInt).Value = CveTipoRetencion .Add("@CveTipoRetencion", SqlDbType.TinyInt).Value = CveTipoRetencion
.Add("@CorreoNotificacion", SqlDbType.VarChar).Value = CorreoNotificacion .Add("@CorreoNotificacion", SqlDbType.VarChar).Value = CorreoNotificacion
.Add("@FormaPaqueteria", SqlDbType.Int).Value = FormaPaqueteria
.Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue .Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue
End With End With

179
App_Code/Thalamus.vb Normal file
View File

@@ -0,0 +1,179 @@
Imports System.IO
Imports System.Net
Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports Extensiones.ModExtensiones
Imports GemBox.Spreadsheet
Imports System.Data
' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
' <System.Web.Script.Services.ScriptService()> _
<WebService(Namespace:="http://ADSistemas.mx/")>
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class Thalamus
Inherits System.Web.Services.WebService
<WebMethod()>
Public Function GenerarArchivos(CveEmpresa As Integer) As Boolean
Dim RutaArchivoVentas As String = $"C:\Temp\Ventas{Now.ToString("yyyyMMdd")}.xlsx"
Dim DTVentas As New DataTable
DTVentas.Columns.Add("systemId")
DTVentas.Columns.Add("Branch")
DTVentas.Columns.Add("Code")
DTVentas.Columns.Add("Sale Date")
DTVentas.Columns.Add("Quantity")
DTVentas.Columns.Add("Amount")
DTVentas.Columns.Add("Transaction ID")
For x = 0 To 50
Dim dr As DataRow = DTVentas.NewRow
dr(0) = $"systemId {x}"
dr(1) = $"Branch {x}"
dr(2) = $"{x}"
dr(3) = $"{Now.ToString("yyyy-MM-dd")}"
dr(4) = $"{x}"
dr(5) = $"{x}.00"
dr(6) = $"{x}"
DTVentas.Rows.Add(dr)
Next
SpreadsheetInfo.SetLicense(SerialGemBoxSpreadsheet())
Dim workbook = New ExcelFile
Dim worksheet = workbook.Worksheets.Add("Ventas")
worksheet.InsertDataTable(DTVentas,
New InsertDataTableOptions() With
{
.ColumnHeaders = True,
.StartRow = 0
})
workbook.Save(RutaArchivoVentas)
Dim FTPServer As String = "ftp://127.0.0.1/"
Dim TFPUsr As String = "Toor"
Dim FTPPass As String = "agj-3500"
Dim FInfo As New FileInfo(RutaArchivoVentas)
Dim Carga As Boolean = CargarArchivos(FInfo.FullName, FTPServer, TFPUsr, FTPPass)
If Carga Then
Carga = VerificarArchivo(FInfo.Name, FInfo.Length, FTPServer, TFPUsr, FTPPass)
End If
Return Carga
End Function
Private Function CargarArchivos(RutaArchivo As String, FTPServer As String, FTPUsr As String, FTPPass As String) As Boolean
Dim Respuesta As Boolean
Dim FInfo As New FileInfo(RutaArchivo)
If FInfo.Exists Then
Dim request As FtpWebRequest = DirectCast(WebRequest.Create($"{FTPServer}/{FInfo.Name}"), FtpWebRequest)
request.Method = WebRequestMethods.Ftp.UploadFile
Dim tamanio As Integer = 1024
Dim buffer As Byte() = New Byte(tamanio) {}
Dim byteRead As Integer = 0
Dim Conected As Boolean = False
request.Credentials = New NetworkCredential(FTPUsr, FTPPass)
Try
request.GetResponse()
Conected = True
Catch ex As Exception
End Try
If Conected Then
Dim ftpStream As Stream
Dim f As FileStream
ftpStream = request.GetRequestStream
f = File.OpenRead(FInfo.FullName)
Try
Do
byteRead = f.Read(buffer, 0, tamanio)
ftpStream.Write(buffer, 0, byteRead)
Loop While byteRead <> 0
Respuesta = True
'validar si existe archivo si coincide en tamaño
Catch ex As Exception
Respuesta = False
End Try
If f IsNot Nothing Then
f.Close()
End If
If ftpStream IsNot Nothing Then
ftpStream.Close()
End If
Else
Respuesta = False
'no se conecto al ftp probablemente credenciales erroneas
End If
Else
Respuesta = False
'El archivo no existe en el disco local
End If
Return Respuesta
End Function
Private Function VerificarArchivo(Archivo As String, Tamanio As Long, FTPServer As String, FTPUsr As String, FTPPass As String) As Boolean
Dim Respuesta As Boolean = False
Dim reqSize As FtpWebRequest = DirectCast(FtpWebRequest.Create(New Uri(FTPServer & Archivo)), FtpWebRequest)
reqSize.Credentials = New NetworkCredential(FTPUsr, FTPPass)
reqSize.Method = WebRequestMethods.Ftp.GetFileSize
reqSize.UseBinary = True
Dim loginresponse As FtpWebResponse = DirectCast(reqSize.GetResponse(), FtpWebResponse)
Dim respSize As FtpWebResponse = DirectCast(reqSize.GetResponse(), FtpWebResponse)
respSize = DirectCast(reqSize.GetResponse(), FtpWebResponse)
Dim size As Long = respSize.ContentLength
respSize.Close()
If Tamanio = size Then
Respuesta = True
End If
Return Respuesta
End Function
End Class

View File

@@ -4653,6 +4653,26 @@ Partial Class Bancos_IE
Alert("El Beneficiario no tiene una cuenta activa en BBVA, dela de alta o seleccione otro método de pago", TipoMensaje.MsgAdvertencia) Alert("El Beneficiario no tiene una cuenta activa en BBVA, dela de alta o seleccione otro método de pago", TipoMensaje.MsgAdvertencia)
End If End If
ElseIf DdlTipoTransaccion.SelectedValue = "17" Then
If Dep.DtResultados.Rows.Count > 0 Then
DdlCuentaDeposito.DataSource = Dep.DtResultados
trCuentaDeposito.Visible = True
BtnGuardar.ToolTip = ""
Else
BtnGuardar.Enabled = False
Alert("El proveedor no tiene cuentas deposito.", TipoMensaje.MsgAdvertencia)
BtnGuardar.ToolTip = "El proveedor no tiene cuentas deposito"
End If
UpGuardar.Update()
Else Else
DdlCuentaDeposito.DataSource = Dep.DtResultados.FiltraParametros("Estatus ='True'") DdlCuentaDeposito.DataSource = Dep.DtResultados.FiltraParametros("Estatus ='True'")
If Dep.DtResultados.Rows.Count > 0 Then If Dep.DtResultados.Rows.Count > 0 Then
@@ -4663,6 +4683,19 @@ Partial Class Bancos_IE
End If End If
Else
If DdlTipoTransaccion.SelectedValue.Contiene("9", "17") Then
BtnGuardar.Enabled = False
Alert("El proveedor no tiene cuentas deposito.", TipoMensaje.MsgAdvertencia)
BtnGuardar.ToolTip = "El proveedor no tiene cuentas deposito"
Else
trCuentaDeposito.Visible = True
BtnGuardar.Enabled = True
End If
UpGuardar.Update()
End If End If

View File

@@ -11,6 +11,9 @@
Pago Electrónico Pago Electrónico
</asp:Content> </asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server"> <asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<i>
<asp:LinkButton ID="LnlImprimir" runat="server" Text="Imprimir" OnClick="BtnReportePago_Click"></asp:LinkButton>
</i>
</asp:Content> </asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server"> <asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
@@ -255,6 +258,17 @@
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:LinkButton ID="LnkAyuda" runat="server" href="#" OnClientClick="return false;"
CssClass="btn btn-circle btn-sm bg-warning" Text="<i class='fa fa-info'></i>" Visible="false" Height="25" Width="25"
data-toggle="popover" title="Ayuda" data-placement="top" data-trigger="hover" />
</ItemTemplate>
</asp:TemplateField>
<%--<asp:BoundField DataField="Abonado" HeaderText="Importe" DataFormatString="{0:N2}" />--%> <%--<asp:BoundField DataField="Abonado" HeaderText="Importe" DataFormatString="{0:N2}" />--%>
</Columns> </Columns>
<RowStyle CssClass="Texto" /> <RowStyle CssClass="Texto" />
@@ -481,6 +495,15 @@
<asp:DropDownList ID="DdlCuentaEnviados" runat="server" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="100px" CssClass="form-control input-sm select2me"></asp:DropDownList> <asp:DropDownList ID="DdlCuentaEnviados" runat="server" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="100px" CssClass="form-control input-sm select2me"></asp:DropDownList>
</li> </li>
<li>Tipo:
<asp:DropDownList ID="DdlTipoGeneracionEnviados" runat="server" CssClass="form-control input-sm select2me" Width="100px">
<asp:ListItem Text="Todos" Value="-1" />
<asp:ListItem Text="Pagos Proveedor" Selected="True" Value="PAGO" />
<asp:ListItem Text="Anticipos" Value="ANT" />
<asp:ListItem Text="Funcionarios y Empleados" Value="FyE" />
</asp:DropDownList>
</li>
<li >Estatus <li >Estatus
<asp:DropDownList ID="DdlEstatusEnviados" runat="server" Width="100px" CssClass="form-control input-sm select2me"> <asp:DropDownList ID="DdlEstatusEnviados" runat="server" Width="100px" CssClass="form-control input-sm select2me">
<asp:ListItem Text="Todos" Value="-1" /> <asp:ListItem Text="Todos" Value="-1" />
@@ -556,7 +579,7 @@
</div> </div>
<asp:GridView ID="GvEnviadas" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros enviados" ToolTip="Tabla de pagos electronicos" <asp:GridView ID="GvEnviadas" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros enviados" ToolTip="Tabla de pagos electronicos"
DataKeyNames="CveLayoutEnvioDetalle,CveIE,CveLayoutEnvio,CveProveedor,Archivo,Estatus" DataKeyNames="CveLayoutEnvioDetalle,CveIE,CveLayoutEnvio,CveProveedor,Archivo,Estatus,NotificarA"
OnRowDataBound="GvEnviadas_RowDataBound" CssClass="table table-striped table-hover Widthall ScrollAD" data-heigth="350px" data-freezerows="1" Style="text-align: center;" GridLines="None"> OnRowDataBound="GvEnviadas_RowDataBound" CssClass="table table-striped table-hover Widthall ScrollAD" data-heigth="350px" data-freezerows="1" Style="text-align: center;" GridLines="None">
<Columns> <Columns>
<asp:BoundField DataField="Fecha" HeaderText="Fecha Envio" DataFormatString="{0:d}" /> <asp:BoundField DataField="Fecha" HeaderText="Fecha Envio" DataFormatString="{0:d}" />
@@ -682,7 +705,7 @@
<asp:Button ID="BtnReporteAltaCarga" ClientIDMode="Static" Text="" runat="server" Style="display: none;" OnClick="BtnReporteAltaCarga_Click" /> <asp:Button ID="BtnReporteAltaCarga" ClientIDMode="Static" Text="" runat="server" Style="display: none;" OnClick="BtnReporteAltaCarga_Click" />
<asp:Button ID="BtnReporteAltaGenera" ClientIDMode="Static" Text="" runat="server" Style="display: none;" OnClick="BtnReporteAltaGenera_Click" /> <asp:Button ID="BtnReporteAltaGenera" ClientIDMode="Static" Text="" runat="server" Style="display: none;" OnClick="BtnReporteAltaGenera_Click" />
<asp:Button ID="BtnReportePago" ClientIDMode="Static" Text="" runat="server" Style="display: none;" OnClick="BtnReportePago_Click" /> <%--<asp:Button ID="BtnReportePago" ClientIDMode="Static" Text="" runat="server" Style="display: none;" OnClick="BtnReportePago_Click" />--%>
@@ -690,7 +713,7 @@
<div class="modal-dialog"> <div class="modal-dialog">
<!-- Modal content--> <!-- Modal content-->
<div class="modal-content" style="width:750px!important"> <div class="modal-content" style="width:900px!important">
<div class="modal-header "> <div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button> <button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Alta Cuentas</h4> <h4 class="modal-title">Alta Cuentas</h4>
@@ -700,7 +723,8 @@
<asp:UpdatePanel ID="UpModalCuentasCuerpo" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UpModalCuentasCuerpo" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<asp:GridView ID="GvCuentasModal" runat="server" DataKeyNames="CveCuentaDeposito" AutoGenerateColumns="False" ToolTip="Cuentas modal" OnRowDataBound="GvCuentasModal_RowDataBound" <asp:GridView ID="GvCuentasModal" runat="server" DataKeyNames="CveCuentaDeposito,CveSATBanco" AutoGenerateColumns="False" ToolTip="Cuentas modal"
OnRowDataBound="GvCuentasModal_RowDataBound"
CssClass="table table-striped table-hover Widthall" Style="text-align: center;" GridLines="None"> CssClass="table table-striped table-hover Widthall" Style="text-align: center;" GridLines="None">
<Columns> <Columns>
@@ -710,18 +734,32 @@
<asp:BoundField HeaderText="Cuenta" DataField="Cuenta" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField HeaderText="Cuenta" DataField="Cuenta" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Clabe" DataField="CLABEDestino" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField HeaderText="Clabe" DataField="CLABEDestino" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Alias" DataField="BBVAAlias" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Left" />
<asp:TemplateField HeaderText="Alta" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="40px"> <asp:TemplateField HeaderText="Banco" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="150px">
<ItemTemplate> <ItemTemplate>
<asp:CheckBox ID="ChkCuentasEstatus" runat="server" Checked='<%# Eval("EstatusPagoElectronicoGrupos") %>' /> <asp:DropDownList CssClass="form-control select2me" Width="100%" ID="DdlSatBanco" runat="server" DataTextField="Banco" DataValueField="CveSATBanco" >
<asp:ListItem Value="-1">Seleccione uno</asp:ListItem>
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Alias" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="100px">
<ItemTemplate>
<asp:TextBox runat="server" ID="TxtBBVAAlias" Text='<%# Bind("BBVAAlias") %>' Width="100%" ></asp:TextBox>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Alta" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="40px">
<%--________________________________________________________--%> <HeaderTemplate>
<input type="checkbox" class="form-check-input" id="ChkSelector" onclick="SelectorCuentasProveedor(this)">
</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox ID="ChkCuentasEstatus" runat="server" Checked='<%# Eval("EstatusPagoElectronicoGrupos") %>' CssClass="CssCuentasSelector" />
</ItemTemplate>
</asp:TemplateField>
</Columns> </Columns>
<RowStyle CssClass="Texto" /> <RowStyle CssClass="Texto" />
@@ -813,10 +851,15 @@
<div class="col-md-12" runat="server" id="DVDescargaCuentas1" visible=" false" > <div class="col-md-12" runat="server" id="DVDescargaCuentas1" visible=" false" >
<p> Cuentas Bancomer <asp:LinkButton runat="server" ID="LnkDescargaCuentas1" OnClick="LnkDescargaCuentas1_Click" CssClass="Texto"></asp:LinkButton> </p> <p> Cuentas Bancomer <asp:LinkButton runat="server" ID="LnkDescargaCuentas1" OnClick="LnkDescargaCuentas1_Click" CssClass="Texto"></asp:LinkButton> </p>
</div> </div>
<div class="col-md-12" runat="server" id="DVDescargaCuentas2" visible=" false"> <div class="col-md-12" runat="server" id="DVDescargaCuentas2" visible=" false">
<p> Cuentas Interbancarias <asp:LinkButton runat="server" ID="LnkDescargaCuentas2" OnClick="LnkDescargaCuentas2_Click" CssClass="Texto"></asp:LinkButton> </p> <p> Cuentas Interbancarias <asp:LinkButton runat="server" ID="LnkDescargaCuentas2" OnClick="LnkDescargaCuentas2_Click" CssClass="Texto"></asp:LinkButton> </p>
</div> </div>
<div class="col-md-12" runat="server" id="DVDescargaReporte" visible=" false">
<p> <asp:LinkButton runat="server" ID="LnkDescargaReporte" OnClick="LnkDescargaReporte_Click" CssClass="Texto" Text="Descargar Reporte"></asp:LinkButton> </p>
</div>
</div> </div>
@@ -825,6 +868,7 @@
<asp:PostBackTrigger ControlID="LnkDescarga" /> <asp:PostBackTrigger ControlID="LnkDescarga" />
<asp:PostBackTrigger ControlID="LnkDescargaCuentas1" /> <asp:PostBackTrigger ControlID="LnkDescargaCuentas1" />
<asp:PostBackTrigger ControlID="LnkDescargaCuentas2" /> <asp:PostBackTrigger ControlID="LnkDescargaCuentas2" />
<asp:PostBackTrigger ControlID="LnkDescargaReporte" />
</Triggers> </Triggers>
</asp:UpdatePanel> </asp:UpdatePanel>
@@ -847,24 +891,40 @@
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server"> <asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script type="text/javascript"> <script type="text/javascript">
function fncg() {
$get('BtnReporteAltaCarga').click(); function pageLoad() {
$(document).ready(function () {
$('[data-toggle="popover"]').popover();
});
} }
function fncp() {
$get('BtnReportePago').click();
} //function fncg() {
// $get('BtnReporteAltaCarga').click();
//}
//function fncp() {
// $get('BtnReportePago').click();
//}
function PrefijoFolioEnviados(TxtPrefijo) { function PrefijoFolioEnviados(TxtPrefijo) {
$(`.CSSPrefijo`).each(function () { $(`.CSSPrefijo`).each(function () {
$(this).val(TxtPrefijo.value) $(this).val(TxtPrefijo.value)
}); });
}
function SelectorCuentasProveedor(Chk) {
$(`.CssCuentasSelector input[type=checkbox]`).each(function () {
$(this).prop('checked', Chk.checked);
});
} }

View File

@@ -70,6 +70,17 @@ Partial Class Bancos_PagoElectronicoGrupos
End Set End Set
End Property End Property
Private Property DT_PagosReporte As DataTable
Get
Return CType(ViewState("DT_PagosReporte"), DataTable)
End Get
Set(value As DataTable)
ViewState("DT_PagosReporte") = value
End Set
End Property
Private Property DTAltasPendientes As DataTable Private Property DTAltasPendientes As DataTable
Get Get
Return CType(ViewState("DTAltasPendientes"), DataTable) Return CType(ViewState("DTAltasPendientes"), DataTable)
@@ -181,6 +192,7 @@ Partial Class Bancos_PagoElectronicoGrupos
ViewState("NombreArchivoBancomer") = value ViewState("NombreArchivoBancomer") = value
End Set End Set
End Property End Property
Private Property NombreArchivoInterbancario As String Private Property NombreArchivoInterbancario As String
Get Get
Return ViewState("NombreArchivoInterbancario").ToString Return ViewState("NombreArchivoInterbancario").ToString
@@ -190,6 +202,18 @@ Partial Class Bancos_PagoElectronicoGrupos
End Set End Set
End Property End Property
Property DTSATBancos As DataTable
Get
If ViewState("DTSATBancos") Is Nothing Then
Return New DataTable
Else
Return DirectCast(ViewState("DTSATBancos"), DataTable)
End If
End Get
Set(value As DataTable)
ViewState("DTSATBancos") = value
End Set
End Property
#End Region #End Region
@@ -273,11 +297,8 @@ Partial Class Bancos_PagoElectronicoGrupos
GvPendientes.DataBind() GvPendientes.DataBind()
UpEnviados.Update() UpEnviados.Update()
UpGVDatos.Update() UpGVDatos.Update()
End Sub End Sub
Private Sub CargaDatosInformativos() Private Sub CargaDatosInformativos()
Dim Altas = 0 Dim Altas = 0
@@ -369,7 +390,7 @@ Partial Class Bancos_PagoElectronicoGrupos
Response.ContentType = "application/zip" Response.ContentType = "application/zip"
Response.End() Response.End()
End Sub End Sub
Private Function CreaArchivo(Tipo As Integer, Optional MismoBanco As Boolean = True, Optional NombreArchivoEnviado As String = "") As Boolean Private Function CreaArchivo(Tipo As Integer, Optional MismoBanco As Boolean = True, Optional ByRef NombreArchivoEnviado As String = "") As Boolean
System.Threading.Thread.Sleep(1000) 'Un segundo de diferencia Para doferentes tipos de bancos System.Threading.Thread.Sleep(1000) 'Un segundo de diferencia Para doferentes tipos de bancos
@@ -386,6 +407,8 @@ Partial Class Bancos_PagoElectronicoGrupos
If NombreArchivoEnviado.Length > 0 Then If NombreArchivoEnviado.Length > 0 Then
NombreArchivo = NombreArchivoEnviado NombreArchivo = NombreArchivoEnviado
Else
NombreArchivoEnviado = NombreArchivo
End If End If
Dim path As String = String.Format("{0}Layout\{1}", UsuarioActual.Empresa.Ruta, NombreArchivo) Dim path As String = String.Format("{0}Layout\{1}", UsuarioActual.Empresa.Ruta, NombreArchivo)
@@ -428,13 +451,20 @@ Partial Class Bancos_PagoElectronicoGrupos
If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.RowType = DataControlRowType.DataRow Then
Dim LnkAyuda As LinkButton = e.Row.FCLinkButton("LnkAyuda")
'Colorea GV 'Colorea GV
If e.Row.DBCampo("RazonSocial").ToString = "" Then If e.Row.DBCampo("RazonSocial").ToString = "" Then
e.Row.BackColor = Drawing.Color.WhiteSmoke e.Row.BackColor = Drawing.Color.WhiteSmoke
Else Else
If e.Row.DBCampo("EstatusPagoElectronicoGrupos").ToString <> "True" Then If e.Row.DBCampo("EstatusPagoElectronicoGrupos").ToString <> "True" Then
e.Row.BackColor = Drawing.Color.LightSalmon
'e.Row.BackColor = Drawing.Color.LightSalmon
e.Row.ToolTip = "Cuenta Deposito aun sin dar de Alta." e.Row.ToolTip = "Cuenta Deposito aun sin dar de Alta."
LnkAyuda.Attributes.Add("data-content", "Cuenta Deposito aún sin dar de Alta.")
LnkAyuda.Visible = True
End If End If
If e.Row.DBCampo("CveProveedor").ToString.ToEntero > 0 Then If e.Row.DBCampo("CveProveedor").ToString.ToEntero > 0 Then
@@ -446,13 +476,22 @@ Partial Class Bancos_PagoElectronicoGrupos
End If End If
If Not e.Row.DBCampo("CveCuentaDeposito").ToString.ToEntero > 0 Then If Not e.Row.DBCampo("CveCuentaDeposito").ToString.ToEntero > 0 Then
e.Row.Cells(0).BackColor = Drawing.Color.Red 'e.Row.Cells(0).BackColor = Drawing.Color.Red
e.Row.ToolTip = "Sin Cuenta Deposito asignada" e.Row.ToolTip = "Sin Cuenta Deposito asignada"
LnkAyuda.Attributes.Add("data-content", "Sin Cuenta Deposito asignada")
LnkAyuda.Visible = True
End If End If
If e.Row.DBCampo("EstatusCtaDeposito").ToString = "False" Then If e.Row.DBCampo("EstatusCtaDeposito").ToString = "False" Then
e.Row.Cells(0).BackColor = Drawing.Color.Red 'e.Row.Cells(0).BackColor = Drawing.Color.Red
e.Row.ToolTip = "Cuenta Deposito INACTIVA" e.Row.ToolTip = "Cuenta Deposito INACTIVA"
LnkAyuda.Attributes.Add("data-content", "Cuenta Deposito INACTIVA")
LnkAyuda.Visible = True
End If End If
e.Row.FCHyperLink("HLImporte").NavigateUrl = String.Format("IE.aspx?CveIE={0}", e.Row.DBCampo("CveIE")) e.Row.FCHyperLink("HLImporte").NavigateUrl = String.Format("IE.aspx?CveIE={0}", e.Row.DBCampo("CveIE"))
@@ -503,7 +542,7 @@ Partial Class Bancos_PagoElectronicoGrupos
e.Row.FCHyperLink("HLDetalle").NavigateUrl = String.Format("IE.aspx?CveIE={0}", e.Row.DBCampo("CveIE")) e.Row.FCHyperLink("HLDetalle").NavigateUrl = String.Format("IE.aspx?CveIE={0}", e.Row.DBCampo("CveIE"))
If e.Row.DataKey("Estatus").ToEntero = 3 Then If e.Row.DataKey("Estatus").ToEntero.contiene(2, 3) Then
e.Row.FCLinkButton("ImgUpload").Visible = False e.Row.FCLinkButton("ImgUpload").Visible = False
e.Row.FCLinkButton("LnkGvCancelar").Visible = False e.Row.FCLinkButton("LnkGvCancelar").Visible = False
@@ -755,6 +794,7 @@ Partial Class Bancos_PagoElectronicoGrupos
'Mensaje.Append("Descarga Layouts<br><br>") 'Mensaje.Append("Descarga Layouts<br><br>")
DVDescargaPagos.Visible = False DVDescargaPagos.Visible = False
DVDescargaReporte.Visible = False
@@ -1192,6 +1232,9 @@ Partial Class Bancos_PagoElectronicoGrupos
DVDescargaPagos.Visible = True DVDescargaPagos.Visible = True
DVDescargaCuentas1.Visible = False DVDescargaCuentas1.Visible = False
DVDescargaCuentas2.Visible = False DVDescargaCuentas2.Visible = False
DVDescargaReporte.Visible = True
DT_PagosReporte = DTPendientesTemp.Copy
LnkDescarga.Text = NombreArchivoPago LnkDescarga.Text = NombreArchivoPago
RegistraScript("$('#ModalDescarga').modal({ backdrop: 'static', keyboard: false});") RegistraScript("$('#ModalDescarga').modal({ backdrop: 'static', keyboard: false});")
@@ -1703,6 +1746,8 @@ Partial Class Bancos_PagoElectronicoGrupos
If NombreArchivoBancomer.Length > 0 Or NombreArchivoInterbancario.Length > 0 Then If NombreArchivoBancomer.Length > 0 Or NombreArchivoInterbancario.Length > 0 Then
DVDescargaPagos.Visible = False DVDescargaPagos.Visible = False
DVDescargaReporte.Visible = False
LnkDescargaCuentas1.Text = NombreArchivoBancomer LnkDescargaCuentas1.Text = NombreArchivoBancomer
LnkDescargaCuentas2.Text = NombreArchivoInterbancario LnkDescargaCuentas2.Text = NombreArchivoInterbancario
RegistraScript("$('#ModalDescarga').modal({ backdrop: 'static', keyboard: false});") RegistraScript("$('#ModalDescarga').modal({ backdrop: 'static', keyboard: false});")
@@ -1850,17 +1895,18 @@ Partial Class Bancos_PagoElectronicoGrupos
'CORREO 'CORREO
#Region " GENERA Y MANDA CORREO " #Region " GENERA Y MANDA CORREO "
Private Sub MandaCorreo(data As Object)
Dim Parametros As List(Of String) = DirectCast(data, List(Of String))
Dim Mail As New ClsSisMail() 'Private Sub MandaCorreo(data As Object)
Dim Para As String = Parametros(0) ' Dim Parametros As List(Of String) = DirectCast(data, List(Of String))
Dim Asunto As String = Parametros(1)
Dim Body As String = Parametros(2)
Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body) ' Dim Mail As New ClsSisMail()
' Dim Para As String = Parametros(0)
' Dim Asunto As String = Parametros(1)
' Dim Body As String = Parametros(2)
End Sub ' Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body)
'End Sub
Private Function GeneraCorreo(CveIE As Integer, objIE As ClsBancos) As String Private Function GeneraCorreo(CveIE As Integer, objIE As ClsBancos) As String
Dim strBody As New StringBuilder Dim strBody As New StringBuilder
@@ -2338,11 +2384,15 @@ Partial Class Bancos_PagoElectronicoGrupos
Return strBody.ToString Return strBody.ToString
End Function End Function
#End Region #End Region
#Region " IMPRIMIR " #Region " IMPRIMIR "
Protected Sub BtnReporteAltaCarga_Click(sender As Object, e As EventArgs) Protected Sub BtnReporteAltaCarga_Click(sender As Object, e As EventArgs)
Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos/LayoutAltaProveedor.rdlc", UsuarioActual.Empresa.Ruta)) Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos/LayoutAltaProveedor.rdlc", UsuarioActual.Empresa.Ruta))
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))
@@ -2374,6 +2424,9 @@ Partial Class Bancos_PagoElectronicoGrupos
ImprimirPDF("Empresas/Grales/Formatos/LayoutAltaProveedor.rdlc", DtAlta, params, "LayoutAltaProveedor", RDSName:="DsPagoElectronico") ImprimirPDF("Empresas/Grales/Formatos/LayoutAltaProveedor.rdlc", DtAlta, params, "LayoutAltaProveedor", RDSName:="DsPagoElectronico")
End If End If
End Sub End Sub
Protected Sub BtnReporteAltaGenera_Click(sender As Object, e As EventArgs) Protected Sub BtnReporteAltaGenera_Click(sender As Object, e As EventArgs)
Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos/LayoutAltaProveedor.rdlc", UsuarioActual.Empresa.Ruta)) Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos/LayoutAltaProveedor.rdlc", UsuarioActual.Empresa.Ruta))
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))
@@ -2402,12 +2455,24 @@ Partial Class Bancos_PagoElectronicoGrupos
End If End If
End Sub End Sub
Protected Sub BtnReportePago_Click(sender As Object, e As EventArgs) Protected Sub BtnReportePago_Click(sender As Object, e As EventArgs)
Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos/LayoutAltaProveedor.rdlc", UsuarioActual.Empresa.Ruta)) Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos/LayoutAltaProveedor.rdlc", UsuarioActual.Empresa.Ruta))
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 params As New List(Of ReportParameter) Dim DT_PagosReporte As New DataTable
DT_PagosReporte = DTPendientes.FiltraParametros("EstatusPagoElectronicoGrupos = 'True' AND EstatusCtaDeposito > 0").Copy()
'DT_PagosReporte.Columns(7).ColumnName = "Proveedor"
'DT_PagosReporte.Columns(2).ColumnName = "Importe"
'DT_PagosReporte.Columns(22).ColumnName = "Moneda"
Dim params As New List(Of ReportParameter)
If Archivo.Exists Then If Archivo.Exists Then
ImprimirPDF(String.Format("{0}Formatos\LayoutPagoProveedor.rdlc", UsuarioActual.Empresa.Ruta), DtPago, params, "LayoutPagoProveedor", RDSName:="DSPagoElectronicoV2") ImprimirPDF(String.Format("{0}Formatos\LayoutPagoProveedor.rdlc", UsuarioActual.Empresa.Ruta), DtPago, params, "LayoutPagoProveedor", RDSName:="DSPagoElectronicoV2")
@@ -2420,14 +2485,23 @@ Partial Class Bancos_PagoElectronicoGrupos
params.Add(New ReportParameter("LogoPath", "")) params.Add(New ReportParameter("LogoPath", ""))
End If End If
params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa)) params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("Direccion", UsuarioActual.Empresa.Direccion)) params.Add(New ReportParameter("Direccion", UsuarioActual.Empresa.Direccion))
params.Add(New ReportParameter("RFC", UsuarioActual.Empresa.RFC)) params.Add(New ReportParameter("RFC", UsuarioActual.Empresa.RFC))
params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy"))) params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
ImprimirPDF("Empresas/Grales/Formatos/LayoutPagoProveedor.rdlc", DtPago, params, "LayoutPagoProveedor", RDSName:="DSPagoElectronicoV2")
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
params.Add(New ReportParameter("Titulo", "Reporte Pago Proveedor Layout"))
ImprimirPDF("Empresas/Grales/Formatos/LayoutPagoProveedor.rdlc", DT_PagosReporte, params, "LayoutPagoProveedor", RDSName:="DSPagoElectronicoV2")
End If End If
End Sub End Sub
#End Region #End Region
@@ -2444,22 +2518,40 @@ Partial Class Bancos_PagoElectronicoGrupos
End Sub End Sub
Private Sub CargaGVPendintesModal() Private Sub CargaGVPendintesModal()
Dim DTGvCuentasPendientes As DataTable = DTPendientes.Copy.FiltraParametros("CveCuentaDeposito > 0", "", {"CveCuentaDeposito", "BancoNombre", "RazonSocial", "Cuenta", "CLABEDestino", "BBVAAlias", "EstatusPagoElectronicoGrupos"}) Dim ObjBancos As New ClsBancos
If ObjBancos.GetBancosSAT Then
DTSATBancos = ObjBancos.DtResultados
End If
ObjBancos.Dispose()
Dim DTGvCuentasPendientes As DataTable = DTPendientes.Copy.FiltraParametros("CveCuentaDeposito > 0", "", {"CveCuentaDeposito", "BancoNombre", "RazonSocial", "Cuenta", "CLABEDestino", "BBVAAlias", "EstatusPagoElectronicoGrupos", "CveSATBanco"})
GvCuentasModal.DataSource = DTGvCuentasPendientes GvCuentasModal.DataSource = DTGvCuentasPendientes
GvCuentasModal.DataBind() GvCuentasModal.DataBind()
UpModalCuentasCuerpo.Update() UpModalCuentasCuerpo.Update()
End Sub End Sub
Protected Sub GvCuentasModal_RowDataBound(sender As Object, e As GridViewRowEventArgs) Protected Sub GvCuentasModal_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.FCCheckBox("ChkCuentasEstatus").Checked = True
'e.Row.FCCheckBox("ChkCuentasEstatus").Checked = True
e.Row.FCDropDownList("DdlSatBanco").DataSource = DTSATBancos
e.Row.FCDropDownList("DdlSatBanco").DataBind()
e.Row.FCDropDownList("DdlSatBanco").Items.Insert(0, New ListItem("Seleccione uno", "-1"))
e.Row.FCDropDownList("DdlSatBanco").SelectedValueExist(e.Row.DataKey("CveSATBanco"))
End If End If
End Sub End Sub
@@ -2475,10 +2567,14 @@ Partial Class Bancos_PagoElectronicoGrupos
ObjGenerales.IniciaTransacSQL() ObjGenerales.IniciaTransacSQL()
For Each GvRow As GridViewRow In GvCuentasModal.Rows For Each GvRow As GridViewRow In GvCuentasModal.Rows
Dim CveCuentaDeposito As Integer = GvRow.DataKey("CveCuentaDeposito").ToEntero Dim CveCuentaDeposito As Integer = GvRow.DataKey("CveCuentaDeposito").ToEntero
Dim ChkCuentasEstatus As CheckBox = GvRow.FCCheckBox("ChkCuentasEstatus") Dim ChkCuentasEstatus As CheckBox = GvRow.FCCheckBox("ChkCuentasEstatus")
Dim TxtBBVAAlias As TextBox = GvRow.FCTextBox("TxtBBVAAlias")
Dim DdlSatBanco As DropDownList = GvRow.FCDropDownList("DdlSatBanco")
If Not ObjGenerales.UpdateCuentasDepositosEstatusPagoElectronicoGrupos(CveCuentaDeposito, ChkCuentasEstatus.Checked) Then
If Not ObjGenerales.UpdateCuentasDepositosEstatusPagoElectronicoGrupos(CveCuentaDeposito, ChkCuentasEstatus.Checked, DdlSatBanco.SelectedValue.ToEntero, TxtBBVAAlias.Text) Then
ErrorProceso = True ErrorProceso = True
Exit For Exit For
End If End If
@@ -2512,7 +2608,7 @@ Partial Class Bancos_PagoElectronicoGrupos
Dim FechaI = If(IsDate(txtFechaIEnviados.Text.Trim()), txtFechaIEnviados.Text.Trim(), "-1") Dim FechaI = If(IsDate(txtFechaIEnviados.Text.Trim()), txtFechaIEnviados.Text.Trim(), "-1")
Dim FechaF = If(IsDate(txtFechaFEnviados.Text.Trim()), txtFechaFEnviados.Text.Trim(), "-1") Dim FechaF = If(IsDate(txtFechaFEnviados.Text.Trim()), txtFechaFEnviados.Text.Trim(), "-1")
If ObjBancos.GetLayoutPagosEnviados(DdlCuentaEnviados.SelectedValue.ToEntero, DdlEstatusEnviados.SelectedValue.ToEntero, "-1", FechaI, FechaF, PorGrupos:=True) Then If ObjBancos.GetLayoutPagosEnviados(DdlCuentaEnviados.SelectedValue.ToEntero, DdlEstatusEnviados.SelectedValue.ToEntero, DdlTipoGeneracionEnviados.SelectedValue, FechaI, FechaF, PorGrupos:=True) Then
DTEnviadas = ObjBancos.DtResultados DTEnviadas = ObjBancos.DtResultados
Else Else
DTEnviadas = Nothing DTEnviadas = Nothing
@@ -2651,9 +2747,6 @@ Partial Class Bancos_PagoElectronicoGrupos
End If End If
End Sub End Sub
@@ -2672,6 +2765,7 @@ Partial Class Bancos_PagoElectronicoGrupos
Dim CveLayoutEnvio As Integer = GvRow.DataKey("CveLayoutEnvio").ToEntero Dim CveLayoutEnvio As Integer = GvRow.DataKey("CveLayoutEnvio").ToEntero
Dim CveIE As Integer = GvRow.DataKey("CveIE").ToEntero Dim CveIE As Integer = GvRow.DataKey("CveIE").ToEntero
Dim CveProveedor As Integer = GvRow.DataKey("CveProveedor").ToEntero Dim CveProveedor As Integer = GvRow.DataKey("CveProveedor").ToEntero
Dim NotificarA As String = GvRow.DataKey("NotificarA")
If Not ObjBanco.UpdateLayoutEnviosDetalle(CveLayoutEnvioDetalle, CveLayoutEnvio, CveIE, CveProveedor, 2, "", True) Then If Not ObjBanco.UpdateLayoutEnviosDetalle(CveLayoutEnvioDetalle, CveLayoutEnvio, CveIE, CveProveedor, 2, "", True) Then
@@ -2713,6 +2807,10 @@ Partial Class Bancos_PagoElectronicoGrupos
Else Else
ObjBanco.Commit() ObjBanco.Commit()
Alert("Confirmado Correctamente") Alert("Confirmado Correctamente")
NotificacionPago(CveIE, NotificarA)
CargaEnviados()
End If End If
@@ -2968,4 +3066,312 @@ Partial Class Bancos_PagoElectronicoGrupos
Response.TransmitFile(FilePath) Response.TransmitFile(FilePath)
Response.End() Response.End()
End Sub End Sub
Protected Sub LnkDescargaReporte_Click(sender As Object, e As EventArgs)
Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos/LayoutAltaProveedor.rdlc", UsuarioActual.Empresa.Ruta))
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
' Dim DT_PagosReporte As New DataTable
DT_PagosReporte = DT_PagosReporte.FiltraParametros("EstatusPagoElectronicoGrupos = 'True' AND EstatusCtaDeposito > 0").Copy()
'DT_PagosReporte.Columns(7).ColumnName = "Proveedor"
'DT_PagosReporte.Columns(2).ColumnName = "Importe"
'DT_PagosReporte.Columns(22).ColumnName = "Moneda"
Dim params As New List(Of ReportParameter)
If Archivo.Exists Then
ImprimirPDF(String.Format("{0}Formatos\LayoutPagoProveedor.rdlc", UsuarioActual.Empresa.Ruta), DtPago, params, "LayoutPagoProveedor", RDSName:="DSPagoElectronicoV2")
Else
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
If Imagen.Exists Then
params.Add(New ReportParameter("LogoPath", logouri))
Else
params.Add(New ReportParameter("LogoPath", ""))
End If
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("Direccion", UsuarioActual.Empresa.Direccion))
params.Add(New ReportParameter("RFC", UsuarioActual.Empresa.RFC))
params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
params.Add(New ReportParameter("Titulo", "Reporte Pago Proveedor Layout"))
ImprimirPDF("Empresas/Grales/Formatos/LayoutPagoProveedor.rdlc", DT_PagosReporte, params, "LayoutPagoProveedor", RDSName:="DSPagoElectronicoV2")
End If
End Sub
Private Sub NotificacionPago(CveIE As Integer, CorreoNotificarA As String)
'If Not DdlTipoTransaccion.SelectedValue.ToEntero.Contiene(9, 17) Then
'Dim Param As New List(Of String)
'Param.Add(CorreoNotificarA) 'Para
'Param.Add("Notificaciones de pago") 'Asunto
'Param.Add(GeneraCorreo(CveIE)) 'Body
'Param.Add(CveIE.ToString) 'CveIE
Dim Body As String = GeneraCorreo(CveIE)
'Dim Comprobante = If(ComprobanteIE <> "", String.Format("{0}IE\{1}", UsuarioActual.Empresa.Ruta, ComprobanteIE), "") 'Archivo Adjunto
Dim Comprobante As String = ""
Dim File As Byte() = Nothing
'If UsuarioActual.Empresa.Funcionalidad(545).ToEntero > 0 Then
' File = NewGeneraBytesCxP(CveProveedor, UsuarioActual.Nombre)
'End If
Dim Hilo As New Threading.Thread(Sub() MandaCorreo(CorreoNotificarA, "Notificaciones de pago", Body, CveIE, Comprobante, File))
Hilo.Start()
'End If
End Sub
Private Sub MandaCorreo(Para As String, Asunto As String, Body As String, CveIE As Integer, Comprobante As String, File As Byte())
'Dim Parametros As List(Of String) = DirectCast(Data, List(Of String))
Dim Mail As New ClsSisMail()
Para = If(Para IsNot Nothing, Para, "")
Asunto = If(Asunto IsNot Nothing, Asunto, "")
Body = If(Body IsNot Nothing, Body, "")
Dim ListaArchivos As New List(Of ClsSisMail.ArchivoMail)
If Comprobante IsNot Nothing AndAlso Comprobante <> "" Then
ListaArchivos.Add(New ClsSisMail.ArchivoMail With {.Ruta = Comprobante})
End If
If File IsNot Nothing Then
ListaArchivos.Add(New ClsSisMail.ArchivoMail With {.ArchivoBinario = File, .NombreArchivo = "EstadoCuentaCxP.pdf"})
End If
If Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body, Archivos:=ListaArchivos) Then
Dim objIE As New ClsBancos
objIE.UpdateBancos_IENotificaciones(1, "-1", "-1", CveIE)
objIE.Dispose()
End If
End Sub
Private Function GeneraCorreo(CveIE As Integer) As String
Dim strBody As New StringBuilder
Dim objIE As New ClsBancos
If objIE.GetBancosIE(CveIE, UsuarioActual.CveEmpresa) Then
strBody.Append("<html xmlns=""http://www.w3.org/1999/xhtml""> ")
strBody.Append("<head> ")
strBody.Append(" <style type=""text/css""> ")
strBody.Append(" body ")
strBody.Append(" { ")
strBody.Append(" margin:0px; ")
strBody.Append(" padding:0px 0px 0px 0px; ")
strBody.Append(" font-family: Verdana, Arial, Helvetica, sans-serif; ")
strBody.Append(" font-size: 10px; ")
strBody.Append(" background-color:#F0F0F0; ")
strBody.Append(" } ")
strBody.Append(" a.Texto ")
strBody.Append(" { ")
strBody.Append(" font-size:11px; ")
strBody.Append(" background-color:#F7F6F3; ")
strBody.Append(" text-decoration:none; ")
strBody.Append(" font-weight:bold; ")
strBody.Append(" } ")
strBody.Append(" .Texto ")
strBody.Append(" { ")
strBody.Append(" background-color:#F7F6F3; color:Black; font-family:Verdana; font-size:10px; text-align:center; vertical-align:middle; height:20px;")
strBody.Append(" } ")
strBody.Append(" .TextoAlterno ")
strBody.Append(" { ")
strBody.Append(" background-color:White; color:Black; font-family:Verdana; font-size:10px; text-align:center; ")
strBody.Append(" vertical-align:middle; height:20px;")
strBody.Append(" } ")
strBody.Append(" .BarraIdentidad ")
strBody.Append(" { ")
strBody.Append(" color:#FFFFFF; ")
strBody.Append(" background:#F0F0F0; ")
strBody.Append(" font-weight:bold; ")
strBody.Append(" font-size:19px; ")
strBody.Append(" font-style:oblique; ")
strBody.Append(" } ")
strBody.Append(" .Titulos ")
strBody.Append(" { ")
strBody.Append(" background-color: Gray;")
strBody.Append(" color:White; ")
strBody.Append(" font-family:Verdana; font-size:12px; text-align:center; ")
strBody.Append(" vertical-align:middle; font-weight:bold; height:30px; ")
strBody.Append(" text-decoration:none; ")
strBody.Append(" } ")
strBody.Append(" .Verde {color: #00CC00;} ")
strBody.Append(" .Negro {color: #000000;} ")
strBody.Append(" .Rojo {color: #FF0000;} ")
strBody.Append(" </style> ")
strBody.Append("</head> ")
strBody.Append("<body> ")
strBody.AppendFormat("<div id='C_div' style='width: 600px'>")
strBody.AppendFormat(" <fieldset>")
strBody.AppendFormat(" <legend><b>{0}</b></legend>", UsuarioActual.Empresa.Empresa)
strBody.AppendFormat(" <table class='TextoG' border='0' cellpadding='0' cellspacing='0' width='100%'>")
strBody.AppendFormat(" <tr>")
strBody.AppendFormat(" <td style='width:100px'>{0}</td>", UsuarioActual.Empresa.Direccion)
strBody.AppendFormat(" </tr>")
strBody.AppendFormat(" <tr>")
strBody.AppendFormat(" <td>Col. {0}</td>", UsuarioActual.Empresa.Colonia)
strBody.AppendFormat(" </tr>")
strBody.AppendFormat(" <tr>")
strBody.AppendFormat(" <td>{0}, {1}, C.P.{2}</td>", UsuarioActual.Empresa.Ciudad, UsuarioActual.Empresa.Estado, UsuarioActual.Empresa.CP)
strBody.AppendFormat(" </tr>")
strBody.AppendFormat(" <tr>")
strBody.AppendFormat(" <td>RFC {0}</td>", UsuarioActual.Empresa.RFC)
strBody.AppendFormat(" </tr>")
strBody.AppendFormat(" </table>")
strBody.AppendFormat(" </fieldset>")
strBody.AppendFormat("</div><br/><br/>")
strBody.AppendFormat("<div style='width: 600px'>")
strBody.AppendFormat(" <fieldset>")
strBody.AppendFormat(" <legend><b> </b></legend>")
strBody.AppendFormat(" <table class='TextoG' style='width:100%'>")
If objIE.CveTipoTransaccion = 1 Then ' cuando es cheque
strBody.Append(" <tr style=""height: 22px""> ")
strBody.Append(" <td>Favor de pasar a nuestras oficinas por el cheque con la siguientes instrucciones.</td> ")
strBody.Append(" </tr> ")
End If
If objIE.CveTipoTransaccion = 2 Then ' cuando es transf
strBody.Append(" <tr style=""height: 22px""> ")
strBody.Append(" <td>Notificación de transferencia de pago realizada.</td> ")
strBody.Append(" </tr> ")
End If
strBody.Append(" <tr style=""height: 22px""> ")
strBody.AppendFormat(" <td>&nbsp;</td> ")
strBody.Append(" </tr> ")
strBody.Append(" </table> ")
strBody.AppendFormat(" </fieldset>")
strBody.Append(" </div> ")
strBody.AppendFormat("<div style='width: 600px'>")
strBody.AppendFormat(" <table style='width:100%'>")
strBody.AppendFormat(" <tr>")
strBody.AppendFormat(" <td style='vertical-align: top'>")
strBody.AppendFormat(" <fieldset>")
strBody.AppendFormat(" <legend>Beneficiario:<b>{0}</b> </legend>", objIE.PagueseA)
strBody.AppendFormat(" <table width='100%'>")
strBody.AppendFormat(" <tr style='background-color: gray; color: White; font-family: Verdana; font-size: 10px; text-align: center; vertical-align: middle; font-weight: bold; height: 20px; text-decoration: none;'>")
strBody.AppendFormat(" <th scope='col' style='width:150px;'></th>")
strBody.AppendFormat(" <th scope='col' style='width:450px;'></th>")
strBody.AppendFormat(" </tr>")
strBody.AppendFormat(" <tr class='Texto'>")
strBody.AppendFormat(" <td>Movimiento:</td>")
strBody.AppendFormat(" <td style='text-align: left'>{0}</td>", objIE.TipoTransaccion)
strBody.AppendFormat(" </tr>")
strBody.AppendFormat(" <tr class='Texto'>")
strBody.AppendFormat(" <td>Banco:</td>")
strBody.AppendFormat(" <td style='text-align: left'>{0}</td>", objIE.Banco)
strBody.AppendFormat(" </tr>")
strBody.AppendFormat(" <tr class='Texto'>")
strBody.AppendFormat(" <td>Cuenta:</td>")
strBody.AppendFormat(" <td style='text-align: left'>{0}</td>", objIE.NumCuenta)
strBody.AppendFormat(" </tr>")
If objIE.CuentaDepositado.ToString <> "" Then
strBody.AppendFormat(" <tr class='Texto'>")
strBody.AppendFormat(" <td>Cuenta Destino:</td>")
strBody.AppendFormat(" <td style='text-align: left'>{0}</td>", objIE.CuentaDepositado)
strBody.AppendFormat(" </tr>")
End If
strBody.AppendFormat(" <tr class='Texto'>")
strBody.AppendFormat(" <td>Fecha:</td>")
strBody.AppendFormat(" <td style='text-align: left'>{0}</td>", objIE.FechaDocumento.ToString("dd/MM/yyyy"))
strBody.AppendFormat(" </tr>")
strBody.AppendFormat(" <tr class='Texto'>")
strBody.AppendFormat(" <td>Importe:</td>")
strBody.AppendFormat(" <td style='text-align: left'>$ {0} {1}</td>", objIE.Importe.FormatoNumero, objIE.Moneda)
strBody.AppendFormat(" </tr>")
strBody.AppendFormat(" <tr class='Texto'>")
strBody.AppendFormat(" <td>Observaciones:</td>")
strBody.AppendFormat(" <td style='text-align: left'>{0}</td>", objIE.Observaciones)
strBody.AppendFormat(" </tr>")
strBody.AppendFormat(" <tr class='Texto'>")
strBody.AppendFormat(" <td colspan='2'>")
strBody.AppendFormat(" <hr />")
strBody.AppendFormat(" </td>")
strBody.AppendFormat(" </tr>")
strBody.AppendFormat(" </table>")
strBody.AppendFormat(" </fieldset>")
strBody.AppendFormat(" </td>")
strBody.AppendFormat(" </tr>")
strBody.AppendFormat(" </table>")
strBody.AppendFormat("</div>")
'MOVIMIENTOS CHEQUE
If objIE.GetBancosIEMovimientos(CveIE, UsuarioActual.CveEmpresa) Then
Dim Textov33 As String = ""
If UsuarioActual.Empresa.Funcionalidad(520) = "1" Then
Textov33 = "Favor de emitir complemento de pago de los siguientes documentos"
End If
strBody.AppendFormat("<div style='width: 1000px'>")
strBody.AppendFormat(" <table style='width:1000px'>")
strBody.AppendFormat(" <tr>")
strBody.AppendFormat(" <td style='vertical-align: top'>")
strBody.AppendFormat(" <fieldset>")
strBody.AppendFormat(" <legend><b>Documentos abonados o pagados <br/>{0}</b> </legend>", Textov33)
strBody.AppendFormat(" <table width='1000px'>")
strBody.AppendFormat(" <tr style='background-color: gray; color: White; font-family: Verdana; font-size: 10px; text-align: center; vertical-align: middle; font-weight: bold; height: 20px; text-decoration: none;'>")
strBody.AppendFormat(" <th scope='col' style='width: 10%'>Fecha</th>")
strBody.AppendFormat(" <th scope='col' style='width: 20%'>Factura</th>")
strBody.AppendFormat(" <th scope='col' style='width: 20%'>Importe ($)</th>")
strBody.AppendFormat(" <th scope='col' style='width: 40%'>Folio Fiscal</th>")
strBody.AppendFormat(" <th scope='col' style='width: 15%'>NC Aplicadas</th>")
strBody.AppendFormat(" </tr>")
For Each dr As DataRow In objIE.DtResultados.FiltraParametros("CveConceptoContable IN (17) AND CveCompra > 0").Rows
strBody.AppendFormat(" <tr class='Texto'>")
strBody.AppendFormat(" <td>{0}</td>", dr("Fecha").ToString.ToDate.ToShortDateString())
strBody.AppendFormat(" <td>{0}</td>", dr("SerieFolio").ToString)
strBody.AppendFormat(" <td style='text-align: right'>$ {0}</td>", dr("Importe").ToString.FormatoNumero)
strBody.AppendFormat(" <td>{0}</td>", dr("FolioFiscal"))
strBody.AppendFormat(" <td>{0}</td>", dr("ImporteNC").ToString.FormatoNumero)
strBody.AppendFormat(" </tr>")
Next
strBody.AppendFormat(" <tr class='Texto'>")
strBody.AppendFormat(" <td colspan='5'>")
strBody.AppendFormat(" <hr />")
strBody.AppendFormat(" </td>")
strBody.AppendFormat(" </tr>")
strBody.AppendFormat(" </table>")
strBody.AppendFormat(" </fieldset>")
strBody.AppendFormat(" </td>")
strBody.AppendFormat(" </tr>")
strBody.AppendFormat(" </table>")
strBody.AppendFormat("</div>")
End If
strBody.Append(" <div> Favor de no responder a este correo. </div> ")
strBody.Append("</body></html>")
End If
objIE.Dispose()
Return strBody.ToString
End Function
End Class End Class

View File

@@ -945,6 +945,24 @@ Partial Class Bancos_PopIECompras
Alert("El Beneficiario no tiene una cuenta activa en BBVA, dela de alta o seleccione otro método de pago", TipoMensaje.MsgAdvertencia) Alert("El Beneficiario no tiene una cuenta activa en BBVA, dela de alta o seleccione otro método de pago", TipoMensaje.MsgAdvertencia)
End If End If
ElseIf DdlTipoTransaccion.SelectedValue = "17" Then
If Dep.DtResultados.Rows.Count > 0 Then
DdlCuentaDeposito.DataSource = Dep.DtResultados
trCuentaDeposito.Visible = True
BtnGuardar.ToolTip = ""
Else
BtnGuardar.Enabled = False
BtnGuardar.ToolTip = "El proveedor no tiene cuentas deposito"
End If
UpGuardar.Update()
Else Else
DdlCuentaDeposito.DataSource = Dep.DtResultados.FiltraParametros("Estatus ='True'") DdlCuentaDeposito.DataSource = Dep.DtResultados.FiltraParametros("Estatus ='True'")
If Dep.DtResultados.Rows.Count > 0 Then If Dep.DtResultados.Rows.Count > 0 Then
@@ -952,6 +970,19 @@ Partial Class Bancos_PopIECompras
DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1"))
End If End If
End If End If
Else
If DdlTipoTransaccion.SelectedValue.Contiene("9", "17") Then
BtnGuardar.Enabled = False
BtnGuardar.ToolTip = "El proveedor no tiene cuentas deposito"
Else
trCuentaDeposito.Visible = True
BtnGuardar.Enabled = True
BtnGuardar.ToolTip = ""
End If
UpGuardar.Update()
End If End If
Dep.Dispose() Dep.Dispose()

View File

@@ -2518,22 +2518,23 @@ Partial Class Bancos_ProveedoresAbonar
Alert("El Beneficiario no tiene una cuenta activa en BBVA, dela de alta o seleccione otro método de pago", TipoMensaje.MsgAdvertencia) Alert("El Beneficiario no tiene una cuenta activa en BBVA, dela de alta o seleccione otro método de pago", TipoMensaje.MsgAdvertencia)
End If End If
'ElseIf DdlTipoTransaccion.SelectedValue = "17" Then ElseIf DdlTipoTransaccion.SelectedValue = "17" Then
' If Dep.DtResultados.Rows.Count > 0 Then If Dep.DtResultados.Rows.Count > 0 Then
' DdlCuentaDeposito.DataSource = Dep.DtResultados DdlCuentaDeposito.DataSource = Dep.DtResultados
' trCuentaDeposito.Visible = True trCuentaDeposito.Visible = True
' BtnIEGuardar.ToolTip = "" BtnIEGuardar.ToolTip = ""
' Else Else
' BtnIEGuardar.Enabled = False BtnIEGuardar.Enabled = False
' BtnIEGuardar.ToolTip = "El proveedor no tiene cuentas deposito" BtnIEGuardar.ToolTip = "El proveedor no tiene cuentas deposito"
Alert("El proveedor no tiene cuentas deposito.", TipoMensaje.MsgAdvertencia)
' End If End If
' UpGuardar.Update() UpGuardar.Update()
Else Else
DdlCuentaDeposito.DataSource = Dep.DtResultados.FiltraParametros("Estatus ='True'") DdlCuentaDeposito.DataSource = Dep.DtResultados.FiltraParametros("Estatus ='True'")
If Dep.DtResultados.Rows.Count > 0 Then If Dep.DtResultados.Rows.Count > 0 Then
@@ -2550,23 +2551,43 @@ Partial Class Bancos_ProveedoresAbonar
End If End If
'Else Else
' If DdlTipoTransaccion.SelectedValue = "17" Then If DdlTipoTransaccion.SelectedValue.Contiene("9", "17") Then
' BtnIEGuardar.Enabled = False BtnIEGuardar.Enabled = False
' BtnIEGuardar.ToolTip = "El proveedor no tiene cuentas deposito" BtnIEGuardar.ToolTip = "El proveedor no tiene cuentas deposito"
' Else Alert("El proveedor no tiene cuentas deposito.", TipoMensaje.MsgAdvertencia)
' BtnIEGuardar.Enabled = True Else
' BtnIEGuardar.ToolTip = "" trCuentaDeposito.Visible = True
' End If BtnIEGuardar.Enabled = True
BtnIEGuardar.ToolTip = ""
End If
' UpGuardar.Update() UpGuardar.Update()
End If End If
Else
If DdlTipoTransaccion.SelectedValue = "17" Then
BtnIEGuardar.Enabled = False
BtnIEGuardar.ToolTip = "El proveedor no tiene cuentas deposito"
Else
trCuentaDeposito.Visible = True
BtnIEGuardar.Enabled = True
BtnIEGuardar.ToolTip = ""
End If
UpGuardar.Update()
End If End If
Dep.Dispose() Dep.Dispose()
'Else 'Else
' trCuentaDeposito.Visible = False ' trCuentaDeposito.Visible = False

File diff suppressed because it is too large Load Diff

View File

@@ -400,6 +400,8 @@ public partial class General_PopUpPaqueteriasGuias : ClsPaginas
else else
{ {
ObjGeneral.Commit(); ObjGeneral.Commit();
string notificacionCorreos = getCorreoString();
MandaCorreoNotificacionGuia(notificacionCorreos);
if (Guia == "-1") if (Guia == "-1")
{ {
if (CveVenta > 0 || CveOC > 0 || CveMovimiento > 0 || CveCompra > 0) if (CveVenta > 0 || CveOC > 0 || CveMovimiento > 0 || CveCompra > 0)
@@ -718,7 +720,6 @@ public partial class General_PopUpPaqueteriasGuias : ClsPaginas
} }
Destinatario = $"{DbRowVenta["Mail"].ToString()};{DbRowVenta["CorreoVendedorVenta"].ToString()}{CorreoAsistente}"; Destinatario = $"{DbRowVenta["Mail"].ToString()};{DbRowVenta["CorreoVendedorVenta"].ToString()}{CorreoAsistente}";
if (ObjVentas.GetVentaDetalle(CveVenta)) if (ObjVentas.GetVentaDetalle(CveVenta))
{ {
DTMovimientos = ObjVentas.DtResultados; DTMovimientos = ObjVentas.DtResultados;
@@ -727,6 +728,32 @@ public partial class General_PopUpPaqueteriasGuias : ClsPaginas
} }
} }
} }
private string getCorreoString()
{
ClsVentas ObjVentas = new ClsVentas();
if (ObjVentas.GetVenta(CveVenta,UsuarioActual.CveEmpresa))
{
int CveVendedor = ObjVentas.DtResultados.Rows[0]["CveVendedor"].ToEntero();
int CveCliente = ObjVentas.DtResultados.Rows[0]["CveCliente"].ToEntero();
DataRow Vendedor = get_GlobalDTVendedores(UsuarioActual.CveEmpresa).FiltroPrimero(string.Format("CveVendedor = {0}",CveVendedor));
DataRow Cliente = get_GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimero(string.Format("CveCliente = {0}",CveCliente));
string CorreosConcat = "{0};{1};{2};{3};{4}";
return CorreosConcat;
}
ObjVentas.Dispose();
return "";
}
private void MandaCorreoNotificacionGuia(string Correos)
{
Correos.GuardaLog();
ClsSisMail MailCls = new ClsSisMail();
MailCls.SendMail(ClsPaginas.EmpresaNotificaciones, Correos, "Se enviara la compra a su dirección", "Pendiente", Correos);
MailCls = null;
}
#endregion #endregion
} }

View File

@@ -170,7 +170,12 @@
<label class="col-md-1" style="width: 90px; margin-top: 5px;">Usuario:</label> <label class="col-md-1" style="width: 90px; margin-top: 5px;">Usuario:</label>
<div class="col-md-2"> <div class="col-md-2">
<asp:DropDownList ID="DdlUsuarios" DataTextField="Nombre" DataValueField="CveUsuario" runat="server" Width="100%" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-small input-sm select2me"/> <asp:DropDownList ID="DdlUsuarios" DataTextField="Nombre" DataValueField="CveUsuario" runat="server" Width="100%" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-small input-sm select2me" />
</div>
<div runat="server" id="DivEstatusEntrega" visible="false">
<div class="col-md-2">
<label>Entregas Directas</label>&nbsp;&nbsp;&nbsp;<asp:CheckBox ID="ChkLote" data-size="small" runat="server"/>
</div>
</div> </div>
</div> </div>
</div> </div>
@@ -185,13 +190,13 @@
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" /> <input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVDatos.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('TxtBusqueda','{0}')", GVDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div> </div>
<asp:GridView ID="GVDatos" runat="server" DataKeyNames="CvePaqueteriaGuia, CveSubProyecto, SubProyecto, CveAgrupador, TipoAgrupador, Folio, CvePaqueteria, Paqueteria, Liga, CveEstatus, Estatus, Rastreo, Guia, NumCajas, Peso, Dimensiones, Fecha, FechaEstimada, CveUsuario, CveEmpresa, FechaIng, Observaciones, ImplicaCosto, CvePaqueteriaGuiaTipo" <asp:GridView ID="GVDatos" runat="server" DataKeyNames="CvePaqueteriaGuia, CveSubProyecto, SubProyecto, CveAgrupador, TipoAgrupador, Folio, CvePaqueteria, Paqueteria, Liga, CveEstatus, Estatus, Rastreo, Guia, NumCajas, Peso, Dimensiones, Fecha, FechaEstimada, CveUsuario, CveEmpresa, FechaIng, Observaciones, ImplicaCosto, CvePaqueteriaGuiaTipo,EsEntregaInterna"
AutoGenerateColumns="False" EmptyDataText="No se encontraron Registros con los filtros especificados" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn ScrollAD" data-sort="true" GridLines="None" AutoGenerateColumns="False" EmptyDataText="No se encontraron Registros con los filtros especificados" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn ScrollAD" data-sort="true" GridLines="None"
EmptyDataRowStyle-HorizontalAlign="Center" OnRowDataBound="GVDatos_RowDataBound"> EmptyDataRowStyle-HorizontalAlign="Center" OnRowDataBound="GVDatos_RowDataBound">
<Columns> <Columns>
<asp:BoundField DataField="SubProyecto" HeaderText="Sucursal" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField DataField="SubProyecto" HeaderText="Sucursal" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="PaqueteriaGuiaTipo" HeaderText="Guía Tipo" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField DataField="PaqueteriaGuiaTipo" HeaderText="Guía Tipo" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Left" />
<asp:TemplateField HeaderText="Folio" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="7%"> <asp:TemplateField HeaderText="Folio" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="4%">
<ItemTemplate> <ItemTemplate>
<asp:HyperLink runat="server" ID="HLFolio" Text='<%# Eval("Folio")%>' ToolTip='<%# "Ir a " + Eval("TipoAgrupador")%>' Target="_blank" /> <asp:HyperLink runat="server" ID="HLFolio" Text='<%# Eval("Folio")%>' ToolTip='<%# "Ir a " + Eval("TipoAgrupador")%>' Target="_blank" />
</ItemTemplate> </ItemTemplate>
@@ -207,11 +212,12 @@
<asp:BoundField DataField="FechaEstimada" HeaderText="Fecha Est." ItemStyle-Width="4%" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-HorizontalAlign="Center" /> <asp:BoundField DataField="FechaEstimada" HeaderText="Fecha Est." ItemStyle-Width="4%" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="FechaIng" HeaderText="Fecha Ing" ItemStyle-Width="4%" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-HorizontalAlign="Center" /> <asp:BoundField DataField="FechaIng" HeaderText="Fecha Ing" ItemStyle-Width="4%" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-HorizontalAlign="Center" />
<asp:TemplateField ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center" HeaderText="Editar/Liga/Subir"> <asp:TemplateField ItemStyle-Width="13%" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" HeaderText="Editar/Liga/Subir/Reasignar">
<ItemTemplate> <ItemTemplate>
<asp:LinkButton ID="imgEditar" runat="server" OnClick="imgEditar_Click" AlternateText="Editar" ToolTip="Actualizar" CommandArgument='<%# Eval("CvePaqueteriaGuia")%>' CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" /> <asp:LinkButton ID="imgEditar" runat="server" OnClick="imgEditar_Click" AlternateText="Editar" ToolTip="Actualizar" CommandArgument='<%# Eval("CvePaqueteriaGuia")%>' CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
<asp:HyperLink ID="BtnLiga" runat="server" CssClass="btn btn-circle btn-sm blue" Text="<i class='fa fa-external-link' aria-hidden='true'></i>" ToolTip="Ir a Paquetería" Target="_blank"></asp:HyperLink> <asp:HyperLink ID="BtnLiga" runat="server" CssClass="btn btn-circle btn-sm blue" Text="<i class='fa fa-external-link' aria-hidden='true'></i>" ToolTip="Ir a Paquetería" Target="_blank"></asp:HyperLink>
<asp:LinkButton ID="SubirArchivo" runat="server" OnClick="SubirArchivo_Click" Visible="true" AlternateText="Subir" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i title='Subir Documento' class='fa fa-upload' title='Subir Documento' ></i>" /> <asp:LinkButton ID="SubirArchivo" runat="server" OnClick="SubirArchivo_Click" Visible="true" AlternateText="Subir" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i title='Subir Documento' class='fa fa-upload' title='Subir Documento' ></i>" />
<asp:LinkButton ID="LnkReasignar" runat="server" OnClick="Reasignar_Click" Visible="true" AlternateText="Reasignar" CausesValidation="False" CssClass="btn btn-circle btn-sm blue" Text="<i title='Reasignar' class='fa fa-user' title='Reasignar' ></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si"/>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>

View File

@@ -229,6 +229,11 @@ public partial class General_RepPaqueteriasGuias : ClsPaginas
DdlEstatusEditar.Items.Insert(3, new ListItem("Entregado ", "3")); DdlEstatusEditar.Items.Insert(3, new ListItem("Entregado ", "3"));
DdlEstatusEditar.Items.Insert(4, new ListItem("Confirmado por Cliente", "4")); DdlEstatusEditar.Items.Insert(4, new ListItem("Confirmado por Cliente", "4"));
DdlEstatusEditar.SelectedValue = "-1"; DdlEstatusEditar.SelectedValue = "-1";
if(UsuarioActual.Empresa.Funcionalidad(280) == "1"){
DivEstatusEntrega.Visible = true;
}
} }
private void CargaUsuarios() private void CargaUsuarios()
@@ -270,7 +275,8 @@ public partial class General_RepPaqueteriasGuias : ClsPaginas
String FechaIngInicio = TxtFechaInicialIngreso.Text == "" ? "-1" : TxtFechaInicialIngreso.Text; String FechaIngInicio = TxtFechaInicialIngreso.Text == "" ? "-1" : TxtFechaInicialIngreso.Text;
String FechaIngFin = TxtFechaFinalIngreso.Text == "" ? "-1" : TxtFechaFinalIngreso.Text; String FechaIngFin = TxtFechaFinalIngreso.Text == "" ? "-1" : TxtFechaFinalIngreso.Text;
if (ObjGeneral.GetPaqueteriasGuias(CvePaqueteriaGuia, CvePaqueteriaGuiaTipo, CvePaqueteria, CveEstatus, CveSubProyecto, CveEmpresa, Guia, FechaInicio, FechaFin, FechaIngInicio, FechaIngFin, Filtro: Filtro, CveUsuarioEntrega: CveUsuarioEntrega)) if (ObjGeneral.GetPaqueteriasGuias(CvePaqueteriaGuia, CvePaqueteriaGuiaTipo, CvePaqueteria, CveEstatus, CveSubProyecto, CveEmpresa, Guia, FechaInicio, FechaFin,
FechaIngInicio, FechaIngFin, Filtro: Filtro, CveUsuarioEntrega: CveUsuarioEntrega, EsEntregaInterna: ChkLote.Checked))
{ {
DTDatos = ObjGeneral.DtResultados; DTDatos = ObjGeneral.DtResultados;
GVDatos.DataSource = DTDatos; GVDatos.DataSource = DTDatos;
@@ -532,7 +538,7 @@ public partial class General_RepPaqueteriasGuias : ClsPaginas
{ {
e.Row.FCLinkButton("SubirArchivo").Visible = false; e.Row.FCLinkButton("SubirArchivo").Visible = false;
} }
e.Row.FCLinkButton("LnkReasignar").Visible = e.Row.DataKey("EsEntregaInterna").ToString() == "True";
} }
} }
@@ -924,6 +930,7 @@ public partial class General_RepPaqueteriasGuias : ClsPaginas
DataRow DbRowVenta = ObjVentas.DtResultados.Rows[0]; DataRow DbRowVenta = ObjVentas.DtResultados.Rows[0];
int CveCliente = DbRowVenta["CveCliente"].ToString().ToEntero(); int CveCliente = DbRowVenta["CveCliente"].ToString().ToEntero();
int CveVendedor = DbRowVenta["CveVendedor"].ToString().ToEntero();
SerieFolio = String.Format("{0}-{1}", DbRowVenta["Serie"].ToString(), DbRowVenta["Folio"].ToString().ToEntero()); SerieFolio = String.Format("{0}-{1}", DbRowVenta["Serie"].ToString(), DbRowVenta["Folio"].ToString().ToEntero());
NombreCliente = DbRowVenta["ClienteNombre"].ToString(); NombreCliente = DbRowVenta["ClienteNombre"].ToString();
@@ -941,6 +948,10 @@ public partial class General_RepPaqueteriasGuias : ClsPaginas
} }
// Destinatario = "sig.buzon02@gmail.com"; // CORREO PRUEBA // Destinatario = "sig.buzon02@gmail.com"; // CORREO PRUEBA
//if (UsuarioActual.Empresa.Funcionalidad(280) == "1" && CveCliente > 0 && CveVendedor > 0)
//{
// Destinatario = getCorreoNotificacion(CveCliente,CveVendedor);
//}
if (ObjVentas.GetVentaDetalle(CveVenta)) if (ObjVentas.GetVentaDetalle(CveVenta))
{ {
@@ -951,8 +962,37 @@ public partial class General_RepPaqueteriasGuias : ClsPaginas
} }
} }
} }
private string getCorreoNotificacion(int CveCliente, int CveVendedor)
{
DataRow DatosCliente = get_GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimero(string.Format("CveCliente = {0}",CveCliente));
DataRow DatosVendedor = get_GlobalDTVendedores(UsuarioActual.CveEmpresa).FiltroPrimero(string.Format("CveVendedor = {0}", CveVendedor));
if (DatosCliente != null && DatosVendedor != null)
{
StringBuilder correos = new StringBuilder("");
if (DatosCliente["CorreoEntregaCompras"].ToString().Length > 0) correos.Append(string.Format("{0};", DatosCliente["CorreoEntregaCompras"].ToString()));
if (DatosCliente["CorreoEntregaAlmacen"].ToString().Length > 0) correos.Append(string.Format("{0};", DatosCliente["CorreoEntregaAlmacen"].ToString()));
if (DatosVendedor["Correo"].ToString().Length > 0) correos.Append(string.Format("{0};", DatosVendedor["Correo"].ToString()));
if (DatosVendedor["CorreoAdicionalNotificaciones"].ToString().Length > 0) correos.Append(string.Format("{0};", DatosVendedor["CorreoAdicionalNotificaciones"].ToString()));
return correos.ToString();
}
return "";
}
#endregion #endregion
protected void Reasignar_Click(object sender, EventArgs e)
{
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
int CvePaqueteriaGuia = GvRow.DataKey("CvePaqueteriaGuia").ToEntero();
ClsGenerales ObjGeneral = new ClsGenerales();
if (ObjGeneral.AsignarEntregasPorRealizar(CvePaqueteriaGuia, -1))
{
Alert("La guía está lista para volver a ser asignada, disponible en el reporte <a style='color:#23527c' href='/Inventarios/EntregasPorRealizar.aspx'>Entregas Por Realizar</a>");
}
ObjGeneral.Dispose();
CargaDatos();
UPDatos.Update();
}
} }

View File

@@ -714,6 +714,8 @@ Partial Class General_SaldosIniciales
Dim CveSATPS As Integer = GlobalDTPSATPS.FiltroPrimeroValor("CveSATPS", $"SATClavePS = '{SATClavePS}'").ToString.ToEntero Dim CveSATPS As Integer = GlobalDTPSATPS.FiltroPrimeroValor("CveSATPS", $"SATClavePS = '{SATClavePS}'").ToString.ToEntero
Dim CveTamaño As Integer = GlobalDTAcumTamaños.FiltroPrimeroValor("CveTamaño", $"Tamaño = '{Tamaño}' AND CveEmpresa = {UsuarioActual.CveEmpresa}").ToString.ToEntero Dim CveTamaño As Integer = GlobalDTAcumTamaños.FiltroPrimeroValor("CveTamaño", $"Tamaño = '{Tamaño}' AND CveEmpresa = {UsuarioActual.CveEmpresa}").ToString.ToEntero
Dim CveClasificacion2 As Integer = GlobalDTClasificaciones2(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveClasificacion", $"Clasificacion = '{Clasificacion2}'").ToString.ToEntero Dim CveClasificacion2 As Integer = GlobalDTClasificaciones2(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveClasificacion", $"Clasificacion = '{Clasificacion2}'").ToString.ToEntero
Dim CveClasificacionDetalle As Integer = GlobalDTClasificacionesDetalle(UsuarioActual.CveEmpresa, -1).FiltroPrimeroValor("CveClasificacionDetalle", $"ClasificacionDetalle = '{Linea}'").ToString.ToEntero
If Not CveClasificacion > 0 AndAlso Clasificacion <> "" Then If Not CveClasificacion > 0 AndAlso Clasificacion <> "" Then
If ObjClas.AddClasificaciones(Clasificacion, "", -1, "-1", -1, "-1", -1, "-1", If ObjClas.AddClasificaciones(Clasificacion, "", -1, "-1", -1, "-1", -1, "-1",
@@ -851,16 +853,16 @@ Partial Class General_SaldosIniciales
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, 0, 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) <= 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,
' CveTipoPS:=CveTipoPS, CveSATPS:=CveSATPS, CveMarca:=CveMarca, CveTamaño:=CveTamaño, CveMedida:=CveMedida) <= 0 Then ' CveTipoPS:=CveTipoPS, CveSATPS:=CveSATPS, CveMarca:=CveMarca, CveTamaño:=CveTamaño, CveMedida:=CveMedida) <= 0 Then
ErrorPS = True ErrorPS = True
Codigo.GuardaLog Codigo.GuardaLog
Exit For Exit For
Else 'Else
If ObjPS.GetPS(-1, -1, UsuarioActual.CveEmpresa) Then ' If ObjPS.GetPS(-1, -1, UsuarioActual.CveEmpresa) Then
DTPS = ObjPS.DtResultados ' DTPS = ObjPS.DtResultados
End If ' End If
End If End If
End If End If

View File

@@ -244,10 +244,11 @@
<td colspan="2"> <td colspan="2">
<asp:Panel ID="PnlEntrega" runat="server" Visible="false"> <asp:Panel ID="PnlEntrega" runat="server" Visible="false">
<asp:RadioButton id="RbSinEntrega" runat="server" OnCheckedChanged="EntregaRadioGroup_Click" Width="25%" GroupName="EntregaRadioGroup" Text="Sin Entrega" AutoPostBack="true"></asp:RadioButton> <asp:RadioButton id="RbSinEntrega" runat="server" OnCheckedChanged="EntregaRadioGroup_Click" Width="33%" GroupName="EntregaRadioGroup" Text="Entrega en mostrador" AutoPostBack="true"></asp:RadioButton>
<asp:RadioButton id="RbEntregaInterna" runat="server" OnCheckedChanged="EntregaRadioGroup_Click" Width="25%" GroupName="EntregaRadioGroup" Text="Entrega Interna" AutoPostBack="true"></asp:RadioButton> <asp:RadioButton id="RbEntregaInterna" runat="server" OnCheckedChanged="EntregaRadioGroup_Click" Width="30%" GroupName="EntregaRadioGroup" Text="Entrega Interna" AutoPostBack="true"></asp:RadioButton>
<asp:RadioButton id="RbEntregaExterna" runat="server" OnCheckedChanged="EntregaRadioGroup_Click" Width="25%" GroupName="EntregaRadioGroup" Text="Entrega Externa" AutoPostBack="true"></asp:RadioButton> <asp:RadioButton id="RbEntregaExterna" runat="server" OnCheckedChanged="EntregaRadioGroup_Click" Width="30%" GroupName="EntregaRadioGroup" Text="Entrega Externa" AutoPostBack="true"></asp:RadioButton>
</asp:Panel> </asp:Panel>
<asp:LinkButton ID="LnkPaqueteriaDetalle" runat="server" OnClick="PaqueteriaDetalle_Click" Visible="false">ver detalle de entrega</asp:LinkButton>
</td> </td>
</tr> </tr>
@@ -452,7 +453,7 @@
<asp:BoundField HeaderText="Cant. Surtida" DataField="CantidadS" DataFormatString="{0:#,##0.######}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="7.5%" /> <asp:BoundField HeaderText="Cant. Surtida" DataField="CantidadS" DataFormatString="{0:#,##0.######}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="7.5%" />
<asp:TemplateField HeaderText="Cant. a Surtir" ItemStyle-Width="10%"> <asp:TemplateField HeaderText="Cant. a Surtir" ItemStyle-Width="10%">
<ItemTemplate> <ItemTemplate>
<asp:TextBox ID="TbCantidadF" runat="server" Width="60px" Mask="9,999.99" Text='<%# Eval("CantidadF") %>'></asp:TextBox> <asp:TextBox ID="TbCantidadF" runat="server" Width="60px" Mask="9,999.99" DataFormatString="{0:#,##0.######}" style="text-align: right" Text='<%# Eval("CantidadF") %>'></asp:TextBox>
<asp:Button Text="Serie" ID="BtnSerie" OnClick="BtnSerie_Click" CssClass="btn btn-primary btn-xs" runat="server" /> <asp:Button Text="Serie" ID="BtnSerie" OnClick="BtnSerie_Click" CssClass="btn btn-primary btn-xs" runat="server" />
</ItemTemplate> </ItemTemplate>
<HeaderStyle CssClass="Titulos" /> <HeaderStyle CssClass="Titulos" />

View File

@@ -244,6 +244,14 @@ Partial Class Inventarios_EntregaAlmacen
ViewState("EsDevolucionDirecta") = value ViewState("EsDevolucionDirecta") = value
End Set End Set
End Property End Property
Private Property FormaPaqueteria As Integer
Get
Return CType(ViewState("FormaPaqueteria"), Integer)
End Get
Set(value As Integer)
ViewState("FormaPaqueteria") = value
End Set
End Property
#End Region #End Region
@@ -614,7 +622,21 @@ Partial Class Inventarios_EntregaAlmacen
DtDatos.Columns.Add("CantidadSeleccionada", GetType(Double)) DtDatos.Columns.Add("CantidadSeleccionada", GetType(Double))
End If End If
If UsuarioActual.Empresa.Funcionalidad(280) = "1" Then
FormaPaqueteria = DtDatos.Rows(0)("FormaPaqueteria").ToString.ToEntero
Dim FormaPaq As Integer = FormaPaqueteria
Select Case FormaPaq
Case 1
RbSinEntrega.Checked = True
Case 2
RbEntregaInterna.Checked = True
LnkPaqueteriaDetalle.Visible = True
DdlEstatus.SelectedValue = "5"
Case 3
RbEntregaExterna.Checked = True
LnkPaqueteriaDetalle.Visible = True
End Select
End If
'TxtFecha.Text = If(EsDevolucionVenta = 1, Now.ToShortDateString, DtDatos.Rows(0)("Fecha").ToString) 'TxtFecha.Text = If(EsDevolucionVenta = 1, Now.ToShortDateString, DtDatos.Rows(0)("Fecha").ToString)
End If End If
@@ -2261,13 +2283,15 @@ Partial Class Inventarios_EntregaAlmacen
ElseIf TipoMovimiento = 2 Then ElseIf TipoMovimiento = 2 Then
CantidadPendientePorSalir = CantidadPendientePorSalir - CantidadEntradaSinCosto CantidadPendientePorSalir = CantidadPendientePorSalir - CantidadEntradaSinCosto
End If End If
'si el alamcen del que salio, es el mismo que entra, no hay traspasos.
If CveAlmacenTraspasoDestino = DdlAlmacen.SelectedValue.ToEntero Then CveAlmacenTraspasoDestino = 0
If Not ErrorMovInv AndAlso CantidadPendientePorSalir > 0 Then If Not ErrorMovInv AndAlso CantidadPendientePorSalir > 0 Then
Dim ConceptoMovimiento = 3 Dim ConceptoMovimiento = 3
ConceptoMovimiento = If(TipoMovimiento = 1, ConceptoMovimiento, 18) ConceptoMovimiento = If(TipoMovimiento = 1, ConceptoMovimiento, 18)
ConceptoMovimiento = If(CveAlmacenTraspasoDestino > 0, 8, ConceptoMovimiento) ConceptoMovimiento = If(CveAlmacenTraspasoDestino > 0, 8, ConceptoMovimiento)
Dim Almacen1 = DdlAlmacen.SelectedValue.ToEntero Dim Almacen1 As Integer = DdlAlmacen.SelectedValue.ToEntero
If TipoDocto = "Rem" AndAlso CveAlmacenTraspasoDestino = 0 Then If TipoDocto = "Rem" AndAlso CveAlmacenTraspasoDestino = 0 Then
ErrorMovInv = True ErrorMovInv = True
@@ -3631,6 +3655,13 @@ Partial Class Inventarios_EntregaAlmacen
TxtObservacionesPaqInterna.Text = "" TxtObservacionesPaqInterna.Text = ""
UpPaqInterna.Update() UpPaqInterna.Update()
End Sub End Sub
Protected Sub PaqueteriaDetalle_Click(sender As Object, e As EventArgs)
If RbEntregaExterna.Checked Then
RegistraScript("AbrirVentana('/General/PopUpPaqueteriasGuias.aspx',800,547,'N')")
ElseIf RbEntregaInterna.Checked Then
RegistraScript("$('#ModalPaqueteriaInterna').modal('show')")
End If
End Sub
#End Region #End Region

View File

@@ -70,7 +70,7 @@
</div> </div>
<div class="portlet-body rowpadding"> <div class="portlet-body rowpadding">
<asp:GridView ID="GvPaqueteriasGuias" runat="server" AutoGenerateColumns="False" <asp:GridView ID="GvPaqueteriasGuias" runat="server" AutoGenerateColumns="False"
DataKeyNames="CvePaqueteriaGuia,Folio,FechaIng,Nombre,Contacto,Estatus" DataKeyNames="CvePaqueteriaGuia,Folio,FechaIng,Nombre,Contacto,Estatus,CobranzaCorreo,CorreoEntregaAlmacen,CorreoEntregaCompras,Correo,CorreoAdicionalNotificaciones"
EmptyDataText="No se encontraron registros" ToolTip="Listado de Temas" EmptyDataText="No se encontraron registros" ToolTip="Listado de Temas"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" CssClass="table table-striped table-advance table-hover Widthall ScrollAD"
data-sort="true" data-sort="true"

View File

@@ -40,15 +40,30 @@ public partial class Inventarios_EntregasPorRealizar : ClsPaginas
ObjGeneral.IniciaTransacSQL(); ObjGeneral.IniciaTransacSQL();
GridViewRowCollection Grid = GvPaqueteriasGuias.Rows; GridViewRowCollection Grid = GvPaqueteriasGuias.Rows;
int CvePersonal = DdlUsuario.SelectedValue.ToEntero();
foreach (GridViewRow row in Grid) foreach (GridViewRow row in Grid)
{ {
if (row.FCCheckBox("ChkAsigna").Checked) if (row.FCCheckBox("ChkAsigna").Checked)
{ {
int CvePaqueteriasGuias = row.DataKey("CvePaqueteriaGuia").ToEntero(); int CvePaqueteriasGuias = row.DataKey("CvePaqueteriaGuia").ToEntero();
int CvePersonal = DdlUsuario.SelectedValue.ToEntero();
if(!ObjGeneral.AsignarEntregasPorRealizar(CvePaqueteriasGuias, CvePersonal)){ if(!ObjGeneral.AsignarEntregasPorRealizar(CvePaqueteriasGuias, CvePersonal)){
TieneError = true; TieneError = true;
}else
{
string CobranzaCorreo = row.DataKey("CobranzaCorreo");
string CorreoEntregaAlmacen = row.DataKey("CorreoEntregaAlmacen");
string CorreoEntregaCompras = row.DataKey("CorreoEntregaCompras");
string CorreoVendedor = row.DataKey("Correo");
string CorreoAdicionalNotificacionesVendedor = row.DataKey("CorreoAdicionalNotificaciones");
string CorreosCC = string.Format("{0};{1};{2};{3}", CorreoVendedor, CorreoAdicionalNotificacionesVendedor, CobranzaCorreo, CorreoEntregaCompras);
string LogCorreo = string.Format("{0} -- {1} --- {2}", "Tipo de entrega", CorreoEntregaAlmacen, CorreosCC);
LogCorreo.GuardaLog();
ClsSisMail MailCls = new ClsSisMail();
MailCls.SendMail(ClsPaginas.EmpresaNotificaciones, CorreoVendedor, "Se enviara la compra a su dirección", "Pendiente", CorreosCC);
MailCls = null;
} }
} }
} }

View File

@@ -145,7 +145,7 @@
<label class="col-md-1 truncate">Clasificación:</label> <label class="col-md-1 truncate">Clasificación:</label>
<div class="col-md-2"> <div class="col-md-2">
<asp:DropDownList ID="DdlClasificacion" CssClass="select2me" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Clasificacion" DataValueField="CveClasificacion" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 150px !important;"> <asp:DropDownList ID="DdlClasificacion" CssClass="select2me" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Clasificacion" DataValueField="CveClasificacion" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 150px !important;">
<asp:ListItem Selected="True" Text="Seleccione la Clasificación (Todas)" Value="-1"></asp:ListItem> <asp:ListItem Selected="True" Text=" Todas" Value="-1"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
</div> </div>
<label class="col-md-1 truncate">Unidad Medida:</label> <label class="col-md-1 truncate">Unidad Medida:</label>
@@ -161,7 +161,7 @@
<label class="col-md-1 truncate">Tipo Almacen:</label> <label class="col-md-1 truncate">Tipo Almacen:</label>
<div class="col-md-1"> <div class="col-md-1">
<asp:DropDownList ID="DdlTipoAlmacen" CssClass="select2me" runat="server" AppendDataBoundItems="true" DataTextField="TipoAlmacen" DataValueField="CveTipoAlmacen" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100px !important;"> <asp:DropDownList ID="DdlTipoAlmacen" CssClass="select2me" runat="server" AppendDataBoundItems="true" DataTextField="TipoAlmacen" DataValueField="CveTipoAlmacen" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100px !important;">
<asp:ListItem Selected="True" Text="Seleccione el tipo de Almacen (Todos)" Value="-1"></asp:ListItem> <asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
</div> </div>
<label class="col-md-1 truncate">Tránsito?:</label> <label class="col-md-1 truncate">Tránsito?:</label>

View File

@@ -121,7 +121,7 @@
<asp:BoundField DataField="Existencia" ItemStyle-HorizontalAlign="Right" HeaderText="Existencia" DataFormatString="{0:#,###.######}" /> <asp:BoundField DataField="Existencia" ItemStyle-HorizontalAlign="Right" HeaderText="Existencia" DataFormatString="{0:#,###.######}" />
<asp:BoundField DataField="PendientePorSurtir" ItemStyle-HorizontalAlign="Right" HeaderText="Pendiente Por Surtir" DataFormatString="{0:#,###.######}" /> <asp:BoundField DataField="PendientePorSurtir" ItemStyle-HorizontalAlign="Right" HeaderText="Pendiente Por Surtir" DataFormatString="{0:#,###.######}" />
<asp:BoundField DataField="ExistenciaFinal" ItemStyle-HorizontalAlign="Right" HeaderText="Existencia Real" DataFormatString="{0:#,###.######}" /> <asp:BoundField DataField="ExistenciaFinal" ItemStyle-HorizontalAlign="Right" HeaderText="Existencia Real" DataFormatString="{0:#,###.######}" />
<asp:BoundField DataField="Importe" ItemStyle-HorizontalAlign="Right" HeaderText="Precio" DataFormatString="{0:N2}"/> <asp:BoundField DataField="Importe" ItemStyle-HorizontalAlign="Right" HeaderText="Precio Neto" DataFormatString="{0:N2}"/>
<asp:BoundField DataField="CantidadDisponibleInv" ItemStyle-HorizontalAlign="Right" HeaderText="Pendiente Por Recibir" DataFormatString="{0:#,###.######}" Visible="false"/> <asp:BoundField DataField="CantidadDisponibleInv" ItemStyle-HorizontalAlign="Right" HeaderText="Pendiente Por Recibir" DataFormatString="{0:#,###.######}" Visible="false"/>
</Columns> </Columns>
</asp:GridView> </asp:GridView>

View File

@@ -850,7 +850,7 @@ Partial Class Inventarios_RecepcionAlmacen
TipoCambio = ObjCompras.DtResultados.Rows(0)("TipoCambio").ToString.ToDecimal TipoCambio = ObjCompras.DtResultados.Rows(0)("TipoCambio").ToString.ToDecimal
TipoMovimiento = If(ObjCompras.DtResultados.Rows(0)("EstatusAlmacen").ToString.ToEntero = 1, 2, 1) TipoMovimiento = If(ObjCompras.DtResultados.Rows(0)("EstatusAlmacen").ToString.ToEntero = 1, 2, 1)
TipoMovimiento = If(ObjCompras.DtResultados.Rows(0)("TipoDocto").ToString.Contiene("NC", "DEV"), 3, TipoMovimiento) TipoMovimiento = If(ObjCompras.DtResultados.Rows(0)("TipoDocto").ToString.Contiene("NC", "DEV"), 3, TipoMovimiento)
TotalCompraOC = ObjCompras.DtResultados.Rows(0)("SubTotal").ToString.ToDecimal TotalCompraOC = ObjCompras.DtResultados.Rows(0)("SubTotal").ToString.ToDecimal - ObjCompras.DtResultados.Rows(0)("Descuentos").ToString.ToDecimal
CveTipoCompra = ObjCompras.DtResultados.Rows(0)("CveTipoCompra").ToString.ToEntero CveTipoCompra = ObjCompras.DtResultados.Rows(0)("CveTipoCompra").ToString.ToEntero
If TipoMovimiento = 3 Then If TipoMovimiento = 3 Then
@@ -1259,6 +1259,9 @@ Partial Class Inventarios_RecepcionAlmacen
e.Row.FCTextBox("TbCantidadF").Text = e.Row.DBCampo("CantidadF").FormatoNumero e.Row.FCTextBox("TbCantidadF").Text = e.Row.DBCampo("CantidadF").FormatoNumero
e.Row.FCTextBox("TbCantidadF").Enabled = False e.Row.FCTextBox("TbCantidadF").Enabled = False
End If End If
If UsuarioActual.CveRol = 1 Then 'carga la cantidad con el rol AD
e.Row.FCTextBox("TbCantidadF").Text = e.Row.DBCampo("CantidadF").FormatoNumero
End If
End If End If
If CBool(e.Row.DBCampo("AplicaSeccion")) Then If CBool(e.Row.DBCampo("AplicaSeccion")) Then
@@ -2155,6 +2158,7 @@ Partial Class Inventarios_RecepcionAlmacen
Private Sub GuardaCompraOC() Private Sub GuardaCompraOC()
Dim CveMovimiento As Integer Dim CveMovimiento As Integer
Dim CveMovimientoOriginal As Integer
' Dim CveMovimientoS ' Dim CveMovimientoS
Dim InvFolio As String = "" Dim InvFolio As String = ""
@@ -2203,6 +2207,7 @@ Partial Class Inventarios_RecepcionAlmacen
CveCompraSurtir, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, TipoCambio:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, TipoCambio), CveCompraSurtir, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, TipoCambio:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, TipoCambio),
MovimientoFijo:=If(TipoMovimiento = 2, True, False), Remision:=TxtRemision.Text, Modulo:="RA/G1") MovimientoFijo:=If(TipoMovimiento = 2, True, False), Remision:=TxtRemision.Text, Modulo:="RA/G1")
If CveMovimiento > 0 Then If CveMovimiento > 0 Then
CveMovimientoOriginal = CveMovimiento
InvFolio = ObjInventario.Folio.ToString InvFolio = ObjInventario.Folio.ToString
Dim DtDetalle As New DataTable Dim DtDetalle As New DataTable
Dim DtDetalleLote As New DataTable Dim DtDetalleLote As New DataTable
@@ -2283,7 +2288,7 @@ Partial Class Inventarios_RecepcionAlmacen
''VALIDACIÓN DE IMPORTES INGRESADOS VS LA COMPRA U OC ''VALIDACIÓN DE IMPORTES INGRESADOS VS LA COMPRA U OC
If Not UsuarioActual.Empresa.Funcionalidad(531) = "1" Then If Not UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
If Not ErrorMovInv AndAlso RecibidaCompleta AndAlso ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then If Not ErrorMovInv AndAlso RecibidaCompleta AndAlso ObjInventario.GetMovimientosDetalle(CveMovimientoOriginal, UsuarioActual.CveEmpresa) Then
Dim dtt As DataTable = ObjInventario.DtResultados Dim dtt As DataTable = ObjInventario.DtResultados
Dim tTotalInsertado As Decimal = dtt.SUMD("TotalOriginal") Dim tTotalInsertado As Decimal = dtt.SUMD("TotalOriginal")
If CveTipoCompra = 8 Then 'entrada almacen con costo indirecto cargado en la misma compra If CveTipoCompra = 8 Then 'entrada almacen con costo indirecto cargado en la misma compra
@@ -2297,6 +2302,8 @@ Partial Class Inventarios_RecepcionAlmacen
End If End If
End If End If
Dim ImporteIngresoAdicional As Decimal = 0
'SI RECEPCION VALIDA [ENTREGADIRECTA, APARTADOS, AC] 'SI RECEPCION VALIDA [ENTREGADIRECTA, APARTADOS, AC]
If TipoMovimiento = 1 Then If TipoMovimiento = 1 Then
'ENTREGA DIRECTA 'ENTREGA DIRECTA
@@ -2410,45 +2417,11 @@ Partial Class Inventarios_RecepcionAlmacen
If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
Dim DtPSVirtual As New DataTable("DtTamanios") Dim DtPSVirtual As New DataTable("DtTamanios")
DtPSVirtual.Columns.Add(New DataColumn("CvePS", GetType(Integer)))
DtPSVirtual.Columns.Add(New DataColumn("Cantidad", GetType(Decimal)))
DtPSVirtual.Columns.Add(New DataColumn("PU", GetType(Decimal)))
DtPSVirtual.Columns.Add(New DataColumn("CveUM", GetType(Integer)))
Dim DtComprasDetalle As DataTable = Nothing If ObjInventario.GetMovimientosDetalleVirtual(CveMovimiento, UsuarioActual.CveEmpresa) Then
Dim DtTamanios As DataTable = Nothing DtPSVirtual = ObjInventario.DtResultados
If ObjCompras.GetCompraDetalle(CveCompraSurtir) Then
DtComprasDetalle = ObjCompras.DtResultados.Copy()
End If End If
If ObjAcum.TamañoGet(-1, UsuarioActual.CveEmpresa) Then
DtTamanios = ObjAcum.DtResultados.Copy()
End If
For Each GvRow As GridViewRow In GvInv.Rows
If GvRow.RowType = DataControlRowType.DataRow Then
For Each Tam As DataRow In DtTamanios.Rows
If Tam("CveTamaño").ToString() = GvRow.DataKey("CveTamaño") Then
Dim CvePSCargo = Tam("CvePSCargo").ToString().ToEntero()
Dim RowCompraDetalle = DtComprasDetalle.FiltroPrimero($"CvePS = {CvePSCargo}")
If RowCompraDetalle IsNot Nothing Then
Dim Row As DataRow = DtPSVirtual.NewRow()
Row("CvePS") = CvePSCargo
Row("Cantidad") = GvRow.FCTextBox("TbCantidadF").Text.ToDecimal()
Row("PU") = RowCompraDetalle("PU").ToString().ToDecimal()
Row("CveUM") = GvRow.DataKey("CveUM").ToEntero()
DtPSVirtual.Rows.Add(Row)
End If
End If
Next
End If
Next
If DtPSVirtual IsNot Nothing AndAlso DtPSVirtual.Rows.Count > 0 Then If DtPSVirtual IsNot Nothing AndAlso DtPSVirtual.Rows.Count > 0 Then
Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen= {DdlAlmacen.SelectedValue}").ToEntero() Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen= {DdlAlmacen.SelectedValue}").ToEntero()
@@ -2461,8 +2434,8 @@ Partial Class Inventarios_RecepcionAlmacen
For Each RowUsado As DataRow In DtPSVirtual.Rows For Each RowUsado As DataRow In DtPSVirtual.Rows
Dim CvePS = RowUsado("CvePS").ToString().ToEntero() Dim CvePS = RowUsado("CvePS").ToString().ToEntero()
Dim CantidadUsado As Double = RowUsado("Cantidad").ToString().ToDouble() Dim CantidadUsado As Decimal = RowUsado("Cantidad").ToString().ToDecimal()
Dim PU As Decimal = RowUsado("PU").ToString().ToDecimal() Dim PU As Decimal = RowUsado("Cargo").ToString().ToDecimal()
Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero() Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero()
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtual, CantidadUsado, CveUM, CvePS, PU, -1, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtual, CantidadUsado, CveUM, CvePS, PU, -1, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
@@ -2470,6 +2443,12 @@ Partial Class Inventarios_RecepcionAlmacen
Exit For Exit For
End If End If
Next Next
If ObjInventario.GetMovimientosDetalle(CveMovimientoVirtual, UsuarioActual.CveEmpresa) Then
ImporteIngresoAdicional = ObjInventario.DtResultados.SUMD("TotalOriginal")
End If
Else
ErrorMovInv = True
End If End If
End If End If
@@ -2549,8 +2528,6 @@ Partial Class Inventarios_RecepcionAlmacen
Else Else
'VIRTUAL 'VIRTUAL
If CveTipoCompra = 9 And UsuarioActual.Empresa.Funcionalidad(573) = "1" Then If CveTipoCompra = 9 And UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
@@ -2618,6 +2595,27 @@ Partial Class Inventarios_RecepcionAlmacen
End If End If
''VALIDACIÓN DE IMPORTES INGRESADOS VS LA COMPRA U OC
'If Not UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
If Not ErrorMovInv AndAlso RecibidaCompleta Then
If ObjInventario.GetMovimientosDetalle(CveMovimientoOriginal, UsuarioActual.CveEmpresa) Then
Dim dtt As DataTable = ObjInventario.DtResultados
Dim tTotalInsertado As Decimal = dtt.SUMD("TotalOriginal") + ImporteIngresoAdicional
If CveTipoCompra = 8 Then 'entrada almacen con costo indirecto cargado en la misma compra
tTotalInsertado = dtt.SUMD("Total") ' está incluido el costo indirecto en la factura
End If
If Math.Round(TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1), 2) <> Math.Round(tTotalInsertado, 2) Then
ErrorMovInv = True
Alert("La Entrada no coincide con el valor del documento." & Math.Round(TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1), 2) & " -" & tTotalInsertado.RoundSQL.ToString, TipoMensaje.MsgError)
GuardaLog("La Entrada no coincide con el valor del documento." & Math.Round(TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1), 2) & " -" & tTotalInsertado.RoundSQL.ToString)
End If
Else
ErrorMovInv = True
End If
End If
' End If
'ACTUALIZA ESTATUS ALMACEN 'ACTUALIZA ESTATUS ALMACEN
If TipoMovimiento = 2 Then If TipoMovimiento = 2 Then
If Not ObjCompras.UpdateEstatusAlmacen(CveCompraSurtir, 0) Then If Not ObjCompras.UpdateEstatusAlmacen(CveCompraSurtir, 0) Then
@@ -2631,212 +2629,212 @@ Partial Class Inventarios_RecepcionAlmacen
End If End If
'PREPOLIZA - SOLO CUANDO SEA RECEPCIÓN 'PREPOLIZA - SOLO CUANDO SEA RECEPCIÓN
If TipoMovimiento = 1 AndAlso ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then If TipoMovimiento = 1 AndAlso Not ErrorMovInv Then
Dim DtCostos As DataTable = Nothing If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then
Dim ValorInventario As Decimal = 0
DtCostos = ObjInventario.DtResultados
Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundSQL
Dim TotalCostoExtranjero As Decimal = DtCostos.SUM("TotalExtranjero").ToDecimal
'VARIABLES Dim DtCostos As DataTable = Nothing
Dim IdCtaContableAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {DdlAlmacen.SelectedValue}").ToEntero Dim ValorInventario As Decimal = 0
Dim CveCuentaAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContableSIG", $"CveAlmacen = {DdlAlmacen.SelectedValue}").ToEntero DtCostos = ObjInventario.DtResultados
Dim IdCtaContableRecepcion = -1 Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundSQL
Dim IdCtaContableRecepcionME = -1 Dim TotalCostoExtranjero As Decimal = DtCostos.SUM("TotalExtranjero").ToDecimal
Dim IdCtaContableRecepcionComplementaria = -1
Dim Fecha As Date = Now
Dim CveProveedor As Integer = -1
Dim ProveedorNombre As String = ""
Dim SerieFolio As String = ""
Dim CveConceptoContableCosto = -1
Dim CveConceptoContableCostoME = -1
Dim CveConceptoContableCostoComplementaria = -1
Dim UsaComplementariaFleteImportaciones As Boolean = False
If UsuarioActual.CveEmpresa = 119 Then UsaComplementariaFleteImportaciones = False
If DtCostos.Rows.Count > 0 Then 'VARIABLES
If CveCompraSurtir > 0 Then Dim IdCtaContableAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {DdlAlmacen.SelectedValue}").ToEntero
If ObjCompras.GetCompras(CveCompraSurtir, "-1", "-1", -1, -1, UsuarioActual.CveEmpresa) Then Dim CveCuentaAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContableSIG", $"CveAlmacen = {DdlAlmacen.SelectedValue}").ToEntero
'Fecha = ObjCompras.DtResultados(0)("Fecha").ToString.ToDate Dim IdCtaContableRecepcion = -1
Fecha = TxtFecha.Text.ToDate Dim IdCtaContableRecepcionME = -1
CveProveedor = ObjCompras.DtResultados(0)("CveProveedor").ToString.ToEntero Dim IdCtaContableRecepcionComplementaria = -1
ProveedorNombre = ObjCompras.DtResultados(0)("RazonSocial").ToString Dim Fecha As Date = Now
SerieFolio = $"Compra: {ObjCompras.DtResultados(0)("SerieFolio").ToString}" Dim CveProveedor As Integer = -1
CveConceptoContableCosto = 205 Dim ProveedorNombre As String = ""
CveConceptoContableCostoME = 230 Dim SerieFolio As String = ""
CveConceptoContableCostoComplementaria = 231 Dim CveConceptoContableCosto = -1
Dim CveConceptoContableCostoME = -1
Dim CveConceptoContableCostoComplementaria = -1
Dim UsaComplementariaFleteImportaciones As Boolean = False
If UsuarioActual.CveEmpresa = 119 Then UsaComplementariaFleteImportaciones = False
If ObjConta.GetRetCuenta(205, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then If DtCostos.Rows.Count > 0 Then
IdCtaContableRecepcion = ObjConta.DtResultados.FiltroPrimeroValor("IdCtaContable").ToEntero If CveCompraSurtir > 0 Then
If ObjCompras.GetCompras(CveCompraSurtir, "-1", "-1", -1, -1, UsuarioActual.CveEmpresa) Then
'Fecha = ObjCompras.DtResultados(0)("Fecha").ToString.ToDate
Fecha = TxtFecha.Text.ToDate
CveProveedor = ObjCompras.DtResultados(0)("CveProveedor").ToString.ToEntero
ProveedorNombre = ObjCompras.DtResultados(0)("RazonSocial").ToString
SerieFolio = $"Compra: {ObjCompras.DtResultados(0)("SerieFolio").ToString}"
CveConceptoContableCosto = 205
CveConceptoContableCostoME = 230
CveConceptoContableCostoComplementaria = 231
If ObjConta.GetRetCuenta(205, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then
IdCtaContableRecepcion = ObjConta.DtResultados.FiltroPrimeroValor("IdCtaContable").ToEntero
End If
If UsaComplementariaFleteImportaciones AndAlso ObjConta.GetRetCuenta(230, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then
IdCtaContableRecepcionME = ObjConta.DtResultados.FiltroPrimeroValor("IdCtaContable").ToEntero
End If
If UsaComplementariaFleteImportaciones AndAlso ObjConta.GetRetCuenta(231, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then
IdCtaContableRecepcionComplementaria = ObjConta.DtResultados.FiltroPrimeroValor("IdCtaContable").ToEntero
End If
Else
ErrorMovInv = True
End If End If
ElseIf CveOCSurtir > 0 Then
If ObjOC.GetOC(CveOCSurtir, UsuarioActual.CveEmpresa) Then
'Fecha = ObjOC.DtResultados(0)("Fecha").ToString.ToDate
Fecha = TxtFecha.Text.ToDate
CveProveedor = ObjOC.DtResultados(0)("CveProveedor").ToString.ToEntero
ProveedorNombre = ObjOC.DtResultados(0)("RazonSocial").ToString
SerieFolio = String.Format("{0} OC# {1} - Almacén# {2}", ProveedorNombre, ObjOC.DtResultados(0)("Folio"), ObjInventario.Folio)
CveConceptoContableCosto = 176
CveConceptoContableCostoME = 228
CveConceptoContableCostoComplementaria = 229
If UsaComplementariaFleteImportaciones AndAlso ObjConta.GetRetCuenta(230, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then If UsuarioActual.CveEmpresa = 119 Then UsaComplementariaFleteImportaciones = True
IdCtaContableRecepcionME = ObjConta.DtResultados.FiltroPrimeroValor("IdCtaContable").ToEntero
If UsaComplementariaFleteImportaciones AndAlso ObjConta.GetRetCuenta(176, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then
IdCtaContableRecepcion = ObjConta.DtResultados.FiltroPrimeroValor("IdCtaContable").ToEntero
End If
If UsaComplementariaFleteImportaciones AndAlso ObjConta.GetRetCuenta(228, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then
IdCtaContableRecepcionME = ObjConta.DtResultados.FiltroPrimeroValor("IdCtaContable").ToEntero
End If
If UsaComplementariaFleteImportaciones AndAlso ObjConta.GetRetCuenta(229, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then
IdCtaContableRecepcionComplementaria = ObjConta.DtResultados.FiltroPrimeroValor("IdCtaContable").ToEntero
End If
Else
ErrorMovInv = True
End If End If
If UsaComplementariaFleteImportaciones AndAlso ObjConta.GetRetCuenta(231, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then
IdCtaContableRecepcionComplementaria = ObjConta.DtResultados.FiltroPrimeroValor("IdCtaContable").ToEntero
End If
Else
ErrorMovInv = True
End If End If
ElseIf CveOCSurtir > 0 Then
If ObjOC.GetOC(CveOCSurtir, UsuarioActual.CveEmpresa) Then
'Fecha = ObjOC.DtResultados(0)("Fecha").ToString.ToDate
Fecha = TxtFecha.Text.ToDate
CveProveedor = ObjOC.DtResultados(0)("CveProveedor").ToString.ToEntero
ProveedorNombre = ObjOC.DtResultados(0)("RazonSocial").ToString
SerieFolio = String.Format("{0} OC# {1} - Almacén# {2}", ProveedorNombre, ObjOC.DtResultados(0)("Folio"), ObjInventario.Folio)
CveConceptoContableCosto = 176
CveConceptoContableCostoME = 228
CveConceptoContableCostoComplementaria = 229
If UsuarioActual.CveEmpresa = 119 Then UsaComplementariaFleteImportaciones = True If Not ErrorMovInv Then
Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen= {DdlAlmacen.SelectedValue}").ToEntero
CvePrePoliza = ObjConta.AddPrePolizas("Inventario/RecepcionAlmacen", 74, TotalCosto, TotalCosto, 1, Fecha, ProveedorNombre, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If CvePrePoliza > 0 Then
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, TotalCosto, SerieFolio, 68, SerieFolio, Fecha, IdCtaContableAlmacen, -1, CveCompra:=CveCompraSurtir, CveSubProyecto:=CveSubProyecto, CveOC:=CveOCSurtir, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCosto, CveCuenta:=CveCuentaAlmacen) Then
If UsaComplementariaFleteImportaciones AndAlso ObjConta.GetRetCuenta(176, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then 'AGREGA POR CONCEPTO POR CVEOCDETALLE
IdCtaContableRecepcion = ObjConta.DtResultados.FiltroPrimeroValor("IdCtaContable").ToEntero If CveOCSurtir > 0 Then
End If Dim TotalCostoDetalle As Decimal = 0
Dim TotalCostoAcumulado As Decimal = 0
Dim cont As Integer = 1
For Each Dr As DataRow In DtCostos.Rows
TotalCostoDetalle = (Dr("Total").ToString.ToDecimal)
TotalCostoExtranjero = Dr("TotalExtranjero").ToString.ToDecimal
TotalCostoAcumulado += Math.Round(TotalCostoDetalle, 2)
If UsaComplementariaFleteImportaciones AndAlso ObjConta.GetRetCuenta(228, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then 'si es el último movimiento verifica los importes que sean igual
IdCtaContableRecepcionME = ObjConta.DtResultados.FiltroPrimeroValor("IdCtaContable").ToEntero If cont = DtCostos.Rows.Count AndAlso (Math.Round(TotalCosto, 2) <> Math.Round(TotalCostoAcumulado, 2)) Then
End If TotalCostoDetalle = TotalCostoDetalle + (Math.Round(TotalCosto, 2) - Math.Round(TotalCostoAcumulado, 2))
TotalCostoExtranjero = TotalCostoExtranjero + (Math.Round(TotalCosto, 2) - Math.Round(TotalCostoAcumulado, 2))
End If
If UsaComplementariaFleteImportaciones AndAlso ObjConta.GetRetCuenta(229, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then If CveMoneda <> 1 AndAlso UsaComplementariaFleteImportaciones Then
IdCtaContableRecepcionComplementaria = ObjConta.DtResultados.FiltroPrimeroValor("IdCtaContable").ToEntero 'COMPLEMENTARIA
End If If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, TotalCostoExtranjero, SerieFolio, CveConceptoContableCostoME, SerieFolio, Fecha, IdCtaContableRecepcionME, -1, CveCompra:=CveCompraSurtir, CveOC:=CveOCSurtir, CveSubProyecto:=CveSubProyecto, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCostoExtranjero, ImporteME:=TotalCostoExtranjero, TipoCambio:=TipoCambio.ToDecimal, CveOCDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then
Else If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, TotalCostoDetalle - TotalCostoExtranjero, SerieFolio, CveConceptoContableCostoComplementaria, SerieFolio, Fecha, IdCtaContableRecepcionComplementaria, -1, CveCompra:=CveCompraSurtir, CveOC:=CveOCSurtir, CveProveedor:=CveProveedor, CveSubProyecto:=CveSubProyecto, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCostoDetalle - TotalCostoExtranjero, ImporteME:=TotalCostoExtranjero, TipoCambio:=TipoCambio.ToDecimal, CveOCDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then
ErrorMovInv = True ErrorMovInv = True
End If Exit For
End If End If
Else
If Not ErrorMovInv Then
Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen= {DdlAlmacen.SelectedValue}").ToEntero
CvePrePoliza = ObjConta.AddPrePolizas("Inventario/RecepcionAlmacen", 74, TotalCosto, TotalCosto, 1, Fecha, ProveedorNombre, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If CvePrePoliza > 0 Then
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, TotalCosto, SerieFolio, 68, SerieFolio, Fecha, IdCtaContableAlmacen, -1, CveCompra:=CveCompraSurtir, CveSubProyecto:=CveSubProyecto, CveOC:=CveOCSurtir, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCosto, CveCuenta:=CveCuentaAlmacen) Then
'AGREGA POR CONCEPTO POR CVEOCDETALLE
If CveOCSurtir > 0 Then
Dim TotalCostoDetalle As Decimal = 0
Dim TotalCostoAcumulado As Decimal = 0
Dim cont As Integer = 1
For Each Dr As DataRow In DtCostos.Rows
TotalCostoDetalle = (Dr("Total").ToString.ToDecimal)
TotalCostoExtranjero = Dr("TotalExtranjero").ToString.ToDecimal
TotalCostoAcumulado += Math.Round(TotalCostoDetalle, 2)
'si es el último movimiento verifica los importes que sean igual
If cont = DtCostos.Rows.Count AndAlso (Math.Round(TotalCosto, 2) <> Math.Round(TotalCostoAcumulado, 2)) Then
TotalCostoDetalle = TotalCostoDetalle + (Math.Round(TotalCosto, 2) - Math.Round(TotalCostoAcumulado, 2))
TotalCostoExtranjero = TotalCostoExtranjero + (Math.Round(TotalCosto, 2) - Math.Round(TotalCostoAcumulado, 2))
End If
If CveMoneda <> 1 AndAlso UsaComplementariaFleteImportaciones Then
'COMPLEMENTARIA
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, TotalCostoExtranjero, SerieFolio, CveConceptoContableCostoME, SerieFolio, Fecha, IdCtaContableRecepcionME, -1, CveCompra:=CveCompraSurtir, CveOC:=CveOCSurtir, CveSubProyecto:=CveSubProyecto, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCostoExtranjero, ImporteME:=TotalCostoExtranjero, TipoCambio:=TipoCambio.ToDecimal, CveOCDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, TotalCostoDetalle - TotalCostoExtranjero, SerieFolio, CveConceptoContableCostoComplementaria, SerieFolio, Fecha, IdCtaContableRecepcionComplementaria, -1, CveCompra:=CveCompraSurtir, CveOC:=CveOCSurtir, CveProveedor:=CveProveedor, CveSubProyecto:=CveSubProyecto, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCostoDetalle - TotalCostoExtranjero, ImporteME:=TotalCostoExtranjero, TipoCambio:=TipoCambio.ToDecimal, CveOCDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then
ErrorMovInv = True ErrorMovInv = True
Exit For Exit For
End If End If
Else Else
ErrorMovInv = True If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, TotalCostoDetalle, SerieFolio, CveConceptoContableCosto, SerieFolio, Fecha, IdCtaContableRecepcion, -1, CveCompra:=CveCompraSurtir, CveOC:=CveOCSurtir, CveSubProyecto:=CveSubProyecto, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCostoDetalle, CveCuenta:=-1, CveOCDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then
Exit For ErrorMovInv = True
Exit For
End If
End If End If
Else cont = cont + 1
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, TotalCostoDetalle, SerieFolio, CveConceptoContableCosto, SerieFolio, Fecha, IdCtaContableRecepcion, -1, CveCompra:=CveCompraSurtir, CveOC:=CveOCSurtir, CveSubProyecto:=CveSubProyecto, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCostoDetalle, CveCuenta:=-1, CveOCDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then
ErrorMovInv = True
Exit For
End If
End If
cont = cont + 1
Next Next
Else
TotalCosto = DtCostos.SUMD("Total").RoundSQL
TotalCostoExtranjero = DtCostos.SUMD("TotalExtranjero")
If CveMoneda <> 1 AndAlso UsaComplementariaFleteImportaciones Then
'COMPLEMENTARIA
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, TotalCostoExtranjero, SerieFolio, CveConceptoContableCostoME, SerieFolio, Fecha, IdCtaContableRecepcionME, -1, CveCompra:=CveCompraSurtir, CveOC:=CveOCSurtir, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCostoExtranjero, ImporteME:=TotalCostoExtranjero, TipoCambio:=TipoCambio.ToDecimal) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, TotalCosto - TotalCostoExtranjero, SerieFolio, CveConceptoContableCostoComplementaria, SerieFolio, Fecha, IdCtaContableRecepcionComplementaria, -1, CveCompra:=CveCompraSurtir, CveOC:=CveOCSurtir, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCosto - TotalCostoExtranjero, ImporteME:=TotalCostoExtranjero, TipoCambio:=TipoCambio.ToDecimal) Then
ErrorMovInv = True
End If
Else
ErrorMovInv = True
End If
Else Else
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, TotalCosto, SerieFolio, CveConceptoContableCosto, SerieFolio, Fecha, IdCtaContableRecepcion, -1, CveCompra:=CveCompraSurtir, CveOC:=CveOCSurtir, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCosto, CveCuenta:=-1) Then TotalCosto = DtCostos.SUMD("Total").RoundSQL
ErrorMovInv = True TotalCostoExtranjero = DtCostos.SUMD("TotalExtranjero")
If CveMoneda <> 1 AndAlso UsaComplementariaFleteImportaciones Then
'COMPLEMENTARIA
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, TotalCostoExtranjero, SerieFolio, CveConceptoContableCostoME, SerieFolio, Fecha, IdCtaContableRecepcionME, -1, CveCompra:=CveCompraSurtir, CveOC:=CveOCSurtir, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCostoExtranjero, ImporteME:=TotalCostoExtranjero, TipoCambio:=TipoCambio.ToDecimal) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, TotalCosto - TotalCostoExtranjero, SerieFolio, CveConceptoContableCostoComplementaria, SerieFolio, Fecha, IdCtaContableRecepcionComplementaria, -1, CveCompra:=CveCompraSurtir, CveOC:=CveOCSurtir, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCosto - TotalCostoExtranjero, ImporteME:=TotalCostoExtranjero, TipoCambio:=TipoCambio.ToDecimal) Then
ErrorMovInv = True
End If
Else
ErrorMovInv = True
End If
Else
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, TotalCosto, SerieFolio, CveConceptoContableCosto, SerieFolio, Fecha, IdCtaContableRecepcion, -1, CveCompra:=CveCompraSurtir, CveOC:=CveOCSurtir, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCosto, CveCuenta:=-1) Then
ErrorMovInv = True
End If
End If End If
End If End If
End If
Else Else
ErrorMovInv = True
End If
Else
ErrorMovInv = True
End If
End If
If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, -1) Then
If ObjConta.ValorPolizaDescuadre > 0 Then
GuardaLogAD($"Inventarios/RecepcionAlmacen-PPCompOC | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
MensajeError = "El Movimiento presenta una diferencia en el registro."
ErrorMovInv = True
End If
End If
'CONTABILIZAR - UNIFICAR Y SIMPLIFICAR CON PP DE LA COMPRA
If Not ErrorMovInv Then
If CvePrePolizaCompra > 0 Then
If UsuarioActual.Empresa.Funcionalidad(219) = "1" Then
If Not ObjConta.PrePolizaUnificacion(CvePrePoliza, CvePrePolizaCompra) Then
ErrorMovInv = True ErrorMovInv = True
MensajeError = "Error al unificar los conceptos contables"
End If End If
End If
End If
If UsuarioActual.Empresa.Funcionalidad(220) <> "" Then
If Not ObjConta.PrePolizaSimplificacion(CvePrePoliza, UsuarioActual.CveEmpresa) Then
ErrorMovInv = True
MensajeError = "Error al simplificar los conceptos contables"
End If
End If
If UsuarioActual.Empresa.Funcionalidad(200) = "1" Then
If ObjContaContPAQ Is Nothing Then
ObjContaContPAQ = New ClsContPAQi(UsuarioActual.Empresa)
ObjContaContPAQ.IniciaTransacSQL()
End If
If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContaContPAQ) Then
MensajeContabilidad = $"<br>Movimiento contabilizado en el folio: <b><a class='Texto' href = '/Contabilidad/RegPoliza.aspx?IdPoliza={ObjConta.ContaIdPoliza}'>{ObjConta.ContaFolio}</a></b><br>"
Else Else
ErrorMovInv = True ErrorMovInv = True
MensajeError = "Error al contabilizar los conceptos contables"
End If End If
End If End If
If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, -1) Then
If ObjConta.ValorPolizaDescuadre > 0 Then
GuardaLogAD($"Inventarios/RecepcionAlmacen-PPCompOC | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
MensajeError = "El Movimiento presenta una diferencia en el registro."
ErrorMovInv = True
End If
End If
'CONTABILIZAR - UNIFICAR Y SIMPLIFICAR CON PP DE LA COMPRA
If Not ErrorMovInv Then
If CvePrePolizaCompra > 0 Then
If UsuarioActual.Empresa.Funcionalidad(219) = "1" Then
If Not ObjConta.PrePolizaUnificacion(CvePrePoliza, CvePrePolizaCompra) Then
ErrorMovInv = True
MensajeError = "Error al unificar los conceptos contables"
End If
End If
End If
If UsuarioActual.Empresa.Funcionalidad(220) <> "" Then
If Not ObjConta.PrePolizaSimplificacion(CvePrePoliza, UsuarioActual.CveEmpresa) Then
ErrorMovInv = True
MensajeError = "Error al simplificar los conceptos contables"
End If
End If
If UsuarioActual.Empresa.Funcionalidad(200) = "1" Then
If ObjContaContPAQ Is Nothing Then
ObjContaContPAQ = New ClsContPAQi(UsuarioActual.Empresa)
ObjContaContPAQ.IniciaTransacSQL()
End If
If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContaContPAQ) Then
MensajeContabilidad = $"<br>Movimiento contabilizado en el folio: <b><a class='Texto' href = '/Contabilidad/RegPoliza.aspx?IdPoliza={ObjConta.ContaIdPoliza}'>{ObjConta.ContaFolio}</a></b><br>"
Else
ErrorMovInv = True
MensajeError = "Error al contabilizar los conceptos contables"
End If
End If
End If
End If End If
Else
ErrorMovInv = True
MensajeError = "Error al obtener movimientos"
End If End If
Else
ErrorMovInv = True
MensajeError = "Error al obtener movimientos"
End If End If
'PREPOLIZA - NC 'PREPOLIZA - NC
If TipoMovimiento = 3 Then If TipoMovimiento = 3 AndAlso Not ErrorMovInv Then
If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then
Dim DtCostos As DataTable = Nothing Dim DtCostos As DataTable = Nothing
DtCostos = ObjInventario.DtResultados DtCostos = ObjInventario.DtResultados
Dim TotalCosto As Decimal = DtCostos.SUM("Total").ToDecimal Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundSQL
Dim TotalNC As Decimal = 0 Dim TotalNC As Decimal = 0
Dim CveClasificacionDifCostoNC = -1 Dim CveClasificacionDifCostoNC = -1
@@ -2850,11 +2848,9 @@ Partial Class Inventarios_RecepcionAlmacen
Dim IdCtaContableClasificacion As Integer = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {CveClasificacionDifCostoNC}").ToEntero Dim IdCtaContableClasificacion As Integer = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {CveClasificacionDifCostoNC}").ToEntero
Dim CveCuentaClasificacion As Integer = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostosSIG", $"CveClasificacion = {CveClasificacionDifCostoNC}").ToEntero Dim CveCuentaClasificacion As Integer = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostosSIG", $"CveClasificacion = {CveClasificacionDifCostoNC}").ToEntero
TotalCosto = Math.Round(TotalCosto, 2) TotalNC = TotalNC.RoundSQL
TotalNC = Math.Round(TotalNC, 2)
Dim DifCostoNC = Math.Round(TotalCosto - TotalNC, 2) Dim DifCostoNC = Math.Round(TotalCosto - TotalNC, 2)
'VARIABLES 'VARIABLES
Dim IdCtaContableAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {DdlAlmacen.SelectedValue}").ToEntero Dim IdCtaContableAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {DdlAlmacen.SelectedValue}").ToEntero
Dim CveCuentaAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContableSIG", $"CveAlmacen = {DdlAlmacen.SelectedValue}").ToEntero Dim CveCuentaAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContableSIG", $"CveAlmacen = {DdlAlmacen.SelectedValue}").ToEntero

View File

@@ -653,13 +653,33 @@ Partial Class Inventarios_TraspasoAlmacen
End If End If
End If End If
Dim DrAlmO, DrAlmD As DataRow
Dim CveSucursalOrigen, CveSucursalDestino As Integer
Dim TipoAlmacenOrigen, TipoAlmacenDestino As Integer
Dim CveSubProyectoOrigen, CveSubProyectoDestino As Integer
Dim IdCtaContableOrigen, IdCtaContableDestino As Integer
DrAlmO = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacenOrigen.SelectedValue.ToEntero).FiltroPrimero("")
DrAlmD = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacenDestino.SelectedValue.ToEntero).FiltroPrimero("")
If DrAlmO IsNot Nothing AndAlso DrAlmD IsNot Nothing Then
CveSucursalOrigen = DrAlmO("CveSubProyecto").ToString.ToEntero
TipoAlmacenOrigen = DrAlmO("CveTipoAlmacen").ToString.ToEntero
CveSubProyectoOrigen = DrAlmO("CveSubProyecto").ToString.ToEntero
IdCtaContableOrigen = DrAlmO("IdCtaContable").ToString.ToEntero
CveSucursalDestino = DrAlmD("CveSubProyecto").ToString.ToEntero
TipoAlmacenDestino = DrAlmD("CveTipoAlmacen").ToString.ToEntero
CveSubProyectoDestino = DrAlmD("CveSubProyecto").ToString.ToEntero
IdCtaContableDestino = DrAlmO("IdCtaContable").ToString.ToEntero
End If
'VALIDA ALMACEN DISTINTA SUCURSAL DEBE SER TRANSITORIO 'VALIDA ALMACEN DISTINTA SUCURSAL DEBE SER TRANSITORIO
If Not UsuarioActual.CveEmpresa.Contiene(7, 140) Then '[IPP] EMPRESA VIGILANCIA NO OCUPA TRANSITORIOS - TIENEN MIL SUCURSALES Xd If Not UsuarioActual.CveEmpresa.Contiene(7, 140) Then '[IPP] EMPRESA VIGILANCIA NO OCUPA TRANSITORIOS - TIENEN MIL SUCURSALES Xd
If Not ChkTransitorio.Checked Then If Not ChkTransitorio.Checked Then
Dim CveSucursalOrigen = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen = {DdlAlmacenOrigen.SelectedValue.ToEntero}")
Dim CveSucursalDestino = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen = {DdlAlmacenDestino.SelectedValue.ToEntero}")
If Not GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTipoAlmacen", $"CveAlmacen = {DdlAlmacenDestino.SelectedValue.ToEntero}").Contiene("21", "26") Then 'NO SE VALIDA CUANDO EL TIPO DE ALMACEN DESTINO ES DE DEVOLUCION If Not TipoAlmacenDestino.Contiene(21, 26) Then 'NO SE VALIDA CUANDO EL TIPO DE ALMACEN DESTINO ES DE DEVOLUCION
If CveSucursalOrigen <> CveSucursalDestino Then If CveSucursalOrigen <> CveSucursalDestino Then
Alert("Por ser un traspaso entre sucursales es necesario indicar que el traspaso es transitorio.", TipoMensaje.MsgAdvertencia) Alert("Por ser un traspaso entre sucursales es necesario indicar que el traspaso es transitorio.", TipoMensaje.MsgAdvertencia)
RegistraScript("playsonidito(''142608__autistic-lucario__error.wav'');", "SonidoError") RegistraScript("playsonidito(''142608__autistic-lucario__error.wav'');", "SonidoError")
@@ -757,9 +777,6 @@ Partial Class Inventarios_TraspasoAlmacen
Dim TotalCantidad As Decimal = DtMovimientos.SUMD("Cantidad") Dim TotalCantidad As Decimal = DtMovimientos.SUMD("Cantidad")
Dim TipoAlmacenOrigen = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTipoAlmacen", $"CveAlmacen = {DdlAlmacenOrigen.SelectedValue.ToEntero}").ToEntero
Dim TipoAlmacenDestino = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTipoAlmacen", $"CveAlmacen = {DdlAlmacenDestino.SelectedValue.ToEntero}").ToEntero
''[IPP-1Noviembre2018] SE COMENTA PORQUE NO TIENE NI PIES NI CABEZA. LE FALTA DESARROLLO ''[IPP-1Noviembre2018] SE COMENTA PORQUE NO TIENE NI PIES NI CABEZA. LE FALTA DESARROLLO
'If (TipoAlmacenOrigen = 14 Or TipoAlmacenDestino = 14) And TipoAlmacenOrigen <> TipoAlmacenDestino Then 'If (TipoAlmacenOrigen = 14 Or TipoAlmacenDestino = 14) And TipoAlmacenOrigen <> TipoAlmacenDestino Then
' ObjInventario.Dispose() ' ObjInventario.Dispose()
@@ -813,9 +830,9 @@ Partial Class Inventarios_TraspasoAlmacen
'VIRTUAL SALIDA 'VIRTUAL SALIDA
If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen= {DdlAlmacenOrigen.SelectedValue}").ToEntero() 'Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen= {DdlAlmacenOrigen.SelectedValue}").ToEntero()
Dim CveAlmacenVirtual As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, 24).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={CveSubProyecto}").ToEntero() Dim CveAlmacenVirtual As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, 24).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={CveSubProyectoOrigen}").ToEntero()
CveMovimientoVirtualSalida = ObjInventario.AddMovimiento(CveAlmacenVirtual, 37, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="TA/V", CveMovimientoRelacionado:=CveMovimientoSalida) CveMovimientoVirtualSalida = ObjInventario.AddMovimiento(CveAlmacenVirtual, 37, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="TA/V", CveMovimientoRelacionado:=CveMovimientoSalida)
FolioVirtualSalida = ObjInventario.Folio FolioVirtualSalida = ObjInventario.Folio
@@ -845,7 +862,7 @@ Partial Class Inventarios_TraspasoAlmacen
Dim TipoMovimientoEntrada = 27 Dim TipoMovimientoEntrada = 27
AlmacenEntrada = If(ChkTransitorio.Checked, DdlAlmacenTransitorio.SelectedValue.ToEntero, DdlAlmacenDestino.SelectedValue.ToEntero) AlmacenEntrada = If(ChkTransitorio.Checked, DdlAlmacenTransitorio.SelectedValue.ToEntero, DdlAlmacenDestino.SelectedValue.ToEntero)
Dim TipoAlmacenEntrada As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTipoAlmacen", $"CveAlmacen = {AlmacenEntrada}").ToEntero() 'Dim TipoAlmacenEntrada As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTipoAlmacen", $"CveAlmacen = {AlmacenEntrada}").ToEntero()
CveMovimientoEntrada = ObjInventario.AddMovimiento(AlmacenEntrada, TipoMovimientoEntrada, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, -1, -1, CveMovimientoEntrada = ObjInventario.AddMovimiento(AlmacenEntrada, TipoMovimientoEntrada, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, -1, -1,
Observaciones:=TxtObservaciones.Text.Trim, Recibio:=If(ChkTransitorio.Checked, TxtResponsable.Text.Trim, "-1"), Observaciones:=TxtObservaciones.Text.Trim, Recibio:=If(ChkTransitorio.Checked, TxtResponsable.Text.Trim, "-1"),
@@ -858,7 +875,7 @@ Partial Class Inventarios_TraspasoAlmacen
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
Dim Cont As Integer = 0 Dim Cont As Integer = 0
For Each Dr As DataRow In ObjInventario.DtResultados.Rows For Each Dr As DataRow In ObjInventario.DtResultados.Rows
Dim CostoEntrada As Decimal = If(TipoAlmacenEntrada = 26, 0, Dr("PU").ToString.ToDecimal()) Dim CostoEntrada As Decimal = If(TipoAlmacenDestino = 26, 0, Dr("PU").ToString.ToDecimal())
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, CostoEntrada, CveAF:=Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=-1, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, Observaciones:=Dr("Observaciones").ToString) Then If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, CostoEntrada, CveAF:=Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=-1, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, Observaciones:=Dr("Observaciones").ToString) Then
ErrorMovInv = True ErrorMovInv = True
TextoError = "Ocurrió un error al guardar los movimientos de entrada" TextoError = "Ocurrió un error al guardar los movimientos de entrada"
@@ -870,9 +887,9 @@ Partial Class Inventarios_TraspasoAlmacen
End If End If
'VIRTUAL ENTRADA 'VIRTUAL ENTRADA
If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen= {DdlAlmacenDestino.SelectedValue}").ToEntero() 'Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen= {DdlAlmacenDestino.SelectedValue}").ToEntero()
Dim CveAlmacenVirtual As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveTipoAlmacen =24 AND CveSubProyecto={CveSubProyecto}").ToEntero() Dim CveAlmacenVirtual As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveTipoAlmacen =24 AND CveSubProyecto={CveSubProyectoDestino }").ToEntero()
CveMovimientoVirtualEntrada = ObjInventario.AddMovimiento(CveAlmacenVirtual, 36, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="TA/S3") CveMovimientoVirtualEntrada = ObjInventario.AddMovimiento(CveAlmacenVirtual, 36, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="TA/S3")
FolioVirtualEntrada = ObjInventario.Folio FolioVirtualEntrada = ObjInventario.Folio
@@ -904,17 +921,33 @@ Partial Class Inventarios_TraspasoAlmacen
Dim resultado As DataTable = ObjInventario.DtResultados Dim resultado As DataTable = ObjInventario.DtResultados
Dim importe As Decimal = resultado.SUMD("Total").RoundSQL Dim importe As Decimal = resultado.SUMD("Total").RoundSQL
Dim IdCtaContableSalida As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenOrigen.SelectedValue.ToEntero)).ToEntero 'Dim IdCtaContableSalida As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenOrigen.SelectedValue.ToEntero)).ToEntero
Dim IdCtaContableEntrada As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenDestino.SelectedValue.ToEntero)).ToEntero 'Dim IdCtaContableEntrada As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenDestino.SelectedValue.ToEntero)).ToEntero
Dim Contabilizable As Boolean = True Dim Contabilizable As Boolean = True
If IdCtaContableSalida = IdCtaContableEntrada Then Contabilizable = False If IdCtaContableOrigen = IdCtaContableDestino And TipoAlmacenDestino <> 26 Then Contabilizable = False
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContableSalida, -1, CveMovimientoAlmacen:=CveMovimientoSalida, Contabilizable:=Contabilizable, ImporteMX:=importe) Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContableOrigen, -1, CveMovimientoAlmacen:=CveMovimientoSalida, Contabilizable:=Contabilizable, ImporteMX:=importe) Then
ErrorMovInv = True ErrorMovInv = True
End If End If
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContableEntrada, -1, CveMovimientoAlmacen:=CveMovimientoEntrada, Contabilizable:=Contabilizable, ImporteMX:=importe) Then 'si el tipo de almacen de entrada es Almacen sin costo, se registra al costo, la salida.
If TipoAlmacenOrigen <> 26 AndAlso TipoAlmacenDestino = 26 Then
Dim tCveClasificacion As Integer = DtMovimientos.MAX("CveClasificacion").ToEntero
Dim dr As DataRow = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=tCveClasificacion).FiltroPrimero("")
Dim IdCuentaCostos As Integer = -1
If dr IsNot Nothing Then
IdCuentaCostos = dr("IdCuentaCostos").ToString.ToEntero
End If
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -importe, TxtObservaciones.Text, 69, TxtObservaciones.Text, Fecha, IdCuentaCostos, -1, CveClasificacion:=tCveClasificacion, CveSubProyecto:=CveSubProyectoOrigen, CveMovimientoAlmacen:=CveMovimientoSalida, Contabilizable:=Contabilizable, ImporteMX:=-importe) Then
ErrorMovInv = True
End If
Contabilizable = False
importe = 0
End If
If Not ErrorMovInv AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContableDestino, -1, CveMovimientoAlmacen:=CveMovimientoEntrada, Contabilizable:=Contabilizable, ImporteMX:=importe) Then
ErrorMovInv = True ErrorMovInv = True
End If End If
End If End If
@@ -1083,6 +1116,7 @@ Partial Class Inventarios_TraspasoAlmacen
Mensaje.AppendFormat("<br/> Folio: <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{0}</a></b>", FolioMov, CveMovimiento) Mensaje.AppendFormat("<br/> Folio: <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{0}</a></b>", FolioMov, CveMovimiento)
Alert(Mensaje.ToString, TipoMensaje.MsgInformacion) Alert(Mensaje.ToString, TipoMensaje.MsgInformacion)
Mensaje.Clear()
LimpiaMovimiento() LimpiaMovimiento()

View File

@@ -460,7 +460,7 @@ Partial Class Site
'End If 'End If
'OC.Dispose() 'OC.Dispose()
LtlMNotificaciones.Text = LtlMNotificaciones.Text & Notificaciones.ToString LtlMNotificaciones.Text = String.Format("{0}{1}", LtlMNotificaciones.Text, Notificaciones.ToString)
Notificaciones.Clear() Notificaciones.Clear()
End Sub End Sub
@@ -494,11 +494,41 @@ Partial Class Site
#Region "TIPO DE CAMBIO" #Region "TIPO DE CAMBIO"
Private Sub CargaTipoCambio() Private Sub CargaTipoCambio()
If Application("TipoCambioActual") Is Nothing Then
'sino existe el dato, lo carga por ser la primera vez
Application("TipoCambioActual") = GetTipoCambio()
Else
Dim TCA As TipoCambioActual = CType(Application("TipoCambioActual"), TipoCambioActual)
If TCA.Fecha <> DateTime.Today Then
Application("TipoCambioActual") = GetTipoCambio()
End If
End If
lblTipoCambio.Text = String.Format(" | TC {0:C4}", CType(Application("TipoCambioActual"), TipoCambioActual).TipoCambio)
End Sub
Private Function GetTipoCambio() As TipoCambioActual
'Dim Retorno As TipoCambioActual
Dim TCT As Decimal = 0
Dim ObjGenerales As ClsGenerales = New ClsGenerales Dim ObjGenerales As ClsGenerales = New ClsGenerales
If ObjGenerales.GetTipoCambio(-1, DateTime.Now) And ObjGenerales.DtResultados.Rows.Count > 0 Then If ObjGenerales.GetTipoCambio(-1, DateTime.Today) Then
lblTipoCambio.Text = String.Format(" | TC {0:C4}", ObjGenerales.DtResultados(0)("TipoCambio").ToString().ToDecimal())
If ObjGenerales.DtResultados.Rows.Count > 0 Then
TCT = ObjGenerales.DtResultados(0)("TipoCambio").ToString().ToDecimal()
End If
End If End If
ObjGenerales.Dispose() ObjGenerales.Dispose()
End Sub
Return New TipoCambioActual With {.Fecha = DateTime.Today, .TipoCambio = TCT}
End Function
#End Region #End Region
End Class End Class
Public Class TipoCambioActual
Public Fecha As Date
Public TipoCambio As Decimal
End Class

1
Tareas/Thalamus.asmx Normal file
View File

@@ -0,0 +1 @@
<%@ WebService Language="VB" CodeBehind="~/App_Code/Thalamus.vb" Class="Thalamus" %>

View File

@@ -5984,6 +5984,9 @@ Partial Class Clientes
#Region "C U E N T A S - B A N C A R I A S" #Region "C U E N T A S - B A N C A R I A S"
Private Sub CargaCuentasBancarias() Private Sub CargaCuentasBancarias()
If CveCliente <= 0 Then Exit Sub
Dim ObjCuentasBancos As New ClsGenerales Dim ObjCuentasBancos As New ClsGenerales
ViewState("OrdenCuentasBancos") = "" ViewState("OrdenCuentasBancos") = ""
DTCuentasBancos = New DataTable DTCuentasBancos = New DataTable

View File

@@ -10,8 +10,7 @@
padding: 0px 5px; padding: 0px 5px;
} }
.nolineheight TxtNombreCliente .nolineheight TxtNombreCliente line-height: 1;
line-height: 1;
} }
.claseesconder { .claseesconder {
@@ -1599,7 +1598,8 @@
<div class="portlet box purpleAlmacen" id="DivSalidaAlmacen" runat="server"> <div class="portlet box purpleAlmacen" id="DivSalidaAlmacen" runat="server">
<div class="portlet-title"> <div class="portlet-title">
<div class="caption"> <div class="caption">
<i class="fa fa-dropbox"></i><asp:Literal ID="LltSalidaAlmacen" runat="server" Text="Salida Almacen"></asp:Literal> <i class="fa fa-dropbox"></i>
<asp:Literal ID="LltSalidaAlmacen" runat="server" Text="Salida Almacen"></asp:Literal>
</div> </div>
<div class="tools"> <div class="tools">
<a href="javascript:;" class="collapse"></a> <a href="javascript:;" class="collapse"></a>
@@ -3294,6 +3294,18 @@
<td> <td>
<asp:TextBox ID="TxtCorreoNotificaciones" runat="server" Width="100%" CssClass="form-control"></asp:TextBox></td> <asp:TextBox ID="TxtCorreoNotificaciones" runat="server" Width="100%" CssClass="form-control"></asp:TextBox></td>
</tr> </tr>
<tr align="left" id="trPaqueteriOpcionesLabel" runat="server" visible="false">
<td id="Td2" runat="server">Tipo de Entrega:&nbsp;</td>
</tr>
<tr align="left" id="trPaqueteriaOpciones" runat="server" visible="false">
<td colspan="2">
<asp:RadioButtonList runat="server" ID="RblPaqueteria">
<asp:ListItem Value="1" Text="Entrega En Mostrador" />
<asp:ListItem Value="2" Text="Entrega Interna" />
<asp:ListItem Value="3" Text="Entrega Externa" />
</asp:RadioButtonList>
</td>
</tr>
</table> </table>
</div> </div>
</ContentTemplate> </ContentTemplate>
@@ -4141,8 +4153,8 @@
<asp:Literal ID="LtlTareaNueva" runat="server"></asp:Literal> <asp:Literal ID="LtlTareaNueva" runat="server"></asp:Literal>
<UserControl:TareaNueva runat="server" id="TareaNueva" /> <UserControl:TareaNueva runat="server" id="TareaNueva" />
<script> function OnAddedTareaNueva() { <script> function OnAddedTareaNueva() {
$('.btnupEventoBitacora').click(); $('.btnupEventoBitacora').click();
} }
</script> </script>
</div> </div>
@@ -7071,9 +7083,9 @@
$get(Row).style.backgroundColor = "#82b6db"; $get(Row).style.backgroundColor = "#82b6db";
$get(Obj).focus(); $get(Obj).focus();
var total = parseFloat($('#<%= HplSaldoAuxiliar.ClientID%>').text().replace(',', '')); var total = parseFloat($('#<%= HplSaldoAuxiliar.ClientID%>').text().replace(',', ''));
$get(Obj).value = 0; $get(Obj).value = 0;
var suma = 0; var suma = 0;
$('#<%= GVAnticipos.ClientID%> input[type="text"]').each(function (index) { $('#<%= GVAnticipos.ClientID%> input[type="text"]').each(function (index) {
var currentsaldo = parseFloat($(this).val()) var currentsaldo = parseFloat($(this).val())
if (isNaN(currentsaldo)) { currentsaldo = 0 } if (isNaN(currentsaldo)) { currentsaldo = 0 }
suma = currentsaldo + suma; suma = currentsaldo + suma;
@@ -7089,7 +7101,7 @@
$get(Obj).value = ""; $get(Obj).value = "";
$get(Row).style.backgroundColor = "#ffffff"; $get(Row).style.backgroundColor = "#ffffff";
} }
//if ($("input:checkbox:not(:checked)")) //if ($("input:checkbox:not(:checked)"))
SetText2($get("LblTotalAnticipos"), formato_numero($get("HdnAnticipos").value, 2, '.', ',')); SetText2($get("LblTotalAnticipos"), formato_numero($get("HdnAnticipos").value, 2, '.', ','));
} }
function imprimircotizacion() { function imprimircotizacion() {
@@ -7103,121 +7115,121 @@
var ValorTxt = Obj.value; var ValorTxt = Obj.value;
var suma = 0; var suma = 0;
var total = parseFloat($('#<%= HplSaldoAuxiliar.ClientID%>').text().replace(',', '')); var total = parseFloat($('#<%= HplSaldoAuxiliar.ClientID%>').text().replace(',', ''));
$('#<%= GVAnticipos.ClientID%> input[type="text"]').each(function (index) { $('#<%= GVAnticipos.ClientID%> input[type="text"]').each(function (index) {
var currentsaldo = parseFloat($(this).val()) var currentsaldo = parseFloat($(this).val())
if (isNaN(currentsaldo)) { currentsaldo = 0 } if (isNaN(currentsaldo)) { currentsaldo = 0 }
suma = currentsaldo + suma; suma = currentsaldo + suma;
}); });
var txtvalue = (total - suma) + parseFloat(ValorTxt); var txtvalue = (total - suma) + parseFloat(ValorTxt);
if (txtvalue < 0) { txtvalue = 0; } if (txtvalue < 0) { txtvalue = 0; }
if (txtvalue < Monto) { Monto = txtvalue.toFixed(2); } if (txtvalue < Monto) { Monto = txtvalue.toFixed(2); }
if (isNaN(ValorTxt)) if (isNaN(ValorTxt))
ValorTxt = 0; ValorTxt = 0;
if (isNaN(Monto)) if (isNaN(Monto))
Monto = 0; Monto = 0;
if (parseFloat(ValorTxt) < 0) { if (parseFloat(ValorTxt) < 0) {
ValorTxt = 0; ValorTxt = 0;
Obj.value = 0; Obj.value = 0;
} }
if (parseFloat(ValorTxt) > parseFloat(Monto)) { if (parseFloat(ValorTxt) > parseFloat(Monto)) {
alert("El monto de ''Anticipo a Amortizar'' no puede ser mayor al monto del ''Anticipo''"); alert("El monto de ''Anticipo a Amortizar'' no puede ser mayor al monto del ''Anticipo''");
Obj.value = Monto; Obj.value = Monto;
} }
} }
function ImprimirCotizacion() { function ImprimirCotizacion() {
__doPostBack('ctl00$HB$LNKImprimirCotizacion', ''); __doPostBack('ctl00$HB$LNKImprimirCotizacion', '');
} }
function SetText2(ObjTo, Value) { function SetText2(ObjTo, Value) {
ObjTo.innerText = Value; ObjTo.innerText = Value;
} }
//VALIDA QUE LA CANTIDAD DE T (TXT) NO SEA MAYOR A C //VALIDA QUE LA CANTIDAD DE T (TXT) NO SEA MAYOR A C
function ValidarCantidad(t, c) { function ValidarCantidad(t, c) {
t.value = (t.value > c ? c : t.value) t.value = (t.value > c ? c : t.value)
} }
//VALIDA QUE LA CANTIDAD DE T (TXT) NO SEA MENOR A C //VALIDA QUE LA CANTIDAD DE T (TXT) NO SEA MENOR A C
function ValidarCantidadMenor(t, c) { function ValidarCantidadMenor(t, c) {
t.value = (t.value > c ? t.value : c) t.value = (t.value > c ? t.value : c)
} }
function Comma(Num) { //function to add commas to textboxes function Comma(Num) { //function to add commas to textboxes
Num += ''; Num += '';
Num = Num.replace(',', ''); Num = Num.replace(',', ''); Num = Num.replace(',', ''); Num = Num.replace(',', ''); Num = Num.replace(',', ''); Num = Num.replace(',', '');
Num = Num.replace(',', ''); Num = Num.replace(',', ''); Num = Num.replace(',', ''); Num = Num.replace(',', ''); Num = Num.replace(',', ''); Num = Num.replace(',', '');
x = Num.split('.'); x = Num.split('.');
x1 = x[0]; x1 = x[0];
x2 = x.length > 1 ? '.' + x[1] : ''; x2 = x.length > 1 ? '.' + x[1] : '';
var rgx = /(\d+)(\d{3})/; var rgx = /(\d+)(\d{3})/;
while (rgx.test(x1)) while (rgx.test(x1))
x1 = x1.replace(rgx, '$1' + ',' + '$2'); x1 = x1.replace(rgx, '$1' + ',' + '$2');
return x1 + x2; return x1 + x2;
} }
function AddCodigoBarrasSerie(e) { function AddCodigoBarrasSerie(e) {
if (e.keyCode == 13 || e.which == 13) { if (e.keyCode == 13 || e.which == 13) {
$('#BtnCodigoBarrasSerie').click(); $('#BtnCodigoBarrasSerie').click();
} }
} }
//SERIE PS //SERIE PS
function SeriePS(e, b, txt, hdn) { function SeriePS(e, b, txt, hdn) {
; ;
if (e.keyCode == 13 || e.which == 13) { if (e.keyCode == 13 || e.which == 13) {
if (txt.value != "" && txt.value != hdn.value) { if (txt.value != "" && txt.value != hdn.value) {
$(b).click(); $(b).click();
} }
} }
} }
function SeriePSBlur(b, txt, hdn) { function SeriePSBlur(b, txt, hdn) {
; ;
if (txt.value != "" && txt.value != hdn.value) { if (txt.value != "" && txt.value != hdn.value) {
$(b).click(); $(b).click();
} }
} }
//SERIE-LOTE INV //SERIE-LOTE INV
var H1 = ""; var H1 = "";
var H2 = ""; var H2 = "";
var T = ""; var T = "";
function EnterAFEdit(event, Txt, Hdn1, Hdn2) { function EnterAFEdit(event, Txt, Hdn1, Hdn2) {
if (event.which == 13 || event.keyCode == 13) { if (event.which == 13 || event.keyCode == 13) {
H1 = Hdn1; H1 = Hdn1;
H2 = Hdn2; H2 = Hdn2;
T = Txt; T = Txt;
$get("HdnCodAFEdit").value = Txt.value; $get("HdnCodAFEdit").value = Txt.value;
$('#BtnVinculaAFEdit').click(); $('#BtnVinculaAFEdit').click();
} }
} }
function AFBlurEdit(Txt, Hdn1, Hdn2) { function AFBlurEdit(Txt, Hdn1, Hdn2) {
if (Txt.value.length > 0 && Txt.value != Hdn2.value) { if (Txt.value.length > 0 && Txt.value != Hdn2.value) {
H1 = Hdn1; H1 = Hdn1;
H2 = Hdn2; H2 = Hdn2;
T = Txt; T = Txt;
$get("HdnCodAFEdit").value = Txt.value; $get("HdnCodAFEdit").value = Txt.value;
$('#BtnVinculaAFEdit').click(); $('#BtnVinculaAFEdit').click();
} }
} }
function EnterAFEditOK(Cve, Codigo) { function EnterAFEditOK(Cve, Codigo) {
$get(H1.id).value = Cve; $get(H1.id).value = Cve;
$get(H2.id).value = Codigo; $get(H2.id).value = Codigo;
$get(T.id).value = (Codigo == -1) ? "" : Codigo; $get(T.id).value = (Codigo == -1) ? "" : Codigo;
} }
//Suma Totales //Suma Totales
function FnSuma() { function FnSuma() {
$get('TxtSubTotal2').value = FormatoNumero(ToDouble($get('TxtSubTotal').value) - ToDouble($get('LblDescuentos').innerHTML) - ToDouble($get('LblAmortizacion').innerHTML), 2); $get('TxtSubTotal2').value = FormatoNumero(ToDouble($get('TxtSubTotal').value) - ToDouble($get('LblDescuentos').innerHTML) - ToDouble($get('LblAmortizacion').innerHTML), 2);
var totalVenta = ToDouble($get('TxtSubTotal2').value) + ToDouble($get('TxtIVA').value) + ToDouble($get('TxtIEPS') ? ToDouble($get('TxtIEPS').value) : 0) - ToDouble($get('TxtRetIVA').value) - ToDouble($get('TxtRetISR').value); var totalVenta = ToDouble($get('TxtSubTotal2').value) + ToDouble($get('TxtIVA').value) + ToDouble($get('TxtIEPS') ? ToDouble($get('TxtIEPS').value) : 0) - ToDouble($get('TxtRetIVA').value) - ToDouble($get('TxtRetISR').value);
debugger; debugger;
$("#<%=GvImpuestosLocales2.ClientID%> input[type='text']").each(function () { $("#<%=GvImpuestosLocales2.ClientID%> input[type='text']").each(function () {
if ($(this).attr("class") == '5') // cuando es traslado de impuesto local, se suma if ($(this).attr("class") == '5') // cuando es traslado de impuesto local, se suma
totalVenta += ToDouble($(this).val().toString()); totalVenta += ToDouble($(this).val().toString());
@@ -7239,7 +7251,7 @@
$get("HdnTipoDescuento").value = "3"; $get("HdnTipoDescuento").value = "3";
//si es con.nc,es.el.total //si es con.nc,es.el.total
var Total = ToDouble($get(TipoAnticipo == 2? 'TxtTotal':'TxtSubTotal').value); var Total = ToDouble($get(TipoAnticipo == 2 ? 'TxtTotal' : 'TxtSubTotal').value);
var SaldoCompra = parseFloat(parseFloat($get('HdnVentaSaldo').value).toFixed(2)); var SaldoCompra = parseFloat(parseFloat($get('HdnVentaSaldo').value).toFixed(2));
if (ToDouble($get('HdnCveVenta').value) == 0) SaldoCompra = Total; if (ToDouble($get('HdnCveVenta').value) == 0) SaldoCompra = Total;

View File

@@ -1206,6 +1206,15 @@ Partial Class Ventas
ViewState("SaldoAnticipo") = value ViewState("SaldoAnticipo") = value
End Set End Set
End Property End Property
Private Property CorreoEntregaAlmacen As String
Get
Return If(IsNothing(ViewState("CorreoEntregaAlmacen")), "", ViewState("CorreoEntregaAlmacen").ToString())
End Get
Set(value As String)
ViewState("CorreoEntregaAlmacen") = value
End Set
End Property
#End Region #End Region
@@ -2634,6 +2643,7 @@ Partial Class Ventas
If UsuarioActual.CveEmpresa = 141 Then If UsuarioActual.CveEmpresa = 141 Then
BtnModalAddPS.Enabled = False BtnModalAddPS.Enabled = False
End If End If
MostrarOpcioensPaqueteria()
End Sub End Sub
Private Sub BloqueaClasificaciones() Private Sub BloqueaClasificaciones()
If UsuarioActual.CveEmpresa = 141 AndAlso DdlTipoComprobante.SelectedValue = "Cot" Then If UsuarioActual.CveEmpresa = 141 AndAlso DdlTipoComprobante.SelectedValue = "Cot" Then
@@ -4847,6 +4857,7 @@ Partial Class Ventas
ViewState("Mail") = If(DdlTipoComprobante.SelectedValue = "Cot", ObjCliente.MailCotizacion, ObjCliente.Mail) ViewState("Mail") = If(DdlTipoComprobante.SelectedValue = "Cot", ObjCliente.MailCotizacion, ObjCliente.Mail)
ViewState("MailCC") = ObjCliente.NotificarA ViewState("MailCC") = ObjCliente.NotificarA
CorreoEntregaAlmacen = ObjCliente.DtResultados(0)("CorreoEntregaAlmacen").ToString
LblDireccion.Text = ObjCliente.Direccion LblDireccion.Text = ObjCliente.Direccion
LblColonia.Text = ObjCliente.Colonia LblColonia.Text = ObjCliente.Colonia
LblCiudad.Text = ObjCliente.Ciudad LblCiudad.Text = ObjCliente.Ciudad
@@ -5157,8 +5168,8 @@ Partial Class Ventas
CargarAlmacenes() CargarAlmacenes()
If UsuarioActual.Empresa.FacturaProduccion Then If UsuarioActual.Empresa.FacturaProduccion Then
CargaDocumentacionCliente()
End If End If
CargaDocumentacionCliente()
If UsuarioActual.CveEmpresa.Contiene(72, 80, 1, 119) Then If UsuarioActual.CveEmpresa.Contiene(72, 80, 1, 119) Then
BtnEmitirImprimir.OnClientClick = $"ValidaGuardar({ If(ImprimeNombreSucursal = True, 1, 0)});" BtnEmitirImprimir.OnClientClick = $"ValidaGuardar({ If(ImprimeNombreSucursal = True, 1, 0)});"
@@ -7470,7 +7481,7 @@ Partial Class Ventas
ObjContr.Dispose() ObjContr.Dispose()
ObjDocCliente.Dispose() ObjDocCliente.Dispose()
'ObjFolios.Dispose() 'ObjFolios.Dispose()
ErrorList.Clear ErrorList.Clear()
ErrorList = Nothing ErrorList = Nothing
MensajeAlert = Nothing MensajeAlert = Nothing
If ObjContPaq IsNot Nothing Then ObjContPaq.Dispose() If ObjContPaq IsNot Nothing Then ObjContPaq.Dispose()
@@ -9502,7 +9513,7 @@ Partial Class Ventas
CveVentaRelacion:=(If(factura.CveVentaRelacion.ToEntero() > 0, factura.CveVentaRelacion, -1)), ImporteRelacion:=(If(factura.ImporteRelacion <> Nothing, factura.ImporteRelacion, -1)), CveVentaRelacion:=(If(factura.CveVentaRelacion.ToEntero() > 0, factura.CveVentaRelacion, -1)), ImporteRelacion:=(If(factura.ImporteRelacion <> Nothing, factura.ImporteRelacion, -1)),
CveTipoAmortizacionAnticipo:=factura.CveTipoAmortizacionAnticipo, CveEmpresaCRM:=CveEmpresaCRM, EsInterno:=EsInterno, CveAcercamientoCRM:=CveAcercamientoCRM, CveTipoAmortizacionAnticipo:=factura.CveTipoAmortizacionAnticipo, CveEmpresaCRM:=CveEmpresaCRM, EsInterno:=EsInterno, CveAcercamientoCRM:=CveAcercamientoCRM,
DiasCredito:=factura.DiasCredito, EsDiasCreditoFijo:=factura.EsDiasCreditoFijo, AnticipoEspecial:=If(TrAntEspecial.Visible, ChkAntEspecial.Checked, False), DiasCredito:=factura.DiasCredito, EsDiasCreditoFijo:=factura.EsDiasCreditoFijo, AnticipoEspecial:=If(TrAntEspecial.Visible, ChkAntEspecial.Checked, False),
Kilometraje:=TxtKilometraje.Text.ToDouble, EsAmortizacion:=EsNCAmortizacion, CveTipoRetencion:=CveTipoRetencion, CorreoNotificacion:=TxtCorreoNotificaciones.Text) Then Kilometraje:=TxtKilometraje.Text.ToDouble, EsAmortizacion:=EsNCAmortizacion, CveTipoRetencion:=CveTipoRetencion, CorreoNotificacion:=TxtCorreoNotificaciones.Text, FormaPaqueteria:=RblPaqueteria.SelectedValue.ToEntero) Then
ErrorList.Add("Ocurrió un error al Generar la Venta.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico") ErrorList.Add("Ocurrió un error al Generar la Venta.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
Else Else
If factura.TipoDocto.Contiene("Dev", "Egs") Or DtVentasNC IsNot Nothing Or CveEstatusRefacturacion = 1 Then If factura.TipoDocto.Contiene("Dev", "Egs") Or DtVentasNC IsNot Nothing Or CveEstatusRefacturacion = 1 Then
@@ -9523,6 +9534,10 @@ Partial Class Ventas
End If End If
End If End If
If UsuarioActual.Empresa.Funcionalidad(280) = "1" And RblPaqueteria.SelectedValue = "1" Then
NotificarPaqueteria()
End If
End If End If
If Not GuardarUsados(ObjVentas.IniciaTransacSQL, ObjVentas.CveVenta) Then If Not GuardarUsados(ObjVentas.IniciaTransacSQL, ObjVentas.CveVenta) Then
@@ -14055,7 +14070,7 @@ Partial Class Ventas
TrVistaPrevia.Visible = EstatusCliente TrVistaPrevia.Visible = EstatusCliente
End If End If
MostrarOpcioensPaqueteria()
TrAtencionA.Visible = True TrAtencionA.Visible = True
tdVigencia.Visible = DdlTipoComprobante.SelectedValue.Contiene("Cot") tdVigencia.Visible = DdlTipoComprobante.SelectedValue.Contiene("Cot")
@@ -14066,6 +14081,7 @@ Partial Class Ventas
UPCondicionesPago.Update() UPCondicionesPago.Update()
UpCliente.Update() UpCliente.Update()
UpPS.Update() UpPS.Update()
UPObservaciones.Update()
End Sub End Sub
Protected Sub DdlSucursalCliente_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlSucursalCliente.SelectedIndexChanged Protected Sub DdlSucursalCliente_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlSucursalCliente.SelectedIndexChanged
CargaClienteSucursal(DdlSucursalCliente.SelectedValue.ToEntero()) CargaClienteSucursal(DdlSucursalCliente.SelectedValue.ToEntero())
@@ -25660,6 +25676,27 @@ Partial Class Ventas
CargaEventoBitacora() CargaEventoBitacora()
End Sub End Sub
Private Sub MostrarOpcioensPaqueteria()
Dim mostrarOpcionesPaq As Boolean = DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ped")
trPaqueteriaOpciones.Visible = mostrarOpcionesPaq
trPaqueteriOpcionesLabel.Visible = mostrarOpcionesPaq
End Sub
Private Sub NotificarPaqueteria()
Dim DtVendedores As DataTable = GlobalDTVendedores(UsuarioActual.CveEmpresa)
Dim CorreoVendedor As String = DtVendedores.FiltroPrimeroValor("Correo", String.Format("CveVendedor = {0}", DdlVendedor.SelectedValue))
Dim CorreoVendedorAdicional As String = DtVendedores.FiltroPrimeroValor("CorreoAdicionalNotificaciones", String.Format("CveVendedor = {0}", DdlVendedor.SelectedValue))
Dim CorreoCliente As String = Mail
Dim CorreoClienteAlmacen As String = CorreoEntregaAlmacen
Dim CorreoNotificacionCliente As String = MailCC
Dim CorreosCC As String = String.Format("{0};{1};{2};{3}", CorreoVendedor, CorreoVendedorAdicional, CorreoCliente, CorreoNotificacionCliente)
Dim LogCorreo As String = String.Format("{0} -- {1} --- {2}", "Tipo de entrega", CorreoClienteAlmacen, CorreosCC)
LogCorreo.GuardaLog
Dim MailCls As New ClsSisMail
MailCls.SendMail(ClsPaginas.EmpresaNotificaciones, CorreoVendedor, "Entrega en mostrador", "Pendiente", CorreosCC)
MailCls = Nothing
End Sub
End Class End Class