-- mejora

This commit is contained in:
2023-08-18 19:06:42 -07:00
parent 3d032c7dfe
commit cd9d8346f2
18 changed files with 263 additions and 356 deletions

View File

@@ -936,10 +936,10 @@ Public Class ClsContabilidad
' Return Retorno
'End Function
Public Function AddPrePolizasDetalle2(CvePrePoliza As Integer, TipoMovimiento As Boolean, Importe As Decimal, Referencia As String, CveConceptoContable As Integer, Concepto As String, FechaVencimiento As Date, IdCtaContable As Integer, IdSegmentoNegocio As Integer,
Public Function AddPrePolizasDetalle(CvePrePoliza As Integer, TipoMovimiento As Boolean, Importe As Decimal, ImporteMN As Decimal, CveConceptoContable As Integer, Referencia As String, Concepto As String,
Optional CveIE As Integer = -1, Optional CveVenta As Integer = -1, Optional CveCompra As Integer = -1, Optional CveSubProyecto As Integer = -1, Optional CveCliente As Integer = -1, Optional CveProveedor As Integer = -1,
Optional CvePersonal As Integer = -1, Optional CveMovimientoAlmacen As Integer = -1, Optional CveActivoFijo As Integer = -1, Optional CveColectiva As Integer = -1, Optional CveCreditoDetalle As Integer = -1,
Optional CveOC As Integer = -1, Optional CveClasificacion As Integer = -1, Optional CveVentaAmortizacion As Integer = -1, Optional CveCompraAmortizacion As Integer = -1, Optional ImporteMX As Decimal = 0, Optional ImporteME As Decimal = 0,
Optional CveOC As Integer = -1, Optional CveClasificacion As Integer = -1, Optional CveVentaAmortizacion As Integer = -1, Optional CveCompraAmortizacion As Integer = -1, Optional ImporteME As Decimal = 0,
Optional CvePrePolizaOriginal As Integer = -1, Optional CveIEDevolucion As Integer = -1, Optional CveCredito As Integer = -1, Optional CveCuenta As Integer = -1, Optional CveTipoGasto As Integer = -1, Optional Contabilizable As Boolean = True,
Optional TipoCambio As Decimal = 1, Optional CveOCDetalle As Integer = -1, Optional TipoCambioPago As Decimal = 1, Optional PorcentajeImpuesto As Decimal = 0, Optional CveNominaMovtoPermanente As Integer = -1) As Boolean
@@ -961,17 +961,17 @@ Public Class ClsContabilidad
.Add("@CvePrePolizaOriginal", SqlDbType.Int).Value = CvePrePolizaOriginal
.Add("@CveConceptoContable", SqlDbType.Int).Value = CveConceptoContable
.Add("@TipoMovto", SqlDbType.Bit).Value = TipoMovimiento
.Add("@Importe", SqlDbType.Money).Value = Math.Round(Importe, 2)
.Add("@ImporteMX", SqlDbType.Money).Value = Math.Round(ImporteMX, 2)
.Add("@ImporteME", SqlDbType.Money).Value = Math.Round(ImporteME, 3)
.Add("@Importe", SqlDbType.Money).Value = Importe.RoundSQL
.Add("@ImporteMX", SqlDbType.Money).Value = ImporteMN.RoundSQL
.Add("@ImporteME", SqlDbType.Money).Value = ImporteME.RoundSQL(3)
.Add("@TC", SqlDbType.Decimal).Value = TipoCambio
.Add("@TCPago", SqlDbType.Decimal).Value = TipoCambioPago
.Add("@Referencia", SqlDbType.VarChar).Value = Referencia
.Add("@Concepto", SqlDbType.VarChar).Value = Concepto
.Add("@FechaVencimiento", SqlDbType.Date).Value = FechaVencimiento
.Add("@IdCtaContable", SqlDbType.Int).Value = IdCtaContable
'.Add("@FechaVencimiento", SqlDbType.Date).Value = FechaVencimiento
'.Add("@IdCtaContable", SqlDbType.Int).Value = IdCtaContable
'.Add("@IdSegmentoNegocio", SqlDbType.Int).Value = IdSegmentoNegocio
.Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta
.Add("@IdSegmentoNegocio", SqlDbType.Int).Value = IdSegmentoNegocio
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
.Add("@CveVentaAmortizacion", SqlDbType.Int).Value = CveVentaAmortizacion
@@ -1053,19 +1053,6 @@ Public Class ClsContabilidad
Return Retorno
End Function
Public Function AddPrePolizasDetalle(CvePrePoliza As Integer, TipoMovimiento As Boolean, Importe As Decimal, ImporteMN As Decimal, CveConceptoContable As Integer, Referencia As String, Concepto As String,
Optional CveIE As Integer = -1, Optional CveVenta As Integer = -1, Optional CveCompra As Integer = -1, Optional CveSubProyecto As Integer = -1, Optional CveCliente As Integer = -1, Optional CveProveedor As Integer = -1,
Optional CvePersonal As Integer = -1, Optional CveMovimientoAlmacen As Integer = -1, Optional CveActivoFijo As Integer = -1, Optional CveColectiva As Integer = -1, Optional CveCreditoDetalle As Integer = -1,
Optional CveOC As Integer = -1, Optional CveClasificacion As Integer = -1, Optional CveVentaAmortizacion As Integer = -1, Optional CveCompraAmortizacion As Integer = -1, Optional ImporteME As Decimal = 0,
Optional CvePrePolizaOriginal As Integer = -1, Optional CveIEDevolucion As Integer = -1, Optional CveCredito As Integer = -1, Optional CveCuenta As Integer = -1, Optional CveTipoGasto As Integer = -1, Optional Contabilizable As Boolean = True,
Optional TipoCambio As Decimal = 1, Optional CveOCDetalle As Integer = -1, Optional TipoCambioPago As Decimal = 1, Optional PorcentajeImpuesto As Decimal = 0, Optional CveNominaMovtoPermanente As Integer = -1) As Boolean
Dim Retorno As Boolean = False
Retorno = AddPrePolizasDetalle2(CvePrePoliza, TipoMovimiento, Importe, Referencia, CveConceptoContable, Concepto, New DateTime(1900, 1, 1), 0, -1, CveIE, CveVenta, CveCompra, CveSubProyecto, CveCliente, CveProveedor, CvePersonal,
CveMovimientoAlmacen, CveActivoFijo, CveColectiva, CveCreditoDetalle, CveOC, CveClasificacion, CveVentaAmortizacion, CveCompraAmortizacion, ImporteMN, ImporteME, CvePrePoliza, CveIEDevolucion, CveCredito, CveCuenta, CveTipoGasto, Contabilizable,
TipoCambio, CveOCDetalle, TipoCambioPago, PorcentajeImpuesto, CveNominaMovtoPermanente)
Return Retorno
End Function
Public Function ObtenerConceptoEmpresa(CveEmpresa As Integer, CveConcepto As Integer, NombreComercial As String, SerieFolio As String, FolioBancario As String, Optional Adicional As String = "") As String
Dim Concepto As String = ""

View File

@@ -6000,12 +6000,7 @@ Public Class ClsPaginas
If Not UsarStimulsoft Then
Dim Archivo As New System.IO.FileInfo(RutaFormato)
If Archivo.Exists Then
'If UsuarioActual.Empresa.Funcionalidad(350) = "1" Then
' RutaFormato = RutaFormato.Replace(".rdlc", ".mrt")
' retorno = StreamBytesStimulsoft("Facturas", RutaFormato, lrds, params, NombreArchivo:=NombreArchivo, Formato:="PDF")
'Else
' retorno = StreamPDF(RutaFormato, lrds, params, NombreArchivo, "PDF", MR:=Nothing)
'End If
retorno = StreamPDF(RutaFormato, lrds, params, NombreArchivo, "PDF", MR:=Nothing, SubReportData:=SubReportData)
Dim ArchivoPDF As New System.IO.FileInfo(String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, Vta.TipoDocto, Vta.SerieFolio))
If Guardar Then
@@ -6029,12 +6024,7 @@ Public Class ClsPaginas
Else
params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("RFC", UsuarioActual.Empresa.RFC))
'If UsuarioActual.Empresa.Funcionalidad(350) = "1" Then
' RutaFormato = RutaFormato.Replace(".rdlc", ".mrt")
' retorno = StreamBytesStimulsoft("Facturas", RutaFormatoDefault, lrds, params, NombreArchivo:=NombreArchivo, Formato:="PDF")
'Else
' retorno = StreamPDF(RutaFormatoDefault, lrds, params, NombreArchivo, "PDF", MR:=Nothing)
'End If
retorno = StreamPDF(RutaFormatoDefault, lrds, params, NombreArchivo, "PDF", MR:=Nothing, SubReportData:=SubReportData)
End If
Else

