This commit is contained in:
2021-05-21 08:16:18 -07:00
84 changed files with 6759 additions and 4085 deletions

View File

@@ -345,10 +345,6 @@ Partial Class Contabilidad_FiltraPolizas
Alert(PolizasSinComprobante, TipoMensaje.MsgAdvertencia)
Else
MergePdfFiles(Pathpdf.ToArray)
If File.Exists(pathPoliza) Then
Directory.Delete(String.Format("{0}/{1}", AppDomain.CurrentDomain.BaseDirectory, Tick), True)
End If
End If
Else
Alert("No hay polizas seleccionadas para imprimir", TipoMensaje.MsgAdvertencia)
@@ -358,6 +354,11 @@ Partial Class Contabilidad_FiltraPolizas
Else
Alert("No hay informacion cargada", TipoMensaje.MsgAdvertencia)
End If
If File.Exists(pathPoliza) Then
Directory.Delete(String.Format("{0}/{1}", AppDomain.CurrentDomain.BaseDirectory, Tick), True)
End If
Catch ex As Exception
Alert("Error al descargar el paquete", TipoMensaje.MsgError)
If File.Exists(pathPoliza) Then

View File

@@ -160,7 +160,7 @@
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CvePlantillaPolizaDetalle, TipoMovimiento, CveSubProyecto, CveProveedor, CvePersonal, CveConcepto, IdCtaContable, Orden,PorcentajeImpuesto" EmptyDataText="No se encontraron Plantilla de Pólizas Registradas" ToolTip="Listado de Plantilla de Pólizas" CssClass="table table-striped table-advance table-hover Widthall" GridLines="None">
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CvePlantillaPolizaDetalle, TipoMovimiento, CveSubProyecto, CveProveedor, CvePersonal, CveConcepto, IdCtaContable, Orden,PorcentajeImpuesto, CveCuenta" EmptyDataText="No se encontraron Plantilla de Pólizas Registradas" ToolTip="Listado de Plantilla de Pólizas" CssClass="table table-striped table-advance table-hover Widthall" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="Concepto Contable">
<ItemTemplate>
@@ -176,7 +176,7 @@
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Left" HeaderText="Cuenta Contable">
<ItemTemplate>
&nbsp;<asp:Literal ID="LtlCtaContable" runat="server" Text='<%# Eval("NombreCuenta", "{0}") %>'>></asp:Literal>
&nbsp;<asp:Literal ID="LtlCtaContable" runat="server" Text='<%# Eval("NombreCuenta") %>'>></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
@@ -268,25 +268,24 @@
<div class="form-group form-md-line-input input-iconright">
<asp:Label ID="LblCuenta" runat="server" Text=""></asp:Label>
<asp:DropDownList ID="DdlCtaContable" CssClass="form-control input-sm select2me js-cuenta-programmatic" runat="server" AppendDataBoundItems="true" DataTextField="CtaCodigo" DataValueField="Id" Width="240px" ValidationGroup="GrpAgregar"></asp:DropDownList>
<label for="<%= DdlCtaContable.ClientID.ToString()%>">Cuenta Contable:</label>
<asp:DropDownList ID="DdlCuentas" CssClass="form-control input-sm select2me js-cuenta-programmatic" runat="server" Visible="false" AppendDataBoundItems="true" DataTextField="CtaCodigo" DataValueField="CveCuenta" Width="240px" ValidationGroup="GrpAgregar"></asp:DropDownList>
<label for="<%= DdlCtaContable.ClientID.ToString()%>">Cuenta Contable:</label>
<asp:DropDownList ID="DdlCuentas" CssClass="form-control input-sm select2me js-cuenta-programmatic" runat="server" Visible="false" AppendDataBoundItems="true" DataTextField="CtaCodigo" DataValueField="CveCuenta" Width="240px" ValidationGroup="GrpAgregar"></asp:DropDownList>
<label for="<%= DdlCtaContable.ClientID.ToString()%>">Cuenta Contable:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DDLSubProyecto" CssClass="form-control input-sm select2me js-subproyecto-programmatic" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Width="240px" ValidationGroup="GrpAgregar"></asp:DropDownList>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DDLSubProyecto" CssClass="form-control input-sm select2me js-subproyecto-programmatic" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Width="240px" ValidationGroup="GrpAgregar"></asp:DropDownList>
<label for="<%= DDLSubProyecto.ClientID.ToString()%>">SubProyecto:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DDLProveedor" CssClass="form-control input-sm select2me js-referencia-programmatic" runat="server" AppendDataBoundItems="true" DataTextField="RazonSocial" DataValueField="CveProveedor" Width="240px" ValidationGroup="GrpAgregar"></asp:DropDownList>
<asp:DropDownList ID="DDLProveedor" CssClass="form-control input-sm select2me js-referencia-programmatic" runat="server" AppendDataBoundItems="true" DataTextField="RazonSocial" DataValueField="CveProveedor" Width="240px" ValidationGroup="GrpAgregar"></asp:DropDownList>
<label ID="LblProveedor" runat="server" for="<%= DDLProveedor.ClientID.ToString()%>">Razón Social:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtOrden" CssClass="form-control " runat="server" MaxLength="4" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="TxtOrden" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Orden''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarRegistro"></asp:RequiredFieldValidator>
<label for="<%= TxtOrden.ClientID.ToString()%>">Orden:</label>
<label for="<%= TxtOrden.ClientID.ToString()%>">Orden:</label>
</div>
<div class="form-group form-md-line-input input-iconright">

