This commit is contained in:
Oscar Irigoyen
2022-09-27 11:21:35 -07:00
7 changed files with 1662 additions and 1601 deletions

View File

@@ -16708,11 +16708,11 @@ Partial Class Compras_Compras
End If
If UsuarioActual.Empresa.CveEmpresa = 158 AndAlso DdlSubProyecto.SelectedValue.ToEntero > 0 AndAlso DdlSubProyecto.SelectedValue.ToEntero.Contiene(11881, 11882, 11886) Then
RfvDdlCultivosCuadro.Visible = True
Else
RfvDdlCultivosCuadro.Visible = False
End If
'If UsuarioActual.Empresa.CveEmpresa = 158 AndAlso DdlSubProyecto.SelectedValue.ToEntero > 0 AndAlso DdlSubProyecto.SelectedValue.ToEntero.Contiene(11881, 11882, 11886) Then
' RfvDdlCultivosCuadro.Visible = True
'Else
' RfvDdlCultivosCuadro.Visible = False
'End If
End Sub
Private Sub DdlPSChange()

View File

@@ -219,6 +219,16 @@ Partial Class PopUpAuxiliar
Else
e.Row.FCLinkButton("LnkDesAplicar").CommandArgument = String.Format("{0}|{1}|{2}", e.Row.DBCampo("CvePrePoliza"), e.Row.DBCampo("CveVentaAmortizacion"), e.Row.DBCampo("CveVenta"))
End If
ElseIf e.Row.DBCampo("CveConceptoContable").Contiene("60", "272") Then 'desaplicar NC Compra
e.Row.FCLinkButton("LnkDesAplicar").Visible = True
e.Row.FCLinkButton("LnkDesAplicar").CommandName = "DesAplicarCompra"
e.Row.FCLinkButton("imgD").Visible = False
If e.Row.DBCampo("CveConceptoContable").Contiene("272") Then
e.Row.FCLinkButton("LnkDesAplicar").CommandArgument = String.Format("{0}|{1}|{2}", e.Row.DBCampo("CvePrePoliza"), e.Row.DBCampo("CveCompra"), e.Row.DBCampo("CveCompraAmortizacion"))
Else
e.Row.FCLinkButton("LnkDesAplicar").CommandArgument = String.Format("{0}|{1}|{2}", e.Row.DBCampo("CvePrePoliza"), e.Row.DBCampo("CveCompraAmortizacion"), e.Row.DBCampo("CveCompra"))
End If
End If
If e.Row.DBCampo("TipoReferencia").ToEntero = 1 Then
@@ -387,7 +397,6 @@ Partial Class PopUpAuxiliar
Else
Return ViewState("CvePrePolizaNegativa").ToString.ToEntero
End If
End Get
Set(value As Integer)
ViewState("CvePrePolizaNegativa") = value
@@ -395,7 +404,6 @@ Partial Class PopUpAuxiliar
End Property
Private Sub AgregaPolizaNegativo(CvePrePoliza As Integer)
Dim ObjContabilidad As New ClsContabilidad
@@ -405,8 +413,6 @@ Partial Class PopUpAuxiliar
Dim CvePrePolizaNueva As Integer = ObjContabilidad.AddPrePolizasNegativa(CvePrePoliza, UsuarioActual.CveUsuario, TxtConceptoCancelacion.Text, UsuarioActual.CveEmpresa, TxtFechaCancelacion.Text.ToDate)
If Not CvePrePolizaNueva > 0 Then
TieneError = True
End If
@@ -482,6 +488,40 @@ Partial Class PopUpAuxiliar
End If
If e.CommandName = "DesAplicarCompra" Then
Dim CvePrePoliza, CveCompra, CveCompraAmortizacion As Integer
Dim TieneError = False
Dim St As String() = e.CommandArgument.ToString.Split("|"c)
If St.Length > 0 Then
CvePrePoliza = St(0).ToEntero
CveCompra = St(1).ToEntero
CveCompraAmortizacion = St(2).ToEntero
End If
If CvePrePoliza > 0 Then
Dim Conta As New ClsContabilidad()
Conta.IniciaTransacSQL()
If Not Conta.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False) Then
TieneError = True
End If
If Not TieneError AndAlso Not Conta.DesAplicarPago(CvePrePoliza, 272, CveCompra, CveCompraAmortizacion) Then
TieneError = True
End If
If Not TieneError Then
Conta.Commit()
Alert("Pago Desaplicado.", TipoMensaje.ToastInformacion)
Else
Conta.RollBack()
Alert("Pago no fue desaplicado.", TipoMensaje.ToastError)
End If
End If
End If
End Sub

