diff --git a/App_Code/ClsCompras.vb b/App_Code/ClsCompras.vb index 85ebc6d5d..5750cf281 100644 --- a/App_Code/ClsCompras.vb +++ b/App_Code/ClsCompras.vb @@ -273,10 +273,12 @@ Public Class ClsCompras Public Function UpdateCompra(Descripcion As String, FolioSecundario As String, FechaVencimiento As Date, AplicaNotaCredito As Boolean, Observaciones As String, CveEstatusCompra As Integer, Descuento As Double, SubTotal As Double, IVA As Double, Total As Double, CveUsuario As Integer, CveCompra As Integer, Optional CveCajaChica As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveProveedorSucursal As Integer = -1, Optional PorcentajeIVA As Double = 0, Optional NumeroReembolso As String = "", Optional CveTipoCompra As Integer = -1, Optional NoDeducible As Boolean = False, - Optional CveFactura As Integer = -1, Optional CveContrato As Integer = -1) As Boolean + Optional CveFactura As Integer = -1, Optional CveContrato As Integer = -1, Optional CveRetIVAConcepto As Integer = -1, Optional CveRetISRConcepto As Integer = -1) As Boolean Dim Retorno As Boolean = False + + DataAdapter("PA_Comp_CompraUpdate") With SqlAdapter.SelectCommand.Parameters @@ -301,6 +303,9 @@ Public Class ClsCompras .Add("@NoDeducible", SqlDbType.Bit).Value = NoDeducible .Add("@CveFactura", SqlDbType.Int).Value = CveFactura .Add("@CveContrato", SqlDbType.Int).Value = CveContrato + + .Add("@CveRetIVAConcepto", SqlDbType.Int).Value = CveRetIVAConcepto + .Add("@CveRetISRConcepto", SqlDbType.Int).Value = CveRetISRConcepto End With Try @@ -3294,6 +3299,46 @@ Public Class ClsCompras Return Retorno End Function #End Region + + + + 'Public Function GetComprasPrepolizasRetIvaRetISRActualiza(CveCompra As Integer, CveRetIVAConcepto As Integer, CveRetISRConcepto As Integer) As Boolean + ' Dim Retorno As Boolean = False + ' DataAdapter("PA_Comp_ComprasPrepolizasRetIvaRetISRActualizaGet") + ' With SqlAdapter.SelectCommand.Parameters + ' .Add("@CveCompra", SqlDbType.Int).Value = CveCompra + ' .Add("@CveRetIVAConcepto", SqlDbType.Int).Value = CveRetIVAConcepto + ' .Add("@CveRetISRConcepto", SqlDbType.Int).Value = CveRetISRConcepto + ' End With + ' Try + ' SqlAdapter.Fill(Data) + ' Retorno = True + ' Catch ex As Exception + ' OnError("Ocurrió un error al Obtener los datos de retención de IVA y retención ISR.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + ' End Try + ' Return Retorno + 'End Function + + + Public Function UpdateComprasRetencionesUpdate(CveConceptoRetIVA As Integer, CveConceptoRetISR As Integer, CveCompra As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Comp_ComprasRetencionesUpdate") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveConceptoRetIVA", SqlDbType.Int).Value = CveConceptoRetIVA + .Add("@CveConceptoRetISR", SqlDbType.Int).Value = CveConceptoRetISR + .Add("@CveCompra", SqlDbType.Int).Value = CveCompra + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar el concepto de la prepoliza.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function + + + End Class diff --git a/App_Code/ClsContPAQi.vb b/App_Code/ClsContPAQi.vb index 146607353..f1be4bfd8 100644 --- a/App_Code/ClsContPAQi.vb +++ b/App_Code/ClsContPAQi.vb @@ -6644,6 +6644,7 @@ Public Class ClsContPAQi StrSQL.Append(" CodigoSup5 VARCHAR(100), Sup5 VARCHAR(200), CodigoSup6 VARCHAR(100), Sup6 VARCHAR(200),") StrSQL.Append(" CodigoSup7 VARCHAR(100), Sup7 VARCHAR(200), CodigoSup8 VARCHAR(100), Sup8 VARCHAR(100),") StrSQL.Append(" SaldoActual FLOAT);") + StrSQL.Append(" CREATE NONClUSTERED INDEX IDX ON #TEMP (ID); ") StrSQL.Append(" ") 'StrSQL.AppendLine(" -- RECOLECCION DE DATOS RECORRIENDO TODO EL ARBOL") StrSQL.Append(" WITH Rec(IdCtaSup, IdSubCtade, CtaSup, SubCtade, Level, Orden) AS ") @@ -6782,6 +6783,8 @@ Public Class ClsContPAQi SqlDataAdapter(StrSQL.ToString, CommandType.Text) + SqlAdapter.SelectCommand.CommandTimeout = 0 + With SqlAdapter.SelectCommand.Parameters .Add("@FechaI", SqlDbType.Date).Value = FechaI .Add("@FechaF", SqlDbType.Date).Value = FechaF diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index 7c08d813d..254a7c886 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -939,7 +939,7 @@ 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 = If(CveConceptoContable = 30, Importe, Math.Round(Importe, 2)) + .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("@TC", SqlDbType.Decimal).Value = TipoCambio diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index 8b89df8a6..8402fca44 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -399,7 +399,7 @@ Public Class ClsInventarios Return Retorno End Function - Public Function UpdateAlmacen(Almacen As String, CveTipoAlmacen As Integer, IdCtaContable As Integer, Modalidad As Integer, Estatus As Boolean, CveAlmacen As Integer, Inventariable As Byte, CveSubProyecto As Integer, Optional Orden As Integer = -1, Optional CveCuenta As Integer = -1, Optional CveUsuarioAutoriza As Integer = -1, Optional CveAlmacenVirtual As Integer = -1) As Boolean + Public Function UpdateAlmacen(Almacen As String, CveTipoAlmacen As Integer, IdCtaContable As Integer, Modalidad As Integer, Estatus As Boolean, CveAlmacen As Integer, Inventariable As Byte, CveSubProyecto As Integer, CveEmpresa As Integer, Optional Orden As Integer = -1, Optional CveCuenta As Integer = -1, Optional CveUsuarioAutoriza As Integer = -1, Optional CveAlmacenVirtual As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Inv_AlmacenesUpdate") @@ -413,6 +413,7 @@ Public Class ClsInventarios .Add("@Estatus", SqlDbType.Bit).Value = Estatus .Add("@Inventariable", SqlDbType.Bit).Value = Inventariable .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@Orden", SqlDbType.SmallInt).Value = Orden .Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta .Add("@CveUsuarioAutoriza", SqlDbType.Int).Value = CveUsuarioAutoriza diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb index 6eb54e465..b20d213f2 100644 --- a/App_Code/ClsNominas.vb +++ b/App_Code/ClsNominas.vb @@ -3139,7 +3139,7 @@ Public Class ClsNominas Return retorno End Function - Public Function PA_AGRO_Embarque_ManifiestoGet(cveSubproyecto As Int32, cveUsuario As Int32, cveEmpresa As Int32, cveEmbarqueManifiesto As Int32) As Boolean + Public Function EmbarqueManifiestoGet(cveSubproyecto As Int32, cveUsuario As Int32, cveEmpresa As Int32, cveEmbarqueManifiesto As Int32) As Boolean Dim retorno As Boolean = False DataAdapter("PA_AGRO_Embarque_ManifiestoGet", CommandType.StoredProcedure) addParameters("@CveSubproyecto", SqlDbType.Int, cveSubproyecto) @@ -3150,7 +3150,7 @@ Public Class ClsNominas Return retorno End Function - Public Function PA_Agro_Embarque_PalletGet(cvePallet As Int32, cveCultivo As Int32, cveCultivoVariedad As Int32, cveEnvase As Int32, cveEtiqueta As Int32, cveEtiquetasporTarima As Int32, cveFormatoImpresion As Int32, cveTamaño As Int32, cveTipoTarima As Int32, cveEmpresa As Int32, cveEmbarqueManifiesto As Int32, cveTemporada As Int32, Optional agrupado As Boolean = False) As Boolean + Public Function EmbarquePalletGet(cvePallet As Int32, cveCultivo As Int32, cveCultivoVariedad As Int32, cveEnvase As Int32, cveEtiqueta As Int32, cveEtiquetasporTarima As Int32, cveFormatoImpresion As Int32, cveTamaño As Int32, cveTipoTarima As Int32, cveEmpresa As Int32, cveEmbarqueManifiesto As Int32, cveTemporada As Int32, Optional agrupado As Boolean = False) As Boolean Dim retorno As Boolean = False DataAdapter("PA_Agro_Embarque_PalletGet", CommandType.StoredProcedure) addParameters("@CvePallet", SqlDbType.Int, cvePallet) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index ffa920110..8a0a66972 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -5999,7 +5999,7 @@ Public Class ClsPaginas Dim bdir As String = If(RutaReporte.Contains("Empresas"), ModExtensiones.DirectorioBaseEmpresas, AppDomain.CurrentDomain.BaseDirectory) 'TOMAR LA RUTA BASE PARA EL DIRECTORIO DE LA EMPRESA - If Not String.IsNullOrEmpty(RutaEmpresa) AndAlso Not RutaReporte.Contains("Grales") AndAlso Not RutaReporte.Contains("Contabilidad/Reportes/") AndAlso Not RutaReporte.Contains("AC/Reportes/") Then + If Not String.IsNullOrEmpty(RutaEmpresa) AndAlso Not RutaReporte.Contains("Grales") AndAlso Not RutaReporte.Contains("Contabilidad/Reportes/") AndAlso Not RutaReporte.Contains("Contabilidad2/Reportes/") AndAlso Not RutaReporte.Contains("AC/Reportes/") Then bdir = RutaEmpresa.Replace($"{CveEmpresa}/", "") End If @@ -6553,10 +6553,12 @@ Public Class ClsPaginas Else LogoRuta = String.Format("{0}Formatos\Logo.png", UsuarioActual.Empresa.Ruta) If File.Exists(LogoRuta) Then - LogoRuta = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + 'LogoRuta = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + LogoRuta = String.Format("{0}", LogoRuta) End If End If - LogoRuta = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + 'LogoRuta = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + LogoRuta = String.Format("{0}", LogoRuta) 'Si no tiene CBB, SE GENERA If Not ImagenCBB.Exists Then Dim CBB As New ClbNegBICFDv3_2.ClsNegCBBGenerar() @@ -7114,7 +7116,9 @@ Public Class ClsPaginas Else LogoRuta = String.Format("{0}Formatos\Logo.png", UsuarioActual.Empresa.Ruta) If File.Exists(LogoRuta) Then - LogoRuta = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + 'LogoRuta = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + LogoRuta = String.Format("{0}", LogoRuta) + End If End If @@ -8991,14 +8995,16 @@ Public Class ClsPaginas 'LOGO Dim LogoRuta As String = "" - LogoRuta = String.Format("{0}Logo.png", UsuarioActual.Empresa.Ruta) - If File.Exists(LogoRuta) Then + 'LogoRuta = String.Format("{0}Logo.png", UsuarioActual.Empresa.Ruta) - If File.Exists(LogoRuta) Then - LogoRuta = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) - End If - 'POR EMPRESA - params.Add(New ReportParameter("LogoPath", LogoRuta)) + Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) + + If Imagen.Exists Then + 'If File.Exists(LogoRuta) Then + ' LogoRuta = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + 'End If + ''POR EMPRESA + params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}")) Else params.Add(New ReportParameter("LogoPath", "")) End If diff --git a/App_Code/ClsValidaCFDi.vb b/App_Code/ClsValidaCFDi.vb index 66d701fa5..c236c5bbb 100644 --- a/App_Code/ClsValidaCFDi.vb +++ b/App_Code/ClsValidaCFDi.vb @@ -62,8 +62,8 @@ Public Class ClsValidaCFDi Public Function Verificar(FolioFiscal As String, RFCEmisor As String, RFCReceptor As String, Optional Importe As Decimal = 0.00) As Integer Me.LFolioFiscal = HttpUtility.UrlEncode(FolioFiscal) - Me.LRFCEmisor = HttpUtility.UrlEncode(RFCEmisor) - Me.LRFCReceptor = HttpUtility.UrlEncode(RFCReceptor) + Me.LRFCEmisor = RFCEmisor + Me.LRFCReceptor = RFCReceptor Me.LImporte = Importe VerificaCFDI() diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 781074ec6..219c9477a 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -759,7 +759,7 @@ Namespace Modelos If ObjContPaqTransac IsNot Nothing Then ObjContPaq = ObjContPaqTransac Else - If UsuarioActual.Empresa.UsaAC OrElse UsuarioActual.Empresa.Funcionalidad(200) = "1" Then + If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso (UsuarioActual.Empresa.UsaAC OrElse UsuarioActual.Empresa.Funcionalidad(200) = "1") Then ObjContPaq = New ClsContPAQi(UsuarioActual.Empresa) End If End If @@ -5170,7 +5170,7 @@ Namespace Modelos Dim ObjAcum As New ClsAcumuladores(ObjVentas.IniciaTransacSQL()) Dim ObjAC As ClsContPAQi = Nothing - If UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200) = "1" Then + If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso (UsuarioActual.Empresa.UsaAC OrElse UsuarioActual.Empresa.Funcionalidad(200) = "1") Then ObjAC = New ClsContPAQi(UsuarioActual.Empresa) : ObjAC.IniciaTransacSQL() End If diff --git a/Ashx/SIGWeb.ashx b/Ashx/SIGWeb.ashx index 6a595d10c..c5ba7c563 100644 --- a/Ashx/SIGWeb.ashx +++ b/Ashx/SIGWeb.ashx @@ -1527,8 +1527,9 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState Dim xmlarchivos As System.Xml.Linq.XDocument = New System.Xml.Linq.XDocument() Dim xfolder As XElement = New XElement("folder") For Each urfile In System.IO.Directory.GetFiles(directorio) - Dim xfile As New XElement("archivo", urfile) + Dim xfile As New XElement("archivo", "") xfile.SetAttributeValue("EXT", Path.GetExtension(urfile)) + xfile.SetAttributeValue("urlfile", urfile) xfolder.Add(xfile) Next diff --git a/Bancos/DepositosCaja.aspx b/Bancos/DepositosCaja.aspx index 028df676e..5fa4f467c 100644 --- a/Bancos/DepositosCaja.aspx +++ b/Bancos/DepositosCaja.aspx @@ -142,36 +142,49 @@
-
- - + +
+ +
+
+
-
-
+ +
-
-
-
+
+
+ +
- - + + -
+
+
+ +
+
+ + + + + +
-
+
Seleccionado: $ 0.00 -
@@ -282,10 +295,10 @@ - + - + @@ -335,7 +348,7 @@