View File

@@ -219,8 +219,7 @@ public partial class Bancos_Devoluciones : ClsPaginas
}
protected void CargaDevolucionesProveedor(int CveProveedor)
{
ClsMovimientos ObjMov = new ClsMovimientos();
ClsCompProveedores clsCompProveedores = new ClsCompProveedores();
ClsMovimientos ObjMov = new ClsMovimientos();
if (ObjMov.GetEgresosSinComprobar("-1", "-1", CveProveedor, -1, -1, -1, -1, -1, -1, UsuarioActual.CveEmpresa))
{
@@ -228,8 +227,7 @@ public partial class Bancos_Devoluciones : ClsPaginas
GvDevoluciones.DataSource = ObjMov.DtResultados.FiltraParametros("CveIE > 0 AND Saldo > 0 AND CveConceptoContable in (10,48,338)", "", columnas);
GvDevoluciones.DataBind();
}
ObjMov.Dispose();
clsCompProveedores.Dispose();
ObjMov.Dispose();
UpDevoluciones.Update();
}
#endregion
@@ -249,7 +247,7 @@ public partial class Bancos_Devoluciones : ClsPaginas
case "3":
if (ObjMov.GetEgresosSinComprobar("-1", "-1", -1, CvePersonal, -1, -1, -1, 1, -1, UsuarioActual.CveEmpresa))
{
string[] columnas = new string[7] { "CveIE", "IEDevolucion", "Saldo", "Importe", "Pagado", "Folio", "FechaDocumento" };
string[] columnas = new string[10] { "CveIE", "IEDevolucion", "Saldo", "Importe", "Pagado", "Folio", "FechaDocumento", "Abreviatura", "CveMoneda", "TipoCambio" };
GvDevoluciones.DataSource = ObjMov.DtResultados.FiltraParametros("CveIE > 0 AND Saldo > 0 ", "", columnas);
GvDevoluciones.DataBind();
}
@@ -257,7 +255,7 @@ public partial class Bancos_Devoluciones : ClsPaginas
case "4":
if (ObjMov.GetPrestamosPersonalXSaldar(CvePersonal, -1, UsuarioActual.CveEmpresa))
{
string[] columnas = new string[7] { "CveIE", "IEDevolucion", "Saldo", "Importe", "Pagado", "Folio", "FechaDocumento" };
string[] columnas = new string[10] { "CveIE", "IEDevolucion", "Saldo", "Importe", "Pagado", "Folio", "FechaDocumento", "Abreviatura", "CveMoneda", "TipoCambio" };
GvDevoluciones.DataSource = ObjMov.DtResultados.FiltraParametros("CveIE > 0 AND Saldo > 0 ", "", columnas);
GvDevoluciones.DataBind();
}
@@ -335,9 +333,6 @@ public partial class Bancos_Devoluciones : ClsPaginas
}
//terminan validaciones
List<Archivo> filesgral = Anexo.getfiles().Archivos;
string filemove = "";
string Comprobante = "";
@@ -347,8 +342,6 @@ public partial class Bancos_Devoluciones : ClsPaginas
filemove = fileItem.filename;
}
ClsBancos ObjIE = new ClsBancos();
ClsContabilidad ObjMov = new ClsContabilidad(ObjIE.IniciaTransacSQL());
ClsCompras ObjComp = new ClsCompras(ObjIE.IniciaTransacSQL());
@@ -622,9 +615,9 @@ public partial class Bancos_Devoluciones : ClsPaginas
archivo = new System.IO.FileInfo(String.Format("{0}Formatos/ComprobanteEgreso.rdlc", UsuarioActual.Empresa.Ruta, DdlCuenta.SelectedValue.ToEntero()));
}
if (IDPoliza > 0)
if (CvePrePoliza > 0)
{
Msg.AppendFormat(@"<br/><br/><a class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza</a>", IDPoliza);
Msg.AppendFormat(@"<br/><br/><a class=""Texto"" target='_blank' href=""/Contabilidad/RegPrePolizaS.aspx?CvePrePoliza={0}"">Ver Póliza</a>", CvePrePoliza);
}
ObjIE.Commit();
@@ -633,7 +626,6 @@ public partial class Bancos_Devoluciones : ClsPaginas
filemove.FilesMove(CveIE.ToString(), String.Format("{0}IE", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase: false);
}
if (!Msg.ToString().Equals(""))
{
string AccionJS = String.Format(@"document.location.href=""{0}"";", HttpContext.Current.Request.Url.PathAndQuery);
@@ -661,20 +653,22 @@ public partial class Bancos_Devoluciones : ClsPaginas
{
ClsNominas onom = new ClsNominas();
onom.GetConceptos(UsuarioActual.CveEmpresa);
DataTable dt = onom.DtResultados.FiltraParametros(" FormulaTotal = 'FNC.[MovimientosPermanentes]'");
DdlConcepto.Items.Clear();
DdlConcepto.DataSource = dt.FiltraParametros("Tipo ='D'");
DataRow drow = dt.NewRow();
drow["CveConcepto"] = "-1";
drow["Concepto"] = "Seleccione";
dt.Rows.InsertAt(drow, 0);
DdlConcepto.DataSource = dt;
DdlConcepto.SelectedValueExist("-1");
DdlConcepto.DataBind();
if (onom.GetConceptos(UsuarioActual.CveEmpresa))
{
DataTable dt = onom.DtResultados.FiltraParametros(" FormulaTotal = 'FNC.[MovimientosPermanentes]'");
DdlConcepto.Items.Clear();
DdlConcepto.DataSource = dt.FiltraParametros("Tipo ='D'");
DataRow drow = dt.NewRow();
drow["CveConcepto"] = "-1";
drow["Concepto"] = "Seleccione";
dt.Rows.InsertAt(drow, 0);
DdlConcepto.DataSource = dt;
DdlConcepto.SelectedValueExist("-1");
//DdlConcepto.Items.Insert(0, new ListItem("Seleccione", "-1"));
}
onom.Dispose();
//DdlConcepto.Items.Insert(0, new ListItem("Seleccione", "-1"));
DdlConcepto.DataBind();
}
}

View File

@@ -3225,9 +3225,8 @@ Partial Class Bancos_IE
' 'MOVIMIENTOS CHEQUE
' 'If objIE.GetBancosIEMovimientos(CveIE, UsuarioActual.CveEmpresa) Then
' ' Dim Textov33 As String = ""
' ' If UsuarioActual.Empresa.Funcionalidad(520) = "1" Then
'
' ' Textov33 = "Favor de emitir complemento de pago de los siguientes documentos"
' ' End If
' ' strBody.AppendFormat("<div style='width: 1000px'>")
' ' strBody.AppendFormat(" <table style='width:1000px'>")

