Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -555,7 +555,7 @@ Public Class ClsVentas
|
|||||||
Optional AtencionA As String = "-1", Optional PedidoContrato As String = "-1", Optional CveFormaPago33 As Integer = -1, Optional CveMetodoPago33 As Integer = -1,
|
Optional AtencionA As String = "-1", Optional PedidoContrato As String = "-1", Optional CveFormaPago33 As Integer = -1, Optional CveMetodoPago33 As Integer = -1,
|
||||||
Optional CveCliente As Integer = -1, Optional CveClienteSucursal As Integer = -1, Optional OrdenCompra As String = "-1", Optional RetIVA As Double = -1,
|
Optional CveCliente As Integer = -1, Optional CveClienteSucursal As Integer = -1, Optional OrdenCompra As String = "-1", Optional RetIVA As Double = -1,
|
||||||
Optional RetISR As Double = -1, Optional Kilometraje As Double = 0, Optional CveUsoCFDi As Integer = -1, Optional ServicioDomicilio As Boolean = False, Optional CveVendedor As Integer = -1,
|
Optional RetISR As Double = -1, Optional Kilometraje As Double = 0, Optional CveUsoCFDi As Integer = -1, Optional ServicioDomicilio As Boolean = False, Optional CveVendedor As Integer = -1,
|
||||||
Optional RequiereOS As Boolean = False) As Boolean
|
Optional RequiereOS As Boolean = False, Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1) As Boolean
|
||||||
|
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
DataAdapter("PA_Vta_VentasUpdate")
|
DataAdapter("PA_Vta_VentasUpdate")
|
||||||
@@ -591,6 +591,8 @@ Public Class ClsVentas
|
|||||||
.Add("@ServicioDomicilio", SqlDbType.Bit).Value = ServicioDomicilio
|
.Add("@ServicioDomicilio", SqlDbType.Bit).Value = ServicioDomicilio
|
||||||
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
|
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
|
||||||
.Add("@RequiereOS", SqlDbType.Int).Value = RequiereOS
|
.Add("@RequiereOS", SqlDbType.Int).Value = RequiereOS
|
||||||
|
.Add("@CveMedico", SqlDbType.Int).Value = CveMedico
|
||||||
|
.Add("@CveProcedimiento", SqlDbType.Int).Value = CveProcedimiento
|
||||||
End With
|
End With
|
||||||
|
|
||||||
Try
|
Try
|
||||||
@@ -604,7 +606,7 @@ Public Class ClsVentas
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function UpdateObservacionesVenta(CveVenta As Integer, CveEmpresa As Integer, CveVendedor As Integer, Observaciones As String, FormaPaqueteria As Integer, CorreoNotificaciones As String, ObservacionesAlm As String,
|
Public Function UpdateObservacionesVenta(CveVenta As Integer, CveEmpresa As Integer, CveVendedor As Integer, Observaciones As String, FormaPaqueteria As Integer, CorreoNotificaciones As String, ObservacionesAlm As String,
|
||||||
Pedido As String, OrdenCompra As String, FechaPago As String, CveUsoCFDI As Integer, Optional DescripcionVenta As String = "-1") As Boolean
|
Pedido As String, OrdenCompra As String, FechaPago As String, CveUsoCFDI As Integer, Optional DescripcionVenta As String = "-1", Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1) As Boolean
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
DataAdapter("PA_Vta_VentasObservacionesUpdate")
|
DataAdapter("PA_Vta_VentasObservacionesUpdate")
|
||||||
With SqlAdapter.SelectCommand.Parameters
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
@@ -620,6 +622,8 @@ Public Class ClsVentas
|
|||||||
.Add("@OrdenCompra", SqlDbType.NVarChar).Value = OrdenCompra
|
.Add("@OrdenCompra", SqlDbType.NVarChar).Value = OrdenCompra
|
||||||
.Add("@FechaPago", SqlDbType.Date).Value = FechaPago
|
.Add("@FechaPago", SqlDbType.Date).Value = FechaPago
|
||||||
.Add("@DescripcionVenta", SqlDbType.VarChar).Value = DescripcionVenta
|
.Add("@DescripcionVenta", SqlDbType.VarChar).Value = DescripcionVenta
|
||||||
|
.Add("@CveMedico", SqlDbType.Int).Value = CveMedico
|
||||||
|
.Add("@CveProcedimiento", SqlDbType.Int).Value = CveProcedimiento
|
||||||
|
|
||||||
|
|
||||||
End With
|
End With
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ Imports System.Data
|
|||||||
Imports System.Data.SqlClient
|
Imports System.Data.SqlClient
|
||||||
Imports System.IO
|
Imports System.IO
|
||||||
Imports Extensiones
|
Imports Extensiones
|
||||||
|
Imports Microsoft.Owin.Security.Provider
|
||||||
Imports Microsoft.Reporting.WebForms
|
Imports Microsoft.Reporting.WebForms
|
||||||
|
|
||||||
Partial Class Inventarios_EntregaAlmacen
|
Partial Class Inventarios_EntregaAlmacen
|
||||||
@@ -4269,27 +4269,36 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
|
|
||||||
Respuesta = ObjOS.UpdateOrdenesServiciosEstatus(CveOSEstatusFinalizada, UsuarioActual.CveUsuario, CveOSCerrar)
|
Respuesta = ObjOS.UpdateOrdenesServiciosEstatus(CveOSEstatusFinalizada, UsuarioActual.CveUsuario, CveOSCerrar)
|
||||||
|
|
||||||
|
Dim cancelarPeido As Boolean = CancelarPedido(TransaccionSql, CveMovimientoGenerado, Respuesta)
|
||||||
|
|
||||||
If Respuesta Then
|
If Respuesta Then
|
||||||
|
Dim ObjInventario As New ClsInventarios(TransaccionSql)
|
||||||
Dim ObjInventario As New ClsInventarios(ObjOS.IniciaTransacSQL)
|
|
||||||
|
|
||||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoGenerado, UsuarioActual.CveEmpresa) Then
|
If ObjInventario.GetMovimientosDetalle(CveMovimientoGenerado, UsuarioActual.CveEmpresa) Then
|
||||||
|
If Not cancelarPeido Then
|
||||||
|
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
||||||
|
|
||||||
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
Dim CveVentaDetalle As Integer = Dr("CveVentaDetalle").ToString().ToEntero()
|
||||||
|
Dim Cantidad As Decimal = Dr("Cantidad").ToString().ToDecimal
|
||||||
|
|
||||||
Dim CveVentaDetalle As Integer = Dr("CveVentaDetalle").ToString().ToEntero()
|
If CveVentaDetalle > 0 Then
|
||||||
Dim Cantidad As Decimal = Dr("Cantidad").ToString().ToDecimal
|
If Not ObjInventario.UpdatePedidoDetalleCantidad(CveVentaDetalle, Cantidad) Then
|
||||||
|
Respuesta = False
|
||||||
If CveVentaDetalle > 0 Then
|
Exit For
|
||||||
If Not ObjInventario.UpdatePedidoDetalleCantidad(CveVentaDetalle, Cantidad) Then
|
End If
|
||||||
|
Else
|
||||||
Respuesta = False
|
Respuesta = False
|
||||||
Exit For
|
|
||||||
End If
|
End If
|
||||||
Else
|
|
||||||
Respuesta = False
|
|
||||||
End If
|
|
||||||
|
|
||||||
Next
|
Next
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Respuesta AndAlso cancelarPeido Then
|
||||||
|
Dim objVentas As New ClsVentas(TransaccionSql)
|
||||||
|
If Not objVentas.UpdateEstatusVenta(CveVentaSurtir, 4, UsuarioActual.CveEmpresa) Then
|
||||||
|
Respuesta = False
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -4302,4 +4311,48 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
|
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Private Function CancelarPedido(ByRef TransaccionSql As SqlTransaction, CveMovimientoGenerado As Integer, ByRef RespuestaPadre As Boolean) As Boolean
|
||||||
|
|
||||||
|
Dim Cancelar As Boolean = True
|
||||||
|
|
||||||
|
Dim objVentas As New ClsVentas(TransaccionSql)
|
||||||
|
Dim ObjInventario As New ClsInventarios(TransaccionSql)
|
||||||
|
|
||||||
|
Dim DTMovimiento As New DataTable
|
||||||
|
Dim DTPedidoDetalle As New DataTable
|
||||||
|
|
||||||
|
If ObjInventario.GetMovimientosDetalle(CveMovimientoGenerado, UsuarioActual.CveEmpresa) Then
|
||||||
|
DTMovimiento = ObjInventario.DtResultados
|
||||||
|
Else
|
||||||
|
RespuestaPadre = False
|
||||||
|
End If
|
||||||
|
|
||||||
|
If objVentas.GetVentaDetalle(CveVentaSurtir) Then
|
||||||
|
DTPedidoDetalle = objVentas.DtResultados
|
||||||
|
Else
|
||||||
|
RespuestaPadre = False
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
If RespuestaPadre Then
|
||||||
|
|
||||||
|
For Each rowPedido As DataRow In DTPedidoDetalle.Rows
|
||||||
|
Dim CantidadPedido As Decimal = rowPedido("Cantidad").ToString.ToDecimal
|
||||||
|
Dim CveVentaDetalle As Integer = rowPedido("CveVentaDetalle").ToString.ToEntero
|
||||||
|
|
||||||
|
Dim CantidadDevuelto As Decimal = DTMovimiento.FiltroPrimeroValor("Cantidad", $"CveVentaDetalle = {CveVentaDetalle}").ToDecimal
|
||||||
|
|
||||||
|
If CantidadPedido <> CantidadDevuelto Then
|
||||||
|
Cancelar = False
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
|
||||||
|
Next
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
Return Cancelar
|
||||||
|
|
||||||
|
End Function
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -3072,7 +3072,7 @@ Partial Class OS_OrdenesServicios
|
|||||||
Dim PU As Decimal = GvRow.DataKey("PU").ToDecimal
|
Dim PU As Decimal = GvRow.DataKey("PU").ToDecimal
|
||||||
|
|
||||||
If CantidadRegistro > 0 Then
|
If CantidadRegistro > 0 Then
|
||||||
Dim CveVentaDetalle As Integer = DtVentaDetalle.Rows(IndexMov1)("CveVentaDetalle").ToString.ToEntero
|
Dim CveVentaDetalle As Integer = GvRow.DataKey("CveVentaDetalle").ToEntero ' DtVentaDetalle.Rows(IndexMov1)("CveVentaDetalle").ToString.ToEntero
|
||||||
Dim CveMovimientoDetalle As Integer = GvRow.DataKey("CveMovimientoDetalle").ToEntero
|
Dim CveMovimientoDetalle As Integer = GvRow.DataKey("CveMovimientoDetalle").ToEntero
|
||||||
|
|
||||||
Dim Serie As String = GvRow.DataKey("Serie")
|
Dim Serie As String = GvRow.DataKey("Serie")
|
||||||
|
|||||||
@@ -2738,7 +2738,12 @@ Partial Class Ventas
|
|||||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then BtnCrearApartirDe.Visible = False
|
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then BtnCrearApartirDe.Visible = False
|
||||||
|
|
||||||
If UsuarioActual.TienePermisoProceso(302) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Egs") Then BtnEditar.Visible = True
|
If UsuarioActual.TienePermisoProceso(302) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Egs") Then BtnEditar.Visible = True
|
||||||
If UsuarioActual.TienePermisoProceso(302) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Rem") Then BtnPermisoEditarRemision.Visible = True
|
If UsuarioActual.TienePermisoProceso(302) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ped") Then BtnPermisoEditarRemision.Visible = True
|
||||||
|
|
||||||
|
If DdlTipoComprobante.SelectedValue = "Ped" Then
|
||||||
|
BtnPermisoEditarRemision.Text = "Editar Pedido"
|
||||||
|
BtnEditarRemision.Text = "Actualizar Pedido"
|
||||||
|
End If
|
||||||
|
|
||||||
DivFechaAnticipoCliente.Visible = True
|
DivFechaAnticipoCliente.Visible = True
|
||||||
TxtFechaAnticipoCliente.Text = NowADS().ToShortDateString
|
TxtFechaAnticipoCliente.Text = NowADS().ToShortDateString
|
||||||
@@ -21690,6 +21695,9 @@ Partial Class Ventas
|
|||||||
|
|
||||||
ViewState("CveClienteAnterior") = CveCliente
|
ViewState("CveClienteAnterior") = CveCliente
|
||||||
|
|
||||||
|
DdlMedicoObservaciones.Enabled = True
|
||||||
|
DdlProcedimientoObservaciones.Enabled = True
|
||||||
|
|
||||||
Dim CantidadFacturadaRemision As Decimal = 0
|
Dim CantidadFacturadaRemision As Decimal = 0
|
||||||
|
|
||||||
'EN BDH NO DEBE PERMITIR EDITAR EL PU
|
'EN BDH NO DEBE PERMITIR EDITAR EL PU
|
||||||
@@ -21752,6 +21760,7 @@ Partial Class Ventas
|
|||||||
UpPS.Update()
|
UpPS.Update()
|
||||||
UpCliente.Update()
|
UpCliente.Update()
|
||||||
UPObservaciones.Update()
|
UPObservaciones.Update()
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub BtnEditarRemision_Click(sender As Object, e As EventArgs) Handles BtnEditarRemision.Click
|
Private Sub BtnEditarRemision_Click(sender As Object, e As EventArgs) Handles BtnEditarRemision.Click
|
||||||
Dim OcurrioError As Boolean = False
|
Dim OcurrioError As Boolean = False
|
||||||
@@ -21846,7 +21855,7 @@ Partial Class Ventas
|
|||||||
PedidoContrato:=TxtPedidoContrato.Text, AtencionA:=TxtAtencionA.Text.Trim, CveMetodoPago33:=DdlMetodoPago33.SelectedValue.ToEntero(),
|
PedidoContrato:=TxtPedidoContrato.Text, AtencionA:=TxtAtencionA.Text.Trim, CveMetodoPago33:=DdlMetodoPago33.SelectedValue.ToEntero(),
|
||||||
CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero(), TipoDocto:="Rem", CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal,
|
CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero(), TipoDocto:="Rem", CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal,
|
||||||
OrdenCompra:=TxtOrdenCompra.Text, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, Kilometraje:=TxtKilometraje.Text.ToDouble, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero(),
|
OrdenCompra:=TxtOrdenCompra.Text, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, Kilometraje:=TxtKilometraje.Text.ToDouble, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero(),
|
||||||
CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), ServicioDomicilio:=TrServicioDomicilio.Visible) Then
|
CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), ServicioDomicilio:=TrServicioDomicilio.Visible, CveMedico:=DdlMedicoObservaciones.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimientoObservaciones.SelectedValue.ToEntero) Then
|
||||||
OcurrioError = True
|
OcurrioError = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user