-compras. concepto de entrada
- proveedoresbonar, simplificar y C78 - modextensiones. log
This commit is contained in:
@@ -565,17 +565,51 @@ Partial Class Bancos_ProveedoresAbonar
|
||||
If e.Row.DBCampo("CveCompra").ToEntero > 0 Then
|
||||
|
||||
Dim FiltroInv As String = ""
|
||||
If UsuarioActual.Empresa.Funcionalidad(134).ToEntero > 0 Then
|
||||
Dim PorcentajeSaldo = e.Row.DBCampo("ImporteAlmacenPorcentaje").ToString.ToDouble + e.Row.DBCampo("ImporteServiciosPorcentaje").ToString.ToDouble + e.Row.DBCampo("ImporteDevolucionPorcentaje").ToString.ToDouble
|
||||
Dim SaldoInv = (e.Row.DBCampo("Saldo").ToString.ToDouble * (PorcentajeSaldo / 100))
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(134).ToEntero > 0 Then ' valores 1 - permite pago proporcional, valor 2. paga solo si se recibio el 100%
|
||||
'se bloquean las opciones
|
||||
e.Row.FCCheckBox("Chk").Enabled = False
|
||||
e.Row.FCTextBox("TxtAbonar").Enabled = False
|
||||
|
||||
Dim Str As New StringBuilder
|
||||
Str.AppendFormat("Importe Almacen: ${0} ({1}%) <br/>", e.Row.DBCampo("ImporteAlmacen").FormatoNumero, e.Row.DBCampo("ImporteAlmacenPorcentaje"))
|
||||
If e.Row.DBCampo("ImporteServicios").ToDouble > 0 Then Str.AppendFormat("Importe Servicios: ${0} ({1}%) <br/>", e.Row.DBCampo("ImporteServicios").FormatoNumero, e.Row.DBCampo("ImporteServiciosPorcentaje"))
|
||||
If e.Row.DBCampo("ImporteDevolucion").ToDouble > 0 Then Str.AppendFormat("Importe Devuelto: ${0} ({1}%) <br/>", e.Row.DBCampo("ImporteDevolucion").FormatoNumero, e.Row.DBCampo("ImporteDevolucionPorcentaje"))
|
||||
Str.AppendFormat(" <i> Importes <b> SIN</b> IVA</i>")
|
||||
e.Row.FCLabel("LbEstatusInv").Attributes.Add("title", Str.ToString)
|
||||
|
||||
Dim PorcentajeAlmacen As Decimal = e.Row.DBCampo("ImporteAlmacenPorcentaje").ToString.ToDecimal + e.Row.DBCampo("ImporteServiciosPorcentaje").ToString.ToDecimal + e.Row.DBCampo("ImporteDevolucionPorcentaje").ToString.ToDecimal
|
||||
Dim SaldoInv As Decimal = (e.Row.DBCampo("Saldo").ToString.ToDecimal * (PorcentajeAlmacen / 100))
|
||||
If UsuarioActual.Empresa.Funcionalidad(134) = "1" Then 'cuando es proporcional
|
||||
FiltroInv = $"FnCambia({e.Row.FCCheckBox("Chk").ClientID},this,{SaldoInv},1,'{"El importe no debe exceder lo recibido en almacén"}',1);"
|
||||
ElseIf UsuarioActual.Empresa.Funcionalidad(134) = "2" Then
|
||||
FiltroInv = "" 'queno considera lo proporcional
|
||||
End If
|
||||
|
||||
|
||||
If PorcentajeAlmacen = 0 Then ' sin recibir
|
||||
e.Row.FCLabel("LbEstatusInv").Text = "<i Class='fa fa-flag-o' aria-hidden='true'></i>"
|
||||
e.Row.FCLabel("LbEstatusInv").ForeColor = Drawing.Color.Red
|
||||
|
||||
ElseIf PorcentajeAlmacen > 99.0 OrElse e.Row.DBCampo("ImporteAlmacen").ToDecimal >= e.Row.DBCampo("Saldo").ToString.ToDecimal Then 'recibido completo ' si tiene un porcentaje mayor ingresado, que este halla sido por OC, debe de permitirlo
|
||||
' NOTA. si la factura tiene devoluciones, debera comparar el saldo de la factura con lo recibido en el almacen
|
||||
e.Row.FCLabel("LbEstatusInv").Text = "<i Class='fa fa-flag' aria-hidden='true'></i>"
|
||||
e.Row.FCLabel("LbEstatusInv").ForeColor = Drawing.Color.Green
|
||||
e.Row.FCCheckBox("Chk").Enabled = True
|
||||
e.Row.FCTextBox("TxtAbonar").Enabled = True
|
||||
Else ' parcial
|
||||
|
||||
e.Row.FCLabel("LbEstatusInv").Text = "<i Class='fa fa-flag-checkered' aria-hidden='true'></i>"
|
||||
e.Row.FCLabel("LbEstatusInv").ForeColor = Drawing.Color.DarkOrange
|
||||
If UsuarioActual.Empresa.Funcionalidad(134).ToEntero = 1 Then ' si es la opcion ,de pagar lo proporcional
|
||||
e.Row.FCCheckBox("Chk").Enabled = True
|
||||
e.Row.FCTextBox("TxtAbonar").Enabled = True
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
e.Row.FCLiteral("LtlAux").Text = String.Format("<a Class=""Texto thickbox"" href=""/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxPProveedor&CveProveedor={0}&CveCompra={1}&TB_iframe=true&height=370&width=900"" />Ir</a>", e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveCompra"))
|
||||
e.Row.FCTextBox("TxtAbonar").Attributes.Add("onblur", String.Format("FnCambia({0},this,{1},1,'{2}',1);{3}", e.Row.FCCheckBox("Chk").ClientID, e.Row.DBCampo("Saldo"), "El Importe no debe de exceder el saldo", FiltroInv))
|
||||
|
||||
@@ -605,61 +639,18 @@ Partial Class Bancos_ProveedoresAbonar
|
||||
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(131).ToEntero > 0 Or UsuarioActual.Empresa.Funcionalidad(134).ToEntero > 0 Then
|
||||
Dim Str As New StringBuilder
|
||||
Str.AppendFormat("Importe Almacen: ${0} ({1}%) <br/>", e.Row.DBCampo("ImporteAlmacen").FormatoNumero, e.Row.DBCampo("ImporteAlmacenPorcentaje"))
|
||||
If e.Row.DBCampo("ImporteServicios").ToDouble > 0 Then Str.AppendFormat("Importe Servicios: ${0} ({1}%) <br/>", e.Row.DBCampo("ImporteServicios").FormatoNumero, e.Row.DBCampo("ImporteServiciosPorcentaje"))
|
||||
If e.Row.DBCampo("ImporteDevolucion").ToDouble > 0 Then Str.AppendFormat("Importe Devuelto: ${0} ({1}%) <br/>", e.Row.DBCampo("ImporteDevolucion").FormatoNumero, e.Row.DBCampo("ImporteDevolucionPorcentaje"))
|
||||
Str.AppendFormat(" <i> Importes <b> SIN</b> IVA</i>")
|
||||
|
||||
e.Row.FCLabel("LbEstatusInv").Attributes.Add("title", Str.ToString)
|
||||
Select Case e.Row.DBCampo("EstatusInventario").ToEntero
|
||||
Case 1
|
||||
e.Row.FCLabel("LbEstatusInv").Text = "<i Class='fa fa-flag-o' aria-hidden='true'></i>"
|
||||
e.Row.FCLabel("LbEstatusInv").ForeColor = Drawing.Color.Red
|
||||
If UsuarioActual.Empresa.Funcionalidad(134).ToEntero.Contiene(1, 2) Then ' si se recibió mercancía se paga lo proporcional
|
||||
If UsuarioActual.CveEmpresa = 72 Then
|
||||
If e.Row.DBCampo("Fecha").ToDate > "12/02/2017".ToDate Then
|
||||
e.Row.FCCheckBox("Chk").Enabled = False
|
||||
e.Row.FCTextBox("TxtAbonar").Enabled = False
|
||||
End If
|
||||
Else
|
||||
e.Row.FCCheckBox("Chk").Enabled = False
|
||||
e.Row.FCTextBox("TxtAbonar").Enabled = False
|
||||
End If
|
||||
End If
|
||||
Case 2
|
||||
e.Row.FCLabel("LbEstatusInv").Text = "<i Class='fa fa-flag-checkered' aria-hidden='true'></i>"
|
||||
e.Row.FCLabel("LbEstatusInv").ForeColor = Drawing.Color.DarkOrange
|
||||
'condición que bloquea que se pueda pagar sin aun es parcial la recepción,
|
||||
If UsuarioActual.Empresa.Funcionalidad(134).ToEntero = 2 Then
|
||||
|
||||
e.Row.FCCheckBox("Chk").Enabled = False
|
||||
e.Row.FCTextBox("TxtAbonar").Enabled = False
|
||||
|
||||
' si tiene un porcentaje mayor ingresado, que este halla sido por OC, debe de permitirlo
|
||||
If e.Row.DBCampo("ImporteAlmacenPorcentaje").ToDecimal >= 99.0 Then 'si ya se recibió el 100%
|
||||
e.Row.FCCheckBox("Chk").Enabled = True
|
||||
e.Row.FCTextBox("TxtAbonar").Enabled = True
|
||||
End If
|
||||
|
||||
End If
|
||||
Case 3
|
||||
e.Row.FCLabel("LbEstatusInv").Text = "<i Class='fa fa-flag' aria-hidden='true'></i>"
|
||||
e.Row.FCLabel("LbEstatusInv").ForeColor = Drawing.Color.Green
|
||||
Case Else
|
||||
End Select
|
||||
'si está bloqueada y es refacturación, debe de permitirlo, sin importar lo que se halla ingresado
|
||||
If e.Row.DBCampo("CveCompraRefacturacion").ToEntero > 0 AndAlso Not e.Row.FCCheckBox("Chk").Enabled Then
|
||||
e.Row.FCCheckBox("Chk").Enabled = True
|
||||
e.Row.FCTextBox("TxtAbonar").Enabled = True
|
||||
End If
|
||||
'si está bloqueada y es refacturación, debe de permitirlo, sin importar lo que se halla ingresado
|
||||
If e.Row.DBCampo("CveCompraRefacturacion").ToEntero > 0 AndAlso Not e.Row.FCCheckBox("Chk").Enabled Then
|
||||
e.Row.FCCheckBox("Chk").Enabled = True
|
||||
e.Row.FCTextBox("TxtAbonar").Enabled = True
|
||||
End If
|
||||
If UsuarioActual.Empresa.Funcionalidad(306) = "1" And e.Row.DBCampo("AplicaNotaCredito").ToString = "True" Then
|
||||
e.Row.FCCheckBox("Chk").Enabled = False
|
||||
End If
|
||||
|
||||
End If
|
||||
If UsuarioActual.Empresa.Funcionalidad(306) = "1" And e.Row.DBCampo("AplicaNotaCredito").ToString = "True" Then
|
||||
e.Row.FCCheckBox("Chk").Enabled = False
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
End Sub
|
||||
@@ -2017,7 +2008,7 @@ Partial Class Bancos_ProveedoresAbonar
|
||||
End If
|
||||
End If
|
||||
|
||||
If MsgError <> "" AndAlso ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, 5) Then
|
||||
If MsgError = "" AndAlso ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, 5) Then
|
||||
If ObjMov.ValorPolizaDescuadre > 0 Then
|
||||
MsgError = ObjMov.MensajePolizaDescuadre + " " + ObjMov.ValorDiferencia
|
||||
GuardaLogAD($"Bancos/ProveedoresAbonar | Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
|
||||
@@ -2944,6 +2935,7 @@ Partial Class Bancos_ProveedoresAbonar
|
||||
Dim TCPago As Decimal = GlobalTipoCambio(TxtFechaIncobrable.Text.ToDate).ToDecimal
|
||||
Dim CveMoneda As Integer = gr.DataKey("CveMoneda").ToEntero
|
||||
Dim FechaCompra As Date = gr.DataKey("Fecha").ToDate
|
||||
Dim CveSubProyecto As Integer = gr.DataKey("CveSubProyecto").ToEntero
|
||||
|
||||
Dim CveConceptoContablePago As Integer = 17
|
||||
If gr.DataKey("CveTipoConcepto").ToEntero = 2 Then CveConceptoContablePago = 308 'cuando es acreedor
|
||||
@@ -2991,7 +2983,7 @@ Partial Class Bancos_ProveedoresAbonar
|
||||
|
||||
Dim PorcentajePago As Decimal = gr.DataKey("Saldo").ToDecimal / gr.DataKey("Original").ToDecimal
|
||||
|
||||
If gr.DataKey("IVA").ToDecimal > 0 Then
|
||||
If MsgError = "" AndAlso gr.DataKey("IVA").ToDecimal > 0 Then
|
||||
Dim PorcentajeImpuesto As Decimal = gr.DataKey("PorcentajeIVA").ToDecimal
|
||||
Dim IdCtaIVAXAcreditar As Integer = 0
|
||||
Dim IdCtaIVAAcreditable As Integer = 0
|
||||
@@ -3011,7 +3003,7 @@ Partial Class Bancos_ProveedoresAbonar
|
||||
|
||||
End If
|
||||
|
||||
If gr.DataKey("IEPS").ToDecimal > 0 Then
|
||||
If MsgError = "" AndAlso gr.DataKey("IEPS").ToDecimal > 0 Then
|
||||
|
||||
Dim IEPS As Decimal = PorcentajePago * gr.DataKey("IEPS").ToDecimal
|
||||
If ObjConta.GetRetCuenta(25, UsuarioActual.CveEmpresa) Then
|
||||
@@ -3030,7 +3022,7 @@ Partial Class Bancos_ProveedoresAbonar
|
||||
End If
|
||||
|
||||
' se manda al ot ingresos, los impuestos por acreditar
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Saldo, gr.DataKey("SerieFolio").ToString, 78, ConceptoPartida, Now, IdCtaContable:=UsuarioActual.Empresa.IdCuentaOtrosIngresos, CveIE:=-1, IdSegmentoNegocio:=-1, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CveCompra:=gr.DataKey("CveCompra").ToEntero, ImporteMX:=If(CveMoneda = 1, Saldo, Saldo * TCPago), TipoCambio:=TCCompra, TipoCambioPago:=TCPago, CveCuenta:=-1) Then
|
||||
If MsgError = "" AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Saldo, gr.DataKey("SerieFolio").ToString, 78, ConceptoPartida, Now, IdCtaContable:=UsuarioActual.Empresa.IdCuentaOtrosIngresos, CveIE:=-1, IdSegmentoNegocio:=-1, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CveCompra:=gr.DataKey("CveCompra").ToEntero, ImporteMX:=If(CveMoneda = 1, Saldo, Saldo * TCPago), TipoCambio:=TCCompra, TipoCambioPago:=TCPago, CveCuenta:=-1, CveSubProyecto:=CveSubProyecto) Then
|
||||
MsgError = "Ocurrio un error al saldar el movimiento"
|
||||
End If
|
||||
|
||||
@@ -3051,7 +3043,7 @@ Partial Class Bancos_ProveedoresAbonar
|
||||
|
||||
|
||||
|
||||
If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, 5) Then
|
||||
If MsgError = "" AndAlso ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, 5) Then
|
||||
If ObjConta.ValorPolizaDescuadre > 0 Then
|
||||
MsgError = ObjConta.MensajePolizaDescuadre + " " + ObjConta.ValorDiferencia
|
||||
GuardaLogAD($"Bancos/ProveedoresAbonar | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
|
||||
|
||||
Reference in New Issue
Block a user