SMS - 2024.02.02
This commit is contained in:
@@ -439,8 +439,30 @@ Public Class WS_PuntoVenta
|
||||
|
||||
objProyecto.Dispose()
|
||||
Return Respuesta
|
||||
End Function
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
<WebMethod()>
|
||||
Public Function GetSucursales(CveEmpresa As Integer) As RespuestaWS
|
||||
Dim objProyecto As New ClsSubProyectos
|
||||
Dim Respuesta As New RespuestaWS
|
||||
|
||||
If objProyecto.GetSubProyectos(CveEmpresa) Then
|
||||
Respuesta.Datos = objProyecto.DtResultados
|
||||
|
||||
Respuesta.Datos.Columns(2).ColumnName = "CveSucursal"
|
||||
Respuesta.Datos.Columns(3).ColumnName = "Sucursal"
|
||||
Respuesta.Datos.TableName = "Resultados"
|
||||
Respuesta.HuboError = False
|
||||
Else
|
||||
Respuesta.Descripcion = "HUBO UN ERROR"
|
||||
End If
|
||||
|
||||
objProyecto.Dispose()
|
||||
Return Respuesta
|
||||
End Function
|
||||
|
||||
|
||||
<WebMethod()>
|
||||
Public Function GetClientes(CveEmpresa As Integer) As RespuestaWS
|
||||
Dim objClientes As New ClsClientes
|
||||
@@ -546,14 +568,15 @@ Public Class WS_PuntoVenta
|
||||
|
||||
#Region "ProductosServicios"
|
||||
<WebMethod()>
|
||||
Public Function GetProductosServicios(CvePS As Integer, CveClasificacion As Integer, Codigo As String, PS As String, CveEmpresa As Integer, CveSubProyecto As Integer) As RespuestaWS
|
||||
Public Function GetProductosServicios(CvePS As Integer, CveClasificacion As Integer, Codigo As String, PS As String, CveEmpresa As Integer, CveSucursal As Integer) As RespuestaWS
|
||||
Dim objPS As New ClsProductosServicios
|
||||
Dim Respuesta As New RespuestaWS
|
||||
|
||||
If objPS.GetPS(CvePS, CveClasificacion, CveEmpresa, Codigo, PS, CveSubProyecto:=CveSubProyecto, pAplicaParaVenta:=1, pEstado:=1) Then
|
||||
If objPS.GetPS(CvePS, CveClasificacion, CveEmpresa, Codigo, PS:=PS, CveSubProyecto:=CveSucursal, pAplicaParaVenta:=1, pEstado:=1) Then
|
||||
Respuesta.Datos = objPS.DtResultados
|
||||
Respuesta.Datos.TableName = "Resultados"
|
||||
Respuesta.HuboError = False
|
||||
Respuesta.HuboError = False
|
||||
GuardaLog($"CvePS: {CvePS}, CveClasificacion: {CveClasificacion}, CveEmpresa: {CveEmpresa}, Codigo: {Codigo}, PS: {PS}, CveSubProyecto: {CveSucursal}, pAplicaParaVenta: {1}, pEstado: {1}")
|
||||
Else
|
||||
Respuesta.Descripcion = "HUBO UN ERROR"
|
||||
End If
|
||||
@@ -847,17 +870,35 @@ Public Class WS_PuntoVenta
|
||||
|
||||
CvePrePoliza = ObjConta.AddPrePolizas("Vta", 4, objVenta.Total, objVenta.Total, objVenta.CveMoneda, objVenta.Fecha, "Punto de Venta addVenta", objVenta.CveUsuario, objVenta.CveEmpresa)
|
||||
|
||||
If objVentas.DtResultados.Rows.Count = 0 Then
|
||||
If objVentas.DtResultados.Rows.Count = 0 Then
|
||||
|
||||
If objVenta.CveEmpresa = 1 Then
|
||||
If objVenta.CveSubProyecto <= 0 Then
|
||||
objVenta.CveSubProyecto = 10430
|
||||
End If
|
||||
|
||||
If objVenta.FolioFact.ToString.Contiene("", "-1", "0") Then
|
||||
objVenta.FolioFact = getFolio("Rem", objVenta.CveEmpresa, objVenta.CveSubProyecto).ToEntero
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
If objVentas.AddVenta(objVenta.TipoDocto, objVenta.FolioFact, objVenta.CveCliente, objVenta.CveClienteSucursal,
|
||||
objVenta.SubTotal, objVenta.Descuento, objVenta.Amortizacion, objVenta.IVA, objVenta.RetIVA, objVenta.RetISR,
|
||||
objVenta.Total, objVenta.CveMoneda, objVenta.TipoCambio, objVenta.CveMetodoPago, objVenta.CondicionesPago,
|
||||
objVenta.FormaPago, ClsPaginas.NowADS(), objVenta.Fecha, objVenta.MotivoDescuento, objVenta.Observaciones, objVenta.FechaEjecucion,
|
||||
objVenta.FormaPago, ClsPaginas.NowADS(), objVenta.Fecha, objVenta.MotivoDescuento, objVenta.Observaciones, If(objVenta.FechaEjecucion < MinFecha, Now, objVenta.FechaEjecucion),
|
||||
objVenta.CveVendedor, If(objVenta.Alfa1 IsNot Nothing, objVenta.Alfa1, ""), If(objVenta.Alfa2 IsNot Nothing, objVenta.Alfa2, ""), If(objVenta.Alfa3 IsNot Nothing, objVenta.Alfa3, ""), objVenta.Num1,
|
||||
objVenta.Num2, objVenta.Num3, Fech1, Fech2, Fech3, objVenta.CveCorte, If(objVenta.NumeroPersonas > 255, 255, objVenta.NumeroPersonas), CvePrePoliza, objVenta.CveUsuario, objVenta.CveEmpresa, objVenta.Propina, objVenta.CveVentaTerminal, CveSubProyecto:=objVenta.CveSubProyecto, CveSubProyectoEjecucion:=objVenta.CveSubProyecto) Then
|
||||
objVenta.CveVenta = objVentas.CveVenta
|
||||
'Ingresar los detalles
|
||||
objVenta.Num2, objVenta.Num3, Fech1, Fech2, Fech3, objVenta.CveCorte, If(objVenta.NumeroPersonas > 255, 255, objVenta.NumeroPersonas), CvePrePoliza,
|
||||
objVenta.CveUsuario, objVenta.CveEmpresa, objVenta.Propina, objVenta.CveVentaTerminal, CveSubProyecto:=objVenta.CveSubProyecto, CveSubProyectoEjecucion:=objVenta.CveSubProyecto, Vigencia:=Now) Then
|
||||
objVenta.CveVenta = objVentas.CveVenta
|
||||
'Ingresar los detalles
|
||||
|
||||
If objVenta.CveEmpresa = 1 Then
|
||||
GuardaLog($"objVenta.Detalle {objVenta.Detalle.Count}")
|
||||
End If
|
||||
For Each Detalle As ClsVentaWS.ClsVentaDetalleWS In objVenta.Detalle
|
||||
If objVentas.AddVentaDetalle(objVentas.CveVenta, Detalle.CvePS, Detalle.Cantidad, Detalle.CveUnidadMedida, Detalle.PU, Detalle.IVA, Detalle.Total, Detalle.Observaciones, Detalle.Descuento, Detalle.TipoDescuento, Detalle.CveSubProyecto, -1) Then
|
||||
If objVentas.AddVentaDetalle(objVentas.CveVenta, Detalle.CvePS, Detalle.Cantidad, Detalle.CveUnidadMedida, Detalle.PU, Detalle.IVA, Detalle.Total, Detalle.Observaciones, Detalle.Descuento, Detalle.TipoDescuento, Detalle.CveSubProyecto, -1, IEPS:=0) Then
|
||||
'Ingresar las caracteristicas del detalle de la venta
|
||||
For Each Caracteristica As ClsVentaWS.ClsVentaDetalleCaracteristicaWS In Detalle.Caracteristicas
|
||||
If objVentas.AddVentaDetalleCaracteristica(objVentas.CveVentaDetalle, Caracteristica.CvePS, Caracteristica.CveOpcion) = False Then
|
||||
@@ -954,50 +995,57 @@ Public Class WS_PuntoVenta
|
||||
'Se agrega movimiento separado por la cuenta de ventas (ER)
|
||||
' For Each Row As DataRow In DT.Rows
|
||||
ImporteMov = objVenta.SubTotal
|
||||
Dim CveClasificacion_04 As Integer = -1
|
||||
If ImporteMov <> 0 Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimientoVenta, ImporteMov, ImporteMov, CveConceptoVenta, " ", " ", CveVenta:=objVenta.CveVenta, CveCliente:=objVenta.CveCliente, CveIE:=CveIE, CveSubProyecto:=objVenta.CveSubProyecto, CveClasificacion:=CveClasificacion_04) Then
|
||||
ErrorMovtosVentas = True
|
||||
End If
|
||||
End If
|
||||
' Next
|
||||
|
||||
'Se agregan los DSV DESCUENTOS
|
||||
ImporteMov = objVenta.Descuento
|
||||
If ImporteMov <> 0 Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimientoVenta, ImporteMov, ImporteMov, CveConceptoDSV, " ", " ", CveVenta:=objVenta.CveVenta, CveCliente:=objVenta.CveCliente, CveIE:=CveIE) Then
|
||||
ErrorMovtosDSV = True
|
||||
End If
|
||||
End If
|
||||
'End If
|
||||
|
||||
'Se agregan las CxC
|
||||
ImporteMov = objVenta.Total - TotalPagado
|
||||
If ImporteMov <> 0 Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimientoVenta, ImporteMov, ImporteMov, CveConceptoAfectacion, " ", " ", CveVenta:=objVenta.CveVenta, CveCliente:=objVenta.CveCliente, CveIE:=CveIE) Then
|
||||
ErrorMovtosCxC = True
|
||||
End If
|
||||
End If
|
||||
|
||||
'Si hubo un pago agregarlo
|
||||
ImporteMov = TotalPagado
|
||||
If ImporteMov <> 0 Then
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimientoVenta, ImporteMov, ImporteMov, 2, " ", " ", CveVenta:=objVenta.CveVenta, CveCliente:=objVenta.CveCliente, CveIE:=CveIE) Then
|
||||
ErrorMovtosCxC = True
|
||||
End If
|
||||
End If
|
||||
'Se agregan el Traslado de IVA
|
||||
ImporteMov = objVenta.IVA
|
||||
If ImporteMov <> 0 Then
|
||||
Dim PorcentajeImpuesto As Decimal = 0
|
||||
If objVenta.SubTotal > 0 Then
|
||||
PorcentajeImpuesto = (objVenta.IVA / objVenta.SubTotal)
|
||||
End If
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimientoVenta, ImporteMov, ImporteMov, CveConceptoIVA, " ", " ", CveVenta:=objVenta.CveVenta, CveCliente:=objVenta.CveCliente, CveIE:=CveIE, PorcentajeImpuesto:=PorcentajeImpuesto) Then
|
||||
ErrorMovtosTrasladoIVA = True
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
' FIXME OIC
|
||||
'Dim CveClasificacion_04 As Integer = -1
|
||||
'If ImporteMov <> 0 Then
|
||||
' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimientoVenta, ImporteMov, ImporteMov, CveConceptoVenta, " ", " ", CveVenta:=objVenta.CveVenta, CveCliente:=objVenta.CveCliente, CveIE:=CveIE, CveSubProyecto:=objVenta.CveSubProyecto, CveClasificacion:=CveClasificacion_04) Then
|
||||
' ErrorMovtosVentas = True
|
||||
' End If
|
||||
'End If
|
||||
'' Next
|
||||
|
||||
''Se agregan los DSV DESCUENTOS
|
||||
'ImporteMov = objVenta.Descuento
|
||||
'If ImporteMov <> 0 Then
|
||||
' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimientoVenta, ImporteMov, ImporteMov, CveConceptoDSV, " ", " ", CveVenta:=objVenta.CveVenta, CveCliente:=objVenta.CveCliente, CveIE:=CveIE) Then
|
||||
' ErrorMovtosDSV = True
|
||||
' End If
|
||||
'End If
|
||||
''End If
|
||||
|
||||
''Se agregan las CxC
|
||||
'ImporteMov = objVenta.Total - TotalPagado
|
||||
'If ImporteMov <> 0 Then
|
||||
' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimientoVenta, ImporteMov, ImporteMov, CveConceptoAfectacion, " ", " ", CveVenta:=objVenta.CveVenta, CveCliente:=objVenta.CveCliente, CveIE:=CveIE) Then
|
||||
' ErrorMovtosCxC = True
|
||||
' End If
|
||||
'End If
|
||||
|
||||
''Si hubo un pago agregarlo
|
||||
'ImporteMov = TotalPagado
|
||||
'If ImporteMov <> 0 Then
|
||||
|
||||
' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimientoVenta, ImporteMov, ImporteMov, 2, " ", " ", CveVenta:=objVenta.CveVenta, CveCliente:=objVenta.CveCliente, CveIE:=CveIE) Then
|
||||
' ErrorMovtosCxC = True
|
||||
' End If
|
||||
'End If
|
||||
''Se agregan el Traslado de IVA
|
||||
'ImporteMov = objVenta.IVA
|
||||
'If ImporteMov <> 0 Then
|
||||
' Dim PorcentajeImpuesto As Decimal = 0
|
||||
' If objVenta.SubTotal > 0 Then
|
||||
' PorcentajeImpuesto = (objVenta.IVA / objVenta.SubTotal)
|
||||
' End If
|
||||
' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimientoVenta, ImporteMov, ImporteMov, CveConceptoIVA, " ", " ", CveVenta:=objVenta.CveVenta, CveCliente:=objVenta.CveCliente, CveIE:=CveIE, PorcentajeImpuesto:=PorcentajeImpuesto) Then
|
||||
' ErrorMovtosTrasladoIVA = True
|
||||
' End If
|
||||
'End If
|
||||
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
@@ -1051,6 +1099,37 @@ Public Class WS_PuntoVenta
|
||||
Return CveVentas
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
Private Function getFolio(TipoDoctoConsulta As String, CveEmpresa As Integer, CvesubProyecto As Integer) As String
|
||||
Dim Respuesta As String = "-1"
|
||||
Dim ObjFolios As New ClsGralFolios()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
If ObjFolios.GetFolios(TipoDoctoConsulta, CveEmpresa) Then
|
||||
GuardaLog($" GetFolios ok {ObjFolios.DtResultados.Rows.Count} . CvesubProyecto = {CvesubProyecto} .")
|
||||
Dim DT As DataTable = ObjFolios.DtResultados.FiltraParametros(String.Format(" CveSubProyecto = {0} And Estado = 'Activo'", CvesubProyecto))
|
||||
If DT.Rows.Count > 0 Then
|
||||
|
||||
Respuesta = DT.Rows(0)("FActual").ToString()
|
||||
|
||||
|
||||
|
||||
End If
|
||||
DT.Dispose()
|
||||
|
||||
End If
|
||||
|
||||
ObjFolios.Dispose()
|
||||
|
||||
GuardaLog($" Folio Rem {Respuesta} .")
|
||||
Return Respuesta
|
||||
|
||||
End Function
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user