Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -6247,13 +6247,14 @@ Public Class ClsInventarios
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function UpdatePedidoDetalleCantidad(CveVentaDetalle As Integer, Cantidad As Decimal) As Boolean
|
||||
Public Function UpdatePedidoDetalleCantidad(CveVentaDetalle As Integer, Cantidad As Decimal, Optional Opcion As Integer = 1) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_VentasDetalleCantidadUpdate")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveVentaDetalle", SqlDbType.Int).Value = CveVentaDetalle
|
||||
.Add("@Cantidad", SqlDbType.Money).Value = Cantidad
|
||||
.Add("@Opcion", SqlDbType.Int).Value = Opcion
|
||||
End With
|
||||
|
||||
Try
|
||||
|
||||
@@ -170,23 +170,30 @@
|
||||
DataKeyNames="EsDevolucionVenta"
|
||||
data-sort="true" EmptyDataText="No se encontraron resultados." AutoGenerateColumns="False" >
|
||||
<Columns>
|
||||
<%--0--%>
|
||||
<asp:BoundField HeaderText="Tipo Docto" DataField="TipoDocto" ItemStyle-Width="55px" />
|
||||
<asp:HyperLinkField DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="~/Ventas/Ventas.aspx?CveVenta={0}" Target="_blank" ItemStyle-Width="80px" HeaderText="SerieFolio" ControlStyle-CssClass="Texto" DataTextField="SerieFolio" />
|
||||
|
||||
<%-- <asp:BoundField HeaderText="Fecha" DataField="Fecha" DataFormatString="{0:d}" ItemStyle-Width="90px" ItemStyle-HorizontalAlign="Center" />--%>
|
||||
|
||||
<%--1--%>
|
||||
<asp:HyperLinkField DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="~/Ventas/Ventas.aspx?CveVenta={0}" Target="_blank" ItemStyle-Width="80px" HeaderText="SerieFolio" ControlStyle-CssClass="Texto" DataTextField="SerieFolio" />
|
||||
<asp:TemplateField HeaderText="Fecha" ItemStyle-Width="90px" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LtlFechaFactura" runat="server" ></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<%--2--%>
|
||||
<asp:HyperLinkField DataNavigateUrlFields="CveCliente" DataNavigateUrlFormatString="~/Ventas/Clientes.aspx?CveCliente={0}" Target="_blank" HeaderText="Cliente" ControlStyle-CssClass="Texto" ItemStyle-HorizontalAlign="Left" DataTextField="Nombre" />
|
||||
<%--3--%>
|
||||
<asp:BoundField HeaderText="Total" DataField="Total" DataFormatString="{0:n2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<%--4--%>
|
||||
<asp:BoundField HeaderText="Sucursal" DataField="SubProyecto" ItemStyle-Width="100px" />
|
||||
<%--5--%>
|
||||
<asp:BoundField HeaderText="Tipo Venta" DataField="TipoVenta" Visible="false" />
|
||||
<%--6--%>
|
||||
<asp:BoundField HeaderText="Médico" DataField="Medico" Visible="false" />
|
||||
<%--7--%>
|
||||
<asp:BoundField HeaderText="Procedimiento" DataField="Procedimiento" Visible="false" />
|
||||
<%--8--%>
|
||||
<asp:BoundField HeaderText="Sutido" DataField="Surtido" DataFormatString="{0:n2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<%--9--%>
|
||||
<asp:TemplateField ItemStyle-Width="70px" HeaderText="Acción" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
|
||||
|
||||
@@ -88,6 +88,7 @@ Partial Class RepNotasSinAlmacen
|
||||
GvVentas.Columns(6).Visible = True
|
||||
GvVentas.Columns(7).Visible = True
|
||||
GvVentas.Columns(8).Visible = True
|
||||
GvVentas.Columns(9).Visible = True
|
||||
TxtFechaF.Text = NowADS.AddDays(3).ToShortDateString
|
||||
|
||||
GvVentas.Columns(4).Visible = False
|
||||
|
||||
@@ -7,6 +7,11 @@ Imports System.Data
|
||||
Imports System.Data.SqlClient
|
||||
Imports System.Diagnostics
|
||||
Imports System.ServiceModel.Security
|
||||
Imports RVCFDI.RVLTimbrado
|
||||
Imports Microsoft.Owin.Security.Provider
|
||||
Imports Telerik.Web.UI
|
||||
|
||||
|
||||
|
||||
Partial Class OS_OrdenesServicios
|
||||
Inherits ClsPaginas
|
||||
@@ -3139,6 +3144,37 @@ Partial Class OS_OrdenesServicios
|
||||
ProcesoOK = False
|
||||
End If
|
||||
|
||||
|
||||
Dim DT_Ventas_Detalles As DataTable = DTSolicitudDev.FiltraParametros("", "", {"CantidadPedido", "CvePS", "CveVentaDetalle"})
|
||||
DT_Ventas_Detalles.Columns.Add("CantidadUsada", GetType(Decimal))
|
||||
DT_Ventas_Detalles.AcceptChanges()
|
||||
|
||||
For Each dRow As DataRow In DT_Ventas_Detalles.Rows
|
||||
|
||||
For Each gvRow As GridViewRow In GvMU.Rows
|
||||
|
||||
Dim CantidadUsada As Decimal = gvRow.FCTextBox("TxtUtilizado").Text.ToDecimal
|
||||
|
||||
If dRow("CvePS").ToString.ToDecimal = gvRow.DataKey("CvePS").ToDecimal AndAlso CantidadUsada > 0 Then
|
||||
|
||||
dRow("CantidadUsada") = dRow("CantidadUsada").ToString.ToDecimal + CantidadUsada
|
||||
|
||||
End If
|
||||
Next
|
||||
|
||||
Next
|
||||
|
||||
For Each dRow As DataRow In DT_Ventas_Detalles.Rows
|
||||
Dim CantidadUsada As Decimal = dRow("CantidadUsada").ToString.ToDecimal
|
||||
If dRow("CantidadUsada").ToString.ToDecimal < dRow("CantidadPedido").ToString.ToDecimal Then
|
||||
If Not ObjInventario.UpdatePedidoDetalleCantidad(dRow("CveVentaDetalle").ToString.ToEntero, CantidadUsada, 2) Then
|
||||
ProcesoOK = False
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
|
||||
Else
|
||||
If ProcesoOK Then
|
||||
Dim AplicaDevolucion As Boolean = False
|
||||
@@ -3424,6 +3460,44 @@ Partial Class OS_OrdenesServicios
|
||||
Dim CveMoneda As Integer = -1
|
||||
Dim tCveVendedor As Integer = -1
|
||||
|
||||
|
||||
Dim CountDetalles As Integer = 0
|
||||
Dim PuEnCero As Boolean = False
|
||||
|
||||
For Each GvRow As GridViewRow In GvMU.Rows
|
||||
|
||||
Dim CantidadRegistro As Decimal = GvRow.FCTextBox("TxtUtilizado").Text.ToDecimal
|
||||
Dim PU As Decimal = GvRow.DataKey("PU").ToDecimal
|
||||
Dim CodigoPS As String = GvRow.DataKey("CodigoPS")
|
||||
|
||||
If CantidadRegistro > 0 Then
|
||||
If PU > 0 Then
|
||||
CountDetalles = CountDetalles + 1
|
||||
Else
|
||||
Alert($"Prodcuto {CodigoPS} con precio unitario en cero.", TipoMensaje.MsgAdvertencia)
|
||||
PuEnCero = True
|
||||
End If
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
If PuEnCero Then
|
||||
Respuesta.CveVenta = -1
|
||||
Respuesta.SerieFolio = ""
|
||||
Respuesta.dtdetalle = New DataTable
|
||||
Return Respuesta
|
||||
End If
|
||||
|
||||
If CountDetalles = 0 Then
|
||||
Respuesta.CveVenta = -1
|
||||
Respuesta.SerieFolio = ""
|
||||
Respuesta.dtdetalle = New DataTable
|
||||
Alert("Remision sin detalles.", TipoMensaje.MsgAdvertencia)
|
||||
Return Respuesta
|
||||
End If
|
||||
|
||||
|
||||
|
||||
If ObjVentas.GetVenta(CvePedido, UsuarioActual.CveEmpresa, VerificaAlmacen:=False) Then
|
||||
Dim DbRowVenta As DataRow = ObjVentas.DtResultados.Copy().Rows(0)
|
||||
CveMoneda = DbRowVenta("CveMoneda").ToString.ToEntero
|
||||
|
||||
Reference in New Issue
Block a user