View File

@@ -213,18 +213,18 @@ Partial Class Bancos_OtrosIE
Cuenta = DRt("ConceptoContable").ToString
'SACO LA CLAVE DE LA CUENTA BANCARIA SELECCIONADO
If DdlCuenta.SelectedValue.ToEntero > 0 And DRt("CveConcepto").ToString = "30" Then 'DTCuentasContables
' Dim DRr As DataRow = DTCuentasContables.FiltroPrimero(String.Format("Id={0}", IdCuentaBancos(DdlCuenta.SelectedValue.ToEntero)))
If DRr IsNot Nothing Then
CodigoCuenta = DRr("CuentaFormato").ToString()
EsComodin = 1
Else
Alert("La Cuenta Bancaria no se ha vinculado a la cuenta contable", TipoMensaje.MsgAdvertencia)
GvMov.DataBind()
UPMovs.Update()
Exit Sub
End If
End If
'If DdlCuenta.SelectedValue.ToEntero > 0 And DRt("CveConcepto").ToString = "30" Then 'DTCuentasContables
'Dim DRr As DataRow = DTCuentasContables.FiltroPrimero(String.Format("Id={0}", IdCuentaBancos(DdlCuenta.SelectedValue.ToEntero)))
'If DRr IsNot Nothing Then
' CodigoCuenta = DRr("CuentaFormato").ToString()
' EsComodin = 1
'Else
' Alert("La Cuenta Bancaria no se ha vinculado a la cuenta contable", TipoMensaje.MsgAdvertencia)
' GvMov.DataBind()
' UPMovs.Update()
' Exit Sub
' End If
'End If
Dim DR As DataRow = DTMovimientos.NewRow
DR("IdCuenta") = 0

View File

@@ -2678,9 +2678,9 @@ Partial Class Bancos_PagoElectronico
' 'MOVIMIENTOS CHEQUE
' If objIE.GetBancosIEMovimientos(CveIE, UsuarioActual.CveEmpresa) Then
' Dim Textov33 As String = ""
' If UsuarioActual.Empresa.Funcionalidad(520) = "1" Then
' Textov33 = "Favor de emitir complemento de pago de los siguientes documentos"
' End If
' strBody.AppendFormat("<div style='width: 1000px'>")
' strBody.AppendFormat(" <table style='width:1000px'>")

View File

@@ -3264,9 +3264,9 @@ Partial Class Bancos_PagoElectronicoGrupos
' 'MOVIMIENTOS CHEQUE
' If objIE.GetBancosIEMovimientos(CveIE, UsuarioActual.CveEmpresa) Then
' Dim Textov33 As String = ""
' If UsuarioActual.Empresa.Funcionalidad(520) = "1" Then
' Textov33 = "Favor de emitir complemento de pago de los siguientes documentos"
' End If
' strBody.AppendFormat("<div style='width: 1000px'>")
' strBody.AppendFormat(" <table style='width:1000px'>")

View File

@@ -365,7 +365,7 @@ Partial Class Bancos_PolizaCheque
Cuenta = drt("ConceptoContable").ToString
IdCuenta = drt("IdCtaContable").ToString.ToEntero
CveCuenta = 0
CveCuenta = drt("CveCuenta").ToString.ToEntero
CodigoCuenta = drt("Codigo").ToString
NombreCuenta = drt("Nombre").ToString
@@ -717,8 +717,6 @@ Partial Class Bancos_PolizaCheque
CveProveedorSeleccionado = DdlProveedores.txtValue.Value.ToEntero
End If
If DdlCuenta.SelectedValue.ToEntero <= 0 Then
If UsuarioActual.CveEmpresa <> 126 Then
Alert("Seleccione la Cuenta Bancaria", TipoMensaje.MsgAdvertencia)
@@ -726,15 +724,12 @@ Partial Class Bancos_PolizaCheque
Exit Sub
End If
End If
For Each Gvr As GridViewRow In GvMov.Rows
TotalCargos += Gvr.FCTextBox("TxtCargo").Text.ToDecimal
TotalAbonos += Gvr.FCTextBox("TxtAbono").Text.ToDecimal
Next
For Each Gvr As GridViewRow In GvMov.Rows
If Gvr.DataKey("CveConcepto").ToEntero = 30 Then
@@ -749,8 +744,7 @@ Partial Class Bancos_PolizaCheque
If Not ValidaConcepto30 Then
Alert("El importe no coincide con el concepto de bancos.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
Dim filesgral As List(Of Archivo) = Anexo.getfiles().Archivos
Dim filemove As String = ""
@@ -763,14 +757,10 @@ Partial Class Bancos_PolizaCheque
If TotalCargos = TotalAbonos Then
Dim ObjIE As New ClsBancos()
Dim ObjMov As New ClsContabilidad(ObjIE.IniciaTransacSQL)
Dim ObjNom As New ClsNominas(ObjIE.IniciaTransacSQL)
Dim ObjMov As New ClsContabilidad(ObjIE.IniciaTransacSQL)
Dim IDPoliza As Integer = 0
Dim CveIE As Integer
Dim MsgError As String = ""
Dim idCuentaContabilizacion As Long = 1
If MsgError = "" Then
@@ -794,8 +784,6 @@ Partial Class Bancos_PolizaCheque
If CveIE > 0 Then
'inserto los movimientos de la conta para abonar al saldo
If CvePrePoliza > 0 Then
Dim alertaContabilizacion As String = "Se enviaron correctamente las siguientes pólizas:<br><br>"
@@ -831,10 +819,13 @@ Partial Class Bancos_PolizaCheque
Importe = Importe * TC
End If
'If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, Referencia, gvr.DataKey("CveConcepto").ToEntero, TxtObservaciones.Text, Now, gvr.DataKey("IDCuenta").ToEntero, -1, CveIE, CveProveedor:=CveProveedorSeleccionado, CveSubProyecto:=gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero, CvePersonal:=CvePersonalSeleccionado, ImporteMX:=Importe, TipoCambio:=TC, CveCuenta:=gvr.DataKey("CveCuenta").ToEntero) Then
' MsgError = "no se pudo insertar el detalle de la póliza2"
'End If
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, Importe, gvr.DataKey("CveConcepto").ToEntero, Referencia, TxtObservaciones.Text, CveIE:=CveIE, CveProveedor:=CveProveedorSeleccionado, CveSubProyecto:=gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero, CvePersonal:=CvePersonalSeleccionado, TipoCambio:=TC, CveCuenta:=gvr.DataKey("CveCuenta").ToEntero) Then
MsgError = "no se pudo insertar el detalle de la póliza2"
End If
End If
If gvr.DataKey("CveConcepto").ToEntero = 30 Then
If CveMoneda > 1 AndAlso UsuarioActual.CveEmpresa = 119 Then
'Agregamos complementaria
@@ -843,31 +834,18 @@ Partial Class Bancos_PolizaCheque
End If
End If
End If
End If
End If
Next
If TxtAjuste.Text.ToDecimal <> 0 Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TxtAjuste.Text.ToDecimal, TxtAjuste.Text.ToDecimal, 44, "", TxtObservaciones.Text, CveIE:=CveIE, TipoCambio:=TC) Then
MsgError = "no se pudo insertar el detalle de la póliza2"
End If
End If
If CvePeriodo > 0 Then
If Not ObjNom.UpdatePagoNomina(CvePeriodo, CveIE, CvePrePoliza, UsuarioActual.CveEmpresa) Then
MsgError = "No se pudo actualizar el periodo de la nómina"
End If
End If
End If
Else
MsgError = "No se pudo insertar la póliza"
End If
Else
MsgError = "No se insertó el encabezado"
End If
@@ -929,21 +907,17 @@ Partial Class Bancos_PolizaCheque
Alert(StrMsg.ToString, TipoMensaje.MsgInformacion, "window.location.reload();")
Else
Alert(MsgError.ToString, TipoMensaje.MsgError)
ObjIE.RollBack()
ObjIE.RollBack()
End If
Else
Alert("Debe de llevar un importe", TipoMensaje.MsgAdvertencia)
End If
End If
End If
ObjIE.Dispose()
ObjMov.Dispose()
ObjNom.Dispose()
ObjMov.Dispose()
Else
Alert("La suma de los movimientos no son iguales", TipoMensaje.MsgAdvertencia)

