eFacturas agregar facturas, compras rnc grtid seleccion, contatos trasnportes

This commit is contained in:
rakcsle
2024-07-17 21:04:51 -07:00
parent 57abb42cbf
commit 2cd6d71ee7
14 changed files with 271 additions and 113 deletions

View File

@@ -1192,17 +1192,7 @@ Partial Class Compras_Compras
End Set
End Property
Private Property ImporteRNCSaldar As Decimal
Get
If ViewState("ImporteRNCSaldar") Is Nothing Then
ViewState("ImporteRNCSaldar") = 0D
End If
Return ViewState("ImporteRNCSaldar").ToString.ToDecimal
End Get
Set(value As Decimal)
ViewState("ImporteRNCSaldar") = value
End Set
End Property
Private Property DTRemisionesNotaDeCredito As DataTable
Get
@@ -1220,53 +1210,10 @@ Partial Class Compras_Compras
End Property
Private Property SerieFolioProntoPago As String
Get
If ViewState("SerieFolioProntoPago") Is Nothing Then
ViewState("SerieFolioProntoPago") = ""
End If
Return ViewState("SerieFolioProntoPago").ToString
End Get
Set(value As String)
ViewState("SerieFolioProntoPago") = value
End Set
End Property
Private Property TipoCambioProntoPago As Decimal
Get
If ViewState("TipoCambioProntoPago") Is Nothing Then
ViewState("TipoCambioProntoPago") = 0D
End If
Return ViewState("TipoCambioProntoPago").ToString.ToDecimal
End Get
Set(value As Decimal)
ViewState("TipoCambioProntoPago") = value
End Set
End Property
Private Property FechaProntoPago As Date
Get
If ViewState("FechaProntoPago") Is Nothing Then
ViewState("FechaProntoPago") = MinFecha
End If
Return ViewState("FechaProntoPago").ToString.ToDate
End Get
Set(value As Date)
ViewState("FechaProntoPago") = value
End Set
End Property
Private Property CveMonedaProntoPago As Integer
Get
If ViewState("CveMonedaProntoPago") Is Nothing Then
ViewState("CveMonedaProntoPago") = 0D
End If
Return ViewState("CveMonedaProntoPago").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CveMonedaProntoPago") = value
End Set
End Property
'ImporteRNCSaldar = 0
'SerieFolioProntoPago = ""
@@ -1687,10 +1634,22 @@ Partial Class Compras_Compras
DdlTipoComprobante.Items.Add(New ListItem("Devolución", "DEV"))
DdlTipoComprobante.SelectedValueExist("DEV")
End If
If UsuarioActual.Empresa.Funcionalidad(574).ToEntero = 1 AndAlso DdlTipoComprobante.SelectedValue = "NC" Then
ConfiguraseleccionRemisionNotaCredito()
End If
End If
'SE OCUPAN AFUERA DEL POSTBACK ??
cargaddlVinculacionServcios()
'SE OCUPAN AFUERA DEL POSTBACK ??
cargaddlVinculacionServcios()
If UsuarioActual.TienePermisoProceso(117) Then
HplAddClasificacion.Visible = False
@@ -1719,6 +1678,56 @@ Partial Class Compras_Compras
End Sub
Private Sub ConfiguraseleccionRemisionNotaCredito()
Dim AutoSelRNC As Boolean = False
DdlTipoComprobante_SelectedIndexChanged(Nothing, Nothing)
DdlTipoCompra.SelectedValueExist(15)
DdlTipoCompra_SelectedIndexChanged(Nothing, Nothing)
For Each gvRow As GridViewRow In GvFacturaNC.Rows
If gvRow.DataKey("CveCompra").ToEntero > 0 AndAlso gvRow.FCCheckBox("ChkFacturaNC").Checked Then
Dim SerieFolioFacura As String = ObtenerUltimaParte(gvRow.DataKey("SerieFolio"))
Dim seleccion As String = ""
For Each item As ListItem In DdlRemisionNotaCredito.Items
Dim serieFolioItem As String = ObtenerUltimaParte(item.Text)
If SerieFolioFacura = serieFolioItem Then
'seleccion = item.Value
AutoSelRNC = True
DdlRemisionNotaCredito.SelectedValueExist(item.Value)
Exit For
End If
Next
If AutoSelRNC Then
Exit For
End If
End If
Next
If AutoSelRNC Then
'DdlRemisionNotaCredito_SelectedIndexChanged(Nothing, Nothing)
End If
HLAplicaNCFact.Visible = True
UpPS.Update()
UpEstatus.Update()
End Sub
Public Function ObtenerUltimaParte(SerieFolioFactura As String) As String
Dim posicionUltimoGuion As Integer = SerieFolioFactura.LastIndexOf("-")
If posicionUltimoGuion <> -1 Then
Return SerieFolioFactura.Substring(posicionUltimoGuion + 1)
Else
Return SerieFolioFactura
End If
End Function
#Region "C A R G A S"
Private Sub MostrarOcultarColumnaIEPS()
@@ -7046,26 +7055,44 @@ Partial Class Compras_Compras
End If
End If
Next
If UsuarioActual.Empresa.Funcionalidad(574) = "1" Then
If DdlRemisionNotaCredito.SelectedValue.ToEntero > 0 AndAlso ImporteRNCSaldar > 0 Then
If Not ErrorPrepoliza Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteRNCSaldar, ImporteRNCSaldar, 373, Referencia, Concepto, CveCompra:=DdlRemisionNotaCredito.SelectedValue.ToEntero, CveProveedor:=Me.CveProveedor, ImporteME:=If(TipoCambio = 1, 0, ImporteRNCSaldar), TipoCambio:=TipoCambio,
CveClasificacion:=-1, CveSubProyecto:=CompraActual.CveSubProyecto, Contabilizable:=True) Then
ErrorPrepoliza = True
End If
For Each gvRow As GridViewRow In GVRemisionesNotaDeCredito.Rows
If gvRow.FCCheckBox("Chk").Checked Then
Dim ImporteRNCSaldar As Decimal = gvRow.DataKey("Saldo").ToDecimal
Dim CveCompraRNC As Integer = gvRow.DataKey("CveCompra").ToEntero
If Not ErrorPrepoliza Then
Dim ConPrePNC As ConceptosTipoSaldo = ObtenerCveConceptoPrePoliza(15, CompraActual.CveMoneda, True, CompraActual.CveTipoConceptoProveedor)
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteRNCSaldar, ImporteRNCSaldar, ConPrePNC.CveConcepto, Referencia, Concepto, CveCompra:=CompraActual.CveCompra, CveProveedor:=Me.CveProveedor, ImporteME:=If(TipoCambio = 1, 0, ImporteRNCSaldar), TipoCambio:=TipoCambio,
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteRNCSaldar, ImporteRNCSaldar, 373, Referencia, Concepto, CveCompra:=CveCompraRNC, CveProveedor:=Me.CveProveedor, ImporteME:=If(TipoCambio = 1, 0, ImporteRNCSaldar), TipoCambio:=TipoCambio,
CveClasificacion:=-1, CveSubProyecto:=CompraActual.CveSubProyecto, Contabilizable:=True) Then
ErrorPrepoliza = True
Exit For
End If
If Not ErrorPrepoliza Then
Dim ConPrePNC As ConceptosTipoSaldo = ObtenerCveConceptoPrePoliza(15, CompraActual.CveMoneda, True, CompraActual.CveTipoConceptoProveedor)
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteRNCSaldar, ImporteRNCSaldar, ConPrePNC.CveConcepto, Referencia, Concepto, CveCompra:=CompraActual.CveCompra, CveProveedor:=Me.CveProveedor, ImporteME:=If(TipoCambio = 1, 0, ImporteRNCSaldar), TipoCambio:=TipoCambio,
CveClasificacion:=-1, CveSubProyecto:=CompraActual.CveSubProyecto, Contabilizable:=True) Then
ErrorPrepoliza = True
Exit For
End If
End If
End If
End If
End If
Next
If ErrorPrepoliza Then
ErrorMovtosCxP = True
@@ -15688,7 +15715,7 @@ Partial Class Compras_Compras
Protected Sub DdlProveedores_SelectedIndexChanged(sender As Object, e As EventArgs)
CargarFacturas()
If UsuarioActual.Empresa.Funcionalidad(574).ToEntero = 1 Then
CargaDdlRemisionNotaCredito()
CargaGVRemisionNotaCredito()
End If
End Sub
@@ -16222,7 +16249,7 @@ Partial Class Compras_Compras
End If
Next
UpINV.Update()
UpInv.Update()
UpSerie.Update()
TxtSerieLote.Focus()
RegistraScript(String.Format("$('#DivSerie').on('shown.bs.modal', function () {{$('#DivSerie').focus(); $('#{0}').trigger(jQuery.Event('keypress', {{which: 13}})); }});$('#DivSerie').modal('show'); ", TxtSerieLote.ClientID))
@@ -18649,7 +18676,7 @@ Partial Class Compras_Compras
GvInvMov.Visible = True
ObjVentas.Dispose()
UpINV.Update()
UpInv.Update()
End Sub
Private Sub GvInvMov_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvInvMov.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
@@ -19719,7 +19746,7 @@ Partial Class Compras_Compras
If DdlTipoCompra.SelectedValue = "15" Then 'Remisión de nota de crédito
If DdlTipoComprobante.SelectedValue = "NC" Then
CargaDdlRemisionNotaCredito()
CargaGVRemisionNotaCredito()
'bloquear la vinculación a la compra
HLAplicaNCFact.Visible = False
Else
@@ -21140,51 +21167,49 @@ Partial Class Compras_Compras
End Sub
Private Sub CargaDdlRemisionNotaCredito()
Private Sub CargaGVRemisionNotaCredito()
DvDdlRemisionNotaCredito.Visible = True
DTRemisionesNotaDeCredito = New DataTable
GVRemisionesNotaDeCredito.DataSource = Nothing
GVRemisionesNotaDeCredito.Visible = False
Dim ObjCompras As New ClsCompras
If ObjCompras.GetNotasCreditoRep(DdlProveedor.SelectedValue.ToEntero, 0, "-1", "-1", UsuarioActual.CveEmpresa, 2) Then
DdlRemisionNotaCredito.DataSource = ObjCompras.DtResultados
'DdlRemisionNotaCredito.DataSource = ObjCompras.DtResultados
DTRemisionesNotaDeCredito = ObjCompras.DtResultados
GVRemisionesNotaDeCredito.DataSource = DTRemisionesNotaDeCredito
GVRemisionesNotaDeCredito.Visible = True
End If
ObjCompras.Dispose()
DdlRemisionNotaCredito.DataBind()
DdlRemisionNotaCredito.Items.Insert(0, New ListItem("-", "-1"))
GVRemisionesNotaDeCredito.DataBind()
'DdlRemisionNotaCredito.DataBind()
'DdlRemisionNotaCredito.Items.Insert(0, New ListItem("-", "-1"))
UpPS.Update()
UpEstatus.Update()
End Sub
Protected Sub DdlRemisionNotaCredito_SelectedIndexChanged(sender As Object, e As EventArgs)
'Protected Sub DdlRemisionNotaCredito_SelectedIndexChanged(sender As Object, e As EventArgs)
ImporteRNCSaldar = 0
SerieFolioProntoPago = ""
TipoCambioProntoPago = 1
FechaProntoPago = MinFecha
CveMonedaProntoPago = 1
' ImporteRNCSaldar = 0
' SerieFolioProntoPago = ""
' TipoCambioProntoPago = 1
' FechaProntoPago = MinFecha
' CveMonedaProntoPago = 1
If DdlRemisionNotaCredito.SelectedValue.ToEntero > 0 Then
ImporteRNCSaldar = DTRemisionesNotaDeCredito.FiltroPrimeroValor("Saldo", $" CveCompra = {DdlRemisionNotaCredito.SelectedValue.ToEntero} ").ToDecimal
SerieFolioProntoPago = DTRemisionesNotaDeCredito.FiltroPrimeroValor("SerieFolio", $" CveCompra = {DdlRemisionNotaCredito.SelectedValue.ToEntero} ")
TipoCambioProntoPago = DTRemisionesNotaDeCredito.FiltroPrimeroValor("TipoCambio", $" CveCompra = {DdlRemisionNotaCredito.SelectedValue.ToEntero} ").ToDecimal
FechaProntoPago = DTRemisionesNotaDeCredito.FiltroPrimeroValor("Fecha", $" CveCompra = {DdlRemisionNotaCredito.SelectedValue.ToEntero} ").ToString.ToDate
CveMonedaProntoPago = DTRemisionesNotaDeCredito.FiltroPrimeroValor("CveMoneda", $" CveCompra = {DdlRemisionNotaCredito.SelectedValue.ToEntero} ").ToEntero
End If
''Alert(ImporteRNCSaldar.ToString)
'CompraPago.SerieFolio = Gvr.DataKey("SerieFolio")
'CompraPago.TC = Gvr.DataKey("TipoCambio").ToDecimal
'CompraPago.Fecha = Gvr.DataKey("Fecha").ToDate
'CompraPago.CveMoneda = Gvr.DataKey("CveMoneda").ToEntero
'CompraPago.Total = Gvr.DataKey("Total").ToDecimal
'CompraPago.CveTipoConceptoProveedor = CveTipoConcepto
' If DdlRemisionNotaCredito.SelectedValue.ToEntero > 0 Then
' ImporteRNCSaldar = DTRemisionesNotaDeCredito.FiltroPrimeroValor("Saldo", $" CveCompra = {DdlRemisionNotaCredito.SelectedValue.ToEntero} ").ToDecimal
' SerieFolioProntoPago = DTRemisionesNotaDeCredito.FiltroPrimeroValor("SerieFolio", $" CveCompra = {DdlRemisionNotaCredito.SelectedValue.ToEntero} ")
' TipoCambioProntoPago = DTRemisionesNotaDeCredito.FiltroPrimeroValor("TipoCambio", $" CveCompra = {DdlRemisionNotaCredito.SelectedValue.ToEntero} ").ToDecimal
' FechaProntoPago = DTRemisionesNotaDeCredito.FiltroPrimeroValor("Fecha", $" CveCompra = {DdlRemisionNotaCredito.SelectedValue.ToEntero} ").ToString.ToDate
' CveMonedaProntoPago = DTRemisionesNotaDeCredito.FiltroPrimeroValor("CveMoneda", $" CveCompra = {DdlRemisionNotaCredito.SelectedValue.ToEntero} ").ToEntero
' End If
End Sub
'End Sub
#End Region