File diff suppressed because it is too large Load Diff

View File

@@ -945,6 +945,7 @@ Partial Class Inventarios_TraspasoAlmacen
Serie = If(gvr.DataKey("Serie") = "", "-1", gvr.DataKey("Serie"))
Lote = If(gvr.DataKey("Lote") = "", "-1", gvr.DataKey("Lote"))
FechaCaducidad = If(gvr.DataKey("FechaCaducidad") = "", MinFecha, gvr.DataKey("FechaCaducidad").ToDate)
Dim MsgAdicional As String = ""
If ObjInventario.GetExistenciasProducto(gvr.DataKey("CvePS").ToEntero, gvr.DataKey("CveUM").ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie, Lote:=Lote, Caducidad:=FechaCaducidad) Then
'si hay existencia en almacen costeado, lo tengo que sacar
@@ -957,15 +958,11 @@ Partial Class Inventarios_TraspasoAlmacen
' para asegurarnos que lo pendiente por surtir se pueda surtir con otras series, consultamos de nuevo, pero a nivel producto, para checar existencia
If ExistenciaSinPendiente > 0 AndAlso Existencia <= 0 AndAlso PendienteporSurtir > 0 Then
MsgAdicional = " Pendiente por surtir: " & PendienteporSurtir.FormatoNumero(0)
If ObjInventario.GetExistenciasProducto(gvr.DataKey("CvePS").ToEntero, gvr.DataKey("CveUM").ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd 23:59")) Then
'si hay existencia en almacen costeado, lo tengo que sacar
Existencia = ObjInventario.DtResultados.FiltroPrimeroValor("ExistenciaFinal", String.Format("CveAlmacen = {0}", DdlAlmacenOrigen.SelectedValue)).ToDecimal
'si la existencia del producto en general, supera a lo pendiente, entonces la serie si se puede sacar.
If Existencia > PendienteporSurtir Then
Existencia = ExistenciaSinPendiente
Else
Existencia = ExistenciaSinPendiente - PendienteporSurtir
End If
End If
End If
@@ -975,7 +972,7 @@ Partial Class Inventarios_TraspasoAlmacen
If Existencia < 0 Then
ErrorExistencia = True
TextoExistencia.AppendFormat("-<b>#{0}</b> {1} {2} &nbsp; Existencia: <b>{3}</b><br/>", gvr.DataKey("No"), gvr.DataKey("PS"), If(gvr.DataKey("Serie").ToString().Trim().Length > 0, $" &nbsp; Serie: <b>{gvr.DataKey("Serie")}</b>", ""), (Existencia + gvr.FCTextBox("TxtCantidad2").Text.ToEntero))
TextoExistencia.AppendFormat("-<b>#{0}</b> {1} {2} &nbsp; Existencia: <b>{3}</b>{4}<br/>", gvr.DataKey("No"), gvr.DataKey("PS"), If(gvr.DataKey("Serie").ToString().Trim().Length > 0, $" &nbsp; Serie: <b>{gvr.DataKey("Serie")}</b>", ""), (Existencia + gvr.FCTextBox("TxtCantidad2").Text.ToEntero), MsgAdicional)
End If
Next

View File

@@ -338,7 +338,7 @@
<div class="col-md-3" runat="server" id="DvNumRemision2" visible="false">
<asp:TextBox ID="TxtNumRemision" runat="server" MaxLength="10" Width="80%" onblur="ValidaNumRemision()"></asp:TextBox>
<asp:Button ID="BtnValidaNumRemision" ClientIDMode="Static" OnClick="BtnValidaNumRemision_Click" Style="display: none;" runat="server" />
<asp:LinkButton runat="server" Visible="false" ID="LnkActualziarNumRemision" OnClick="LnkActualziarNumRemision_Click"
<asp:LinkButton runat="server" Visible="false" ID="LnkActualizarNumRemision" OnClick="LnkActualizarNumRemision_Click"
data-toggle="confirmation" data-popout="true" data-original-title="Actualizar número remisión"
data-btn-ok-label="si" Text="<i class='fa fa-check' style='color:green'></i>" CssClass="btn btn-default btn-circle btn-xs"
ToolTip="¿Está seguro que desea actualizar el número de remisión?" />

View File

@@ -844,11 +844,8 @@ Partial Class OC_OC
DdlCultivosCuadro.DataBind()
DdlCultivosCuadro.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
If UsuarioActual.CveRol = 1 Then
DvNumRemision1.Visible = True
DvNumRemision2.Visible = True
End If
DvNumRemision1.Visible = True
DvNumRemision2.Visible = True
End If
@@ -2637,7 +2634,7 @@ Partial Class OC_OC
If GeneraReq Then
If Not ValidaNumRemision(TxtNumRemision.Text.Trim(), "REQ", CveProveedor, OC.IniciaTransacSQL) Then
If TxtNumRemision.Text.Trim() <> "" AndAlso Not ValidaNumRemision(TxtNumRemision.Text.Trim(), "REQ", CveProveedor, OC.IniciaTransacSQL) Then
TieneError = True
End If
@@ -8762,20 +8759,17 @@ Partial Class OC_OC
Return Retorno
End Function
Private Function ValidaNumRemision(NumRemision As String, TipoOC As String, CveProveedor As Integer, Optional OcTransaccion As SqlClient.SqlTransaction = Nothing, Optional CveOrdenCompraValida As Integer = -1) As Boolean
Dim NumRemisionValida As Boolean = False
LnkActualziarNumRemision.Visible = False
LnkActualizarNumRemision.Visible = False
If NumRemision.Trim.Length > 0 Then
If UsuarioActual.Empresa.Funcionalidad(590) = "1" AndAlso UsuarioActual.CveRol = 1 Then
If UsuarioActual.Empresa.Funcionalidad(590) = "1" Then
Dim ObjOC As New ClsOC(OcTransaccion)
If ObjOC.GetVerificaNumRemision(CveProveedor, TipoOC, NumRemision, UsuarioActual.CveEmpresa, CveOrdenCompraValida) Then
If ObjOC.DtResultados.Rows.Count > 0 Then
Alert($"La remision ya se encuentra asignada a la { If(TipoOC = "OC", "Orden de compra", "Requisición")} <a target='_blank' class='Texto' href='./OC.aspx?OC={ObjOC.DtResultados.Rows(0)("CveOrdenCompra").ToString()}' >{ObjOC.DtResultados.Rows(0)("Folio").ToString() }</a>.", TipoMensaje.MsgAdvertencia)
TxtNumRemision.Text = ""
Else
NumRemisionValida = True
End If
@@ -8786,18 +8780,13 @@ Partial Class OC_OC
Else
NumRemisionValida = True
End If
If NumRemisionValida Then
If CveOrdenCompra > 0 And BtnGuardar.Enabled And BtnGuardar.Visible Then
LnkActualziarNumRemision.Visible = True
LnkActualizarNumRemision.Visible = True
End If
End If
UPPEmp.Update()
Return NumRemisionValida
End Function
@@ -8808,13 +8797,9 @@ Partial Class OC_OC
End Sub
Protected Sub LnkActualziarNumRemision_Click(sender As Object, e As EventArgs)
Protected Sub LnkActualizarNumRemision_Click(sender As Object, e As EventArgs)
If NumeroRemisionOriginal.Trim = TxtNumRemision.Text.Trim Then
Exit Sub
End If
If NumeroRemisionOriginal.Trim = TxtNumRemision.Text.Trim Then Exit Sub
If ValidaNumRemision(TxtNumRemision.Text.Trim(), TipoOC, DdlProveedores.SelectedValue.ToEntero, Nothing, If(CveOrdenCompra > 0, CveOrdenCompra, -1)) Then
@@ -8845,6 +8830,5 @@ Partial Class OC_OC
Alert("El número de remisión no es valido.")
End If
End Sub
End Class

View File

@@ -2258,6 +2258,15 @@ Partial Class Ventas
End Set
End Property
Private Property CveMonedaLineaAdicional As Integer
Get
Return IfNull(ViewState("CveMonedaLineaAdicional"), "-1", ViewState("CveMonedaLineaAdicional")).ToString().ToEntero()
End Get
Set(value As Integer)
ViewState("CveMonedaLineaAdicional") = value
End Set
End Property
#End Region
'#Region "AuxiliarConta"
@@ -6681,6 +6690,11 @@ Partial Class Ventas
BloqueaCondiconesPago()
DeshabilitarAplicarNotaDeCredito(LblRFC.Text)
If CveVenta <= 0 Then
CalculaLineasAdicionales()
End If
'If UsuarioActual.Empresa.Funcionalidad(705) = "1" Then
' Using ObjVentas As New ClsVentas
' If ObjVentas.GetLineasAdicionales(-1, CveCliente, -1, -1, DdlMoneda.SelectedValue.ToEntero(), MinFecha, MaxFecha, 0, UsuarioActual.CveEmpresa) Then
@@ -8845,6 +8859,12 @@ Partial Class Ventas
Exit Sub
End If
'VERIFICA QUE LA MONEDA DE LA LINEA ADICIONAL SEA LA MISMA QUE LA VENTA
If Me.CveMonedaLineaAdicional <> DdlMoneda.SelectedValue.ToEntero() Then
Alert("La moneda de la linea adicional de crédito debe ser la misma que la factura.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
'VERIFICA QUE EL SALDO DISPONIBLE SEA MENOR AL IMPORTE
If Me.SaldoLineaAdicional <= TxtTotal.Text.ToDecimal() Then
Alert("El saldo de la linea adicional debe ser mayor o igual al de la factura", TipoMensaje.MsgAdvertencia)
@@ -18034,8 +18054,6 @@ Partial Class Ventas
ListaDescuentos.Add(ObjDescuento)
End If
CalculaLineasAdicionales()
CalculaTotalesVenta()
LimpiaAgregar()
@@ -21665,6 +21683,11 @@ Partial Class Ventas
If CveCliente > 0 Then
CargaAnticipos(CveCliente)
End If
If CveVenta <= 0 Then
CalculaLineasAdicionales()
End If
End Sub
Private Sub btnBuscarPrecio_Click(sender As Object, e As EventArgs) Handles btnBuscarPrecio.Click
Dim Codigo, CodigoBarras As String
@@ -35280,6 +35303,7 @@ Partial Class Ventas
TxtFechaPago.Text = ObjVentas.DtResultados.Rows(0)("FechaVencimiento").ToString().ToDateTime().ToString("dd/MM/yyyy")
Me.SaldoLineaAdicional = ObjVentas.DtResultados.Rows(0)("Saldo").ToString().ToDecimal()
Me.CveClasificacionLineaAdicional = ObjVentas.DtResultados.Rows(0)("CveClasificacionPS").ToString().ToEntero()
Me.CveMonedaLineaAdicional = ObjVentas.DtResultados.Rows(0)("CveMoneda").ToString().ToEntero()
End If
End If
End Using
@@ -35313,6 +35337,12 @@ Partial Class Ventas
Alert("El saldo de la linea adicional debe ser mayor o igual al de la factura", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
'VERIFICA QUE LA MONEDA DE LA LINEA ADICIONAL SEA LA MISMA QUE LA VENTA
If Me.CveMonedaLineaAdicional <> DdlMoneda.SelectedValue.ToEntero() Then
Alert("La moneda de la linea adicional de crédito debe ser la misma que la factura.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
Using ObjVentas As New ClsVentas