View File

@@ -248,12 +248,13 @@ Partial Class Contabilidad_PlantillasPolizasDetalle
Dim Row As DataRow
Dim ErrorActualizar = False
Dim ErrorDetalle = False
Dim Cuenta As Integer = -1
If HdnModalidad.Value = "I" Then
If CvePlantillaPoliza > 0 Then
If ObjPlantillaPolizaDetalle.AddConta_PlantillasPolizasDetalles(CvePlantillaPoliza, DdlConcepto.SelectedValue.ToEntero, DdlTipoMovimiento.SelectedValue.ToEntero, DdlCtaContable.SelectedValue.ToEntero, TxtOrden.Text.Trim.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DDLSubProyecto.SelectedValue.ToEntero, DDLProveedor.SelectedValue.ToEntero, DdlPersonal.SelectedValue.ToEntero, DdlPorcentajeImpuesto.SelectedValue.ToDecimal,
CveCuenta:=DdlCuentas.SelectedValue.ToEntero) Then
If ObjPlantillaPolizaDetalle.AddConta_PlantillasPolizasDetalles(CvePlantillaPoliza, DdlConcepto.SelectedValue.ToEntero, DdlTipoMovimiento.SelectedValue.ToEntero, DdlCtaContable.SelectedItem.ToEntero, TxtOrden.Text.Trim.ToEntero,
UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DDLSubProyecto.SelectedValue.ToEntero, DDLProveedor.SelectedValue.ToEntero, DdlPersonal.SelectedValue.ToEntero,
DdlPorcentajeImpuesto.SelectedValue.ToDecimal, CveCuenta:=DdlCuentas.SelectedValue.ToEntero) Then
TxtOrden.Text = ""
If Not ChkSeguirAgregando.Checked Then
updatatos()
@@ -289,8 +290,9 @@ CveCuenta:=DdlCuentas.SelectedValue.ToEntero) Then
Else
If HdnID.Value.ToEntero <> -1 Then
If CvePlantillaPoliza > 0 Then
If ObjPlantillaPolizaDetalle.UpdateConta_PlantillasPolizasDetalle(DdlConcepto.SelectedValue.ToEntero, DdlTipoMovimiento.SelectedValue.ToEntero, DdlCtaContable.SelectedValue.ToEntero, TxtOrden.Text.Trim.ToEntero,
HdnID.Value.ToEntero, DDLSubProyecto.SelectedValue.ToEntero, DDLProveedor.SelectedValue.ToEntero, DdlPersonal.SelectedValue.ToEntero, DdlPorcentajeImpuesto.SelectedValue.ToDecimal) Then
If ObjPlantillaPolizaDetalle.UpdateConta_PlantillasPolizasDetalle(DdlConcepto.SelectedValue.ToEntero, DdlTipoMovimiento.SelectedValue.ToEntero, DdlCtaContable.SelectedItem.ToEntero, TxtOrden.Text.Trim.ToEntero,
HdnID.Value.ToEntero, DDLSubProyecto.SelectedValue.ToEntero, DDLProveedor.SelectedValue.ToEntero, DdlPersonal.SelectedValue.ToEntero,
DdlPorcentajeImpuesto.SelectedValue.ToDecimal, CveCuenta:=DdlCuentas.SelectedValue.ToEntero) Then
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
updatatos()
Else
@@ -328,8 +330,11 @@ CveCuenta:=DdlCuentas.SelectedValue.ToEntero) Then
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
Dim Cuenta As Integer = e.Row.DataKey("IdCtaContable").ToString.ToEntero
e.Row.FCLiteral("LtlCtaContable").Text = DTCuentasContables.FiltroPrimeroValor("Nombre", $"Id = {Cuenta}")
If UsuarioActual.Empresa.TipoContabilidad <> 1 Then
Dim Cuenta As Integer = e.Row.DataKey("IdCtaContable").ToString.ToEntero
e.Row.FCLiteral("LtlCtaContable").Text = DTCuentasContables.FiltroPrimeroValor("Nombre", $"Id = {Cuenta}")
End If
End If
End Sub
@@ -438,6 +443,7 @@ CveCuenta:=DdlCuentas.SelectedValue.ToEntero) Then
DdlConcepto.SelectedValueExist(GvRow.DataKey("CveConcepto"))
DdlTipoMovimiento.SelectedValueExist(IIf(GvRow.DataKey("TipoMovimiento") = "Abono", 1, 0).ToString)
DdlCtaContable.SelectedValueExist(GvRow.DataKey("IdCtaContable"))
DdlCuentas.SelectedValueExist(GvRow.DataKey("CveCuenta"))
DDLSubProyecto.SelectedValueExist(GvRow.DataKey("CveSubProyecto"))
TxtOrden.Text = GvRow.DataKey("Orden")
LbAgregar.Text = "Actualizar"
@@ -477,7 +483,7 @@ CveCuenta:=DdlCuentas.SelectedValue.ToEntero) Then
DDLSubProyecto.SelectedIndex = 0
DDLProveedor.SelectedIndex = 0
DdlPersonal.SelectedIndex = 0
TxtOrden.Text = ""
TxtOrden.Text = ""
UpModal.Update()
HdnModalidad.Value = "I"
RegistraScript(String.Format("$('#{0}').modal();", "divAgregarSucursal"))

