contratos

This commit is contained in:
Rakcsle Supertramp
2020-11-04 10:31:50 -07:00
parent cc86167206
commit 7f34791f36
9 changed files with 240 additions and 33 deletions

View File

@@ -570,6 +570,13 @@
<asp:BoundField DataField="FechaPago" HeaderText="Fecha Pago" ItemStyle-HorizontalAlign="center" DataFormatString="{0:d}" />
<asp:BoundField DataField="ImportePago" HeaderText="Importe Pago" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />
<asp:TemplateField ItemStyle-HorizontalAlign="Center" Visible="false">
<ItemTemplate>
<asp:Label ID="LblCveIE" runat="server" />
<asp:Label ID="LblCvePrePolizaDetalle" runat="server" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>

View File

@@ -2926,6 +2926,9 @@ Partial Class Compras_eFacturas
End If
Next
If MSGComplemento.Trim.Length > 0 Then
' BtnVincularPago.Visible = False
ViculacionConPUE = True
@@ -2974,11 +2977,30 @@ Partial Class Compras_eFacturas
GvVincularPago.DataBind()
UpVincularPago.Update()
ListaComprasPUE = ListaComprasPUEInterna
If DivVincularPagoManualmente.Visible Then
For Each GvRowValidaCompra As GridViewRow In GVPDocumentosRelacionadosPagos.Rows
If GvRowValidaCompra.DataKey("CveCompra").ToEntero > 0 Then
DivVincularPagoManualmente.Visible = True
Exit For
Else
DivVincularPagoManualmente.Visible = False
End If
Next
End If
UpVincularPago.Update()
RegistraScript("$('#ModalVincularPago').modal('show')", "VincularPagoModalShow")
End Sub
@@ -3004,11 +3026,25 @@ Partial Class Compras_eFacturas
For Each Gv As GridViewRow In GVPDocumentosRelacionadosPagos.Rows
If Not ObjCompra.AddComplementoPago(Gv.DataKey("CveIE").ToEntero, Gv.DataKey("CveCompra").ToEntero, Gv.DataKey("ImpPagado").ToDecimal, Gv.DataKey("CvePrePolizaDetalle").ToEntero, CveFacturaPago) > 0 Then
TieneError = True
If HdnCveIE.Value.ToEntero > 0 Then
If Gv.DataKey("CveCompra").ToEntero > 0 And Gv.FCLabel("LblCveIE").Text.ToEntero > 0 Then
If Not ObjCompra.AddComplementoPago(Gv.FCLabel("LblCveIE").Text.ToEntero, Gv.DataKey("CveCompra").ToEntero, Gv.DataKey("ImpPagado").ToDecimal, Gv.FCLabel("LblCvePrePolizaDetalle").Text.ToEntero, CveFacturaPago) > 0 Then
TieneError = True
Exit For
End If
End If
Else
If Gv.DataKey("CveCompra").ToEntero > 0 Then
If Not ObjCompra.AddComplementoPago(Gv.DataKey("CveIE").ToEntero, Gv.DataKey("CveCompra").ToEntero, Gv.DataKey("ImpPagado").ToDecimal, Gv.DataKey("CvePrePolizaDetalle").ToEntero, CveFacturaPago) > 0 Then
TieneError = True
Exit For
End If
End If
End If
Next
If Not TieneError AndAlso Not ObjCompra.AddVincularPago(CveFacturaPago) Then
@@ -3021,6 +3057,7 @@ Partial Class Compras_eFacturas
If ViculacionConPUE Then
For Each CveCompraVinculada In ListaComprasPUE
objEventos.AddEventoBitacora($"Complemento { ComplementoConPUE } vinculado manualmente (Compra PUE) ", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompra:=CveCompraVinculada)
Next
@@ -3040,6 +3077,8 @@ Partial Class Compras_eFacturas
ObjCompra.Commit()
HdnCveIE.Value = ""
Alert("El pago fue vinculado correctamente", TipoMensaje.MsgInformacion)
RegistraScript("$('#ModalVincularPago').modal('hide')", "VincularPagoModalHide")
CargaDatos()
@@ -3062,33 +3101,83 @@ Partial Class Compras_eFacturas
End Sub
Protected Sub BtnVincularManualmente_Click(sender As Object, e As EventArgs)
If HdnCveIE.Value <> "-1" AndAlso IsNumeric(HdnCveIE.Value) AndAlso HdnCveIE.Value.ToEntero > 0 Then
Dim ImportePago As Double = 0
Dim ImporteIES As Double = 0
Dim SerieFolioIE As String = ""
Dim ObjCompras As New ClsCompras
Dim ErrorVinculacion = True
If ObjCompras.GetCompararComplementoPago(CveProveedor, -1, "", UsuarioActual.CveEmpresa, HdnCveIE.Value.ToEntero) Then
GvVincularPago.DataSource = ObjCompras.DtResultados
If ObjCompras.DtResultados.Rows.Count > 0 Then
SerieFolioIE = ObjCompras.DtResultados.Rows(0)("SerieFolio").ToString
End If
ImportePago = ObjCompras.DtResultados.SUMD("Monto")
'GvVincularPago.DataSource = ObjCompras.DtResultados
'If ObjCompras.DtResultados.Rows.Count > 0 Then
' SerieFolioIE = ObjCompras.DtResultados.Rows(0)("SerieFolio").ToString
'End If
'ImportePago = ObjCompras.DtResultados.SUMD("Monto")
For Each Drow As DataRow In ObjCompras.DtResultados.Rows
For Each GvRow As GridViewRow In GVPDocumentosRelacionadosPagos.Rows
If GvRow.RowType = DataControlRowType.DataRow Then
If Drow("CveCompra").ToString.ToEntero = GvRow.DataKey("CveCompra").ToEntero Then
GvRow.FCLabel("LblCveIE").Text = Drow("CveIE").ToString.ToEntero.ToString
GvRow.FCLabel("LblCvePrePolizaDetalle").Text = Drow("CvePrePolizaDetalle").ToString.ToEntero.ToString
End If
End If
Next
Next
For Each GvRow As GridViewRow In GVPDocumentosRelacionadosPagos.Rows
If GvRow.RowType = DataControlRowType.DataRow Then
If GvRow.FCLabel("LblCveIE").Text.ToEntero > 0 And GvRow.FCLabel("LblCvePrePolizaDetalle").Text.ToEntero > 0 Then
ErrorVinculacion = False
Exit For
Else
ErrorVinculacion = True
End If
End If
Next
Else
ErrorVinculacion = True
End If
ImporteIES = ObjCompras.DtResultados.FiltraParametros("CveIE > 0").SUM("Importe")
ObjCompras.Dispose()
If Not ErrorVinculacion Then
ImporteIES = ObjCompras.DtResultados.FiltraParametros("CveIE > 0").SUM("Importe")
ObjCompras.Dispose()
BtnVincularPago.Visible = True
BtnVincularPago.Visible = True
LblSerieFolioPago.Text = $"{SeriePago}-{FolioPago}"
LblImportePago.Text = ImportePago.FormatoNumero
'LblSerieFolioIE.Text = SerieFolioIE
LblImporteIE.Text = ImporteIES.FormatoNumero
GvVincularPago.DataBind()
UpVincularPago.Update()
ObjCompras.Dispose()
Else
Alert("No se pudo realizar la vinculacion manual", TipoMensaje.MsgAdvertencia)
End If
LblSerieFolioPago.Text = $"{SeriePago}-{FolioPago}"
LblImportePago.Text = ImportePago.FormatoNumero
'LblSerieFolioIE.Text = SerieFolioIE
LblImporteIE.Text = ImporteIES.FormatoNumero
GvVincularPago.DataBind()
UpVincularPago.Update()
ObjCompras.Dispose()
End If
End Sub
Private Sub GVPDocumentosRelacionadosPagos_RowCreated(sender As Object, e As GridViewRowEventArgs) Handles GVPDocumentosRelacionadosPagos.RowCreated