View File

@@ -1701,7 +1701,7 @@ Partial Class Compras_Compras
If ProductosCodigoSATNoPermitidos.ToString.Length > 0 Then
Dim mensajeAdvertencia As String = String.Format("El comprobante contiene productos con código SAT '01010101', revise los productos:</br></br>{0}", ProductosCodigoSATNoPermitidos.ToString)
Alert(mensajeAdvertencia, TipoMensaje.MsgAdvertencia)
BtnGuardar.Enabled = False
If UsuarioActual.CveEmpresa.Contiene(119, 158) Then BtnGuardar.Enabled = False
BtnGuardar.ToolTip = "No se permite registrar facturas con conceptos con código '01010101'. Solicite al proveedor un nuevo comprobante."
End If
@@ -4843,7 +4843,8 @@ Partial Class Compras_Compras
End If
If ContadorInventario > 0 Then
CuentaMatrizAlmacen = CtaAlmacen
' CuentaMatrizAlmacen = CtaAlmacen
ElseIf grp.CveActivoFijo > 0 Then
Dim CtaAF = -1

View File

@@ -1849,14 +1849,9 @@ Partial Class Compras_Proveedores
DdlCveTipoProveedor.SelectedValue.ToEntero, DdlMonedaPrefente.SelectedValue.ToEntero, UsaLimiteCredito:=ChkUsaLimiteCredito.Checked, DIOTCveTipoTercero:=DDlDIOTTipoTercero.SelectedValue.ToEntero, DIOTCveTipoOperacion:=DdlDIOTTipoOperacion.SelectedValue.ToEntero, DIOTNumeroIDFiscal:=TxtDIOTNumIDFiscal.Text, CveUsuarioModifico:=UsuarioActual.CveUsuario,
DIOTCvePais:=DdlDIOTPais.SelectedValue.ToEntero, AplicarEvaluacion:=ChkAplicarEvaluacion.Checked, FechaEvaluacion:=FechaEvaluacion, CicloEvaluacion:=CicloEvaluacion, CveUsuarioEvaluador:=DdlUsuarioEvaluador.SelectedValue.ToEntero(), CP:=TxtCP.Text.ToEntero, DIOTNacionalidad:=TxtDIOTNacionalidad.Text,
CveConfianzaProveedor:=DdlConfianzaProveedor.SelectedValue.ToEntero(), CveRegimenFiscal:=DdlRegimenFiscal.SelectedValue.ToEntero) Then
'CargaDatos()
If tIdContaProveedor > 0 AndAlso CreoCuenta Then ObjProveedores.UpdateProveedorIdCuentaAC(CveProveedor, tIdContaProveedor)
'If ObjProveedores.GetProveedores(ClsCompProveedores.TipoConsulta.ParaGlobalDT, -1, "-1", "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then
GlobalDTCompProveedores(UsuarioActual.CveEmpresa) = Nothing
'End If
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
'HABILITA ENVIAR ACTIVACION AL PORTAL PROVEEDOR SI SE AGREGO CORREO

View File