View File

@@ -80,9 +80,6 @@
<li>
<asp:LinkButton ID="LnkComprobante" runat="server" Visible="false" data-toggle="modal" data-target="#ModalUpload" Style="color: #686868;"><i class="fa fa-upload" style="color:#686868;"></i> Cargar Comprobante</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="LnkImprimirPoliza" runat="server" Visible="true" OnClick="LnkImprimirPoliza_Click" Style="color: #686868;"><i class="fa fa-print" style="color:#686868;"></i> Imprimir Poliza</asp:LinkButton>
</li>
@@ -410,7 +407,7 @@
<asp:UpdatePanel ID="UpPrePoliza" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div style="width: 100%; min-height: 200px; overflow-scrolling: auto;">
<asp:GridView ID="GvPrePoliza" runat="server" AutoGenerateColumns="False" DataKeyNames="CvePrePolizaDetalle, CveConceptoContable, IdCtaContable, CveSubProyecto, CveTipoGasto,Referencia,CveVenta,CveCompra,CveOC" Width="100%" CssClass="table table-striped table-advance table-hover" GridLines="None">
<asp:GridView ID="GvPrePoliza" runat="server" AutoGenerateColumns="False" DataKeyNames="CvePrePolizaDetalle, CveConceptoContable, IdCtaContable, CveSubProyecto, CveTipoGasto,Referencia,CveVenta,CveCompra,CveOC,Concepto,TipoMovto,ImporteMN" Width="100%" CssClass="table table-striped table-advance table-hover" GridLines="None">
<Columns>
<asp:TemplateField>
<HeaderTemplate>Movimiento</HeaderTemplate>

File diff suppressed because it is too large Load Diff

View File

