Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -3115,7 +3115,8 @@
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtEtiqueta" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
|
||||
<label for="<%= TxtEtiqueta.ClientID.ToString()%>">Etiqueta:</label>
|
||||
<ajax:MaskedEditExtender ID="MEEEtiqueta" runat="server" TargetControlID="TxtEtiqueta" Mask="99\/99" MaskType="None" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<label for="<%= TxtEtiqueta.ClientID.ToString()%>">Etiqueta (mm/yy):</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -3142,7 +3143,7 @@
|
||||
<div class="col-md-8">
|
||||
<div id="DivCodEnsamble" runat="server" class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtCodEnsamble" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
|
||||
<asp:CustomValidator ID="CVCodEnsamble" runat="server" ControlToValidate="TxtCodEnsamble" ValidateEmptyText="true" ClientValidationFunction="ValidarCodigoEnsamble" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod.Ensamble''</b> es incorrecto, por favor ingréselo correctamente." ValidationGroup="GrpAddVenta" />
|
||||
<asp:CustomValidator ID="CVCodEnsamble" runat="server" ControlToValidate="TxtCodEnsamble" ValidateEmptyText="true" Display="None" ClientValidationFunction="ValidarCodigoEnsamble" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod.Ensamble''</b> es incorrecto, por favor ingréselo correctamente." ValidationGroup="GrpAddVenta" />
|
||||
<label for="<%= TxtCodEnsamble.ClientID.ToString()%>">Cod.Ensamble:</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -7126,7 +7126,7 @@ Partial Class PV
|
||||
Else
|
||||
'TxtPUFactura.Enabled = True
|
||||
'TxtPUFactura.Text = ""
|
||||
DdlPSAjuste.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
|
||||
' DdlPSAjuste.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
|
||||
End If
|
||||
DdlPSAjuste.DataBind()
|
||||
' DdlPSAjuste.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
@@ -7418,6 +7418,10 @@ Partial Class PV
|
||||
Alert("No se ha especificado producto de ajuste a entregar")
|
||||
Exit Sub
|
||||
End If
|
||||
If TxtEtiqueta.Text <> "" OrElse TxtEtiqueta.Text.Length <> 4 Then
|
||||
Alert("No se ha especificado la etiqueta.")
|
||||
Exit Sub
|
||||
End If
|
||||
If Not CalculaMesesUso() Then
|
||||
Exit Sub
|
||||
End If
|
||||
@@ -7427,53 +7431,63 @@ Partial Class PV
|
||||
If DdlTipoUso.SelectedValue.ToEntero > 0 AndAlso DdlPSAjuste.SelectedValue.ToEntero > 0 AndAlso TxtMesesUso.Text <> "" AndAlso DdlPS.SelectedValue.ToEntero > 0 Then
|
||||
Dim CveMarca As Integer = -1
|
||||
|
||||
CveMarca = GlobalDTPS(UsuarioActual.CveEmpresa, DdlPSAjuste.SelectedValue.ToEntero).FiltroPrimeroValor("CveMarca", "").ToEntero
|
||||
CveMarca = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=DdlPSAjuste.SelectedValue.ToEntero).FiltroPrimeroValor("CveMarca", "").ToEntero
|
||||
Dim ImportePagarCliente As Decimal = 0
|
||||
Dim ObjAcum As New ClsAcumuladores
|
||||
If ObjAcum.GarantiasMesesGet(-1, UsuarioActual.CveEmpresa, CveMarca, DdlTipoUso.SelectedValue.ToEntero, TxtMesesUso.Text.ToEntero) Then
|
||||
If ObjAcum.DtResultados.Rows.Count > 0 Then
|
||||
TxtPorcentajeAjuste.Text = (ObjAcum.DtResultados.Rows(0)("Valor").ToString.ToDouble / 100).ToString
|
||||
''obtener siempre y cuando la fecha de inicio sea mayor
|
||||
Dim strDate As Date = ($"01/{TxtEtiqueta.Text.Substring(0, 2)}/{TxtEtiqueta.Text.Substring(2, 2)}").ToDate
|
||||
Dim drg As DataRow = ObjAcum.DtResultados.FiltroPrimero($" #{strDate.ToString("yyyy/MM/dd")}# > FechaInicioVigencia ", "FechaInicioVigencia")
|
||||
If drg IsNot Nothing Then
|
||||
|
||||
TxtImporteAjuste.Text = (TxtPorcentajeAjuste.Text.ToDecimal * TxtPUFactura.Text.ToDecimal).FormatoNumero
|
||||
ImportePagarCliente = TxtImporteAjuste.Text.ToDecimal
|
||||
TxtPorcentajeAjuste.Text = (drg("Valor").ToString.ToDouble / 100).ToString
|
||||
TxtImporteAjuste.Text = (TxtPorcentajeAjuste.Text.ToDecimal * TxtPUFactura.Text.ToDecimal).FormatoNumero
|
||||
ImportePagarCliente = TxtImporteAjuste.Text.ToDecimal
|
||||
|
||||
Dim CargoVendido As Decimal = 0
|
||||
Dim CargoGarantia As Decimal = 0
|
||||
Dim CveTamaño As Integer = 0
|
||||
Dim CargoVendido As Decimal = 0
|
||||
Dim CargoGarantia As Decimal = 0
|
||||
Dim CveTamaño As Integer = 0
|
||||
|
||||
If DdlPSAjuste.SelectedValue.ToEntero > 0 Then
|
||||
Dim Dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, DdlPSAjuste.SelectedValue.ToEntero).FiltroPrimero("")
|
||||
If Dr IsNot Nothing Then
|
||||
CargoGarantia = Dr("Cargo").ToString.ToDecimal
|
||||
If DdlPSAjuste.SelectedValue.ToEntero > 0 Then
|
||||
Dim Dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, DdlPSAjuste.SelectedValue.ToEntero).FiltroPrimero("")
|
||||
If Dr IsNot Nothing Then
|
||||
CargoGarantia = Dr("Cargo").ToString.ToDecimal
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
If DdlPS.SelectedValue.ToEntero > 0 Then
|
||||
Dim Dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, DdlPS.SelectedValue.ToEntero).FiltroPrimero("")
|
||||
If Dr IsNot Nothing Then
|
||||
CveTamaño = Dr("CveTamaño").ToString.ToEntero
|
||||
If DdlPS.SelectedValue.ToEntero > 0 Then
|
||||
Dim Dr As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=DdlPS.SelectedValue.ToEntero).FiltroPrimero("")
|
||||
If Dr IsNot Nothing Then
|
||||
CveTamaño = Dr("CveTamaño").ToString.ToEntero
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
Dim DrCargo As DataRow = GlobalDTAcumTamaños(UsuarioActual.CveEmpresa).FiltroPrimero($" CveTamaño = {CveTamaño}")
|
||||
If DrCargo IsNot Nothing Then
|
||||
Dim DrCargo As DataRow = GlobalDTAcumTamaños(UsuarioActual.CveEmpresa).FiltroPrimero($" CveTamaño = {CveTamaño}")
|
||||
If DrCargo IsNot Nothing Then
|
||||
|
||||
CargoVendido = DrCargo("Cargo").ToString.ToDecimal
|
||||
CargoVendido = DrCargo("Cargo").ToString.ToDecimal
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
'el ajuste no puede ser mayor al precio de lo vendido de nuevo
|
||||
If (TxtPrecio.Text.ToDouble - ((TxtPUFactura.Text.ToDouble - TxtImporteAjuste.Text.ToDouble) - (CargoVendido - CargoGarantia))) < 0 Then
|
||||
'el ajuste no puede ser mayor al precio de lo vendido de nuevo
|
||||
If (TxtPrecio.Text.ToDouble - ((TxtPUFactura.Text.ToDouble - TxtImporteAjuste.Text.ToDouble) - (CargoVendido - CargoGarantia))) < 0 Then
|
||||
|
||||
TxtImporteAjuste.Text = "0.00"
|
||||
CargoGarantia = CargoVendido
|
||||
ImportePagarCliente = 0
|
||||
End If
|
||||
ImportePagarCliente = (TxtPrecio.Text.ToDouble - ((TxtPUFactura.Text.ToDouble - TxtImporteAjuste.Text.ToDouble) - (CargoVendido - CargoGarantia))).ToDecimal
|
||||
|
||||
TxtImporteAjuste.ToolTip = $"La diferencia de ajuste fue: {(TxtPrecio.Text.ToDouble - TxtImporteAjuste.Text.ToDouble).FormatoNumero()}. La diferencia de tamaños fue: {(CargoVendido - CargoGarantia).FormatoNumero}."
|
||||
TxtImporteAjuste.Text = ((TxtPUFactura.Text.ToDouble - TxtImporteAjuste.Text.ToDouble) - (CargoVendido - CargoGarantia)).FormatoNumero
|
||||
'TxtPagarCliente.Text = ImportePagarCliente.FormatoNumero
|
||||
Else
|
||||
Alert("El producto no tiene ajuste en ese periodo", TipoMensaje.MsgAdvertencia)
|
||||
'cuando no está registrada, no da ajuste
|
||||
TxtImporteAjuste.ToolTip = "El producto no tiene ajuste en ese periodo"
|
||||
TxtImporteAjuste.Text = "0.00"
|
||||
CargoGarantia = CargoVendido
|
||||
ImportePagarCliente = 0
|
||||
End If
|
||||
ImportePagarCliente = (TxtPrecio.Text.ToDouble - ((TxtPUFactura.Text.ToDouble - TxtImporteAjuste.Text.ToDouble) - (CargoVendido - CargoGarantia))).ToDecimal
|
||||
|
||||
TxtImporteAjuste.ToolTip = $"La diferencia de ajuste fue: {(TxtPrecio.Text.ToDouble - TxtImporteAjuste.Text.ToDouble).FormatoNumero()}. La diferencia de tamaños fue: {(CargoVendido - CargoGarantia).FormatoNumero}."
|
||||
TxtImporteAjuste.Text = ((TxtPUFactura.Text.ToDouble - TxtImporteAjuste.Text.ToDouble) - (CargoVendido - CargoGarantia)).FormatoNumero
|
||||
'TxtPagarCliente.Text = ImportePagarCliente.FormatoNumero
|
||||
Else
|
||||
Alert("El producto no tiene ajuste en ese periodo", TipoMensaje.MsgAdvertencia)
|
||||
'cuando no está registrada, no da ajuste
|
||||
|
||||
@@ -600,11 +600,13 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
|
||||
|
||||
//
|
||||
|
||||
if (e.Row.DBCampo("PuedeRefacturar").ToString().ToEntero() == 1 && e.Row.DBCampo("CveEstatusFactura").ToString().ToEntero() == 23)
|
||||
if (e.Row.DBCampo("CveEstatusFactura").ToString().ToEntero() == 23)
|
||||
{
|
||||
e.Row.FCLinkButton("LnkValidarRefac").Visible = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (e.Row.DBCampo("PuedeRefacturar") == "0" && e.Row.DBCampo("CveEstatusFactura") == "23" && e.Row.DBCampo("CveVentaSustitucion").ToEntero() > 0)
|
||||
{
|
||||
if (e.Row.FCLinkButton("LnkCancelar") != null) e.Row.FCLinkButton("LnkCancelar").Visible = true;
|
||||
|
||||
@@ -61,29 +61,31 @@ Partial Class Ventas_RepProductosServicios
|
||||
|
||||
#Region " CARGA DATOS INICIALES "
|
||||
|
||||
Private Sub CargaGrupo()
|
||||
DdlGrupo.Items.Insert(0, New ListItem("Categoria", "3"))
|
||||
DdlGrupo.Items.Insert(1, New ListItem("Clasificación", "4"))
|
||||
DdlGrupo.Items.Insert(2, New ListItem("Productos-Servicios", "5"))
|
||||
DdlGrupo.Items.Insert(3, New ListItem("Año", "6"))
|
||||
DdlGrupo.Items.Insert(4, New ListItem("Mes", "7"))
|
||||
DdlGrupo.Items.Insert(5, New ListItem("Año/Mes", "8"))
|
||||
DdlGrupo.Items.Insert(6, New ListItem("Fecha", "9"))
|
||||
DdlGrupo.Items.Insert(7, New ListItem("Cliente", "10"))
|
||||
DdlGrupo.Items.Insert(8, New ListItem("Vendedor", "12"))
|
||||
DdlGrupo.Items.Insert(9, New ListItem("Usuario", "13"))
|
||||
DdlGrupo.Items.Insert(10, New ListItem("Estatus Fact.", "14"))
|
||||
DdlGrupo.Items.Insert(11, New ListItem("Año Ejec.", "15"))
|
||||
DdlGrupo.Items.Insert(12, New ListItem("Mes Ejec.", "16"))
|
||||
DdlGrupo.Items.Insert(13, New ListItem("Año/Mes Ejec.", "17"))
|
||||
DdlGrupo.Items.Insert(14, New ListItem("Fecha Ejec.", "18"))
|
||||
DdlGrupo.Items.Insert(15, New ListItem("Cliente - PS", "20"))
|
||||
DdlGrupo.Items.Insert(16, New ListItem("Sucursal - PS", "21"))
|
||||
DdlGrupo.Items.Insert(17, New ListItem("Familia - Marca - Tipo", "22"))
|
||||
DdlGrupo.Items.Insert(18, New ListItem("Tipo Cliente", "23"))
|
||||
DdlGrupo.Items.Insert(18, New ListItem("Marca", "24"))
|
||||
DdlGrupo.Items.Insert(18, New ListItem("Cliente Sucursal", "26"))
|
||||
DdlGrupo.Items.Insert(18, New ListItem("Giro", "27"))
|
||||
Private Sub CargaGrupo()
|
||||
If DdlProyecto.Visible Then DdlGrupo.Items.Insert(0, New ListItem("Proyecto", "1"))
|
||||
DdlGrupo.Items.Add(New ListItem(LblSubProyecto.Text, "2"))
|
||||
DdlGrupo.Items.Add(New ListItem("Categoria", "3"))
|
||||
DdlGrupo.Items.Add(New ListItem("Clasificación", "4"))
|
||||
DdlGrupo.Items.Add(New ListItem("Productos-Servicios", "5"))
|
||||
DdlGrupo.Items.Add(New ListItem("Año", "6"))
|
||||
DdlGrupo.Items.Add(New ListItem("Mes", "7"))
|
||||
DdlGrupo.Items.Add(New ListItem("Año/Mes", "8"))
|
||||
DdlGrupo.Items.Add(New ListItem("Fecha", "9"))
|
||||
DdlGrupo.Items.Add(New ListItem("Cliente", "10"))
|
||||
DdlGrupo.Items.Add(New ListItem("Vendedor", "12"))
|
||||
DdlGrupo.Items.Add(New ListItem("Usuario", "13"))
|
||||
DdlGrupo.Items.Add(New ListItem("Estatus Fact.", "14"))
|
||||
DdlGrupo.Items.Add(New ListItem("Año Ejec.", "15"))
|
||||
DdlGrupo.Items.Add(New ListItem("Mes Ejec.", "16"))
|
||||
DdlGrupo.Items.Add(New ListItem("Año/Mes Ejec.", "17"))
|
||||
DdlGrupo.Items.Add(New ListItem("Fecha Ejec.", "18"))
|
||||
DdlGrupo.Items.Add(New ListItem("Cliente - PS", "20"))
|
||||
DdlGrupo.Items.Add(New ListItem("Sucursal - PS", "21"))
|
||||
DdlGrupo.Items.Add(New ListItem("Familia - Marca - Tipo", "22"))
|
||||
DdlGrupo.Items.Add(New ListItem("Tipo Cliente", "23"))
|
||||
DdlGrupo.Items.Add(New ListItem("Marca", "24"))
|
||||
DdlGrupo.Items.Add(New ListItem("Cliente Sucursal", "26"))
|
||||
DdlGrupo.Items.Add(New ListItem("Giro", "27"))
|
||||
|
||||
DdlGrupo.DataBind()
|
||||
DdlGrupo.SelectedValueExist("8")
|
||||
@@ -157,9 +159,9 @@ Partial Class Ventas_RepProductosServicios
|
||||
DdlClienteClasificacion.DataBind()
|
||||
DdlClienteClasificacion.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
CargaGrupo()
|
||||
CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, LblProyecto, LblSubProyecto, divProyecto:=DivProyecto)
|
||||
CargarCentrosDeCosto(Nothing, DdlSubProyectoEjecucion, Nothing, Nothing)
|
||||
CargarCentrosDeCosto(Nothing, DdlSubProyectoEjecucion, Nothing, Nothing)
|
||||
CargaGrupo()
|
||||
|
||||
TipoCambio = 1
|
||||
TCEspecifico = 0
|
||||
|
||||
@@ -18318,8 +18318,8 @@ Partial Class Ventas
|
||||
Return False
|
||||
End If
|
||||
|
||||
If PU <= 0 AndAlso UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
|
||||
Alert("El precio debe ser mayor a 0", TipoMensaje.MsgAdvertencia)
|
||||
If PU <= 0 Then
|
||||
Alert("No se puede vender a un importe de cero", TipoMensaje.MsgAdvertencia)
|
||||
Return False
|
||||
End If
|
||||
|
||||
@@ -18331,10 +18331,10 @@ Partial Class Ventas
|
||||
ObjVentas.Dispose()
|
||||
|
||||
'VALIDA PRECIO CERO (0)
|
||||
If UsuarioActual.Empresa.Funcionalidad(139).ToString().ToEntero() > 0 And PU = 0 And DtPromociones.FiltroPrimeroValor("PUPromocion", $"CvePS = {CvePS}").ToDecimal > 0 Then
|
||||
Alert($"El producto <b>{HdnPS.Value}</b>. No se puede vender a un importe de cero ($0)", TipoMensaje.MsgAdvertencia)
|
||||
Return False
|
||||
End If
|
||||
'If UsuarioActual.Empresa.Funcionalidad(139).ToString().ToEntero() > 0 And PU = 0 And DtPromociones.FiltroPrimeroValor("PUPromocion", $"CvePS = {CvePS}").ToDecimal > 0 Then
|
||||
' Alert($"El producto <b>{HdnPS.Value}</b>. No se puede vender a un importe de cero ($0)", TipoMensaje.MsgAdvertencia)
|
||||
' Return False
|
||||
'End If
|
||||
|
||||
'SI NO TIENE LA FUNCIONALIDAD VALIDARA LAS MONEDAS
|
||||
If UsuarioActual.Empresa.Funcionalidad(524) <> "" Then
|
||||
@@ -23674,16 +23674,44 @@ Partial Class Ventas
|
||||
Protected Sub LBDevolucionAlmacen_Click(sender As Object, e As EventArgs)
|
||||
Dim SaldoAlmacen As Decimal = 0
|
||||
|
||||
Dim ObjVentas As New ClsVentas
|
||||
If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa, VerificaAlmacen:=True) Then
|
||||
If ObjVentas.DtResultados.Rows.Count > 0 Then
|
||||
Dim DbRowVenta As DataRow = ObjVentas.DtResultados.Rows(0)
|
||||
Me.DevolucionAlmacen = DbRowVenta("EsDevolucionVenta").ToString().ToEntero()
|
||||
SaldoAlmacen = DbRowVenta("SaldoAlmacen").ToString().ToDecimal()
|
||||
Dim ErrorVerificacion As Boolean = False
|
||||
|
||||
Using ObjInv As New ClsInventarios
|
||||
If ObjInv.GetInv_Mov(CveVenta, UsuarioActual.CveEmpresa) Then
|
||||
If ObjInv.DtResultados.Rows.Count > 0 Then
|
||||
TieneAlmacen = True
|
||||
End If
|
||||
Else
|
||||
ErrorVerificacion = True
|
||||
End If
|
||||
End Using
|
||||
|
||||
If ErrorVerificacion Then
|
||||
Alert("No se pudieron verificar los movimientos de almacen del documento.", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If SaldoAlmacen >= 0 Then
|
||||
If Not TieneAlmacen Then
|
||||
Alert("El documento no tiene movimientos de almacen.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Using ObjVentas As New ClsVentas
|
||||
If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa, VerificaAlmacen:=True) Then
|
||||
If ObjVentas.DtResultados.Rows.Count > 0 Then
|
||||
Dim DbRowVenta As DataRow = ObjVentas.DtResultados.Rows(0)
|
||||
Me.DevolucionAlmacen = DbRowVenta("EsDevolucionVenta").ToString().ToEntero()
|
||||
SaldoAlmacen = DbRowVenta("SaldoAlmacen").ToString().ToDecimal()
|
||||
End If
|
||||
End If
|
||||
End Using
|
||||
|
||||
If DdlTipoComprobante.SelectedValue.ToString() = "Rem" AndAlso SaldoAlmacen = 0 Then
|
||||
Alert("El documento ya fue devuelto.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If DdlTipoComprobante.SelectedValue.ToString() = "Ing" AndAlso SaldoAlmacen = 0 Then
|
||||
Alert("El movimiento ya fue devuelto.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
@@ -23691,17 +23719,17 @@ Partial Class Ventas
|
||||
If Me.DevolucionAlmacen.Contiene(2) Then
|
||||
InicializaDevolucionAlmacen()
|
||||
UpnTools.Update()
|
||||
ObjVentas.Dispose()
|
||||
Alert("El movimiento ya fue devuelto.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim EstatusDevolucion = If(Me.DevolucionAlmacen = 0, 1, 0)
|
||||
|
||||
If ObjVentas.UpdateVentasDevolucionAlmacen(EstatusDevolucion, CveVenta) Then
|
||||
Dim ObjV As New ClsVentas
|
||||
If ObjV.UpdateVentasDevolucionAlmacen(EstatusDevolucion, CveVenta) Then
|
||||
Alert("La solicitud de Devolución de Almacén se guardó correctamente")
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
ObjV.Dispose()
|
||||
|
||||
Me.DevolucionAlmacen = EstatusDevolucion
|
||||
|
||||
@@ -24693,28 +24721,9 @@ Partial Class Ventas
|
||||
End Sub
|
||||
|
||||
Private Sub LbCancelarDocumento_Click(sender As Object, e As EventArgs) Handles LbCancelarDocumento.Click
|
||||
Dim SaldoAlmacen As Decimal = 0
|
||||
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Dev", "Egs") Then
|
||||
|
||||
Dim sb As New StringBuilder()
|
||||
Dim sbExtra As New StringBuilder()
|
||||
sb.Append("La factura se encuentra en el siguiente estatus del SAT:<br/>")
|
||||
|
||||
Dim TotalT As Decimal = TxtTotal.Text.ToDecimal
|
||||
Dim RFCReceptor As String = ""
|
||||
|
||||
If String.IsNullOrEmpty(Me.RFCReceptorVenta) Then
|
||||
RFCReceptor = LblRFC.Text.Trim
|
||||
|
||||
'SI SE FACTURO LA SUCURSAL DEL CLIENTE TOMA EL RFC DE ESTA
|
||||
If FacturarSucursal AndAlso Me.ClienteSucursal IsNot Nothing Then
|
||||
RFCReceptor = Me.ClienteSucursal.RFC
|
||||
End If
|
||||
Else
|
||||
RFCReceptor = Me.RFCReceptorVenta
|
||||
End If
|
||||
|
||||
Dim SaldoAlmacen As Decimal = 0
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Dev") Then
|
||||
|
||||
Dim PermiteCancelar As Boolean = True
|
||||
Using ObjVentas As New ClsVentas
|
||||
@@ -24737,12 +24746,41 @@ Partial Class Ventas
|
||||
Else
|
||||
PermiteCancelar = False
|
||||
End If
|
||||
|
||||
If PermiteCancelar And SaldoVenta <> 0 Then
|
||||
If UsuarioActual.TienePermisoProceso(269) AndAlso Not DevolucionAlmacen = 2 Then
|
||||
DivDevAlm.Visible = True
|
||||
TieneAlmacen = True
|
||||
End If
|
||||
End If
|
||||
|
||||
End Using
|
||||
|
||||
If Not PermiteCancelar Then
|
||||
Alert("La venta no se puede cancelar si no ha sido surtida previamente", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Dev", "Egs") Then
|
||||
|
||||
Dim sb As New StringBuilder()
|
||||
Dim sbExtra As New StringBuilder()
|
||||
sb.Append("La factura se encuentra en el siguiente estatus del SAT:<br/>")
|
||||
|
||||
Dim TotalT As Decimal = TxtTotal.Text.ToDecimal
|
||||
Dim RFCReceptor As String = ""
|
||||
|
||||
If String.IsNullOrEmpty(Me.RFCReceptorVenta) Then
|
||||
RFCReceptor = LblRFC.Text.Trim
|
||||
|
||||
'SI SE FACTURO LA SUCURSAL DEL CLIENTE TOMA EL RFC DE ESTA
|
||||
If FacturarSucursal AndAlso Me.ClienteSucursal IsNot Nothing Then
|
||||
RFCReceptor = Me.ClienteSucursal.RFC
|
||||
End If
|
||||
Else
|
||||
RFCReceptor = Me.RFCReceptorVenta
|
||||
End If
|
||||
|
||||
|
||||
Dim SWatch As New Stopwatch
|
||||
@@ -25057,7 +25095,7 @@ Partial Class Ventas
|
||||
' CancelarRefacturada()
|
||||
'End If
|
||||
|
||||
Dim ObjFacturaCancelacion As New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=True)
|
||||
Dim ObjFacturaCancelacion As New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=True, VerificaAlmacen:=True)
|
||||
Try
|
||||
Dim resp As Modelos.Factura.MCancelacionVentaMensaje = Nothing
|
||||
Dim strMensaje As New StringBuilder()
|
||||
|
||||
Reference in New Issue
Block a user