@@ -1185,25 +1185,25 @@ Partial Class RegPoliza
Dim tCveSub As Integer = If(drt("IdSegNeg").ToString <> "", GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"SubProyecto ='{drt("SegNeg")}'").ToEntero, -1)
'If tCveSub <= 0 AndAlso drt("IdSegNeg").ToString.ToEntero = 0 Then 'toma el primero
' tCveSub = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto").ToEntero
'End If ' Now, drt("IdCuenta").ToString.ToEntero, 0,
'If ObjConta.AddPrePolizasDetalle(tCvePrePoliza, drt("TipoMovto").ToString = "True",
' drt("Importe").ToString.ToDecimal,
' drt("Importe").ToString.ToDecimal, 299,
' drt("Concepto").ToString,
' drt("Concepto").ToString,
' CveSubProyecto:=tCveSub,
' CveCuenta:=tCveCuenta) Then
' 'registro
' If Not ObjContaq.UpdateMovimientoPrePolizaDetalle(drt("IdPoliza").ToString.ToEntero,
' drt("Id").ToString.ToEntero,
' ObjConta.CvePrePolizaDetalle) Then
' ErrorRegistro = True
' Exit For
' End If
'Else
' ErrorRegistro = True
' Exit For
'End If
If ObjConta.AddPrePolizasDetalle2(tCvePrePoliza, drt("TipoMovto").ToString = "True",
drt("Importe").ToString.ToDecimal,
drt("Concepto").ToString, 299,
drt("Concepto").ToString, Now,
drt("IdCuenta").ToString.ToEntero, 0,
CveSubProyecto:=tCveSub,
ImporteMX:=drt("Importe").ToString.ToDecimal, CveCuenta:=tCveCuenta) Then
'registro
If Not ObjContaq.UpdateMovimientoPrePolizaDetalle(drt("IdPoliza").ToString.ToEntero,
drt("Id").ToString.ToEntero,
ObjConta.CvePrePolizaDetalle) Then
ErrorRegistro = True
Exit For
End If
Else
ErrorRegistro = True
Exit For
End If
Next
If Not ErrorRegistro AndAlso tCvePrePolizaOriginal <= 0 AndAlso Not ObjConta.UpdatePrePoliza(dr("FechaPol").ToString.ToDate, dr("Folio").ToString.ToEntero, -1, tIdPoliza, tCvePrePoliza, UsuarioActual.CveEmpresa, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then

View File

@@ -1079,20 +1079,20 @@ Partial Class ContabilidadC_RegPrePoliza
idCuentaContabilizacion = 0
End If
If Importe <> 0 Then
If ObjMov.AddPrePolizasDetalle2(CvePrePoliza, TipoMovto, Importe, gvr.FCLiteral("LtlReferencia").Text, gvr.DataKey("CveConcepto").ToEntero(), gvr.FCTextBox("TxtConcepto").Text,
TxtFecha.Text.ToDate(), IdCtaContable, -1, CveSubProyecto:=gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero(), CveIE:=CveIE,
CveProveedor:=CveProveedor, CveCompra:=CveCompra,
CvePersonal:=gvr.DataKey("CvePersonal").ToEntero(), CveClasificacion:=gvr.DataKey("CveClasificacion").ToEntero(),
CveTipoGasto:=gvr.FCDropDownList("DdlTipoGasto").SelectedValue.ToEntero(),
CveCliente:=gvr.DataKey("CveCliente").ToEntero(), CveVenta:=gvr.DataKey("CveVenta").ToEntero(), TipoCambio:=If(gvr.DataKey("TC").ToString().ToDecimal() > 0, gvr.DataKey("TC").ToString().ToDecimal(), 1),
ImporteME:=If(gvr.DataKey("TC").ToString().ToDecimal() > 0, (Importe / (gvr.DataKey("TC").ToString().ToDecimal() - 1)).RoundSQL, 0),
PorcentajeImpuesto:=gvr.DataKey("PorcentajeImpuesto").ToDecimal(), CveCuenta:=gvr.DataKey("CveCuenta").ToEntero()) Then
Else
MsgError = "No se pudo insertar el detalle de la póliza2"
Exit For
End If
End If
'If Importe <> 0 Then
' If ObjMov.AddPrePolizasDetalle2(CvePrePoliza, TipoMovto, Importe, gvr.FCLiteral("LtlReferencia").Text, gvr.DataKey("CveConcepto").ToEntero(), gvr.FCTextBox("TxtConcepto").Text,
' TxtFecha.Text.ToDate(), IdCtaContable, -1, CveSubProyecto:=gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero(), CveIE:=CveIE,
' CveProveedor:=CveProveedor, CveCompra:=CveCompra,
' CvePersonal:=gvr.DataKey("CvePersonal").ToEntero(), CveClasificacion:=gvr.DataKey("CveClasificacion").ToEntero(),
' CveTipoGasto:=gvr.FCDropDownList("DdlTipoGasto").SelectedValue.ToEntero(),
' CveCliente:=gvr.DataKey("CveCliente").ToEntero(), CveVenta:=gvr.DataKey("CveVenta").ToEntero(), TipoCambio:=If(gvr.DataKey("TC").ToString().ToDecimal() > 0, gvr.DataKey("TC").ToString().ToDecimal(), 1),
' ImporteME:=If(gvr.DataKey("TC").ToString().ToDecimal() > 0, (Importe / (gvr.DataKey("TC").ToString().ToDecimal() - 1)).RoundSQL, 0),
' PorcentajeImpuesto:=gvr.DataKey("PorcentajeImpuesto").ToDecimal(), CveCuenta:=gvr.DataKey("CveCuenta").ToEntero()) Then
' Else
' MsgError = "No se pudo insertar el detalle de la póliza2"
' Exit For
' End If
'End If
If CveIE > 0 AndAlso gvr.DataKey("CveConcepto").ToEntero = 30 Then
MensajeAlert.AppendFormat("<br/><br/>Folio Bancario: <b><a href = ""/Bancos/IE.aspx?CveIE={0}"" class=""texto"" target=""_blank"" >{1}</a></b>", CveIE, FolioIE)
End If
@@ -2257,16 +2257,16 @@ Partial Class ContabilidadC_RegPrePoliza
' CargoAbono = False
'End If
If YaExiste = False Then
If IdCuenta > 0 Then
If Not ObjConta.AddPrePolizasDetalle2(CvePrePoliza, TipoMovto, Importe, "", CveConceptoContable, Concepto, Now.ToDate(), IdCtaContable, -1, ImporteMX:=Importe, CveSubProyecto:=CveSubProyecto, CveCuenta:=IdCuenta) Then
TieneError = True
Exit For
End If
Else
IdCuenta = -2
End If
End If
'If YaExiste = False Then
' If IdCuenta > 0 Then
' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, "", CveConceptoContable, Concepto, Now.ToDate(), IdCtaContable, -1, ImporteMX:=Importe, CveSubProyecto:=CveSubProyecto, CveCuenta:=IdCuenta) Then
' TieneError = True
' Exit For
' End If
' Else
' IdCuenta = -2
' End If
'End If
Next

View File

@@ -1196,8 +1196,9 @@ Partial Class ContabilidadC_RegPrePolizaS
End If
If Not ObjContabilidad.UpdatePrePolizasDetalle(row.DataKey("CvePrePolizaDetalle").ToEntero, row.FCLiteral("TxtConcepto").Text, row.DataKey("CveSubProyecto").ToEntero,
If(row.FCLiteral("TxtCargo").Text.ToDecimal <> 0, False, True), If(row.FCLiteral("TxtCargo").Text.ToDecimal <> 0,
row.FCLiteral("TxtCargo").Text.ToDecimal, row.FCLiteral("TxtAbono").Text.ToDecimal), CveTipoGasto:=If(DdlTipoGasto.Visible, row.DataKey("CveTipoGasto").ToEntero, row.DataKey("CveTipoGasto").ToEntero),
-1, If(row.FCLiteral("TxtCargo").Text.ToDecimal <> 0, False, True),
If(row.FCLiteral("TxtCargo").Text.ToDecimal <> 0, row.FCLiteral("TxtCargo").Text.ToDecimal, row.FCLiteral("TxtAbono").Text.ToDecimal),
CveTipoGasto:=If(DdlTipoGasto.Visible, row.DataKey("CveTipoGasto").ToEntero, row.DataKey("CveTipoGasto").ToEntero),
CveConceptoContable:=row.DataKey("CveConceptoContable").ToEntero, CveProveedor:=row.DataKey("CveProveedor").ToEntero, CveCompra:=row.DataKey("CveCompra").ToEntero,
CveCliente:=row.DataKey("CveCliente").ToEntero, CveVenta:=row.DataKey("CveVenta").ToEntero,
CvePersonal:=row.DataKey("CvePersonal").ToEntero, Referencia:=row.FCLiteral("TxtRef").Text, CveCuenta:=row.DataKey("CveCuenta").ToEntero, CveUsuarioModifico:=UsuarioActual.CveUsuario, CveIE:=CveIEAgregado) Then

View File

@@ -3589,7 +3589,7 @@ Partial Class General_SaldosIniciales
If Not ObjRH.AddPersonal(Codigo, ApellidoPaterno, ApellidoMaterno, Nombre, CorreoElectronico, FechaIn, CveTipoPeriodo, NumeroSS, CBool(AltaIMSS), SalarioDiario.ToDouble, SalarioDiario.ToDouble, SDI.ToDouble, SDI.ToDouble,
-1, -1, -1, CveMetodoPago, FechaIn, FechaFn.ToString(), CveTipoContrato, Direccion, CveTurno, CvePuesto, CveDepartamento, -1, CveEscolaridad, CveEstadoCivil, CveGenero, -1, FechaBaja, CveEstatusPersonal, FechaNac,
LugarNacimiento, Direccion, "", "", "", CodigoPostal, Ciudad, CveEstado, Telefono, "", Celular, RFC, CURP, "", NombrePadre, NombreMadre, -1, CveSATRiesgoPuesto, CveSATRegimenContratacion, -1, CveSubProyecto, "", -1,
ClabeInterbancaria, "", CveJornada, CveJornada, "", -1, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveUsuarioNomina, "", CveRegistroPatronal:=CveRegistroPatronal, CveTipoTrabajador:=CveTipoTrabajador) Then
ClabeInterbancaria, "", CveJornada, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveUsuarioNomina, "", CveRegistroPatronal:=CveRegistroPatronal, CveTipoTrabajador:=CveTipoTrabajador) Then
If (ObjRH.noguardoXcurpb) Then
Else
ErrorRH = True

View File