@@ -1888,7 +1888,7 @@ Partial Class ContabilidadC_RegPrePolizaS
' Conexion As Odbc.OdbcConnection = Nothing
Dim ErrorArchivo = False
Dim ErrorExcel = False
DdlPlantilla.SelectedValue = DdlPlantilla2.SelectedValue
dt = ReadExcelFile(Ruta + FileName, True)
@@ -1930,35 +1930,21 @@ Partial Class ContabilidadC_RegPrePolizaS
If Not ErrorArchivo Then
DtMovimientos.Clear()
Dim ObjConta As New ClsContabilidad()
ObjConta.IniciaTransacSQL()
Try
Dim TieneError As Boolean = False
Dim ContadorUpdate As Integer = 0
Dim ContadorError As Integer = 0
Dim NombreCuenta As String = ""
Dim CvePrePoliza As Integer = 0
Dim Cuenta As String = ""
Dim Reporte As New StringBuilder
Dim TotalCargos As Integer = 0
Dim TotalAbonos As Integer = 0
CvePrePoliza = ObjConta.AddPrePolizas("Contabilidad/RegPrePolizaExcel", DdlPlantilla2.SelectedValue.ToEntero, TotalCargos, TotalAbonos, 1, TxtFecha.Text.ToDate, DdlPlantilla2.SelectedItem.Text.ToString, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=DdlTipoPolizaAdd.SelectedValue.ToEntero)
For Each Row As DataRow In dt.Rows
NombreCuenta = Row("NombreCuenta").ToString
Cuenta = Row("Cuenta").ToString
Dim Importe As Decimal = If(Row("Cargo").ToString.ToDecimal <> 0, Row("Cargo").ToString.ToDecimal, Row("Abono").ToString.ToDecimal)
Dim Concepto As String = Row("Concepto").ToString
Dim Referencia As String = Row("Referencia").ToString
Dim CveCuenta As Integer = -1
Dim NombreCuenta As String = Row("NombreCuenta").ToString
Dim Cuenta As String = Row("Cuenta").ToString
Dim ConceptoAdministrativo As String = Row("ConceptoAdministrativo").ToString
Dim CveSubProyecto As Integer = Row("CveSubProyecto").ToString.ToEntero
Dim TipoMovto As Boolean = If(Row("Cargo").ToString.ToDecimal <> 0, False, True)
Dim YaExiste As Boolean = False
Dim CveConceptoContable As Integer = Row("CveConceptoContable").ToString.ToEntero
Dim IdCtaContable As Integer = Row("IdCtaContable").ToString.ToEntero
Dim CveClasificacion As Integer = -1
@@ -1971,56 +1957,44 @@ Partial Class ContabilidadC_RegPrePolizaS
If CveSubProyecto = 0 Then CveSubProyecto = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", String.Format("SubProyecto = '{0}'", Row("SubProyecto"))).ToEntero
Dim dr As DataRow = DtMovimientos.NewRow
Dim CodigoCuenta As String = ""
dr("IdCuenta") = IdCtaContable
dr("CodigoCuenta") = Cuenta & "<br>" & NombreCuenta
dr("Cuenta") = ConceptoAdministrativo
dr("Referencia") = Row("Referencia").ToString
dr("Concepto") = Row("Concepto").ToString
dr("TipoMovto") = TipoMovto
dr("EsComodin") = 0
dr("CveConcepto") = CveConceptoContable
dr("CveConceptoContable") = CveConceptoContable
dr("ConceptoContable") = ""
dr("Cargo") = Row("Cargo").ToString.ToDecimal
dr("Abono") = Row("Abono").ToString.ToDecimal
dr("Descripcion") = ""
dr("CveSubProyecto") = CveSubProyecto
dr("CveProveedor") = -1
dr("CveCompra") = -1
dr("CvePersonal") = -1
dr("CveClasificacion") = CveClasificacion
dr("CveCliente") = -1
dr("CveVenta") = -1
If Importe <> 0 Then
If ObjConta.GetCuentas(-1, Cuenta.Replace("-", ""), 1, UsuarioActual.CveEmpresa) Then
If ObjConta.DtResultados.Rows.Count > 0 Then
CveCuenta = ObjConta.DtResultados().FiltroPrimeroValor("CveCuenta").ToEntero
'TipoCuenta = ObjConta.DtResultados().FiltroPrimeroValor("Tipo")
Else
Reporte.AppendLine($"{Cuenta} - {NombreCuenta} - {Importe} </br>")
TieneError = True
YaExiste = True
End If
Else
TieneError = True
Exit For
End If
If YaExiste = False Then
If CveCuenta > 0 Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, "", CveConceptoContable, Concepto, Now.ToDate, IdCtaContable, -1, ImporteMX:=Importe, CveSubProyecto:=CveSubProyecto, CveClasificacion:=CveClasificacion, CveCuenta:=CveCuenta) Then
TieneError = True
Exit For
End If
Else
CveCuenta = -2
End If
End If
End If
TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbono.Text.ToDouble).ToString.FormatoNumero
TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargo.Text.ToDouble).ToString.FormatoNumero
DtMovimientos.Rows.Add(dr)
DtMovimientos.AcceptChanges()
Next
If Not TieneError Then
ObjConta.Commit()
Alert(String.Format("<br/><br/>Prepóliza: <b><a href = ""/Contabilidad/RegPrePolizas.aspx?CvePrePoliza={0}"" class=""texto"" target=""_blank"" >{1}</a></b>", CvePrePoliza, "Ver"))
Alert($"Se agregó la póliza {ObjConta.ContaFolio}")
Else
Alert($"No encontraron las siguientes cuentas: {Reporte.ToString} ", TipoMensaje.MsgError)
ObjConta.RollBack()
End If
GvMov.DataSource = DtMovimientos
GvMov.DataBind()
UPMovs.Update()
Catch ex As Exception
ObjConta.RollBack()
Alert("No se pudo cargar el excel")
End Try
ObjConta.Dispose()
End If
End Sub
#End Region