Facturacion de Entrega directa con NC
This commit is contained in:
@@ -6704,6 +6704,23 @@ Partial Class Ventas
|
||||
GuardarVenta(ObjVentas, ObjConta, ObjInventario, ObjContr, ObjFactura, TmpDT, ObjFactura.CveNCaVincular, ObjContPaq, ObjBancos, ObjOS,
|
||||
ObjEventos, ObjCGame, ObjClientes, EsNCAmortizacion:=EsNCAmortizacion)
|
||||
|
||||
'Agregamos las OCs a la tabla
|
||||
If ObjFactura.CveVenta > 0 AndAlso ErrorList.Count = 0 AndAlso DTOrdenesCompraPS IsNot Nothing AndAlso DTOrdenesCompraPS.Rows.Count > 0 AndAlso ErrorList.Count = 0 Then
|
||||
Dim CveVentaDetalle As Integer = 0
|
||||
Dim CveOrdenCompraDetalle As Integer = 0
|
||||
Dim Cantidad As Decimal = 0
|
||||
|
||||
For Each row As DataRow In TmpDT.Rows
|
||||
Cantidad = row("Cantidad").ToString.ToDecimal
|
||||
CveVentaDetalle = row("CveVentaDetalle").ToString.ToEntero
|
||||
CveOrdenCompraDetalle = row("CveOrdenCompraDetalle").ToString.ToEntero
|
||||
If Not ObjVentas.AgregarVentaOCDetalle(CveVentaDetalle, CveOrdenCompraDetalle, Cantidad) Then
|
||||
ErrorList.Add("Ocurrió un Error al agregar el detalle de la Remision")
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
'SI ES REFACTURACION
|
||||
Dim ObjNC As List(Of Object) = Nothing
|
||||
If ErrorList.Count = 0 Then
|
||||
@@ -6723,7 +6740,6 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -6789,24 +6805,6 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
|
||||
'Agregamos las OCs a la tabla
|
||||
If DTOrdenesCompraPS IsNot Nothing AndAlso DTOrdenesCompraPS.Rows.Count > 0 AndAlso ErrorList.Count = 0 Then
|
||||
Dim CveVentaDetalle As Integer = 0
|
||||
Dim CveOrdenCompraDetalle As Integer = 0
|
||||
Dim Cantidad As Decimal = 0
|
||||
|
||||
|
||||
For Each row As DataRow In TmpDT.Rows
|
||||
Cantidad = row("Cantidad").ToString.ToDecimal
|
||||
CveVentaDetalle = row("CveVentaDetalle").ToString.ToEntero
|
||||
CveOrdenCompraDetalle = row("CveOrdenCompraDetalle").ToString.ToEntero
|
||||
If Not ObjVentas.AgregarVentaOCDetalle(CveVentaDetalle, CveOrdenCompraDetalle, Cantidad) Then
|
||||
ErrorList.Add("Ocurrió un Error al agregar el detalle de la Remision")
|
||||
End If
|
||||
Next
|
||||
|
||||
End If
|
||||
|
||||
'Agregamos las Cotizaciones a la tabla
|
||||
If DtCotizacionesPS IsNot Nothing AndAlso DtCotizacionesPS.Rows.Count > 0 AndAlso ErrorList.Count = 0 Then
|
||||
Dim CveVentaDetalle As Integer = 0
|
||||
@@ -6828,8 +6826,6 @@ Partial Class Ventas
|
||||
Next
|
||||
End If
|
||||
|
||||
|
||||
|
||||
'Marcamos las ventas anteriores a febrero como surtidas - Ajuste Compu
|
||||
If ErrorList.Count = 0 Then
|
||||
If Not ObjVentas.MarcarRemisionesSinSurtir(ObjVentas.CveVenta) Then
|
||||
@@ -9037,7 +9033,7 @@ Partial Class Ventas
|
||||
|
||||
|
||||
#Region " GUARDAR - VENTA, PREPOLIZAS, INV, ESTIMACIONES, AC, NOTA DE CRÉDITO "
|
||||
Private Sub GuardarVenta(ByRef ObjVentas As ClsVentas, ByRef ObjConta As ClsContabilidad, ByRef ObjInventario As ClsInventarios, ByRef ObjContr As ClsContratos, factura As Modelos.Factura, TmpDTDetalle As DataTable, CveNCaVincular As Integer,
|
||||
Private Sub GuardarVenta(ByRef ObjVentas As ClsVentas, ByRef ObjConta As ClsContabilidad, ByRef ObjInventario As ClsInventarios, ByRef ObjContr As ClsContratos, factura As Modelos.Factura, ByRef TmpDTDetalle As DataTable, CveNCaVincular As Integer,
|
||||
ByRef objContPaqi As ClsContPAQi, Optional ByRef ObjBancos As ClsBancos = Nothing, Optional ByRef ObjOS As ClsOS = Nothing, ByRef Optional ObjEventos As ClsOIEventos = Nothing, ByRef Optional ObjCGame As ClsCGame = Nothing,
|
||||
ByRef Optional ObjCliente As ClsClientes = Nothing, Optional EsNCAmortizacion As Boolean = False, Optional NCDescuento As Boolean = False)
|
||||
|
||||
@@ -9171,7 +9167,7 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
|
||||
Dim TmpDr As DataRow = TmpDT.Select($"Consec = {Row("Consec").ToString}")(0)
|
||||
Dim TmpDr As DataRow = TmpDTDetalle.Select($"Consec = {Row("Consec").ToString}")(0)
|
||||
TmpDr("CveVentaDetalle") = ObjVentas.CveVentaDetalle
|
||||
|
||||
Try
|
||||
@@ -9342,7 +9338,7 @@ Partial Class Ventas
|
||||
Cantidad = DtPedidos2TmpDT.FiltroPrimeroValor("Cantidad", $"CveVentaDetallePedido2={row("CveVentaDetalle")}").ToDecimal
|
||||
CvePS = DtPedidos2TmpDT.FiltroPrimeroValor("CvePS", $"CveVentaDetallePedido2={row("CveVentaDetalle")}").ToEntero
|
||||
PU = DtPedidos2TmpDT.FiltroPrimeroValor("PU", $"CveVentaDetallePedido2={row("CveVentaDetalle")}").ToDecimal
|
||||
CveVentaDetalle = TmpDT.FiltroPrimeroValor("CveVentaDetalle", $"CveVentaDetallePedido2={row("CveVentaDetalle")}").ToEntero
|
||||
CveVentaDetalle = TmpDTDetalle.FiltroPrimeroValor("CveVentaDetalle", $"CveVentaDetallePedido2={row("CveVentaDetalle")}").ToEntero
|
||||
CveVentaDetallePadre = row("CveVentaDetalle").ToString.ToEntero
|
||||
|
||||
If Not ObjVentas.AddVentaDetallePedido2(CveVentaDetalle, CveVentaDetallePadre, Cantidad) Then
|
||||
@@ -9393,6 +9389,7 @@ Partial Class Ventas
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub GuardarVentaPrePolizas(ByRef ObjConta As ClsContabilidad, factura As Modelos.Factura, TmpDTDetalleMovimientos As DataTable, CveNCaVincular As Integer,
|
||||
ByRef objContPaqi As ClsContPAQi, Optional ByRef ObjBancos As ClsBancos = Nothing, ByRef Optional ObjVentas As ClsVentas = Nothing,
|
||||
ByRef Optional ObjEventos As ClsOIEventos = Nothing, Optional EsNCAmortizacion As Boolean = False, Optional NCDescuento As Boolean = False)
|
||||
@@ -18232,7 +18229,9 @@ Partial Class Ventas
|
||||
Exit Sub
|
||||
End If
|
||||
If String.IsNullOrEmpty(Vigencia.EsCancelable) Then
|
||||
sb.Append("<b>No encontrado</b> <br/>")
|
||||
Alert("No se pudo encontrar el estatus de la factura en el SAT.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
'sb.Append("<b>No encontrado</b> <br/>")
|
||||
Else
|
||||
sb.AppendFormat("<b>{0}</b> <br/>", Vigencia.EsCancelable)
|
||||
End If
|
||||
|
||||
@@ -67,52 +67,52 @@ Public Class WSSIGApp
|
||||
Application("GlobalDTVtaFormaPago") = value
|
||||
End Set
|
||||
End Property
|
||||
'Property GlobalDTSubProyectos(CveProyecto As Integer, Optional CveSubProyecto As Integer = -1, Optional CveEmpresa As Integer = -1, Optional Estatus As Integer = 1) As DataTable
|
||||
' Get
|
||||
Property GlobalDTSubProyectos(CveProyecto As Integer, Optional CveSubProyecto As Integer = -1, Optional CveEmpresa As Integer = -1, Optional Estatus As Integer = 1) As DataTable
|
||||
Get
|
||||
|
||||
' If DirectCast(Application("GlobalDTSubProyectos"), DataTable) Is Nothing Or (DirectCast(Application("GlobalDTSubProyectos"), DataTable) IsNot Nothing AndAlso DirectCast(Application("GlobalDTSubProyectos"), DataTable).Rows.Count = 0) Then
|
||||
' Dim P As New ClsSubProyectos
|
||||
' If P.GetSubProyectos Then
|
||||
' Application("GlobalDTSubProyectos") = P.DtResultados
|
||||
If DirectCast(Application("GlobalDTSubProyectos"), DataTable) Is Nothing Or (DirectCast(Application("GlobalDTSubProyectos"), DataTable) IsNot Nothing AndAlso DirectCast(Application("GlobalDTSubProyectos"), DataTable).Rows.Count = 0) Then
|
||||
Dim P As New ClsSubProyectos
|
||||
If P.GetSubProyectos Then
|
||||
Application("GlobalDTSubProyectos") = P.DtResultados
|
||||
End If
|
||||
P.Dispose()
|
||||
|
||||
Dim msg As String = "aqui no se carga subproyectos"
|
||||
'If Request IsNot Nothing Then
|
||||
' msg = msg & Request.ServerVariables("URL")
|
||||
'End If
|
||||
' P.Dispose()
|
||||
msg.GuardaLog()
|
||||
|
||||
' Dim msg As String = "aqui no se carga subproyectos"
|
||||
' 'If Request IsNot Nothing Then
|
||||
' ' msg = msg & Request.ServerVariables("URL")
|
||||
' 'End If
|
||||
' msg.GuardaLog()
|
||||
End If
|
||||
|
||||
If CveProyecto <> -1 OrElse CveSubProyecto <> -1 OrElse CveEmpresa <> -1 OrElse Estatus <> -1 Then
|
||||
Dim StrSQL As New StringBuilder
|
||||
If CveProyecto <> -1 Then StrSQL.AppendFormat(" AND CveProyecto = {0}", CveProyecto)
|
||||
If CveSubProyecto <> -1 Then StrSQL.AppendFormat(" AND CveSubProyecto = {0}", CveSubProyecto)
|
||||
If Estatus <> -1 Then StrSQL.AppendFormat(" AND CveEstatus = {0}", Estatus)
|
||||
If CveEmpresa <> -1 Then StrSQL.AppendFormat(" AND CveEmpresa = {0}", CveEmpresa)
|
||||
|
||||
Dim Dv As New DataView(DirectCast(Application("GlobalDTSubProyectos"), DataTable), StrSQL.ToString.Trim.TrimStart("A"c, "N"c, "D"c), "", DataViewRowState.CurrentRows)
|
||||
GlobalDTSubProyectos = Dv.ToTable
|
||||
Dv.Dispose()
|
||||
|
||||
Else
|
||||
GlobalDTSubProyectos = DirectCast(Application("GlobalDTSubProyectos"), DataTable)
|
||||
End If
|
||||
|
||||
End Get
|
||||
Set(ByVal value As DataTable)
|
||||
If value Is Nothing OrElse value.Rows.Count = 0 Then
|
||||
Dim msg As String = "aqui no se carga subproyectos"
|
||||
'If Request IsNot Nothing Then
|
||||
' msg = msg & Request.ServerVariables("URL")
|
||||
'End If
|
||||
msg.GuardaLog()
|
||||
|
||||
' If CveProyecto <> -1 OrElse CveSubProyecto <> -1 OrElse CveEmpresa <> -1 OrElse Estatus <> -1 Then
|
||||
' Dim StrSQL As New StringBuilder
|
||||
' If CveProyecto <> -1 Then StrSQL.AppendFormat(" AND CveProyecto = {0}", CveProyecto)
|
||||
' If CveSubProyecto <> -1 Then StrSQL.AppendFormat(" AND CveSubProyecto = {0}", CveSubProyecto)
|
||||
' If Estatus <> -1 Then StrSQL.AppendFormat(" AND CveEstatus = {0}", Estatus)
|
||||
' If CveEmpresa <> -1 Then StrSQL.AppendFormat(" AND CveEmpresa = {0}", CveEmpresa)
|
||||
|
||||
' Dim Dv As New DataView(DirectCast(Application("GlobalDTSubProyectos"), DataTable), StrSQL.ToString.Trim.TrimStart("A"c, "N"c, "D"c), "", DataViewRowState.CurrentRows)
|
||||
' GlobalDTSubProyectos = Dv.ToTable
|
||||
' Dv.Dispose()
|
||||
|
||||
' Else
|
||||
' GlobalDTSubProyectos = DirectCast(Application("GlobalDTSubProyectos"), DataTable)
|
||||
' End If
|
||||
|
||||
' End Get
|
||||
' Set(ByVal value As DataTable)
|
||||
' If value Is Nothing OrElse value.Rows.Count = 0 Then
|
||||
' Dim msg As String = "aqui no se carga subproyectos"
|
||||
' 'If Request IsNot Nothing Then
|
||||
' ' msg = msg & Request.ServerVariables("URL")
|
||||
' 'End If
|
||||
' msg.GuardaLog()
|
||||
|
||||
' End If
|
||||
' Application("GlobalDTSubProyectos") = value
|
||||
' End Set
|
||||
'End Property
|
||||
End If
|
||||
Application("GlobalDTSubProyectos") = value
|
||||
End Set
|
||||
End Property
|
||||
Property GlobalDTSATUsosCFDI(Optional EsPersonaFisica As Integer = -1) As DataTable
|
||||
Get
|
||||
If EsPersonaFisica <> -1 Then
|
||||
@@ -151,20 +151,20 @@ Public Class WSSIGApp
|
||||
Application("GlobalDTUsuarios") = value
|
||||
End Set
|
||||
End Property
|
||||
'Property GlobalDTUnidadesMedida(Optional CveEmpresa As Integer = -1) As DataTable
|
||||
' Get
|
||||
' If CveEmpresa <> -1 Then
|
||||
' Dim Dv As New DataView(DirectCast(Application("GlobalDTUnidadesMedida"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), " UnidadMedida", DataViewRowState.CurrentRows)
|
||||
' GlobalDTUnidadesMedida = Dv.ToTable
|
||||
' Dv.Dispose()
|
||||
' Else
|
||||
' GlobalDTUnidadesMedida = DirectCast(Application("GlobalDTUnidadesMedida"), DataTable)
|
||||
' End If
|
||||
' End Get
|
||||
' Set(value As DataTable)
|
||||
' Application("GlobalDTUnidadesMedida") = value
|
||||
' End Set
|
||||
'End Property
|
||||
Property GlobalDTUnidadesMedida(Optional CveEmpresa As Integer = -1) As DataTable
|
||||
Get
|
||||
If CveEmpresa <> -1 Then
|
||||
Dim Dv As New DataView(DirectCast(Application("GlobalDTUnidadesMedida"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), " UnidadMedida", DataViewRowState.CurrentRows)
|
||||
GlobalDTUnidadesMedida = Dv.ToTable
|
||||
Dv.Dispose()
|
||||
Else
|
||||
GlobalDTUnidadesMedida = DirectCast(Application("GlobalDTUnidadesMedida"), DataTable)
|
||||
End If
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
Application("GlobalDTUnidadesMedida") = value
|
||||
End Set
|
||||
End Property
|
||||
Property GlobalDTGralCategorias(CveEmpresa As Integer) As DataTable
|
||||
Get
|
||||
If CveEmpresa <> -1 Then
|
||||
@@ -2142,7 +2142,7 @@ Public Class WSSIGApp
|
||||
Timbre.Comprobante.TipoComprobante = If(Obj.TipoDocto.Contiene("Ing", "Ant"), "I", If(Obj.TipoDocto.Contiene("Egs", "Dev"), "E", ""))
|
||||
Timbre.Comprobante.Folio = Obj.Folio.ToString
|
||||
Timbre.Comprobante.Serie = Obj.Serie
|
||||
Timbre.Comprobante.Fecha = Obj.FechaCP
|
||||
Timbre.Comprobante.Fecha = Obj.Fecha
|
||||
Timbre.Comprobante.FormadePago = Obj.FormaPagoSAT33
|
||||
Timbre.Comprobante.CondicionesdePago = Obj.FormaPago33
|
||||
Timbre.Comprobante.MetodoPago = Obj.ClaveMetodoPagoSAT
|
||||
@@ -4158,6 +4158,51 @@ Public Class WSSIGApp
|
||||
Return Events
|
||||
End Function
|
||||
|
||||
<WebMethod>
|
||||
Public Function GetRepAcercamientos(CveEmpresa As Integer, CveVendedor As Integer, FechaInicio As DateTime, FechaFin As DateTime) As String
|
||||
Dim Retorno = "[]"
|
||||
Using ObjCRM As New ClsCRM
|
||||
If ObjCRM.GetAcercamiento(CveEmpresa, CveVendedor:=CveVendedor, FechaInicio:=FechaInicio, FechaFin:="-1") Then
|
||||
Retorno = ObjCRM.DtResultados.DataTableToJSONIPP()
|
||||
End If
|
||||
End Using
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
<WebMethod>
|
||||
Public Function GetRepAcercamientosProcesos(CveEmpresa As Integer, CveVendedor As Integer, FechaInicio As DateTime, FechaFin As DateTime) As String
|
||||
Dim Retorno = "[]"
|
||||
Dim cveTipoProceso = -1
|
||||
Dim idgrupo1 = 1
|
||||
Dim idgrupo2 = 1
|
||||
Dim FechaI = FechaInicio.ToString("yyyy/MM/dd")
|
||||
Dim FechaF = FechaFin.ToString("yyyy/MM/dd")
|
||||
Dim cveMedioCaptacion = -1
|
||||
Dim cveProbabilidadAcercamiento = -1
|
||||
Using ObjCRM As New ClsCRM
|
||||
If ObjCRM.RepAcercamientosEtapas(CveEmpresa, cveTipoProceso, idgrupo1, idgrupo2, FechaI, FechaF, CveVendedor, cveMedioCaptacion, cveProbabilidadAcercamiento) Then
|
||||
Retorno = ObjCRM.DtResultados.DataTableToJSONIPP()
|
||||
End If
|
||||
End Using
|
||||
Return Retorno
|
||||
End Function
|
||||
<WebMethod>
|
||||
Public Function GetRepAcercamientosRechazos(CveEmpresa As Integer, CveVendedor As Integer, FechaInicio As DateTime, FechaFin As DateTime) As String
|
||||
Dim Retorno = "[]"
|
||||
Dim cveTipoProceso = -1
|
||||
Dim idgrupo1 = 1
|
||||
Dim idgrupo2 = 1
|
||||
Dim FechaI = FechaInicio.ToString("yyyy/MM/dd")
|
||||
Dim FechaF = FechaFin.ToString("yyyy/MM/dd")
|
||||
Dim cveMedioCaptacion = -1
|
||||
Dim cveProbabilidadAcercamiento = -1
|
||||
Using ObjCRM As New ClsCRM
|
||||
If ObjCRM.RepAcercamientosEtapas(CveEmpresa, cveTipoProceso, idgrupo1, idgrupo2, FechaI, FechaF, CveVendedor, cveMedioCaptacion, cveProbabilidadAcercamiento) Then
|
||||
Retorno = ObjCRM.DtResultados.DataTableToJSONIPP()
|
||||
End If
|
||||
End Using
|
||||
Return Retorno
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
<WebMethod()>
|
||||
@@ -4841,8 +4886,5 @@ Namespace WebServiceAppModels
|
||||
Public Property Correcto As Boolean
|
||||
Public Property Mensajes As List(Of String)
|
||||
End Class
|
||||
|
||||
|
||||
|
||||
End Namespace
|
||||
|
||||
|
||||
Reference in New Issue
Block a user