@@ -259,7 +259,7 @@ Partial Class Inventarios_CatAlmacenes
If HdnModalidad.Value = "A" Then
If ObjAlmacen.AddAlmacen(TxtAlmacen.Text.Trim, DdlTipoAlmacen.SelectedValue.ToEntero, CuentaContable, DdlModalidad.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,
If ObjAlmacen.AddAlmacen(TxtAlmacen.Text.Trim, DdlTipoAlmacen.SelectedValue.ToEntero, DdlModalidad.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,
CByte(DdlInventariable.SelectedValue), DdlSubProyecto.SelectedValue.ToEntero, TxtOrden.Text.ToEntero, CveCuenta, CveUsuarioAutoriza:=DdlUsuariosAutoriza.SelectedValue.ToEntero,
CveAlmacenVirtual:=DdlAlmacenesVirtuales.SelectedValue.ToEntero()) Then
Alert("El nuevo Almacen se guardó correctamente.", TipoMensaje.MsgInformacion)
@@ -271,7 +271,7 @@ Partial Class Inventarios_CatAlmacenes
Else
TieneError = True
End If
ElseIf ObjAlmacen.UpdateAlmacen(TxtAlmacen.Text.Trim, DdlTipoAlmacen.SelectedValue.ToEntero, CuentaContable, DdlModalidad.SelectedValue.ToEntero, (CByte(Estatus)), HdnID.Value.ToEntero, CByte(DdlInventariable.SelectedValue), DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, TxtOrden.Text.ToEntero, CveCuenta, CveUsuarioAutoriza:=DdlUsuariosAutoriza.SelectedValue.ToEntero, CveAlmacenVirtual:=DdlAlmacenesVirtuales.SelectedValue.ToEntero) Then
ElseIf ObjAlmacen.UpdateAlmacen(TxtAlmacen.Text.Trim, DdlTipoAlmacen.SelectedValue.ToEntero, DdlModalidad.SelectedValue.ToEntero, (CByte(Estatus)), HdnID.Value.ToEntero, CByte(DdlInventariable.SelectedValue), DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, TxtOrden.Text.ToEntero, CveCuenta, CveUsuarioAutoriza:=DdlUsuariosAutoriza.SelectedValue.ToEntero, CveAlmacenVirtual:=DdlAlmacenesVirtuales.SelectedValue.ToEntero) Then
Alert("El Almacen se actualizo correctamente.", TipoMensaje.MsgInformacion)
UpDatos.Update()
ViewState("DTAlmacenes") = ObjAlmacen.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)

View File

