This commit is contained in:
Rakcsle Supertramp
2020-03-24 16:57:24 -07:00
6 changed files with 50 additions and 74 deletions

View File

@@ -547,6 +547,24 @@ Public Class ClsVentas
Return Retorno Return Retorno
End Function End Function
Public Function CancelarPagos(CveVenta As Integer, CvePrePoliza As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_CancelarPagosVenta")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
.Add("@CvePrePoliza", SqlDbType.Int).Value = CvePrePoliza
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al cancelar los pagos de la venta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function RemoveVta_VentaPago(CveVenta As Integer, CveMetodoPago As Integer) As Boolean Public Function RemoveVta_VentaPago(CveVenta As Integer, CveMetodoPago As Integer) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentasPagoRemove") DataAdapter("PA_Vta_VentasPagoRemove")

View File

@@ -4285,7 +4285,7 @@ Namespace Modelos
End If End If
'CUANDO LA CANCELACION ESTA EN PROCESO NO DEBE REALIZAR NADA DE ESTE PROCESO 'CUANDO LA CANCELACION ESTA EN PROCESO NO DEBE REALIZAR NADA DE ESTE PROCESO
If (((ObjFactura.Saldo > 0 AndAlso (CveEstatus > 0 AndAlso CveEstatus <> 20)) OrElse (ObjFactura.Total = 0 AndAlso UsuarioActual.CveEmpresa.Contiene(72) AndAlso ObjFactura.TipoDocto.Contiene("Ing"))) AndAlso CveEstatus.Contiene(4, 5)) OrElse (CvePlantillaPoliza = 7 AndAlso (CveEstatus > 0 AndAlso CveEstatus <> 20)) Then If Not EsRefacturacion AndAlso ((((ObjFactura.Saldo > 0 AndAlso (CveEstatus > 0 AndAlso CveEstatus <> 20)) OrElse (ObjFactura.Total = 0 AndAlso UsuarioActual.CveEmpresa.Contiene(72) AndAlso ObjFactura.TipoDocto.Contiene("Ing"))) AndAlso CveEstatus.Contiene(4, 5)) OrElse (CvePlantillaPoliza = 7 AndAlso (CveEstatus > 0 AndAlso CveEstatus <> 20))) Then
'CUANDO SE CANCELA, LA PÓLIZA DEBE DE SER DE DIARIO 'CUANDO SE CANCELA, LA PÓLIZA DEBE DE SER DE DIARIO
CvePrePoliza = ObjConta.AddPrePolizas("Modelos/CancelarDocumento", CvePlantillaPoliza, ObjFactura.Total, ObjFactura.Total, ObjFactura.CveMoneda, Now, ObjFactura.Cliente.Nombre, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=3) CvePrePoliza = ObjConta.AddPrePolizas("Modelos/CancelarDocumento", CvePlantillaPoliza, ObjFactura.Total, ObjFactura.Total, ObjFactura.CveMoneda, Now, ObjFactura.Cliente.Nombre, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=3)
@@ -4296,8 +4296,16 @@ Namespace Modelos
MensajeError = "Ocurrió un error al generar la prepoliza de cancelación." MensajeError = "Ocurrió un error al generar la prepoliza de cancelación."
End If End If
''CANCELAR PAGOS
'If EsRefacturacion AndAlso ObjFactura.TipoDocto.Contiene("Ing", "Rem", "Ant") AndAlso ObjFactura.Pagado > 0 Then
' If Not ObjVentas.CancelarPagos(ObjFactura.CveVenta, CvePrePoliza) Then
' ErrorCancelar = True
' MensajeError = "Ocurrió un error al generar la cancelación de pagos."
' End If
'End If
'CANCELAR PAGOS 'CANCELAR PAGOS
If ObjFactura.TipoDocto.Contiene("Egs", "Dev") Then If Not EsRefacturacion AndAlso ObjFactura.TipoDocto.Contiene("Egs", "Dev") Then
If Not ErrorCancelar Then If Not ErrorCancelar Then
If Not ObjConta.PrePolizasCancelarPagos(ObjFactura.CveDevolucion, CvePrePoliza) Then If Not ObjConta.PrePolizasCancelarPagos(ObjFactura.CveDevolucion, CvePrePoliza) Then
ErrorCancelar = True ErrorCancelar = True
@@ -4306,6 +4314,7 @@ Namespace Modelos
End If End If
End If End If
'CANCELA PREPOLIZA 'CANCELA PREPOLIZA
If Not ErrorCancelar Then If Not ErrorCancelar Then
ErrorCancelar = ProcesoPrepolizas(ObjFactura, ObjConta, -1, ObjFactura.DtDetalle, ObjAC, -1, ObjBancos, ObjVentas, ObjEventos, DtRemisionesRelacionadas:=DtRemisionesRelacionadas, SeCancelaRemisionProceso:=SeCancelaRemisionProceso, ErrorCancelar = ProcesoPrepolizas(ObjFactura, ObjConta, -1, ObjFactura.DtDetalle, ObjAC, -1, ObjBancos, ObjVentas, ObjEventos, DtRemisionesRelacionadas:=DtRemisionesRelacionadas, SeCancelaRemisionProceso:=SeCancelaRemisionProceso,

View File

@@ -202,70 +202,14 @@
CssClass="table table-striped table-advance table-hover ScrollAD" CssClass="table table-striped table-advance table-hover ScrollAD"
data-sort="true" Width="100%" Style="text-align: center;" GridLines="None"> data-sort="true" Width="100%" Style="text-align: center;" GridLines="None">
<Columns> <Columns>
<asp:TemplateField> <asp:HyperLinkField HeaderText="Folio" DataTextField="Folio" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}"/>
<HeaderTemplate> <asp:BoundField HeaderText="Fecha" DataField="Fecha" />
<asp:Label Text="Folio" runat="server" CausesValidation="false"> </asp:Label> <asp:BoundField HeaderText="Fecha Vencimiento" DataField="FechaVencimiento" />
</HeaderTemplate> <asp:BoundField HeaderText="Cantidad" DataField="CantidadOriginal" />
<ItemTemplate> <asp:BoundField HeaderText="Por Facturar" DataField="Cantidad" />
<asp:HyperLink ID="LtlFolio" runat="server" Text='<%# Eval("Folio") %>' Target="_blank" NavigateUrl='<%# String.Concat("/Ventas/Ventas.aspx?CveVenta=" + Eval("CveVenta").ToString) %>'></asp:HyperLink> <asp:BoundField HeaderText="Producto" DataField="CodigoPS" ItemStyle-HorizontalAlign="Left" />
</ItemTemplate> <asp:BoundField HeaderText="PU" DataField="PU" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
</asp:TemplateField> <asp:BoundField HeaderText="Total" DataField="Total" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:TemplateField>
<HeaderTemplate>
<asp:Label Text="Fecha" runat="server" CausesValidation="false"> </asp:Label>
</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("Fecha", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
<asp:Label Text="FechaVencimiento" runat="server" CausesValidation="false"> </asp:Label>
</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFechaVencimiento" runat="server" Text='<%# Eval("FechaVencimiento", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
<asp:Label Text="Cantidad" runat="server" CausesValidation="false"> </asp:Label>
</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlCantOri" runat="server" Text='<%# Eval("CantidadOriginal") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
<asp:Label Text="Por Facturar" runat="server" CausesValidation="false"> </asp:Label>
</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlCantDispo" runat="server" Text='<%# Eval("Cantidad") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
<HeaderTemplate>
<asp:Label Text="Producto" runat="server" CausesValidation="false"> </asp:Label>
</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlProducto" runat="server" Text='<%# Eval("CodigoPS") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Right">
<HeaderTemplate>
<asp:Label Text="PU" runat="server" CausesValidation="false"> </asp:Label>
</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlPU" runat="server" Text='<%# Eval("PU", "{0:N2}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Right">
<HeaderTemplate>
<asp:Label Text="Total" runat="server" CausesValidation="false"> </asp:Label>
</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlTotal" runat="server" Text='<%# Eval("Total", "{0:N2}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
</Columns> </Columns>
<HeaderStyle CssClass="Titulos" /> <HeaderStyle CssClass="Titulos" />
<RowStyle CssClass="Texto" /> <RowStyle CssClass="Texto" />

View File

@@ -280,9 +280,13 @@ Partial Class RepRemisionesDetalle
Private Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click Private Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
GvDatos.ExportToExcel("Reporte de Remisiones por Facturar Detalle" & Now.ToShortDateString) 'GvDatos.ExportToExcel("Reporte de Remisiones por Facturar Detalle" & Now.ToShortDateString)
GvDatos.ExportToExcelG("Reporte de Remisiones por Facturar Detalle" & Now.ToShortDateString, Titulo:="Reporte de Remisiones por Facturar Detalle ", Usuario:=UsuarioActual)
End Sub End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
CargaDatos() CargaDatos()
End Sub End Sub
Public Overrides Sub VerifyRenderingInServerForm(control As Control)
'MyBase.VerifyRenderingInServerForm(control)
End Sub
End Class End Class

View File

@@ -17736,20 +17736,20 @@ Partial Class Ventas
End Sub End Sub
Private Function ValidaPagosContado() As Boolean Private Function ValidaPagosContado() As Boolean
Dim Retorno = False Dim Retorno = False
Dim Total As Decimal = TxtTotal.Text.ToDecimal()
'SI LA VENTA ES NUEVA VALIDAR TAMBIEN LOS PAGOS DE CONTADO 'SI LA VENTA ES NUEVA VALIDAR TAMBIEN LOS PAGOS DE CONTADO
If UsuarioActual.CveEmpresa = 141 AndAlso CveVenta <= 0 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant") Then If UsuarioActual.CveEmpresa = 141 AndAlso CveVenta <= 0 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant") Then
If Not PermiteCredito AndAlso (DtPagos Is Nothing OrElse DtPagos.Rows.Count = 0) AndAlso Total > 0 Then If Not PermiteCredito AndAlso (DtPagos Is Nothing OrElse DtPagos.Rows.Count = 0) AndAlso TxtTotal.Text.ToDecimal > 0 Then
Alert("Es necesario especificar un pago.", TipoMensaje.MsgAdvertencia) Alert("Es necesario especificar un pago.", TipoMensaje.MsgAdvertencia)
Retorno = True Retorno = True
Return Retorno Return Retorno
End If End If
If Not PermiteCredito AndAlso (DtPagos IsNot Nothing AndAlso DtPagos.Rows.Count > 0) AndAlso Total > 0 Then If Not PermiteCredito AndAlso (DtPagos IsNot Nothing AndAlso DtPagos.Rows.Count > 0) AndAlso TxtTotal.Text.ToDecimal > 0 Then
Dim TotalPago As Decimal = DtPagos.SUM("Importe").ToDecimal() Dim TotalPago As Decimal = DtPagos.SUM("Importe").ToDecimal()
If TotalPago < Total Then If TotalPago < TxtTotal.Text.ToDecimal Then
Alert("La suma de los pagos debe ser igual al total de la venta.", TipoMensaje.MsgAdvertencia) Alert("La suma de los pagos debe ser igual al total de la venta.", TipoMensaje.MsgAdvertencia)
Retorno = True Retorno = True
Return Retorno Return Retorno
@@ -17767,11 +17767,10 @@ Partial Class Ventas
If UsuarioActual.CveEmpresa = 141 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant") Then If UsuarioActual.CveEmpresa = 141 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant") Then
If Not PermiteCredito AndAlso DtPagos IsNot Nothing AndAlso DtPagos.Rows.Count > 0 AndAlso Total > 0 Then If Not PermiteCredito AndAlso DtPagos IsNot Nothing AndAlso DtPagos.Rows.Count > 0 AndAlso TxtTotal.Text.ToDecimal > 0 Then
Dim TotalPago As Decimal = DtPagos.SUM("Importe").ToDecimal() Dim TotalPago As Decimal = DtPagos.SUM("Importe").ToDecimal()
If TotalPago < Total Then If TotalPago < TxtTotal.Text.ToDecimal Then
Alert("La suma de los pagos debe ser igual al total de la venta.", TipoMensaje.MsgAdvertencia) Alert("La suma de los pagos debe ser igual al total de la venta.", TipoMensaje.MsgAdvertencia)
Retorno = True Retorno = True
Return Retorno Return Retorno

View File

@@ -32,6 +32,8 @@