CvePlantillaPoliza en ContPAQ

En impresion de polizas se agrego el filtro de grupos de plantillas
This commit is contained in:
Raul Pimienta
2019-08-31 10:59:10 -07:00
parent 13715b4121
commit 07c564cdbd
4 changed files with 27 additions and 7 deletions

View File

@@ -2005,7 +2005,7 @@ Public Class ClsContPAQi
''' <remarks></remarks>
'''
Public Function AddPoliza(TipoPol As Integer, Concepto As String, Cargos As Double, Abonos As Double, CveUsuario As Integer, FechaPoliza As Date, Optional pFolio As String = "-1",
Optional pTipo As String = "", Optional Guid As String = "-1") As Integer
Optional pTipo As String = "", Optional Guid As String = "-1", Optional CvePlantillaPoliza As Integer = -1) As Integer
'Tipo As String, pFolioPoliza As Integer) As Boolean
Dim Retorno As Integer = 0
If Guid = "-1" Then Guid = System.Guid.NewGuid().ToString()
@@ -2078,11 +2078,11 @@ Public Class ClsContPAQi
StrSQL.AppendLine(" INSERT INTO Polizas (Id, RowVersion, Ejercicio, Periodo, TipoPol, Folio, Clase, Impresa, ")
StrSQL.AppendLine(" Concepto, Fecha, Cargos, Abonos, IdDiario, SistOrig, Ajuste, IdUsuario, ")
StrSQL.AppendLine(" ConFlujo, ConCuadre, TimeStamp,Guid)")
StrSQL.AppendLine(" ConFlujo, ConCuadre, TimeStamp,Guid,CvePlantillaPoliza)")
StrSQL.AppendLine(" ")
StrSQL.AppendLine(" VALUES (@IdPoliza, @RowVersion, @Ejercicio, @Periodo, @TipoPol, @Folio, @Clase, @Impresa, ")
StrSQL.AppendLine(" @Concepto, @Fecha, ROUND(@Cargos,2), ROUND(@Abonos,2), @IdDiario, @SistOrig, @Ajuste, @IdUsuario, ")
StrSQL.AppendLine(" @ConFlujo, @ConCuadre, @TimeStamp,@Guid)")
StrSQL.AppendLine(" @ConFlujo, @ConCuadre, @TimeStamp,@Guid,@CvePlantillaPoliza)")
StrSQL.AppendLine(" ")
StrSQL.AppendLine(" EXEC PA_UpdateId 'Id_Poliza';")
StrSQL.AppendLine(" ")
@@ -2123,6 +2123,7 @@ Public Class ClsContPAQi
.Add("@FechaPoliza", SqlDbType.DateTime).Value = FechaPoliza
.Add("@pFolio", SqlDbType.VarChar).Value = pFolio
.Add("@Guid", SqlDbType.VarChar).Value = Guid
.Add("@CvePlantillaPoliza", SqlDbType.Int).Value = CvePlantillaPoliza
.Add("@IdPoliza", SqlDbType.Int).Direction = ParameterDirection.Output
End With
@@ -7308,7 +7309,7 @@ Public Class ClsContPAQi
Return Retorno
End Function
Public Function GetPolizasMasivo(Inicio As Date, Fin As Date, FolioI As Integer, FolioF As Integer, TipoPol As Integer, CveUsuario As Integer, CveSubProyecto As Integer, CveCuenta As Integer) As Boolean
Public Function GetPolizasMasivo(Inicio As Date, Fin As Date, FolioI As Integer, FolioF As Integer, TipoPol As Integer, CveUsuario As Integer, CveSubProyecto As Integer, CveCuenta As Integer, CveGrupoPlantillaPoliza As Integer) As Boolean
Dim Retorno As Boolean = False
StrSQL.Clear()
@@ -7338,6 +7339,12 @@ Public Class ClsContPAQi
StrSQL.Append(" AND (@CveSubProyecto = -1 OR ( MP.IdPoliza IN (SELECT IdPoliza FROM @DtSeg)) OR (@CveSubProyecto = -2 AND MP.IdSegNeg = 0) ) ")
StrSQL.Append(" AND (@CveUsuario = -1 OR P.IdUsuario = @CveUsuario) ")
StrSQL.Append(" AND (@Cvecuenta = -1 OR C.Id = @Cvecuenta) ")
StrSQL.Append(" AND (@CveGrupoPlantillaPoliza = -1
OR ( @CveGrupoPlantillaPoliza = 1 AND ISNULL(P.CvePlantillaPoliza,0) IN (1,22,43, 53, 60, 69, 74, 58, 59, 58, 59, 61, 62, 70,78, 89,94,95,96, 97,99,
64,65,68,72,75,79,80,81,82,83,84,90,91,93,40,41,42,48,54,55,14,24,32,34,37) )
OR ( @CveGrupoPlantillaPoliza = 2 AND ISNULL(P.CvePlantillaPoliza,0) IN (4,7,47,10,12,74) )
OR ( @CveGrupoPlantillaPoliza = 3 And ISNULL(P.CvePlantillaPoliza,0) IN (2, 3, 5, 8, 9, 13,15,17,19,21, 36,44, 45, 49, 50, 51, 52, 56, 57, 67, 71,73,77,85,86,87,88, 92,98,76,23,38) )
OR ( @CveGrupoPlantillaPoliza = 4 AND ISNULL(P.CvePlantillaPoliza,0) IN (6, 11,16, 63,46,47,39,100) ) )")
StrSQL.Append(" ORDER BY P.Folio, MP.NumMovto ")
StrSQL.Append(" END; ")
@@ -7353,6 +7360,8 @@ Public Class ClsContPAQi
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@cvecuenta", SqlDbType.Int).Value = CveCuenta
.Add("@CveGrupoPlantillaPoliza", SqlDbType.Int).Value = CveGrupoPlantillaPoliza
End With
Try
SqlAdapter.Fill(Data)

