This commit is contained in:
2023-07-10 16:59:57 -07:00
3 changed files with 44 additions and 35 deletions

View File

@@ -557,8 +557,8 @@ Public Class Timbrado
resp = conector.ObtieneCFDI(RFCEmisor, FolioFiscal)
MsgCancelacion.AppendFormat("-3.3")
'VERIFICA SI SE CANCELO O FUE CANCELADO PREVIAMENTE
If resultadoCancelacion.Exitoso OrElse resultadoCancelacion.NumeroError = "202" Then
'VERIFICA SI SE CANCELO O FUE CANCELADO PREVIAMENTE (CODIGO DE ERROR "330279")
If resultadoCancelacion.Exitoso OrElse resultadoCancelacion.NumeroError.Contiene("202", "330279") Then
MsgCancelacion.AppendFormat("-3.4")
CancelacionMensaje = resultadoCancelacion.Descripcion
Dim xmlDoc As New System.Xml.XmlDocument()

View File

@@ -638,12 +638,12 @@
<td width="80px">Serie:</td>
<td>
<asp:TextBox runat="server" ID="TxtSerie" ClientIDMode="Static" Width="200px" />
<asp:RequiredFieldValidator ID="RFVSerie" runat="server" ControlToValidate="TxtSerie" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Serie''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAgregaSerie"></asp:RequiredFieldValidator>
<%-- <asp:RequiredFieldValidator ID="RFVSerie" runat="server" ControlToValidate="TxtSerie" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Serie''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAgregaSerie"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCESerie" runat="server" HighlightCssClass="vco" TargetControlID="RFVSerie" Width="300px"></ajax:ValidatorCalloutExtender>
<asp:CustomValidator id="ReVTxtSerie" runat="server" ControlToValidate="TxtSerie" Display="None" ClientValidationFunction="TamanioSerie"
<asp:CustomValidator id="ReVTxtSerie" runat="server" ControlToValidate="TxtSerie" Display="None" ClientValidationFunction="TamanioSerie"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Serie''</b> debe tener un minimo de 6 caracteres." ValidationGroup="GrpAgregaSerie" />
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender3" runat="server" HighlightCssClass="vco" TargetControlID="ReVTxtSerie" Width="300px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender3" runat="server" HighlightCssClass="vco" TargetControlID="ReVTxtSerie" Width="300px"></ajax:ValidatorCalloutExtender>--%>
</td>
<td width="80px" runat="server" id="TdCaducidad1">Fecha Caducidad:</td>
<td runat="server" id="TdCaducidad2">

View File