@@ -2538,11 +2538,11 @@ Partial Class Clientes
Dim NombreCuentaCuentaAltaCompaq As String = ""
Dim IdCuentaAltaCompaq As Integer = -1
'Si tiene contabilizacion automatica y la funcionalidad de carga cuenta automatica o UsaAC le agregamos automaticamente una cuenta al cliente
If UsuarioActual.Empresa.Funcionalidad(211).ToEntero() > 0 AndAlso (UsuarioActual.Empresa.Funcionalidad(200).ToEntero() > 0 Or UsuarioActual.Empresa.UsaAC) AndAlso DdlCtaContableClientes.SelectedValue.ToEntero() < 1 Then
If Not AgregarCuentaContable(BtnActivaRegistroClientes, DdlCtaContableClientes, CodigoCuentaAltaCompaq, NombreCuentaCuentaAltaCompaq, IdCuentaAltaCompaq) Then
ErrorProceso = True
End If
End If
'If UsuarioActual.Empresa.Funcionalidad(211).ToEntero() > 0 AndAlso (UsuarioActual.Empresa.Funcionalidad(200).ToEntero() > 0 Or UsuarioActual.Empresa.UsaAC) AndAlso DdlCtaContableClientes.SelectedValue.ToEntero() < 1 Then
' If Not AgregarCuentaContable(BtnActivaRegistroClientes, DdlCtaContableClientes, CodigoCuentaAltaCompaq, NombreCuentaCuentaAltaCompaq, IdCuentaAltaCompaq) Then
' ErrorProceso = True
' End If
'End If
'Dim MetodoPago = DdlMetodoPago.SelectedValue.Toentero()
'If UsuarioActual.Empresa.CvePlataforma = 3 Then
@@ -2612,12 +2612,11 @@ Partial Class Clientes
End If
End If
If IdCuentaAltaCompaq > 0 Then
If Not AltaCuentaContabilidadSIG(CodigoCuentaAltaCompaq, NombreCuentaCuentaAltaCompaq, IdCuentaAltaCompaq, 1, ObjClientes.IniciaTransacSQL) Then
ErrorProceso = True
End If
End If
'If IdCuentaAltaCompaq > 0 Then
' If Not AltaCuentaContabilidadSIG(CodigoCuentaAltaCompaq, NombreCuentaCuentaAltaCompaq, IdCuentaAltaCompaq, 1, ObjClientes.IniciaTransacSQL) Then
' ErrorProceso = True
' End If
'End If
If ErrorProceso Then
ObjClientes.RollBack()
@@ -2638,7 +2637,6 @@ Partial Class Clientes
End If
End If
Else
Dim NombreCliente As String = ""
If TxtRFC.Text.Length = 13 AndAlso TxtApellidoPaterno.Text <> "" AndAlso TxtApellidoMaterno.Text <> "" AndAlso TxtNombres.Text <> "" Then
@@ -2672,7 +2670,6 @@ Partial Class Clientes
ObjClientes.AddClienteImpuestosLocales(CveCliente, GVR.DataKey("CveImpuestoLocal").ToEntero())
End If
Next
GuardarDocumentosClientes()
'For Each gvr As GridViewRow In GvDocsVentas.Rows
@@ -2753,18 +2750,13 @@ Partial Class Clientes
#Region "G L O B L A L"
Private Sub RecargaGlobal()
'Dim Hilo As New System.Threading.Thread(AddressOf GeneraGlobalDT)
'Hilo.Start()
Private Sub RecargaGlobal()
GeneraGlobalDT()
End Sub
Private Sub GeneraGlobalDT()
GlobalDTCliente(UsuarioActual.CveEmpresa) = Nothing
'Dim Objclientes As New ClsClientes
'If Objclientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, -1, Estatus:=-1) Then
' Application("GlobalDTCliente") = Objclientes.DtResultados
'End If
'Objclientes.Dispose()
GlobalDTCliente(UsuarioActual.CveEmpresa) = Nothing
End Sub
#End Region
@@ -3701,147 +3693,147 @@ Partial Class Clientes
End Sub
Public Sub BtnAgregaCuentaContable(sender As Object, e As EventArgs) Handles BtnActivaRegistroClientes.Click, BtnActivaRegistroAnticipos.Click, BtnActivaRegistroIVA.Click, BtnActivaRegistroISR.Click
Dim CuentaContable = DirectCast(sender, Button).CommandArgument.ToString()
Dim Button = DirectCast(sender, Button)
'Dim CuentaContable = DirectCast(sender, Button).CommandArgument.ToString()
'Dim Button = DirectCast(sender, Button)
Dim CodigoCuentaAltaCompaq As String = ""
Dim NombreCuentaCuentaAltaCompaq As String = ""
Dim IdCuentaAltaCompaq As Integer = -1
'Dim CodigoCuentaAltaCompaq As String = ""
'Dim NombreCuentaCuentaAltaCompaq As String = ""
'Dim IdCuentaAltaCompaq As Integer = -1
Select Case CuentaContable
Case "Clientes"
AgregarCuentaContable(Button, DdlCtaContableClientes, "", "", -1)
Case "Anticipos"
'Select Case CuentaContable
' Case "Clientes"
' AgregarCuentaContable(Button, DdlCtaContableClientes, "", "", -1)
' Case "Anticipos"
AgregarCuentaContable(Button, DdlCtaContableAnticipos, CodigoCuentaAltaCompaq, NombreCuentaCuentaAltaCompaq, IdCuentaAltaCompaq)
AltaCuentaContabilidadSIG(CodigoCuentaAltaCompaq, NombreCuentaCuentaAltaCompaq, IdCuentaAltaCompaq, 3)
' AgregarCuentaContable(Button, DdlCtaContableAnticipos, CodigoCuentaAltaCompaq, NombreCuentaCuentaAltaCompaq, IdCuentaAltaCompaq)
' AltaCuentaContabilidadSIG(CodigoCuentaAltaCompaq, NombreCuentaCuentaAltaCompaq, IdCuentaAltaCompaq, 3)
Case "RetIVA"
' Case "RetIVA"
AgregarCuentaContable(Button, DdlCtaContableRetIVA, "", "", -1)
Case "RetISR"
AgregarCuentaContable(Button, DdlCtaContableRetISR, "", "", -1)
End Select
' AgregarCuentaContable(Button, DdlCtaContableRetIVA, "", "", -1)
' Case "RetISR"
' AgregarCuentaContable(Button, DdlCtaContableRetISR, "", "", -1)
'End Select
End Sub
Private Function AgregarCuentaContable(btn As Button, ddl As DropDownList, ByRef CodigoCuentaAltaCompaq As String, ByRef NombreCuentaCuentaAltaCompaq As String, ByRef IdCuentaAltaCompaq As Integer) As Boolean
Dim IdCuentaContable As Integer = -1
Dim CtaCodigo As String = ""
Dim TieneError = False
Dim ProcesoCorrecto As Boolean
Dim ObjContaAC As New ClsContPAQi(UsuarioActual.Empresa)
ObjContaAC.IniciaTransacSQL()
Dim CuentaPadre = -1
Select Case btn.CommandArgument.ToString()
Case "Clientes"
CuentaPadre = UsuarioActual.Empresa.Funcionalidad(211).ToEntero()
Case "Anticipos"
CuentaPadre = UsuarioActual.Empresa.Funcionalidad(212).ToEntero()
Case "RetIVA"
CuentaPadre = UsuarioActual.Empresa.Funcionalidad(213).ToEntero()
Case "RetISR"
CuentaPadre = UsuarioActual.Empresa.Funcionalidad(214).ToEntero()
End Select
'SI EL NOMBRE DEL PROVEEDOR ES MAYOR DE 50 LO CORTAMOS
Dim NombreCuenta = If(TxtNombreComercial.Text.Trim.Length > 50, TxtNombreComercial.Text.Trim.Substring(0, 50), TxtNombreComercial.Text.Trim)
IdCuentaContable = ObjContaAC.AddSiguienteCuentaHijo(CuentaPadre, NombreCuenta, Tipo:="A", CuentaMayor:=2)
NombreCuentaCuentaAltaCompaq = NombreCuenta
IdCuentaAltaCompaq = IdCuentaContable
If IdCuentaContable > 0 Then
ObjContaAC.GetCuentas(IdCuentaContable, "-1", -1)
Dim dt = ObjContaAC.DtResultados
If dt.Rows.Count = 1 Then
Dim row As DataRow = dt.Rows(0)
CtaCodigo = CStr(row("CtaCodigo"))
CodigoCuentaAltaCompaq = CStr(row("Codigo"))
Else
TieneError = True
End If
Else
TieneError = True
End If
If Not TieneError Then
ObjContaAC.Commit()
'Alert(String.Format("Se registo la Cuenta Contable: {0}", CtaCodigo, TipoMensaje.MsgInformacion))
ddl.Items.Add(New ListItem(CtaCodigo, IdCuentaContable.ToString())) : ddl.SelectedValueExist(IdCuentaContable.ToString())
btn.Visible = False
ddl.Width = 206
ProcesoCorrecto = True
Else
ObjContaAC.RollBack()
Alert("error", TipoMensaje.MsgError)
ProcesoCorrecto = False
End If
ObjContaAC.Dispose()
UpFiscalContable.Update()
Return ProcesoCorrecto
End Function
Private Function AltaCuentaContabilidadSIG(CodigoCuentaAltaCompaq As String, NombreCuentaCuentaAltaCompaq As String, IdCuentaAltaCompaq As Integer, CveConceptoContable As Integer, Optional Transaccion As SqlTransaction = Nothing) As Boolean
Dim Respuesta As Boolean = False
Dim DisposeClases As Boolean = False
Dim ObjContabilidad As ClsContabilidad
If Transaccion Is Nothing Then
ObjContabilidad = New ClsContabilidad
DisposeClases = True
Else
ObjContabilidad = New ClsContabilidad(Transaccion)
DisposeClases = False
End If
If UsuarioActual.CveEmpresa.Contiene(7, 11, 145, 122) Then
Dim CvePadre As Integer = GlobalDTContaCuentasContables(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveCuenta", $"IdCompaq = {UsuarioActual.Empresa.Funcionalidad(211).ToEntero()}").ToEntero
'If ObjContabilidad.GetCuentasGlobales(UsuarioActual.CveEmpresa, 1) Then
' Dim CvePadre As Integer = ObjContabilidad.DtResultados.FiltroPrimeroValor("CveCuenta").ToEntero
If CvePadre > 0 Then
Dim CvecuentaNueva As Integer = ObjContabilidad.AddCuenta(CvePadre, CodigoCuentaAltaCompaq, NombreCuentaCuentaAltaCompaq, "A", 2, 1, CveCliente:=CveCliente, IdCompaq:=IdCuentaAltaCompaq)
If CvecuentaNueva > 0 Then
If ObjContabilidad.AddCuentasAsignaciones(CveConceptoContable, UsuarioActual.CveEmpresa, CvecuentaNueva, CveCliente:=CveCliente, PorcentajeIVA:=0) Then
Respuesta = True
End If
End If
End If
'End If
Else
Respuesta = True
End If
If DisposeClases Then
ObjContabilidad.Dispose()
If Not Respuesta Then
Alert("Se presento un error al agregar y asignar la cuenta (Conta SIG).", TipoMensaje.MsgAdvertencia)
End If
End If
Return Respuesta
End Function
End Sub
'Private Function AgregarCuentaContable(btn As Button, ddl As DropDownList, ByRef CodigoCuentaAltaCompaq As String, ByRef NombreCuentaCuentaAltaCompaq As String, ByRef IdCuentaAltaCompaq As Integer) As Boolean
' Dim IdCuentaContable As Integer = -1
' Dim CtaCodigo As String = ""
' Dim TieneError = False
' Dim ProcesoCorrecto As Boolean
' Dim ObjContaAC As New ClsContPAQi(UsuarioActual.Empresa)
' ObjContaAC.IniciaTransacSQL()
' Dim CuentaPadre = -1
' Select Case btn.CommandArgument.ToString()
' Case "Clientes"
' CuentaPadre = UsuarioActual.Empresa.Funcionalidad(211).ToEntero()
' Case "Anticipos"
' CuentaPadre = UsuarioActual.Empresa.Funcionalidad(212).ToEntero()
' Case "RetIVA"
' CuentaPadre = UsuarioActual.Empresa.Funcionalidad(213).ToEntero()
' Case "RetISR"
' CuentaPadre = UsuarioActual.Empresa.Funcionalidad(214).ToEntero()
' End Select
' 'SI EL NOMBRE DEL PROVEEDOR ES MAYOR DE 50 LO CORTAMOS
' Dim NombreCuenta = If(TxtNombreComercial.Text.Trim.Length > 50, TxtNombreComercial.Text.Trim.Substring(0, 50), TxtNombreComercial.Text.Trim)
' IdCuentaContable = ObjContaAC.AddSiguienteCuentaHijo(CuentaPadre, NombreCuenta, Tipo:="A", CuentaMayor:=2)
' NombreCuentaCuentaAltaCompaq = NombreCuenta
' IdCuentaAltaCompaq = IdCuentaContable
' If IdCuentaContable > 0 Then
' ObjContaAC.GetCuentas(IdCuentaContable, "-1", -1)
' Dim dt = ObjContaAC.DtResultados
' If dt.Rows.Count = 1 Then
' Dim row As DataRow = dt.Rows(0)
' CtaCodigo = CStr(row("CtaCodigo"))
' CodigoCuentaAltaCompaq = CStr(row("Codigo"))
' Else
' TieneError = True
' End If
' Else
' TieneError = True
' End If
' If Not TieneError Then
' ObjContaAC.Commit()
' 'Alert(String.Format("Se registo la Cuenta Contable: {0}", CtaCodigo, TipoMensaje.MsgInformacion))
' ddl.Items.Add(New ListItem(CtaCodigo, IdCuentaContable.ToString())) : ddl.SelectedValueExist(IdCuentaContable.ToString())
' btn.Visible = False
' ddl.Width = 206
' ProcesoCorrecto = True
' Else
' ObjContaAC.RollBack()
' Alert("error", TipoMensaje.MsgError)
' ProcesoCorrecto = False
' End If
' ObjContaAC.Dispose()
' UpFiscalContable.Update()
' Return ProcesoCorrecto
'End Function
'Private Function AltaCuentaContabilidadSIG(CodigoCuentaAltaCompaq As String, NombreCuentaCuentaAltaCompaq As String, IdCuentaAltaCompaq As Integer, CveConceptoContable As Integer, Optional Transaccion As SqlTransaction = Nothing) As Boolean
' Dim Respuesta As Boolean = False
' Dim DisposeClases As Boolean = False
' Dim ObjContabilidad As ClsContabilidad
' If Transaccion Is Nothing Then
' ObjContabilidad = New ClsContabilidad
' DisposeClases = True
' Else
' ObjContabilidad = New ClsContabilidad(Transaccion)
' DisposeClases = False
' End If
' If UsuarioActual.CveEmpresa.Contiene(7, 11, 145, 122) Then
' Dim CvePadre As Integer = GlobalDTContaCuentasContables(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveCuenta", $"IdCompaq = {UsuarioActual.Empresa.Funcionalidad(211).ToEntero()}").ToEntero
' 'If ObjContabilidad.GetCuentasGlobales(UsuarioActual.CveEmpresa, 1) Then
' ' Dim CvePadre As Integer = ObjContabilidad.DtResultados.FiltroPrimeroValor("CveCuenta").ToEntero
' If CvePadre > 0 Then
' Dim CvecuentaNueva As Integer = ObjContabilidad.AddCuenta(CvePadre, CodigoCuentaAltaCompaq, NombreCuentaCuentaAltaCompaq, "A", 2, 1, CveCliente:=CveCliente, IdCompaq:=IdCuentaAltaCompaq)
' If CvecuentaNueva > 0 Then
' If ObjContabilidad.AddCuentasAsignaciones(CveConceptoContable, UsuarioActual.CveEmpresa, CvecuentaNueva, CveCliente:=CveCliente, PorcentajeIVA:=0) Then
' Respuesta = True
' End If
' End If
' End If
' 'End If
' Else
' Respuesta = True
' End If
' If DisposeClases Then
' ObjContabilidad.Dispose()
' If Not Respuesta Then
' Alert("Se presento un error al agregar y asignar la cuenta (Conta SIG).", TipoMensaje.MsgAdvertencia)
' End If
' End If
' Return Respuesta
'End Function
#End Region

View File

@@ -8464,11 +8464,8 @@ Partial Class PV
DVRegimenSociedad.Visible = False
DivRazonSocial2.Attributes.Add("class", "col-md-12")
If UsuarioActual.Empresa.Funcionalidad(350).Contiene("1", "2") Then
DivRazonSocial2.Attributes.Add("class", "col-md-8")
DVRegimenSociedad.Visible = True
DivRazonSocial2.Attributes.Add("class", "col-md-8")
DVRegimenSociedad.Visible = True
If TxtRFCCliente.Text.ToUpper = "XAXX010101000" Then
DdlRegimenFiscalCliente.DataSource = GlobalDTRegimenesFiscales().FiltraParametros("CveRegimenFiscal = 11")
@@ -8497,14 +8494,7 @@ Partial Class PV
DdlUsoCFDICliente.Items.Clear()
DdlUsoCFDICliente.Items.Insert(0, New ListItem("Seleccione", "-1"))
End If
MuestraOcultaGenero()
UpAgregarCliente.Update()
End Sub

View File

@@ -79,10 +79,8 @@ Partial Class Ventas_RepProductosServiciosDetalle
CargaParametrosDetalle()
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
LblServicioDomicilioFiltro.Visible = True
DVServicioDomicilio.Visible = True
End If
If UsuarioActual.CveEmpresa.Contiene(7, 122) Then
@@ -772,20 +770,12 @@ Partial Class Ventas_RepProductosServiciosDetalle
Private Sub BtnDescargarPDF_Click(sender As Object, e As EventArgs) Handles BtnDescargarZipPDF.Click
'If Not Directory.Exists(AppDomain.CurrentDomain.BaseDirectory & "Temp\" & UsuarioActual.CveUsuario.ToString & "\") Then
' Directory.CreateDirectory(AppDomain.CurrentDomain.BaseDirectory & "Temp\" & UsuarioActual.CveUsuario.ToString & "\")
'End If
Dim Archivo As String = String.Empty
Dim HuboInexistentes As Boolean = False
Dim SBInexistentes As New StringBuilder : SBInexistentes.Append("No se pudieron anexar los siguientes archivos:<br />")
Dim ArchivoDestino As String = String.Format("{0}Temp\{1}.zip", AppDomain.CurrentDomain.BaseDirectory, Now.ToString("yyyyMMddhhmmss") & UsuarioActual.CveUsuario.ToString)
Dim archiveZip As ZipArchive = ZipFile.Open(ArchivoDestino, ZipArchiveMode.Create)
Dim DTVentas As DataTable = TmpDT.FiltraParametros("", "", {"CveVenta", "TipoDocumento", "Folio", "SerieFolio"})
Try
@@ -797,10 +787,8 @@ Partial Class Ventas_RepProductosServiciosDetalle
If Drow("TipoDocumento").ToString.Trim <> String.Empty Then
Archivo = String.Format("{0}PDF/{1}/{2}.pdf", UsuarioActual.Empresa.Ruta.Replace("\", "/"), Drow("TipoDocumento").ToString, Drow("SerieFolio").ToString)
If File.Exists(Archivo) Then
archiveZip.CreateEntryFromFile(Archivo, Drow("SerieFolio").ToString & ".pdf")
If UsuarioActual.CveRol = 1 Then
If UsuarioActual.CveRol = 1 OrElse UsuarioActual.CveEmpresa = 119 Then
Archivo = String.Format("{0}XML/{1}/{2}.xml", UsuarioActual.Empresa.Ruta.Replace("\", "/"), Drow("TipoDocumento").ToString, Drow("SerieFolio").ToString)
If File.Exists(Archivo) Then
archiveZip.CreateEntryFromFile(Archivo, Drow("SerieFolio").ToString & ".xml")
@@ -810,7 +798,6 @@ Partial Class Ventas_RepProductosServiciosDetalle
SBInexistentes.AppendFormat("Tipo {0}, Folio {1} - {2}<br />", Drow("TipoDocumento").ToString, SerieFolio, Archivo)
End If
End If
Else
HuboInexistentes = True
SBInexistentes.AppendFormat("Tipo {0}, Folio {1} - {2}<br />", Drow("TipoDocumento").ToString, SerieFolio, Archivo)
@@ -818,14 +805,11 @@ Partial Class Ventas_RepProductosServiciosDetalle
End If
Next
Catch ex As Exception
End Try
archiveZip.Dispose()
Response.Clear()
Response.ContentType = "application/zip"
Response.AddHeader("content-disposition", $"attachment; filename=facturas{Now.ToString("yyyyMMddhhmmss")}.zip")