This commit is contained in:
rrene
2020-05-28 18:04:21 -07:00
7 changed files with 287 additions and 216 deletions

View File

@@ -2944,6 +2944,24 @@ Public Class ClsInventarios
Return Retorno Return Retorno
End Function End Function
Public Function UpdateEstatusAlmacen(CveVentaDetalle As Integer, Valor As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("Vta_UpdateDevolucionVentaDetalle")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveVentaDetalle", SqlDbType.Int).Value = CveVenta
.Add("@Valor", SqlDbType.Int).Value = Valor
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al actualizar la devolucion.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function LimpiaEntregaDirecta(CveMovimiento As Integer) As Boolean Public Function LimpiaEntregaDirecta(CveMovimiento As Integer) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Inv_LimpiaEntregaDirecta") DataAdapter("PA_Inv_LimpiaEntregaDirecta")
@@ -3064,6 +3082,24 @@ Public Class ClsInventarios
Return Retorno Return Retorno
End Function End Function
Public Function GetSaldoVentaDetalle(CveVenta As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentaDetalleSaldo")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener datos de almacen por detalle.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function GetMovimientosDevoluciones(CveVenta As Integer, CveEmpresa As Integer) As Boolean Public Function GetMovimientosDevoluciones(CveVenta As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentaDetalleAlmacenDevolucion") DataAdapter("PA_Vta_VentaDetalleAlmacenDevolucion")

View File

@@ -3201,12 +3201,12 @@ Namespace Modelos
End If End If
'Factura 'Factura
If Not ObjEventos.AddEventoBitacora($"Sustituye a: <a href='/Ventas/Ventas.aspx?CveVenta={CveRemision}' target='_blank' class='Texto'>Folio Factura</a>", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=ObjFactura.CveVenta) Then If Not ObjEventos.AddEventoBitacora($"Remisión facturada: <a href='/Ventas/Ventas.aspx?CveVenta={CveRemision}' target='_blank' class='Texto'>Folio Factura</a>", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=ObjFactura.CveVenta) Then
ErrorPrepoliza = True ErrorPrepoliza = True
End If End If
'Remision 'Remision
If Not ObjEventos.AddEventoBitacora($"Refacturacion en: <a href='/Ventas/Ventas.aspx?CveVenta={ObjFactura.CveVenta}' target='_blank' class='Texto'>{ObjFactura.Folio}</a>", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveRemision) Then If Not ObjEventos.AddEventoBitacora($"Facturación de remisión en: <a href='/Ventas/Ventas.aspx?CveVenta={ObjFactura.CveVenta}' target='_blank' class='Texto'>{ObjFactura.Folio}</a>", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveRemision) Then
ErrorPrepoliza = True ErrorPrepoliza = True
End If End If
@@ -4269,6 +4269,18 @@ Namespace Modelos
Dim ObjE As New ClsOIEventos() Dim ObjE As New ClsOIEventos()
ObjE.AddEventoBitacora(msgBitacora, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveVenta) ObjE.AddEventoBitacora(msgBitacora, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveVenta)
ObjE.Dispose() ObjE.Dispose()
Else
If CveEstatus = 5 Then
Dim ObjE As New ClsOIEventos()
ObjE.AddEventoBitacora("La cancelación de la factura fue aceptada en el SAT", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveVenta)
ObjE.Dispose()
ElseIf CveEstatus = 4 Then
Dim ObjE As New ClsOIEventos()
ObjE.AddEventoBitacora("No se pudo comprobar el estatus de factura ante el SAT, solo sera cancelada en el sistema", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveVenta)
ObjE.Dispose()
End If
End If End If
'SI ES CANCELACION EN PROCESO CANCELA EL PROCESO DE LAS REMISIONES 'SI ES CANCELACION EN PROCESO CANCELA EL PROCESO DE LAS REMISIONES

View File

@@ -60,7 +60,7 @@
<asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-Width="5%" /> <asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-Width="5%" />
<asp:BoundField HeaderText="Lote" DataField="Lote" ItemStyle-Width="5%" /> <asp:BoundField HeaderText="Lote" DataField="Lote" ItemStyle-Width="5%" />
<asp:BoundField HeaderText="FechaCaducidad" DataField="FechaCaducidad" ItemStyle-Width="5%" /> <asp:BoundField HeaderText="FechaCaducidad" DataField="FechaCaducidad" ItemStyle-Width="5%" />
<asp:BoundField HeaderText="Sección Actual" DataField="AlmacenSeccion" ItemStyle-Width="15%" /> <asp:BoundField HeaderText="Sección Actual" DataField="SeccionAlmacen" ItemStyle-Width="15%" />
<asp:BoundField HeaderText="Existencia" DataField="Existencia" DataFormatString="{0:#,###.##}" ItemStyle-Width="5%" /> <asp:BoundField HeaderText="Existencia" DataField="Existencia" DataFormatString="{0:#,###.##}" ItemStyle-Width="5%" />
<asp:TemplateField ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center"> <asp:TemplateField ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center">
<ItemTemplate> <ItemTemplate>
@@ -69,7 +69,7 @@
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Nueva Seccion" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center"> <asp:TemplateField HeaderText="Nueva Seccion" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
<ItemTemplate> <ItemTemplate>
<asp:DropDownList ID="DDlS" runat="server" Width="150px" DataValueField="CveAlmacenSeccion" DataTextField="AlmacenSeccion" class="select2me"></asp:DropDownList> <asp:DropDownList ID="DDlS" runat="server" Width="150px" DataValueField="CveSeccion" DataTextField="Seccion" class="select2me"></asp:DropDownList>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>

View File

@@ -184,28 +184,32 @@ Partial Class Inventarios_AjustesSeccionAlmacen
Dim ErrorArchivo = False Dim ErrorArchivo = False
If Not ErrorArchivo AndAlso DtExcel IsNot Nothing Then If Not ErrorArchivo AndAlso DtExcel IsNot Nothing Then
If Not DtExcel.Columns(0).ColumnName = "Código" Then If Not DtExcel.Columns(0).ColumnName = "Cantidad" Then
Alert("El nombre de la primera columna debe ser 'Código'.Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not DtExcel.Columns(1).ColumnName = "Código" Then
Alert("El nombre de la segunda columna debe ser 'Código'.Favor de corregirlo", TipoMensaje.MsgError) Alert("El nombre de la segunda columna debe ser 'Código'.Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub Exit Sub
End If End If
If Not DtExcel.Columns(1).ColumnName = "Producto/Servicio" Then If Not DtExcel.Columns(2).ColumnName = "Producto/Servicio" Then
Alert("El nombre de la cuarta columna debe ser 'Producto/Servicio'. Favor de corregirlo", TipoMensaje.MsgError) Alert("El nombre de la tercera columna debe ser 'Producto/Servicio'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub Exit Sub
End If End If
If Not DtExcel.Columns(2).ColumnName = "SeccionAlmacen" Then If Not DtExcel.Columns(3).ColumnName = "SeccionAlmacen" Then
Alert("El nombre de la quinta columna debe ser 'SeccionAlmacen'. Favor de corregirlo", TipoMensaje.MsgError) Alert("El nombre de la cuarta columna debe ser 'SeccionAlmacen'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub Exit Sub
End If End If
If Not DtExcel.Columns(3).ColumnName = "Serie" Then If Not DtExcel.Columns(4).ColumnName = "Serie" Then
Alert("El nombre de la sexta columna debe ser 'Serie'. Favor de corregirlo", TipoMensaje.MsgError) Alert("El nombre de la quinta columna debe ser 'Serie'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub Exit Sub
End If End If
If Not DtExcel.Columns(4).ColumnName = "Lote" Then If Not DtExcel.Columns(5).ColumnName = "Lote" Then
Alert("El nombre de la séptima columna debe ser 'Lote'. Favor de corregirlo", TipoMensaje.MsgError) Alert("El nombre de la sexta columna debe ser 'Lote'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub Exit Sub
End If End If
If Not DtExcel.Columns(5).ColumnName = "FechaCaducidad" Then If Not DtExcel.Columns(6).ColumnName = "FechaCaducidad" Then
Alert("El nombre de la octava columna debe ser 'FechaCaducidad'. Favor de corregirlo", TipoMensaje.MsgError) Alert("El nombre de la séptima columna debe ser 'FechaCaducidad'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub Exit Sub
End If End If
@@ -239,17 +243,21 @@ Partial Class Inventarios_AjustesSeccionAlmacen
For Each RowExcel As DataRow In DtExcel.Rows For Each RowExcel As DataRow In DtExcel.Rows
Dim Codigo As String = RowExcel("Código").ToString.Trim Dim Codigo As String = RowExcel("Código").ToString.Trim()
Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, Codigo:=Codigo).Rows(0) Dim PS As String = RowExcel("Producto/Servicio").ToString().Trim()
Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, Codigo:=Codigo).FiltroPrimero($"PS='{PS}'")
If DrPS IsNot Nothing Then If DrPS IsNot Nothing Then
If Not ErrorMovInv Then If Not ErrorMovInv Then
Dim CantidadEntrada As Decimal = RowExcel("Cantidad").ToString().ToDecimal()
Dim CvePS As Integer = DrPS("CvePS").ToString().ToEntero() Dim CvePS As Integer = DrPS("CvePS").ToString().ToEntero()
Dim CveUM As Integer = DrPS("CveUM").ToString().ToEntero() Dim CveUM As Integer = DrPS("CveUM").ToString().ToEntero()
Dim ProductoServicio As String = RowExcel("Producto/Servicio").ToString.Trim
Dim SeccionAlmacen As String = RowExcel("SeccionAlmacen").ToString.Trim Dim SeccionAlmacen As String = RowExcel("SeccionAlmacen").ToString.Trim
Dim CveSeccionAlmacen As Integer = dtSecciones.FiltroPrimeroValor("CveSeccion", $"AlmacenSeccion='{SeccionAlmacen}'") Dim CveSeccionAlmacen As Integer = dtSecciones.FiltroPrimeroValor("CveSeccion", $"SeccionAlmacen='{SeccionAlmacen}'")
Dim Serie As String = RowExcel("Serie").ToString() Dim Serie As String = RowExcel("Serie").ToString()
Dim Lote As String = RowExcel("Lote").ToString() Dim Lote As String = RowExcel("Lote").ToString()
@@ -257,6 +265,7 @@ Partial Class Inventarios_AjustesSeccionAlmacen
Dim RowExistencia As DataRow = DtExistenciasSecciones.FiltroPrimero($"CvePS={CvePS}") Dim RowExistencia As DataRow = DtExistenciasSecciones.FiltroPrimero($"CvePS={CvePS}")
If RowExistencia IsNot Nothing Then
Dim CveSeccionAlmacenSalida As Integer = RowExistencia("CveSeccionAlmacen").ToString().ToEntero() Dim CveSeccionAlmacenSalida As Integer = RowExistencia("CveSeccionAlmacen").ToString().ToEntero()
Dim CantidadSalida As Decimal = RowExistencia("Existencia").ToString().ToDecimal() Dim CantidadSalida As Decimal = RowExistencia("Existencia").ToString().ToDecimal()
Dim SerieSalida As String = RowExistencia("Serie").ToString() Dim SerieSalida As String = RowExistencia("Serie").ToString()
@@ -280,7 +289,6 @@ Partial Class Inventarios_AjustesSeccionAlmacen
Dim RowEntrada As DataRow = ObjInventario.DtResultados.Rows(0) Dim RowEntrada As DataRow = ObjInventario.DtResultados.Rows(0)
Dim CvePSEntrada = RowEntrada("CvePS").ToString().ToEntero() Dim CvePSEntrada = RowEntrada("CvePS").ToString().ToEntero()
Dim CantidadEntrada As Decimal = RowEntrada("Cantidad").ToString().ToDecimal()
Dim PUEntrada As Decimal = RowEntrada("PUOriginal").ToString().ToDecimal() Dim PUEntrada As Decimal = RowEntrada("PUOriginal").ToString().ToDecimal()
Dim CveUMEntrada As Integer = RowEntrada("CveUM").ToString().ToEntero() Dim CveUMEntrada As Integer = RowEntrada("CveUM").ToString().ToEntero()
@@ -298,6 +306,11 @@ Partial Class Inventarios_AjustesSeccionAlmacen
ErrorMovInv = True ErrorMovInv = True
End If End If
End If End If
Else
ErrorMovInv = True
RowNoEncontrados.AppendFormat("{0},", Codigo)
End If
End If End If
Else Else
ErrorMovInv = True ErrorMovInv = True

View File

@@ -1980,7 +1980,7 @@ Partial Class Inventarios_EntregaAlmacen
End If End If
For Each Dr As DataRow In ObjInventario.DtResultados.Rows For Each Dr As DataRow In ObjInventario.DtResultados.Rows
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, Serie:=Dr("Serie").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1)) Then If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, Serie:=Dr("Serie").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1), EsInterno:=EsInterno) Then
ErrorMovInv = True ErrorMovInv = True
TextoError.AppendFormat("Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar.") TextoError.AppendFormat("Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar.")
Exit For Exit For

View File

@@ -1,19 +1,19 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="PrestamosdeProveedor.aspx.vb" Inherits="Inventarios_PrestamosdeProveedor" %> <%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="PrestamosdeProveedor.aspx.vb" Inherits="Inventarios_PrestamosdeProveedor" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" Runat="Server"> <asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content> </asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" Runat="Server"> <asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content> </asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server"> <asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Préstamos de Proveedores Préstamos de Proveedores
</asp:Content> </asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server"> <asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content> </asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server"> <asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content> </asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" Runat="Server"> <asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content> </asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" Runat="Server"> <asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel runat="server" ID="UpFiltraEntrega" UpdateMode="Conditional"> <asp:UpdatePanel runat="server" ID="UpFiltraEntrega" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter"> <div class="portlet solid grey-cascade portlet-filter">
@@ -25,7 +25,7 @@
<label class="col-md-1 truncate" style="text-align: right;">Proveedor:</label> <label class="col-md-1 truncate" style="text-align: right;">Proveedor:</label>
<div class="col-md-3"> <div class="col-md-3">
<ADS:DropDownLost ID="ddlProveedor" runat="server" DataValueField="CveProveedor" DataTextField="RazonSocial" AutoPostBack="true" CssClassDdl="select2me" CssStyle="width: 300px; "></ADS:DropDownLost> <ADS:Dropdownlost ID="ddlProveedor" runat="server" DataValueField="CveProveedor" DataTextField="RazonSocial" AutoPostBack="true" CssClassDdl="select2me" CssStyle="width: 300px; "></ADS:Dropdownlost>
</div> </div>
<label class="col-md-1 truncate" style="text-align: right;">Folio:</label> <label class="col-md-1 truncate" style="text-align: right;">Folio:</label>
@@ -102,6 +102,8 @@
<label class="col-md-3">Observaciones:</label> <label class="col-md-3">Observaciones:</label>
<div class="col-md-9"> <div class="col-md-9">
<asp:TextBox ID="TxtObservacionesEntrega" TextMode="MultiLine" Rows="2" runat="server" Width="300px"></asp:TextBox> <asp:TextBox ID="TxtObservacionesEntrega" TextMode="MultiLine" Rows="2" runat="server" Width="300px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvObservaciones" runat="server" ControlToValidate="TxtObservacionesEntrega" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Observaciones''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpRecibir"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VceObservaciones" runat="server" HighlightCssClass="vco" TargetControlID="RfvObservaciones" Width="350px"></ajax:ValidatorCalloutExtender>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
@@ -136,7 +138,7 @@
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Cantidad" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center"> <asp:TemplateField HeaderText="Cantidad" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
<ItemTemplate> <ItemTemplate>
<asp:TextBox ID="TxtCantidad" Visible="false" Width="60px" runat="server" Text="0" enabled="false"></asp:TextBox> <asp:TextBox ID="TxtCantidad" Visible="false" Width="60px" runat="server" Text="0" Enabled="false"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="SoloNumeros2" runat="server" TargetControlID="TxtCantidad" FilterType="Custom, Numbers" ValidChars="." /> <ajax:FilteredTextBoxExtender ID="SoloNumeros2" runat="server" TargetControlID="TxtCantidad" FilterType="Custom, Numbers" ValidChars="." />
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
@@ -153,7 +155,7 @@
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
</asp:Content> </asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server"> <asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
<script type="text/javascript" language="javascript"> <script type="text/javascript" language="javascript">

View File

@@ -7015,28 +7015,36 @@ Partial Class Ventas
Dim ObjNC As List(Of Object) = Nothing Dim ObjNC As List(Of Object) = Nothing
If ErrorList.Count = 0 Then If ErrorList.Count = 0 Then
If NuevaFactura = 1 Then If NuevaFactura = 1 Then
'Si directamente como cancelada sin aceptación, debe de generar la cancelacion aquí 'SI YA ESTA MARCADA LA VENTA ANTERIOR
'If Me.CveEstatusRefacturacion = 0 Then ' cuando es refacturación sin aceptación debe de cancelar y reducir saldo If DevolucionAlmacenNC = 2 Then
' ObjNC = generaNC(ObjVentas, ObjConta, ObjInventario, ObjContr, ObjContPaq, ObjFacturaDevolucion, ObjBancos, ObjEventos)
' If ObjNC Is Nothing Then
' ErrorList.Add("No se pudo Cancelar la Factura")
' End If
'End If
'Esquema viejo, evitamos que aparezca por surtir
If ErrorList.Count = 0 Then
'MARCAR VENTA ANTERIOR
If Not ObjInventario.ActualizarEsDevolucionVenta(CveDevolucion, 2) Then
ErrorList.Add("No se pudo Cancelar el movimiento de almacen de la Factura")
End If
'MARCAR VENTA ANTERIOR
If VentaSaldoAlmacenNC <> 0 OrElse DevolucionAlmacenNC = 2 Then
If Not ObjInventario.ActualizarEsDevolucionVenta(ObjFactura.CveVenta, 2) Then If Not ObjInventario.ActualizarEsDevolucionVenta(ObjFactura.CveVenta, 2) Then
ErrorList.Add("No se pudo Cancelar el movimiento de almacen de la Factura") ErrorList.Add("No se pudo Cancelar el movimiento de almacen de la Factura")
End If End If
End If End If
'MARCAR VENTA ANTERIOR
If Not ObjInventario.ActualizarEsDevolucionVenta(CveDevolucion, 2) Then
ErrorList.Add("No se pudo Cancelar el movimiento de almacen de la Factura")
End If End If
'MARCA LO PENDIENTE A NIVEL DETALLE
Dim DtMovDetalles As DataTable = Nothing
If ObjInventario.GetSaldoVentaDetalle(ObjFactura.CveVenta, UsuarioActual.CveEmpresa) Then
DtMovDetalles = ObjInventario.DtResultados.Copy()
End If
If DtMovDetalles IsNot Nothing Then
For Each Row As DataRow In DtMovDetalles.Rows
Dim SaldoAlmacen As Decimal = Row("SaldoAlmacen").ToString().ToEntero()
If SaldoAlmacen < 0 Then
ObjInventario.UpdateEstatusAlmacen(Row("CveVentaDetalle").ToString().ToEntero(), 1)
ElseIf SaldoAlmacen = 0 Then
ObjInventario.UpdateEstatusAlmacen(Row("CveVentaDetalle").ToString().ToEntero(), 0)
End If
Next
End If
DtMovDetalles.Dispose()
End If End If
End If End If
@@ -11122,12 +11130,12 @@ Partial Class Ventas
End If End If
'Factura 'Factura
If Not ObjEventos.AddEventoBitacora($"Sustituye a: <a href='/Ventas/Ventas.aspx?CveVenta={CveRemision}' target='_blank' class='Texto'>Folio Factura</a>", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=ObjFactura.CveVenta) Then If Not ObjEventos.AddEventoBitacora($"Remisión facturada : <a href='/Ventas/Ventas.aspx?CveVenta={CveRemision}' target='_blank' class='Texto'>{ObjFactura.Folio}</a>", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=ObjFactura.CveVenta) Then
ErrorPrepoliza = True ErrorPrepoliza = True
End If End If
'Remision 'Remision
If Not ObjEventos.AddEventoBitacora($"Refacturacion en: <a href='/Ventas/Ventas.aspx?CveVenta={ObjFactura.CveVenta}' target='_blank' class='Texto'>{ObjFactura.Folio}</a>", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveRemision) Then If Not ObjEventos.AddEventoBitacora($"Facturación de remisión en: <a href='/Ventas/Ventas.aspx?CveVenta={ObjFactura.CveVenta}' target='_blank' class='Texto'>{ObjFactura.Folio}</a>", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveRemision) Then
ErrorPrepoliza = True ErrorPrepoliza = True
End If End If
Next Next