View File

@@ -1050,7 +1050,7 @@ Public Class ClsContabilidad
Dim tIdPoliza As Integer
Dim CveTipoPoliza, FolioFijo As Integer
Dim CveTipoPoliza, FolioFijo, CvePlantillaPoliza As Integer
Dim Cargos As Decimal
Dim Abonos As Decimal
Dim NumPoliza As String = ""
@@ -1087,6 +1087,7 @@ Public Class ClsContabilidad
FolioFijo = Data.Rows(0)("FolioFijo").ToString.ToEntero
TipoPoliza = Data.Rows(0)("TipoPoliza").ToString
CodigoNumeroPoliza = Data.Rows(0)("CodigoNumeroPoliza").ToString
CvePlantillaPoliza = Data.Rows(0)("CvePlantillaPoliza").ToString.ToEntero
'FolioFiscal = Data.Rows(0)("FolioFiscal").ToString
'MetodoPagoSAT = Data.Rows(0)("ClaveSAT").ToString
@@ -1106,7 +1107,7 @@ Public Class ClsContabilidad
ObjConta.RemoveCausacionesIVA(-1, tIdPoliza)
ObjConta.RemoveDevolucionesIVA(-1, tIdPoliza)
Else
tIdPoliza = ObjConta.AddPoliza(CveTipoPoliza, Concepto, Cargos, Abonos, CveUsuario, Fecha, FolioFijo.ToString, CodigoNumeroPoliza)
tIdPoliza = ObjConta.AddPoliza(CveTipoPoliza, Concepto, Cargos, Abonos, CveUsuario, Fecha, FolioFijo.ToString, CodigoNumeroPoliza, CvePlantillaPoliza:=CvePlantillaPoliza)
ContaFolio = ObjConta.Folio.ToString
End If

View File

@@ -84,6 +84,16 @@
<div class="col-md-2 ">
<asp:DropDownList ID="DdlCuenta" DataTextField="CodigoNombre" DataValueField="Id" CssClass="form-control input-sm select2me" runat="server"></asp:DropDownList>
</div>
<label class="col-md-1 truncate" data-toggle="tooltip" data-placement="top" title="Grupo Plantilla">Grupo Plantilla:</label>
<div class="col-md-2 ">
<asp:DropDownList ID="DdlGrupoPlantilla" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
<asp:ListItem Text="Compras" Value="1"></asp:ListItem>
<asp:ListItem Text="Ventas" Value="2"></asp:ListItem>
<asp:ListItem Text="Pago Compra" Value="3"></asp:ListItem>
<asp:ListItem Text="Pago Venta" Value="4"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>

View File

@@ -40,7 +40,7 @@ Partial Class Contabilidad_PolizasImpresion
Dim objcont As New ClsContPAQi(UsuarioActual.Empresa)
If objcont.GetPolizasMasivo(TxtFechaInicio.Text.ToDate, TxtFechaFin.Text.ToDate, foli, folf, ddlTipoPoliza.SelectedValue.ToEntero, DdlUsuarioRegistro.SelectedValue.ToEntero, DdlSegmentoNeg.SelectedValue.ToEntero, DdlCuenta.SelectedValue.ToEntero) Then
If objcont.GetPolizasMasivo(TxtFechaInicio.Text.ToDate, TxtFechaFin.Text.ToDate, foli, folf, ddlTipoPoliza.SelectedValue.ToEntero, DdlUsuarioRegistro.SelectedValue.ToEntero, DdlSegmentoNeg.SelectedValue.ToEntero, DdlCuenta.SelectedValue.ToEntero, DdlGrupoPlantilla.SelectedValue.ToEntero) Then
If objcont.DtResultados.Rows.Count < 10000 Then
If objcont.DtResultados.Rows.Count > 0 Then