- +
diff --git a/Bancos/DepositosCaja.aspx.vb b/Bancos/DepositosCaja.aspx.vb index dc9c99b5c..bad49980c 100644 --- a/Bancos/DepositosCaja.aspx.vb +++ b/Bancos/DepositosCaja.aspx.vb @@ -97,6 +97,8 @@ Partial Class Bancos_DepositosCaja ObjBancos.GetPagosCajaChica(FechaI, FechaF, UsuarioActual.CveEmpresa, DdlCajaChica.SelectedValue.ToEntero, DdlTipoPago.SelectedValue.ToEntero, CveSubProyecto:=DdlSubProyectos.SelectedValue.ToEntero, MSI:=MSI) GvFacturas.DataSource = ObjBancos.DtResultados + lblValorTotal.Text = ObjBancos.DtResultados.SUM("Importe").ToString("###,###,###.00") + ObjBancos.Dispose() @@ -108,7 +110,7 @@ Partial Class Bancos_DepositosCaja TxtDescuento.Text = "" TxtIVA.Text = "" TxtComisionIntermediario.Text = "" - lblValorTotal.Text = "0.0" + 'lblValorTotal.Text = "0.0" lblValorTotalSeleccionado.Text = "0.0" divLabelTotal.Visible = True DdlSubProyectoDeposito.SelectedValueExist(DdlSubProyectos.SelectedValue.ToEntero) @@ -116,7 +118,11 @@ Partial Class Bancos_DepositosCaja DdlSubProyectoIntermediario.SelectedValueExist(DdlSubProyectos.SelectedValue.ToEntero) UpGvFacturas.Update() UpParametros.Update() - UpComisiones.Update() + UpComisiones.Update() + + + + End Sub Private Sub BtnDepositar_Click(sender As Object, e As EventArgs) Handles BtnDepositar.Click @@ -247,7 +253,7 @@ Partial Class Bancos_DepositosCaja If Not FolioIE > 0 Then OcurrioError = True End If - CveIEOrigen = ObjBancos.AddBancos_IE(DdlCuentaDeposito.SelectedValue.ToEntero, CveTransaccionBanco, Fecha, FolioIE.ToString, "Depósito Bancario", TotalImporte, CveMoneda, 1, "Depósito Bancario", "", False, False, -1, NuevaCvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveProveedorIntermediario:=CveProveedorIntermediario) + CveIEOrigen = ObjBancos.AddBancos_IE(DdlCuentaDeposito.SelectedValue.ToEntero, CveTransaccionBanco, Fecha, FolioIE.ToString, "Depósito Bancario", TotalImporte, CveMoneda, 1, TxtObservaciones.Text, "", False, False, -1, NuevaCvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveProveedorIntermediario:=CveProveedorIntermediario) documentos += String.Format("Depósito: {1}    
", CveIEOrigen, FolioIE) @@ -295,7 +301,7 @@ Partial Class Bancos_DepositosCaja OcurrioError = True Exit For End If - CveIEDestino = ObjBancos.AddBancos_IE(DdlCajaChica.SelectedValue.ToEntero, 2, Fecha, FolioIE.ToString, String.Format("Depósito Bancario: {0}", SerieFolio), Importe, CveMoneda, 1, "Depósito Bancario", "", False, False, -1, NuevaCvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + CveIEDestino = ObjBancos.AddBancos_IE(DdlCajaChica.SelectedValue.ToEntero, 2, Fecha, FolioIE.ToString, String.Format("Depósito Bancario: {0}", SerieFolio), Importe, CveMoneda, 1, TxtObservaciones.Text, "", False, False, -1, NuevaCvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, True, Importe, SerieFolio, 30, String.Format("Depósito Bancario: {0}", SerieFolio), Fecha, IdCuentaBancariaDestino, -1, CveClasificacion:=CveClasificacion, CveSubProyecto:=CveSubProyecto, CveVenta:=CveVenta, CveIE:=CveIEDestino, ImporteMX:=Importe * TipoCambio, CveCuenta:=CveCuentaBancariaDestino) Then diff --git a/Bancos/Devoluciones.aspx b/Bancos/Devoluciones.aspx index 26ab60086..eaa04eda3 100644 --- a/Bancos/Devoluciones.aspx +++ b/Bancos/Devoluciones.aspx @@ -247,6 +247,23 @@
+ + + + + + +
+ +
+
+
+ + + + + +
diff --git a/Bancos/Devoluciones.aspx.cs b/Bancos/Devoluciones.aspx.cs index ad11e336e..cfe9b6d4a 100644 --- a/Bancos/Devoluciones.aspx.cs +++ b/Bancos/Devoluciones.aspx.cs @@ -108,7 +108,10 @@ public partial class Bancos_Devoluciones : ClsPaginas divTipoDevolucion.Visible = false; break; } + + ComprobanteMuestraOculta(); CargaTipoTransaccion(tipo); + } protected void TipoDevolucion_SelectedIndexChanged(object sender, EventArgs e) @@ -125,6 +128,23 @@ public partial class Bancos_Devoluciones : ClsPaginas break; } + + ComprobanteMuestraOculta(); + + } + + + private void ComprobanteMuestraOculta() + { + if (OpcionDevolucion.SelectedValue.ToEntero() == 3 && TipoDevolucion.SelectedValue.ToString().ToEntero() == 2) + { + Anexo.Text = ""; + DvComprobante.Visible = false; + } + else + { + DvComprobante.Visible = true; + } } protected void CargaTipoTransaccion(string tipo) @@ -374,6 +394,19 @@ public partial class Bancos_Devoluciones : ClsPaginas } //terminan validaciones + + + + List filesgral = Anexo.getfiles().Archivos; + string filemove = ""; + string Comprobante = ""; + foreach(Archivo fileItem in filesgral){ + Comprobante = System.IO.Path.GetExtension(String.Format("{0}Temp\\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", ""); + filemove = fileItem.filename; + } + + + ClsBancos ObjIE = new ClsBancos(); ClsContabilidad ObjMov = new ClsContabilidad(ObjIE.IniciaTransacSQL()); ClsCompras ObjComp = new ClsCompras(ObjIE.IniciaTransacSQL()); @@ -385,6 +418,7 @@ public partial class Bancos_Devoluciones : ClsPaginas int CveConceptoContableBanco = 30; int CveConceptoContableDevolucion = 0; int CvePlantillaPoliza = 0; + int CveTipoPoliza = 1;// tipo ingreso int CvePrePoliza = 0; int CveMoneda = get_GlobalDTBancosCuentas(-1, CveEmpresa: UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero()}").ToEntero(); int FolioFijo = 0; @@ -403,6 +437,7 @@ public partial class Bancos_Devoluciones : ClsPaginas CveConceptoContableDevolucion = 92; CvePlantillaPoliza = 7; TipoMovtoDevolucion = false; + CveTipoPoliza = 2; //tipo egreso break; case "2": PagueseA = DdlProveedores.SelectedText.ToString(); @@ -431,7 +466,7 @@ public partial class Bancos_Devoluciones : ClsPaginas // DATOS PREPOLIZA if ( DdlTipoTransanccion.SelectedValue == "1" && UsuarioActual.CveEmpresa != 119) FolioFijo = TxtFolio.Text.ToEntero(); - CvePrePoliza = ObjMov.AddPrePolizas("Bancos/IE Devoluciones", CvePlantillaPoliza, TxtImporte.Text.Trim().ToDouble(), TxtImporte.Text.Trim().ToDouble(), 1, TxtFechaDocumento.Text.ToDate(), TxtObservaciones.Text.Trim(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo: FolioFijo, ReglaFolioPoliza: ObjComp.ObtenerReglaFolio(DdlTipoTransanccion.SelectedValue, null, UsuarioActual.CveEmpresa), CveTipoPoliza: ObjMov.ObtenerTipoPoliza(DdlTipoTransanccion.SelectedValue, "-1", UsuarioActual.CveEmpresa)); + CvePrePoliza = ObjMov.AddPrePolizas("Bancos/IE Devoluciones", CvePlantillaPoliza, TxtImporte.Text.Trim().ToDouble(), TxtImporte.Text.Trim().ToDouble(), 1, TxtFechaDocumento.Text.ToDate(), TxtObservaciones.Text.Trim(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo: FolioFijo, ReglaFolioPoliza: ObjComp.ObtenerReglaFolio(DdlTipoTransanccion.SelectedValue, null, UsuarioActual.CveEmpresa), CveTipoPoliza: CveTipoPoliza); if (CvePrePoliza > 0) { @@ -487,7 +522,7 @@ public partial class Bancos_Devoluciones : ClsPaginas { CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero(), DdlTipoTransanccion.SelectedValue.ToEntero(), TxtFechaDocumento.Text.Trim().ToDate(), TxtFolio.Text.Trim(), PagueseA, TxtImporte.Text.Trim().ToDouble(), CveMoneda, - TC, TxtObservaciones.Text.Trim(), "", false, false, -1, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa); + TC, TxtObservaciones.Text.Trim(), "", false, false, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa); if (CveIE > 0) { //GUARDA PREPOLIZAS DETALLE DEVOLUCION @@ -646,6 +681,12 @@ public partial class Bancos_Devoluciones : ClsPaginas } ObjIE.Commit(); + if (filemove != "") + { + 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); diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index 1c2ca9a0c..e845a08e3 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -700,6 +700,13 @@ Partial Class Bancos_IE TxtImporte.Attributes.Add("onkeypress", "javascript: return false;") End If + If Request("Opcion") IsNot Nothing AndAlso Request("Opcion") = "INGPC" Then + If UsuarioActual.Empresa.Funcionalidad(590) = "1" Then + DivOtrosIngresosEgresos.Visible = True + End If + + End If + If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString.Contiene("EGSCREDITO") Then LblPagueseA.Text = "" @@ -1844,18 +1851,18 @@ Partial Class Bancos_IE Private Sub CargaTipoTransaccion(Optional Tipo As String = "") Dim dt As DataTable If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString.Contiene("EGSSINFACT", "EGSCREDITO") Then - dt = GlobalDTTipoTransacciones.FiltraParametros("Tipo='Egs'") + dt = GlobalDTTipoTransacciones.FiltraParametros("Tipo='Egs' AND Estatus = 1") LtlTitulo.Text = "Egreso Por Comprobar" RBL.Items.Remove(RBL.Items.FindByValue("C")) ElseIf Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString = "DEV" Then - dt = GlobalDTTipoTransacciones.FiltraParametros("Tipo='Ing'") + dt = GlobalDTTipoTransacciones.FiltraParametros("Tipo='Ing' AND Estatus = 1 ") LtlTitulo.Text = If(Request("Opcion").ToString = "INGPC", "Ingreso por comprobar", "Devolución") LblPagueseA.Text = "Recibido de:" RBL.SelectedValue = "C" Anexo.Visible = True ElseIf Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString = "INGPC" Then - dt = GlobalDTTipoTransacciones.FiltraParametros("Tipo='Ing'") + dt = GlobalDTTipoTransacciones.FiltraParametros("Tipo='Ing' AND Estatus = 1") LtlTitulo.Text = If(Request("Opcion").ToString = "INGPC", "Ingreso por comprobar", "Devolución") LblPagueseA.Text = "Recibido de:" RBL.SelectedValue = "C" @@ -1865,13 +1872,13 @@ Partial Class Bancos_IE RBL.Items.Remove(RBL.Items.FindByValue("FE")) ElseIf Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString = "ANTC" Then - dt = GlobalDTTipoTransacciones.FiltraParametros("Tipo='Ing'") + dt = GlobalDTTipoTransacciones.FiltraParametros("Tipo='Ing' AND Estatus = 1 ") LtlTitulo.Text = "Anticipo de Cliente" LblPagueseA.Text = "Recibido de:" Anexo.Visible = True RBL.Items.Remove(RBL.Items.FindByValue("P")) : RBL.Items.Remove(RBL.Items.FindByValue("FE")) : RBL.Items.Remove(RBL.Items.FindByValue("DD")) : RBL.Items.Remove(RBL.Items.FindByValue("AC")) : RBL.Items.Remove(RBL.Items.FindByValue("DP")) ElseIf Opcion = "DevDinV" Then ' DEVOLUCION DINERO NC-VENTAS - dt = GlobalDTTipoTransacciones.FiltraParametros("Tipo='Egs'") + dt = GlobalDTTipoTransacciones.FiltraParametros("Tipo='Egs' AND Estatus = 1 ") LtlTitulo.Text = "Devolución dinero" RBL.SelectedValue = "C" RBL.Enabled = False @@ -1879,20 +1886,17 @@ Partial Class Bancos_IE dt = GlobalDTTipoTransacciones End If - - If Opcion = "DevDinC" AndAlso Request("P") IsNot Nothing AndAlso Request("P").Length > 0 Or Opcion = "DevDinC" AndAlso Masivonotas Then - DdlTipoTransaccion.DataSource = dt.FiltraParametros("Tipo = 'Ing' ") + DdlTipoTransaccion.DataSource = dt.FiltraParametros("Tipo = 'Ing' AND Estatus = 1 ") Else DdlTipoTransaccion.DataSource = dt End If If Tipo.Length > 0 Then DdlTipoTransaccion.Items.Clear() - DdlTipoTransaccion.DataSource = GlobalDTTipoTransacciones.FiltraParametros($"Tipo = '{Tipo}' AND EstatusTexto = 'Activo' ") + DdlTipoTransaccion.DataSource = GlobalDTTipoTransacciones.FiltraParametros($"Tipo = '{Tipo}' AND Estatus = 1 ") End If - DdlTipoTransaccion.DataBind() DdlTipoTransaccion.Items.Insert(0, New ListItem("Seleccione Tipo Movimiento", "-1")) RBL_SelectedIndexChanged(RBL, Nothing) @@ -2584,6 +2588,7 @@ Partial Class Bancos_IE Dim CveConceptoContable As Integer = 30 Dim CveConceptoCompra As Integer = 10 Dim CveCreditoDetalle As Integer = -1 + Dim tCveTipoPoliza As Integer = 2 Dim CIF As Decimal = 0 Dim CvePlantillaPoliza As Integer = 3 Dim CvePrePoliza As Integer = 0 @@ -2667,9 +2672,11 @@ Partial Class Bancos_IE CvePlantillaPoliza = 92 End If + Dim AgregaPolizaSaldoInicial As Boolean = False 'Cuando es Egreso sin factura, se registra una compra tipo anticipo If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString = "EGSSINFACT" Then + tCveTipoPoliza = 2 Select Case RBL.SelectedValue Case "P" 'Proveedores If CveProveedor > 0 Then @@ -2710,6 +2717,7 @@ Partial Class Bancos_IE If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString = "INGPC" Then HdnProvPorIVA.Value = "0" CvePlantillaPoliza = 6 + tCveTipoPoliza = 1 Select Case RBL.SelectedValue Case "DD" ' Deudores Diversos If CveProveedor > 0 Then @@ -2792,7 +2800,7 @@ Partial Class Bancos_IE End If If DdlTipoTransaccion.SelectedValue = "1" AndAlso UsuarioActual.CveEmpresa <> 119 Then FolioFijo = ObjIE.Folio.ToEntero 'cheque - CvePrePoliza = ObjMov.AddPrePolizas("Bancos/IE " + If(Request("Opcion") IsNot Nothing, Request("Opcion").ToString, "") + " " + RBL.SelectedValue, CvePlantillaPoliza, TxtImporte.Text.Trim.ToDouble, TxtImporte.Text.Trim.ToDouble, tCveMoneda, TxtFechaDocumento.Text.ToDate, PagueseA, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo:=FolioFijo, ReglaFolioPoliza:=ObjComp.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, Nothing, UsuarioActual.CveEmpresa), CveTipoPoliza:=ObjMov.ObtenerTipoPoliza(DdlTipoTransaccion.SelectedValue, "-1", UsuarioActual.CveEmpresa)) + CvePrePoliza = ObjMov.AddPrePolizas("Bancos/IE " + If(Request("Opcion") IsNot Nothing, Request("Opcion").ToString, "") + " " + RBL.SelectedValue, CvePlantillaPoliza, TxtImporte.Text.Trim.ToDouble, TxtImporte.Text.Trim.ToDouble, tCveMoneda, TxtFechaDocumento.Text.ToDate, PagueseA, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo:=FolioFijo, ReglaFolioPoliza:=ObjComp.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, Nothing, UsuarioActual.CveEmpresa), CveTipoPoliza:=tCveTipoPoliza) 'valida prepoliza If CvePrePoliza > 0 Then @@ -2873,6 +2881,30 @@ Partial Class Bancos_IE Dim importeMX As Decimal Dim Multiplicador As Integer + Dim tCveSubProyecto As Integer = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveSubProyecto).FiltroPrimeroValor("CveSubProyecto").ToEntero + + 'OTROS INGRESOS/EGRESOS + Dim TCC As Decimal = 1 + If TxtTipoCambio.Text.Trim.ToDecimal > 0 Then TCC = TxtTipoCambio.Text.Trim.ToDecimal + + Dim ImporteOtros As Decimal = TxtOtrosIngresosEgresos.Text.ToDecimal * TCC + If ImporteOtros <> 0 Then + Dim TipoMovtoIE As Boolean = False + Dim CveConcIE As Integer = 78 + If ImporteOtros > 0 Then + TipoMovtoIE = True : ImporteOtros = Math.Abs(ImporteOtros) + CveConcIE = 78 + Else + TipoMovtoIE = False : ImporteOtros = Math.Abs(ImporteOtros) + CveConcIE = 211 + End If + + Dim OtConcepto As String = PagueseA & " $" & TxtOtrosIngresosEgresos.Text.ToDecimal.FormatoNumero + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoIE, ImporteOtros, PagueseA, CveConcIE, OtConcepto, Now, -1, -1, CveIE, CveCliente:=CveCliente, ImporteMX:=ImporteOtros, CveSubProyecto:=tCveSubProyecto, ImporteME:=0) Then + MsgError = "Ocurrió un error al registrar el asiento de pago de devolución" + Exit Select + End If + End If If ObjMov.GetPlantillaConceptos(UsuarioActual.CveEmpresa, CvePlantillaPoliza) Then @@ -2929,7 +2961,7 @@ Partial Class Bancos_IE Case 66 If RBL.SelectedValue = "C" AndAlso CveCliente > 0 Then - importeMovimiento = TxtImporte.Text.ToDecimal - TxtIvaIxC.Text.ToDecimal + importeMovimiento = TxtImporte.Text.ToDecimal - TxtIvaIxC.Text.ToDecimal - TxtOtrosIngresosEgresos.Text.ToDecimal importeMX = importeMovimiento 'Agregamos el IVA @@ -3733,7 +3765,7 @@ Partial Class Bancos_IE End Select - If UsuarioActual.Empresa.UsaAC Then + If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaAC Then Dim ConceptoRenglon, Referencia As String Dim FolioPoliza As Integer Dim Fecha As Date = TxtFechaDocumento.Text.ToDate @@ -4452,7 +4484,7 @@ Partial Class Bancos_IE Dim ObjConta As New ClsContabilidad(Banc.IniciaTransacSQL()) Dim ObjAC As ClsContPAQi = Nothing - If UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200).ToString = "1" Then + If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso (UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200).ToString = "1") Then Try ObjAC = New ClsContPAQi(UsuarioActual.Empresa) ObjAC.IniciaTransacSQL() @@ -4747,7 +4779,7 @@ Partial Class Bancos_IE Dim ObjConta As New ClsContabilidad(Banc.IniciaTransacSQL) Dim ObjAC As ClsContPAQi = Nothing - If UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200).ToString = "1" Then + If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso (UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200).ToString = "1") Then ObjAC = New ClsContPAQi(UsuarioActual.Empresa) ObjAC.IniciaTransacSQL() End If @@ -5075,49 +5107,53 @@ Partial Class Bancos_IE EliminaPoliza() End Sub Private Sub EliminaPoliza() - Dim ObjAC As New ClsContPAQi(UsuarioActual.Empresa) - ObjAC.IniciaTransacSQL() - Dim ObjConta As New ClsContabilidad - ObjConta.IniciaTransacSQL() - Dim ErrorCompra = False + If UsuarioActual.Empresa.TipoContabilidad = 2 Then + Dim ObjAC As New ClsContPAQi(UsuarioActual.Empresa) + ObjAC.IniciaTransacSQL() + Dim ObjConta As New ClsContabilidad + ObjConta.IniciaTransacSQL() - 'Elimina la poliza - If (UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200).ToString = "1") AndAlso IDPoliza > 0 Then - If Not ObjAC.RemovePoliza(IDPoliza) Then - ErrorCompra = True + Dim ErrorCompra = False + + 'Elimina la poliza + If (UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200).ToString = "1") AndAlso IDPoliza > 0 Then + If Not ObjAC.RemovePoliza(IDPoliza) Then + ErrorCompra = True + End If + End If + + 'Desasocia la poliza + If Not ErrorCompra Then + If Not ObjConta.DesasociarPoliza(IDPoliza, UsuarioActual.CveEmpresa) Then + ErrorCompra = True + End If + End If + + If Not ErrorCompra Then + If Not ObjConta.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False) Then + ErrorCompra = True + End If + End If + + If Not ErrorCompra Then + Alert("La poliza ha sido desvinculada y eliminada con exito.", TipoMensaje.MsgInformacion) + ObjAC.Commit() + ObjConta.Commit() + Else + Alert("Ocurrió un error al desvincular y/o eliminar la poliza. Por favor intente de nuevo ", TipoMensaje.MsgError) + ObjAC.RollBack() + ObjConta.RollBack() + End If + + ObjAC.Dispose() + ObjConta.Dispose() + + If Not ErrorCompra Then + CargaDatos() End If End If - 'Desasocia la poliza - If Not ErrorCompra Then - If Not ObjConta.DesasociarPoliza(IDPoliza, UsuarioActual.CveEmpresa) Then - ErrorCompra = True - End If - End If - - If Not ErrorCompra Then - If Not ObjConta.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False) Then - ErrorCompra = True - End If - End If - - If Not ErrorCompra Then - Alert("La poliza ha sido desvinculada y eliminada con exito.", TipoMensaje.MsgInformacion) - ObjAC.Commit() - ObjConta.Commit() - Else - Alert("Ocurrió un error al desvincular y/o eliminar la poliza. Por favor intente de nuevo ", TipoMensaje.MsgError) - ObjAC.RollBack() - ObjConta.RollBack() - End If - - ObjAC.Dispose() - ObjConta.Dispose() - - If Not ErrorCompra Then - CargaDatos() - End If End Sub #End Region @@ -5561,7 +5597,7 @@ Partial Class Bancos_IE End If End If - If (UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200).ToString = "1") AndAlso IDPoliza > 0 Then + If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso ((UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200).ToString = "1") AndAlso IDPoliza > 0) Then ObjAC = New ClsContPAQi(UsuarioActual.Empresa) ObjAC.IniciaTransacSQL() If Not ObjAC.RemovePoliza(IDPoliza) Then diff --git a/Bancos/ProveedoresAbonar.aspx b/Bancos/ProveedoresAbonar.aspx index 48f92f474..9d5d23cab 100644 --- a/Bancos/ProveedoresAbonar.aspx +++ b/Bancos/ProveedoresAbonar.aspx @@ -369,7 +369,7 @@ diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb index 387ed4951..9c6fc4e0e 100644 --- a/Bancos/ProveedoresAbonar.aspx.vb +++ b/Bancos/ProveedoresAbonar.aspx.vb @@ -333,7 +333,7 @@ Partial Class Bancos_ProveedoresAbonar If UsuarioActual.TienePermisoProceso(98) Then PermiteModificarImporte = False End If - Calendario.StartDate = Now.AddMonths(-4) + Calendario.StartDate = Now.AddMonths(-8) 'proceso que restringue solo el pago de apartir del dia de hoy y como limite fin de mes If UsuarioActual.TienePermisoProceso(105) Then Calendario.StartDate = Now @@ -574,7 +574,6 @@ Partial Class Bancos_ProveedoresAbonar FiltroInv = "" 'queno considera lo proporcional End If - If PorcentajeAlmacen = 0 Then ' sin recibir e.Row.FCLabel("LbEstatusInv").Text = "" e.Row.FCLabel("LbEstatusInv").ForeColor = Drawing.Color.Red @@ -732,11 +731,6 @@ Partial Class Bancos_ProveedoresAbonar ImporteSeleccionado += gvr.FCTextBox("TxtAbonar").Text.ToDecimal If gvr.DataKey("UUID") <> "" Then - '529 - - - - Valida.Verificar(gvr.DataKey("UUID"), gvr.DataKey("RFC"), UsuarioActual.Empresa.RFC, gvr.DataKey("TotalOriginal").ToDecimal) If Not UsuarioActual.Empresa.FacturaProduccion OrElse UsuarioActual.CveEmpresa < 2 Then @@ -770,7 +764,6 @@ Partial Class Bancos_ProveedoresAbonar ObjCompra.Dispose() Else MsgValidadas.AppendFormat("Factura Cancelada: {0} - {1} con movimientos de almacen, relacione su factura nueva para descontar saldo
", gvr.DataKey("SerieFolio"), gvr.DataKey("Descripcion")) - End If Else @@ -807,7 +800,7 @@ Partial Class Bancos_ProveedoresAbonar Dim ObjMov As New ClsContabilidad(ObjIE.IniciaTransacSQL) Dim ObjComp As New ClsCompras(ObjIE.IniciaTransacSQL) Dim ObjConta As ClsContPAQi = Nothing - If UsuarioActual.Empresa.UsaContabilidad Then + If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaContabilidad Then ObjConta = New ClsContPAQi(UsuarioActual.Empresa) ObjConta.IniciaTransacSQL() End If @@ -892,7 +885,6 @@ Partial Class Bancos_ProveedoresAbonar End If Anexo.Text = "" - 'inserto los movimientos de la conta para abonar al saldo If CvePrePoliza > 0 Then @@ -935,21 +927,6 @@ Partial Class Bancos_ProveedoresAbonar End If End If - 'If ObjIE.GetFluctuacionesBitacora(UsuarioActual.CveEmpresa) Then - ' If ObjIE.DtResultados.Rows.Count > 0 Then - ' Dim tFecha As Date = TxtFechaDocumento.Text.ToDate - ' Dim FechaC As String = String.Format("{0}/{1}/{2}", tFecha.Year, tFecha.Month, tFecha.Day) - ' Dim drr As DataRow = ObjIE.DtResultados.FiltroPrimero("Fecha < #" & FechaC & "#", "Fecha DESC") - - ' If drr IsNot Nothing Then - ' FechaUltimaFluctuacion = drr("Fecha").ToString.ToDate - ' TipoCambioFluctuacion = drr("TipoCambio").ToString.ToDecimal - ' End If - - ' End If - 'End If - - Dim DttPlantilla As DataTable = Nothing If ObjMov.GetPlantillaConceptos(UsuarioActual.CveEmpresa, CvePlantillaPoliza) Then DttPlantilla = ObjMov.DtResultados @@ -961,31 +938,24 @@ Partial Class Bancos_ProveedoresAbonar For Each gvr As GridViewRow In GvCxP.Rows If gvr.FCCheckBox("Chk").Checked Then Dim EsImportacion As Boolean = False - + tipoCambioCompra = gvr.DataKey("TipoCambioOriginal").ToDecimal + PorcentajePago = (gvr.FCTextBox("TxtAbonar").Text.ToDecimal) / gvr.DataKey("Original").ToDecimal + tipoCambioCompraValuacion = 1 'Tipos de cambio If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then 'Si la venta viene en Pesos y se va a pagar en Pesos TipoCambioPago = 1 - tipoCambioCompra = 1 - PorcentajePago = gvr.FCTextBox("TxtAbonar").Text.ToDecimal / gvr.DataKey("Original").ToDecimal ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then 'Si la venta viene en Dolares y se va a pagar en Pesos TipoCambioPago = TxtTC.Text.ToDecimal - tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal - tipoCambioCompraValuacion = If(gvr.DataKey("Fecha").ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, gvr.DataKey("TipoCambio").ToDecimal) - PorcentajePago = ((gvr.FCTextBox("TxtAbonar").Text.ToDecimal) / gvr.DataKey("Original").ToDecimal).RoundSQL + tipoCambioCompraValuacion = If(gvr.DataKey("Fecha").ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, tipoCambioCompra) ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then 'Si la venta viene en Dolares y se va a pagar en DOLARES 'TipoCambioPago = 'GlobalTipoCambio(TxtFechaDocumento.Text.ToDate).ToString.ToDecimal TipoCambioPago = TxtTCDolaresDolares.Text.ToDecimal - tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal - tipoCambioCompraValuacion = If(gvr.DataKey("Fecha").ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, gvr.DataKey("TipoCambio").ToDecimal) - PorcentajePago = gvr.FCTextBox("TxtAbonar").Text.ToDecimal / gvr.DataKey("Original").ToDecimal + tipoCambioCompraValuacion = If(gvr.DataKey("Fecha").ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, tipoCambioCompra) ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES TipoCambioPago = TxtTCDolares.Text.ToDecimal - tipoCambioCompra = 1 - PorcentajePago = (gvr.FCTextBox("TxtAbonar").Text.ToDecimal) / gvr.DataKey("Original").ToDecimal End If CveSubProyecto = gvr.DataKey("CveSubProyecto").ToEntero - 'If ObjMov.GetPlantillaConceptos(UsuarioActual.CveEmpresa, CvePlantillaPoliza) Then If DttPlantilla IsNot Nothing AndAlso DttPlantilla.Rows.Count > 0 Then For Each Row As DataRow In DttPlantilla.Rows ConceptoContable = Row("CveConcepto").ToString.ToEntero @@ -996,7 +966,6 @@ Partial Class Bancos_ProveedoresAbonar Referencia = gvr.DataKey("SerieFolio").ToString Dim PorcentajeImpuesto As Decimal = 0 - Select Case ConceptoContable Case 17 'Pago Proveedores @@ -1011,21 +980,8 @@ Partial Class Bancos_ProveedoresAbonar End Select End If - If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then - ImporteMovimiento = gvr.FCTextBox("TxtAbonar").Text.ToDecimal - importeMX = ImporteMovimiento - ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then - ImporteMovimiento = gvr.FCTextBox("TxtAbonar").Text.ToDecimal - importeMX = gvr.FCTextBox("TxtAbonar").Text.ToDecimal * tipoCambioCompraValuacion - ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then - ImporteMovimiento = gvr.FCTextBox("TxtAbonar").Text.ToDecimal - importeMX = gvr.FCTextBox("TxtAbonar").Text.ToDecimal * tipoCambioCompraValuacion - ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then - ImporteMovimiento = gvr.FCTextBox("TxtAbonar").Text.ToDecimal - importeMX = ImporteMovimiento * tipoCambioCompraValuacion - End If - ImporteMovimiento = ImporteMovimiento.RoundSQL - importeMX = importeMX.RoundSQL + ImporteMovimiento = gvr.FCTextBox("TxtAbonar").Text.ToDecimal.RoundSQL + importeMX = (gvr.FCTextBox("TxtAbonar").Text.ToDecimal * tipoCambioCompraValuacion).RoundSQL TipoCambioGeneral = tipoCambioCompraValuacion ConceptoMovimiento = $"{HplProveedor.Text} F:{gvr.DataKey("SerieFolio")}" 'cuando son dolares, y tienen complementaria, se hace el registro @@ -1070,26 +1026,10 @@ Partial Class Bancos_ProveedoresAbonar ConceptoContable = 285 End If - If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then - ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago - importeMX = ImporteMovimiento - ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then - tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal - ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago - importeMX = ImporteMovimiento * tipoCambioCompra - ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then - ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago - importeMX = ImporteMovimiento * tipoCambioCompra - ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then - tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal - ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago - importeMX = ImporteMovimiento * tipoCambioCompra - End If - ImporteMovimiento = ImporteMovimiento.RoundSQL - importeMX = importeMX.RoundSQL + ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago).RoundSQL + importeMX = (ImporteMovimiento * tipoCambioCompra).RoundSQL + TipoCambioGeneral = tipoCambioCompra - - If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}" 'Conta ContPAQ @@ -1127,23 +1067,10 @@ Partial Class Bancos_ProveedoresAbonar Funcionalidad = 578 ConceptoContable = 286 End If - If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then - ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago - importeMX = ImporteMovimiento - ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then - tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal - ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) - importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) - ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then - ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) - importeMX = ImporteMovimiento * tipoCambioCompra - ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then - tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal - ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) - importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) - End If - ImporteMovimiento = ImporteMovimiento.RoundSQL - importeMX = importeMX.RoundSQL + + ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago).RoundSQL + importeMX = (ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)).RoundSQL + TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}" @@ -1177,21 +1104,9 @@ Partial Class Bancos_ProveedoresAbonar ConceptoContable = 328 End If - If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then - ImporteMovimiento = gvr.DataKey("RetISR").ToDecimal * PorcentajePago - importeMX = ImporteMovimiento - ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then - ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago) - importeMX = ImporteMovimiento * tipoCambioCompra - ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then - ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago) - importeMX = ImporteMovimiento * tipoCambioCompra - ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then - ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago) - importeMX = ImporteMovimiento * tipoCambioCompra - End If - ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero) - importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero) + ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago).RoundSQL + importeMX = (ImporteMovimiento * tipoCambioCompra).RoundSQL + TipoCambioGeneral = tipoCambioCompra If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}" @@ -1221,22 +1136,8 @@ Partial Class Bancos_ProveedoresAbonar funcionalidad = 348 ConceptoContable = 328 End If - - If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then - ImporteMovimiento = gvr.DataKey("RetISR").ToDecimal * PorcentajePago - importeMX = ImporteMovimiento - ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then - ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago) - importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) - ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then - ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago) - importeMX = ImporteMovimiento * tipoCambioCompra - ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then - ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago) - importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) - End If - ImporteMovimiento = ImporteMovimiento.RoundSQL - importeMX = importeMX.RoundSQL + ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago).RoundSQL + importeMX = (ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)).RoundSQL TipoCambioGeneral = TipoCambioPago If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}" @@ -1254,7 +1155,6 @@ Partial Class Bancos_ProveedoresAbonar End If End If - End If Case 14 'Iva X Acreditar @@ -1263,23 +1163,8 @@ Partial Class Bancos_ProveedoresAbonar 'funcionalidad que toma el 100% del pago para acreditamiento de iva If TotalImporte = gvr.DataKey("Saldo").ToDecimal Then - If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then - ImporteMovimiento = gvr.DataKey("IVA").ToDecimal - importeMX = ImporteMovimiento - ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then - tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal - ImporteMovimiento = gvr.DataKey("IVA").ToDecimal - importeMX = ImporteMovimiento * tipoCambioCompra - ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then - ImporteMovimiento = gvr.DataKey("IVA").ToDecimal - importeMX = ImporteMovimiento * tipoCambioCompra - ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then - tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal - ImporteMovimiento = gvr.DataKey("IVA").ToDecimal - importeMX = ImporteMovimiento * tipoCambioCompra - End If - ImporteMovimiento = ImporteMovimiento.RoundSQL - importeMX = importeMX.RoundSQL + ImporteMovimiento = (gvr.DataKey("IVA").ToDecimal).RoundSQL + importeMX = (ImporteMovimiento * tipoCambioCompra).RoundSQL If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}" Else @@ -1287,23 +1172,10 @@ Partial Class Bancos_ProveedoresAbonar importeMX = 0 End If Else - ImporteMovimiento = gvr.DataKey("IVA").ToDecimal * PorcentajePago - - If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then - importeMX = ImporteMovimiento - ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then - tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal - importeMX = ImporteMovimiento * tipoCambioCompra - ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then - importeMX = ImporteMovimiento * tipoCambioCompra - ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then - tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal - importeMX = ImporteMovimiento * tipoCambioCompra - End If - ImporteMovimiento = ImporteMovimiento.RoundSQL - importeMX = importeMX.RoundSQL - + ImporteMovimiento = (gvr.DataKey("IVA").ToDecimal * PorcentajePago).RoundSQL + importeMX = (ImporteMovimiento * tipoCambioCompra).RoundSQL If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}" + End If TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) @@ -1330,24 +1202,10 @@ Partial Class Bancos_ProveedoresAbonar Dim TotalImporte As Decimal = gvr.FCTextBox("TxtAbonar").Text.ToDecimal If UsuarioActual.Empresa.Funcionalidad(521) = "1" Then 'funcionalidad que toma el 100% del pago para acreditamiento de iva + If TotalImporte = gvr.DataKey("Saldo").ToDecimal Then - If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then - ImporteMovimiento = gvr.DataKey("IVADeducible").ToDecimal - importeMX = ImporteMovimiento - ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then - tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal - ImporteMovimiento = gvr.DataKey("IVADeducible").ToDecimal - importeMX = gvr.DataKey("IVADeducible").ToDecimal * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) - ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then - ImporteMovimiento = gvr.DataKey("IVADeducible").ToDecimal - importeMX = ImporteMovimiento * tipoCambioCompra - ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then - tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal - ImporteMovimiento = gvr.DataKey("IVADeducible").ToDecimal - importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) - End If - ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero) - importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero) + ImporteMovimiento = (gvr.DataKey("IVADeducible").ToDecimal).RoundSQL + importeMX = (ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)).RoundSQL If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}" Else @@ -1356,19 +1214,8 @@ Partial Class Bancos_ProveedoresAbonar End If Else ImporteMovimiento = gvr.DataKey("IVADeducible").ToDecimal * PorcentajePago + importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) - If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then - importeMX = ImporteMovimiento - ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then - tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal - importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) - ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then - importeMX = ImporteMovimiento * tipoCambioCompra - ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then - tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal - - importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) - End If ImporteMovimiento = ImporteMovimiento.RoundSQL importeMX = importeMX.RoundSQL @@ -1411,20 +1258,8 @@ Partial Class Bancos_ProveedoresAbonar Case 25 'IEPS X Acreditar Dim TotalImporte As Decimal = gvr.FCTextBox("TxtAbonar").Text.ToDecimal - ImporteMovimiento = gvr.DataKey("IEPSPorPagar").ToDecimal * PorcentajePago - If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then - importeMX = ImporteMovimiento - ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then - tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal - importeMX = ImporteMovimiento * tipoCambioCompra - ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then - importeMX = ImporteMovimiento * tipoCambioCompra - ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then - tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal - importeMX = ImporteMovimiento * tipoCambioCompra - End If - ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero) - importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero) + ImporteMovimiento = (gvr.DataKey("IEPSPorPagar").ToDecimal * PorcentajePago).RoundSQL + importeMX = (ImporteMovimiento * tipoCambioCompra).RoundSQL TipoCambioGeneral = tipoCambioCompra If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}" @@ -1435,20 +1270,8 @@ Partial Class Bancos_ProveedoresAbonar End If Case 26 'IEPS Acreditable Dim TotalImporte As Decimal = gvr.FCTextBox("TxtAbonar").Text.ToDecimal - ImporteMovimiento = gvr.DataKey("IEPSPorPagar").ToDecimal * PorcentajePago - If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then - importeMX = ImporteMovimiento - ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then - tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal - importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) - ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then - importeMX = ImporteMovimiento * tipoCambioCompra - ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then - tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal - importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) - End If - ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero) - importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero) + ImporteMovimiento = (gvr.DataKey("IEPSPorPagar").ToDecimal * PorcentajePago).RoundSQL + importeMX = (ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)).RoundSQL TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) If ImporteMovimiento <> 0 AndAlso TipoContabilidad <> 1 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then @@ -1456,6 +1279,7 @@ Partial Class Bancos_ProveedoresAbonar IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaIEPSAcreditable").ToString.ToEntero End If End If + Case 64 'Ganancia If CveMoneda <> 1 OrElse gvr.DataKey("CveMoneda").ToEntero <> 1 Then @@ -1479,37 +1303,6 @@ Partial Class Bancos_ProveedoresAbonar importeMX = ImporteMovimiento End If - '' si tiene funcionalidad de flucturación con ivas, tomar tipocambioventa - 'If tipoCambioPago > tipoCambioVentaDiferenciaCambiaria AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then - ' ImporteMovimiento = (gvr.FCTextBox("TxtAbonar").Text.ToDecimal * tipoCambioPago) - (gvr.FCTextBox("TxtAbonar").Text.ToDecimal * tipoCambioVentaDiferenciaCambiaria) 'Añadimos la diferencia de ganancia en la venta - ' ImporteMovimiento -= ((gvr.DataKey("IVA").ToDecimal * PorcentajePago) * TCImpuestos) - ((gvr.DataKey("IVA").ToDecimal * PorcentajePago) * tipoCambioVentaDiferenciaCambiaria) 'Añadimos la diferencia de ganancia en el IVA - ' ImporteMovimiento += ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * TCImpuestos) - ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * tipoCambioVentaDiferenciaCambiaria) 'Añadimos la diferencia de ganancia en el RetIVA - ' ImporteMovimiento += ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * TCImpuestos) - ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * tipoCambioVentaDiferenciaCambiaria) 'Añadimos la diferencia de ganancia en el RetISR - ' ImporteMovimiento -= ((gvr.DataKey("IEPS").ToDecimal * PorcentajePago) * TCImpuestos) - ((gvr.DataKey("IEPS").ToDecimal * PorcentajePago) * tipoCambioVentaDiferenciaCambiaria) 'Añadimos la diferencia de ganancia en el IEPS - ' ImporteMovimiento = Math.Abs(Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero)) - ' importeMX = ImporteMovimiento - 'End If - - - 'Dim TotalImporte As Decimal = gvr.FCTextBox("TxtAbonar").Text.ToDecimal - - ''Dim IVA As Decimal = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal, gvr.DataKey("IVAPorPagar").ToDecimal, gvr.DataKey("IVA").ToDecimal * PorcentajePago) - 'Dim IVA As Decimal = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal AndAlso Math.Abs(Math.Round(gvr.DataKey("IVAPorPagar").ToDecimal - (gvr.DataKey("IVA").ToDecimal * PorcentajePago), 2)) <= 0.02, gvr.DataKey("IVAPorPagar").ToDecimal, gvr.DataKey("IVA").ToDecimal * PorcentajePago) - 'Dim IEPS As Decimal = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal AndAlso Math.Abs(Math.Round(gvr.DataKey("IEPSPorPagar").ToDecimal - (gvr.DataKey("IEPS").ToDecimal * PorcentajePago), 2)) <= 0.02, gvr.DataKey("IEPSPorPagar").ToDecimal, gvr.DataKey("IEPS").ToDecimal * PorcentajePago) 'If(TotalImporte = gvr.DataKey("Saldo").ToDecimal, gvr.DataKey("IEPSPorPagar").ToDecimal, gvr.DataKey("IEPS").ToDecimal * PorcentajePago) - - 'IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria - 'Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompraValuacion) - 'TipoCambioGeneral = TCImpuestos - '''' si tiene funcionalidad de flucturación con ivas, tomar tipocambioCompra - 'If TipoCambioPago < tipoCambioCompra AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then - ' ImporteMovimiento = (gvr.FCTextBox("TxtAbonar").Text.ToDecimal * TipoCambioPago) - (gvr.FCTextBox("TxtAbonar").Text.ToDecimal * tipoCambioCompra) 'Añadimos la diferencia de ganancia en la venta - ' ImporteMovimiento -= (IVA * TCImpuestos) - (IVA * tipoCambioCompra) 'Añadimos la diferencia de ganancia en el IVA - ' ImporteMovimiento += ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * TCImpuestos) - ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * tipoCambioCompra) 'Añadimos la diferencia de ganancia en el RetIVA - ' ImporteMovimiento += ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * TCImpuestos) - ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * tipoCambioCompra) 'Añadimos la diferencia de ganancia en el RetISR - ' ImporteMovimiento -= (IEPS * TCImpuestos) - (IEPS * tipoCambioCompra) 'Añadimos la diferencia de ganancia en el IEPS - ' ImporteMovimiento = Math.Abs(Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero)) - ' importeMX = ImporteMovimiento - 'End If Else ImporteMovimiento = 0 End If @@ -1531,23 +1324,6 @@ Partial Class Bancos_ProveedoresAbonar ImporteMovimiento = Math.Abs(Diferencia) importeMX = ImporteMovimiento End If - - 'Dim TotalImporte As Decimal = gvr.FCTextBox("TxtAbonar").Text.ToDecimal - 'Dim IVA As Decimal = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal AndAlso Math.Abs(Math.Round(gvr.DataKey("IVAPorPagar").ToDecimal - (gvr.DataKey("IVA").ToDecimal * PorcentajePago), 2)) <= 0.02, gvr.DataKey("IVAPorPagar").ToDecimal, gvr.DataKey("IVA").ToDecimal * PorcentajePago) - 'Dim IEPS As Decimal = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal AndAlso Math.Abs(Math.Round(gvr.DataKey("IEPSPorPagar").ToDecimal - (gvr.DataKey("IEPS").ToDecimal * PorcentajePago), 2)) <= 0.02, gvr.DataKey("IEPSPorPagar").ToDecimal, gvr.DataKey("IEPS").ToDecimal * PorcentajePago) 'If(TotalImporte = gvr.DataKey("Saldo").ToDecimal, gvr.DataKey("IEPSPorPagar").ToDecimal, gvr.DataKey("IEPS").ToDecimal * PorcentajePago) - - 'IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria - 'Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompraValuacion) - '' si tiene funcionalidad de flucturación con ivas, tomar tipocambioCompra - 'If TipoCambioPago > tipoCambioCompra AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then - ' ImporteMovimiento = (gvr.FCTextBox("TxtAbonar").Text.ToDecimal * tipoCambioCompra) - (gvr.FCTextBox("TxtAbonar").Text.ToDecimal * TipoCambioPago) 'Añadimos la diferencia de ganancia en la venta - ' ImporteMovimiento -= (IVA * tipoCambioCompra) - (IVA * TCImpuestos) 'Añadimos la diferencia de ganancia en el IVA - ' ImporteMovimiento += ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * tipoCambioCompra) - ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetIVA - ' ImporteMovimiento += ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * tipoCambioCompra) - ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetISR - ' ImporteMovimiento -= (IEPS * tipoCambioCompra) - (IEPS * TCImpuestos) 'Añadimos la diferencia de ganancia en el IEPS - ' ImporteMovimiento = Math.Abs(Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero)) - ' importeMX = ImporteMovimiento - 'End If Else ImporteMovimiento = 0 End If @@ -1645,8 +1421,6 @@ Partial Class Bancos_ProveedoresAbonar ObjComp.ProgramarCompra(gvr.DataKey("CveCompra").ToEntero, 0, UsuarioActual.CveUsuario, -1) End If - ' End If - End If Next ConceptoMovimiento = $"{TxtPagueseA.Text.Trim} - {TxtObservaciones.Text} {If(TipoCambioPago > 1, $" TC:{TipoCambioPago}", "")}" @@ -1816,7 +1590,6 @@ Partial Class Bancos_ProveedoresAbonar Exit For Else - 'IVA. siempre se registra aunque sea cero If MsgError = "" Then diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index c9753e346..15afe3ed3 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -1126,6 +1126,37 @@ Partial Class Compras_Compras + + Private Property CveRetISRConceptoOriginal As Integer + Get + + If ViewState("CveRetISRConceptoOriginal") Is Nothing Then + ViewState("CveRetISRConceptoOriginal") = -1 + End If + + Return ViewState("CveRetISRConceptoOriginal").ToString.ToEntero + + End Get + Set(value As Integer) + ViewState("CveRetISRConceptoOriginal") = value + End Set + End Property + Private Property CveRetIVAConceptoOriginal As Integer + Get + If ViewState("CveRetIVAConceptoOriginal") Is Nothing Then + ViewState("CveRetIVAConceptoOriginal") = -1 + End If + Return ViewState("CveRetIVAConceptoOriginal").ToString.ToEntero + End Get + Set(value As Integer) + ViewState("CveRetIVAConceptoOriginal") = value + End Set + End Property + + + + + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not IsPostBack Then 'ImgBtnBuscarOC.Attributes.Add("data-toggle", "tooltip") @@ -1290,7 +1321,13 @@ Partial Class Compras_Compras If UsuarioActual.Empresa.Funcionalidad(590).ToString.ToEntero = 1 Then DVCultivosCuadro.Visible = True DdlSubProyecto.AutoPostBack = True - DdlCultivosCuadro.DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros($"CveSubProyecto = {DdlSubProyecto.SelectedValue}") + + GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa) = Nothing + Dim extrafiltro = "Estatus=1 AND " + If Request("CveCompra") IsNot Nothing AndAlso IsNumeric(Request("CveCompra")) AndAlso Request("CveCompra").ToEntero > 0 Then + extrafiltro = "" + End If + DdlCultivosCuadro.DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros($"{extrafiltro} CveSubProyecto = {DdlSubProyecto.SelectedValue}") DdlCultivosCuadro.DataBind() DdlCultivosCuadro.Items.Insert(0, New ListItem("Seleccione uno", "-1")) @@ -2147,12 +2184,10 @@ Partial Class Compras_Compras ObjSAT.Dispose() End If - - Return RFC End Function - Private Sub CargaRetIVAConcepto(Optional Cambio As Boolean = False) + Private Sub CargaRetIVAConcepto(Optional Cambio As Boolean = False, Optional DIOTCveTipoOperacion As Integer = -1) If TrRetIVA.Visible Then TdRetIVAConcepto.Visible = True @@ -2161,32 +2196,66 @@ Partial Class Compras_Compras If Cambio Then DdlRetIVAConcepto.Items.Clear() - If RFCProv.Length = 13 Then - DdlRetIVAConcepto.Items.Insert(0, New ListItem("Honorarios/Serv. Prof.", "1")) - DdlRetIVAConcepto.Items.Insert(1, New ListItem("Fletes P.F.", "2")) + If RFCProv.Length = 13 Then ' personal moral + If DIOTCveTipoOperacion = 1 Then '03 - Prestación de Servicios Profesionales + DdlRetIVAConcepto.Items.Insert(0, New ListItem("Honorarios/Serv. Prof.", "1")) + End If + + If DIOTCveTipoOperacion = 2 Then ' 06 - Arrendamiento de inmuebles + DdlRetIVAConcepto.Items.Add(New ListItem("Arrendamiento", "4")) + End If + + If DIOTCveTipoOperacion = 3 Then ' 85 - Otros + DdlRetIVAConcepto.Items.Insert(0, New ListItem("Honorarios/Serv. Prof.", "1")) + DdlRetIVAConcepto.Items.Add(New ListItem("Arrendamiento", "4")) + DdlRetIVAConcepto.Items.Insert(0, New ListItem("Fletes P.F.", "2")) + End If + ElseIf RFCProv.Length = 12 Then - DdlRetIVAConcepto.Items.Insert(0, New ListItem("Fletes P.M.", "3")) + If DIOTCveTipoOperacion = 1 Then '03 - Prestación de Servicios Profesionales + DdlRetIVAConcepto.Items.Insert(0, New ListItem("Honorarios/Serv. Prof.", "1")) + End If + + If DIOTCveTipoOperacion = 2 Then ' 06 - Arrendamiento de inmuebles + DdlRetIVAConcepto.Items.Add(New ListItem("Arrendamiento", "4")) + End If + + If DIOTCveTipoOperacion = 3 Then ' 85 - Otros + DdlRetIVAConcepto.Items.Insert(0, New ListItem("Honorarios/Serv. Prof.", "1")) + DdlRetIVAConcepto.Items.Add(New ListItem("Arrendamiento", "4")) + DdlRetIVAConcepto.Items.Insert(0, New ListItem("Fletes P.F.", "2")) + End If + End If - DdlRetIVAConcepto.Items.Add(New ListItem("Arrendamiento", "4")) - ''If UsuarioActual.Empresa.Funcionalidad(577).ToEntero = 1 Then - DdlRetIVAConcepto.Items.Add(New ListItem("Ret IVA Servicios", "5")) - ''End If - End If + UpPS.Update() End Sub - Private Sub CargaRetISRConcepto(Optional Cambio As Boolean = False) + Private Sub CargaRetISRConcepto(Optional Cambio As Boolean = False, Optional DIOTCveTipoOperacion As Integer = -1) If TrRetISR.Visible Then TdRetISRConcepto.Visible = True End If If Cambio Then DdlRetISRConcepto.Items.Clear() - DdlRetISRConcepto.Items.Insert(0, New ListItem("Honorarios", "1")) - DdlRetISRConcepto.Items.Insert(1, New ListItem("Arrendamiento", "2")) - DdlRetISRConcepto.Items.Insert(1, New ListItem("Resico", "3")) + + If DIOTCveTipoOperacion = 1 Then '03 - Prestación de Servicios Profesionales + DdlRetISRConcepto.Items.Insert(0, New ListItem("Honorarios", "1")) + DdlRetISRConcepto.Items.Insert(1, New ListItem("Resico", "3")) + End If + + If DIOTCveTipoOperacion = 2 Then ' 06 - Arrendamiento de inmuebles + DdlRetISRConcepto.Items.Insert(0, New ListItem("Arrendamiento", "2")) + DdlRetISRConcepto.Items.Insert(1, New ListItem("Resico", "3")) + End If + + If DIOTCveTipoOperacion = 3 Then ' 85 - Otros + DdlRetISRConcepto.Items.Insert(0, New ListItem("Honorarios", "1")) + DdlRetISRConcepto.Items.Insert(1, New ListItem("Arrendamiento", "2")) + DdlRetISRConcepto.Items.Insert(1, New ListItem("Resico", "3")) + End If End If UpPS.Update() @@ -2547,8 +2616,6 @@ Partial Class Compras_Compras HFDiferenciaCompra.Value = TxtTotal.Text - - TotalGeneral = dr("Total").ToString.ToDouble CveMoneda = dr("CveMoneda").ToString.ToEntero DdlValidadaSAT.SelectedValue = "Si" @@ -2570,6 +2637,11 @@ Partial Class Compras_Compras DdlRetIVAConcepto.SelectedValueExist(dr("CveRetIVAConcepto").ToString) DdlRetISRConcepto.SelectedValueExist(dr("CveRetISRConcepto").ToString) + + CveRetIVAConceptoOriginal = If(dr("CveRetIVAConcepto").ToString.ToEntero > 0, dr("CveRetIVAConcepto").ToString.ToEntero, -1) + CveRetISRConceptoOriginal = If(dr("CveRetISRConcepto").ToString.ToEntero > 0, dr("CveRetISRConcepto").ToString.ToEntero, -1) + + If dr("CveTipoConcepto").ToString.ToEntero = 1 Then LblProveedor.Text = "Proveedor:" Else LblProveedor.Text = "Acreedor:" HdnCveEstatusFactura.Value = dr("CveEstatusFactura").ToString @@ -2838,6 +2910,16 @@ Partial Class Compras_Compras TxtObsPS.Enabled = True LbAgregar.Enabled = True LnkUpdateFechaPago.Visible = True + + If DdlRetIVAConcepto.SelectedValue.ToEntero > 0 Then + DdlRetIVAConcepto.Enabled = True + End If + + If DdlRetISRConcepto.SelectedValue.ToEntero > 0 Then + DdlRetISRConcepto.Enabled = True + End If + + End If BtnGuardar.Visible = False @@ -3359,56 +3441,53 @@ Partial Class Compras_Compras HdnCveProveedor.Value = ObjProveedor.CveProveedor.ToString TxtFechaPago.Text = (TxtFecha.Text.ToDate.AddDays(LblDiasCredito.Text.ToEntero)).ToShortDateString RFCProv = ObjProveedor.RFC - CargaRetIVAConcepto(True) - CargaRetISRConcepto(True) + CargaRetIVAConcepto(True, ObjProveedor.DIOTCveTipoOperacion) + CargaRetISRConcepto(True, ObjProveedor.DIOTCveTipoOperacion) - If ObjProveedor.DIOTCveTipoOperacion = 1 Then '03 - Prestación de Servicios Profesionales - DdlRetIVAConcepto.SelectedValueExist("1") - DdlRetISRConcepto.SelectedValueExist("1") ' honorarios - ElseIf ObjProveedor.DIOTCveTipoOperacion = 2 Then ' 06 - Arrendamiento de inmuebles - DdlRetIVAConcepto.SelectedValueExist("4") - DdlRetISRConcepto.SelectedValueExist("2") ' arrendamiento - ElseIf ObjProveedor.DIOTCveTipoOperacion = 3 Then ' 85 - Otros - DdlRetIVAConcepto.SelectedValueExist("2") ' flete pf - DdlRetIVAConcepto.SelectedValueExist("3") ' fletes pm - DdlRetISRConcepto.SelectedValueExist("1") ' honorarios - ElseIf ObjProveedor.DIOTCveTipoOperacion = 0 Then + 'If ObjProveedor.DIOTCveTipoOperacion = 1 Then '03 - Prestación de Servicios Profesionales + ' DdlRetIVAConcepto.SelectedValueExist("1") + ' DdlRetISRConcepto.SelectedValueExist("1") ' honorarios + 'ElseIf ObjProveedor.DIOTCveTipoOperacion = 2 Then ' 06 - Arrendamiento de inmuebles + ' DdlRetIVAConcepto.SelectedValueExist("4") + ' DdlRetISRConcepto.SelectedValueExist("2") ' arrendamiento + 'ElseIf ObjProveedor.DIOTCveTipoOperacion = 3 Then ' 85 - Otros + ' DdlRetIVAConcepto.SelectedValueExist("2") ' flete pf + ' DdlRetIVAConcepto.SelectedValueExist("3") ' fletes pm + ' DdlRetISRConcepto.SelectedValueExist("1") ' honorarios + ' 'ElseIf ObjProveedor.DIOTCveTipoOperacion = 0 Then + 'End If - If CveFactura > 0 Then + If CveFactura > 0 Then - If RetIVAOriginal > 0 Then - Dim CalRetIVAPor As Decimal = (RetIVAOriginal * 1 / SubTotal2Original).RoundAD(6).ToDecimal - - If (CalRetIVAPor).RoundAD(6) = 0.106667 Then - DdlRetIVAConcepto.SelectedValueExist("1") '10.66 servicios profecionales - End If - - If (CalRetIVAPor).RoundAD(2) = 0.04 Then '4 Fletes - - If RFCProv.Length = 13 Then - DdlRetIVAConcepto.SelectedValueExist("2") - Else - DdlRetIVAConcepto.SelectedValueExist("3") - End If - - - End If + If RetIVAOriginal > 0 Then + Dim CalRetIVAPor As Decimal = (RetIVAOriginal * 1 / SubTotal2Original).RoundAD(6).ToDecimal + If (CalRetIVAPor).RoundSQL(6) = 0.106667 OrElse (CalRetIVAPor).RoundSQL(6) = 0.053333 Then + DdlRetIVAConcepto.SelectedValueExist("1") '10.66 servicios profecionales End If - If RetISROriginal > 0 Then + If (CalRetIVAPor).RoundSQL(2) = 0.04 Then '4 Fletes - Dim CalRetISRPor As Decimal = (RetISROriginal * 1 / SubTotal2Original).RoundAD(5).ToDecimal - - If (CalRetISRPor).RoundAD(1) = 0.1 Then '10 Sercviios profecionales - DdlRetISRConcepto.SelectedValueExist("1") + If RFCProv.Length = 13 Then + DdlRetIVAConcepto.SelectedValueExist("2") + Else + DdlRetIVAConcepto.SelectedValueExist("3") End If + End If - If (CalRetISRPor).RoundAD(4) = 0.0125 Then '1.25 Recico regimen simplificado confianza - DdlRetISRConcepto.SelectedValueExist("3") - End If + End If + If RetISROriginal > 0 Then + + Dim CalRetISRPor As Decimal = (RetISROriginal * 1 / SubTotal2Original).RoundAD(5).ToDecimal + + If (CalRetISRPor).RoundSQL(1) = 0.1 Then '10 Servicios profesionales + DdlRetISRConcepto.SelectedValueExist("1") + End If + + If (CalRetISRPor).RoundSQL(4) = 0.0125 Then '1.25 Recico regimen simplificado confianza + DdlRetISRConcepto.SelectedValueExist("3") End If End If @@ -5081,31 +5160,6 @@ Partial Class Compras_Compras Next - ''[IPP] COMENTADO A MIRAS DE ELIMINAR 21-FEBRERO-2018 - ''VERIFICA SI TIENE DESCUENTO (AMORTIZACION) - 'If TxtDescuento.Text.ToDouble > 0 Then - ' DescuentoConIVA = TxtDescuento.Text.ToDecimal * 1.16D - - ' 'Valida que el descuento con iva cuadre en los totales - ' If Math.Abs(DescuentoConIVA - (Importe - TxtTotal.Text.ToDecimal)) < 0.02 Then - ' DescuentoConIVA = Importe - TxtTotal.Text.ToDecimal - ' ElseIf DescuentoConIVA <> (Importe - TxtTotal.Text.ToDecimal) Then - ' ErrorACMEnsaje.Append(" - Valida que el descuento con iva cuadre en los totales ") - ' ErrorAC = True - ' End If - - ' 'actualizo el idcuenta del presupuesto - ' If ObjContaAC.AddMovimiento(IdPoliza, tIdContaProveedor, True, MultiplicadorNC * (Importe - DescuentoConIVA), "", ConceptoRenglon, 0, Fecha, "") Then - ' 'agrego a la cuenta contable anticipos - ' If Not ObjContaAC.AddMovimiento(IdPoliza, CtaProveedorAnticipos, True, MultiplicadorNC * DescuentoConIVA, "", ConceptoRenglon, 0, Fecha, "") Then - ' ErrorACMEnsaje.Append(" - actualizo el idcuenta del presupuesto ObjContaAC.AddMovimiento 1") - ' ErrorAC = True - ' End If - ' Else - ' ErrorACMEnsaje.Append(" - actualizo el idcuenta del presupuesto ObjContaAC.AddMovimiento 2") - ' ErrorAC = True - ' End If - 'Else 'actualizo el idcuenta del presupuesto Importe = TxtTotal.Text.ToDecimal If Not ObjContaAC.AddMovimiento(IdPoliza, tIdContaProveedor, True, MultiplicadorNC * (If(ArrAnticipos.Count > 0, ImporteAnticipo, Importe)), "", ConceptoRenglon, 0, Fecha, "") Then @@ -5505,20 +5559,12 @@ Partial Class Compras_Compras Next End If Next - End If - - If AplicarCostoIndirecto(ObjInventario, ObjCompras) Then ErrorMovInv = True End If - 'Else - ' Alert("El tipo de cambio no esta actualizado. Por favor comuniquese con un asistente SIG.", TipoMensaje.MsgError) - ' ErrorMovInv = True - 'End If - End If '*************************************************** P R I M E R A P A R T E C O M P R A S ************************************************************************************************************************************************************************************************************************************************************************************************** @@ -5661,12 +5707,6 @@ Partial Class Compras_Compras Dim CveCompraCapital As Integer = -1 Dim CveCompraInteres As Integer = -1 - 'Dim ImporteCapital As Decimal = 0 - ' Dim ImporteCapitalIVA As Decimal = 0 - - 'Dim ImporteInteres As Decimal = 0 - ' Dim ImporteInteresIVA As Decimal = 0 - ' Dim ImporteIEMensualidad As Decimal = ObjIE.DtResultados.FiltroPrimeroValor("ImporteIE", $"CveCreditoDetalle = {CveCreditoDetalleTemp}").ToDecimal CreditoEstatus = ObjIE.DtResultados.FiltroPrimeroValor("Estatus", $"CveCreditoDetalle = {CveCreditoDetalleTemp}").ToEntero @@ -5685,7 +5725,6 @@ Partial Class Compras_Compras Capital = Ambos Interes = Ambos - End If If Capital > 0 Then @@ -5695,8 +5734,6 @@ Partial Class Compras_Compras CveCompraInteres = CveCompra End If - - If (CveCompraCapital > 0 And CveCompraInteres > 0) And EstusTemp = 2 Then If EstusTemp = 2 Then EstusTemp = 3 @@ -5715,9 +5752,6 @@ Partial Class Compras_Compras ImporteInteres:=Interes) Then ErrorCredito = True End If - 'ObjIE.UpdateCreditosDetalle(CveCreditoDetalle, "01/01/2000".ToDate, -1, -1, -1, -1, -1, -1, Estatus) - - Else ErrorCredito = True @@ -5756,8 +5790,6 @@ Partial Class Compras_Compras IdCtaIVAAcreditable = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeIVA).Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero End If - - '********************** Variables '********************** '****** Pagos @@ -5864,8 +5896,6 @@ Partial Class Compras_Compras Dim importeRetISRxAcreditar As Decimal = 0 importeRetISRxAcreditar = TxtRetISR.Text.ToDecimal - - '****** Movimientos Independientes 'Pago Proveedores (17) @@ -5966,7 +5996,7 @@ Partial Class Compras_Compras importeMovimiento = TxtTotal.Text.ToDecimal 'TmpDT.SUM("Total", String.Format("ISNULL(TipoAF, 0) <> 2 And ISNULL(CveAlmacen, 0) = 0 And ISNULL(AplicaCostoIndirecto, 0) <> 1 And CveClasificacion = {0} And CveSubProyecto = {1} And ISNULL(CveTipoGasto, 0) = {2} Then", Row2("CveClasificacion").ToString.ToEntero, Row2("CveSubProyecto").ToString.ToEntero, Row2("CveTipoGasto").ToString.ToEntero)).ToString.ToDecimal importeMN = importeMovimiento * tipoCambioActual * Multiplicador 'CLASIFICACION - If Row2("CveClasificacion").ToString.ToEntero > 0 Then + If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso Row2("CveClasificacion").ToString.ToEntero > 0 Then If ObjConta.GetRetCuenta(6, Row2("CveClasificacion").ToString.ToEntero, CveSubProyecto:=Row2("CveSubProyecto").ToString.ToEntero) Then If ObjConta.DtResultados.Rows.Count > 0 AndAlso ObjConta.DtResultados.Rows(0)("IdCuentaGasto").ToString.ToEntero > 0 Then IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaGasto").ToString.ToEntero @@ -6101,7 +6131,7 @@ Partial Class Compras_Compras ConceptoContable = 288 End If - If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then + If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then If ObjConta.DtResultados.Rows.Count > 0 Then IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaIVAAcreditable").ToString.ToEntero End If @@ -6113,7 +6143,7 @@ Partial Class Compras_Compras IdCtaIva = If(IdCtaIVAXAcreditar > 0, IdCtaIVAXAcreditar, 0) Dim ttConceptoContable As Integer = 14 - If ObjConta.GetRetCuenta(ttConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaIva > 0 Then + If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso ObjConta.GetRetCuenta(ttConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaIva > 0 Then If ObjConta.DtResultados.Rows.Count > 0 Then IdCtaIva = ObjConta.DtResultados.Rows(0)("IdCuentaIVAxAcreditar").ToString.ToEntero End If @@ -6139,7 +6169,7 @@ Partial Class Compras_Compras If chkImportacion.Checked Then ConceptoContable = 287 End If - If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then + If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then If ObjConta.DtResultados.Rows.Count > 0 Then IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaIVAxAcreditar").ToString.ToEntero End If @@ -6176,7 +6206,7 @@ Partial Class Compras_Compras If tipoCambioActual > 1 Then Concepto += $" TC{tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}" PorcentajeImpuesto = PorcentajeIVA IdCtaContable = If(IdCtaIVAXAcreditar > 0, IdCtaIVAXAcreditar, 0) - If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then + If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then If ObjConta.DtResultados.Rows.Count > 0 Then IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaIVAxAcreditar").ToString.ToEntero End If @@ -6189,7 +6219,7 @@ Partial Class Compras_Compras importeMovimiento = ImporteIEPSxAcreditar importeMN = Math.Round(importeMovimiento, 2) * tipoCambioActual * Multiplicador If tipoCambioActual > 1 Then Concepto += $" TC{tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}" - If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then + If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then If ObjConta.DtResultados.Rows.Count > 0 Then IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaIEPSxAcreditar").ToString.ToEntero End If @@ -6207,7 +6237,7 @@ Partial Class Compras_Compras If Not DdlTipoComprobante.SelectedValue.Contiene("Ant") Then importeMovimiento = ImporteIEPSAcreditable importeMN = Math.Round(importeMovimiento, 2) * tipoCambioActual * Multiplicador - If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then + If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then If ObjConta.DtResultados.Rows.Count > 0 Then IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaIEPSAcreditable").ToString.ToEntero End If @@ -6216,7 +6246,7 @@ Partial Class Compras_Compras 'Agregamos el Opuesto del 26 -> 25 If importeMovimiento <> 0 Then Dim IdCtaIEPS As Integer = 0 - If ObjConta.GetRetCuenta(25, UsuarioActual.CveEmpresa) Then + If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso ObjConta.GetRetCuenta(25, UsuarioActual.CveEmpresa) Then If ObjConta.DtResultados.Rows.Count > 0 Then IdCtaIEPS = ObjConta.DtResultados.Rows(0)("IdCuentaIEPSxAcreditar").ToString.ToEntero End If @@ -6264,27 +6294,24 @@ Partial Class Compras_Compras importeMovimiento = importeRetIVAAcreditable importeMN = Math.Round(importeMovimiento, 2) * tipoCambioActual * Multiplicador - If CtaProveedorRetIVA > 0 Then - IdCtaContable = CtaProveedorRetIVA - ElseIf UsuarioActual.Empresa.Funcionalidad(Funcionalidad).ToEntero > 0 Then - IdCtaContable = UsuarioActual.Empresa.Funcionalidad(Funcionalidad).ToEntero - Else - If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then - If ObjConta.DtResultados.Rows.Count > 0 Then - IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero + + If UsuarioActual.Empresa.TipoContabilidad = 2 Then + + If CtaProveedorRetIVA > 0 Then + IdCtaContable = CtaProveedorRetIVA + ElseIf UsuarioActual.Empresa.Funcionalidad(Funcionalidad).ToEntero > 0 Then + IdCtaContable = UsuarioActual.Empresa.Funcionalidad(Funcionalidad).ToEntero + Else + If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then + If ObjConta.DtResultados.Rows.Count > 0 Then + IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero + End If End If End If + End If - 'Codigo anterior - 'If UsuarioActual.Empresa.Funcionalidad(577).ToEntero = 1 Then - ' IdCtaContable = UsuarioActual.Empresa.Funcionalidad(578).ToEntero - ''End If - - 'If DdlRetIVAConcepto.SelectedValue.ToEntero = 5 Then - ' IdCtaContable = UsuarioActual.Empresa.Funcionalidad(578).ToEntero - 'End If 'Agregamos el Opuesto del 22 -> 15 @@ -6301,6 +6328,7 @@ Partial Class Compras_Compras Case 15 'RetIVA X Acreditar Honorarios/Serv. Prof. If Not DdlTipoComprobante.SelectedValue.Contiene("Ant") Then If DdlRetIVAConcepto.Items.Count > 0 AndAlso DdlRetIVAConcepto.SelectedValue.ToEntero() > 0 Then + Dim Funcionalidad As Integer = 0 If DdlRetIVAConcepto.SelectedValue.ToEntero = 1 Then Funcionalidad = 307 @@ -6323,24 +6351,31 @@ Partial Class Compras_Compras importeMN = Math.Round(importeMovimiento, 2) * tipoCambioActual * Multiplicador If tipoCambioActual > 1 Then Concepto += $" TC{tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}" - If CtaProveedorRetIVA > 0 Then - IdCtaContable = CtaProveedorRetIVA - ElseIf UsuarioActual.Empresa.Funcionalidad(Funcionalidad).ToEntero > 0 Then - IdCtaContable = UsuarioActual.Empresa.Funcionalidad(Funcionalidad).ToEntero - Else - If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then - If ObjConta.DtResultados.Rows.Count > 0 Then - IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero + + If UsuarioActual.Empresa.TipoContabilidad = 2 Then + If CtaProveedorRetIVA > 0 Then + IdCtaContable = CtaProveedorRetIVA + ElseIf UsuarioActual.Empresa.Funcionalidad(Funcionalidad).ToEntero > 0 Then + IdCtaContable = UsuarioActual.Empresa.Funcionalidad(Funcionalidad).ToEntero + Else + If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then + If ObjConta.DtResultados.Rows.Count > 0 Then + IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero + End If End If End If End If + + + End If End If Case 23 'RetISR Acreditable If Not DdlTipoComprobante.SelectedValue.Contiene("Ant") Then If DdlRetISRConcepto.Items.Count > 0 AndAlso DdlRetISRConcepto.SelectedValue.ToEntero > 0 Then + Dim funcionalidad As Integer = 0 Dim ConceptoContableContra As Integer = 0 @@ -6360,18 +6395,22 @@ Partial Class Compras_Compras importeMovimiento = importeRetISRAcreditable importeMN = Math.Round(importeMovimiento, 2) * tipoCambioActual * Multiplicador - If CtaProveedorRetISR > 0 Then - IdCtaContable = CtaProveedorRetISR - ElseIf UsuarioActual.Empresa.Funcionalidad(funcionalidad).ToEntero > 0 Then - IdCtaContable = UsuarioActual.Empresa.Funcionalidad(funcionalidad).ToEntero - Else - If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then - If ObjConta.DtResultados.Rows.Count > 0 Then - IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero + + If UsuarioActual.Empresa.TipoContabilidad = 2 Then + If CtaProveedorRetISR > 0 Then + IdCtaContable = CtaProveedorRetISR + ElseIf UsuarioActual.Empresa.Funcionalidad(funcionalidad).ToEntero > 0 Then + IdCtaContable = UsuarioActual.Empresa.Funcionalidad(funcionalidad).ToEntero + Else + If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then + If ObjConta.DtResultados.Rows.Count > 0 Then + IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero + End If End If End If End If + 'Agregamos el Opuesto del 23 -> 16 If importeMovimiento <> 0 Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, importeMovimiento, Referencia, ConceptoContableContra, Concepto + If(tipoCambioActual > 1, $" TC {tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}", ""), FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CvePersonal:=CvePersonal, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMovimiento * tipoCambioActual, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), Contabilizable:=SeContabiliza) Then @@ -6385,6 +6424,7 @@ Partial Class Compras_Compras Case 16 'Ret ISR X Acreditar If Not DdlTipoComprobante.SelectedValue.Contiene("Ant") Then If DdlRetISRConcepto.Items.Count > 0 AndAlso DdlRetISRConcepto.SelectedValue.ToEntero > 0 Then + Dim funcionalidad As Integer = 0 If DdlRetISRConcepto.SelectedValue.ToEntero = 1 Then funcionalidad = 315 @@ -6399,49 +6439,27 @@ Partial Class Compras_Compras importeMovimiento = importeRetISRxAcreditar importeMN = Math.Round(importeMovimiento, 2) * tipoCambioActual * Multiplicador If tipoCambioActual > 1 Then Concepto += $" TC{tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}" - If CtaProveedorRetISR > 0 Then - IdCtaContable = CtaProveedorRetISR - ElseIf UsuarioActual.Empresa.Funcionalidad(funcionalidad).ToEntero > 0 Then - IdCtaContable = UsuarioActual.Empresa.Funcionalidad(funcionalidad).ToEntero - Else - If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then - If ObjConta.DtResultados.Rows.Count > 0 Then - IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero + If UsuarioActual.Empresa.TipoContabilidad = 2 Then + If CtaProveedorRetISR > 0 Then + IdCtaContable = CtaProveedorRetISR + ElseIf UsuarioActual.Empresa.Funcionalidad(funcionalidad).ToEntero > 0 Then + IdCtaContable = UsuarioActual.Empresa.Funcionalidad(funcionalidad).ToEntero + Else + If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then + If ObjConta.DtResultados.Rows.Count > 0 Then + IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero + End If End If End If End If + + End If End If - 'Case 244 'RetISR Acreditable Terceros y Arrendamiento - ' If Not DdlTipoComprobante.SelectedValue.Contiene("Ant") Then - ' If DdlRetISRConcepto.Items.Count > 0 AndAlso DdlRetISRConcepto.SelectedValue.ToEntero = 2 Then - ' importeMovimiento = importeRetISRAcreditable - ' importeMN = Math.Round(importeMovimiento, 2) * tipoCambioActual * Multiplicador - ' If CtaProveedorRetISR > 0 Then - ' IdCtaContable = CtaProveedorRetISR - ' ElseIf UsuarioActual.Empresa.Funcionalidad(318).ToEntero > 0 Then - ' IdCtaContable = UsuarioActual.Empresa.Funcionalidad(318).ToEntero - ' Else - ' If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then - ' If ObjConta.DtResultados.Rows.Count > 0 Then - ' IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero - ' End If - ' End If - ' End If - ' 'Agregamos el Opuesto del 244 -> 243 - ' If importeMovimiento <> 0 Then - ' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, importeMovimiento, Referencia, 243, Concepto + If(tipoCambioActual > 1, $" TC {tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}", ""), FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CvePersonal:=CvePersonal, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMovimiento * tipoCambioActual, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), Contabilizable:=SeContabiliza) Then - ' ErrorPrepoliza = True - ' End If - ' End If - ' If tipoCambioActual > 1 Then Concepto += $" TC{tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}" - ' End If - ' End If Case 64 'Ganancia - CveSubProyectoInsertar = CveSubProyecto If CveSubProyectoInsertar <= 0 Then ErrorPrepoliza = True @@ -6482,30 +6500,7 @@ Partial Class Compras_Compras Else importeMovimiento = 0 End If - 'Case 285 'Ret IVA 6% Servicios - ' IdCtaContable = UsuarioActual.Empresa.Funcionalidad(578).ToEntero - - ' 'If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then - ' ' If ObjConta.DtResultados.Rows.Count > 0 Then - ' ' IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero - ' ' End If - ' 'End If - - - ' If DdlRetIVAConcepto.SelectedValue.ToEntero = 5 Then - - ' If CveMoneda = 2 Then - ' importeMN = TxtRetIVA.Text.ToDecimal * TxtTC.Text.ToDecimal - ' Else - ' importeMN = TxtRetIVA.Text.ToDecimal - ' importeMovimiento = TxtRetIVA.Text.ToDecimal - - ' End If - - ' Else - ' importeMovimiento = 0 - ' End If Case 6 'Compra Dim AgregaMercanciaInventario As Boolean = UsuarioActual.CveEmpresa.Contiene(1, 72, 80, 119, 140, 145, 141, 152, 153, 154, 158, 159, 160, 161, 162, 163) AndAlso UsuarioActual.Empresa.UsaInventarios AndAlso Not UsuarioActual.Empresa.Funcionalidad(126) = "1" @@ -6532,7 +6527,8 @@ Partial Class Compras_Compras For Each Row2 As DataRow In DT.Rows importeMovimiento = If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, Row2("ImporteSinImpuestos").ToString.ToDecimal, Row2("Total").ToString.ToDecimal) importeMN = importeMovimiento * tipoCambioActual * Multiplicador - If ObjConta.GetRetCuenta(49, Row2("CveActivoFijo").ToString.ToEntero) Then + + If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso ObjConta.GetRetCuenta(49, Row2("CveActivoFijo").ToString.ToEntero) Then If ObjConta.DtResultados.Rows.Count > 0 Then IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCtaContActivoFijo").ToString.ToEntero End If @@ -6581,12 +6577,15 @@ Partial Class Compras_Compras importeMovimiento = TmpDT.SUM(If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, "ImporteSinImpuestos", "Total"), $"CveAlmacen = {RowDetalle("CveAlmacen")}").ToString.ToDecimal + TmpDT.SUM("CostoIndirectoAlmacen", $"CveAlmacen = {RowDetalle("CveAlmacen")}").ToString.ToDecimal 'Row2("Total").ToString.ToDecimal + Row2("CostoIndirectoAlmacen").ToString.ToDecimal importeMN = importeMovimiento * tipoCambioActual * Multiplicador - If ObjConta.GetRetCuenta(6, RowDetalle("CveClasificacion").ToString().ToEntero()) Then - If ObjConta.DtResultados.Rows.Count > 0 Then - IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaGasto").ToString.ToEntero + If UsuarioActual.Empresa.TipoContabilidad = 2 Then + If ObjConta.GetRetCuenta(6, RowDetalle("CveClasificacion").ToString().ToEntero()) Then + If ObjConta.DtResultados.Rows.Count > 0 Then + IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaGasto").ToString.ToEntero + End If End If End If + If importeMN <> 0 Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMN, Referencia, 6, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CvePersonal:=CvePersonal, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=tipoCambioActual, CveClasificacion:=RowDetalle("CveClasificacion").ToString().ToEntero(), CveSubProyecto:=RowDetalle("CveSubProyecto").ToString().ToEntero(), Contabilizable:=SeContabiliza) Then @@ -6600,11 +6599,16 @@ Partial Class Compras_Compras importeMovimiento = TmpDT.SUM(If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, "ImporteSinImpuestos", "Total"), $"CveAlmacen = {Row2("CveAlmacen")}").ToString.ToDecimal + TmpDT.SUM("CostoIndirectoAlmacen", $"CveAlmacen = {Row2("CveAlmacen")}").ToString.ToDecimal 'Row2("Total").ToString.ToDecimal + Row2("CostoIndirectoAlmacen").ToString.ToDecimal importeMN = importeMovimiento * tipoCambioActual * Multiplicador - If ObjConta.GetRetCuenta(68, GvInv.HeaderRow.FCDropDownList("ddlAlmacen").SelectedValue.ToString.ToEntero) Then - If ObjConta.DtResultados.Rows.Count > 0 Then - IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero + + If UsuarioActual.Empresa.TipoContabilidad = 2 Then + If ObjConta.GetRetCuenta(68, GvInv.HeaderRow.FCDropDownList("ddlAlmacen").SelectedValue.ToString.ToEntero) Then + If ObjConta.DtResultados.Rows.Count > 0 Then + IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero + End If End If End If + + If importeMN <> 0 Then 'Conta ContPAQ If IdCtaContable = 0 Then @@ -6685,23 +6689,27 @@ Partial Class Compras_Compras importeMN = importeMovimiento * tipoCambioActual * Multiplicador 'TIENE QUE TENER EL IMPORTEMN IGUAL AL IMPORTEMOVIMIENTO PORQUE NO TOMA EN CUENTA SI UN PRODUCTO ES TIPO SERVICIO End Select - If ConceptoContabilizacion = 6 Then - If ObjConta.GetRetCuenta(ConceptoContabilizacion, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then - IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaGasto").ToString.ToEntero + If UsuarioActual.Empresa.TipoContabilidad = 2 Then + If ConceptoContabilizacion = 6 Then + If ObjConta.GetRetCuenta(ConceptoContabilizacion, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then + IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaGasto").ToString.ToEntero + End If + Else + If ObjConta.GetRetCuenta(ConceptoContabilizacion, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then + IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero + End If End If - Else - If ObjConta.GetRetCuenta(ConceptoContabilizacion, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then - IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero + + If ObjConta.GetRetCuenta(ConceptoContabilizacionME, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then + IdCtaContableME = ObjConta.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero + End If + + If ObjConta.GetRetCuenta(ConceptoContabilizacionMEComp, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then + IdCtaContableMEComp = ObjConta.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero End If End If - If ObjConta.GetRetCuenta(ConceptoContabilizacionME, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then - IdCtaContableME = ObjConta.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero - End If - If ObjConta.GetRetCuenta(ConceptoContabilizacionMEComp, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then - IdCtaContableMEComp = ObjConta.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero - End If Dim CveMovimientoAlmacen As Integer = -1 'If importeMovimiento <> 0 Then @@ -6803,7 +6811,7 @@ Partial Class Compras_Compras For Each RowDetalle As DataRow In TmpDT.FiltraParametros("ISNULL(TipoAF,0) <> 2", "", {"CveClasificacion", "CveSubProyecto"}).Rows - If ObjConta.GetRetCuenta(6, RowDetalle("CveClasificacion").ToString().ToEntero()) Then + If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso ObjConta.GetRetCuenta(6, RowDetalle("CveClasificacion").ToString().ToEntero()) Then If ObjConta.DtResultados.Rows.Count > 0 Then IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaGasto").ToString.ToEntero End If @@ -6837,19 +6845,20 @@ Partial Class Compras_Compras importeMovimiento = TmpDT.SUM(If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, "ImporteSinImpuestos", "Total"), $"ISNULL(TipoAF,0) <> 2 And ISNULL(CveAlmacen,0) = 0 And ISNULL(AplicaCostoIndirecto,0) <> 1 And ISNULL(CveTipoPS,0) = 2").ToString.ToDecimal importeMN = importeMovimiento * tipoCambioActual * Multiplicador - If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then 'cuando es emp acumuladora + 'no es necesario, ya se está interpretandoe l usado como producto + 'If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then 'cuando es emp acumuladora - Dim Valor As Decimal = 0 - For Each RowAcum As DataRow In GlobalDTAcumTamaños().FiltraParametros("CveEmpresa = 140").Rows - Dim TotalTamanio = TmpDT.FiltroPrimeroValor("Total", $"CvePS={RowAcum("CvePSCargo")}").ToDecimal() - If TotalTamanio > 0 Then - Valor += TotalTamanio - End If - Next + ' Dim Valor As Decimal = 0 + ' For Each RowAcum As DataRow In GlobalDTAcumTamaños().FiltraParametros("CveEmpresa = 140").Rows + ' Dim TotalTamanio = TmpDT.FiltroPrimeroValor("Total", $"CvePS={RowAcum("CvePSCargo")}").ToDecimal() + ' If TotalTamanio > 0 Then + ' Valor += TotalTamanio + ' End If + ' Next - importeMovimiento += Valor - importeMN = importeMovimiento * tipoCambioActual * Multiplicador - End If + ' importeMovimiento += Valor + ' importeMN = importeMovimiento * tipoCambioActual * Multiplicador + 'End If Dim ConceptoContabilizacionNC = 225 Dim CveMovimientoDevolucion As Integer = -1 @@ -6860,7 +6869,7 @@ Partial Class Compras_Compras CveMovimientoDevolucion = Devolucion.CveMovimiento End If - If ObjConta.GetRetCuenta(ConceptoContabilizacionNC, UsuarioActual.CveEmpresa) Then + If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso ObjConta.GetRetCuenta(ConceptoContabilizacionNC, UsuarioActual.CveEmpresa) Then If ObjConta.DtResultados.Rows.Count > 0 Then IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero End If @@ -6916,8 +6925,6 @@ Partial Class Compras_Compras End If Next - - 'la diferencia se va aplicar sobre los 'Dim diferenciaTransito As Decimal = ImporteTransito - importeMN.RoundSQL @@ -6967,12 +6974,9 @@ Partial Class Compras_Compras End If End If - - End If End If - If UsuarioActual.CveEmpresa.Contiene(119) Then Dim ContienePSNeteoBonif As Boolean = False For Each Dr As DataRow In TmpDT.Rows @@ -7084,7 +7088,7 @@ Partial Class Compras_Compras 'CLASIFICACION If Row2("CveClasificacion").ToString.ToEntero > 0 AndAlso DdlTipoComprobante.SelectedValue = "Fac" Then - If ObjConta.GetRetCuenta(6, Row2("CveClasificacion").ToString.ToEntero, CveSubProyecto:=Row2("CveSubProyecto").ToString.ToEntero) Then + If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso ObjConta.GetRetCuenta(6, Row2("CveClasificacion").ToString.ToEntero, CveSubProyecto:=Row2("CveSubProyecto").ToString.ToEntero) Then If ObjConta.DtResultados.Rows.Count > 0 AndAlso ObjConta.DtResultados.Rows(0)("IdCuentaGasto").ToString.ToEntero > 0 Then IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaGasto").ToString.ToEntero Else @@ -7150,15 +7154,11 @@ Partial Class Compras_Compras End If - - End If - Next End If End If - 'LIMPIA importeMovimiento = 0 IdCtaContable = 0 @@ -7199,16 +7199,11 @@ Partial Class Compras_Compras End If End If - 'If CveCompraRefacturacion > 0 Then - ' importeMovimiento = 0 - ' importeMN = 0 - ' End If - - Case 59 'Documentos importeMovimiento = importeCreditos importeMN = importeMovimiento * tipoCambioActual * Multiplicador - If ObjConta.GetRetCuenta(ConceptoContable, CveProveedor) Then + + If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso ObjConta.GetRetCuenta(ConceptoContable, CveProveedor) Then If ObjConta.DtResultados.Rows.Count > 0 Then If ObjConta.DtResultados.Rows.Count > 0 Then IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero @@ -7356,8 +7351,6 @@ Partial Class Compras_Compras End If End If - - 'ObjConta.PrePolizaUnificacion(CvePrePoliza, CvePrePolizaTemp) End If Next @@ -7393,7 +7386,8 @@ Partial Class Compras_Compras Case 29 'Funcionarios y Empleados importeMovimiento = importeFE importeMN = importeMovimiento * tipoCambioActual * Multiplicador - If ObjConta.GetRetCuenta(ConceptoContable, CvePersonal) Then + + If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso ObjConta.GetRetCuenta(ConceptoContable, CvePersonal) Then If ObjConta.DtResultados.Rows.Count > 0 Then IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCtaContPersonal").ToString.ToEntero End If @@ -7409,12 +7403,12 @@ Partial Class Compras_Compras Dim PorcentajeImpuestoAnticipo = PorcentajeIVA CtaIvaxAcreditar = If(IdCtaIVAXAcreditar > 0, IdCtaIVAXAcreditar, 0) CtaIvaAcreditable = If(IdCtaIVAAcreditable > 0, IdCtaIVAAcreditable, 0) - If ObjConta.GetRetCuenta(14, UsuarioActual.CveEmpresa) And Not CtaIvaxAcreditar > 0 Then + If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso ObjConta.GetRetCuenta(14, UsuarioActual.CveEmpresa) And Not CtaIvaxAcreditar > 0 Then If ObjConta.DtResultados.Rows.Count > 0 Then CtaIvaxAcreditar = ObjConta.DtResultados.Rows(0)("IdCuentaIVAxAcreditar").ToString.ToEntero End If End If - If ObjConta.GetRetCuenta(19, UsuarioActual.CveEmpresa) And Not CtaIvaAcreditable > 0 Then + If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso ObjConta.GetRetCuenta(19, UsuarioActual.CveEmpresa) And Not CtaIvaAcreditable > 0 Then If ObjConta.DtResultados.Rows.Count > 0 Then CtaIvaAcreditable = ObjConta.DtResultados.Rows(0)("IdCuentaIVAAcreditable").ToString.ToEntero End If @@ -7707,12 +7701,8 @@ Partial Class Compras_Compras End If End If End If - - End If - - '** PRUEBA CUANDO SE AMORTIZA NC ANTES DE QUE SE REGISTRE NO DEBE TENER CONCEPTO 19 ** JM 01/06/2017 SE HIZO ESTO PARA LA FACTURA HRFA-8012831 DE VIGILANCIA '[IPP] NC NO DEBE REGISTRAR IMPUESTOS EN AMORTIZACIÓN 27/Agosto/2018 Dim tConceptoContable As Integer @@ -8418,8 +8408,6 @@ Partial Class Compras_Compras End If - - 'VALIDAR ERRORES If ErrorAC OrElse ErrorPrepoliza OrElse ErrorPrepolizaDescuadre OrElse ErrorDetalles OrElse ErrorMovDev OrElse ErrorMovtosCxP OrElse ErrorMovtosRetIVA OrElse ErrorMovtosRetISR OrElse ErrorMovtosEstimaciones OrElse ErrorMovtosIE OrElse ErrorMovtosIVA OrElse ErrorMovInv OrElse TieneError OrElse ErrorAF OrElse ErrorOC OrElse ErrorBitacora OrElse ErrorAddAcarreos OrElse ErrorCreditosCompra Then If ErrorDetalles Then @@ -8491,8 +8479,6 @@ Partial Class Compras_Compras MsgAccionAceptar = "location.href =""Compras.aspx""" End If - - 'CUANDO ES REEMBOLSO COMPROBACION Y CAJA CHICA If UsuarioActual.CveEmpresa.Contiene(1, 119, 141) AndAlso TxtNumeroReembolso.Text.Trim <> "" AndAlso (DdlPersonalReembolso.SelectedValue.ToEntero > 0 Or DdlCuentaCajaChicaReembolso.SelectedValue.ToEntero > 0) Then If ObjCompras.GetComprobacion(DdlPersonalReembolso.SelectedValue.ToEntero, DdlCuentaCajaChicaReembolso.SelectedValue.ToEntero, TxtNumeroReembolso.Text.Trim, UsuarioActual.CveEmpresa) Then @@ -8517,8 +8503,6 @@ Partial Class Compras_Compras End If - - 'AJUSTA POLIZA If IdPoliza > 0 Then PolizaFolio = ObjContaAC.Folio @@ -8540,6 +8524,11 @@ Partial Class Compras_Compras Msg.AppendFormat($"
Recibir mercancía de entrega directa.") End If + If Not TieneError AndAlso Not ObjConta.PrePolizaSimplificacion(CvePrePoliza, UsuarioActual.CveEmpresa) Then + TieneError = True + Alert("No se pudo simplificar los movimientos", TipoMensaje.MsgError) + End If + If Not TieneError Then ObjCompras.Commit() If ObjContaAC IsNot Nothing Then ObjContaAC.Commit() @@ -8859,6 +8848,8 @@ Partial Class Compras_Compras Private Sub GuardaAnticipos(ByRef ObjComprasParametro As ClsCompras, ByRef ObjContaParametro As ClsContabilidad) + + Dim CveSubProyectoAnticipo As Integer = TmpDT.FiltroPrimeroValor("CveSubProyecto", "CveSubProyecto > 0").ToEntero 'SI YA VIENE LOS OBJETOS DE CLASE TOMA LOS DE PARAMETROS Dim ObjCompra As ClsCompras Dim ObjConta As ClsContabilidad @@ -8971,11 +8962,14 @@ Partial Class Compras_Compras Dim TipoMovimiento As Boolean = If(Row("TipoMovto").ToString = "True", True, False) ImporteMovimiento = 0 IdCtaContable = 0 - Dim Concepto As String = String.Format("{0}-{1}", TxtSerie.Text, TxtFolio.Text) + + + + Dim Concepto As String = String.Format("{0} F:{1}-{2}", HplProveedor.Text, TxtSerie.Text, TxtFolio.Text) Dim importeMN As Decimal = 0 Dim Multiplicador As Integer = If(Row("Multiplicador").ToString.ToEntero = 1, 1, -1) Dim PorcentajeImpuesto As Decimal = 0 - Dim ConceptoPartida As String = String.Format("{0}-{1}", TxtSerie.Text, TxtFolio.Text) + Dim ConceptoPartida As String = String.Format("{0} F:{1}-{2}", HplProveedor.Text, TxtSerie.Text, TxtFolio.Text) Select Case ConceptoContable @@ -8995,10 +8989,10 @@ Partial Class Compras_Compras If DdlMoneda.SelectedValue.ToEntero <> 1 Then IdCtaContable = CtaProveedorAnticiposExtranjera - If ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, ImporteMovimiento, "", ConceptoContable, "", Fecha, IdCtaContable, -1, CveCompra:=CveCompraNC, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=ImporteMovimiento, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=ImporteMovimiento, TipoCambio:=tipoCambioNC, CveCompraAmortizacion:=CveCompra) Then + If ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, ImporteMovimiento, ConceptoPartida, ConceptoContable, "", Fecha, IdCtaContable, -1, CveCompra:=CveCompraNC, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=ImporteMovimiento, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=ImporteMovimiento, TipoCambio:=tipoCambioNC, CveCompraAmortizacion:=CveCompra, CveSubProyecto:=CveSubProyectoAnticipo) Then IdCtaContable = CtaProveedorAnticiposComplementaria - If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, importeMN - ImporteMovimiento, "", 266, "", Fecha, IdCtaContable, -1, CveCompra:=CveCompraNC, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=importeMN - ImporteMovimiento, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=ImporteMovimiento, TipoCambio:=tipoCambioNC, CveCompraAmortizacion:=CveCompra) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, importeMN - ImporteMovimiento, ConceptoPartida, 266, "", Fecha, IdCtaContable, -1, CveCompra:=CveCompraNC, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=importeMN - ImporteMovimiento, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=ImporteMovimiento, TipoCambio:=tipoCambioNC, CveCompraAmortizacion:=CveCompra, CveSubProyecto:=CveSubProyectoAnticipo) Then ErrorMovtosCxP = 1 Exit Select End If @@ -9011,7 +9005,7 @@ Partial Class Compras_Compras IdCtaContable = CtaProveedorAnticipos If ImporteMovimiento <> 0 Then PorcentajePago = ImporteMovimiento / TxtTotal.Text.ToDecimal - If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, ImporteMovimiento, "", ConceptoContable, "", Fecha, IdCtaContable, -1, CveCompra:=CveCompraNC, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=importeMN, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=If(tipoCambio = 1, 0, ImporteMovimiento), CveCompraAmortizacion:=CveCompra) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, ImporteMovimiento, ConceptoPartida, ConceptoContable, "", Fecha, IdCtaContable, -1, CveCompra:=CveCompraNC, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=importeMN, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=If(tipoCambio = 1, 0, ImporteMovimiento), CveCompraAmortizacion:=CveCompra, CveSubProyecto:=CveSubProyectoAnticipo) Then ErrorMovtosCxP = 1 End If End If @@ -9035,9 +9029,9 @@ Partial Class Compras_Compras If DdlMoneda.SelectedValue.ToEntero <> 1 Then IdCtaContable = CtaProveedorExtranjera - If ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, ImporteMovimiento, ConceptoPartida, ConceptoContable, ConceptoPartida, Fecha, IdCtaContable, -1, CveCompra:=CveCompraNC, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=ImporteMovimiento, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=ImporteMovimiento, TipoCambio:=tipoCambioNC, CveCompraAmortizacion:=CveCompra) Then + If ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, ImporteMovimiento, ConceptoPartida, ConceptoContable, ConceptoPartida, Fecha, IdCtaContable, -1, CveCompra:=CveCompraNC, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=ImporteMovimiento, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=ImporteMovimiento, TipoCambio:=tipoCambioNC, CveCompraAmortizacion:=CveCompra, CveSubProyecto:=CveSubProyectoAnticipo) Then IdCtaContable = CtaProveedorComplementaria - If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, importeMN - ImporteMovimiento, ConceptoPartida, 235, ConceptoPartida, Fecha, IdCtaContable, -1, CveCompra:=CveCompraNC, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=importeMN - ImporteMovimiento, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=ImporteMovimiento, TipoCambio:=tipoCambioNC, CveCompraAmortizacion:=CveCompra) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, importeMN - ImporteMovimiento, ConceptoPartida, 235, ConceptoPartida, Fecha, IdCtaContable, -1, CveCompra:=CveCompraNC, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=importeMN - ImporteMovimiento, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=ImporteMovimiento, TipoCambio:=tipoCambioNC, CveCompraAmortizacion:=CveCompra, CveSubProyecto:=CveSubProyectoAnticipo) Then ErrorMovtosCxP = 1 Exit Select End If @@ -9049,7 +9043,7 @@ Partial Class Compras_Compras IdCtaContable = CtaProveedor If ImporteMovimiento <> 0 Then PorcentajePago = ImporteMovimiento / TxtTotal.Text.ToDecimal - If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, ImporteMovimiento, ConceptoPartida, ConceptoContable, ConceptoPartida, Fecha, IdCtaContable, -1, CveCompra:=CveCompraNC, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=importeMN, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=If(tipoCambio = 1, 0, ImporteMovimiento), CveCompraAmortizacion:=CveCompra) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, ImporteMovimiento, ConceptoPartida, ConceptoContable, ConceptoPartida, Fecha, IdCtaContable, -1, CveCompra:=CveCompraNC, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=importeMN, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=If(tipoCambio = 1, 0, ImporteMovimiento), CveCompraAmortizacion:=CveCompra, CveSubProyecto:=CveSubProyectoAnticipo) Then ErrorMovtosCxP = 1 End If End If @@ -9087,7 +9081,7 @@ Partial Class Compras_Compras If usacomplementariaAnticipo Then IdCtaContable = CtaProveedorAnticiposComplementaria ImporteAntMN = TipoCambioAnt * ImporteAnt - ImporteAnt - If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, ImporteAnt, "", 266, ConceptoPartida, Fecha, IdCtaContable, -1, CveCompra:=CveCompra, CveCompraAmortizacion:=CveCompraNC, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, ImporteMX:=ImporteAntMN, ImporteME:=ImporteAnt, TipoCambio:=TipoCambioAnt) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, ImporteAnt, ConceptoPartida, 266, ConceptoPartida, Fecha, IdCtaContable, -1, CveCompra:=CveCompra, CveCompraAmortizacion:=CveCompraNC, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, ImporteMX:=ImporteAntMN, ImporteME:=ImporteAnt, TipoCambio:=TipoCambioAnt, CveSubProyecto:=CveSubProyectoAnticipo) Then ErrorMovtosCxP = 1 End If ImporteAntMN = ImporteAnt @@ -9097,7 +9091,7 @@ Partial Class Compras_Compras IdCtaContable = CtaProveedorAnticiposExtranjera End If - If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, ImporteAnt, "", ConceptoContable, ConceptoPartida, Fecha, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=ImporteAntMN, CvePrePolizaOriginal:=CvePrePolizaNueva, ImporteME:=If(tipoCambio = 1, 0, ImporteAnt), CveCompraAmortizacion:=CveCompraNC) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, ImporteAnt, ConceptoPartida, ConceptoContable, ConceptoPartida, Fecha, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=ImporteAntMN, CvePrePolizaOriginal:=CvePrePolizaNueva, ImporteME:=If(tipoCambio = 1, 0, ImporteAnt), CveCompraAmortizacion:=CveCompraNC, CveSubProyecto:=CveSubProyectoAnticipo) Then ErrorMovtosCxP = 1 End If @@ -9146,7 +9140,7 @@ Partial Class Compras_Compras If ImporteMovimiento <> 0 Then PorcentajePago = ImporteMovimiento / TxtTotal.Text.ToDecimal - If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, ImporteMovimiento, "", ConceptoContable, "", Fecha, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=ImporteMovimiento * tipoCambio, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=If(tipoCambio = 1, 0, ImporteMovimiento), CveCompraAmortizacion:=CveCompraNC) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, ImporteMovimiento, "", ConceptoContable, "", Fecha, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=ImporteMovimiento * tipoCambio, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=If(tipoCambio = 1, 0, ImporteMovimiento), CveCompraAmortizacion:=CveCompraNC, CveSubProyecto:=CveSubProyectoAnticipo) Then ErrorMovtosCxP = 1 End If End If @@ -9180,13 +9174,13 @@ Partial Class Compras_Compras If DdlMoneda.SelectedValue.ToEntero <> 1 Then IdCtaContable = CtaProveedorExtranjera - If ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, ImporteMovimiento, Concepto, ConceptoContable, Concepto, Fecha, IdCtaContable, -1, CveCompra:=CveCompra, CveCompraAmortizacion:=CveCompraNC, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=ImporteMovimiento, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=ImporteMovimiento, TipoCambio:=TipoCambio17) Then + If ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, ImporteMovimiento, Concepto, ConceptoContable, Concepto, Fecha, IdCtaContable, -1, CveCompra:=CveCompra, CveCompraAmortizacion:=CveCompraNC, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=ImporteMovimiento, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=ImporteMovimiento, TipoCambio:=TipoCambio17, CveSubProyecto:=CveSubProyectoAnticipo) Then Dim CveConceptoContableComplementaria As Integer = 206 If CveTipoConcepto = 2 Then CveConceptoContableComplementaria = 310 'cuando es acreedor IdCtaContable = CtaProveedorComplementaria - If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, importeMN - ImporteMovimiento, Concepto, CveConceptoContableComplementaria, Concepto, Fecha, IdCtaContable, -1, CveCompra:=CveCompra, CveCompraAmortizacion:=CveCompraNC, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=importeMN - ImporteMovimiento, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=ImporteMovimiento, TipoCambio:=TipoCambio17) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, importeMN - ImporteMovimiento, Concepto, CveConceptoContableComplementaria, Concepto, Fecha, IdCtaContable, -1, CveCompra:=CveCompra, CveCompraAmortizacion:=CveCompraNC, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=importeMN - ImporteMovimiento, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=ImporteMovimiento, TipoCambio:=TipoCambio17, CveSubProyecto:=CveSubProyectoAnticipo) Then ErrorMovtosCxP = 1 Exit Select End If @@ -9197,7 +9191,7 @@ Partial Class Compras_Compras Else IdCtaContable = CtaProveedor If ImporteMovimiento <> 0 Then - If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, ImporteMovimiento, Concepto, ConceptoContable, Concepto, Fecha, IdCtaContable, -1, CveCompra:=CveCompra, CveCompraAmortizacion:=CveCompraNC, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=importeMN, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=If(TipoCambio17 = 1, 0, ImporteMovimiento)) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, ImporteMovimiento, Concepto, ConceptoContable, Concepto, Fecha, IdCtaContable, -1, CveCompra:=CveCompra, CveCompraAmortizacion:=CveCompraNC, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=importeMN, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=If(TipoCambio17 = 1, 0, ImporteMovimiento), CveSubProyecto:=CveSubProyectoAnticipo) Then ErrorMovtosCxP = 1 Exit For End If @@ -9211,18 +9205,16 @@ Partial Class Compras_Compras If UsuarioActual.Empresa.Funcionalidad(521) = "1" Then If sumaAmortizacion = CompraSaldo Then ImporteMovimiento = TxtIVA.Text.ToDecimal - If ImporteMovimiento > 0 Then IVACompleto = True End If - Else ImporteMovimiento = 0 End If Else ImporteMovimiento = Math.Round(PorcentajePago * TxtIVA.Text.ToDecimal, 2) End If - importeMN = ImporteMovimiento * tipoCambio + importeMN = ImporteMovimiento * tipoCambioNC PorcentajeImpuesto = TmpDT.MAX("IVAPorcentaje").ToDecimal IdCtaContable = If(IdCtaIVAXAcreditar > 0, IdCtaIVAXAcreditar, 0) @@ -9236,31 +9228,6 @@ Partial Class Compras_Compras End If End If End If - 'Case 287 'Iva X Acreditar importacion - ' If Not gvr.DataKey("TipoDocto").Contiene("NC", "DEV", "Ant") AndAlso chkImportacion.checked Then - ' If UsuarioActual.Empresa.Funcionalidad(521) = "1" Then - ' If sumaAmortizacion = CompraSaldo Then - ' ImporteMovimiento = TxtIVA.Text.ToDecimal - - ' If ImporteMovimiento > 0 Then - ' IVACompleto = True - ' End If - - ' Else - ' ImporteMovimiento = 0 - ' End If - ' Else - ' ImporteMovimiento = Math.Round(PorcentajePago * TxtIVA.Text.ToDecimal, 2) - ' End If - ' importeMN = ImporteMovimiento * tipoCambio - ' PorcentajeImpuesto = TmpDT.MAX("IVAPorcentaje").ToDecimal - ' IdCtaContable = If(IdCtaIVAXAcreditar > 0, IdCtaIVAXAcreditar, 0) - ' If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then - ' If ObjConta.DtResultados.Rows.Count > 0 Then - ' IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaIVAxAcreditar").ToString.ToEntero - ' End If - ' End If - ' End If Case 19 'Iva Acreditado @@ -9275,7 +9242,7 @@ Partial Class Compras_Compras Else ImporteMovimiento = Math.Round(PorcentajePago * TxtIVA.Text.ToDecimal, 2) End If - importeMN = ImporteMovimiento * tipoCambio + importeMN = ImporteMovimiento * tipoCambioNC PorcentajeImpuesto = TmpDT.MAX("IVAPorcentaje").ToDecimal IdCtaContable = If(IdCtaIVAAcreditable > 0, IdCtaIVAAcreditable, 0) @@ -9290,80 +9257,37 @@ Partial Class Compras_Compras End If Case 15 'RetIVA x Acreditar Honorarios/Serv. Prof. If Not gvr.DataKey("TipoDocto").Contiene("NC", "DEV", "Ant") Then + 'If Not gvr.DataKey("TipoDocto").Contiene("NC", "DEV") Then If DdlRetIVAConcepto.Items.Count > 0 Then - If DdlRetIVAConcepto.SelectedValue.ToEntero = 1 Then - ImporteMovimiento = Math.Round(PorcentajePago * TxtRetIVA.Text.ToDecimal, 2) - importeMN = ImporteMovimiento * tipoCambio - If CtaProveedorRetIVA > 0 Then - IdCtaContable = CtaProveedorRetIVA - ElseIf UsuarioActual.Empresa.Funcionalidad(307).ToEntero > 0 Then - IdCtaContable = UsuarioActual.Empresa.Funcionalidad(307).ToEntero - Else - If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then - If ObjConta.DtResultados.Rows.Count > 0 Then - IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero - End If - End If - End If - End If - End If - End If - Case 22 'RetIVA Acreditable Honorarios/Serv. Prof. - If Not gvr.DataKey("TipoDocto").Contiene("NC", "DEV", "Ant") Then - If DdlRetIVAConcepto.Items.Count > 0 AndAlso DdlRetIVAConcepto.SelectedValue.ToEntero > 0 Then + TipoMovimiento = If(TipoMovimiento, False, True) Dim Funcionalidad As Integer = 0 - If DdlRetIVAConcepto.SelectedValue.ToEntero = 1 Then + If CveRetIVAConceptoOriginal = 1 Then Funcionalidad = 307 - ElseIf DdlRetIVAConcepto.SelectedValue.ToEntero = 2 Then - Funcionalidad = 310 - ElseIf DdlRetIVAConcepto.SelectedValue.ToEntero = 3 Then - Funcionalidad = 312 - ElseIf DdlRetIVAConcepto.SelectedValue.ToEntero = 4 Then - Funcionalidad = 314 - ElseIf DdlRetIVAConcepto.SelectedValue.ToEntero = 5 Then + ConceptoContable = 15 + ElseIf CveRetIVAConceptoOriginal = 2 Then + Funcionalidad = 309 + ConceptoContable = 183 + ElseIf CveRetIVAConceptoOriginal = 3 Then + Funcionalidad = 311 + ConceptoContable = 185 + ElseIf CveRetIVAConceptoOriginal = 4 Then + Funcionalidad = 313 + ConceptoContable = 248 + ElseIf CveRetIVAConceptoOriginal = 5 Then Funcionalidad = 578 + ConceptoContable = 285 End If ImporteMovimiento = Math.Round(PorcentajePago * TxtRetIVA.Text.ToDecimal, 2) importeMN = ImporteMovimiento * tipoCambio + If tipoCambio > 1 Then Concepto += $" TC{tipoCambio} ${ImporteMovimiento.FormatoNumero(2)}" - If CtaProveedorRetIVA > 0 Then - IdCtaContable = CtaProveedorRetIVA - ElseIf UsuarioActual.Empresa.Funcionalidad(Funcionalidad).ToEntero > 0 Then - IdCtaContable = UsuarioActual.Empresa.Funcionalidad(Funcionalidad).ToEntero - Else - If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then - If ObjConta.DtResultados.Rows.Count > 0 Then - IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero - End If - End If - End If - - - 'If UsuarioActual.Empresa.Funcionalidad(577).ToEntero = 1 Then - ' IdCtaContable = UsuarioActual.Empresa.Funcionalidad(578).ToEntero - 'End If - - 'If DdlRetIVAConcepto.SelectedValue.ToEntero = 5 Then - ' IdCtaContable = UsuarioActual.Empresa.Funcionalidad(578).ToEntero - 'End If - - End If - End If - - - - Case 183 'RetIVA x Acreditar Fletes P.F. - If Not gvr.DataKey("TipoDocto").Contiene("NC", "DEV", "Ant") Then - If DdlRetIVAConcepto.Items.Count > 0 Then - If DdlRetIVAConcepto.SelectedValue.ToEntero = 2 Then - ImporteMovimiento = Math.Round(PorcentajePago * TxtRetIVA.Text.ToDecimal, 2) - importeMN = ImporteMovimiento * tipoCambio + If UsuarioActual.Empresa.TipoContabilidad = 2 Then If CtaProveedorRetIVA > 0 Then IdCtaContable = CtaProveedorRetIVA - ElseIf UsuarioActual.Empresa.Funcionalidad(309).ToEntero > 0 Then - IdCtaContable = UsuarioActual.Empresa.Funcionalidad(309).ToEntero + ElseIf UsuarioActual.Empresa.Funcionalidad(Funcionalidad).ToEntero > 0 Then + IdCtaContable = UsuarioActual.Empresa.Funcionalidad(Funcionalidad).ToEntero Else If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then If ObjConta.DtResultados.Rows.Count > 0 Then @@ -9372,185 +9296,179 @@ Partial Class Compras_Compras End If End If End If + + End If + End If + Case 22 'RetIVA Acreditable Honorarios/Serv. Prof. + If Not gvr.DataKey("TipoDocto").Contiene("NC", "DEV", "Ant") Then + 'If Not gvr.DataKey("TipoDocto").Contiene("NC", "DEV") Then + If DdlRetIVAConcepto.Items.Count > 0 AndAlso DdlRetIVAConcepto.SelectedValue.ToEntero > 0 Then + + + TipoMovimiento = If(TipoMovimiento, False, True) + + Dim Funcionalidad As Integer = 0 + Dim ConceptoContableContra As Integer = 0 + + If CveRetIVAConceptoOriginal = 1 Then + Funcionalidad = 308 + ConceptoContable = 22 + ConceptoContableContra = 15 + ElseIf CveRetIVAConceptoOriginal = 2 Then + Funcionalidad = 310 + ConceptoContable = 184 + ConceptoContableContra = 183 + + ElseIf CveRetIVAConceptoOriginal = 3 Then + Funcionalidad = 312 + ConceptoContable = 186 + ConceptoContableContra = 185 + + ElseIf CveRetIVAConceptoOriginal = 4 Then + Funcionalidad = 314 + ConceptoContable = 249 + ConceptoContableContra = 248 + + ElseIf CveRetIVAConceptoOriginal = 5 Then + Funcionalidad = 578 + ConceptoContable = 286 + ConceptoContableContra = 285 + + End If + + ImporteMovimiento = Math.Round(PorcentajePago * TxtRetIVA.Text.ToDecimal, 2) + importeMN = ImporteMovimiento * tipoCambioNC + + + If UsuarioActual.Empresa.TipoContabilidad = 2 Then + If CtaProveedorRetIVA > 0 Then + IdCtaContable = CtaProveedorRetIVA + ElseIf UsuarioActual.Empresa.Funcionalidad(Funcionalidad).ToEntero > 0 Then + IdCtaContable = UsuarioActual.Empresa.Funcionalidad(Funcionalidad).ToEntero + Else + If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then + If ObjConta.DtResultados.Rows.Count > 0 Then + IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero + End If + End If + End If + End If + + If tipoCambio > 1 Then Concepto += $" TC{tipoCambio} ${ImporteMovimiento.FormatoNumero(2)}" + 'Agregamos el Opuesto del 22 -> 15 + If ImporteMovimiento <> 0 Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, ImporteMovimiento, Concepto, ConceptoContableContra, Concepto + If(tipoCambio > 1, $" TC {tipoCambio} ${ImporteMovimiento.FormatoNumero(2)}", ""), Fecha, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveAcreedor:=-1, CveIE:=CveIE, CvePersonal:=CvePersonal, CveColectiva:=-1, CveCreditoDetalle:=-1, ImporteMX:=ImporteMovimiento * tipoCambio, ImporteME:=If(tipoCambio = 1, 0, ImporteMovimiento), Contabilizable:=True, TipoCambio:=tipoCambio, CveSubProyecto:=CveSubProyectoAnticipo) Then + ErrorMovtosCxP = 1 + Exit For + End If + End If + End If End If - Case 184 'RetIVA Acreditable Fletes P.F. - If Not gvr.DataKey("TipoDocto").Contiene("NC", "DEV", "Ant") Then - If DdlRetIVAConcepto.Items.Count > 0 Then - If DdlRetIVAConcepto.SelectedValue.ToEntero = 2 Then - ImporteMovimiento = Math.Round(PorcentajePago * TxtRetIVA.Text.ToDecimal, 2) - importeMN = ImporteMovimiento * tipoCambio - If CtaProveedorRetIVA > 0 Then - IdCtaContable = CtaProveedorRetIVA - ElseIf UsuarioActual.Empresa.Funcionalidad(310).ToEntero > 0 Then - IdCtaContable = UsuarioActual.Empresa.Funcionalidad(310).ToEntero - Else - If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then - If ObjConta.DtResultados.Rows.Count > 0 Then - IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero - End If - End If - End If - End If - End If - End If - Case 185 'RetIVA x Acreditar Fletes P.M. - If Not gvr.DataKey("TipoDocto").Contiene("NC", "DEV", "Ant") Then - If DdlRetIVAConcepto.Items.Count > 0 Then - If DdlRetIVAConcepto.SelectedValue.ToEntero = 3 Then - ImporteMovimiento = Math.Round(PorcentajePago * TxtRetIVA.Text.ToDecimal, 2) - importeMN = ImporteMovimiento * tipoCambio - If CtaProveedorRetIVA > 0 Then - IdCtaContable = CtaProveedorRetIVA - ElseIf UsuarioActual.Empresa.Funcionalidad(311).ToEntero > 0 Then - IdCtaContable = UsuarioActual.Empresa.Funcionalidad(311).ToEntero - Else - If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then - If ObjConta.DtResultados.Rows.Count > 0 Then - IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero - End If - End If - End If - End If - End If - End If - Case 186 'RetIVA Acreditable Fletes P.M. - If Not gvr.DataKey("TipoDocto").Contiene("NC", "DEV", "Ant") Then - If DdlRetIVAConcepto.Items.Count > 0 Then - If DdlRetIVAConcepto.SelectedValue.ToEntero = 3 Then - ImporteMovimiento = Math.Round(PorcentajePago * TxtRetIVA.Text.ToDecimal, 2) - importeMN = ImporteMovimiento * tipoCambio - If CtaProveedorRetIVA > 0 Then - IdCtaContable = CtaProveedorRetIVA - ElseIf UsuarioActual.Empresa.Funcionalidad(312).ToEntero > 0 Then - IdCtaContable = UsuarioActual.Empresa.Funcionalidad(312).ToEntero - Else - If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then - If ObjConta.DtResultados.Rows.Count > 0 Then - IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero - End If - End If - End If - End If - End If - End If - Case 248 'RetIVA x Acreditar Arrendamiento - If Not gvr.DataKey("TipoDocto").Contiene("NC", "DEV", "Ant") Then - If DdlRetIVAConcepto.Items.Count > 0 Then - If DdlRetIVAConcepto.SelectedValue.ToEntero = 4 Then - ImporteMovimiento = Math.Round(PorcentajePago * TxtRetIVA.Text.ToDecimal, 2) - importeMN = ImporteMovimiento * tipoCambio - If CtaProveedorRetIVA > 0 Then - IdCtaContable = CtaProveedorRetIVA - ElseIf UsuarioActual.Empresa.Funcionalidad(313).ToEntero > 0 Then - IdCtaContable = UsuarioActual.Empresa.Funcionalidad(313).ToEntero - Else - If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then - If ObjConta.DtResultados.Rows.Count > 0 Then - IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero - End If - End If - End If - End If - End If - End If - - Case 249 'RetIVA Acreditable Arrendamiento - If Not gvr.DataKey("TipoDocto").Contiene("NC", "DEV", "Ant") Then - If DdlRetIVAConcepto.Items.Count > 0 Then - If DdlRetIVAConcepto.SelectedValue.ToEntero = 4 Then - ImporteMovimiento = Math.Round(PorcentajePago * TxtRetIVA.Text.ToDecimal, 2) - importeMN = ImporteMovimiento * tipoCambio - If CtaProveedorRetIVA > 0 Then - IdCtaContable = CtaProveedorRetIVA - ElseIf UsuarioActual.Empresa.Funcionalidad(314).ToEntero > 0 Then - IdCtaContable = UsuarioActual.Empresa.Funcionalidad(314).ToEntero - Else - If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then - If ObjConta.DtResultados.Rows.Count > 0 Then - IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero - End If - End If - End If - End If - End If - End If Case 16 'RetISR x Acreditar If Not gvr.DataKey("TipoDocto").Contiene("NC", "DEV", "Ant") Then - If DdlRetISRConcepto.Items.Count > 0 AndAlso DdlRetISRConcepto.SelectedValue.ToEntero = 1 Then + 'If Not gvr.DataKey("TipoDocto").Contiene("NC", "DEV") Then + If DdlRetISRConcepto.Items.Count > 0 AndAlso DdlRetISRConcepto.SelectedValue.ToEntero > 0 Then + + TipoMovimiento = If(TipoMovimiento, False, True) + + Dim funcionalidad As Integer = 0 + If DdlRetISRConcepto.SelectedValue.ToEntero = 1 Then + funcionalidad = 315 + ConceptoContable = 16 + ElseIf DdlRetISRConcepto.SelectedValue.ToEntero = 2 Then + funcionalidad = 317 + ConceptoContable = 243 + ElseIf DdlRetISRConcepto.SelectedValue.ToEntero = 3 Then + funcionalidad = 348 + ConceptoContable = 327 + End If ImporteMovimiento = Math.Round(PorcentajePago * TxtRetISR.Text.ToDecimal, 2) importeMN = ImporteMovimiento * tipoCambio - If CtaProveedorRetISR > 0 Then - IdCtaContable = CtaProveedorRetISR - ElseIf UsuarioActual.Empresa.Funcionalidad(315).ToEntero > 0 Then - IdCtaContable = UsuarioActual.Empresa.Funcionalidad(315).ToEntero - Else - If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then - If ObjConta.DtResultados.Rows.Count > 0 Then - IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero + If tipoCambio > 1 Then Concepto += $" TC{tipoCambio} ${ImporteMovimiento.FormatoNumero(2)}" + + + If UsuarioActual.Empresa.TipoContabilidad = 2 Then + If CtaProveedorRetISR > 0 Then + IdCtaContable = CtaProveedorRetISR + + ElseIf UsuarioActual.Empresa.Funcionalidad(funcionalidad).ToEntero > 0 Then + IdCtaContable = UsuarioActual.Empresa.Funcionalidad(funcionalidad).ToEntero + Else + If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then + If ObjConta.DtResultados.Rows.Count > 0 Then + IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero + End If End If End If End If + + End If End If Case 23 'RetISR Acreditable If Not gvr.DataKey("TipoDocto").Contiene("NC", "DEV", "Ant") Then - If DdlRetISRConcepto.Items.Count > 0 AndAlso DdlRetISRConcepto.SelectedValue.ToEntero = 1 Then + 'If Not gvr.DataKey("TipoDocto").Contiene("NC", "DEV") Then + If DdlRetISRConcepto.Items.Count > 0 AndAlso DdlRetISRConcepto.SelectedValue.ToEntero > 0 Then + + TipoMovimiento = If(TipoMovimiento, False, True) + + Dim funcionalidad As Integer = 0 + Dim ConceptoContableContra As Integer = 0 + + If CveRetISRConceptoOriginal = 1 Then + funcionalidad = 316 + ConceptoContable = 23 + ConceptoContableContra = 16 + ElseIf CveRetISRConceptoOriginal = 2 Then + funcionalidad = 318 + ConceptoContable = 244 + ConceptoContableContra = 243 + ElseIf CveRetISRConceptoOriginal = 3 Then + funcionalidad = 348 + ConceptoContable = 328 + ConceptoContableContra = 327 + End If + ImporteMovimiento = Math.Round(PorcentajePago * TxtRetISR.Text.ToDecimal, 2) - importeMN = ImporteMovimiento * tipoCambio - If CtaProveedorRetISR > 0 Then - IdCtaContable = CtaProveedorRetISR - ElseIf UsuarioActual.Empresa.Funcionalidad(316).ToEntero > 0 Then - IdCtaContable = UsuarioActual.Empresa.Funcionalidad(316).ToEntero - Else - If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then - If ObjConta.DtResultados.Rows.Count > 0 Then - IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero + importeMN = Math.Round(ImporteMovimiento, 2) * tipoCambio * Multiplicador + + If UsuarioActual.Empresa.TipoContabilidad = 2 Then + If CtaProveedorRetISR > 0 Then + IdCtaContable = CtaProveedorRetISR + ElseIf UsuarioActual.Empresa.Funcionalidad(funcionalidad).ToEntero > 0 Then + IdCtaContable = UsuarioActual.Empresa.Funcionalidad(funcionalidad).ToEntero + Else + If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then + If ObjConta.DtResultados.Rows.Count > 0 Then + IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero + End If End If End If End If - End If - End If - Case 243 'RetISR X Acreditar Terceros y Arrendamiento - If Not gvr.DataKey("TipoDocto").Contiene("NC", "DEV", "Ant") Then - If DdlRetISRConcepto.Items.Count > 0 AndAlso DdlRetISRConcepto.SelectedValue.ToEntero = 2 Then - ImporteMovimiento = Math.Round(PorcentajePago * TxtRetISR.Text.ToDecimal, 2) - importeMN = ImporteMovimiento * tipoCambio - If CtaProveedorRetISR > 0 Then - IdCtaContable = CtaProveedorRetISR - ElseIf UsuarioActual.Empresa.Funcionalidad(317).ToEntero > 0 Then - IdCtaContable = UsuarioActual.Empresa.Funcionalidad(317).ToEntero - Else - If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then - If ObjConta.DtResultados.Rows.Count > 0 Then - IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero - End If - End If - End If - End If - End If - Case 244 'RetISR Acreditable Terceros y Arrendamiento - If Not gvr.DataKey("TipoDocto").Contiene("NC", "DEV", "Ant") Then - If DdlRetISRConcepto.Items.Count > 0 AndAlso DdlRetISRConcepto.SelectedValue.ToEntero = 2 Then - ImporteMovimiento = Math.Round(PorcentajePago * TxtRetISR.Text.ToDecimal, 2) - importeMN = ImporteMovimiento * tipoCambio - If CtaProveedorRetISR > 0 Then - IdCtaContable = CtaProveedorRetISR - ElseIf UsuarioActual.Empresa.Funcionalidad(318).ToEntero > 0 Then - IdCtaContable = UsuarioActual.Empresa.Funcionalidad(318).ToEntero - Else - If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then - If ObjConta.DtResultados.Rows.Count > 0 Then - IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero - End If + + + If tipoCambio > 1 Then Concepto += $" TC{tipoCambio} ${ImporteMovimiento.FormatoNumero(2)}" + + 'Agregamos el Opuesto del 23 -> 16 + If ImporteMovimiento <> 0 Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, ImporteMovimiento, Concepto, ConceptoContableContra, Concepto + If(tipoCambio > 1, $" TC {tipoCambio} ${ImporteMovimiento.FormatoNumero(2)}", ""), Fecha, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=-1, CveAcreedor:=-1, CveIE:=CveIE, CvePersonal:=CvePersonal, CveColectiva:=-1, CveCreditoDetalle:=-1, ImporteMX:=ImporteMovimiento * tipoCambio, ImporteME:=If(tipoCambio = 1, 0, ImporteMovimiento), Contabilizable:=True, CveSubProyecto:=CveSubProyectoAnticipo) Then + ErrorMovtosCxP = 1 + Exit For End If End If + End If End If + + + + + Case 64 'GANANCIA If gvr.DataKey("TipoDocto").Contiene("NC", "DEV", "Ant") Then 'SOLO SE IMPLEMENTÓ PARA NC If DdlMoneda.SelectedValue.ToEntero <> 1 Or gvr.DataKey("CveMoneda").ToEntero <> 1 Then @@ -9563,9 +9481,6 @@ Partial Class Compras_Compras importeMN = ImporteMovimiento End If - - - If ImporteMovimiento <> 0 Then Dim CveSubProyecto64 As Integer = TmpDT.FiltroPrimeroValor("CveSubProyecto", " CveSubProyecto > 0").ToEntero @@ -9611,7 +9526,7 @@ Partial Class Compras_Compras End If - If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, ImporteMovimiento, Concepto, ConceptoContable, Concepto, Fecha, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=importeMN, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=If(tipoCambio = 1, 0, ImporteMovimiento), PorcentajeImpuesto:=PorcentajeImpuesto) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, ImporteMovimiento, Concepto, ConceptoContable, Concepto, Fecha, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=importeMN, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=If(tipoCambio = 1, 0, ImporteMovimiento), PorcentajeImpuesto:=PorcentajeImpuesto, TipoCambio:=tipoCambioNC, CveSubProyecto:=CveSubProyectoAnticipo) Then ErrorMovtosCxP = 1 Exit For End If @@ -9643,11 +9558,11 @@ Partial Class Compras_Compras If TxtIVA.Text.ToDecimal > 0 Then - If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, True, TxtIVA.Text.ToDecimal, "", 14, "", Fecha, IdCtaIVAXAcreditar, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=TxtIVA.Text.ToDecimal * tipoCambio, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=If(tipoCambio = 1, 0, TxtIVA.Text.ToDecimal), PorcentajeImpuesto:=PorcentajeImpuesto) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, True, TxtIVA.Text.ToDecimal, "", 14, "", Fecha, IdCtaIVAXAcreditar, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=TxtIVA.Text.ToDecimal * tipoCambio, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=If(tipoCambio = 1, 0, TxtIVA.Text.ToDecimal), PorcentajeImpuesto:=PorcentajeImpuesto, CveSubProyecto:=CveSubProyectoAnticipo) Then ErrorMovtosCxP = 1 End If - If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, False, TxtIVA.Text.ToDecimal, "", 19, "", Fecha, IdCtaIVAAcreditable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=TxtIVA.Text.ToDecimal * tipoCambio, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=If(tipoCambio = 1, 0, TxtIVA.Text.ToDecimal), PorcentajeImpuesto:=PorcentajeImpuesto) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, False, TxtIVA.Text.ToDecimal, "", 19, "", Fecha, IdCtaIVAAcreditable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=TxtIVA.Text.ToDecimal * tipoCambio, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=If(tipoCambio = 1, 0, TxtIVA.Text.ToDecimal), PorcentajeImpuesto:=PorcentajeImpuesto, CveSubProyecto:=CveSubProyectoAnticipo) Then ErrorMovtosCxP = 1 End If End If @@ -9747,13 +9662,13 @@ Partial Class Compras_Compras PorcentajePago = gvr.FCTextBox("TxtAnticipo").Text.ToDecimal / TxtTotal.Text.ToDecimal 'Se agrega la nota de credito - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimientoCompra, gvr.FCTextBox("TxtAnticipo").Text.ToDecimal, " ", CveConceptoCompra, " ", TxtFechaPago.Text.ToDate, 0, -1, CveCompra:=CveCompraNC, CveProveedor:=CveProveedor, CveIE:=CveIE, CveCompraAmortizacion:=CveCompraNC, ImporteMX:=gvr.FCTextBox("TxtAnticipo").Text.ToDecimal) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimientoCompra, gvr.FCTextBox("TxtAnticipo").Text.ToDecimal, " ", CveConceptoCompra, " ", TxtFechaPago.Text.ToDate, 0, -1, CveCompra:=CveCompraNC, CveProveedor:=CveProveedor, CveIE:=CveIE, CveCompraAmortizacion:=CveCompraNC, ImporteMX:=gvr.FCTextBox("TxtAnticipo").Text.ToDecimal, CveSubProyecto:=CveSubProyectoAnticipo) Then ErrorMovtosCxP = 1 Exit For End If 'movimiento de pago proveedor - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimientoCompra, gvr.FCTextBox("TxtAnticipo").Text.ToDecimal, " ", CveConceptoPago, " ", TxtFechaPago.Text.ToDate, 0, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveIE:=CveIE, CveCompraAmortizacion:=CveCompraNC, ImporteMX:=gvr.FCTextBox("TxtAnticipo").Text.ToDecimal) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimientoCompra, gvr.FCTextBox("TxtAnticipo").Text.ToDecimal, " ", CveConceptoPago, " ", TxtFechaPago.Text.ToDate, 0, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveIE:=CveIE, CveCompraAmortizacion:=CveCompraNC, ImporteMX:=gvr.FCTextBox("TxtAnticipo").Text.ToDecimal, CveSubProyecto:=CveSubProyectoAnticipo) Then ErrorMovtosCxP = 1 Exit For End If @@ -9762,27 +9677,27 @@ Partial Class Compras_Compras ImporteMovimiento = Math.Round(PorcentajePago * TxtIVA.Text.ToDecimal, 2) If ImporteMovimiento > 0 Then Dim PorcentajeImpuesto As Decimal = TmpDT.MAX("IVAPorcentaje").ToDecimal - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, " ", 14, " ", TxtFechaPago.Text.ToDate, IdCtaIVAXAcreditar, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=ImporteMovimiento, PorcentajeImpuesto:=PorcentajeImpuesto) Then ErrorMovtosCxP = 1 : Exit For + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, " ", 14, " ", TxtFechaPago.Text.ToDate, IdCtaIVAXAcreditar, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=ImporteMovimiento, PorcentajeImpuesto:=PorcentajeImpuesto, CveSubProyecto:=CveSubProyectoAnticipo) Then ErrorMovtosCxP = 1 : Exit For - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, " ", 19, " ", TxtFechaPago.Text.ToDate, IdCtaIVAAcreditable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=ImporteMovimiento, PorcentajeImpuesto:=PorcentajeImpuesto) Then ErrorMovtosCxP = 1 : Exit For + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, " ", 19, " ", TxtFechaPago.Text.ToDate, IdCtaIVAAcreditable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=ImporteMovimiento, PorcentajeImpuesto:=PorcentajeImpuesto, CveSubProyecto:=CveSubProyectoAnticipo) Then ErrorMovtosCxP = 1 : Exit For End If 'si tiene Ret iva y su proporcion ImporteMovimiento = Math.Round(PorcentajePago * TxtRetIVA.Text.ToDecimal, 2) If ImporteMovimiento > 0 Then - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, " ", 15, " ", TxtFechaPago.Text.ToDate, 0, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=ImporteMovimiento) Then ErrorMovtosCxP = 1 : Exit For + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, " ", 15, " ", TxtFechaPago.Text.ToDate, 0, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=ImporteMovimiento, CveSubProyecto:=CveSubProyectoAnticipo) Then ErrorMovtosCxP = 1 : Exit For - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, " ", 22, " ", TxtFechaPago.Text.ToDate, 0, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=ImporteMovimiento) Then ErrorMovtosCxP = 1 : Exit For + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, " ", 22, " ", TxtFechaPago.Text.ToDate, 0, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=ImporteMovimiento, CveSubProyecto:=CveSubProyectoAnticipo) Then ErrorMovtosCxP = 1 : Exit For End If 'si tiene Ret ISR y su proporcion ImporteMovimiento = Math.Round(PorcentajePago * TxtRetISR.Text.ToDecimal, 2) If ImporteMovimiento > 0 Then - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, " ", 16, " ", TxtFechaPago.Text.ToDate, 0, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=ImporteMovimiento) Then ErrorMovtosCxP = 1 : Exit For + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, " ", 16, " ", TxtFechaPago.Text.ToDate, 0, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=ImporteMovimiento, CveSubProyecto:=CveSubProyectoAnticipo) Then ErrorMovtosCxP = 1 : Exit For - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, " ", 23, " ", TxtFechaPago.Text.ToDate, 0, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=ImporteMovimiento) Then ErrorMovtosCxP = 1 : Exit For + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, " ", 23, " ", TxtFechaPago.Text.ToDate, 0, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=ImporteMovimiento, CveSubProyecto:=CveSubProyectoAnticipo) Then ErrorMovtosCxP = 1 : Exit For End If @@ -9965,10 +9880,14 @@ Partial Class Compras_Compras 'PORCENTAJE IVA Dim PorcentajeIVA As Decimal = TmpDT.MAX("IVAPorcentaje").ToDecimal + + Dim TmpCveRetIVAConcepto As Integer = If(CveRetIVAConceptoOriginal <> DdlRetIVAConcepto.SelectedValue.ToEntero, DdlRetIVAConcepto.SelectedValue.ToEntero, -1) + Dim TmpCveRetISRConcepto As Integer = If(CveRetISRConceptoOriginal <> DdlRetISRConcepto.SelectedValue.ToEntero, DdlRetISRConcepto.SelectedValue.ToEntero, -1) + If ObjCompra.UpdateCompra(TxtDescripcion.Text.Trim, TxtFolioSecundario.Text.Trim, TxtFechaPago.Text.ToDate, ChkAplicaNotaCredito.Checked, TxtObsFact.Text.Trim, CveEstatusFactura, TxtDescuento.Text.ToDouble, TxtSubTotal.Text.ToDouble, TxtIVA.Text.ToDouble, TxtTotal.Text.ToDouble, UsuarioActual.CveUsuario, CveCompra, CveCajaChica:=DdlRembolsoCajaChica.SelectedValue.ToEntero, CvePersonal:=DdlRembolsoPersonal.SelectedValue.ToEntero, CveProveedorSucursal:=If(DdlProveedorSucursal.SelectedValue.ToEntero > 0, DdlProveedorSucursal.SelectedValue.ToEntero, -1), PorcentajeIVA:=PorcentajeIVA, NumeroReembolso:=TxtRembolsoNumero.Text, - CveTipoCompra:=DdlTipoCompra.SelectedValue.ToEntero, NoDeducible:=EsNoDeducible) Then + CveTipoCompra:=DdlTipoCompra.SelectedValue.ToEntero, NoDeducible:=EsNoDeducible, CveRetIVAConcepto:=TmpCveRetIVAConcepto, CveRetISRConcepto:=TmpCveRetISRConcepto) Then If Not ComparaDatatables() Then @@ -10461,6 +10380,25 @@ Partial Class Compras_Compras Alert("La compra no se puede actualizar debido a que los totales no son iguales, verifique sus cambios", TipoMensaje.MsgError) End If + + If Retorno AndAlso (CveRetIVAConceptoOriginal <> DdlRetIVAConcepto.SelectedValue.ToEntero OrElse CveRetISRConceptoOriginal <> DdlRetISRConcepto.SelectedValue.ToEntero) Then + Dim tCveConceptoIVA, tCveConceptoISR As Integer + + If CveRetIVAConceptoOriginal <> DdlRetIVAConcepto.SelectedValue.ToEntero Then tCveConceptoIVA = DdlRetIVAConcepto.SelectedValue.ToEntero + If CveRetISRConceptoOriginal <> DdlRetISRConcepto.SelectedValue.ToEntero Then tCveConceptoISR = DdlRetISRConcepto.SelectedValue.ToEntero + + If ObjCompra.UpdateComprasRetencionesUpdate(tCveConceptoIVA, tCveConceptoISR, CveCompra) Then + If tCveConceptoIVA > 0 Then CveRetIVAConceptoOriginal = tCveConceptoIVA + If tCveConceptoISR > 0 Then CveRetISRConceptoOriginal = tCveConceptoISR + Else + + Retorno = False + Alert("Se presento un error al asignar el nuevo concepto de retención", TipoMensaje.MsgAdvertencia) + End If + + End If + + Catch ex As Exception Alert("Ocurrió un error al actualizar la compra", TipoMensaje.MsgError) ObjCompra.RollBack() @@ -18057,9 +17995,13 @@ Partial Class Compras_Compras End If If UsuarioActual.Empresa.Funcionalidad(590).ToString.ToEntero = 1 Then - + GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa) = Nothing + Dim extrafiltro = "Estatus=1 AND " + If Request("CveCompra") IsNot Nothing AndAlso IsNumeric(Request("CveCompra")) AndAlso Request("CveCompra").ToEntero > 0 Then + extrafiltro = "" + End If DdlCultivosCuadro.Items.Clear() - DdlCultivosCuadro.DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros($" CveSubProyecto = {DdlSubProyecto.SelectedValue}") + DdlCultivosCuadro.DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros($"{extrafiltro} CveSubProyecto = {DdlSubProyecto.SelectedValue}") DdlCultivosCuadro.DataBind() DdlCultivosCuadro.Items.Insert(0, New ListItem("Seleccione uno", "-1")) @@ -18897,7 +18839,7 @@ Partial Class Compras_Compras CompruebaAgregar() End If - Alert("SubProyectos cambiados correctamente", TipoMensaje.MsgInformacion) + Alert("SubProyectos cambiados correctamente", TipoMensaje.ToastInformacion) End Sub @@ -18926,7 +18868,7 @@ Partial Class Compras_Compras CompruebaAgregar() End If - Alert("Los tipos de gastos han sido cambiados correctamente", TipoMensaje.MsgInformacion) + Alert("Los tipos de gastos han sido cambiados correctamente", TipoMensaje.ToastInformacion) End Sub diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index 96ccb4953..df24000c7 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -258,7 +258,7 @@ Partial Class PopUpVerFactura 'noPallet = "000001" 'Variedad = "Golden" Using objnom As New ClsNominas - If objnom.PA_AGRO_Embarque_ManifiestoGet(-1, -1, -1, cveEmbarqueManifiesto) And objnom.DtResultados.Rows.Count > 0 Then + If objnom.EmbarqueManifiestoGet(-1, -1, -1, cveEmbarqueManifiesto) And objnom.DtResultados.Rows.Count > 0 Then Dim row As DataRow = objnom.DtResultados.Rows(0) NoEmbarque = row("NoEmbarque").ToString() Cliente = row("Cliente").ToString() @@ -293,12 +293,13 @@ Partial Class PopUpVerFactura 'End If - If objnom.PA_Agro_Embarque_PalletGet(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, cveEmbarqueManifiesto, -1, True) And objnom.DtResultados.Rows.Count > 0 Then + If objnom.EmbarquePalletGet(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, cveEmbarqueManifiesto, -1, True) And objnom.DtResultados.Rows.Count > 0 Then NoPallets = objnom.DtResultados.SUM("NoPallets").ToString() NoKgManifiesto = objnom.DtResultados.SUM("Peso").ToString("N2") NoBultos = objnom.DtResultados.SUM("NoCajas").ToString("N0") tablaReporte = objnom.DtResultados + End If End If 'Remolque 1 12-TF-5E' }, { cveCamion: 2, placa: 'Remolque 2 15-TF-7f @@ -308,7 +309,7 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("Cliente", Cliente)) params.Add(New ReportParameter("Direccion", Direccion)) params.Add(New ReportParameter("Fecha", Fecha)) - params.Add(New ReportParameter("SubProyecto", SubProyecto)) + params.Add(New ReportParameter("SubProyecto", SubProyecto.ToUpper())) params.Add(New ReportParameter("AgenciaAduanalUSA", AgenciaAduanalUSA)) params.Add(New ReportParameter("AgenciaAduanalMEX", AgenciaAduanalMEX)) params.Add(New ReportParameter("Temperatura", Temperatura)) @@ -345,7 +346,11 @@ Partial Class PopUpVerFactura lrds.Add(rds) '"Empresas/Grales/Formatos/EquiposGPS.rdlc" '"D:\\ADSistemas\\Proyectos\\SIG\\SIGIT\\GPS\\PalletEtiqueta.rdlc" - ImprimirPDF("GPS/EmbarqueManifiesto.rdlc", lrds, params, "Manifesto", Content_Disposition:="Inline") + Dim rutardlc = "GPS/EmbarqueManifiesto.rdlc" + If Not IsNothing(tablaReporte.FiltroPrimero("TipoManifiesto=1")) Then + rutardlc = "GPS/EmbarqueManifiesto2.rdlc" + End If + ImprimirPDF(rutardlc, lrds, params, "Manifesto", Content_Disposition:="Inline") End Sub Private Sub imprimirManifiestoRemision(cveEmbarqueManifiesto As Integer) @@ -394,7 +399,7 @@ Partial Class PopUpVerFactura 'noPallet = "000001" 'Variedad = "Golden" Using objnom As New ClsNominas - If objnom.PA_AGRO_Embarque_ManifiestoGet(-1, -1, -1, cveEmbarqueManifiesto) And objnom.DtResultados.Rows.Count > 0 Then + If objnom.EmbarqueManifiestoGet(-1, -1, -1, cveEmbarqueManifiesto) And objnom.DtResultados.Rows.Count > 0 Then Dim row As DataRow = objnom.DtResultados.Rows(0) NoEmbarque = row("NoEmbarque").ToString() Cliente = row("Cliente").ToString() @@ -440,7 +445,7 @@ Partial Class PopUpVerFactura 'End If - If objnom.PA_Agro_Embarque_PalletGet(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, cveEmbarqueManifiesto, -1) And objnom.DtResultados.Rows.Count > 0 Then + If objnom.EmbarquePalletGet(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, cveEmbarqueManifiesto, -1) And objnom.DtResultados.Rows.Count > 0 Then NoPallets = objnom.DtResultados.Rows.Count.ToString() NoKgManifiesto = objnom.DtResultados.SUM("Peso").ToString("N2") NoBultos = objnom.DtResultados.SUM("NoCajas").ToString("N0") @@ -549,7 +554,7 @@ Partial Class PopUpVerFactura 'noPallet = "000001" 'Variedad = "Golden" Using objnom As New ClsNominas - If objnom.PA_AGRO_Embarque_ManifiestoGet(-1, -1, -1, cveEmbarqueManifiesto) And objnom.DtResultados.Rows.Count > 0 Then + If objnom.EmbarqueManifiestoGet(-1, -1, -1, cveEmbarqueManifiesto) And objnom.DtResultados.Rows.Count > 0 Then Dim row As DataRow = objnom.DtResultados.Rows(0) NoEmbarque = row("NoEmbarque").ToString() Cliente = row("Cliente").ToString() @@ -595,7 +600,7 @@ Partial Class PopUpVerFactura 'End If - If objnom.PA_Agro_Embarque_PalletGet(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, cveEmbarqueManifiesto, -1) And objnom.DtResultados.Rows.Count > 0 Then + If objnom.EmbarquePalletGet(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, cveEmbarqueManifiesto, -1) And objnom.DtResultados.Rows.Count > 0 Then NoPallets = objnom.DtResultados.Rows.Count.ToString() NoKgManifiesto = objnom.DtResultados.SUM("Peso").ToString("N2") NoBultos = objnom.DtResultados.SUM("NoCajas").ToString("N0") @@ -686,7 +691,7 @@ Partial Class PopUpVerFactura 'noPallet = "000001" 'Variedad = "Golden" Using objnom As New ClsNominas - If objnom.PA_Agro_Embarque_PalletGet(cvePallet, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1) And objnom.DtResultados.Rows.Count > 0 Then + If objnom.EmbarquePalletGet(cvePallet, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1) And objnom.DtResultados.Rows.Count > 0 Then Dim row As DataRow = objnom.DtResultados.Rows(0) Envase = row("Envase").ToString() Tamano = row("Tamaño").ToString() @@ -756,7 +761,7 @@ Partial Class PopUpVerFactura 'Cultivo = "Tomate" 'noPallet = "000001" Using objnom As New ClsNominas - If objnom.PA_Agro_Embarque_PalletGet(cvePallet, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1) And objnom.DtResultados.Rows.Count > 0 Then + If objnom.EmbarquePalletGet(cvePallet, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1) And objnom.DtResultados.Rows.Count > 0 Then Dim row As DataRow = objnom.DtResultados.Rows(0) Envase = row("Envase").ToString() Tamano = row("Tamaño").ToString() @@ -1207,15 +1212,15 @@ Partial Class PopUpVerFactura Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) - 'params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, ImageToBase64(Drawing.Image.FromFile(Imagen.FullName), Drawing.Imaging.ImageFormat.Png), ""))) - Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) + + Dim params As New List(Of ReportParameter) params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString)) params.Add(New ReportParameter("AgrupoPor", $"{FechaCorte}{Usuario}")) If Imagen.Exists Then - params.Add(New ReportParameter("LogoPath", LogoRuta)) + params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}")) Else params.Add(New ReportParameter("LogoPath", "")) End If @@ -1321,7 +1326,6 @@ Partial Class PopUpVerFactura Private Sub ImprimeGastoContrato(CveContrato As Integer, CveContratoGasto As Integer) Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) - 'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) Dim Dr As DataRow = Nothing Dim ObjContratos As New ClsContratos @@ -1354,13 +1358,13 @@ Partial Class PopUpVerFactura SumaGasto = ObjContratos.DtResultados.SUM("Importe", "CveContratoGasto IS NULL") End If params.Add(New ReportParameter("Utilidad", $"$ {(SumaUtilidad - SumaGasto).ToString.FormatoNumero()}")) - If Imagen.Exists Then - Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) - params.Add(New ReportParameter("LogoPath", LogoRuta)) + If Imagen.Exists Then + params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}")) Else params.Add(New ReportParameter("LogoPath", "")) End If + ImprimirPDF("Empresas/Grales/Formatos/ContratoGasto.rdlc", dt, params, $"{Nombre}-Gastos", Formato:="PDF") End Sub #End Region @@ -1505,11 +1509,10 @@ Partial Class PopUpVerFactura If Dt.Rows.Count > 0 Then Dim params As New List(Of ReportParameter) Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) - 'params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, ImageToBase64(Drawing.Image.FromFile(Imagen.FullName), Drawing.Imaging.ImageFormat.Png), ""))) - Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) + If Imagen.Exists Then - params.Add(New ReportParameter("LogoPath", LogoRuta)) + params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}")) Else params.Add(New ReportParameter("LogoPath", "")) End If @@ -1927,11 +1930,9 @@ Partial Class PopUpVerFactura If DtConceptos.Rows.Count > 0 Then Dim params As New List(Of ReportParameter) Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) - 'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) If Imagen.Exists Then - Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) - params.Add(New ReportParameter("LogoPath", LogoRuta)) + params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}")) Else params.Add(New ReportParameter("LogoPath", "")) End If @@ -2644,14 +2645,41 @@ Partial Class PopUpVerFactura Dim Guardar As Boolean = If(GuardarPDF, True, If(AplicaPagare = "1", False, True)) + + + + + + If Not IsNothing(Vta) Then - '04/05/2018 - Se agrega seccion pruebas para generar factura venta .mrt para PyME - If UsuarioActual.Empresa.CvePlataforma = 2 Then - GeneraPDFVtaPyMe(Vta, "PDF") + + Dim PathArchivo As String = String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, Vta.TipoDocto, Vta.SerieFolio) + Dim Archivo As New System.IO.FileInfo(PathArchivo) + + If Archivo.Exists Then + + HttpContext.Current.Response.Clear() + HttpContext.Current.Response.ClearContent() + HttpContext.Current.Response.ContentType = If(IO.Path.GetExtension(Archivo.Name) = ".txt", "text/plain", "application/pdf") + HttpContext.Current.Response.AppendHeader("Content-disposition", "attachment; filename=" & Archivo.Name) + HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString()) + HttpContext.Current.Response.TransmitFile(PathArchivo) + 'HttpContext.Current.Response.Flush() + HttpContext.Current.Response.End() + Archivo = Nothing + Else - ImprimirbytesPDF(PdfFactura(Vta, AplicaPagare:=AplicaPagare, Guardar:=Guardar), Vta.SerieFolio, "PDF") - Vta = Nothing + + '04/05/2018 - Se agrega seccion pruebas para generar factura venta .mrt para PyME + If UsuarioActual.Empresa.CvePlataforma = 2 Then + GeneraPDFVtaPyMe(Vta, "PDF") + Else + ImprimirbytesPDF(PdfFactura(Vta, AplicaPagare:=AplicaPagare, Guardar:=Guardar), Vta.SerieFolio, "PDF") + Vta = Nothing + End If End If + + End If End Sub @@ -2906,11 +2934,8 @@ Partial Class PopUpVerFactura If Archivo.Exists Then ImprimirPDF(UsuarioActual.Empresa.Ruta & "Formatos/Inicial.rdlc", DtMovimientos, params, String.Format("Inventario Inicial - {0}", Folio), RDSName:="DsInventarios") Else - 'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) - If Imagen.Exists Then - Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) - params.Add(New ReportParameter("LogoPath", LogoRuta)) + params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}")) Else params.Add(New ReportParameter("LogoPath", "")) End If @@ -2942,11 +2967,9 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("FacturadoA", If(CveCompra > 0, dr("RazonSocial").ToString, ""))) End If If UsuarioActual.CveEmpresa = 119 Then - 'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + If Imagen.Exists Then - 'params.Add(New ReportParameter("LogoPath", logouri)) - Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) - params.Add(New ReportParameter("LogoPath", LogoRuta)) + params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}")) Else params.Add(New ReportParameter("LogoPath", "")) @@ -3009,11 +3032,9 @@ Partial Class PopUpVerFactura ImprimirPDF(UsuarioActual.Empresa.Ruta & "Formatos/Entradas.rdlc", DtMovimientos, params, String.Format("Entrada de Almacen - {0}", Folio), RDSName:="DsInventarios") ElseIf UsuarioActual.CveEmpresa = 140 Then - 'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + If Imagen.Exists Then - 'params.Add(New ReportParameter("LogoPath", logouri)) - Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) - params.Add(New ReportParameter("LogoPath", LogoRuta)) + params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}")) Else params.Add(New ReportParameter("LogoPath", "")) End If @@ -3073,11 +3094,9 @@ Partial Class PopUpVerFactura Else - ' Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + If Imagen.Exists Then - 'params.Add(New ReportParameter("LogoPath", logouri)) - Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) - params.Add(New ReportParameter("LogoPath", LogoRuta)) + params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}")) Else params.Add(New ReportParameter("LogoPath", "")) End If @@ -3252,11 +3271,9 @@ Partial Class PopUpVerFactura ImprimirPDF(UsuarioActual.Empresa.Ruta & "Formatos/Salidas.rdlc", DtMovimientos, params, String.Format("Salida de Almacen - {0}", Folio.ToString), RDSName:="DsInventarios") ElseIf UsuarioActual.CveEmpresa = 140 Then - 'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + If Imagen.Exists Then - 'params.Add(New ReportParameter("LogoPath", logouri)) - Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) - params.Add(New ReportParameter("LogoPath", LogoRuta)) + params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}")) Else params.Add(New ReportParameter("LogoPath", "")) End If @@ -3294,11 +3311,9 @@ Partial Class PopUpVerFactura Else Dim A As New System.IO.FileInfo(String.Format("{0}Formatos/EntradaSalida.rdlc", UsuarioActual.Empresa.Ruta)) - 'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + If Imagen.Exists Then - 'params.Add(New ReportParameter("LogoPath", logouri)) - Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) - params.Add(New ReportParameter("LogoPath", LogoRuta)) + params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}")) Else params.Add(New ReportParameter("LogoPath", "")) End If @@ -3376,11 +3391,9 @@ Partial Class PopUpVerFactura Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) Dim params As New List(Of ReportParameter) - 'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + If Imagen.Exists Then - 'params.Add(New ReportParameter("LogoPath", logouri)) - Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) - params.Add(New ReportParameter("LogoPath", LogoRuta)) + params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}")) Else params.Add(New ReportParameter("LogoPath", "")) End If @@ -3407,11 +3420,9 @@ Partial Class PopUpVerFactura Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) Dim params As New List(Of ReportParameter) - 'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + If Imagen.Exists Then - 'params.Add(New ReportParameter("LogoPath", logouri)) - Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) - params.Add(New ReportParameter("LogoPath", LogoRuta)) + params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}")) Else params.Add(New ReportParameter("LogoPath", "")) End If @@ -3444,11 +3455,10 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("NombreEntrego", Personal)) params.Add(New ReportParameter("Responsable", Personal)) params.Add(New ReportParameter("NombreRecibio", Capturo.ToUpper)) - 'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) If Imagen.Exists Then - Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) - params.Add(New ReportParameter("LogoPath", LogoRuta)) + params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}")) Else params.Add(New ReportParameter("LogoPath", "")) End If @@ -3486,11 +3496,9 @@ Partial Class PopUpVerFactura Archivo = "Empresas/Grales/Formatos/PrestamoProductos.rdlc" End If - 'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + If Imagen.Exists Then - 'params.Add(New ReportParameter("LogoPath", logouri)) - Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) - params.Add(New ReportParameter("LogoPath", LogoRuta)) + params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}")) Else params.Add(New ReportParameter("LogoPath", "")) End If @@ -3537,11 +3545,10 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("NombreEntrego", Capturo.ToUpper)) params.Add(New ReportParameter("Responsable", Personal)) params.Add(New ReportParameter("NombreRecibio", Personal)) - 'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) If Imagen.Exists Then - Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) - params.Add(New ReportParameter("LogoPath", LogoRuta)) + params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}")) Else params.Add(New ReportParameter("LogoPath", "")) End If @@ -3579,11 +3586,9 @@ Partial Class PopUpVerFactura Archivo = "Empresas/Grales/Formatos/PrestamoProductos.rdlc" End If - 'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + If Imagen.Exists Then - 'params.Add(New ReportParameter("LogoPath", logouri)) - Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) - params.Add(New ReportParameter("LogoPath", LogoRuta)) + params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}")) Else params.Add(New ReportParameter("LogoPath", "")) End If @@ -3733,12 +3738,10 @@ Partial Class PopUpVerFactura Dim Archivo As New System.IO.FileInfo(String.Format(RutaFormato, UsuarioActual.Empresa.Ruta)) If Archivo.Exists Then Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) - 'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + If Imagen.Exists Then - 'params.Add(New ReportParameter("LogoPath", logouri)) - Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) - params.Add(New ReportParameter("LogoPath", LogoRuta)) + params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}")) Else params.Add(New ReportParameter("LogoPath", "")) End If @@ -3787,13 +3790,10 @@ Partial Class PopUpVerFactura ImprimirPDF(String.Format(RutaFormato, UsuarioActual.Empresa.Ruta), DtMovimientos, params, String.Format("Aviso de Traslado - {0}", Folio), RDSName:="DsInventarios") Else Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) - 'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + If Imagen.Exists Then - ' params.Add(New ReportParameter("LogoPath", logouri)) - Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) - params.Add(New ReportParameter("LogoPath", LogoRuta)) - + params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}")) Else params.Add(New ReportParameter("LogoPath", "")) End If @@ -3838,12 +3838,10 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("CantidadProductos", "500")) params.Add(New ReportParameter("CantidadUsados", "500")) Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) - ' Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + If Imagen.Exists Then - 'params.Add(New ReportParameter("LogoPath", logouri)) - Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) - params.Add(New ReportParameter("LogoPath", LogoRuta)) + params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}")) Else params.Add(New ReportParameter("LogoPath", "")) End If @@ -3857,12 +3855,9 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("FolioRelacionado", FolioRelacionado)) ElseIf UsuarioActual.CveEmpresa = 153 Then Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) - 'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) If Imagen.Exists Then - 'params.Add(New ReportParameter("LogoPath", logouri)) - Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) - params.Add(New ReportParameter("LogoPath", LogoRuta)) + params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}")) Else params.Add(New ReportParameter("LogoPath", "")) End If @@ -3878,12 +3873,9 @@ Partial Class PopUpVerFactura ImprimirPDF(String.Format("{0}Formatos\Traslado.rdlc", UsuarioActual.Empresa.Ruta), DtMovimientos, params, String.Format("Recepción de Traslado - {0}", Folio), RDSName:="DsInventarios") Else Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) - 'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) If Imagen.Exists Then - 'params.Add(New ReportParameter("LogoPath", logouri)) - Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) - params.Add(New ReportParameter("LogoPath", LogoRuta)) + params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}")) Else params.Add(New ReportParameter("LogoPath", "")) End If @@ -4043,9 +4035,7 @@ Partial Class PopUpVerFactura If Not Archivo.Exists Then If Imagen.Exists Then - 'params.Add(New ReportParameter("LogoPath", logouri)) - Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) - params.Add(New ReportParameter("LogoPath", LogoRuta)) + params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}")) Else params.Add(New ReportParameter("LogoPath", "")) End If @@ -4193,14 +4183,13 @@ Partial Class PopUpVerFactura ImprimirPDF(UsuarioActual.Empresa.Ruta & "Formatos/DevolucionCliente.rdlc", DtMovimientos, params, String.Format("Devolucion del Cliente - {0}", Folio.ToString), RDSName:="DsInventarios") 'End If Else - ' Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + If Imagen.Exists Then - 'params.Add(New ReportParameter("LogoPath", logouri)) - Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) - params.Add(New ReportParameter("LogoPath", LogoRuta)) + params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}")) Else params.Add(New ReportParameter("LogoPath", "")) End If + Dim CiudadSucursal As String = "" Dim DomicilioSucursal As String = "" @@ -4231,11 +4220,9 @@ Partial Class PopUpVerFactura Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) Dim params As New List(Of ReportParameter) - 'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + If Imagen.Exists Then - 'params.Add(New ReportParameter("LogoPath", logouri)) - Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) - params.Add(New ReportParameter("LogoPath", LogoRuta)) + params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}")) Else params.Add(New ReportParameter("LogoPath", "")) End If @@ -4262,11 +4249,9 @@ Partial Class PopUpVerFactura Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) Dim params As New List(Of ReportParameter) - ' Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + If Imagen.Exists Then - 'params.Add(New ReportParameter("LogoPath", logouri)) - Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) - params.Add(New ReportParameter("LogoPath", LogoRuta)) + params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}")) Else params.Add(New ReportParameter("LogoPath", "")) End If @@ -4298,11 +4283,8 @@ Partial Class PopUpVerFactura Archivo = "Empresas/Grales/Formatos/EntradaSalida.rdlc" End If - 'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) If Imagen.Exists Then - 'params.Add(New ReportParameter("LogoPath", logouri)) - Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) - params.Add(New ReportParameter("LogoPath", LogoRuta)) + params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}")) Else params.Add(New ReportParameter("LogoPath", "")) End If @@ -4374,11 +4356,8 @@ Partial Class PopUpVerFactura Archivo = "Empresas/Grales/Formatos/EntradaSalidaUniforme.rdlc" End If - ' Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) If Imagen.Exists Then - 'params.Add(New ReportParameter("LogoPath", logouri)) - Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) - params.Add(New ReportParameter("LogoPath", LogoRuta)) + params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}")) Else params.Add(New ReportParameter("LogoPath", "")) End If @@ -4423,11 +4402,9 @@ Partial Class PopUpVerFactura Archivo = "Empresas/Grales/Formatos/PrestamoProductos.rdlc" End If - 'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + If Imagen.Exists Then - 'params.Add(New ReportParameter("LogoPath", logouri)) - Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) - params.Add(New ReportParameter("LogoPath", LogoRuta)) + params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}")) Else params.Add(New ReportParameter("LogoPath", "")) End If @@ -4468,11 +4445,9 @@ Partial Class PopUpVerFactura Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) Dim params As New List(Of ReportParameter) - 'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + If Imagen.Exists Then - 'params.Add(New ReportParameter("LogoPath", logouri)) - Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) - params.Add(New ReportParameter("LogoPath", LogoRuta)) + params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}")) Else params.Add(New ReportParameter("LogoPath", "")) End If @@ -4494,7 +4469,7 @@ Partial Class PopUpVerFactura Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos/Salidas.rdlc", UsuarioActual.Empresa.Ruta)) Dim Archivo2 As New System.IO.FileInfo(String.Format("{0}Formatos/ConsumoInterno.rdlc", UsuarioActual.Empresa.Ruta)) Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) - 'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + Dim params As New List(Of ReportParameter) 'If UsuarioActual.CveEmpresa.Contiene(72, 80) Then @@ -4531,9 +4506,7 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("NombreRecibio", Recibio)) If Imagen.Exists Then - 'params.Add(New ReportParameter("LogoPath", logouri)) - Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) - params.Add(New ReportParameter("LogoPath", LogoRuta)) + params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}")) Else params.Add(New ReportParameter("LogoPath", "")) End If @@ -4722,11 +4695,8 @@ Partial Class PopUpVerFactura Else Dim A As New System.IO.FileInfo(String.Format("{0}Formatos/EntradaSalida.rdlc", UsuarioActual.Empresa.Ruta)) - ' Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) If Imagen.Exists Then - 'params.Add(New ReportParameter("LogoPath", logouri)) - Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) - params.Add(New ReportParameter("LogoPath", LogoRuta)) + params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}")) Else params.Add(New ReportParameter("LogoPath", "")) End If @@ -4982,8 +4952,6 @@ Partial Class PopUpVerFactura End If Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) - 'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) - 'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) If Not ReporteEmpresa.Exists Then params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) @@ -4991,8 +4959,7 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString)) If Imagen.Exists Then - Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) - params.Add(New ReportParameter("LogoPath", LogoRuta)) + params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}")) Else params.Add(New ReportParameter("LogoPath", "")) End If @@ -5189,8 +5156,7 @@ Partial Class PopUpVerFactura Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) If Imagen.Exists Then - Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) - params.Add(New ReportParameter("LogoPath", LogoRuta)) + params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}")) Else params.Add(New ReportParameter("LogoPath", "")) End If @@ -5798,7 +5764,7 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("TotAbono", DtComprobacion.SUM("Abonado").ToString)) If Imagen.Exists Then - params.Add(New ReportParameter("LogoPath", logouri)) + params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}")) Else params.Add(New ReportParameter("LogoPath", "")) End If @@ -5845,17 +5811,7 @@ Partial Class PopUpVerFactura Dim paramList As New List(Of ReportParameter) With paramList - - Dim logouri As String = "" - Dim RutaLogo As String = String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta) - - Dim Imagen As New System.IO.FileInfo(RutaLogo) - - If Imagen.Exists Then - logouri = String.Format("file://{0}", RutaLogo) - Else - logouri = "" - End If + Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) .Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) .Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString)) @@ -5870,7 +5826,7 @@ Partial Class PopUpVerFactura If Imagen.Exists Then - .Add(New ReportParameter("LogoPath", logouri)) + .Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}")) Else .Add(New ReportParameter("LogoPath", "")) End If @@ -6278,9 +6234,7 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("CodigoTD", CodigoTD)) If Imagen.Exists Then - - Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) - params.Add(New ReportParameter("LogoPath", LogoRuta)) + params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}")) Else params.Add(New ReportParameter("LogoPath", "")) End If @@ -6417,9 +6371,7 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("CodigoTD", CodigoTD)) If Imagen.Exists Then - - Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) - params.Add(New ReportParameter("LogoPath", LogoRuta)) + params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}")) Else params.Add(New ReportParameter("LogoPath", "")) End If diff --git a/Compras/Proveedores.aspx.vb b/Compras/Proveedores.aspx.vb index e06070550..61b4752e2 100644 --- a/Compras/Proveedores.aspx.vb +++ b/Compras/Proveedores.aspx.vb @@ -681,7 +681,7 @@ Partial Class Compras_Proveedores Private Sub CargaCuentasContables(Optional IdCuentaPadre As Integer = -1) - If UsuarioActual.Empresa.UsaContabilidad Then + If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaContabilidad Then Dim ObjContabilidad As New ClsContPAQi(UsuarioActual.Empresa) If ObjContabilidad.GetCuentasRecursiva(IdCuentaPadre, 1) Then DtCuentasContables = ObjContabilidad.DtResultados @@ -1383,55 +1383,59 @@ Partial Class Compras_Proveedores End Sub Protected Sub BtnCargarCuentas_Click(sender As Object, e As EventArgs) Handles BtnCargarCuentas.Click - If DtCuentasContables Is Nothing Then + If UsuarioActual.Empresa.TipoContabilidad = 2 Then + + + If DtCuentasContables Is Nothing Then + + End If + + Dim ObjContabilidad As New ClsContPAQi(UsuarioActual.Empresa) + + Select Case HdnCuenta.Value + Case "1" + CargaCuentasDDL(DdlCtaContProveedores, If(DdlCveTipoProveedor.SelectedValue = "2", 202, 201)) + Case "2" + CargaCuentasDDL(DdlCtaContAnticipos, 204) + Case "3" + CargaCuentasDDL(DdlCtaContFondoGarantia, 231) + Case "4" + CargaCuentasDDL(DdlCtaContRetIVA, 206) + Case "5" + CargaCuentasDDL(DdlCtaContRetISR, 206) + Case "6" + CargaCuentasDDL(DdlCtaContAcreedores, 202) + Case "7" + CargaCuentasDDL(DdlCtaContComplementaria, 201) + Case "8" + CargaCuentasDDL(DdlCtaContExtranjera, 201) + Case "9" + CargaCuentasDDL(DdlCtaContAcreedoresExtranjera, 202) + Case "10" + CargaCuentasDDL(DdlCtaContAcreedoresComplementaria, 202) + Case "11" + CargaCuentasDDL(DdlCtaContAnticiposExtranjera, 204) + Case "12" + CargaCuentasDDL(DdlCtaContAnticiposComplementaria, 204) + Case "13" + CargaCuentasDDL(DdlCtaContDeudor, 205) + Case "14" + CargaCuentasDDL(DdlCtaContDeudorExtranjera, 205) + Case "15" + CargaCuentasDDL(DdlCtaContDeudorComplementaria, 205) + Case "16" + CargaCuentasDDL(DdlCtaContDocsXPagar, 203) + Case "17" + CargaCuentasDDL(DdlCtaContDocsXPagarExtranjera, 203) + Case "18" + CargaCuentasDDL(DdlCtaContDocsXPagarComplementaria, 203) + Case "19" + CargaCuentasDDL(DdlCtaContRetISRAcreditable, 206) + Case "20" + CargaCuentasDDL(DdlCtaContRetIVAAcreditable, 206) + End Select End If - - Dim ObjContabilidad As New ClsContPAQi(UsuarioActual.Empresa) - - Select Case HdnCuenta.Value - Case "1" - CargaCuentasDDL(DdlCtaContProveedores, If(DdlCveTipoProveedor.SelectedValue = "2", 202, 201)) - Case "2" - CargaCuentasDDL(DdlCtaContAnticipos, 204) - Case "3" - CargaCuentasDDL(DdlCtaContFondoGarantia, 231) - Case "4" - CargaCuentasDDL(DdlCtaContRetIVA, 206) - Case "5" - CargaCuentasDDL(DdlCtaContRetISR, 206) - Case "6" - CargaCuentasDDL(DdlCtaContAcreedores, 202) - Case "7" - CargaCuentasDDL(DdlCtaContComplementaria, 201) - Case "8" - CargaCuentasDDL(DdlCtaContExtranjera, 201) - Case "9" - CargaCuentasDDL(DdlCtaContAcreedoresExtranjera, 202) - Case "10" - CargaCuentasDDL(DdlCtaContAcreedoresComplementaria, 202) - Case "11" - CargaCuentasDDL(DdlCtaContAnticiposExtranjera, 204) - Case "12" - CargaCuentasDDL(DdlCtaContAnticiposComplementaria, 204) - Case "13" - CargaCuentasDDL(DdlCtaContDeudor, 205) - Case "14" - CargaCuentasDDL(DdlCtaContDeudorExtranjera, 205) - Case "15" - CargaCuentasDDL(DdlCtaContDeudorComplementaria, 205) - Case "16" - CargaCuentasDDL(DdlCtaContDocsXPagar, 203) - Case "17" - CargaCuentasDDL(DdlCtaContDocsXPagarExtranjera, 203) - Case "18" - CargaCuentasDDL(DdlCtaContDocsXPagarComplementaria, 203) - Case "19" - CargaCuentasDDL(DdlCtaContRetISRAcreditable, 206) - Case "20" - CargaCuentasDDL(DdlCtaContRetIVAAcreditable, 206) - End Select - End Sub Private Sub CargaCuentasDDL(Ddl As DropDownList, CveFuncionalidad As Integer) @@ -1610,7 +1614,7 @@ Partial Class Compras_Proveedores Dim ObjContaAC As ClsContPAQi = Nothing - If (UsuarioActual.Empresa.Funcionalidad(200).ToEntero > 0 AndAlso UsuarioActual.Empresa.Funcionalidad(201).ToEntero > 0) Then 'FUNCIONALIDAD 112=AGREGAR CTA CONTABLE PROVEEDOR + If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso ((UsuarioActual.Empresa.Funcionalidad(200).ToEntero > 0 AndAlso UsuarioActual.Empresa.Funcionalidad(201).ToEntero > 0)) Then 'FUNCIONALIDAD 112=AGREGAR CTA CONTABLE PROVEEDOR ObjContaAC = New ClsContPAQi(UsuarioActual.Empresa) ObjContaAC.IniciaTransacSQL() @@ -1846,7 +1850,7 @@ Partial Class Compras_Proveedores 'End If Dim CreoCuenta As Boolean = False - If (UsuarioActual.Empresa.UsaAC Or (UsuarioActual.Empresa.UsaContabilidad And UsuarioActual.Empresa.Funcionalidad(322).ToString.Trim.ToEntero = 0)) Then + If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso (UsuarioActual.Empresa.UsaAC Or (UsuarioActual.Empresa.UsaContabilidad And UsuarioActual.Empresa.Funcionalidad(322).ToString.Trim.ToEntero = 0)) Then Dim ObjContaAC = New ClsContPAQi(UsuarioActual.Empresa) Dim drCuenta As DataRow = ObjContaAC.DtResultados.FiltroPrimero("") If drCuenta IsNot Nothing Then @@ -4256,7 +4260,7 @@ Partial Class Compras_Proveedores #Region "CUENTAS CONTABLES" Private Sub ActivarRegistroAutomatico() - If UsuarioActual.Empresa.UsaContabilidad Or UsuarioActual.Empresa.UsaAC Then + If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso (UsuarioActual.Empresa.UsaContabilidad Or UsuarioActual.Empresa.UsaAC) Then Dim ObjContabilidad As New ClsContPAQi(UsuarioActual.Empresa) '' 17/03/2017 FUNCIONALIDADES 249,250,251 @@ -4429,7 +4433,7 @@ Partial Class Compras_Proveedores End Sub Private Sub AgregarCuentaContable(btn As Button, ddl As DropDownList) - If UsuarioActual.Empresa.UsaContabilidad = True Then + If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaContabilidad = True Then Dim IdCuentaContable As Integer = -1 Dim CtaCodigo As String = "" Dim TieneError = False diff --git a/Compras/RepComprasAF.aspx.vb b/Compras/RepComprasAF.aspx.vb index f6dae6e0f..87a10b5f0 100644 --- a/Compras/RepComprasAF.aspx.vb +++ b/Compras/RepComprasAF.aspx.vb @@ -111,18 +111,22 @@ Partial Class Compras_RepComprasAF If UsuarioActual.Empresa.Tipo_CentroCosto = 1 Then DdlProyecto.Visible = False - LblSubProyecto.Text = "Sucursal" + 'LblSubProyecto.Text = "Sucursal" LblProyecto.Visible = False - DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) - DdlSubProyecto.DataBind() - DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1")) + ' DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) + CargarCentrosDeCosto(Nothing, DdlSubProyecto, Nothing, LblSubProyecto) + 'DdlSubProyecto.DataBind() + 'DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1")) ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 2 Then DdlProyecto.Visible = False - LblSubProyecto.Text = "Proyecto" + 'LblSubProyecto.Text = "Proyecto" LblProyecto.Visible = False - DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) - DdlSubProyecto.DataBind() - DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1")) + + 'DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) + 'DdlSubProyecto.DataBind() + CargarCentrosDeCosto(Nothing, DdlSubProyecto, Nothing, LblSubProyecto) + + 'DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1")) ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 3 Or UsuarioActual.Empresa.Tipo_CentroCosto = 0 Then LblProyecto.Text = "Proyecto" @@ -149,10 +153,14 @@ Partial Class Compras_RepComprasAF End Sub Private Sub CargaSubProyecto() - DdlSubProyecto.Items.Clear() - DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) - DdlSubProyecto.DataBind() - DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1")) + + + CargarCentrosDeCosto(Nothing, DdlSubProyecto, Nothing, LblSubProyecto) + + 'DdlSubProyecto.Items.Clear() + 'DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) + 'DdlSubProyecto.DataBind() + 'DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1")) End Sub Protected Sub BtnConsultar_Click(sender As Object, e As System.EventArgs) Handles BtnConsultar.Click CargaDatos() diff --git a/Compras/RepComprasAFDetalle.aspx.vb b/Compras/RepComprasAFDetalle.aspx.vb index fd65f6a70..b3b037570 100644 --- a/Compras/RepComprasAFDetalle.aspx.vb +++ b/Compras/RepComprasAFDetalle.aspx.vb @@ -174,6 +174,11 @@ Partial Class Compras_RepComprasAFDetalle DdlProveedores.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa) DdlProveedores.DataBind() + If Request.QueryString("CveProveedor") IsNot Nothing AndAlso Request.QueryString("CveProveedor").ToEntero = -3 Then + DdlProveedores.Items.Add(New ListItem("Consumo Interno", "-3")) + End If + + DdlMonedas.DataSource = GlobalDTMonedas() DdlMonedas.DataBind() @@ -325,11 +330,18 @@ Partial Class Compras_RepComprasAFDetalle FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim(), "-1") - Dim Liga As String = $"/Compras/Compras.aspx?CveCompra={e.Row.DBCampo("CveCompra")}" + Dim Liga As String = "" + + + If e.Row.DBCampo("CveCompra").ToEntero > 0 Then + Liga = $"/Compras/Compras.aspx?CveCompra={e.Row.DBCampo("CveCompra")}" + Else + Liga = $"/Inventarios/EntradasSalidas.aspx?CveMovimiento={e.Row.DBCampo("CveMovimiento")}" + End If If e.Row.DBCampo("Orden") = "1" Then - e.Row.Cells(0).Text = String.Format("{2}", "Texto", Liga, e.Row.DBCampo("SerieFolio").ToString) + e.Row.Cells(0).Text = String.Format("{2}", "Texto", Liga, e.Row.DBCampo("SerieFolio").ToString) Else e.Row.BackColor = Drawing.Color.LightGray e.Row.Font.Bold = True diff --git a/Compras/RepProductosServicios.aspx.vb b/Compras/RepProductosServicios.aspx.vb index b3d4480b2..027cc1a66 100644 --- a/Compras/RepProductosServicios.aspx.vb +++ b/Compras/RepProductosServicios.aspx.vb @@ -202,7 +202,23 @@ Partial Class Compras_RepProductosServicios DdlGrupo.SelectedValueExist("8") End Sub Private Sub CargaTipoCentroCosto() + + + If UsuarioActual.Empresa.Tipo_CentroCosto = 1 Then + DdlSubProyecto.Items.Clear() + DivProyecto.Visible = False + LblProyecto.Visible = False + LblSubProyecto.InnerText = "Centro de costo" + + DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) + 'DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1")) + DdlSubProyecto.DataBind() + + DdlGrupo.Items.Insert(0, New ListItem("Centro de costo", "2")) + DdlGrupo.DataBind() + + ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 2 Then DdlSubProyecto.Items.Clear() DivProyecto.Visible = False LblProyecto.Visible = False @@ -215,30 +231,18 @@ Partial Class Compras_RepProductosServicios DdlGrupo.Items.Insert(0, New ListItem("Sucursal", "2")) DdlGrupo.DataBind() - ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 2 Then - DdlSubProyecto.Items.Clear() - DivProyecto.Visible = False - LblProyecto.Visible = False - LblSubProyecto.InnerText = "Proyecto:" - - DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) - 'DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1")) - DdlSubProyecto.DataBind() - - DdlGrupo.Items.Insert(0, New ListItem("Proyecto", "2")) - DdlGrupo.DataBind() - ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 3 Then DdlGrupo.Items.Insert(0, New ListItem("Proyecto", "1")) DdlGrupo.Items.Insert(1, New ListItem("SubProyecto", "2")) DdlGrupo.DataBind() + LblSubProyecto.InnerText = "Proyecto" ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 4 Then - LblProyecto.InnerText = "Sucursal:" - LblSubProyecto.InnerText = "Proyecto:" + LblProyecto.InnerText = "Proyecto
:" + LblSubProyecto.InnerText = "Subproyecto:" - DdlGrupo.Items.Insert(0, New ListItem("Sucursal", "1")) - DdlGrupo.Items.Insert(1, New ListItem("Proyecto", "2")) + DdlGrupo.Items.Insert(0, New ListItem("Proyecto", "1")) + DdlGrupo.Items.Insert(1, New ListItem("Subproyecto", "2")) DdlGrupo.DataBind() ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 5 Then diff --git a/Compras/RepProductosServiciosDetalle.aspx.vb b/Compras/RepProductosServiciosDetalle.aspx.vb index 953b668dc..c71fb4c3c 100644 --- a/Compras/RepProductosServiciosDetalle.aspx.vb +++ b/Compras/RepProductosServiciosDetalle.aspx.vb @@ -310,6 +310,19 @@ Partial Class Compras_RepProductosServiciosDetalle End Sub Private Sub CargaTipoCentroCosto() If UsuarioActual.Empresa.Tipo_CentroCosto = 1 Then + DdlSubProyecto.Items.Clear() + DivProyecto.Visible = False + LblProyecto.Visible = False + LblSubProyecto.InnerText = "Centro de costo" + + DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) + 'DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1")) + DdlSubProyecto.DataBind() + + DdlGrupo.Items.Insert(0, New ListItem("Centro de costo", "2")) + DdlGrupo.DataBind() + + ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 2 Then DdlSubProyecto.Items.Clear() DivProyecto.Visible = False LblProyecto.Visible = False @@ -322,30 +335,18 @@ Partial Class Compras_RepProductosServiciosDetalle DdlGrupo.Items.Insert(0, New ListItem("Sucursal", "2")) DdlGrupo.DataBind() - ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 2 Then - DdlSubProyecto.Items.Clear() - DivProyecto.Visible = False - LblProyecto.Visible = False - LblSubProyecto.InnerText = "Proyecto:" - - DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) - 'DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1")) - DdlSubProyecto.DataBind() - - DdlGrupo.Items.Insert(0, New ListItem("Proyecto", "2")) - DdlGrupo.DataBind() - ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 3 Then DdlGrupo.Items.Insert(0, New ListItem("Proyecto", "1")) DdlGrupo.Items.Insert(1, New ListItem("SubProyecto", "2")) DdlGrupo.DataBind() + LblSubProyecto.InnerText = "Proyecto" ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 4 Then - LblProyecto.InnerText = "Sucursal:" - LblSubProyecto.InnerText = "Proyecto:" + LblProyecto.InnerText = "Proyecto
:" + LblSubProyecto.InnerText = "Subproyecto:" - DdlGrupo.Items.Insert(0, New ListItem("Sucursal", "1")) - DdlGrupo.Items.Insert(1, New ListItem("Proyecto", "2")) + DdlGrupo.Items.Insert(0, New ListItem("Proyecto", "1")) + DdlGrupo.Items.Insert(1, New ListItem("Subproyecto", "2")) DdlGrupo.DataBind() ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 5 Then @@ -356,6 +357,53 @@ Partial Class Compras_RepProductosServiciosDetalle DdlGrupo.Items.Insert(1, New ListItem("Sucursal", "2")) DdlGrupo.DataBind() End If + 'If UsuarioActual.Empresa.Tipo_CentroCosto = 1 Then + ' DdlSubProyecto.Items.Clear() + ' DivProyecto.Visible = False + ' LblProyecto.Visible = False + ' LblSubProyecto.InnerText = "Sucursal:" + + ' DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) + ' 'DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1")) + ' DdlSubProyecto.DataBind() + + ' DdlGrupo.Items.Insert(0, New ListItem("Sucursal", "2")) + ' DdlGrupo.DataBind() + + 'ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 2 Then + ' DdlSubProyecto.Items.Clear() + ' DivProyecto.Visible = False + ' LblProyecto.Visible = False + ' LblSubProyecto.InnerText = "Proyecto:" + + ' DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) + ' 'DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1")) + ' DdlSubProyecto.DataBind() + + ' DdlGrupo.Items.Insert(0, New ListItem("Proyecto", "2")) + ' DdlGrupo.DataBind() + + 'ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 3 Then + ' DdlGrupo.Items.Insert(0, New ListItem("Proyecto", "1")) + ' DdlGrupo.Items.Insert(1, New ListItem("SubProyecto", "2")) + ' DdlGrupo.DataBind() + + 'ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 4 Then + ' LblProyecto.InnerText = "Sucursal:" + ' LblSubProyecto.InnerText = "Proyecto:" + + ' DdlGrupo.Items.Insert(0, New ListItem("Sucursal", "1")) + ' DdlGrupo.Items.Insert(1, New ListItem("Proyecto", "2")) + ' DdlGrupo.DataBind() + + 'ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 5 Then + ' LblProyecto.InnerText = "Proyecto:" + ' LblSubProyecto.InnerText = "Sucursal:" + + ' DdlGrupo.Items.Insert(0, New ListItem("Proyecto", "1")) + ' DdlGrupo.Items.Insert(1, New ListItem("Sucursal", "2")) + ' DdlGrupo.DataBind() + 'End If End Sub Protected Sub BtnConsultar_Click(sender As Object, e As System.EventArgs) Handles BtnConsultar.Click diff --git a/Compras/eFacturas.aspx.vb b/Compras/eFacturas.aspx.vb index be531b95e..143b93038 100644 --- a/Compras/eFacturas.aspx.vb +++ b/Compras/eFacturas.aspx.vb @@ -3037,7 +3037,7 @@ Partial Class Compras_eFacturas ObjCompraFolios.Dispose() - DTDocumentosRelacionados = DTDocumentosRelacionados.FiltraParametros("CveIE > 0 AND LEN(IdDocumento) > 0") + DTDocumentosRelacionados = DTDocumentosRelacionados.FiltraParametros(" LEN(IdDocumento) > 0 ") GVPDocumentosRelacionadosPagos.DataSource = DTDocumentosRelacionados GVPDocumentosRelacionadosPagos.DataBind() diff --git a/Contabilidad/DiarioPagos.aspx.vb b/Contabilidad/DiarioPagos.aspx.vb index 58492f5e6..08f6e4059 100644 --- a/Contabilidad/DiarioPagos.aspx.vb +++ b/Contabilidad/DiarioPagos.aspx.vb @@ -1017,9 +1017,8 @@ Partial Class Contabilidad_DiarioPagos If CargoAnticipo > 0 AndAlso TotalAnticipos = 0 Then ' cuando el pago no cubre el 100% - If Not Conta.AddMovimiento(IDPoliza, IdCuentaAnticipo, False, CargoAnticipo, gvrc.FCHiddenField("HdnSerieFolio").Value, gvrc.FCHiddenField("HdnSerieFolio").Value, IdSegNeg, Fecha, gvrc.FCHiddenField("HdnCveProveedor").Value.ContaReferencia(TipoContaReferencia.Proveedor), If(MonExt, CargoProveedor, 0.0)) Then MsgError = "No se pudo insertar movimiento contable" : Exit For - Dim TmpTotal As Decimal + Dim TmpTotalME As Decimal = CargoAnticipo If CveMoneda = 2 Then 'registro a la cuenta complementaria del proveedor @@ -1028,12 +1027,13 @@ Partial Class Contabilidad_DiarioPagos Else CargoAnticipo = Math.Round(CargoAnticipo * TipoCambioCompra, 2) End If - - 'complementaria - If TmpTotal > 0 AndAlso Not Conta.AddMovimiento(IDPoliza, gvr.DataKey("IdCtaContComplementaria").ToEntero, TipoMovto, TmpTotal, gvrc.FCHiddenField("HdnSerieFolio").Value, gvrc.FCHiddenField("HdnSerieFolio").Value, IdSegNeg, Fecha, gvrc.FCHiddenField("HdnCveProveedor").Value.ContaReferencia(TipoContaReferencia.Proveedor), If(MonExt, gvrc.FCHiddenField("HdnTotal").Value.ToDouble, 0.0)) Then MsgError = "No se pudo insertar movimiento contable" : Exit For - End If + If Not Conta.AddMovimiento(IDPoliza, IdCuentaAnticipo, False, CargoAnticipo, gvrc.FCHiddenField("HdnSerieFolio").Value, gvrc.FCHiddenField("HdnSerieFolio").Value, IdSegNeg, Fecha, gvrc.FCHiddenField("HdnCveProveedor").Value.ContaReferencia(TipoContaReferencia.Proveedor), If(MonExt, TmpTotalME, 0.0)) Then MsgError = "No se pudo insertar movimiento contable" : Exit For + + 'complementaria + If TmpTotal > 0 AndAlso Not Conta.AddMovimiento(IDPoliza, gvr.DataKey("IdCtaContComplementaria").ToEntero, TipoMovto, TmpTotal, gvrc.FCHiddenField("HdnSerieFolio").Value, gvrc.FCHiddenField("HdnSerieFolio").Value, IdSegNeg, Fecha, gvrc.FCHiddenField("HdnCveProveedor").Value.ContaReferencia(TipoContaReferencia.Proveedor), If(MonExt, gvrc.FCHiddenField("HdnTotal").Value.ToDouble, 0.0)) Then MsgError = "No se pudo insertar movimiento contable" : Exit For + End If diff --git a/Contabilidad/RegPrePolizaS.aspx b/Contabilidad/RegPrePolizaS.aspx index 68914892e..cfc98f3ab 100644 --- a/Contabilidad/RegPrePolizaS.aspx +++ b/Contabilidad/RegPrePolizaS.aspx @@ -359,7 +359,7 @@
@@ -477,7 +477,7 @@
+ DataKeyNames="CvePrePolizaDetalle,IdMov, CveConceptoContable, IdCtaContable, CveSubProyecto, CveTipoGasto,Referencia,CveVenta,CveCompra, CveProveedor, CveCliente, CvePersonal, CveCuenta, PorcentajeImpuesto,TipoMovto,EsComplementaria,EsMonedaExtranjera,Concepto,CveClasificacion,ContadoCuenta,ContadoTipoTransaccion,ContadoNumeroFolio,ContadoBeneficiario,ContadoObservaciones,ContadoImporte,TC,ImporteME,Cargo,Abono" Width="100%" > Movimiento @@ -740,14 +740,14 @@
-
-
Concepto:
+
Con Admin:
- + +
diff --git a/Contabilidad/RegPrePolizaS.aspx.vb b/Contabilidad/RegPrePolizaS.aspx.vb index 8c3721346..55c7ad886 100644 --- a/Contabilidad/RegPrePolizaS.aspx.vb +++ b/Contabilidad/RegPrePolizaS.aspx.vb @@ -61,10 +61,15 @@ Partial Class ContabilidadC_RegPrePolizaS Public Property DrConceptoContable As DataRow Get - Return CType(ViewState("ArregloMovs"), DataRow) + If ViewState("DrConceptoContable") IsNot Nothing Then + Return CType(ViewState("DrConceptoContable"), DataRow) + Else + Return Nothing + End If + End Get Set(value As DataRow) - ViewState("ArregloMovs") = value + ViewState("DrConceptoContable") = value End Set End Property @@ -397,97 +402,18 @@ Partial Class ContabilidadC_RegPrePolizaS .Add("PorcentajeImpuesto", Type.GetType("System.Decimal")) .Add("Modificado", Type.GetType("System.Boolean")) .Add("EsComplementaria", Type.GetType("System.Boolean")) + .Add("EsMonedaExtranjera", Type.GetType("System.Boolean")) .Add("TC", Type.GetType("System.Decimal")) - End With - If Not DtMovimientos.Columns.Contains("Cargo") Then DtMovimientos.Columns.Add("Cargo", Type.GetType("System.Decimal")) DtMovimientos.Columns.Add("Abono", Type.GetType("System.Decimal")) End If - DtMovimientos.AcceptChanges() End Sub - - 'Private Sub CargaNomina() - ' Dim CvePlantilla As Integer = DdlPlantilla.SelectedValue.ToEntero - ' Dim ObjNomina As New ClsNominas - ' Dim ObjConta As New ClsContabilidad - - ' Dim Dt As DataTable = Nothing - ' Dim Cuenta As String = "" - ' Dim Concepto As String = "" - ' Dim IdCuenta As Integer = 0 - ' Dim TipoMovto As Integer - ' Dim CveConcepto As Integer - ' Dim CodigoCuenta As String = "" - ' Dim NombreCuenta As String = "" - ' Dim Referencia As String = "" - ' Dim EsComodin As Integer = 0 - ' DtMovimientos.Clear() - - ' If ObjNomina.GetProvisionNomina(CveProyecto, CveSubProyecto, CveTurno, CvePeriodo, UsuarioActual.CveEmpresa) Then - ' Dt = ObjNomina.DtResultados - - ' For Each drt As DataRow In Dt.Rows - ' Dim dr As DataRow = DtMovimientos.NewRow - - ' If drt("NombreCompleto").ToString = "" AndAlso ObjConta.GetRetCuenta(31, UsuarioActual.CveEmpresa) Then - ' CveConcepto = 98 - ' Cuenta = "Nominas por Pagar" - ' IdCuenta = ObjConta.DtResultados(0)("IdCtaContable").ToString.ToEntero - ' Concepto = "Pago Nomina" - ' Referencia = "Pago Nomina" - ' Else - ' Concepto = drt("NombreCompleto") - ' Referencia = "" - ' CveConcepto = drt("CveConceptoContable").ToString.ToEntero - ' Cuenta = drt("ConceptoContable").ToString - ' IdCuenta = drt("IdCtaContable").ToString.ToEntero - ' End If - - ' Dim drr As DataRow = DtCuentasContables.FiltroPrimero($"Id={IdCuenta}") - ' CodigoCuenta = If(drr IsNot Nothing, drr("CuentaFormato").ToString(), "") - ' NombreCuenta = If(drr IsNot Nothing, drr("Nombre").ToString(), "") - - ' TipoMovto = drt("TipoMovto") - - ' If TipoMovto = 0 Then - ' dr("Cargo") = Math.Abs(drt("Importe").ToString.ToDecimal) - ' dr("Abono") = 0 - ' Else - ' dr("Cargo") = 0 - ' dr("Abono") = Math.Abs(drt("Importe").ToString.ToDecimal) - ' End If - - ' dr("IdCuenta") = IdCuenta - ' dr("CodigoCuenta") = CodigoCuenta & "
" & NombreCuenta - ' dr("Cuenta") = Cuenta - ' dr("Concepto") = Concepto - ' dr("Descripcion") = Concepto - ' dr("Referencia") = Referencia - ' dr("TipoMovto") = TipoMovto - ' dr("EsComodin") = EsComodin - ' dr("CveConcepto") = CveConcepto - ' dr("CveProveedor") = "-1" - ' dr("CveSubProyecto") = drt("CveSubProyecto") - ' dr("CvePersonal") = drt("CvePersonal") - ' dr("CveClasificacion") = drt("CveClasificacion") - ' dr("CveTipoGasto") = drt("CveTipoGasto") - - ' DtMovimientos.Rows.Add(dr) - ' Next - - ' GvMov.DataSource = DtMovimientos - ' GvMov.DataBind() - ' UPMovs.Update() - ' End If - - 'End Sub - Private Sub CargaPrePoliza() BtnEliminar.Visible = True LblEncabezado.Text = "Edición de Póliza" @@ -864,16 +790,7 @@ Partial Class ContabilidadC_RegPrePolizaS IdCuenta = 0 CodigoCuenta = "" NombreCuenta = "" - 'If drt("IdCtaContable").ToString.ToEntero > 0 Then 'DtCuentasContables - ' Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", drt("IdCtaContable").ToString)) - ' If drr IsNot Nothing Then - ' IdCuenta = drt("IdCtaContable").ToString.ToEntero - ' CodigoCuenta = drr("CuentaFormato").ToString() - ' NombreCuenta = drr("Nombre").ToString() - ' 'Cuenta = drr("Nombre").ToString() - ' End If - ' EsComodin = 0 - 'End If + Dim dr As DataRow = DtMovimientos.NewRow @@ -894,7 +811,7 @@ Partial Class ContabilidadC_RegPrePolizaS dr("MultipleSubProyecto") = drt("MultipleSubProyecto") dr("CveCuenta") = drt("CveCuenta") dr("EsComplementaria") = drt("EsComplementaria") - 'dr("FolioPoliza") = 0 'drt("FolioPoliza") + dr("EsMonedaExtranjera") = drt("EsMonedaExtranjera") DtMovimientos.Rows.Add(dr) Next @@ -1100,19 +1017,17 @@ Partial Class ContabilidadC_RegPrePolizaS TmpAbono = TmpAbono + Importe TipoMovto = True - If gvr.DataKey("EsComplementaria") = "True" Then - ImporteME = gvr.FCTextBox("TxtAbonoME").Text.ToDecimal - TipoCambio = gvr.FCTextBox("TipoCambio").Text.ToDecimal - End If + If gvr.DataKey("EsComplementaria") = "True" Then ImporteME = gvr.FCTextBox("TxtAbonoME").Text.ToDecimal + If gvr.DataKey("EsMonedaExtranjera") = "True" Then TipoCambio = gvr.FCTextBox("TC").Text.ToDecimal + Else Importe = gvr.DataKey("Abono").ToDecimal TmpAbono = TmpAbono + Importe TipoMovto = True - If gvr.DataKey("EsComplementaria") = "True" Then - ImporteME = gvr.DataKey("MonedaExtranjera").ToDecimal - TipoCambio = gvr.DataKey("TipoCambio").ToDecimal - End If + If gvr.DataKey("EsComplementaria") = "True" Then ImporteME = gvr.DataKey("ImporteME").ToDecimal + If gvr.DataKey("EsMonedaExtranjera") = "True" Then TipoCambio = gvr.DataKey("TC").ToDecimal + End If Else If TipoGrid = 0 Then 'gvmov @@ -1120,22 +1035,16 @@ Partial Class ContabilidadC_RegPrePolizaS TmpCargo = TmpCargo + Importe TipoMovto = False - If gvr.DataKey("EsComplementaria") = "True" Then - ImporteME = gvr.FCTextBox("TxtCargoME").Text.ToDecimal - TipoCambio = gvr.FCTextBox("TxtTC").Text.ToDecimal - End If + If gvr.DataKey("EsComplementaria") = "True" Then ImporteME = gvr.FCTextBox("TxtAbonoME").Text.ToDecimal + If gvr.DataKey("EsMonedaExtranjera") = "True" Then TipoCambio = gvr.FCTextBox("TC").Text.ToDecimal Else Importe = gvr.DataKey("Cargo").ToDecimal TmpCargo = TmpCargo + Importe TipoMovto = False - If gvr.DataKey("EsComplementaria") = "True" Then - ImporteME = gvr.DataKey("MonedaExtranjera").ToDecimal - TipoCambio = gvr.DataKey("TipoCambio").ToDecimal - End If + If gvr.DataKey("EsComplementaria") = "True" Then ImporteME = gvr.DataKey("ImporteME").ToDecimal + If gvr.DataKey("EsMonedaExtranjera") = "True" Then TipoCambio = gvr.DataKey("TC").ToDecimal End If - - End If If Not gvr.DataKey("CveConceptoContable").Contiene("30", "10") Then ' 30-bancos, 10-anticipos proveedores @@ -1153,16 +1062,19 @@ Partial Class ContabilidadC_RegPrePolizaS End If If Importe <> 0 Then Dim tCveCuenta As Integer = gvr.DataKey("CveCuenta").ToEntero + Dim tReferencia, tConcepto As String + Dim tCveSubProyecto, tCveTipoGasto As Integer - Dim tReferencia As String = gvr.DataKey("Referencia") - Dim tConcepto As String = gvr.DataKey("Concepto") - Dim tCveSubProyecto As Integer = gvr.DataKey("CveSubProyecto").ToEntero - Dim tCveTipoGasto As Integer = gvr.DataKey("CveTipoGasto").ToEntero If TipoGrid = 0 Then 'gvmov tReferencia = gvr.FCLiteral("LtlReferencia").Text tConcepto = gvr.FCTextBox("TxtConcepto").Text tCveSubProyecto = gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero tCveTipoGasto = gvr.FCDropDownList("DdlTipoGasto").SelectedValue.ToEntero + Else + tReferencia = gvr.DataKey("Referencia") + tConcepto = gvr.DataKey("Concepto") + tCveSubProyecto = gvr.DataKey("CveSubProyecto").ToEntero + tCveTipoGasto = gvr.DataKey("CveTipoGasto").ToEntero End If If ObjMov.AddPrePolizasDetalle(CvePrePolizaInsertada, TipoMovto, Importe, tReferencia, gvr.DataKey("CveConceptoContable").ToEntero, tConcepto, @@ -1199,7 +1111,6 @@ Partial Class ContabilidadC_RegPrePolizaS MsgError = $"Error {ex.Message}" End Try - If ContRegInsertados = 0 Then MsgError = $"No se insertaron registros (Revise que los importes de los registros contengan valores)" End If @@ -1346,12 +1257,6 @@ Partial Class ContabilidadC_RegPrePolizaS DdlConceptosContablesE_SelectedIndexChanged(DdlConceptosContablesE, e) TxtTipoCambio.Text = GvPrePoliza.Rows(IndiceGrid).DataKey("TC").ToString.ToDecimal.ToString("###,###,###.00") - DdlModalConceptoTipoTransaccion.SelectedValueExist(GvPrePoliza.Rows(IndiceGrid).DataKey("ContadoTipoTransaccion")) - DdlModalConceptoCuenta.SelectedValueExist(GvPrePoliza.Rows(IndiceGrid).DataKey("ContadoCuenta")) - TxtModalConceptoDocumentoFolio.Text = GvPrePoliza.Rows(IndiceGrid).DataKey("ContadoNumeroFolio") - TxtModalConceptoDocumentoBeneficiario.Text = GvPrePoliza.Rows(IndiceGrid).DataKey("ContadoBeneficiario") - TxtModalConceptoDocumentoObservaciones.Text = GvPrePoliza.Rows(IndiceGrid).DataKey("ContadoObservaciones") - TxtModalConceptoDocumentoImporte.Text = GvPrePoliza.Rows(IndiceGrid).DataKey("ContadoImporte").ToDecimal.ToString("###,###,###.00") TxtME.Text = GvPrePoliza.Rows(IndiceGrid).DataKey("ImporteME").ToDecimal.FormatoNumero @@ -1396,11 +1301,22 @@ Partial Class ContabilidadC_RegPrePolizaS TxtAbonoE.Text = Abono End If - If Abono = 0 Then - CargaModalConceptoTipoTransaccion("Ing") - Else - CargaModalConceptoTipoTransaccion("Egs") + If CveConceptoContable = 30 Then + If Abono = 0 Then + CargaModalConceptoTipoTransaccion("Ing") + Else + CargaModalConceptoTipoTransaccion("Egs") + End If + DdlModalConceptoTipoTransaccion.SelectedValueExist(GvPrePoliza.Rows(IndiceGrid).DataKey("ContadoTipoTransaccion")) + DdlModalConceptoCuenta.SelectedValueExist(GvPrePoliza.Rows(IndiceGrid).DataKey("ContadoCuenta")) + TxtModalConceptoDocumentoFolio.Text = GvPrePoliza.Rows(IndiceGrid).DataKey("ContadoNumeroFolio") + TxtModalConceptoDocumentoBeneficiario.Text = GvPrePoliza.Rows(IndiceGrid).DataKey("ContadoBeneficiario") + TxtModalConceptoDocumentoObservaciones.Text = GvPrePoliza.Rows(IndiceGrid).DataKey("ContadoObservaciones") + TxtModalConceptoDocumentoImporte.Text = GvPrePoliza.Rows(IndiceGrid).DataKey("ContadoImporte").ToDecimal.ToString("###,###,###.00") + End If + + UpModalConcepto.Update() End Sub @@ -1414,6 +1330,7 @@ Partial Class ContabilidadC_RegPrePolizaS Private Sub CargaConceptosContablesE() DdlConceptosContablesE.DataSource = GlobalDTContaConceptosContables(-1) DdlConceptosContablesE.DataBind() + DdlConceptosContablesE.Items.Insert(0, New ListItem(" - ", "-1")) End Sub Private Sub CargaSubProyectoE() DdlSubProyectoE.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) @@ -1603,23 +1520,24 @@ Partial Class ContabilidadC_RegPrePolizaS End Sub Private Sub CargaClientesE() DdlClientesE.setEsWebService(True) + DdlClientesE.Attributes.Add("data-metodo", "getcliente") - DdlClientesE.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa) - DdlClientesE.DataBind() + 'DdlClientesE.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa) + 'DdlClientesE.DataBind() ' DdlClientes.Items.Insert(0, New ListItem(" - ", "-1")) End Sub Private Sub CargaVentasE(CveCliente As Integer, Optional CveMoneda As Integer = -1) DvModalconceptoVenta.Visible = True - Dim ObjVentas As New ClsVentas - + DdlVentasE.DataSource = Nothing DdlVentasE.ClearSelection() + + Dim ObjVentas As New ClsVentas If ObjVentas.GetVentas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1", CveCliente, -1, -1, -1, "-1", "-1", "-1", CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then If CveMoneda = 2 Then DdlVentasE.DataSource = ObjVentas.DtResultados.FiltraParametros("CveMoneda = 2") Else DdlVentasE.DataSource = ObjVentas.DtResultados.FiltraParametros("CveMoneda = 1") End If - DdlVentasE.DataBind() DdlVentasE.Items.Insert(0, New ListItem(" - ", "-1")) Else @@ -1657,10 +1575,16 @@ Partial Class ContabilidadC_RegPrePolizaS End Sub Private Function CargaValidacionesConcepto() As Boolean - Dim Retorno As Boolean = true + Dim Retorno As Boolean = True + + If DdlConceptosContablesE.SelectedValue <= 0 Then + Alert("No se ha especificado el concepto", TipoMensaje.ToastAdventencia) + Return False + End If If DrConceptoContable IsNot Nothing Then Dim AplicaComplementaria = Boolean.Parse(DrConceptoContable("EsComplementaria").ToString) + Dim AplicaBancos = Boolean.Parse(DrConceptoContable("AplicaBancos").ToString) If AplicaComplementaria Then Dim Importe As Decimal = IIf(TxtCargoE.Text.ToDecimal <> 0, TxtCargoE.Text.ToDecimal, TxtAbonoE.Text.ToDecimal) @@ -1675,6 +1599,13 @@ Partial Class ContabilidadC_RegPrePolizaS End If End If + If AplicaBancos Then + If DdlModalConceptoTipoTransaccion.SelectedValue.ToEntero <= 0 Then + Alert("seleccione las opciones de bancos ") + Retorno = False + End If + End If + End If Return Retorno End Function @@ -1716,6 +1647,21 @@ Partial Class ContabilidadC_RegPrePolizaS If DdlComprasE.Visible = True AndAlso DdlComprasE.SelectedValue.ToEntero > 0 Then dr("FolioFactura") = DdlComprasE.SelectedItem.ToString() If DdlVentasE.Visible = True AndAlso DdlVentasE.SelectedValue.ToEntero > 0 Then dr("FolioFactura") = DdlVentasE.SelectedItem.ToString() dr("Modificado") = True + dr("TC") = TxtTipoCambio.Text.ToDecimal + + dr("ContadoCuenta") = DdlModalConceptoCuenta.SelectedValue.ToEntero + dr("ContadoTipoTransaccion") = DdlModalConceptoTipoTransaccion.SelectedValue.ToEntero + dr("ContadoNumeroFolio") = TxtModalConceptoDocumentoFolio.Text + dr("ContadoBeneficiario") = TxtModalConceptoDocumentoBeneficiario.Text + dr("ContadoObservaciones") = TxtModalConceptoDocumentoObservaciones.Text + dr("ContadoImporte") = dr("ImporteMN").ToString + + If DrConceptoContable IsNot Nothing Then + dr("EsComplementaria") = DrConceptoContable("EsComplementaria") + dr("EsMonedaExtranjera") = DrConceptoContable("EsMonedaExtranjera") + + If dr("EsMonedaExtranjera") = "True" Then dr("ImporteME") = TxtME.Text.ToDecimal + End If If DdlPorcentajeIVAE.Visible Then dr("PorcentajeImpuesto") = DdlPorcentajeIVAE.SelectedValue.ToDecimal @@ -1735,7 +1681,7 @@ Partial Class ContabilidadC_RegPrePolizaS UpTotalCargo.Update() UpTotalAbono.Update() If Not ChkSeguir.Checked Then RegistraScript("$('#DivEditConcepto').modal('hide')", "hidemodal") - + Alert("Concepto Registrado", TipoMensaje.ToastInformacion) Else Dim CvePrePolizaDetalle As Integer = GvPrePoliza.DataKeys(IndiceGrid).Value.ToString.ToEntero @@ -1775,14 +1721,22 @@ Partial Class ContabilidadC_RegPrePolizaS dr("TC") = TxtTipoCambio.Text.ToDecimal + If DrConceptoContable IsNot Nothing Then + dr("EsComplementaria") = DrConceptoContable("EsComplementaria") + dr("EsMonedaExtranjera") = DrConceptoContable("EsMonedaExtranjera") + + If dr("EsMonedaExtranjera") = "True" Then dr("ImporteME") = TxtME.Text.ToDecimal + + End If + dr("PorcentajeImpuesto") = DdlPorcentajeIVAE.SelectedValue.ToDecimal If TxtCargoE.Text <> "" Then dr("Cargo") = TxtCargoE.Text.ToDecimal - dr("Abono") = "".ToDecimal + dr("Abono") = 0 Else dr("Abono") = TxtAbonoE.Text.ToDecimal - dr("Cargo") = "".ToDecimal + dr("Cargo") = 0 End If DtMovimientos.AcceptChanges() @@ -2355,8 +2309,6 @@ Partial Class ContabilidadC_RegPrePolizaS DtMovimientos.Clear() - Dim ObjConta As New ClsContabilidad() - ObjConta.IniciaTransacSQL() Try Dim ContadorRegistros As Integer = 2 @@ -2514,16 +2466,15 @@ Partial Class ContabilidadC_RegPrePolizaS DtMovimientos.AcceptChanges() End If ContadorRegistros = ContadorRegistros + 1 - Next - TxtTotalCargos.Text = DtMovimientos.SUMD("Cargo").ToString.FormatoNumero - TxtTotalAbonos.Text = DtMovimientos.SUMD("Abono").ToString.FormatoNumero - GvPrePoliza.DataSource = DtMovimientos GvPrePoliza.DataBind() UpPrePoliza.Update() + TxtTotalCargos.Text = DtMovimientos.SUMD("Cargo").ToString.FormatoNumero + TxtTotalAbonos.Text = DtMovimientos.SUMD("Abono").ToString.FormatoNumero + Catch ex As Exception Alert("No se pudo cargar el excel", TipoMensaje.MsgAdvertencia) GuardaLog(ex.Message) diff --git a/Contabilidad2/Reportes/RepSituacionFinanciera.rdlc b/Contabilidad2/Reportes/RepSituacionFinanciera.rdlc index 6c35c1cfe..288ba1a15 100644 --- a/Contabilidad2/Reportes/RepSituacionFinanciera.rdlc +++ b/Contabilidad2/Reportes/RepSituacionFinanciera.rdlc @@ -2138,7 +2138,7 @@ - =Iif( Round(Math.Abs(Variables!TotalActivoActual.Value-Variables!TotalpasivoYHaciendaActual.Value),2) <.005,"" ,"La suma de los totales estan descuadradas." & round(Math.Abs(Variables!TotalActivoAnterior.Value-Variables!TotalpasivoYHaciendaAnterior.Value),2)) + =Iif( Round(Math.Abs(Variables!TotalActivoActual.Value-Variables!TotalpasivoYHaciendaActual.Value),2) <.005,"" ,"La suma de los totales estan descuadradas." & Round(Math.Abs(Variables!TotalActivoActual.Value-Variables!TotalpasivoYHaciendaActual.Value),2)) + + VERSION 3.3 + + - ="<br/><b>Próxima Rotación y Balanceo: </b>" & FormatDateTime(CDate(Parameters!Fecha.Value).AddMonths(6), DateFormat.ShortDate) & "<br/<b>Próxima Alineación: </b>" & FormatDateTime(CDate(Parameters!Fecha.Value).AddMonths(6), DateFormat.ShortDate) + ="<br/><b>Próxima Rotación y Balanceo: </b>" & FormatDateTime(CDate(Parameters!Fecha.Value).AddMonths(6), DateFormat.ShortDate) & " <b>Próxima Alineación: </b>" & FormatDateTime(CDate(Parameters!Fecha.Value).AddMonths(6), DateFormat.ShortDate) HTML @@ -2939,10 +2945,10 @@ Textbox90 - 1.88947cm - 6.75122cm - 0.82021cm - 5.51336cm + 1.77125cm + 7.90108cm + 0.78cm + 4.3635cm 31 - - true - true - true - - - - - < ** Toda corrección de los datos del comprobante debera efectuarse a más tardar tres dias despues de su expedición. ** > - - - - - - 2pt - 2pt - 2pt - 2pt - - Database =System.Convert.FromBase64String(Parameters!QRDescarga.Value) image/png FitProportional - 9.9935in + 9.3435in 6.67743in 0.6035in 0.78275in - 35 + 34 @@ -3130,11 +3098,11 @@ Textbox60 - 24.4593cm + 22.8083cm 0.28014cm 1.49135cm 5.37042cm - 36 + 35 @@ -3160,11 +3128,11 @@ Textbox5 - 20.69665cm + 19.7759cm 0.14007cm 0.05496cm 20.88652cm - 37 + 36 @@ -3191,11 +3159,11 @@ Textbox5 - 27.44203cm + 25.69578cm 0.28014cm 0.05496cm 20.88652cm - 38 + 37 @@ -3285,11 +3253,11 @@ Textbox60 - 24.4593cm + 22.8083cm 7.45145cm 2.45709cm 6.56105cm - 39 + 38 @@ -3324,11 +3292,11 @@ Textbox60 - 24.44952cm + 22.79852cm 14.67145cm 1.46939cm 6.32076cm - 40 + 39 @@ -3363,11 +3331,11 @@ Textbox15 - 8.42892cm + 7.98442cm 1.15361cm 1.05791cm 19.15078cm - 41 + 40 =IIF((Sum(IIF(Fields!CveClasificacion.Value = 20345,1,0), "DsOC") > 0),false,true) @@ -3832,11 +3800,11 @@ true - 20.92547cm + 19.97297cm 0.13424cm 2.25247cm 20.89818cm - 42 + 41 =Microsoft.VisualBasic.Interaction.IIF(First(Fields!SerieFolio.Value, "DataSet4") <> "", False, True) @@ -3853,15 +3821,27 @@ - Acepto ajuste + Acepto ajuste - _______________________ + ____________________ + + + + - + true + true true - VERSION 3.3 + < ** Toda corrección de los datos del comprobante debera efectuarse a más tardar tres dias despues de su expedición. ** > @@ -3925,12 +3908,12 @@ - Textbox5 - 23.28377cm - 17.70088cm - 0.6cm - 3.32021cm - 45 + Textbox4 + 9.73684cm + 0.20617cm + 0.44183cm + 20.83436cm + 44 @@ -3942,7 +3925,7 @@ - 27.49699cm + 25.75074cm - - - - - - - - Camelia, #346, Col.:Luis Encinas, - - - - - - - - - C.P. 83138 Hermosillo - - - - - - - - - + R.F.C ENO970305TL4 + + true + true + + + + + Nombre: + + + + + + + + + + + + + + + #c4d79b + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + =Parameters!ClienteNombre.Value + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + true @@ -4792,11 +4833,11 @@ Textbox19 - 1.37495in - 5.662in - 0.23161in - 2.24597in - 16 + 1.38745in + 5.61883in + 0.2092in + 2.26391in + 18 - 22.89117cm + 23.58967cm @@ -291,7 +291,7 @@ - SerieLote + Serie @@ -1622,7 +1622,7 @@ - SerieLote + Serie + true @@ -3033,8 +3034,8 @@ =Parameters!LogoPath.Value FitProportional 0.12943cm - 2.25453cm - 4.18606cm + 2.25804cm + 3.29186cm 4 - =Parameters!NombreEmpresa.Value - Textbox1 - 4.49188cm + 3.53938cm 0.6cm - 13.51378cm + 17.07793cm 5 @@ -3104,7 +3100,7 @@ @@ -3116,9 +3112,9 @@ Textbox2 0.90456cm - 4.55144cm + 3.59894cm 0.66174cm - 11.39711cm + 17.01837cm 6 + + + Textbox11 + + + + Black + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + 4 + + + + + + + + + 0.6cm + + + + + true + true + + + + + Manifiesto N° + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!NoEmbarque.Value + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Empaque + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + 0.6cm + + + + + true + true + + + + + Fecha Embarque: + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + true + true + + + + + Hora Salida: + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + 0.6cm + + + + + true + true + + + + + =Parameters!Fecha.Value + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + true + true + + + + + =Parameters!Hora.Value + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + 0.6cm + + + + + true + true + + + + + F. F. Registration N° + + + + Black + + 2pt + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + true + true + + + + + <USDA REGISTRATION> + + + + + + + Textbox25 + + + + Black + + 2pt + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + + + + + + + + + + + + + + + + + + + 0.3175cm + 9.78675cm + 3cm + 9.55022cm + + + + + + Embedded + logojam + FitProportional + 0.20354cm + 0.19717cm + 2.79646cm + 4.89479cm + 1 + + + + + + + + + 1.97083cm + + + 4.15334cm + + + 0.38333cm + + + 2.68521cm + + + 5.07938cm + + + + + 0.6cm + + + + + true + true + + + + + =Parameters!NoBultos.Value + + + + + + + Textbox4 + + + + Black + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Bultos Manifestados + + + + + + + Black + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!NoKgManifiesto.Value + + + + + + + Textbox8 + + + + Black + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Kgs. Manifestados + + + + + + + Black + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.38833cm + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + =Parameters!NoPallets.Value + + + + + + + Textbox6 + + + + Black + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Pallets Manifestados + + + + + + + Black + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + + + + + 19.44425cm + 3.27925cm + 1.58833cm + 14.27209cm + 2 + + + + + + + + + 2.60646cm + + + 2.39354cm + + + 2.07667cm + + + 2.07667cm + + + 0.38333cm + + + 2.92334cm + + + 1.97084cm + + + 2.31479cm + + + 2.34125cm + + + + + 0.6cm + + + + + true + true + + + + + ORIGEN / SHIPPER + + + + + + + Textbox264 + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + 4 + + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + DESTINO / CONSIGNE + + + + + + + Textbox269 + + 1.5pt + + + Black + + 1.5pt + + + Black + + 1.5pt + + + Black + + 1.5pt + + + Black + + 1.5pt + + 2pt + 2pt + 2pt + 2pt + + + 4 + + + + + + + + + 0.6cm + + + + + true + true + + + + + Embarcador: + + + + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + AGROPECUARIA JAM, S.A. DE C.V. + + + + + + + Textbox256 + + + 2pt + 2pt + 2pt + 2pt + + + 3 + + + + + + + + true + true + + + + + + + + + + + + Black + + 2pt + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Distribuidor: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!Cliente.Value + + + + + + + Textbox261 + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + 3 + + + + + + + + 0.6cm + + + + + true + true + + + + + Direccion: + + + + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + CARR. A BAHIA DE KINO KM12 + + + + + + + Textbox247 + + + 2pt + 2pt + 2pt + 2pt + + + 3 + + + + + + + + true + true + + + + + + + + + + + + Black + + 2pt + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Domic.: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!Direccion.Value + + + + + + + Textbox252 + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + 3 + + + + + + + + 0.6cm + + + + + true + true + + + + + Ciudad: + + + + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + HERMOSILLO, SONORA + + + + + + + Textbox238 + + + 2pt + 2pt + 2pt + 2pt + + + 3 + + + + + + + + true + true + + + + + + + + + + + + Black + + 2pt + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Lugar: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox243 + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + 3 + + + + + + + + 0.6cm + + + + + true + true + + + + + Reg. Fed. Con.: + + + + + + + Black + + 2pt + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + AJA9809264V2 + + + + + + + Textbox229 + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + 3 + + + + + + + + true + true + + + + + + + + + + + + Black + + 2pt + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Reg. Fed. Con.: + + + + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox234 + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Mercado: + + + + + + + Textbox55 + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!Mercado.Value + + + + + + + Textbox60 + + + + Black + + 2pt + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.30896cm + + + + + true + true + + + + + + + + + + + + Textbox177 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox178 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox179 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox180 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox182 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox183 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox184 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox217 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + TRANSPORTE / TRANSPORTATION + + + + + + + Textbox132 + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + 9 + + + + + + + + + + + + + + 0.6cm + + + + + true + true + + + + + Linea de Trans: + + + + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!LineaTransportacion.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Reg. Fed. Con.: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + 3 + + + + + + + + 0.6cm + + + + + true + true + + + + + Chofer: + + + + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!Chofer.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + N° de Factura: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!NoFactura.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + Medio: + + + + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Trailer + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!NumeroTrailer.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Temperatura: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!Temperatura.Value + + + + °F + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + N° Placa Camion: + + + + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!CamPlaca.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Marca: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!Camion.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + N° de Caja: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!Remolque1.Value + + + + + + + Textbox9 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Placa Caja: + + + + + + + Textbox158 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!Rem1Placa.Value + + + + + + + Textbox10 + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + SCAC: + + + + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!SCAC.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Longitud Caja: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!LongitudCaja.Value + + + + + + + Textbox163 + + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + true + true + + + + + + + + + + + + Textbox223 + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + CAAT: + + + + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!CAAT.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + 3 + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + N° Sello CTPAT + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox191 + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + 3 + + + + + + + + 0.6cm + + + + + true + true + + + + + Anticipo Flete: + + + + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Flete: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + 0.00 + + + + + + + Textbox196 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Sellos de Seguridad: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox199 + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + 3 + + + + + + + + 0.6cm + + + + + true + true + + + + + Observaciones: + + + + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + FARMER PACKER + + + + =Parameters!SubProyecto.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + 3 + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox207 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox208 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox226 + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + GGN: + + + + + + + Textbox209 + + + + Black + + 2pt + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!Permiso.Value + + + + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + 3 + + + + + + + + true + true + + + + + + + + + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox215 + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox216 + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox227 + + + + Black + + 2pt + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.2825cm + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + AGENCIA ADUANAL MEXICANA / MEXICAN CUSTOM + + + + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + 4 + + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + AGENCIA ADUANAL AMERICANA / U.S. CUSTOM + + + + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + 4 + + + + + + + + + 0.6cm + + + + + true + true + + + + + A. Ad. Mexico + + + + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!AgenciaAduanalMEX.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + 3 + + + + + + + + true + true + + + + + + + + + + + + Black + + 2pt + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + A. Ad. Mexico + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!AgenciaAduanalUSA.Value + + + + + + + Textbox370 + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + 3 + + + + + + + + 0.6cm + + + + + true + true + + + + + Reg. Fed. Con.: + + + + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + 3 + + + + + + + + true + true + + + + + + + + + + + + Black + + 2pt + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Reg. Fed. Con.: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox379 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox380 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox381 + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + Domicilio: + + + + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + 3 + + + + + + + + true + true + + + + + + + + + + + + Black + + 2pt + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Domicilio: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox388 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox389 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox390 + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + Lugar: + + + + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + 3 + + + + + + + + true + true + + + + + + + + + + + + Black + + 2pt + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Lugar: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox397 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox398 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox399 + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + Cod. Postal: + + + + + + + Black + + 2pt + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + 3 + + + + + + + + true + true + + + + + + + + + + + + Black + + 2pt + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Cod. Postal: + + + + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox406 + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox407 + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox408 + + + + Black + + 2pt + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.36187cm + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox415 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox416 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox417 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 3.49239cm + 0.25008cm + 13.55333cm + 19.08689cm + 3 + + + + + + + + + 1.73271cm + + + 1.68042cm + + + 5.85895cm + + + 3.10853cm + + + 3.16148cm + + + 3.5448cm + + + + + 0.6cm + + + + + true + true + + + + + Pallets + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Bultos + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Descripción + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Tarima + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Etiqueta + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Envase + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + =Fields!NoPallets.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!NoCajas.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Manifiesto.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Etiqueta.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Envase.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Campo + + + + =Parameters!SubProyecto.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + + After + + + + + + Before + + + + DataSet1 + 17.30058cm + 0.25008cm + 1.8cm + 19.08689cm + 4 + + + + + + 8.28054in +