Generar prepolzias en negativo Ventas
This commit is contained in:
@@ -127,6 +127,7 @@ Public Class ClsContabilidad
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function AddPrePolizas(Modulo As String, CvePlantillaPoliza As Integer, Cargos As Double, Abonos As Double, CveMoneda As Integer, Fecha As Date, Concepto As String, CveUsuario As Integer, CveEmpresa As Integer, Optional FolioFijo As Integer = 0, Optional ReglaFolioPoliza As String = "", Optional CveTipoPoliza As Integer = -1) As Integer
|
||||
|
||||
Dim Retorno As Integer = -1
|
||||
@@ -225,6 +226,33 @@ Public Class ClsContabilidad
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
Public Function AddPrePolizasNegativa(CvePrePoliza As Integer, CveUsuario As Integer, Concepto As String, CveEmpresa As Integer, Fecha As Date) As Boolean
|
||||
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_Conta_PrePolizasNegativaAdd")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CvePrePoliza", SqlDbType.Int).Value = CvePrePoliza
|
||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
.Add("@Concepto", SqlDbType.VarChar).Value = Concepto
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@Fecha", SqlDbType.Date).Value = Fecha
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al Guardar", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
|
||||
End Function
|
||||
|
||||
Public Function GetProveedorAuxiliar(CveProveedor As Integer, CveCompra As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
'Data = New DataTable
|
||||
|
||||
@@ -4887,7 +4887,9 @@ Partial Class Bancos_IE
|
||||
e.Row.Cells(4).Text = String.Format("<a class="" texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"" target=""_blank""><i class="" fa fa-ad-pdf""></i></a>", Encripta(String.Format("OP=CompP&EXT=pdf&SerieFolio={0}&CVECOMPLEMENTOPAGO={1}&CVEIE={2}", e.Row.DBCampo("SerieFolio"), e.Row.DBCampo("CveComplementoPago"), e.Row.DBCampo("CveIE"))))
|
||||
|
||||
If e.Row.DataKey("Estatus").Contiene("1", "3") Then
|
||||
e.Row.FCLinkButton("LnkCancelarComplemetno").Visible = True
|
||||
e.Row.FCLinkButton("LnkCancelarComplemetno").Visible = True
|
||||
Else
|
||||
e.Row.FCLinkButton("LnkCancelarComplemetno").Visible = False
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
@@ -78,7 +78,10 @@
|
||||
<table border="0">
|
||||
<tr>
|
||||
<td>
|
||||
<asp:GridView ID="GVAuxiliar" runat="server" AutoGenerateColumns="False" DataKeyNames="CvePrePoliza, Cargo, Abono, CveReferencia, IdPoliza,CvePrePolizaOriginal" EmptyDataText="No se encontraron Movimientos de Auxiliar" ToolTip="Listado de Auxiliar Contable" CssClass="table table-striped table-advance table-hover mysmallbtn Widthall" Style="text-align: center;" GridLines="None">
|
||||
|
||||
<asp:UpdatePanel UpdateMode="Conditional" runat="server" ID="UpDatos">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GVAuxiliar" runat="server" AutoGenerateColumns="False" DataKeyNames="CvePrePoliza, Cargo, Abono, CveReferencia, IdPoliza,CvePrePolizaOriginal" EmptyDataText="No se encontraron Movimientos de Auxiliar" ToolTip="Listado de Auxiliar Contable" CssClass="table table-striped table-advance table-hover mysmallbtn Widthall" Style="text-align: center;" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Fecha</HeaderTemplate>
|
||||
@@ -142,21 +145,34 @@
|
||||
</asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Eliminar" Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgD" runat="server" Visible='<%# Eval("Eliminable").ToString() = "1" AndAlso Eval("CvePrePoliza").ToString.Length > 0 %>' AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="confirmar" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Cancelar" Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:ImageButton ID="imgE" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Update" ImageUrl="/Imagenes/Btn_Delete.png" Visible='<%# Eval("Cancelable").ToString.ToEntero > 0 And Eval("CvePrePoliza").ToString.ToEntero > 0 And Eval("CveReferencia").ToString.ToEntero > 0 And (Eval("Cargo").ToString.ToDecimal > 0 OrElse Eval("Abono").ToString.ToDecimal > 0) %>' OnClientClick="javascript:return C();" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Cancelar" Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgCancelar" runat="server" CausesValidation="False" OnClick="imgCancelar_Click" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
</Columns>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
<HeaderStyle CssClass="Titulos" />
|
||||
</asp:GridView>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -168,6 +184,66 @@
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="DivCancelar" class="modal fade">
|
||||
<div class="modal-dialog" style="max-height: 500px; max-width: 500px;">
|
||||
<asp:UpdatePanel ID="UpEliminarCotizacion" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
|
||||
<h3 class="modal-title">Cancelar Movimiento</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row" style="align-items: center; vertical-align: middle;">
|
||||
<label class="col-md-4" style="max-width: 155px;">Concepto:</label>
|
||||
<asp:TextBox ID="TxtConceptoCancelacion" runat="server" CssClass="form-control input-sm" Width="90%" CausesValidation="true" MaxLength="100" ValidationGroup="GrpCancelarPrepoliza"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVTxtConceptoCancelacion" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtConceptoCancelacion" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Concepto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpCancelarPrepoliza"></asp:RequiredFieldValidator>
|
||||
|
||||
</div>
|
||||
<div class="row" style="align-items: center; vertical-align: middle;">
|
||||
<label class="col-md-4" style="max-width: 155px;">Fecha de Cancelación:</label>
|
||||
<div class="col-md-3">
|
||||
|
||||
<div class="input-group date date-picker" data-date-format="dd/mm/yyyy" style="width: 85px !important; padding: 0px;">
|
||||
<asp:TextBox ID="TxtFechaCancelacion" runat="server" CssClass="form-control input-sm" Width="80px" CausesValidation="true" MaxLength="10" ValidationGroup="GrpCancelarPrepoliza"></asp:TextBox>
|
||||
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="ImgCalendarioDel" class="btn default input-sm" Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
|
||||
<ajax:MaskedEditExtender ID="MEEFechaCancelacion" runat="server" TargetControlID="TxtFechaCancelacion" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender ID="CalendarioCancelacion" runat="server" TargetControlID="TxtFechaCancelacion" PopupButtonID="ImgCalendarioDel" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
|
||||
<asp:CompareValidator ID="CVFechaCancelacion" runat="server" ControlToValidate="TxtFechaCancelacion" Display="None" Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpCancelarPrepoliza" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Cancelación''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)."></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOFecha2Cancelacion" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaCancelacion" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
</div>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtFechaCancelacion" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> es necesario, por favor ingréselo." ValidationGroup="GrpCancelarPrepoliza"></asp:RequiredFieldValidator>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:Button ID="BtnCancelar" OnClick="BtnCancelar_Click" runat="server" CssClass="btn btn-success" Text="Cancelar Movimiento" ValidationGroup="GrpCancelarPrepoliza" />
|
||||
<button type="button" class="btn default" data-dismiss="modal">Cancelar</button>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
@@ -77,7 +77,8 @@ Partial Class PopUpAuxiliar
|
||||
|
||||
Private Sub CargaDatos()
|
||||
GVAuxiliar.Columns(10).Visible = UsuarioActual.TienePermisoProceso(94)
|
||||
'GVAuxiliar.Columns(11).Visible = UsuarioActual.TienePermisoProceso(94)
|
||||
'GVAuxiliar.Columns(11).Visible = UsuarioActual.TienePermisoProceso(94)
|
||||
GVAuxiliar.Columns(12).Visible = UsuarioActual.TienePermisoProceso(94)
|
||||
|
||||
Select Case Tipo
|
||||
Case "CxCClientes"
|
||||
@@ -102,6 +103,9 @@ Partial Class PopUpAuxiliar
|
||||
LtlTipo2.Text = "Folio de la Compra"
|
||||
LtlTipo3.Text = "Fecha de la Compra"
|
||||
End Select
|
||||
|
||||
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaAuxiliarClienteCxC(CveCliente As Integer, CveVenta As Integer)
|
||||
@@ -158,7 +162,11 @@ Partial Class PopUpAuxiliar
|
||||
GVAuxiliar.DataBind()
|
||||
End Sub
|
||||
|
||||
Protected Sub GVAuxiliar_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVAuxiliar.RowDataBound
|
||||
Protected Sub GVAuxiliar_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVAuxiliar.RowDataBound
|
||||
|
||||
|
||||
|
||||
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.RowIndex = 0 Then
|
||||
e.Row.BackColor = Drawing.Color.LightGray
|
||||
@@ -171,6 +179,7 @@ Partial Class PopUpAuxiliar
|
||||
e.Row.Cells(6).Visible = False
|
||||
e.Row.Cells(7).Visible = False
|
||||
e.Row.Cells(8).Visible = False
|
||||
e.Row.Cells(12).Visible = False
|
||||
ElseIf e.Row.RowIndex = 1 Then
|
||||
e.Row.Cells(0).Width = Unit.Pixel(95)
|
||||
e.Row.Cells(1).Width = Unit.Pixel(180)
|
||||
@@ -350,5 +359,62 @@ Partial Class PopUpAuxiliar
|
||||
Alert("No se encontró información suficiente.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
End Sub
|
||||
|
||||
Property CvePrePolizaNegativa As Integer
|
||||
Get
|
||||
If ViewState("CvePrePolizaNegativa") Is Nothing Then
|
||||
Return -1
|
||||
Else
|
||||
Return ViewState("CvePrePolizaNegativa").ToString.ToEntero
|
||||
End If
|
||||
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CvePrePolizaNegativa") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
Private Sub AgregaPolizaNegativo(CvePrePoliza As Integer)
|
||||
|
||||
Dim ObjContabilidad As New ClsContabilidad
|
||||
Dim TieneError As Boolean = False
|
||||
ObjContabilidad.IniciaTransacSQL()
|
||||
|
||||
If ObjContabilidad.AddPrePolizasNegativa(CvePrePoliza, UsuarioActual.CveUsuario, TxtConceptoCancelacion.Text, UsuarioActual.CveEmpresa, TxtFechaCancelacion.Text.ToDate) Then
|
||||
Alert("Se agrego polzia negativa correctamente.")
|
||||
Else
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
If TieneError Then
|
||||
ObjContabilidad.RollBack()
|
||||
Else
|
||||
ObjContabilidad.Commit()
|
||||
RegistraScript(" $('#DivCancelar').modal('hide'); ")
|
||||
CargaDatos()
|
||||
End If
|
||||
|
||||
ObjContabilidad.Dispose()
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub BtnCancelar_Click(sender As Object, e As EventArgs)
|
||||
AgregaPolizaNegativo(CvePrePolizaNegativa)
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub imgCancelar_Click(sender As Object, e As EventArgs)
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).BindingContainer, GridViewRow)
|
||||
CvePrePolizaNegativa = GvRow.DataKey("CvePrePoliza").ToString.ToEntero
|
||||
|
||||
RegistraScript(" $('#DivCancelar').modal('show'); ")
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user