@@ -1142,11 +1142,11 @@ Partial Class Inventarios_EntregaAlmacen
If CveMetodoInventario = 6 Then
RegistraScript("$('#DivLote').modal('show')")
RegistraScript("$('#DivLote').modal({backdrop: 'static', keyboard: false});")
CargaLote()
UpLoteBatch.Update()
Else
RegistraScript("$('#DivSerie').modal('show')")
RegistraScript("$('#DivSerie').modal({backdrop: 'static', keyboard: false});")
CargaSerie()
UpSerie.Update()
End If
@@ -1173,7 +1173,7 @@ Partial Class Inventarios_EntregaAlmacen
End Sub
Private Sub CargaSerie(Optional CerrarCompletado As Boolean = False, Optional CargaMasivo As Boolean = False)
If Not CargaMasivo Then RegistraScript("$('#DivSerie').modal('show')", "show")
If Not CargaMasivo Then RegistraScript("$('#DivSerie').modal({backdrop: 'static', keyboard: false})", "show")
Dim AplicaCaducidad = False
Dim dttt As DataTable = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=CvePSSerie)
@@ -1270,8 +1270,7 @@ Partial Class Inventarios_EntregaAlmacen
Dim Series As String = Nothing
Series = TxtSerie.Text.Trim
Series = Series.Remove(0, 1)
Series = Series.Remove(Series.Length - 1, 1)
Series = Series.Replace("*", "")
ArraySeries = Series.Trim.Split(","c)
For i As Integer = 0 To ArraySeries.Length - 1
@@ -1285,7 +1284,12 @@ Partial Class Inventarios_EntregaAlmacen
Private Sub AgregaSerie(Serie As String, Tipo As Integer, Optional CargaMasivo As Boolean = False)
If Serie.Trim = "" Then
Alert("El campo Serie es obligatorio. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
Alert("El campo 'Serie' es obligatorio. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If Serie.Trim.Length < 6 Then
Alert("El campo 'Serie' debe tener minimo 6 caracteres. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
@@ -1303,26 +1307,26 @@ Partial Class Inventarios_EntregaAlmacen
'Valida Existencia
'If TipoMovimiento = 1 Then
' Dim ObjInventarios As New ClsInventarios
' Dim Existencia = ObjInventarios.GetExistenciasPS(CvePSSerie, CveUMSerie, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero(), FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Serie:=Serie, CveVendedor:=CveVendedor, CveSubProyecto:=CveSubProyecto, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeApartados:=If(TipoEntrega = 2, 1, -1))
' If Existencia < 1 Then
' Alert($"No hay existencia suficiente del producto <b>""{PSSerie}""</b> con la Serie definida <b>""{Serie}""</b>. Por favor rectifique y vuelva a intentar", TipoMensaje.MsgAdvertencia, If(Tipo = 2, "window.setTimeout(Focus,200);", ""))
' RegistraScript("playsonidito('142608__autistic-lucario__error.wav')", "Error2")
' ObjInventarios.Dispose()
' Exit Sub
' End If
' ObjInventarios.Dispose()
'Else
' If DtExistencias IsNot Nothing Then
' Dim Existencia = DtExistencias.SUM("Cantidad", $"CvePS = {CvePSSerie} AND CveUM = {CveUMSerie} AND Serie = '{Serie}'")
' If Existencia < 1 Then
' Alert($"No hay existencia suficiente del producto <b>""{PSSerie}""</b> con la Serie definida <b>""{Serie}""</b>. Por favor rectifique y vuelva a intentar", TipoMensaje.MsgAdvertencia, If(Tipo = 2, "window.setTimeout(Focus,200);", ""))
' RegistraScript("playsonidito('142608__autistic-lucario__error.wav')", "Error3")
' Exit Sub
' End If
' End If
'End If
If TipoMovimiento = 1 Then
Dim ObjInventarios As New ClsInventarios
Dim Existencia = ObjInventarios.GetExistenciasPS(CvePSSerie, CveUMSerie, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero(), FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Serie:=Serie, CveVendedor:=CveVendedor, CveSubProyecto:=CveSubProyecto, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeApartados:=If(TipoEntrega = 2, 1, -1))
If Existencia < 1 Then
Alert($"No hay existencia suficiente del producto <b>""{PSSerie}""</b> con la Serie definida <b>""{Serie}""</b>. Por favor rectifique y vuelva a intentar", TipoMensaje.MsgAdvertencia, If(Tipo = 2, "window.setTimeout(Focus,200);", ""))
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')", "Error2")
ObjInventarios.Dispose()
Exit Sub
End If
ObjInventarios.Dispose()
Else
If DtExistencias IsNot Nothing Then
Dim Existencia = DtExistencias.SUM("Cantidad", $"CvePS = {CvePSSerie} AND CveUM = {CveUMSerie} AND Serie = '{Serie}'")
If Existencia < 1 Then
Alert($"No hay existencia suficiente del producto <b>""{PSSerie}""</b> con la Serie definida <b>""{Serie}""</b>. Por favor rectifique y vuelva a intentar", TipoMensaje.MsgAdvertencia, If(Tipo = 2, "window.setTimeout(Focus,200);", ""))
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')", "Error3")
Exit Sub
End If
End If
End If
Dim Row = DtDatosDetalle.NewRow
@@ -1433,7 +1437,7 @@ Partial Class Inventarios_EntregaAlmacen
End Sub
Private Sub CargaLote(Optional CerrarCompletado As Boolean = False)
RegistraScript("$('#DivLote').modal('show')")
RegistraScript("$('#DivLote').modal({backdrop: 'static', keyboard: false})")
GvLote.Columns(2).HeaderText = UsuarioActual.Empresa.Funcionalidad(147)
GvLote.DataSource = DtDatosDetalleLote.FiltraParametros(String.Format("ConsecId = {0}", CveConsecSerie), "Consec DESC")
GvLote.DataBind()
@@ -3353,6 +3357,11 @@ Partial Class Inventarios_EntregaAlmacen
Dim CveSeccionAlmacen As Integer = -1
For Each Dr As DataRow In DtDatos.Rows
If ErrorMovInv Then
Exit For
End If
FechaCaducidad = If(CBool(Dr("AplicaCaducidad")) AndAlso Dr("FechaCaducidad").ToString() <> "", Dr("FechaCaducidad").ToString().ToDate, MinFecha)
Lote = If(CBool(Dr("AplicaLote")), Dr("Lote").ToString(), "-1")
CveSeccionAlmacen = If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString().ToEntero(), -1)
@@ -3363,7 +3372,7 @@ Partial Class Inventarios_EntregaAlmacen
For Each Dr1 As DataRow In DtDetalle.Rows
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, 1, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), 0, Serie:=Dr1("Serie").ToString(), Lote:=Lote, FechaCaducidad:=FechaCaducidad, CveSeccionAlmacen:=CveSeccionAlmacen, CveVentaDetalle:=-1, CveContratoDetalle:=Dr("CveContratoDetalle").ToString().ToEntero()) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al procesar los conceptos con serie. Por favor vuelva a intentar."
TextoError = $"Ocurrió un error al procesar los conceptos con serie '{Dr1("Serie").ToString()}'. Por favor vuelva a intentar."
Exit For
End If
Next
@@ -3990,7 +3999,7 @@ Partial Class Inventarios_EntregaAlmacen
UpVerSugerencias.Update()
RegistraScript("$('#ModalVerSugerencias').modal()")
RegistraScript("$('#ModalVerSugerencias').modal({backdrop: 'static', keyboard: false});")
End Sub
Protected Sub BtnAplicarSugerencias_Click(sender As Object, e As EventArgs)
@@ -4171,7 +4180,7 @@ Partial Class Inventarios_EntregaAlmacen
HdnCveVenta.Value = CveVentaSurtir.ToString
CargaModalCombosDirecciones(CveCliente, CveDireccionEnvio)
RegistraScript("$('#DivEditarEntrega').modal('show');")
RegistraScript("$('#DivEditarEntrega').modal({backdrop: 'static', keyboard: false});")
End Sub