This commit is contained in:
2019-10-28 16:22:36 -07:00
parent 99cc487117
commit b79d46a4b4
3 changed files with 72 additions and 53 deletions

View File

@@ -1161,8 +1161,19 @@ Partial Class Inventarios_EntradasSalidas
If DdlAlmacen.SelectedValue.ToEntero <= 0 Then Alert("Seleccione un almacen", TipoMensaje.MsgAdvertencia) : RegistraScript("playsonidito('142608__autistic-lucario__error.wav')") : DdlProducto2.SelectedText = "" : Exit Sub If DdlAlmacen.SelectedValue.ToEntero <= 0 Then Alert("Seleccione un almacen", TipoMensaje.MsgAdvertencia) : RegistraScript("playsonidito('142608__autistic-lucario__error.wav')") : DdlProducto2.SelectedText = "" : Exit Sub
Dim Valido As Boolean = True Dim Valido As Boolean = True
Dim RowPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS).Rows(0)
Dim CveMetodoInventario As Integer = RowPS("Inv_CveMetodoInventario").ToString().ToEntero()
If CveMetodoInventario = 5 And (String.IsNullOrEmpty(SerieLote.Trim()) OrElse SerieLote = "-1") Then
Valido = False
Alert("El producto requiere Serie-Lote", TipoMensaje.MsgAdvertencia)
End If
'salida 'salida
If DdlConcepto.SelectedValue.Contiene({"3", "5", "7", "8", "11", "12", "13", "15", "16", "17", "20", "21", "30", "31"}) Then ' salida de almacen If Valido AndAlso DdlConcepto.SelectedValue.Contiene({"3", "5", "7", "8", "11", "12", "13", "15", "16", "17", "20", "21", "30", "31"}) Then ' salida de almacen
Dim Existencia As Double = GetExistencias(CvePS, CveUM, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, If(SerieLote = "", "-1", SerieLote), If(Lote = "", "-1", Lote), If(Batch = "", "-1", Batch)) Dim Existencia As Double = GetExistencias(CvePS, CveUM, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, If(SerieLote = "", "-1", SerieLote), If(Lote = "", "-1", Lote), If(Batch = "", "-1", Batch))
LbAgregar.ToolTip = Existencia.ToString LbAgregar.ToolTip = Existencia.ToString
If Existencia - Cantidad - DtMovimientos.SUM("Cantidad", $"CvePS = {CvePS} AND CveUM = {CveUM} {If(SerieLote <> "", $" AND SerieLote = '{SerieLote}'", "")}") < 0 Then If Existencia - Cantidad - DtMovimientos.SUM("Cantidad", $"CvePS = {CvePS} AND CveUM = {CveUM} {If(SerieLote <> "", $" AND SerieLote = '{SerieLote}'", "")}") < 0 Then
@@ -1181,6 +1192,7 @@ Partial Class Inventarios_EntradasSalidas
End If End If
End If End If
If Valido Then If Valido Then
Dim CveClasificacion As Integer Dim CveClasificacion As Integer
Dim dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS).FiltroPrimero("", "PS") Dim dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS).FiltroPrimero("", "PS")

View File

@@ -2882,13 +2882,15 @@ Partial Class OC
Promocion = TxtPromocion.Text.Trim Promocion = TxtPromocion.Text.Trim
Try Try
If ChkCotizacion.Checked AndAlso gvCotizaciones.Rows.Count > 0 AndAlso (NumCotizacionesGanadoras > 0 OrElse Not (NumCotizacionesGanadoras <= 0 AndAlso CveConfianzaProveedor = 1)) Then Dim NoProveedoresCot As Integer = DtDetalle.COUNT("CveProveedor", "CveProveedor > 0")
If ChkCotizacion.Checked AndAlso NoProveedoresCot > 0 AndAlso (NumCotizacionesGanadoras > 0 OrElse Not (NumCotizacionesGanadoras <= 0 AndAlso CveConfianzaProveedor = 1)) Then
Dim CveProveedor = -1 Dim CveProveedor = -1
Dim TotalCot = 0.0, IVACot = 0D, RetIVA = 0.0, RetISR = 0.0, PorIVA = 0.0, Porcentaje = 0.0 Dim TotalCot = 0.0, IVACot = 0D, RetIVA = 0.0, RetISR = 0.0, PorIVA = 0.0, Porcentaje = 0.0
Dim IdPoliza = -1 Dim IdPoliza = -1
For Each dr As DataRow In DtDetalle.FiltraParametros("", "CveProveedor").Rows For Each dr As DataRow In DtDetalle.FiltraParametros("CveProveedor > 0", "CveProveedor").Rows
'SI ES DIFERENTE PROVEEDOR AGREGA UNA OC 'SI ES DIFERENTE PROVEEDOR AGREGA UNA OC
If CveProveedor <> dr("CveProveedor").ToString.ToEntero Then If CveProveedor <> dr("CveProveedor").ToString.ToEntero Then

View File

@@ -122,14 +122,18 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
sb.AppendFormat("Es Cancelable: {0} <br/>", string.IsNullOrEmpty(resp.EsCancelable) ? "Desconocido" : resp.EsCancelable); sb.AppendFormat("Es Cancelable: {0} <br/>", string.IsNullOrEmpty(resp.EsCancelable) ? "Desconocido" : resp.EsCancelable);
sb.AppendFormat("Estatus de Cancelación: {0} <br/><br/>", string.IsNullOrEmpty(resp.EsCancelable) ? "Desconocido" : resp.EstatusCancelacion); sb.AppendFormat("Estatus de Cancelación: {0} <br/><br/>", string.IsNullOrEmpty(resp.EsCancelable) ? "Desconocido" : resp.EstatusCancelacion);
//var FueCancelado = CancelarDocumento(CveVenta, CveEstatus, CveCliente, Folio, uuid, CancelacionAcuse, CancelacionFecha, TipoDocto, total.ToDouble(), UsuarioActual.Empresa.CvePAC).Mensaje; if (!UsuarioActual.Empresa.FacturaProduccion && (string.IsNullOrEmpty(uuid) || uuid.Contains("test")))
{
//sb.AppendFormat("{0} <br/>", FueCancelado); var FueCancelado = CancelarDocumento(CveVenta, CveEstatus, CveCliente, Folio, uuid, CancelacionAcuse, CancelacionFecha, TipoDocto, total.ToDouble(), UsuarioActual.Empresa.CvePAC).Mensaje;
//if (CveEstatus.Contiene(4, 5) && EsRefacturacion)
//{
// Response.Redirect(string.Format("Ventas.aspx?CveDevolucion={0}&NuevaFactura=1", CveVenta));
//}
sb.AppendFormat("{0} <br/>", FueCancelado);
if (CveEstatus.Contiene(4, 5) && EsRefacturacion)
{
Response.Redirect(string.Format("Ventas.aspx?CveDevolucion={0}&NuevaFactura=1", CveVenta));
}
}
else
{
if ((resp.EsCancelable.ToUpper() == "NO CANCELABLE")) if ((resp.EsCancelable.ToUpper() == "NO CANCELABLE"))
{ {
sb.Append("Esta factura no es cancelable."); sb.Append("Esta factura no es cancelable.");
@@ -175,6 +179,7 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
ObjVentas.Dispose(); ObjVentas.Dispose();
} }
} }
}
else else
{ {
sb.Append("No se pudo comprobar la vigencia de la factura."); sb.Append("No se pudo comprobar la vigencia de la factura.");