Validacion de traspasos
This commit is contained in:
@@ -17,6 +17,8 @@ Public Class SIGGPS : Implements IHttpHandler, IRequiresSessionState
|
||||
Select Case context.Request("metodo")
|
||||
Case "getimginstalacion"
|
||||
GetImgInstalacion(context)
|
||||
Case "EjecutarNotificaciones"
|
||||
EjecutarNotificaciones(context)
|
||||
End Select
|
||||
ElseIf context.Request.InputStream IsNot Nothing Then
|
||||
Using reader As New StreamReader(context.Request.InputStream)
|
||||
@@ -64,6 +66,14 @@ Public Class SIGGPS : Implements IHttpHandler, IRequiresSessionState
|
||||
Return URLParametros
|
||||
End Function
|
||||
|
||||
Private Sub EjecutarNotificaciones(ByVal context As HttpContext)
|
||||
Dim Retorno As String = "[]"
|
||||
Using ObjGPS As New ClsSisNotificaciones
|
||||
ObjGPS.ObtenerNotificaciones()
|
||||
End Using
|
||||
context.Response.Write(Retorno)
|
||||
End Sub
|
||||
|
||||
Private Sub GetImgInstalacion(ByVal context As HttpContext)
|
||||
Dim params As String = Decripta(context.Request("r").ToString)
|
||||
Dim Parametros = Me.Parametros(params)
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
public partial class Compras_Default : ClsPaginas
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
Alert(UsuarioActual.Nombre);
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -17,12 +17,12 @@ Partial Class SessionesActivas
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
|
||||
Dim listacve As New List(Of String)
|
||||
listacve.Add("1815")
|
||||
Notificaciones.AlertaVentana("notificacion", listacve, timeoutseconds:=0)
|
||||
' Dim listacve As New List(Of String)
|
||||
' listacve.Add("1815")
|
||||
' Notificaciones.AlertaVentana("notificacion", listacve, timeoutseconds:=0)
|
||||
|
||||
RCveUsuario = "0"
|
||||
ClsSisNotificaciones.SendNotificacionERP(100, "Titulo", "Hola Mundo", 1)
|
||||
' RCveUsuario = "0"
|
||||
'ClsSisNotificaciones.SendNotificacionERP(100, "Titulo", "Hola Mundo", 1)
|
||||
CargaDatos("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -6150,6 +6150,10 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
|
||||
If GvInv.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("cbInv").Checked) > 0 AndAlso ddlAlmacen.SelectedValue.ToEntero() <= 0 Then
|
||||
Alert("Tiene que seleccionar un almacen", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
EmitirImprimirNew()
|
||||
End Sub
|
||||
@@ -8981,25 +8985,6 @@ Partial Class Ventas
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
ElseIf AplicarVentaFacturada Then
|
||||
'25/11/2017 SE VA A ELIMINAR, DIJO EL IPP
|
||||
|
||||
'If Not ObjVentas.UpdateVentaRemision(CveVenta, ObjFactura.CveVenta) Then
|
||||
' ErrorList.Add("Ocurrió un error al actualizar la remisión")
|
||||
'End If
|
||||
|
||||
'If Not ObjConta.TraspasarSaldosPrePolizas(CveVenta, ObjFactura.CveVenta, -1, ObjFactura.CvePrePoliza, 2) Then
|
||||
' ErrorList.Add("Ocurrió un error al traspasar los saldos de la remisión")
|
||||
'End If
|
||||
|
||||
''If Not ObjConta.CancelarPrePolizas(-1, CveVenta) Then
|
||||
'' ErrorList.Add("Ocurrió un error al cancelar los saldos de la remisión")
|
||||
''End If
|
||||
|
||||
'If Not TraspasoAlmacen(ObjInventario, CveVenta, ObjConta, True, 9) Then
|
||||
' ErrorList.Add("Ocurrió un error al traspasar el almacen")
|
||||
'End If
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -10251,9 +10236,20 @@ Partial Class Ventas
|
||||
End Function
|
||||
Private Function GuardarVentaInventarios(ObjInventario As ClsInventarios, ObjConta As ClsContabilidad, factura As Modelos.Factura) As Boolean
|
||||
Dim OcurrioError As Boolean = False
|
||||
Try
|
||||
|
||||
If UsuarioActual.Empresa.UsaInventarios AndAlso factura.TipoDocto.Contiene("Ing", "Egs", "Rem") Then
|
||||
|
||||
If RemisionesLista.Count > 0 Then
|
||||
For Each CveRemision As Integer In RemisionesLista
|
||||
'El almacen general es el Primer Almacen de Material en la Sucursal
|
||||
If Not TraspasoAlmacen(ObjInventario, CveRemision, ObjConta, True, 9) Then
|
||||
OcurrioError = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
If GvInv.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("cbInv").Checked) > 0 Then
|
||||
|
||||
Dim CveAlmacen = ddlAlmacen.SelectedValue.ToEntero
|
||||
@@ -10376,22 +10372,16 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
If RemisionesLista.Count > 0 Then
|
||||
For Each CveRemision As Integer In RemisionesLista
|
||||
'El almacen general es el Primer Almacen de Material en la Sucursal
|
||||
If Not TraspasoAlmacen(ObjInventario, CveRemision, ObjConta, True, 9) Then
|
||||
Catch ex As Exception
|
||||
OcurrioError = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
End If
|
||||
OnError("Ocurrió un error al guardar el inventario", ex)
|
||||
End Try
|
||||
|
||||
Return OcurrioError
|
||||
End Function
|
||||
@@ -12498,221 +12488,7 @@ Partial Class Ventas
|
||||
|
||||
Return Not ErrorCancelar
|
||||
End Function
|
||||
'Protected Sub ImgGuardaEstatus_Click(sender As Object, e As System.Web.UI.ImageClickEventArgs) Handles ImgGuardaEstatus.Click
|
||||
|
||||
' 'La validacion de saldos cuando es refacturacion se hace antes asi que si es refacturacion ignoramos esta condicion, si es Anticipo verifica que no esté aplicado
|
||||
' If DdlTipoComprobante.SelectedValue = "Ant" AndAlso (HdnPagado.Value.ToDecimal > 0 Or GvAntNC.Rows.Count > 0) Then
|
||||
' Alert("La factura no se puede cancelar debido a que tiene pagos vinculados.", TipoMensaje.MsgAdvertencia)
|
||||
' Exit Sub
|
||||
' End If
|
||||
|
||||
' 'La validacion de saldos cuando es refacturacion se hace antes asi que si es refacturacion ignoramos esta condicion
|
||||
' If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem") AndAlso HdnPagado.Value.ToDecimal > 0 Then
|
||||
' Alert("La factura no se puede cancelar debido a que tiene pagos vinculados.", TipoMensaje.MsgAdvertencia)
|
||||
' Exit Sub
|
||||
' End If
|
||||
|
||||
' ' si tiene movimientos en almacen, y sigue sin ser marcado como devuelto
|
||||
' If (GvInv.Rows.Count > 0 AndAlso DevolucionAlmacen.Contiene(0, 1)) AndAlso DdlTipoComprobante.SelectedValue <> "Rem" Then
|
||||
' Alert("La factura no se puede cancelar debido a que tiene movimientos de inventario.", TipoMensaje.MsgAdvertencia)
|
||||
' Exit Sub
|
||||
' End If
|
||||
|
||||
' 'Si la remision esta facturada no se puede cancelar
|
||||
' If DdlTipoComprobante.SelectedValue = "Rem" Then
|
||||
' Dim ObjV As New ClsVentas
|
||||
' If ObjV.VerificarRemisionFacturada(CveVenta) Then
|
||||
' If ObjV.DtResultados.Rows.Count > 0 Then
|
||||
' Alert("La remisión no se puede cancelar debido a que ya esta vinculada a una factura.", TipoMensaje.MsgAdvertencia)
|
||||
' Exit Sub
|
||||
' End If
|
||||
' End If
|
||||
' ObjV.Dispose()
|
||||
' End If
|
||||
|
||||
|
||||
' Dim ObjVentas As New ClsVentas() : ObjVentas.IniciaTransacSQL()
|
||||
' Dim ObjAC As ClsContPAQi = Nothing
|
||||
' Dim ObjConta As New ClsContabilidad(ObjVentas.IniciaTransacSQL())
|
||||
' Dim ObjBancos As New ClsBancos(ObjVentas.IniciaTransacSQL())
|
||||
' Dim ObjInventario As New ClsInventarios(ObjVentas.IniciaTransacSQL())
|
||||
' Dim ObjContratos As New ClsContratos(ObjVentas.IniciaTransacSQL())
|
||||
|
||||
' Dim IDPoliza As Integer = -1
|
||||
' Dim CvePrePoliza As Integer
|
||||
' Dim CvePlantillaPoliza As Integer
|
||||
|
||||
' Dim ErrorCancelar As Boolean = False
|
||||
' Dim Mensaje As String = ""
|
||||
|
||||
' CreaObjetosVenta()
|
||||
' If UsuarioActual.Empresa.UsaAC Then
|
||||
' ObjAC = New ClsContPAQi(UsuarioActual.Empresa) : ObjAC.IniciaTransacSQL()
|
||||
' End If
|
||||
|
||||
' If GvInv.Rows.Count > 0 AndAlso DdlTipoComprobante.SelectedValue = "Rem" Then
|
||||
' If CveAlmacenTransitorio > 0 Then
|
||||
' ErrorCancelar = Not TraspasoAlmacen(ObjInventario, CveVenta, ObjConta, False, 9)
|
||||
' Else
|
||||
' ErrorCancelar = Not SalidaEntradaAlmacen(ObjInventario, CveVenta, ObjConta)
|
||||
' End If
|
||||
' End If
|
||||
|
||||
' If ObjFactura.TipoDocto.Contiene("Egs", "Dev") Then
|
||||
' CvePlantillaPoliza = 7
|
||||
' ElseIf ObjFactura.TipoDocto.Contiene("Ing", "Rem", "Ant") Then
|
||||
' CvePlantillaPoliza = 4
|
||||
' Else
|
||||
' CvePlantillaPoliza = 4
|
||||
' End If
|
||||
|
||||
' ObjFactura.CveVenta = CveVenta
|
||||
|
||||
' If HplSaldoAuxiliar.Text.ToDecimal > 0 Then
|
||||
' CvePrePoliza = ObjConta.AddPrePolizas("Ventas/GuardaEstatus", CvePlantillaPoliza, TxtTotal.Text.ToDouble, TxtTotal.Text.Replace(",", "").ToDouble, DdlMoneda.SelectedValue.ToEntero, Now, NombreCliente, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
' ObjFactura.CvePrePoliza = CvePrePoliza
|
||||
|
||||
' If Not ErrorCancelar Then
|
||||
' ErrorCancelar = ProcesoPrepolizas(ObjConta, ObjFactura, -1, TmpDT, ObjAC, -1, ObjBancos, ObjVentas)
|
||||
' End If
|
||||
|
||||
' If Not ErrorCancelar Then
|
||||
' ErrorCancelar = GuardarVentaImpuestosLocales(ObjVentas, ObjConta, ObjFactura, -1)
|
||||
' Else
|
||||
' Exit Sub
|
||||
' End If
|
||||
' End If
|
||||
|
||||
' 'Desvincular Remisiones
|
||||
' '[IPP] COMENTADO PORQUE UNA REMISION USADA SE QUEMA - DETALLES CON INV - 30/ENERO/2018
|
||||
' 'If DdlTipoComprobante.SelectedValue = "Ing" Then
|
||||
' ' If Not ObjVentas.LiberarRemisionesFacturadas(CveVenta) Then
|
||||
' ' ErrorCancelar = True
|
||||
' ' Mensaje = "Ocurrió un error al desvincular las remisiones"
|
||||
' ' End If
|
||||
' 'End If
|
||||
|
||||
' 'Contratos
|
||||
' ErrorList = New List(Of String)
|
||||
' If ObjFactura.CveContrato > 0 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant") Then
|
||||
' GuardarContratoAvanceEstimaciones(ObjContratos, ObjFactura, ErrorList, -1, True)
|
||||
' If ErrorList.Count > 0 Then : ErrorCancelar = True : End If
|
||||
' ElseIf ObjFactura.CveContrato > 0 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Egs", "Dev") Then
|
||||
' GuardarContratoAvanceEstimaciones(ObjContratos, ObjFactura, ErrorList, 1, True)
|
||||
' If ErrorList.Count > 0 Then : ErrorCancelar = True : End If
|
||||
' End If
|
||||
|
||||
' If DdlEstatus.SelectedValue = "4" Then
|
||||
|
||||
' If ObjVentas.UpdateEstatusFactura(DdlEstatus.SelectedValue.ToEntero, FolioFiscal, "", Now, CveVenta, IDPoliza) Then
|
||||
' Mensaje = "El nuevo estatus se guardó correctamente"
|
||||
' Else
|
||||
' ErrorCancelar = True
|
||||
' End If
|
||||
|
||||
' 'Si se está mandando a Cancelada SAT
|
||||
' ElseIf DdlEstatus.SelectedValue = "5" Then
|
||||
' Try
|
||||
' Dim DT As DataTable = Nothing
|
||||
|
||||
' If FolioFiscal = "" Then
|
||||
' Dim XmlDoc As New XmlDocument
|
||||
' XmlDoc.Load(Ruta & "XML\" & DdlTipoComprobante.SelectedValue & "\" & VentaFolio & ".xml")
|
||||
' ViewState("FolioFiscal") = XmlDoc.DocumentElement("cfdi:Complemento").FirstChild.Attributes("UUID").InnerText
|
||||
' End If
|
||||
|
||||
' 'Si es cancelar en el SAT:
|
||||
|
||||
' 'Dim xmlDoc As New System.Xml.XmlDocument()
|
||||
' 'xmlDoc.LoadXml(Encoding.UTF8.GetString(Convert.FromBase64String("PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9InllcyI/Pgo8QWN1c2UgRmVjaGE9IjIwMTYtMTItMzBUMTg6Mjk6MjAuNTExOTg1NSIgUmZjRW1pc29yPSJNT1FKODUxMjE0SEs0IiB4bWxuczpuczI9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvMDkveG1sZHNpZyMiIHhtbG5zOm5zMz0iaHR0cDovL2NhbmNlbGFjZmQuc2F0LmdvYi5teCI+CiAgICA8bnMzOkZvbGlvcz4KICAgICAgICA8bnMzOlVVSUQ+NjNBOEQxN0UtRDMxQi00QjVFLTkzMEEtMzdDNDJDRTFBM0M4PC9uczM6VVVJRD4KICAgICAgICA8bnMzOkVzdGF0dXNVVUlEPjIwMTwvbnMzOkVzdGF0dXNVVUlEPgogICAgPC9uczM6Rm9saW9zPgogICAgPG5zMjpTaWduYXR1cmUgSWQ9IlNlbGxvU0FUIj4KICAgICAgICA8bnMyOlNpZ25lZEluZm8+CiAgICAgICAgICAgIDxuczI6Q2Fub25pY2FsaXphdGlvbk1ldGhvZCBBbGdvcml0aG09Imh0dHA6Ly93d3cudzMub3JnL1RSLzIwMDEvUkVDLXhtbC1jMTRuLTIwMDEwMzE1Ii8+CiAgICAgICAgICAgIDxuczI6U2lnbmF0dXJlTWV0aG9kIEFsZ29yaXRobT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS8wNC94bWxkc2lnLW1vcmUjaG1hYy1zaGE1MTIiLz4KICAgICAgICAgICAgPG5zMjpSZWZlcmVuY2UgVVJJPSIiPgogICAgICAgICAgICAgICAgPG5zMjpUcmFuc2Zvcm1zPgogICAgICAgICAgICAgICAgICAgIDxuczI6VHJhbnNmb3JtIEFsZ29yaXRobT0iaHR0cDovL3d3dy53My5vcmcvVFIvMTk5OS9SRUMteHBhdGgtMTk5OTExMTYiPgogICAgICAgICAgICAgICAgICAgICAgICA8bnMyOlhQYXRoPm5vdChhbmNlc3Rvci1vci1zZWxmOjoqW2xvY2FsLW5hbWUoKT0nU2lnbmF0dXJlJ10pPC9uczI6WFBhdGg+CiAgICAgICAgICAgICAgICAgICAgPC9uczI6VHJhbnNmb3JtPgogICAgICAgICAgICAgICAgPC9uczI6VHJhbnNmb3Jtcz4KICAgICAgICAgICAgICAgIDxuczI6RGlnZXN0TWV0aG9kIEFsZ29yaXRobT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS8wNC94bWxlbmMjc2hhNTEyIi8+CiAgICAgICAgICAgICAgICA8bnMyOkRpZ2VzdFZhbHVlPk8zNzJtbWlEMFZWWUdkcGE4WjJ5K3VPQXVVcTdZb3JURldicER3K2xnVG9CUng3c2RrREtlNDZKRjRaM01hZHZ2djh6bG9vZTYwRGtZUGZyRGNZMUZ3PT08L25zMjpEaWdlc3RWYWx1ZT4KICAgICAgICAgICAgPC9uczI6UmVmZXJlbmNlPgogICAgICAgIDwvbnMyOlNpZ25lZEluZm8+CiAgICAgICAgPG5zMjpTaWduYXR1cmVWYWx1ZT5IbEJVbHplZlZFKzFXNS9QKzRuVk9YbEFuOVZLQUladm0vK2tuSldSb2plTVI4Ung5bHBpTUdIOXBVZG5iVWtObTloOTZQSXQ4QzBFd0Z2UVptRjlCZz09PC9uczI6U2lnbmF0dXJlVmFsdWU+CiAgICAgICAgPG5zMjpLZXlJbmZvPgogICAgICAgICAgICA8bnMyOktleU5hbWU+MDAwMDEwODg4ODg4MDAwMDAwMTY8L25zMjpLZXlOYW1lPgogICAgICAgICAgICA8bnMyOktleVZhbHVlPgogICAgICAgICAgICAgICAgPG5zMjpSU0FLZXlWYWx1ZT4KICAgICAgICAgICAgICAgICAgICA8bnMyOk1vZHVsdXM+eG5MMnpEUHRINWpEc0FaRFRJZk1xYktHcnZlK0F0OEt5eDJFWnZiZlhicEs5dVZFeFdTODc0b01lbEZ6TnE2OS9ZcVNSZVQzSTdJOHdyK2pveTVPN291WkgrNEtXZElHcDRTaTZsSGUwa250eHpObXV1S3lPUGtKOXRNY250bkZtUTRiZnhGeGxnL1VkMmhDdHVveTNqMnhZa0lYdTVPNHBHTTk4Tno4cEFNPTwvbnMyOk1vZHVsdXM+CiAgICAgICAgICAgICAgICAgICAgPG5zMjpFeHBvbmVudD5BUUFCPC9uczI6RXhwb25lbnQ+CiAgICAgICAgICAgICAgICA8L25zMjpSU0FLZXlWYWx1ZT4KICAgICAgICAgICAgPC9uczI6S2V5VmFsdWU+CiAgICAgICAgPC9uczI6S2V5SW5mbz4KICAgIDwvbnMyOlNpZ25hdHVyZT4KPC9BY3VzZT4K")))
|
||||
|
||||
' Dim ObjCancelacion As New Timbrado
|
||||
' Dim TotalT As Decimal = TxtTotal.Text.ToDecimal
|
||||
' Dim RFCReceptor As String = LblRFC.Text.Trim
|
||||
' Dim CvePACCancelacion As Integer = UsuarioActual.Empresa.CvePAC
|
||||
' ImprimeCancelacion(CveVenta)
|
||||
|
||||
' If ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscal, TotalT, RFCReceptor, UsuarioActual.Empresa.RFC, CvePACCancelacion) Then
|
||||
' 'Generamos el acuse y mandamos mail de con el acuse de cancelación - DF 13/01/2017
|
||||
' ' ImprimeCancelacion(CveVenta)
|
||||
|
||||
' If UsuarioActual.Empresa.UsaAC Then
|
||||
' IDPoliza = GenerarPolizaAC(ObjAC, True)
|
||||
' If IDPoliza <= 0 Then
|
||||
' Mensaje = "No se pudo generar la poliza"
|
||||
' ErrorCancelar = True
|
||||
' End If
|
||||
' End If
|
||||
|
||||
' If Not ErrorCancelar Then
|
||||
' If ObjVentas.UpdateEstatusFactura(DdlEstatus.SelectedValue.ToEntero, FolioFiscal, ObjCancelacion.CancelacionAcuse, ObjCancelacion.CancelacionFecha, CveVenta, IDPoliza, CvePAC:=CvePACCancelacion) Then
|
||||
' Mensaje = "El nuevo estatus se guardó correctamente"
|
||||
|
||||
' Else
|
||||
' ErrorCancelar = True
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
|
||||
' Catch ex As Exception
|
||||
' Mensaje = "Ocurrio un error al Cancelar la factura"
|
||||
' GuardaLog($"{ex.Message}")
|
||||
' End Try
|
||||
|
||||
' ElseIf DdlEstatus.SelectedValue = "9" Then
|
||||
|
||||
' If UsuarioActual.Empresa.UsaAC Then
|
||||
' IDPoliza = GenerarPolizaAC(ObjAC, True)
|
||||
|
||||
' If IDPoliza > 0 Then
|
||||
' Mensaje = "Se canceló exitosamente el compromiso."
|
||||
' Else
|
||||
' Mensaje = "No se pudo generar la poliza de cancelación"
|
||||
' ErrorCancelar = True
|
||||
' End If
|
||||
|
||||
' End If
|
||||
|
||||
' If Not ErrorCancelar Then
|
||||
' If Not ObjVentas.UpdateEstatusFactura(DdlEstatus.SelectedValue.ToEntero, "", "", TxtFecha.Text.ToDate, CveVenta, IDPoliza) Then
|
||||
' ErrorCancelar = True
|
||||
' End If
|
||||
' End If
|
||||
|
||||
' ElseIf DdlEstatus.SelectedValue = "12" Then
|
||||
' If ObjVentas.UpdateEstatusFactura(DdlEstatus.SelectedValue.ToEntero, FolioFiscal, "", Now, CveVenta, IDPoliza) Then
|
||||
' Mensaje = "Se canceló exitosamente la Remisión"
|
||||
' Else
|
||||
' ErrorCancelar = True
|
||||
' End If
|
||||
' Else
|
||||
' If ObjVentas.UpdateEstatusFactura(DdlEstatus.SelectedValue.ToEntero, FolioFiscal, "", Now, CveVenta, IDPoliza) Then
|
||||
' 'Alert("El nuevo estatus se guardó correctamente", TipoMensaje.MsgInformacion, "document.location.href=""/Ventas/Ventas.aspx?CveVenta=" & CveVenta & """;")
|
||||
' Mensaje = "El nuevo estatus se guardó correctamente"
|
||||
' Else
|
||||
' ErrorCancelar = True
|
||||
' End If
|
||||
' End If
|
||||
|
||||
|
||||
' If Not ErrorCancelar Then
|
||||
' Alert(Mensaje, TipoMensaje.MsgInformacion, "document.location.href=""/Ventas/Ventas.aspx?CveVenta=" & CveVenta & """;")
|
||||
' ObjVentas.Commit()
|
||||
' If ObjAC IsNot Nothing Then ObjAC.Commit()
|
||||
' Else
|
||||
' Alert(Mensaje, TipoMensaje.MsgError)
|
||||
' ObjVentas.RollBack()
|
||||
' If ObjAC IsNot Nothing Then ObjAC.RollBack()
|
||||
' End If
|
||||
|
||||
' ObjVentas.Dispose()
|
||||
' ObjContratos.Dispose()
|
||||
' ObjConta.Dispose()
|
||||
' ObjBancos.Dispose()
|
||||
' ObjInventario.Dispose()
|
||||
' If ObjAC IsNot Nothing Then ObjAC.Dispose()
|
||||
|
||||
'End Sub
|
||||
Protected Sub ImgBtnAddC_Click(sender As Object, e As ImageClickEventArgs) Handles ImgBtnAddC.Click
|
||||
Dim Row As DataRow = Nothing
|
||||
Row = DTmpC.NewRow
|
||||
@@ -14841,6 +14617,7 @@ Partial Class Ventas
|
||||
End Sub
|
||||
Private Function TraspasoAlmacen(ByRef ObjInventario As ClsInventarios, CveRemision As Integer, ByRef ObjConta As ClsContabilidad, ConSalida As Boolean, ConceptoMovimiento As Integer) As Boolean
|
||||
Dim OcurrioError As Boolean = False
|
||||
Try
|
||||
Dim DtMovimientos As DataTable
|
||||
Dim DtMovimientosDetalles As DataTable
|
||||
DtRemConceptosSurtidos = Nothing
|
||||
@@ -14867,33 +14644,38 @@ Partial Class Ventas
|
||||
DtMovimientosDetalles = ObjInventario.DtResultados.FiltraParametros("CvePS > 0")
|
||||
End If
|
||||
|
||||
If DtMovimientos.Rows.Count > 0 Then
|
||||
Dim GeneroMovimientoAlmacen As Boolean = False
|
||||
|
||||
For Each dr As DataRow In DtMovimientos.Rows
|
||||
|
||||
'Obtenemos los Movimientos de salida
|
||||
If ObjInventario.GetMovimientos(dr("CveMovimiento").ToString.ToEntero, ConceptoMovimiento, -1, UsuarioActual.CveEmpresa) Then
|
||||
|
||||
If ObjInventario.DtResultados.Rows.Count > 0 AndAlso DtMovimientosDetalles.Rows.Count > 0 Then
|
||||
Dim RowMovimiento As DataRow = ObjInventario.DtResultados(0)
|
||||
|
||||
Dim CveAlmacenSalida As Integer = ObjInventario.DtResultados(0)("CveAlmacen").ToString.ToEntero
|
||||
Dim CveAlmacenEntrada As Integer = ObjInventario.DtResultados(0)("CveAlmacenRelacionado").ToString.ToEntero
|
||||
Dim CveMoneda As Integer = ObjInventario.DtResultados(0)("CveMoneda").ToString.ToEntero
|
||||
Dim CveTipoAlmacen As Integer = ObjInventario.DtResultados(0)("CveTipoAlmacen").ToString.ToEntero
|
||||
Dim CveAlmacenSalida As Integer = RowMovimiento("CveAlmacen").ToString.ToEntero()
|
||||
Dim CveAlmacenEntrada As Integer = RowMovimiento("CveAlmacenRelacionado").ToString.ToEntero()
|
||||
Dim CveMoneda As Integer = RowMovimiento("CveMoneda").ToString.ToEntero()
|
||||
Dim CveTipoAlmacen As Integer = RowMovimiento("CveTipoAlmacen").ToString.ToEntero()
|
||||
|
||||
If (CveAlmacenEntrada > 0 AndAlso CveTipoAlmacen <> 1) Or RemisionesLista.Count = 0 Then 'Con remisiones parciales ignoramos las surtidas ya realizadas
|
||||
|
||||
Dim MovDetalle As New DataTable
|
||||
|
||||
If RemisionesLista.Count > 0 Then
|
||||
MovDetalle = CuadrarFacturaMovimientos(DtMovimientosDetalles.FiltraParametros($"CveMovimiento = {dr("CveMovimiento")} AND TieneSalidaxFactura IS NULL"))
|
||||
Else
|
||||
MovDetalle = DtMovimientosDetalles.FiltraParametros($"CveMovimiento = {dr("CveMovimiento")}")
|
||||
End If
|
||||
|
||||
If ErrorList.Count = 0 Then
|
||||
If MovDetalle.Rows.Count > 0 Then
|
||||
Dim CveMovimientoSalidaPorTraspaso = -1
|
||||
If ErrorList.Count = 0 AndAlso MovDetalle.Rows.Count > 0 Then
|
||||
Dim CveMovimientoSalidaPorTraspaso As Integer = -1
|
||||
|
||||
'Le damos salida de apartado por traspaso
|
||||
CveMovimientoSalidaPorTraspaso = GenerarMovimientoAlmacen(ObjInventario, MovDetalle, CveAlmacenSalida, 8, CveMoneda, CveRemision)
|
||||
|
||||
If Not CveMovimientoSalidaPorTraspaso > 0 Then
|
||||
OcurrioError = True
|
||||
Exit For
|
||||
@@ -14901,22 +14683,24 @@ Partial Class Ventas
|
||||
|
||||
'Le damos entrada al general por traspaso
|
||||
If Not OcurrioError Then
|
||||
If Not GenerarMovimientoAlmacen(ObjInventario, MovDetalle, CveAlmacenEntrada, 9, CveMoneda, CveRemision, CveMovimientoRelacionado:=CveMovimientoSalidaPorTraspaso) > 0 Then
|
||||
GeneroMovimientoAlmacen = GenerarMovimientoAlmacen(ObjInventario, MovDetalle, CveAlmacenEntrada, 9, CveMoneda, CveRemision, CveMovimientoRelacionado:=CveMovimientoSalidaPorTraspaso) > 0
|
||||
|
||||
If Not GeneroMovimientoAlmacen Then
|
||||
OcurrioError = True
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
|
||||
If Not OcurrioError Then
|
||||
If ConSalida Then
|
||||
'Le damos salida normal
|
||||
If Not GenerarMovimientoAlmacen(ObjInventario, MovDetalle, CveAlmacenEntrada, 3, CveMoneda, ObjFactura.CveVenta, MovimientoPrePoliza:=True, ObjConta:=ObjConta) > 0 Then
|
||||
If ConSalida AndAlso Not OcurrioError Then
|
||||
GeneroMovimientoAlmacen = GenerarMovimientoAlmacen(ObjInventario, MovDetalle, CveAlmacenEntrada, 3, CveMoneda, ObjFactura.CveVenta, MovimientoPrePoliza:=True, ObjConta:=ObjConta) > 0
|
||||
|
||||
If Not GeneroMovimientoAlmacen Then
|
||||
OcurrioError = True
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
Else
|
||||
OcurrioError = True
|
||||
End If
|
||||
@@ -14927,20 +14711,26 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
ElseIf ObjInventario.GetMovimientos(dr("CveMovimiento").ToString.ToEntero, 3, -1, UsuarioActual.CveEmpresa) Then
|
||||
|
||||
'Esquema viejo, evitamos que aparezca por surtir
|
||||
If Not ObjInventario.ActualizarEsDevolucionVenta(ObjFactura.CveVenta, 2) Then
|
||||
OcurrioError = True
|
||||
Exit For
|
||||
End If
|
||||
|
||||
End If
|
||||
Next
|
||||
|
||||
OcurrioError = Not GeneroMovimientoAlmacen
|
||||
End If
|
||||
|
||||
End If
|
||||
Else
|
||||
OcurrioError = True
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
OcurrioError = True
|
||||
OnError("Ocurrió un error al realizar el traspaso", ex)
|
||||
End Try
|
||||
Return Not OcurrioError
|
||||
End Function
|
||||
Private Function CuadrarFacturaMovimientos(MovDetalle As DataTable) As DataTable
|
||||
@@ -18836,8 +18626,6 @@ Partial Class Ventas
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
#Region "D E V O L U C I O N D E P E D I D O "
|
||||
Private Sub CargaFacturaDevolucionPedido()
|
||||
Dim CveVenta As Integer = Me.CveVenta
|
||||
@@ -23480,9 +23268,4 @@ Partial Class Ventas
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user