Correciones en punto de venta
This commit is contained in:
@@ -13,7 +13,8 @@ Imports System
|
|||||||
Imports System.Net
|
Imports System.Net
|
||||||
Imports System.IO.Compression
|
Imports System.IO.Compression
|
||||||
Imports System.Text
|
Imports System.Text
|
||||||
|
Imports System.Net.Http
|
||||||
|
|
||||||
Namespace Modelos
|
Namespace Modelos
|
||||||
|
|
||||||
<Serializable>
|
<Serializable>
|
||||||
@@ -375,6 +376,7 @@ Namespace Modelos
|
|||||||
Me.RemisionesLista = New List(Of Integer)
|
Me.RemisionesLista = New List(Of Integer)
|
||||||
Me.ListaMensajes = New List(Of String)
|
Me.ListaMensajes = New List(Of String)
|
||||||
Me.FolioFiscal = ""
|
Me.FolioFiscal = ""
|
||||||
|
Me.GenerarPDFFactura = False
|
||||||
IniciaValores()
|
IniciaValores()
|
||||||
Dim ObjVentas As New ClsVentas()
|
Dim ObjVentas As New ClsVentas()
|
||||||
If ObjVentas.GetVenta(CveVenta, CveEmpresa) Then
|
If ObjVentas.GetVenta(CveVenta, CveEmpresa) Then
|
||||||
@@ -895,16 +897,21 @@ Namespace Modelos
|
|||||||
If Me.TipoDocto.Contiene("Ing", "Rem", "Ant", "Egs", "Dev", "Pd2") Then
|
If Me.TipoDocto.Contiene("Ing", "Rem", "Ant", "Egs", "Dev", "Pd2") Then
|
||||||
'If Not ImprimeAlert Then
|
'If Not ImprimeAlert Then
|
||||||
|
|
||||||
Dim ArchivoIngPyMe As New System.IO.FileInfo(String.Format("{0}Formatos/Factura.mrt", UsuarioActual.Empresa.Ruta))
|
If Me.GenerarPDFFactura Then
|
||||||
Dim ArchivoIng As New System.IO.FileInfo(String.Format("{0}Formatos/Factura.rdlc", UsuarioActual.Empresa.Ruta))
|
DescargarFactura(CveVenta, CveEmpresa)
|
||||||
Dim ArchivoRem As New System.IO.FileInfo(String.Format("{0}Formatos/Remision.rdlc", UsuarioActual.Empresa.Ruta))
|
|
||||||
Dim ArchivoEgs As New System.IO.FileInfo(String.Format("{0}Formatos/NotaCredito.rdlc", UsuarioActual.Empresa.Ruta))
|
Dim ArchivoIngPyMe As New System.IO.FileInfo(String.Format("{0}Formatos/Factura.mrt", UsuarioActual.Empresa.Ruta))
|
||||||
|
Dim ArchivoIng As New System.IO.FileInfo(String.Format("{0}Formatos/Factura.rdlc", UsuarioActual.Empresa.Ruta))
|
||||||
If ArchivoIng.Exists Or ArchivoRem.Exists Or ArchivoIngPyMe.Exists Or ArchivoEgs.Exists Then
|
Dim ArchivoRem As New System.IO.FileInfo(String.Format("{0}Formatos/Remision.rdlc", UsuarioActual.Empresa.Ruta))
|
||||||
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul><br/>", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1", CveVenta)))
|
Dim ArchivoEgs As New System.IO.FileInfo(String.Format("{0}Formatos/NotaCredito.rdlc", UsuarioActual.Empresa.Ruta))
|
||||||
Else
|
|
||||||
MensajeAlert.Append("Ocurrió un error al generar el PDF. Por favor vuelva a entrar a la factura para imprimir el PDF. ")
|
If ArchivoIng.Exists Or ArchivoRem.Exists Or ArchivoIngPyMe.Exists Or ArchivoEgs.Exists Then
|
||||||
|
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul><br/>", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1", CveVenta)))
|
||||||
|
Else
|
||||||
|
MensajeAlert.Append("Ocurrió un error al generar el PDF. Por favor vuelva a entrar a la factura para imprimir el PDF. ")
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'ERROR DE NO TIMBRADO
|
'ERROR DE NO TIMBRADO
|
||||||
@@ -1016,6 +1023,28 @@ Namespace Modelos
|
|||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Private Function DescargarFactura(CveVenta As Integer, CveEmpresa As Integer) As Byte()
|
||||||
|
Dim Url = New Uri(String.Format("{0}Compras/PopUpVerFactura.aspx?P={1}", ClsPaginas.UrlSitio, Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta))))
|
||||||
|
Dim File As Byte() = Nothing
|
||||||
|
Try
|
||||||
|
Using httpClient = New HttpClient()
|
||||||
|
httpClient.Timeout = New TimeSpan(0, 15, 0)
|
||||||
|
Using request = New HttpRequestMessage(HttpMethod.Get, Url)
|
||||||
|
request.Headers.Add("ADSToken", Encripta(String.Format("CVEEMPRESA={0}&TICKS={1}", CveEmpresa, DateTime.UtcNow.Ticks)))
|
||||||
|
Dim response = httpClient.SendAsync(request).Result
|
||||||
|
If response.StatusCode = Net.HttpStatusCode.OK Then
|
||||||
|
File = response.Content.ReadAsByteArrayAsync().Result
|
||||||
|
End If
|
||||||
|
End Using
|
||||||
|
End Using
|
||||||
|
Catch ex As Exception
|
||||||
|
File = Nothing
|
||||||
|
OnError("Ocurrió un error al descargar la factura", ex)
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return File
|
||||||
|
End Function
|
||||||
|
|
||||||
#Region " GUARDAR - VENTA, PREPOLIZAS, INV, NC , ESTIMACIONES, AC, NOTA DE CRÉDITO "
|
#Region " GUARDAR - VENTA, PREPOLIZAS, INV, NC , ESTIMACIONES, AC, NOTA DE CRÉDITO "
|
||||||
Private Function RegistrarNCAmortizacion(ObjVentas As ClsVentas, ObjConta As ClsContabilidad, ObjInventario As ClsInventarios, ObjContr As ClsContratos, ObjContPaq As ClsContPAQi, ByVal factura As Modelos.Factura, ObjBancos As ClsBancos, TmpDTconceptos As DataTable, ByRef ObjEventos As ClsOIEventos) As Boolean
|
Private Function RegistrarNCAmortizacion(ObjVentas As ClsVentas, ObjConta As ClsContabilidad, ObjInventario As ClsInventarios, ObjContr As ClsContratos, ObjContPaq As ClsContPAQi, ByVal factura As Modelos.Factura, ObjBancos As ClsBancos, TmpDTconceptos As DataTable, ByRef ObjEventos As ClsOIEventos) As Boolean
|
||||||
Dim ProcesoCorrecto As Boolean = True
|
Dim ProcesoCorrecto As Boolean = True
|
||||||
@@ -1784,8 +1813,6 @@ Namespace Modelos
|
|||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
Else
|
|
||||||
Resultado = False
|
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -8249,6 +8276,7 @@ Namespace Modelos
|
|||||||
|
|
||||||
Public Property CveContratoSecciones As String
|
Public Property CveContratoSecciones As String
|
||||||
Public Property CveEstatus As Integer
|
Public Property CveEstatus As Integer
|
||||||
|
Public Property GenerarPDFFactura As Boolean = False
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -205,6 +205,14 @@ Partial Class Inventarios_RecepcionUsados
|
|||||||
Set(value As Integer)
|
Set(value As Integer)
|
||||||
ViewState("CveRemisionRecibida") = value
|
ViewState("CveRemisionRecibida") = value
|
||||||
End Set
|
End Set
|
||||||
|
End Property
|
||||||
|
Private Property EsDistribuidor As Boolean
|
||||||
|
Get
|
||||||
|
Return CBool(IfNull(ViewState("EsDistribuidor"), False, CBool(ViewState("EsDistribuidor"))))
|
||||||
|
End Get
|
||||||
|
Set(value As Boolean)
|
||||||
|
ViewState("EsDistribuidor") = value
|
||||||
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
|
||||||
@@ -1048,19 +1056,21 @@ Partial Class Inventarios_RecepcionUsados
|
|||||||
|
|
||||||
|
|
||||||
If RBLOpcion.SelectedValue.ToEntero <> 3 Then
|
If RBLOpcion.SelectedValue.ToEntero <> 3 Then
|
||||||
|
If EsDistribuidor Then
|
||||||
If Not ObjAcum.DistribuidorMovtosAdd(DdlClientes.SelectedValue.ToEntero, Dr("Cantidad").ToString.ToEntero(), Dr("CveTamaño").ToString.ToEntero, CveConceptoUsados, -1, UsuarioActual.CveUsuario,
|
If Not ObjAcum.DistribuidorMovtosAdd(DdlClientes.SelectedValue.ToEntero, Dr("Cantidad").ToString.ToEntero(), Dr("CveTamaño").ToString.ToEntero, CveConceptoUsados, -1, UsuarioActual.CveUsuario,
|
||||||
UsuarioActual.CveEmpresa, 0, Dr("Observaciones").ToString, CveMovimiento:=CveMovimiento) Then
|
UsuarioActual.CveEmpresa, 0, Dr("Observaciones").ToString, CveMovimiento:=CveMovimiento) Then
|
||||||
|
|
||||||
|
|
||||||
'CveCliente As Integer, Cantidad As Integer, CveTamaño As Integer, CveConcepto As Integer, CveVenta As Integer, CveUsuario As Integer,
|
'CveCliente As Integer, Cantidad As Integer, CveTamaño As Integer, CveConcepto As Integer, CveVenta As Integer, CveUsuario As Integer,
|
||||||
'CveEmpresa As Integer, ImporteCompras As Decimal, Observaciones As String
|
'CveEmpresa As Integer, ImporteCompras As Decimal, Observaciones As String
|
||||||
|
|
||||||
Mensaje = "Error al guardar Movimientos de distribuidor"
|
Mensaje = "Error al guardar Movimientos de distribuidor"
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
Exit For
|
Exit For
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
@@ -1981,11 +1991,28 @@ Partial Class Inventarios_RecepcionUsados
|
|||||||
UpGenerales.Update()
|
UpGenerales.Update()
|
||||||
End Sub
|
End Sub
|
||||||
Protected Sub BtnRecibir_Click(sender As Object, e As EventArgs)
|
Protected Sub BtnRecibir_Click(sender As Object, e As EventArgs)
|
||||||
|
DtMovimientos.Rows.Clear()
|
||||||
|
|
||||||
Me.CveRemisionRecibida = -1
|
Me.CveRemisionRecibida = -1
|
||||||
Me.CveRemisionRecibida = CType(CType(sender, LinkButton).NamingContainer, GridViewRow).DataKey("CveVenta").ToEntero()
|
Me.CveRemisionRecibida = CType(CType(sender, LinkButton).NamingContainer, GridViewRow).DataKey("CveVenta").ToEntero()
|
||||||
|
|
||||||
|
|
||||||
Dim DtUsados As DataTable = Nothing
|
Dim DtUsados As DataTable = Nothing
|
||||||
|
Dim CveCliente As Integer = -1
|
||||||
|
|
||||||
Dim ObjVentas As New ClsVentas
|
Dim ObjVentas As New ClsVentas
|
||||||
|
If ObjVentas.GetVenta(CveRemisionRecibida, UsuarioActual.CveEmpresa) AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
|
||||||
|
EsDistribuidor = CBool(ObjVentas.DtResultados.Rows(0)("EsDistribuidor").ToString())
|
||||||
|
CveCliente = ObjVentas.DtResultados.Rows(0)("CveCliente").ToString().ToEntero()
|
||||||
|
End If
|
||||||
|
|
||||||
|
If EsDistribuidor Then
|
||||||
|
DivCliente.Visible = True
|
||||||
|
Else
|
||||||
|
DivCliente.Visible = False
|
||||||
|
End If
|
||||||
|
DdlClientes.SelectedValueExist(CveCliente)
|
||||||
|
|
||||||
If ObjVentas.GetVentasUsadosDetalle(CveRemisionRecibida) Then
|
If ObjVentas.GetVentasUsadosDetalle(CveRemisionRecibida) Then
|
||||||
DtUsados = ObjVentas.DtResultados.Copy()
|
DtUsados = ObjVentas.DtResultados.Copy()
|
||||||
End If
|
End If
|
||||||
@@ -2004,11 +2031,11 @@ Partial Class Inventarios_RecepcionUsados
|
|||||||
Dim Cantidad As Double = RowUsado("Cantidad").ToString().ToEntero()
|
Dim Cantidad As Double = RowUsado("Cantidad").ToString().ToEntero()
|
||||||
Dim PU As Double = RowUsado("PU").ToString().ToDouble()
|
Dim PU As Double = RowUsado("PU").ToString().ToDouble()
|
||||||
|
|
||||||
AddNew(CvePS, PS, CveUM, UM, Cantidad, PU,
|
AddNew(CvePS, PS, CveUM, UM, Cantidad, PU, "", "-1", "-1", "-1", "", "", "", DdlAlmacen.SelectedValue.ToEntero, DdlAlmacen.SelectedItem.Text, "", CveTamaño)
|
||||||
"", "-1", "-1", "-1", "", "", "", DdlAlmacen.SelectedValue.ToEntero, DdlAlmacen.SelectedItem.Text, "", CveTamaño)
|
|
||||||
|
|
||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
UpGenerales.Update()
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -202,7 +202,7 @@
|
|||||||
<div class="caption font-green">
|
<div class="caption font-green">
|
||||||
|
|
||||||
<i class="icon-pin font-green"></i>
|
<i class="icon-pin font-green"></i>
|
||||||
<span class="caption-subject bold uppercase"><a id="HlCliente" href="javascript:void(0);" runat="server" class="Texto" onclick="javascript:AbrirVentana('/Ventas/PopUpBuscarClientes.aspx?Opt=Fact&TipoCliente=2', 800, 547, 'N', 'PopUpBuscar')">Cliente: </a></span>
|
<span class="caption-subject bold uppercase"><a id="HlCliente" href="javascript:void(0);" runat="server" class="Texto" onclick="javascript:AbrirVentana('/Ventas/PopUpBuscarClientes.aspx?Opt=Fact&TipoCliente=-1', 800, 547, 'N', 'PopUpBuscar')">Cliente: </a></span>
|
||||||
<asp:LinkButton ID="LnkAgregarCliente" runat="server" AlternateText="Agregar Cliente" Text="<i class='fa fa-plus-square'></i>" />
|
<asp:LinkButton ID="LnkAgregarCliente" runat="server" AlternateText="Agregar Cliente" Text="<i class='fa fa-plus-square'></i>" />
|
||||||
<asp:TextBox ID="TxtCodigo" runat="server" AutoPostBack="true" BorderStyle="None" Width="65px"></asp:TextBox>
|
<asp:TextBox ID="TxtCodigo" runat="server" AutoPostBack="true" BorderStyle="None" Width="65px"></asp:TextBox>
|
||||||
<asp:HiddenField ID="HdnCveCliente" runat="server" ClientIDMode="Static" Value="-1" />
|
<asp:HiddenField ID="HdnCveCliente" runat="server" ClientIDMode="Static" Value="-1" />
|
||||||
@@ -337,9 +337,7 @@
|
|||||||
<asp:DropDownList CssClass="form-control input-sm" ID="DdlTipoComprobante" DataValueField="CveTipoDocumento" DataTextField="TipoDocumento" runat="server" AppendDataBoundItems="true" AutoPostBack="true" Width="100px">
|
<asp:DropDownList CssClass="form-control input-sm" ID="DdlTipoComprobante" DataValueField="CveTipoDocumento" DataTextField="TipoDocumento" runat="server" AppendDataBoundItems="true" AutoPostBack="true" Width="100px">
|
||||||
<asp:ListItem Value="Ing" Text="Ingresos" Selected="True"></asp:ListItem>
|
<asp:ListItem Value="Ing" Text="Ingresos" Selected="True"></asp:ListItem>
|
||||||
<asp:ListItem Value="Ant" Text="Anticipos"></asp:ListItem>
|
<asp:ListItem Value="Ant" Text="Anticipos"></asp:ListItem>
|
||||||
<asp:ListItem Value="Rem" Text="Remision"></asp:ListItem>
|
|
||||||
</asp:DropDownList>
|
</asp:DropDownList>
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
<%--<td id="TdReferencia" runat="server" style="display: none;"> Ref: <asp:TextBox ID="TxtDocto" runat="server" ToolTip="Referencia (Número de factura original)" Width="40px"></asp:TextBox></td>--%>
|
<%--<td id="TdReferencia" runat="server" style="display: none;"> Ref: <asp:TextBox ID="TxtDocto" runat="server" ToolTip="Referencia (Número de factura original)" Width="40px"></asp:TextBox></td>--%>
|
||||||
<td runat="server" id="TdOrdenPago" visible="false">
|
<td runat="server" id="TdOrdenPago" visible="false">
|
||||||
|
|||||||
@@ -1161,6 +1161,10 @@ Partial Class PV
|
|||||||
BtnEmitirImprimir.Attributes.Add("data-html", "true")
|
BtnEmitirImprimir.Attributes.Add("data-html", "true")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(569) = "1" Then
|
||||||
|
DdlTipoComprobante.Items.Add(New ListItem("Remisión", "Rem"))
|
||||||
|
DdlTipoComprobante.SelectedValueExist("Rem")
|
||||||
|
End If
|
||||||
|
|
||||||
'Le quitamos el tamaño extra
|
'Le quitamos el tamaño extra
|
||||||
'RegistraScript("window.onload = function AjustarVentana() { $('.page-content').css('min-height','100%'); }")
|
'RegistraScript("window.onload = function AjustarVentana() { $('.page-content').css('min-height','100%'); }")
|
||||||
@@ -1600,6 +1604,7 @@ Partial Class PV
|
|||||||
ViewState("CliNoInt") = ObjCliente.NoInt
|
ViewState("CliNoInt") = ObjCliente.NoInt
|
||||||
ViewState("CliLocalidad") = If(ObjCliente.Localidad.Trim.Length = 0, ObjCliente.Ciudad.Trim, ObjCliente.Localidad.Trim)
|
ViewState("CliLocalidad") = If(ObjCliente.Localidad.Trim.Length = 0, ObjCliente.Ciudad.Trim, ObjCliente.Localidad.Trim)
|
||||||
ViewState("CliPais") = ObjCliente.Pais
|
ViewState("CliPais") = ObjCliente.Pais
|
||||||
|
|
||||||
'ViewState("NumCtaPago") = ObjCliente.NumCtaPago
|
'ViewState("NumCtaPago") = ObjCliente.NumCtaPago
|
||||||
EnviarCorreoCliente = ObjCliente.EnviarFactura
|
EnviarCorreoCliente = ObjCliente.EnviarFactura
|
||||||
ChkEnviarFactura.Visible = True
|
ChkEnviarFactura.Visible = True
|
||||||
@@ -1621,8 +1626,8 @@ Partial Class PV
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If CveVenta <= 0 Then
|
If CveVenta <= 0 Then
|
||||||
DdlMetodoPago.SelectedValue = ObjCliente.CveMetodoPago.ToString
|
DdlUsoCFDI.SelectedValueExist(ObjCliente.CveUsoCFDI.ToString)
|
||||||
DdlUsoCFDI.SelectedValueExist(ObjCliente.CveUsoCFDI)
|
DdlMetodoPago.SelectedValueExist(ObjCliente.CveMetodoPago.ToString)
|
||||||
End If
|
End If
|
||||||
TxtFechaPago.Text = (Now.AddDays(ObjCliente.PlazoCobranza)).ToShortDateString
|
TxtFechaPago.Text = (Now.AddDays(ObjCliente.PlazoCobranza)).ToShortDateString
|
||||||
|
|
||||||
@@ -2069,14 +2074,14 @@ Partial Class PV
|
|||||||
e.Row.FCCheckBox("cbInv").Enabled = True
|
e.Row.FCCheckBox("cbInv").Enabled = True
|
||||||
|
|
||||||
'SI ES REMISION O VENTA DEBE SALIR DE ALMACEN
|
'SI ES REMISION O VENTA DEBE SALIR DE ALMACEN
|
||||||
If UsuarioActual.TienePermisoProceso(157) AndAlso e.Row.DBCampo("CvePS").ToEntero > 0 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ing") AndAlso UsuarioActual.CveEmpresa <> 72 Then
|
'If UsuarioActual.TienePermisoProceso(157) AndAlso e.Row.DBCampo("CvePS").ToEntero > 0 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ing") AndAlso UsuarioActual.CveEmpresa <> 72 Then
|
||||||
e.Row.FCCheckBox("cbInv").Checked = True
|
' e.Row.FCCheckBox("cbInv").Checked = True
|
||||||
e.Row.FCCheckBox("cbInv").Enabled = False
|
' e.Row.FCCheckBox("cbInv").Enabled = False
|
||||||
End If
|
'End If
|
||||||
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(531).ToString = "1" Then
|
'If UsuarioActual.Empresa.Funcionalidad(531).ToString = "1" Then
|
||||||
e.Row.FCCheckBox("cbInv").Checked = True
|
' e.Row.FCCheckBox("cbInv").Checked = True
|
||||||
End If
|
'End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -2485,24 +2490,31 @@ Partial Class PV
|
|||||||
ObjFactura.CveAlmacenRecepcionUsados = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros($"CveTipoAlmacen = {CveTipoAlmacen} AND CveSubProyecto= {DdlSubProyectoDatos.SelectedValue}").Rows(0)("CveAlmacen").ToString.ToEntero
|
ObjFactura.CveAlmacenRecepcionUsados = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros($"CveTipoAlmacen = {CveTipoAlmacen} AND CveSubProyecto= {DdlSubProyectoDatos.SelectedValue}").Rows(0)("CveAlmacen").ToString.ToEntero
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If Not ddlAlmacen.SelectedValue.ToEntero > 0 AndAlso ddlAlmacen.Items.Count > 1 AndAlso UsuarioActual.Empresa.Funcionalidad(531).ToString = "1" Then
|
'If Not ddlAlmacen.SelectedValue.ToEntero > 0 AndAlso ddlAlmacen.Items.Count > 1 AndAlso UsuarioActual.Empresa.Funcionalidad(531).ToString = "1" Then
|
||||||
ddlAlmacen.SelectedIndex = 1
|
' ddlAlmacen.SelectedIndex = 1
|
||||||
|
'End If
|
||||||
|
|
||||||
|
If ddlAlmacen.SelectedValue.ToEntero > 0 Then
|
||||||
|
ObjFactura.CveAlmacen = ddlAlmacen.SelectedValue.ToEntero
|
||||||
|
|
||||||
|
If Not DtInv.Columns.Contains("Seleccionado") Then
|
||||||
|
DtInv.Columns.Add("Seleccionado", GetType(Integer))
|
||||||
|
End If
|
||||||
|
|
||||||
|
For Each Gvr As GridViewRow In GvInv.Rows
|
||||||
|
Dim Dr As DataRow = DtInv.Select($"CvePS={Gvr.DataKey("CvePS")}")(0)
|
||||||
|
If Gvr.FCCheckBox("cbInv").Checked AndAlso ddlAlmacen.SelectedValue.ToEntero > 0 Then
|
||||||
|
Dr("Seleccionado") = 1
|
||||||
|
Else
|
||||||
|
Dr("Seleccionado") = 0
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
|
DtInv.AcceptChanges()
|
||||||
|
|
||||||
|
ObjFactura.DtInventario = DtInv.FiltraParametros("Seleccionado = 1")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'ObjFactura.CveAlmacen = ddlAlmacen.SelectedValue.ToEntero
|
|
||||||
|
|
||||||
DtInv.Columns.Add("Seleccionado", GetType(Integer))
|
|
||||||
For Each Gvr As GridViewRow In GvInv.Rows
|
|
||||||
Dim Dr As DataRow = DtInv.Select($"CvePS={Gvr.DataKey("CvePS")}")(0)
|
|
||||||
If Gvr.FCCheckBox("cbInv").Checked AndAlso ddlAlmacen.SelectedValue.ToEntero > 0 Then
|
|
||||||
Dr("Seleccionado") = 1
|
|
||||||
Else
|
|
||||||
Dr("Seleccionado") = 0
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
DtInv.AcceptChanges()
|
|
||||||
|
|
||||||
'ObjFactura.DtInventario = DtInv.FiltraParametros("Seleccionado = 1")
|
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -3384,7 +3396,7 @@ Partial Class PV
|
|||||||
|
|
||||||
|
|
||||||
If CveCliente <= 0 Then
|
If CveCliente <= 0 Then
|
||||||
Alert("Es necesario seleccionar el cliente al cual se le va a facturar.", TipoMensaje.MsgAdvertencia, "AbrirVentana('/Ventas/PopUpBuscarClientes.aspx?Opt=Fact&TipoCliente=2', 800, 547, 'N', 'PopUpBuscar')")
|
Alert("Es necesario seleccionar el cliente al cual se le va a facturar.", TipoMensaje.MsgAdvertencia, "AbrirVentana('/Ventas/PopUpBuscarClientes.aspx?Opt=Fact&TipoCliente=-1', 800, 547, 'N', 'PopUpBuscar')")
|
||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -3532,7 +3544,7 @@ Partial Class PV
|
|||||||
|
|
||||||
End Function
|
End Function
|
||||||
Protected Sub LbAgregar_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LbAgregar.Click
|
Protected Sub LbAgregar_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LbAgregar.Click
|
||||||
If Not CveCliente > 0 Then RegistraScript("javascript:AbrirVentana('/Ventas/PopUpBuscarClientes.aspx?Opt=Fact&TipoCliente=2', 800, 547, 'N', 'PopUpBuscar')") : Exit Sub
|
If Not CveCliente > 0 Then RegistraScript("javascript:AbrirVentana('/Ventas/PopUpBuscarClientes.aspx?Opt=Fact&TipoCliente=-1', 800, 547, 'N', 'PopUpBuscar')") : Exit Sub
|
||||||
CargaAgregar()
|
CargaAgregar()
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub CargaAgregar()
|
Private Sub CargaAgregar()
|
||||||
@@ -4552,7 +4564,7 @@ Partial Class PV
|
|||||||
|
|
||||||
Dim ObjCliente As New ClsClientes
|
Dim ObjCliente As New ClsClientes
|
||||||
|
|
||||||
If ObjCliente.AgregarClienteNoFrecuente(TxtNombreCliente.Text.Trim, TxtDireccionCliente.Text.Trim, TxtNumExtCliente.Text.Trim, TxtNumIntCliente.Text.Trim, TxtColoniaCliente.Text.Trim, TxtLocalidadCliente.Text.Trim, TxtCiudadCliente.Text.Trim, TxtEstadoCliente.Text.Trim, TxtPaisCliente.Text.Trim, TxtRFCCliente.Text.Trim, TxtCPCliente.Text.Trim, TxtTelefonoCliente.Text.Trim, TxtCorreoCliente.Text.Trim, DdlSubProyectoDatos.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "", CvePreioLista) Then
|
If ObjCliente.AgregarClienteNoFrecuente(TxtNombreCliente.Text.Trim, TxtDireccionCliente.Text.Trim, TxtNumExtCliente.Text.Trim, TxtNumIntCliente.Text.Trim, TxtColoniaCliente.Text.Trim, TxtLocalidadCliente.Text.Trim, TxtCiudadCliente.Text.Trim, TxtEstadoCliente.Text.Trim, TxtPaisCliente.Text.Trim, TxtRFCCliente.Text.Trim, TxtCPCliente.Text.Trim, TxtTelefonoCliente.Text.Trim, TxtCorreoCliente.Text.Trim, DdlSubProyectoDatos.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "") Then
|
||||||
If ObjCliente.DtResultados.Rows.Count > 0 Then
|
If ObjCliente.DtResultados.Rows.Count > 0 Then
|
||||||
RegistraScript("hideDivEC();")
|
RegistraScript("hideDivEC();")
|
||||||
ViewState("CveCliente") = ObjCliente.DtResultados(0)("CveCliente").ToString.ToEntero
|
ViewState("CveCliente") = ObjCliente.DtResultados(0)("CveCliente").ToString.ToEntero
|
||||||
@@ -5152,6 +5164,14 @@ Partial Class PV
|
|||||||
|
|
||||||
Protected Sub ChkAjuste_CheckedChanged(sender As Object, e As EventArgs)
|
Protected Sub ChkAjuste_CheckedChanged(sender As Object, e As EventArgs)
|
||||||
If ChkAjuste.Checked Then
|
If ChkAjuste.Checked Then
|
||||||
|
|
||||||
|
For Each Gvr As GridViewRow In GvRecepcionUsados.Rows
|
||||||
|
If Gvr.RowType = DataControlRowType.DataRow Then
|
||||||
|
Gvr.FCTextBox("TxtCantidad").Text = ""
|
||||||
|
Gvr.FCTextBox("TxtCantidad").Enabled = False
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
DivAjuste.Visible = True
|
DivAjuste.Visible = True
|
||||||
TxtCantidad.Text = "1"
|
TxtCantidad.Text = "1"
|
||||||
TxtCantidad.Enabled = False
|
TxtCantidad.Enabled = False
|
||||||
@@ -5164,6 +5184,13 @@ Partial Class PV
|
|||||||
TxtPrecio.Attributes.Add("onKeyUp", $"CambiaAjuste(this,{TxtPUFactura.ClientID});")
|
TxtPrecio.Attributes.Add("onKeyUp", $"CambiaAjuste(this,{TxtPUFactura.ClientID});")
|
||||||
TxtPUFactura.Text = TxtPrecio.Text
|
TxtPUFactura.Text = TxtPrecio.Text
|
||||||
Else
|
Else
|
||||||
|
For Each Gvr As GridViewRow In GvRecepcionUsados.Rows
|
||||||
|
If Gvr.RowType = DataControlRowType.DataRow Then
|
||||||
|
Gvr.FCTextBox("TxtCantidad").Text = ""
|
||||||
|
Gvr.FCTextBox("TxtCantidad").Enabled = True
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
DivAjuste.Visible = False
|
DivAjuste.Visible = False
|
||||||
TxtCantidad.Enabled = True
|
TxtCantidad.Enabled = True
|
||||||
TxtPrecio.Attributes.Add("onKeyUp ", "Recalcula();")
|
TxtPrecio.Attributes.Add("onKeyUp ", "Recalcula();")
|
||||||
|
|||||||
Reference in New Issue
Block a user