Correciones en punto de venta
This commit is contained in:
@@ -202,7 +202,7 @@
|
||||
<div class="caption font-green">
|
||||
|
||||
<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:TextBox ID="TxtCodigo" runat="server" AutoPostBack="true" BorderStyle="None" Width="65px"></asp:TextBox>
|
||||
<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:ListItem Value="Ing" Text="Ingresos" Selected="True"></asp:ListItem>
|
||||
<asp:ListItem Value="Ant" Text="Anticipos"></asp:ListItem>
|
||||
<asp:ListItem Value="Rem" Text="Remision"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
|
||||
</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">
|
||||
|
||||
@@ -1161,6 +1161,10 @@ Partial Class PV
|
||||
BtnEmitirImprimir.Attributes.Add("data-html", "true")
|
||||
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
|
||||
'RegistraScript("window.onload = function AjustarVentana() { $('.page-content').css('min-height','100%'); }")
|
||||
@@ -1600,6 +1604,7 @@ Partial Class PV
|
||||
ViewState("CliNoInt") = ObjCliente.NoInt
|
||||
ViewState("CliLocalidad") = If(ObjCliente.Localidad.Trim.Length = 0, ObjCliente.Ciudad.Trim, ObjCliente.Localidad.Trim)
|
||||
ViewState("CliPais") = ObjCliente.Pais
|
||||
|
||||
'ViewState("NumCtaPago") = ObjCliente.NumCtaPago
|
||||
EnviarCorreoCliente = ObjCliente.EnviarFactura
|
||||
ChkEnviarFactura.Visible = True
|
||||
@@ -1621,8 +1626,8 @@ Partial Class PV
|
||||
End If
|
||||
|
||||
If CveVenta <= 0 Then
|
||||
DdlMetodoPago.SelectedValue = ObjCliente.CveMetodoPago.ToString
|
||||
DdlUsoCFDI.SelectedValueExist(ObjCliente.CveUsoCFDI)
|
||||
DdlUsoCFDI.SelectedValueExist(ObjCliente.CveUsoCFDI.ToString)
|
||||
DdlMetodoPago.SelectedValueExist(ObjCliente.CveMetodoPago.ToString)
|
||||
End If
|
||||
TxtFechaPago.Text = (Now.AddDays(ObjCliente.PlazoCobranza)).ToShortDateString
|
||||
|
||||
@@ -2069,14 +2074,14 @@ Partial Class PV
|
||||
e.Row.FCCheckBox("cbInv").Enabled = True
|
||||
|
||||
'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
|
||||
e.Row.FCCheckBox("cbInv").Checked = True
|
||||
e.Row.FCCheckBox("cbInv").Enabled = False
|
||||
End If
|
||||
'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").Enabled = False
|
||||
'End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531).ToString = "1" Then
|
||||
e.Row.FCCheckBox("cbInv").Checked = True
|
||||
End If
|
||||
'If UsuarioActual.Empresa.Funcionalidad(531).ToString = "1" Then
|
||||
' e.Row.FCCheckBox("cbInv").Checked = True
|
||||
'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
|
||||
End If
|
||||
|
||||
If Not ddlAlmacen.SelectedValue.ToEntero > 0 AndAlso ddlAlmacen.Items.Count > 1 AndAlso UsuarioActual.Empresa.Funcionalidad(531).ToString = "1" Then
|
||||
ddlAlmacen.SelectedIndex = 1
|
||||
'If Not ddlAlmacen.SelectedValue.ToEntero > 0 AndAlso ddlAlmacen.Items.Count > 1 AndAlso UsuarioActual.Empresa.Funcionalidad(531).ToString = "1" Then
|
||||
' 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
|
||||
|
||||
'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
|
||||
|
||||
@@ -3384,7 +3396,7 @@ Partial Class PV
|
||||
|
||||
|
||||
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
|
||||
End If
|
||||
|
||||
@@ -3532,7 +3544,7 @@ Partial Class PV
|
||||
|
||||
End Function
|
||||
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()
|
||||
End Sub
|
||||
Private Sub CargaAgregar()
|
||||
@@ -4552,7 +4564,7 @@ Partial Class PV
|
||||
|
||||
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
|
||||
RegistraScript("hideDivEC();")
|
||||
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)
|
||||
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
|
||||
TxtCantidad.Text = "1"
|
||||
TxtCantidad.Enabled = False
|
||||
@@ -5164,6 +5184,13 @@ Partial Class PV
|
||||
TxtPrecio.Attributes.Add("onKeyUp", $"CambiaAjuste(this,{TxtPUFactura.ClientID});")
|
||||
TxtPUFactura.Text = TxtPrecio.Text
|
||||
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
|
||||
TxtCantidad.Enabled = True
|
||||
TxtPrecio.Attributes.Add("onKeyUp ", "Recalcula();")
|
||||
|
||||
Reference in New Issue
Block a user