Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -2010,7 +2010,7 @@ Public Class ClsInventarios
|
|||||||
Optional Serie As String = "-1", Optional Lote As String = "-1", Optional FechaCaducidad As Date = MinFecha,
|
Optional Serie As String = "-1", Optional Lote As String = "-1", Optional FechaCaducidad As Date = MinFecha,
|
||||||
Optional CveVendedor As Integer = -1, Optional CveCliente As Integer = -1,
|
Optional CveVendedor As Integer = -1, Optional CveCliente As Integer = -1,
|
||||||
Optional ExcluyeAdelantado As Integer = -1, Optional PendientePorSurtir As Integer = -1,
|
Optional ExcluyeAdelantado As Integer = -1, Optional PendientePorSurtir As Integer = -1,
|
||||||
Optional ExcluyeApartados As Integer = 1, Optional RestringirAlmacenes As Integer = -1, Optional ExcluyeTransitorios As Integer = -1) As Decimal
|
Optional ExcluyeApartados As Integer = 1, Optional RestringirAlmacenes As Integer = -1, Optional ExcluyeTransitorios As Integer = -1, Optional BuscarEnTabla As Boolean = False) As Decimal
|
||||||
Dim Retorno As Decimal = -1
|
Dim Retorno As Decimal = -1
|
||||||
|
|
||||||
If FechaMovto = "-1" Then
|
If FechaMovto = "-1" Then
|
||||||
@@ -2037,6 +2037,7 @@ Public Class ClsInventarios
|
|||||||
.Add("@ExcluyeApartados", SqlDbType.Int).Value = ExcluyeApartados
|
.Add("@ExcluyeApartados", SqlDbType.Int).Value = ExcluyeApartados
|
||||||
.Add("@ExcluyeTransitorios", SqlDbType.Int).Value = ExcluyeTransitorios
|
.Add("@ExcluyeTransitorios", SqlDbType.Int).Value = ExcluyeTransitorios
|
||||||
.Add("@RestringirAlmacenes", SqlDbType.Int).Value = RestringirAlmacenes
|
.Add("@RestringirAlmacenes", SqlDbType.Int).Value = RestringirAlmacenes
|
||||||
|
.Add("@BuscarEnTabla", SqlDbType.Bit).Value = BuscarEnTabla
|
||||||
|
|
||||||
.Add("@Existencia", SqlDbType.Money).Direction = ParameterDirection.Output
|
.Add("@Existencia", SqlDbType.Money).Direction = ParameterDirection.Output
|
||||||
.Add("@CvePSRetorno", SqlDbType.Int).Direction = ParameterDirection.Output
|
.Add("@CvePSRetorno", SqlDbType.Int).Direction = ParameterDirection.Output
|
||||||
|
|||||||
@@ -4119,7 +4119,7 @@
|
|||||||
<Paragraph>
|
<Paragraph>
|
||||||
<TextRuns>
|
<TextRuns>
|
||||||
<TextRun>
|
<TextRun>
|
||||||
<Value>Carta Porte 3.0</Value>
|
<Value>Carta Porte 2.0</Value>
|
||||||
<Style>
|
<Style>
|
||||||
<FontFamily>calibri</FontFamily>
|
<FontFamily>calibri</FontFamily>
|
||||||
<FontSize>7pt</FontSize>
|
<FontSize>7pt</FontSize>
|
||||||
|
|||||||
@@ -580,9 +580,9 @@
|
|||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
|
|
||||||
<%--8--%>
|
<%--8--%>
|
||||||
<asp:TemplateField HeaderText="Lote/caducidades" ItemStyle-HorizontalAlign="Left" Visible="false" ItemStyle-Width="150px">
|
<asp:TemplateField HeaderText="Lote/Caducidad" ItemStyle-HorizontalAlign="Left" Visible="false" ItemStyle-Width="270px">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:DropDownList ID="DdlCaducidadProducto" CssClass="select2me" Width="150px" runat="server" CausesValidation="true" AutoPostBack="true" OnSelectedIndexChanged="DdlCaducidadProducto_SelectedIndexChanged">
|
<asp:DropDownList ID="DdlCaducidadProducto" CssClass="select2me" Width="100%" runat="server" CausesValidation="true" AutoPostBack="true" OnSelectedIndexChanged="DdlCaducidadProducto_SelectedIndexChanged">
|
||||||
<asp:ListItem Selected="True" Text="-" Value="|"></asp:ListItem>
|
<asp:ListItem Selected="True" Text="-" Value="|"></asp:ListItem>
|
||||||
</asp:DropDownList>
|
</asp:DropDownList>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
|
|||||||
@@ -1005,8 +1005,10 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
If AplicaLote Then GvDatos.Columns(9).Visible = True
|
If AplicaLote Then GvDatos.Columns(9).Visible = True
|
||||||
If AplicaCaducidad Then GvDatos.Columns(10).Visible = True
|
If AplicaCaducidad Then GvDatos.Columns(10).Visible = True
|
||||||
|
|
||||||
If AplicaLote Or AplicaCaducidad Then
|
If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then
|
||||||
GvDatos.Columns(8).Visible = True
|
GvDatos.Columns(8).Visible = True
|
||||||
|
GvDatos.Columns(9).Visible = False
|
||||||
|
GvDatos.Columns(10).Visible = False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If Not String.IsNullOrWhiteSpace(UsuarioActual.Empresa.Funcionalidad(147)) Then
|
If Not String.IsNullOrWhiteSpace(UsuarioActual.Empresa.Funcionalidad(147)) Then
|
||||||
@@ -1252,7 +1254,7 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
If ObjInventarios.GetExistenciasCaducidad(CvePS, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, almacenes) Then
|
If ObjInventarios.GetExistenciasCaducidad(CvePS, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, almacenes) Then
|
||||||
|
|
||||||
For Each dr As DataRow In ObjInventarios.DtResultados.Rows
|
For Each dr As DataRow In ObjInventarios.DtResultados.Rows
|
||||||
DdlLoteFechaCaducidad.Items.Add(New ListItem($"Lote: {dr("Lote").ToString} - Caducidad: {dr("FechaCaducidad").ToString.ToDate.ToString("dd/MM/yyyy")}", $"{dr("Lote").ToString}|{dr("FechaCaducidad").ToString.ToDate.ToString("dd/MM/yyyy")}"))
|
DdlLoteFechaCaducidad.Items.Add(New ListItem($"Lote: {dr("Lote").ToString} - Cad: {dr("FechaCaducidad").ToString.ToDate.ToString("dd/MM/yyyy")}", $"{dr("Lote").ToString}|{dr("FechaCaducidad").ToString.ToDate.ToString("dd/MM/yyyy")}"))
|
||||||
Next
|
Next
|
||||||
|
|
||||||
End If
|
End If
|
||||||
@@ -2045,8 +2047,24 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
If gvr.FCCheckBox("cbInv").Checked AndAlso gvr.FCTextBox("TbCantidadF").Text.ToDecimal > 0 Then
|
If gvr.FCCheckBox("cbInv").Checked AndAlso gvr.FCTextBox("TbCantidadF").Text.ToDecimal > 0 Then
|
||||||
DtDatos.Rows(Index)("CantidadGV") = gvr.FCTextBox("TbCantidadF").Text.ToDecimal
|
DtDatos.Rows(Index)("CantidadGV") = gvr.FCTextBox("TbCantidadF").Text.ToDecimal
|
||||||
DtDatos.Rows(Index)("CveSeccion") = gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero()
|
DtDatos.Rows(Index)("CveSeccion") = gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero()
|
||||||
DtDatos.Rows(Index)("FechaCaducidad") = gvr.FCTextBox("TxtCaducidad").Text.ToDate
|
|
||||||
DtDatos.Rows(Index)("Lote") = gvr.FCTextBox("TxtLote").Text
|
If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then
|
||||||
|
'Esto es por que
|
||||||
|
Dim DdlCaducidadProducto As DropDownList = gvr.FCDropDownList("DdlCaducidadProducto")
|
||||||
|
Dim ArrayCaducidad As String() = DdlCaducidadProducto.SelectedValue.Split("|"c)
|
||||||
|
Dim Lote As String = ArrayCaducidad(0)
|
||||||
|
Dim FechaCaducidad As String = ArrayCaducidad(1)
|
||||||
|
|
||||||
|
DtDatos.Rows(Index)("FechaCaducidad") = FechaCaducidad.ToDate
|
||||||
|
DtDatos.Rows(Index)("Lote") = Lote
|
||||||
|
|
||||||
|
Else
|
||||||
|
DtDatos.Rows(Index)("FechaCaducidad") = gvr.FCTextBox("TxtCaducidad").Text.ToDate
|
||||||
|
DtDatos.Rows(Index)("Lote") = gvr.FCTextBox("TxtLote").Text
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
Index += 1
|
Index += 1
|
||||||
Next
|
Next
|
||||||
|
|||||||
@@ -85,10 +85,19 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<label class="col-md-1 ">Cliente:</label>
|
<%-- <label class="col-md-1 ">Cliente:</label>
|
||||||
<div class="col-md-1">
|
<div class="col-md-1">
|
||||||
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlClientes" Width="100%" data-metodo="getcliente" runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width: 100%;"></ADS:Dropdownlost>
|
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlClientes" Width="100%" data-metodo="getcliente" runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width: 100%;"></ADS:Dropdownlost>
|
||||||
</div>
|
</div>--%>
|
||||||
|
|
||||||
|
<label class="col-md-1 ">Hospital:</label>
|
||||||
|
<div class="col-md-1">
|
||||||
|
|
||||||
|
<asp:DropDownList ID="DdlClienteSucursal" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" DataTextField="Nombre" DataValueField="Clave" CausesValidation="true" Width="100%" >
|
||||||
|
</asp:DropDownList>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<label class="col-md-1 truncate">Vendedor:</label>
|
<label class="col-md-1 truncate">Vendedor:</label>
|
||||||
@@ -147,15 +156,7 @@
|
|||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
|
||||||
<label class="col-md-1 ">Hospital:</label>
|
|
||||||
<div class="col-md-1">
|
|
||||||
|
|
||||||
<asp:DropDownList ID="DdlClienteSucursal" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" DataTextField="Nombre" DataValueField="CveClienteSucursal" CausesValidation="true" Width="100%" >
|
|
||||||
</asp:DropDownList>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|||||||
@@ -51,14 +51,14 @@ Partial Class OS_RepOSMedicas
|
|||||||
|
|
||||||
'CargaClientes
|
'CargaClientes
|
||||||
Dim EsWS As Boolean = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False)
|
Dim EsWS As Boolean = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False)
|
||||||
If EsWS Then
|
'If EsWS Then
|
||||||
DdlClientes.setEsWebService(True)
|
' DdlClientes.setEsWebService(True)
|
||||||
Else
|
'Else
|
||||||
DdlClientes.setEsWebService(False)
|
' DdlClientes.setEsWebService(False)
|
||||||
DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1)
|
' DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1)
|
||||||
DdlClientes.DataBind()
|
' DdlClientes.DataBind()
|
||||||
DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
|
' DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||||
End If
|
'End If
|
||||||
|
|
||||||
'Vendedor
|
'Vendedor
|
||||||
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa, VendedorTipo:=-1).FiltraParametros("VendedorTipo in (1,4)") 'vendedores y vendedores de piso
|
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa, VendedorTipo:=-1).FiltraParametros("VendedorTipo in (1,4)") 'vendedores y vendedores de piso
|
||||||
@@ -139,12 +139,13 @@ Partial Class OS_RepOSMedicas
|
|||||||
Dim ObjOS As New ClsOS
|
Dim ObjOS As New ClsOS
|
||||||
Dim FechaI As Date = If(txtFechaI.Text.Trim = "", MinFecha, txtFechaI.Text.ToDate)
|
Dim FechaI As Date = If(txtFechaI.Text.Trim = "", MinFecha, txtFechaI.Text.ToDate)
|
||||||
Dim FechaF As Date = If(txtFechaF.Text.Trim = "", MaxFecha, txtFechaF.Text.ToDate)
|
Dim FechaF As Date = If(txtFechaF.Text.Trim = "", MaxFecha, txtFechaF.Text.ToDate)
|
||||||
Dim Cvecliente As Integer = If(DdlClientes.SelectedValue.ToEntero > 0, DdlClientes.SelectedValue.ToEntero, -1)
|
Dim Cvecliente As Integer = DdlClienteSucursalCliente()
|
||||||
|
Dim CveClienteSucursal As Integer = DdlClienteSucursalSucursal()
|
||||||
LnkPersonalizar.Visible = False
|
LnkPersonalizar.Visible = False
|
||||||
|
|
||||||
If ObjOS.GetRepOrdenesServicioMedicasRep(FechaI, FechaF, Cvecliente, DdlVendedor.SelectedValue.ToEntero, DdlEstatusOS.SelectedValue.ToEntero, DdlTecnico.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa,
|
If ObjOS.GetRepOrdenesServicioMedicasRep(FechaI, FechaF, Cvecliente, DdlVendedor.SelectedValue.ToEntero, DdlEstatusOS.SelectedValue.ToEntero, DdlTecnico.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa,
|
||||||
CveMedico:=DdlMedico.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero, CveEspecialidad:=DdlEspecialidad.SelectedValue.ToEntero,
|
CveMedico:=DdlMedico.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero, CveEspecialidad:=DdlEspecialidad.SelectedValue.ToEntero,
|
||||||
CveClienteSucursal:=DdlClienteSucursal.SelectedValue.ToEntero) Then
|
CveClienteSucursal:=CveClienteSucursal) Then
|
||||||
GvDatos.DataSource = ObjOS.DtResultados
|
GvDatos.DataSource = ObjOS.DtResultados
|
||||||
If ObjOS.DtResultados IsNot Nothing AndAlso ObjOS.DtResultados.Rows.Count > 0 Then
|
If ObjOS.DtResultados IsNot Nothing AndAlso ObjOS.DtResultados.Rows.Count > 0 Then
|
||||||
LnkPersonalizar.Visible = True
|
LnkPersonalizar.Visible = True
|
||||||
@@ -170,12 +171,12 @@ Partial Class OS_RepOSMedicas
|
|||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
|
||||||
Private Sub CargaClientes()
|
'Private Sub CargaClientes()
|
||||||
DdlClientes.ddl.Items.Clear()
|
' DdlClientes.ddl.Items.Clear()
|
||||||
DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1) '.FiltraParametros($"CveClienteClasificacion = {DdlClienteClasificacion.SelectedValue.ToEntero} OR {DdlClienteClasificacion.SelectedValue.ToEntero} = -1")
|
' DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1) '.FiltraParametros($"CveClienteClasificacion = {DdlClienteClasificacion.SelectedValue.ToEntero} OR {DdlClienteClasificacion.SelectedValue.ToEntero} = -1")
|
||||||
DdlClientes.DataBind()
|
' DdlClientes.DataBind()
|
||||||
DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
|
' DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||||
End Sub
|
'End Sub
|
||||||
|
|
||||||
Protected Sub DdlProyecto_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlProyecto.SelectedIndexChanged
|
Protected Sub DdlProyecto_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlProyecto.SelectedIndexChanged
|
||||||
CargarSubProyecto(DdlSubProyecto, DdlProyecto.SelectedValue)
|
CargarSubProyecto(DdlSubProyecto, DdlProyecto.SelectedValue)
|
||||||
@@ -218,19 +219,31 @@ Partial Class OS_RepOSMedicas
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Sub BtnPersonalizar_Click(sender As Object, e As System.EventArgs) Handles BtnPersonalizar.Click
|
Protected Sub BtnPersonalizar_Click(sender As Object, e As System.EventArgs) Handles BtnPersonalizar.Click
|
||||||
|
|
||||||
|
|
||||||
Personaliza()
|
Personaliza()
|
||||||
|
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub Personaliza()
|
Private Sub Personaliza()
|
||||||
|
|
||||||
GvDatos.Columns(13).Visible = ChkObservaciones.Checked
|
GvDatos.Columns(13).Visible = ChkObservaciones.Checked
|
||||||
|
|
||||||
CargaDatos()
|
CargaDatos()
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Function DdlClienteSucursalCliente() As Integer
|
||||||
|
If DdlClienteSucursal.SelectedValue = "-1" Then
|
||||||
|
Return -1
|
||||||
|
Else
|
||||||
|
Dim array As String() = DdlClienteSucursal.SelectedValue.Split("|"c)
|
||||||
|
Return If(array(0).ToEntero > 0, array(0).ToEntero, -1)
|
||||||
|
End If
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Private Function DdlClienteSucursalSucursal() As Integer
|
||||||
|
If DdlClienteSucursal.SelectedValue = "-1" Then
|
||||||
|
Return -1
|
||||||
|
Else
|
||||||
|
Dim array As String() = DdlClienteSucursal.SelectedValue.Split("|"c)
|
||||||
|
Return If(array(1).ToEntero > 0, array(1).ToEntero, -1)
|
||||||
|
End If
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -111,6 +111,8 @@
|
|||||||
<label class="col-md-1">Sucursal: </label>
|
<label class="col-md-1">Sucursal: </label>
|
||||||
<div class="col-md-2">
|
<div class="col-md-2">
|
||||||
<asp:DropDownList ID="DdlSubProyecto" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="ddlFiltros input-sm select2me Widthall" Style="width: 100%;" runat="server"></asp:DropDownList>
|
<asp:DropDownList ID="DdlSubProyecto" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="ddlFiltros input-sm select2me Widthall" Style="width: 100%;" runat="server"></asp:DropDownList>
|
||||||
|
<asp:RequiredFieldValidator ID="RFVSubProyecto" runat="server" InitialValue="-1" ControlToValidate="DdlSubProyecto" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Sucursal''</b> es necesario, por favor ingréselo." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="VCESubproyecto" runat="server" HighlightCssClass="vco" TargetControlID="RFVSubProyecto" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||||
</div>
|
</div>
|
||||||
<label class="col-md-1 truncate">Fecha Inicial:</label>
|
<label class="col-md-1 truncate">Fecha Inicial:</label>
|
||||||
<div class="col-md-1">
|
<div class="col-md-1">
|
||||||
@@ -185,7 +187,7 @@
|
|||||||
<asp:CheckBox runat="server" ID="chkSelectAll" CssClass="ChkAllClick" />
|
<asp:CheckBox runat="server" ID="chkSelectAll" CssClass="ChkAllClick" />
|
||||||
</HeaderTemplate>
|
</HeaderTemplate>
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:CheckBox runat="server" ID="chkDis" Visible="false" CssClass="ChkAllEvt" />
|
<asp:CheckBox runat="server" ID="chkDis" />
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
<asp:HyperLinkField HeaderText="Folio" ItemStyle-Width="100px" DataTextField="Folio" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" DataNavigateUrlFields="CveVenta" Target="_blank" />
|
<asp:HyperLinkField HeaderText="Folio" ItemStyle-Width="100px" DataTextField="Folio" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" DataNavigateUrlFields="CveVenta" Target="_blank" />
|
||||||
@@ -233,7 +235,7 @@
|
|||||||
<div class="col-md-9">
|
<div class="col-md-9">
|
||||||
<asp:DropDownList ID="DdlPeriodo" DataTextField="Descripcion" DataValueField="CveSATPeriodicidad" CssClass="ddlFiltros input-sm select2me Widthall" Style="width: 100%;" runat="server" AutoPostBack="true" OnSelectedIndexChanged="DdlPeriodo_SelectedIndexChanged"></asp:DropDownList>
|
<asp:DropDownList ID="DdlPeriodo" DataTextField="Descripcion" DataValueField="CveSATPeriodicidad" CssClass="ddlFiltros input-sm select2me Widthall" Style="width: 100%;" runat="server" AutoPostBack="true" OnSelectedIndexChanged="DdlPeriodo_SelectedIndexChanged"></asp:DropDownList>
|
||||||
<asp:RequiredFieldValidator ID="RFVPeriodo" runat="server" InitialValue="-1" ControlToValidate="DdlPeriodo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Periodo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpEmitir"></asp:RequiredFieldValidator>
|
<asp:RequiredFieldValidator ID="RFVPeriodo" runat="server" InitialValue="-1" ControlToValidate="DdlPeriodo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Periodo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpEmitir"></asp:RequiredFieldValidator>
|
||||||
<ajax:ValidatorCalloutExtender ID="VCEPerido" runat="server" HighlightCssClass="vco" TargetControlID="RFVPeriodo" Width="350px"></ajax:ValidatorCalloutExtender>
|
<ajax:ValidatorCalloutExtender ID="VCEPerido" runat="server" HighlightCssClass="vco" TargetControlID="RFVPeriodo" Width="150px" PopupPosition="BottomRight"></ajax:ValidatorCalloutExtender>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
@@ -242,7 +244,7 @@
|
|||||||
<div class="col-md-9">
|
<div class="col-md-9">
|
||||||
<asp:DropDownList ID="DdlMes" DataTextField="Descripcion" DataValueField="CveSATMes" CssClass="ddlFiltros input-sm select2me Widthall" Style="width: 100%;" runat="server"></asp:DropDownList>
|
<asp:DropDownList ID="DdlMes" DataTextField="Descripcion" DataValueField="CveSATMes" CssClass="ddlFiltros input-sm select2me Widthall" Style="width: 100%;" runat="server"></asp:DropDownList>
|
||||||
<asp:RequiredFieldValidator ID="RFVMes" runat="server" InitialValue="-1" ControlToValidate="DdlMes" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Mes''</b> es necesario, por favor ingréselo." ValidationGroup="GrpEmitir"></asp:RequiredFieldValidator>
|
<asp:RequiredFieldValidator ID="RFVMes" runat="server" InitialValue="-1" ControlToValidate="DdlMes" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Mes''</b> es necesario, por favor ingréselo." ValidationGroup="GrpEmitir"></asp:RequiredFieldValidator>
|
||||||
<ajax:ValidatorCalloutExtender ID="VCEMes" runat="server" HighlightCssClass="vco" TargetControlID="RFVMes" Width="350px"></ajax:ValidatorCalloutExtender>
|
<ajax:ValidatorCalloutExtender ID="VCEMes" runat="server" HighlightCssClass="vco" TargetControlID="RFVMes" Width="150px" PopupPosition="BottomRight"></ajax:ValidatorCalloutExtender>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
@@ -252,7 +254,7 @@
|
|||||||
<asp:DropDownList ID="DdlAnio" CssClass="ddlFiltros input-sm select2me Widthall" Style="width: 100%;" runat="server">
|
<asp:DropDownList ID="DdlAnio" CssClass="ddlFiltros input-sm select2me Widthall" Style="width: 100%;" runat="server">
|
||||||
</asp:DropDownList>
|
</asp:DropDownList>
|
||||||
<asp:RequiredFieldValidator ID="RFVAnio" runat="server" InitialValue="-1" ControlToValidate="DdlAnio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Mes''</b> es necesario, por favor ingréselo." ValidationGroup="GrpEmitir"></asp:RequiredFieldValidator>
|
<asp:RequiredFieldValidator ID="RFVAnio" runat="server" InitialValue="-1" ControlToValidate="DdlAnio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Mes''</b> es necesario, por favor ingréselo." ValidationGroup="GrpEmitir"></asp:RequiredFieldValidator>
|
||||||
<ajax:ValidatorCalloutExtender ID="VCEAnio" runat="server" HighlightCssClass="vco" TargetControlID="RFVAnio" Width="350px"></ajax:ValidatorCalloutExtender>
|
<ajax:ValidatorCalloutExtender ID="VCEAnio" runat="server" HighlightCssClass="vco" TargetControlID="RFVAnio" Width="150px" PopupPosition="BottomRight"></ajax:ValidatorCalloutExtender>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
|
|||||||
@@ -49,6 +49,10 @@ Partial Class Ventas_FacturacionGlobal
|
|||||||
|
|
||||||
DdlAnio.Items.Add(New ListItem(Anio.ToString(), Anio.ToString()))
|
DdlAnio.Items.Add(New ListItem(Anio.ToString(), Anio.ToString()))
|
||||||
DdlAnio.Items.Add(New ListItem(AnioAnterior.ToString(), AnioAnterior.ToString()))
|
DdlAnio.Items.Add(New ListItem(AnioAnterior.ToString(), AnioAnterior.ToString()))
|
||||||
|
|
||||||
|
txtFechaI.Text = Now.AddDays(-1).ToString("dd/MM/yyyy")
|
||||||
|
txtFechaF.Text = Now.ToString("dd/MM/yyyy")
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Sub DdlPeriodo_SelectedIndexChanged(sender As Object, e As EventArgs)
|
Protected Sub DdlPeriodo_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||||
@@ -58,6 +62,7 @@ Partial Class Ventas_FacturacionGlobal
|
|||||||
DdlMes.DataSource = GlobalDTGralSATMeses().FiltraParametros("ISNULL(CveSATPeriodicidad,0) <> 5")
|
DdlMes.DataSource = GlobalDTGralSATMeses().FiltraParametros("ISNULL(CveSATPeriodicidad,0) <> 5")
|
||||||
End If
|
End If
|
||||||
DdlMes.DataBind()
|
DdlMes.DataBind()
|
||||||
|
DdlMes.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||||
|
|
||||||
UPFiltros.Update()
|
UPFiltros.Update()
|
||||||
End Sub
|
End Sub
|
||||||
@@ -128,8 +133,15 @@ Partial Class Ventas_FacturacionGlobal
|
|||||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||||
If e.Row.DBCampo("CveVenta").ToEntero() > 0 Then
|
If e.Row.DBCampo("CveVenta").ToEntero() > 0 Then
|
||||||
e.Row.FCCheckBox("chkDis").Visible = True
|
If e.Row.DBCampo("Saldo").ToDecimal() > 0 Then
|
||||||
|
e.Row.FCCheckBox("chkDis").Enabled = False
|
||||||
|
e.Row.FCCheckBox("chkDis").ToolTip = "No se puede seleccionar esta remisión porque no ha sido pagada"
|
||||||
|
Else
|
||||||
|
e.Row.FCCheckBox("chkDis").Enabled = True
|
||||||
|
e.Row.FCCheckBox("chkDis").CssClass = "ChkAllEvt"
|
||||||
|
End If
|
||||||
Else
|
Else
|
||||||
|
e.Row.FCCheckBox("chkDis").Visible = False
|
||||||
e.Row.CssClass = "Totales"
|
e.Row.CssClass = "Totales"
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -137,7 +149,7 @@ Partial Class Ventas_FacturacionGlobal
|
|||||||
|
|
||||||
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs)
|
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs)
|
||||||
Dim CveCliente As Integer = UsuarioActual.Empresa.Funcionalidad(714).ToEntero()
|
Dim CveCliente As Integer = UsuarioActual.Empresa.Funcionalidad(714).ToEntero()
|
||||||
Dim CveMoneda As Integer = -1
|
Dim CveMoneda As Integer = 1
|
||||||
|
|
||||||
Dim SbRemisiones As New StringBuilder()
|
Dim SbRemisiones As New StringBuilder()
|
||||||
Dim RemisionesLista As New List(Of Integer)
|
Dim RemisionesLista As New List(Of Integer)
|
||||||
@@ -171,6 +183,26 @@ Partial Class Ventas_FacturacionGlobal
|
|||||||
End If
|
End If
|
||||||
ObjClientes.Dispose()
|
ObjClientes.Dispose()
|
||||||
|
|
||||||
|
If DtRemisionesPS Is Nothing OrElse DtRemisionesPS.Rows.Count = 0 Then
|
||||||
|
Alert("No se pudieron cargar las remsiones para facturar", TipoMensaje.MsgError)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
|
If DtPagos Is Nothing OrElse DtPagos.Rows.Count = 0 Then
|
||||||
|
Alert("No se pudieron cargar los pagos", TipoMensaje.MsgError)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Me.CveSubProyecto <= 0 Then
|
||||||
|
Alert("No se pudo cargar la sucursal", TipoMensaje.MsgError)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
|
If CveCliente <= 0 Then
|
||||||
|
Alert("No se pudo cargar el cliente", TipoMensaje.MsgError)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
Dim ObjFactura = Modelos.Factura.CrearVentaNueva(UsuarioActual, Me.CveSubProyecto, CveCliente, CveMoneda, "Ing")
|
Dim ObjFactura = Modelos.Factura.CrearVentaNueva(UsuarioActual, Me.CveSubProyecto, CveCliente, CveMoneda, "Ing")
|
||||||
ObjFactura.EsFacturaGlobal = True
|
ObjFactura.EsFacturaGlobal = True
|
||||||
ObjFactura.CveSATPeriodicidad = DdlPeriodo.SelectedValue.ToEntero()
|
ObjFactura.CveSATPeriodicidad = DdlPeriodo.SelectedValue.ToEntero()
|
||||||
@@ -188,6 +220,12 @@ Partial Class Ventas_FacturacionGlobal
|
|||||||
|
|
||||||
ObjFactura.CalculaTotales()
|
ObjFactura.CalculaTotales()
|
||||||
ObjFactura.PreparaTimbre()
|
ObjFactura.PreparaTimbre()
|
||||||
|
|
||||||
|
If ObjFactura.Total <> DtPagos.SUMD("Importe") Then
|
||||||
|
Alert("Los pagos no coinciden con el total de la factura", TipoMensaje.MsgError)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
'ObjFactura.DtInventario = ObjFactura.DtDetalle.FiltraParametros("CveTipoPs = 2")
|
'ObjFactura.DtInventario = ObjFactura.DtDetalle.FiltraParametros("CveTipoPs = 2")
|
||||||
|
|
||||||
Dim SbAlert As New StringBuilder()
|
Dim SbAlert As New StringBuilder()
|
||||||
|
|||||||
@@ -553,6 +553,20 @@ Partial Class Ventas
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Private Property CveClienteSucursalOS As Integer
|
||||||
|
Get
|
||||||
|
If ViewState("CveClienteSucursalOS") Is Nothing Then
|
||||||
|
ViewState("CveClienteSucursalOS") = -1
|
||||||
|
End If
|
||||||
|
Return ViewState("CveClienteSucursalOS").ToString().ToEntero()
|
||||||
|
End Get
|
||||||
|
Set(value As Integer)
|
||||||
|
ViewState("CveClienteSucursalOS") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Private Property CveClienteSucursal As Integer
|
Private Property CveClienteSucursal As Integer
|
||||||
Get
|
Get
|
||||||
If ViewState("CveClienteSucursal") Is Nothing Then
|
If ViewState("CveClienteSucursal") Is Nothing Then
|
||||||
@@ -4161,7 +4175,8 @@ Partial Class Ventas
|
|||||||
If DrPS IsNot Nothing Then
|
If DrPS IsNot Nothing Then
|
||||||
Dim CveTipoPS As Integer = DrPS("CveTipoPS").ToString().ToEntero()
|
Dim CveTipoPS As Integer = DrPS("CveTipoPS").ToString().ToEntero()
|
||||||
Dim CveTipoInv As Integer = DrPS("Inv_CveMetodoInventario").ToString().ToEntero()
|
Dim CveTipoInv As Integer = DrPS("Inv_CveMetodoInventario").ToString().ToEntero()
|
||||||
Dim existencia As Decimal = ps.GetExistenciasPS(Row.DataKey("CvePS").ToEntero(), Row.DataKey("CveUM").ToEntero(), UsuarioActual.CveEmpresa, CveAlmacenExistenciasContrato, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=1, PendientePorSurtir:=1, RestringirAlmacenes:=1, ExcluyeApartados:=-1)
|
Dim BuscarEnTabla As Boolean = If(UsuarioActual.Empresa.Funcionalidad(715) = "1", True, False)
|
||||||
|
Dim existencia As Decimal = ps.GetExistenciasPS(Row.DataKey("CvePS").ToEntero(), Row.DataKey("CveUM").ToEntero(), UsuarioActual.CveEmpresa, CveAlmacenExistenciasContrato, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=1, PendientePorSurtir:=1, RestringirAlmacenes:=1, ExcluyeApartados:=-1, BuscarEnTabla:=BuscarEnTabla)
|
||||||
If (existencia < Row.FCTextBox("TxtCant").Text.ToEntero() AndAlso CveTipoPS <> 1) AndAlso UsuarioActual.CveEmpresa.Contiene(72, 80) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ing", "Ped") Then ' And DdlContratosModal.SelectedValue.ToEntero() <> 196 Then
|
If (existencia < Row.FCTextBox("TxtCant").Text.ToEntero() AndAlso CveTipoPS <> 1) AndAlso UsuarioActual.CveEmpresa.Contiene(72, 80) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ing", "Ped") Then ' And DdlContratosModal.SelectedValue.ToEntero() <> 196 Then
|
||||||
Alert("No cuenta con la cantidad suficiente en inventario para el producto: <br/>" + Row.FCLiteral("LtlPS").Text + ".", TipoMensaje.MsgAdvertencia)
|
Alert("No cuenta con la cantidad suficiente en inventario para el producto: <br/>" + Row.FCLiteral("LtlPS").Text + ".", TipoMensaje.MsgAdvertencia)
|
||||||
TmpDT.Clear()
|
TmpDT.Clear()
|
||||||
@@ -8404,7 +8419,8 @@ Partial Class Ventas
|
|||||||
Dim ObjInventarios As New ClsInventarios
|
Dim ObjInventarios As New ClsInventarios
|
||||||
Dim Existencia As Decimal
|
Dim Existencia As Decimal
|
||||||
If ValidaExistencia Then
|
If ValidaExistencia Then
|
||||||
Existencia = ObjInventarios.GetExistenciasPS(CvePS, CveUM, UsuarioActual.CveEmpresa, -1, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=1, PendientePorSurtir:=1, RestringirAlmacenes:=1, ExcluyeApartados:=-1)
|
Dim BuscarEnTabla As Boolean = If(UsuarioActual.Empresa.Funcionalidad(715) = "1", True, False)
|
||||||
|
Existencia = ObjInventarios.GetExistenciasPS(CvePS, CveUM, UsuarioActual.CveEmpresa, -1, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=1, PendientePorSurtir:=1, RestringirAlmacenes:=1, ExcluyeApartados:=-1, BuscarEnTabla:=BuscarEnTabla)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim Costo As Decimal = ObjInventarios.GetCostoPS(CvePS, TxtCantidad.Text.Trim.ToDecimal, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveTipoAlmacen:=1)
|
Dim Costo As Decimal = ObjInventarios.GetCostoPS(CvePS, TxtCantidad.Text.Trim.ToDecimal, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveTipoAlmacen:=1)
|
||||||
@@ -9410,7 +9426,10 @@ Partial Class Ventas
|
|||||||
CveUnidad = dr("CveUM").ToString().ToEntero()
|
CveUnidad = dr("CveUM").ToString().ToEntero()
|
||||||
Cantidad = TmpDT.SUM("Cantidad", $"CvePS = {CveProducto} AND (EntregaDirecta IS NULL OR EntregaDirecta < 1)") 'VALIDA CONTRA LA SUMA DEL MISMO PS
|
Cantidad = TmpDT.SUM("Cantidad", $"CvePS = {CveProducto} AND (EntregaDirecta IS NULL OR EntregaDirecta < 1)") 'VALIDA CONTRA LA SUMA DEL MISMO PS
|
||||||
If UsuarioActual.Empresa.UsaInventarios AndAlso RemisionesLista.Count < 1 AndAlso dr("EntregaDirecta").ToString().ToEntero() < 1 Then
|
If UsuarioActual.Empresa.UsaInventarios AndAlso RemisionesLista.Count < 1 AndAlso dr("EntregaDirecta").ToString().ToEntero() < 1 Then
|
||||||
Existencia = ObjInventarios.GetExistenciasPS(CveProducto, CveUnidad, UsuarioActual.CveEmpresa, CveAlmacenExistenciasContrato, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=1, PendientePorSurtir:=1, RestringirAlmacenes:=1, ExcluyeApartados:=-1)
|
Dim BuscarEnTabla As Boolean = If(UsuarioActual.Empresa.Funcionalidad(715) = "1", True, False)
|
||||||
|
Existencia = ObjInventarios.GetExistenciasPS(CveProducto, CveUnidad, UsuarioActual.CveEmpresa, CveAlmacenExistenciasContrato, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(),
|
||||||
|
CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=1, PendientePorSurtir:=1,
|
||||||
|
RestringirAlmacenes:=1, ExcluyeApartados:=-1, BuscarEnTabla:=BuscarEnTabla)
|
||||||
If Existencia < Cantidad Then
|
If Existencia < Cantidad Then
|
||||||
MensajeCosto.AppendFormat("<br/>El Producto <b>{0}</b>. No cuenta con la cantidad suficiente en inventario. Cuenta con {1}.", dr("CodigoPS").ToString(), Existencia.FormatoNumero(2))
|
MensajeCosto.AppendFormat("<br/>El Producto <b>{0}</b>. No cuenta con la cantidad suficiente en inventario. Cuenta con {1}.", dr("CodigoPS").ToString(), Existencia.FormatoNumero(2))
|
||||||
Continue For
|
Continue For
|
||||||
@@ -15285,7 +15304,8 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If CveConceptoAlmacen = 3 AndAlso UsuarioActual.CveEmpresa.Contiene({72, 80, 119, 140}) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ing") AndAlso Dr("EntregaDirecta").ToString().ToEntero() < 1 Then
|
If CveConceptoAlmacen = 3 AndAlso UsuarioActual.CveEmpresa.Contiene({72, 80, 119, 140}) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ing") AndAlso Dr("EntregaDirecta").ToString().ToEntero() < 1 Then
|
||||||
Existencia = ObjInventario.GetExistenciasPS(CveProducto, CveUnidad, UsuarioActual.CveEmpresa, CveAlmacen, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1)
|
Dim BuscarEnTabla As Boolean = If(UsuarioActual.Empresa.Funcionalidad(715) = "1", True, False)
|
||||||
|
Existencia = ObjInventario.GetExistenciasPS(CveProducto, CveUnidad, UsuarioActual.CveEmpresa, CveAlmacen, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1, BuscarEnTabla:=BuscarEnTabla)
|
||||||
If Existencia < Cantidad Then
|
If Existencia < Cantidad Then
|
||||||
OcurrioError = True
|
OcurrioError = True
|
||||||
ErrorList.Add($"No cuenta con la cantidad suficiente en inventario del producto {Dr("CodigoPS")} .Cuenta con {Existencia.FormatoNumero(2)}.")
|
ErrorList.Add($"No cuenta con la cantidad suficiente en inventario del producto {Dr("CodigoPS")} .Cuenta con {Existencia.FormatoNumero(2)}.")
|
||||||
@@ -17739,7 +17759,11 @@ Partial Class Ventas
|
|||||||
'SOLO VALIDA EXISTENCIAS Y COSTO: SI USA INVENTARIOS, SOLO PRODUCTOS TIPO PRODUCTO, SOLO REMISIONES E INGRESOS
|
'SOLO VALIDA EXISTENCIAS Y COSTO: SI USA INVENTARIOS, SOLO PRODUCTOS TIPO PRODUCTO, SOLO REMISIONES E INGRESOS
|
||||||
If UsuarioActual.Empresa.UsaInventarios AndAlso CveTipoPS = 2 AndAlso (DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ing", "PA") OrElse ((DdlTipoComprobante.SelectedValue.Contiene("Cot") And UsuarioActual.CveEmpresa.Contiene(119)) OrElse (DdlTipoComprobante.SelectedValue.Contiene("Ped") And UsuarioActual.CveEmpresa.Contiene(186)))) Then
|
If UsuarioActual.Empresa.UsaInventarios AndAlso CveTipoPS = 2 AndAlso (DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ing", "PA") OrElse ((DdlTipoComprobante.SelectedValue.Contiene("Cot") And UsuarioActual.CveEmpresa.Contiene(119)) OrElse (DdlTipoComprobante.SelectedValue.Contiene("Ped") And UsuarioActual.CveEmpresa.Contiene(186)))) Then
|
||||||
Dim ObjInventarios As New ClsInventarios
|
Dim ObjInventarios As New ClsInventarios
|
||||||
Dim Existencia As Decimal = ObjInventarios.GetExistenciasPS(CvePS, CveUM, UsuarioActual.CveEmpresa, -1, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=1, PendientePorSurtir:=1, RestringirAlmacenes:=1, ExcluyeApartados:=-1)
|
|
||||||
|
Dim BuscarEnTabla As Boolean = If(UsuarioActual.Empresa.Funcionalidad(715) = "1", True, False)
|
||||||
|
Dim Existencia As Decimal = ObjInventarios.GetExistenciasPS(CvePS, CveUM, UsuarioActual.CveEmpresa, -1, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(),
|
||||||
|
CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=1, PendientePorSurtir:=1,
|
||||||
|
RestringirAlmacenes:=1, ExcluyeApartados:=-1, BuscarEnTabla:=BuscarEnTabla)
|
||||||
Dim Costo As Decimal = ObjInventarios.GetCostoPS(CvePS, TxtCantidad.Text.Trim.ToDecimal, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveTipoAlmacen:=1)
|
Dim Costo As Decimal = ObjInventarios.GetCostoPS(CvePS, TxtCantidad.Text.Trim.ToDecimal, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveTipoAlmacen:=1)
|
||||||
|
|
||||||
'si el costo es cero, puede ser que no halla movimientos del producto, en esa sucursal. y se volverá a sacar sin especificar sucursal
|
'si el costo es cero, puede ser que no halla movimientos del producto, en esa sucursal. y se volverá a sacar sin especificar sucursal
|
||||||
@@ -22122,7 +22146,8 @@ Partial Class Ventas
|
|||||||
If TxtCodigoSerie.Text.Trim <> "" Then
|
If TxtCodigoSerie.Text.Trim <> "" Then
|
||||||
Dim Serie As String = TxtCodigoSerie.Text.Trim().ToUpper()
|
Dim Serie As String = TxtCodigoSerie.Text.Trim().ToUpper()
|
||||||
Dim Objinventarios As New ClsInventarios
|
Dim Objinventarios As New ClsInventarios
|
||||||
Dim Existencia As Decimal = Objinventarios.GetExistenciasPS(-1, -1, UsuarioActual.CveEmpresa, -1, Serie:=Serie, ExcluyeAdelantado:=1, PendientePorSurtir:=1, RestringirAlmacenes:=1, ExcluyeApartados:=-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero())
|
Dim BuscarEnTabla As Boolean = If(UsuarioActual.Empresa.Funcionalidad(715) = "1", True, False)
|
||||||
|
Dim Existencia As Decimal = Objinventarios.GetExistenciasPS(-1, -1, UsuarioActual.CveEmpresa, -1, Serie:=Serie, ExcluyeAdelantado:=1, PendientePorSurtir:=1, RestringirAlmacenes:=1, ExcluyeApartados:=-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), BuscarEnTabla:=BuscarEnTabla)
|
||||||
Dim ExistenciaActual As Decimal = DtInv.SUMD("Cantidad", String.Format("Serie = '{0}'", Serie))
|
Dim ExistenciaActual As Decimal = DtInv.SUMD("Cantidad", String.Format("Serie = '{0}'", Serie))
|
||||||
CvePS = Objinventarios.CvePS
|
CvePS = Objinventarios.CvePS
|
||||||
Objinventarios.Dispose()
|
Objinventarios.Dispose()
|
||||||
@@ -23064,8 +23089,8 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
'SIN EXISTENCIA
|
'SIN EXISTENCIA
|
||||||
If Gvr.FCTextBox("TxtSerie").Visible = True And Gvr.FCTextBox("TxtSerie").Text.Trim <> "" Then
|
If Gvr.FCTextBox("TxtSerie").Visible = True And Gvr.FCTextBox("TxtSerie").Text.Trim <> "" Then
|
||||||
|
Dim BuscarEnTabla As Boolean = If(UsuarioActual.Empresa.Funcionalidad(715) = "1", True, False)
|
||||||
Existencia = ObjInventarios.GetExistenciasPS(-1, -1, UsuarioActual.CveEmpresa, ddlAlmacen.SelectedValue.ToEntero(), Serie:=Gvr.FCTextBox("TxtSerie").Text.ToString(), ExcluyeAdelantado:=1, PendientePorSurtir:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1)
|
Existencia = ObjInventarios.GetExistenciasPS(-1, -1, UsuarioActual.CveEmpresa, ddlAlmacen.SelectedValue.ToEntero(), Serie:=Gvr.FCTextBox("TxtSerie").Text.ToString(), ExcluyeAdelantado:=1, PendientePorSurtir:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1, BuscarEnTabla:=BuscarEnTabla)
|
||||||
ExistenciaActual = DtInv.SUMD("Cantidad", String.Format("Serie = '{0}'", Gvr.FCTextBox("TxtSerie").Text.Trim))
|
ExistenciaActual = DtInv.SUMD("Cantidad", String.Format("Serie = '{0}'", Gvr.FCTextBox("TxtSerie").Text.Trim))
|
||||||
|
|
||||||
'Valida Existencia
|
'Valida Existencia
|
||||||
@@ -25548,7 +25573,8 @@ Partial Class Ventas
|
|||||||
|
|
||||||
If AplicaSerie Then
|
If AplicaSerie Then
|
||||||
For Each Dr2 As DataRow In DtContratosSerieDetalle.FiltraParametros($"ConsecId = {Dr("CveContratoDetalle")}").Rows
|
For Each Dr2 As DataRow In DtContratosSerieDetalle.FiltraParametros($"ConsecId = {Dr("CveContratoDetalle")}").Rows
|
||||||
Existencia = ObjInventario.GetExistenciasPS(CveProducto, CveUnidad, factura.CveEmpresa, CveAlmacenExistenciasContrato, Serie:=Dr2("Serie").ToString(), FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), ExcluyeAdelantado:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1)
|
Dim BuscarEnTabla As Boolean = If(UsuarioActual.Empresa.Funcionalidad(715) = "1", True, False)
|
||||||
|
Existencia = ObjInventario.GetExistenciasPS(CveProducto, CveUnidad, factura.CveEmpresa, CveAlmacenExistenciasContrato, Serie:=Dr2("Serie").ToString(), FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), ExcluyeAdelantado:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1, BuscarEnTabla:=BuscarEnTabla)
|
||||||
If Existencia < 1 Then
|
If Existencia < 1 Then
|
||||||
GuardaLogAD($"El producto no tiene existencia: CvePS:{CveProducto},CveUnidad:{CveUnidad},Cantidad: {Cantidad},Existencia: {Existencia},CveAlmacen:{CveAlmacenExistenciasContrato},Serie:{Dr2("Serie").ToString()}")
|
GuardaLogAD($"El producto no tiene existencia: CvePS:{CveProducto},CveUnidad:{CveUnidad},Cantidad: {Cantidad},Existencia: {Existencia},CveAlmacen:{CveAlmacenExistenciasContrato},Serie:{Dr2("Serie").ToString()}")
|
||||||
Return False
|
Return False
|
||||||
@@ -25561,7 +25587,8 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
Else
|
Else
|
||||||
Existencia = ObjInventario.GetExistenciasPS(CveProducto, CveUnidad, factura.CveEmpresa, CveAlmacenExistenciasContrato, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), ExcluyeAdelantado:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1)
|
Dim BuscarEnTabla As Boolean = If(UsuarioActual.Empresa.Funcionalidad(715) = "1", True, False)
|
||||||
|
Existencia = ObjInventario.GetExistenciasPS(CveProducto, CveUnidad, factura.CveEmpresa, CveAlmacenExistenciasContrato, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), ExcluyeAdelantado:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1, BuscarEnTabla:=BuscarEnTabla)
|
||||||
If Existencia < Cantidad Then
|
If Existencia < Cantidad Then
|
||||||
GuardaLogAD($"El producto no tiene existencia: CvePS:{CveProducto},CveUnidad:{CveUnidad},Cantidad: {Cantidad},Existencia: {Existencia},CveAlmacen:{CveAlmacenExistenciasContrato}")
|
GuardaLogAD($"El producto no tiene existencia: CvePS:{CveProducto},CveUnidad:{CveUnidad},Cantidad: {Cantidad},Existencia: {Existencia},CveAlmacen:{CveAlmacenExistenciasContrato}")
|
||||||
Return False
|
Return False
|
||||||
@@ -25786,7 +25813,8 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
'VERIFICA EXISTENCIAS
|
'VERIFICA EXISTENCIAS
|
||||||
Dim Existencia As Decimal = ObjInventarios.GetExistenciasPS(CvePSSerie, CveUMSerie, UsuarioActual.CveEmpresa, CveAlmacenExistenciasContrato, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Serie:=SerieRow)
|
Dim BuscarEnTabla As Boolean = If(UsuarioActual.Empresa.Funcionalidad(715) = "1", True, False)
|
||||||
|
Dim Existencia As Decimal = ObjInventarios.GetExistenciasPS(CvePSSerie, CveUMSerie, UsuarioActual.CveEmpresa, CveAlmacenExistenciasContrato, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Serie:=SerieRow, BuscarEnTabla:=BuscarEnTabla)
|
||||||
If Existencia < 1 Then
|
If Existencia < 1 Then
|
||||||
MensajeSinExistencias.Append($"Serie: <b>{SerieRow}</b>. <br/>")
|
MensajeSinExistencias.Append($"Serie: <b>{SerieRow}</b>. <br/>")
|
||||||
Continue For
|
Continue For
|
||||||
@@ -36418,17 +36446,17 @@ Partial Class Ventas
|
|||||||
Return If(array(0).ToEntero > 0, array(0).ToEntero, -1)
|
Return If(array(0).ToEntero > 0, array(0).ToEntero, -1)
|
||||||
End If
|
End If
|
||||||
End Function
|
End Function
|
||||||
Private Function DdlClienteSucursalSucursal() As Integer
|
|
||||||
|
|
||||||
|
Private Function DdlClienteSucursalSucursal() As Integer
|
||||||
If DdlClienteSucursal.SelectedValue = "-1" Then
|
If DdlClienteSucursal.SelectedValue = "-1" Then
|
||||||
Return -1
|
Return -1
|
||||||
Else
|
Else
|
||||||
Dim array As String() = DdlClienteSucursal.SelectedValue.Split("|"c)
|
Dim array As String() = DdlClienteSucursal.SelectedValue.Split("|"c)
|
||||||
Return If(array(1).ToEntero > 0, array(1).ToEntero, -1)
|
Return If(array(1).ToEntero > 0, array(1).ToEntero, -1)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|
||||||
Private Sub SeleccionarClienteSucursal(CveCliente As Integer)
|
Private Sub SeleccionarClienteSucursal(CveCliente As Integer)
|
||||||
|
|
||||||
Dim IndexSeleccion As Integer = 0
|
Dim IndexSeleccion As Integer = 0
|
||||||
@@ -36521,6 +36549,7 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
CveClienteSucursalOS = DdlClienteSucursalSucursal()
|
||||||
|
|
||||||
|
|
||||||
If ChkRequiereTecnicoModal.Checked Then
|
If ChkRequiereTecnicoModal.Checked Then
|
||||||
@@ -36610,7 +36639,17 @@ Partial Class Ventas
|
|||||||
|
|
||||||
CargaCliente(CveCliente)
|
CargaCliente(CveCliente)
|
||||||
|
|
||||||
DdlSucursalCliente.SelectedValueExist(DdlClienteSucursalSucursal)
|
|
||||||
|
' Si es pago directo no asigna la sucurasl al dll
|
||||||
|
If RBLTipoVenta.SelectedValue.ToEntero <> 2 Then
|
||||||
|
If DdlClienteSucursalSucursal() > 0 Then
|
||||||
|
DdlSucursalCliente.SelectedValueExist(DdlClienteSucursalSucursal())
|
||||||
|
Else
|
||||||
|
If DdlSucursalCliente.Items.Count >= 2 Then
|
||||||
|
DdlSucursalCliente.SelectedIndex = 1
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
DdlTipoComprobante_SelectedIndexChanged(sender, Nothing)
|
DdlTipoComprobante_SelectedIndexChanged(sender, Nothing)
|
||||||
|
|
||||||
@@ -36734,8 +36773,10 @@ Partial Class Ventas
|
|||||||
|
|
||||||
Dim EstatusOrdenServicio As Integer = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveEstatusOrdenServicio", "TipoEstatus = 1").ToEntero
|
Dim EstatusOrdenServicio As Integer = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveEstatusOrdenServicio", "TipoEstatus = 1").ToEntero
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
If ObjOrdenServicio.AddOrdenesServicios(CveClienteOS, DdlSubProyectoDatos.SelectedValue.ToEntero, UsuarioActual.Nombre, TxtFechaOS.Text.Replace(",", "").ToDateTime, $"Venta: {LblSerie.Text}-{TxtFolio.Text}", UsuarioActual.CveUsuario, EstatusOrdenServicio,
|
If ObjOrdenServicio.AddOrdenesServicios(CveClienteOS, DdlSubProyectoDatos.SelectedValue.ToEntero, UsuarioActual.Nombre, TxtFechaOS.Text.Replace(",", "").ToDateTime, $"Venta: {LblSerie.Text}-{TxtFolio.Text}", UsuarioActual.CveUsuario, EstatusOrdenServicio,
|
||||||
UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVentaOS, -1, -1, CveOSTipo, CveClienteSucursal:=DdlSucursalCliente.SelectedValue.ToEntero,
|
UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVentaOS, -1, -1, CveOSTipo, CveClienteSucursal:=CveClienteSucursalOS,
|
||||||
Direccion:="", Telefono:="", CveModeloAuto:=-1, Año:="", CveMedico:=DdlMedico.SelectedValue.ToEntero,
|
Direccion:="", Telefono:="", CveModeloAuto:=-1, Año:="", CveMedico:=DdlMedico.SelectedValue.ToEntero,
|
||||||
CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero, CveTipoVenta:=RBLTipoVenta.SelectedValue.ToEntero, FechaCita:=TxtFechaOS.Text.Replace(",", "").ToDateTime,
|
CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero, CveTipoVenta:=RBLTipoVenta.SelectedValue.ToEntero, FechaCita:=TxtFechaOS.Text.Replace(",", "").ToDateTime,
|
||||||
Paciente:=TxtPaciente.Text, IdentificadorCliente:=TxtEpisodio.Text) Then
|
Paciente:=TxtPaciente.Text, IdentificadorCliente:=TxtEpisodio.Text) Then
|
||||||
|
|||||||
Reference in New Issue
Block a user