diff --git a/Acumuladores/CatFoliosGarantia.aspx b/Acumuladores/CatFoliosGarantia.aspx index 9d44d0e67..3089b032b 100644 --- a/Acumuladores/CatFoliosGarantia.aspx +++ b/Acumuladores/CatFoliosGarantia.aspx @@ -138,29 +138,29 @@   - +   - +   - +   - - + +   - + @@ -170,23 +170,16 @@ - + - + - - - - - + - - - - + diff --git a/Acumuladores/CatGarantiasMeses.aspx b/Acumuladores/CatGarantiasMeses.aspx index 867b0fbc4..d9cca1c6c 100644 --- a/Acumuladores/CatGarantiasMeses.aspx +++ b/Acumuladores/CatGarantiasMeses.aspx @@ -189,7 +189,6 @@ Agregar Garantía de Mes
- -
-
diff --git a/Acumuladores/CatGarantiasMeses.aspx.vb b/Acumuladores/CatGarantiasMeses.aspx.vb index 190f4dd6c..1faba2cbf 100644 --- a/Acumuladores/CatGarantiasMeses.aspx.vb +++ b/Acumuladores/CatGarantiasMeses.aspx.vb @@ -76,6 +76,8 @@ Partial Class Acumuladores_CatFoliosGarantia DdlMarca.DataBind() DdlMarca.Items.Insert(0, New ListItem("Todos", "-1")) DdlMarca.SelectedValue = "-1" + DdlMarcaM.DataSource = GlobalDTGralMarcas(UsuarioActual.CveEmpresa) + DdlMarcaM.DataBind() DdlTipoUso.DataSource = GlobalDTAcumTiposUso(UsuarioActual.CveEmpresa) DdlTipoUso.DataBind() diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 5065ed3e2..5e970d841 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -161,7 +161,7 @@ Public Class ClsVentas Return Retorno End Function - Public Function GetVenta(CveVenta As Integer, CveEmpresa As Integer, Optional VerificaAlmacen As Boolean = True) As Boolean + Public Function GetVenta(CveVenta As Integer, CveEmpresa As Integer, Optional VerificaAlmacen As Boolean = False) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_VentasGet") diff --git a/App_Code/modExtensiones.vb b/App_Code/modExtensiones.vb index ed867167f..c9901fe10 100644 --- a/App_Code/modExtensiones.vb +++ b/App_Code/modExtensiones.vb @@ -2405,21 +2405,35 @@ Namespace Extensiones Dim indexRowGV As Integer = 0 Dim cssClassRow As String = "" + Dim CountRowFiltros As Integer = -1 + If DatosFiltros.Trim.Length > 0 Then + CountRowFiltros = 0 + End If + For indexRow = 8 To worksheet.Rows.Count - 4 Try cssClassRow = GridView.Rows(indexRowGV).CssClass.Trim() Select Case cssClassRow + + Case "Totales" + worksheet.Cells.GetSubrangeRelative(indexRow + CountRowFiltros, 0, celdasConTexto.LastColumnIndex + 1, 1).Style.FillPattern.SetSolid(System.Drawing.ColorTranslator.FromHtml("#67809f")) + worksheet.Cells.GetSubrangeRelative(indexRow + CountRowFiltros, 0, celdasConTexto.LastColumnIndex + 1, 1).Style.Font.Weight = 1000 + worksheet.Cells.GetSubrangeRelative(indexRow + CountRowFiltros, 0, celdasConTexto.LastColumnIndex + 1, 1).Style.Font.Color = System.Drawing.ColorTranslator.FromHtml("#ddd") + Exit Select Case "SubTotales2" - worksheet.Cells.GetSubrangeRelative(indexRow - 1, 0, celdasConTexto.LastColumnIndex + 1, 1).Style.FillPattern.SetSolid(System.Drawing.ColorTranslator.FromHtml("#c0c0c0")) - worksheet.Cells.GetSubrangeRelative(indexRow - 1, 0, celdasConTexto.LastColumnIndex + 1, 1).Style.Font.Weight = 1000 - worksheet.Cells.GetSubrangeRelative(indexRow - 1, 0, celdasConTexto.LastColumnIndex + 1, 1).Style.Font.Color = System.Drawing.ColorTranslator.FromHtml("#000077") + worksheet.Cells.GetSubrangeRelative(indexRow + CountRowFiltros, 0, celdasConTexto.LastColumnIndex + 1, 1).Style.FillPattern.SetSolid(System.Drawing.ColorTranslator.FromHtml("#c0c0c0")) + worksheet.Cells.GetSubrangeRelative(indexRow + CountRowFiltros, 0, celdasConTexto.LastColumnIndex + 1, 1).Style.Font.Weight = 1000 + worksheet.Cells.GetSubrangeRelative(indexRow + CountRowFiltros, 0, celdasConTexto.LastColumnIndex + 1, 1).Style.Font.Color = System.Drawing.ColorTranslator.FromHtml("#000077") + Exit Select Case "SubTotales" - worksheet.Cells.GetSubrangeRelative(indexRow - 1, 0, celdasConTexto.LastColumnIndex + 1, 1).Style.FillPattern.SetSolid(System.Drawing.ColorTranslator.FromHtml("#dddddd")) - worksheet.Cells.GetSubrangeRelative(indexRow - 1, 0, celdasConTexto.LastColumnIndex + 1, 1).Style.Font.Weight = 1000 - worksheet.Cells.GetSubrangeRelative(indexRow - 1, 0, celdasConTexto.LastColumnIndex + 1, 1).Style.Font.Color = System.Drawing.ColorTranslator.FromHtml("#67809F") + worksheet.Cells.GetSubrangeRelative(indexRow + CountRowFiltros, 0, celdasConTexto.LastColumnIndex + 1, 1).Style.FillPattern.SetSolid(System.Drawing.ColorTranslator.FromHtml("#dddddd")) + worksheet.Cells.GetSubrangeRelative(indexRow + CountRowFiltros, 0, celdasConTexto.LastColumnIndex + 1, 1).Style.Font.Weight = 1000 + worksheet.Cells.GetSubrangeRelative(indexRow + CountRowFiltros, 0, celdasConTexto.LastColumnIndex + 1, 1).Style.Font.Color = System.Drawing.ColorTranslator.FromHtml("#67809F") + Exit Select Case Else + Exit Select End Select Catch ex As Exception diff --git a/Bancos/PagoAcreedor.aspx.cs b/Bancos/PagoAcreedor.aspx.cs index 958844dd5..df4599748 100644 --- a/Bancos/PagoAcreedor.aspx.cs +++ b/Bancos/PagoAcreedor.aspx.cs @@ -73,20 +73,7 @@ public partial class Bancos_PagoAcreedor : ClsPaginas ViewState["IDCtaContableAcreedorComplementaria"] = value; } } - - private bool UsaComplementaria - { - get - { - return Convert.ToBoolean(ViewState["UsaComplementaria"]); - } - - set - { - ViewState["UsaComplementaria"] = value; - } - } - + private int CveMonedaCuentaPago { get @@ -110,10 +97,9 @@ public partial class Bancos_PagoAcreedor : ClsPaginas protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) - { - UsaComplementaria = true; + { CveMonedaCuentaPago = 0; - rowComisiones.Visible = UsuarioActual.CveEmpresa.Contiene(1, 4, 5, 7, 11, 12, 72, 80, 126, 119, 122); + rowComisiones.Visible = true; CargaTipoTransaccion(); CargaCuentas(); @@ -306,7 +292,7 @@ public partial class Bancos_PagoAcreedor : ClsPaginas { decimal ImporteBanco = TxtImporte.Text.ToDecimal(); decimal ImporteMNBanco = ImporteBanco; - decimal ImporteComplementaria = 0; + decimal ImporteComplementaria = 0; decimal TCPago = TxtTCPago.Text.ToDecimal(); string Conc = TxtObservaciones.Text == "" ? TxtFolio.Text : TxtObservaciones.Text; string Ref = TxtObservaciones.Text == "" ? TxtFolio.Text : TxtObservaciones.Text; @@ -318,16 +304,13 @@ public partial class Bancos_PagoAcreedor : ClsPaginas if (CveIE > 0) { - //GUARDA COMPROBANTE - if (!filemove.Equals("")) - { - filemove.FilesMove(CveIE.ToString(), string.Format(@"{0}IE", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase: false); - } + decimal Importe; decimal ImporteMN; decimal ImporteComision; decimal ImporteComisionMN; decimal AcumImporteMN = 0; + decimal ImporteBancosMN, ImporteAcreedorMN; bool TipoMovtoComision = false; int IdCtaContableOtrosGastos = 0; int CveConceptoDiferenciaCambiaria = 0; @@ -338,8 +321,10 @@ public partial class Bancos_PagoAcreedor : ClsPaginas Importe = gvr.FCTextBox("TxtAbonar").Text.ToDecimal(); ImporteComision = gvr.FCTextBox("TxtComision").Text.ToDecimal(); ImporteMN = Importe; + ImporteAcreedorMN = Importe; + ImporteBancosMN = Importe; ImporteComisionMN = ImporteComision; - ImporteComplementaria = 0; + ImporteComplementaria = 0; if (gvr.FCTextBox("TxtComision").Text.ToDecimal() < 0) { @@ -352,61 +337,47 @@ public partial class Bancos_PagoAcreedor : ClsPaginas { TipoMovtoComision = false; IdCtaContableOtrosGastos = UsuarioActual.Empresa.Funcionalidad(266).ToEntero(); - - } - - Decimal TC = gvr.DataKey("TipoCambio").ToDecimal(); - if (gvr.DataKey("FechaDocumento").ToDate().Month != TxtFechaDocumento.Text.ToDate().Month || gvr.DataKey("FechaDocumento").ToDate().Year != TxtFechaDocumento.Text.ToDate().Year) - { - TC = get_GlobalTipoCambio(TxtFechaDocumento.Text.ToDate().AddMonths(-1).LastDayOfMonth()).ToDecimal(); - } - + } if (gvr.FCCheckBox("Chk").Checked) { + Decimal TC = gvr.DataKey("TipoCambio").ToDecimal(); int tCveMoneda = gvr.DataKey("CveMoneda").ToEntero(); - if (CveMonedaPago == 1 && tCveMoneda == 1) + //Verifica Fluctuación mensual + if (tCveMoneda > 1 && gvr.DataKey("FechaDocumento").ToDate() < TxtFechaDocumento.Text.ToDate().FirstDayOfMonth()) { - ImporteMN = Importe; - ImporteComisionMN = ImporteComision; + TC = get_GlobalTipoCambio(TxtFechaDocumento.Text.ToDate().AddMonths(-1).LastDayOfMonth()).ToDecimal();//obtengo el TC del mes anterior del pago } - else if (CveMonedaPago == 1 && tCveMoneda == 2) - { - ImporteComisionMN = ImporteComision; - if (UsaComplementaria) - { - ImporteMN = Importe; - ImporteComplementaria = (Importe * TC - Importe).RoundSQL(); - } - else - { - ImporteMN = Importe * TC; - ImporteComplementaria = 0; - } - } - else if (CveMonedaPago == 2 && tCveMoneda == 1) - { + ImporteBancosMN = (Importe * TCPago).RoundSQL(); + ImporteAcreedorMN = (Importe * TC).RoundSQL(); - ImporteMN = Importe; - ImporteComisionMN = ImporteComision; - } - else if (CveMonedaPago == 2 && tCveMoneda == 2) - { - ImporteComisionMN = ImporteComision; - if (UsaComplementaria) - { - ImporteMN = Importe; - ImporteComplementaria = (Importe * TC - Importe).RoundSQL(); - } - else - { - ImporteMN = (Importe * TC).RoundSQL(); - ImporteComplementaria = 0; - } - } + //if (CveMonedaPago == 1 && tCveMoneda == 1) + //{ + // ImporteMN = Importe; + // ImporteComisionMN = ImporteComision; + //} + //else if (CveMonedaPago == 1 && tCveMoneda == 2) + //{ + // ImporteComisionMN = ImporteComision; + + // ImporteMN = Importe; + // ImporteComplementaria = (Importe * TC - Importe).RoundSQL(); + //} + //else if (CveMonedaPago == 2 && tCveMoneda == 1) + //{ + // ImporteMN = Importe; + // ImporteComisionMN = ImporteComision; + // ImporteComplementaria = 0; + //} + //else if (CveMonedaPago == 2 && tCveMoneda == 2) + //{ + // ImporteComisionMN = ImporteComision; + // ImporteMN = Importe; + // ImporteComplementaria = (Importe * TC - Importe).RoundSQL(); + //} - ImporteMN = ImporteMN.RoundSQL(); - ImporteComplementaria = ImporteComplementaria.RoundSQL(); + //ImporteMN = ImporteMN.RoundSQL(); + //ImporteComplementaria = ImporteComplementaria.RoundSQL(); ImporteComisionMN = ImporteComisionMN.RoundSQL(); ImporteComision = ImporteComision.RoundSQL(); AcumImporteMN += ImporteMN; @@ -422,38 +393,38 @@ public partial class Bancos_PagoAcreedor : ClsPaginas break; } - if (UsaComplementaria) + if (tCveMoneda > 1 && MsgError == "") { + ImporteComplementaria = (Importe * TC - Importe).RoundSQL(); if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, false, Importe, Ref, CveConceptoContablePrestamoComplementario, Conc, DateTime.Now, IDCtaContableAcreedorComplementaria, -1, CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), ImporteMX: ImporteComplementaria, CveIEDevolucion: gvr.DataKey("CveIE").ToEntero(), ImporteME: Importe, TipoCambio: TC, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero())) MsgError = "No se pudo insertar concepto de acreedor complementaria"; } - if (TCPago != TC) - { - bool TipoMovto = false; - int IdCtaContableDiferenciaCambiaria = 0; - if (TCPago > TC) - { - CveConceptoDiferenciaCambiaria = 65; - IdCtaContableDiferenciaCambiaria = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria; - TipoMovto = false; - Importe = (Importe * TCPago) - (Importe * TC); - } - else if (TCPago < TC) - { - CveConceptoDiferenciaCambiaria = 64; - IdCtaContableDiferenciaCambiaria = UsuarioActual.Empresa.IdCuentaGananciaCambiaria; - TipoMovto = true; - Importe = (Importe * TC) - (Importe * TCPago); - } - ImporteMN = Importe; - - if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, Ref, CveConceptoDiferenciaCambiaria, Conc, DateTime.Now, IdCtaContableDiferenciaCambiaria, -1, CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), ImporteMX: ImporteMN, CveIEDevolucion: gvr.DataKey("CveIE").ToEntero(), ImporteME: Importe, TipoCambio: TC, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyectoPago.SelectedValue.ToEntero())) - MsgError = "No se pudo insertar concepto de diferencia cambiaria"; + if (ImporteBancosMN != ImporteAcreedorMN && MsgError == "") + { + bool TipoMovto = false; + int IdCtaContableDiferenciaCambiaria = 0; + if (TCPago > TC) + { + CveConceptoDiferenciaCambiaria = 65; + IdCtaContableDiferenciaCambiaria = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria; + TipoMovto = false; } + else if (TCPago < TC) + { + CveConceptoDiferenciaCambiaria = 64; + IdCtaContableDiferenciaCambiaria = UsuarioActual.Empresa.IdCuentaGananciaCambiaria; + TipoMovto = true; + } + Importe = ((Importe * TCPago) - (Importe * TC)).Abs(); + + if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, Ref, CveConceptoDiferenciaCambiaria, Conc, DateTime.Now, IdCtaContableDiferenciaCambiaria, -1, CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), ImporteMX: Importe, CveIEDevolucion: gvr.DataKey("CveIE").ToEntero(), ImporteME: Importe, TipoCambio: TC, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyectoPago.SelectedValue.ToEntero())) + MsgError = "No se pudo insertar concepto de diferencia cambiaria"; + } - if (ImporteComisionMN > 0) + if (ImporteComision != 0 && MsgError == "") { + ImporteComisionMN = (ImporteComision * TCPago).RoundSQL(); if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoComision, ImporteComision, Ref, 255, Conc, DateTime.Now, IdCtaContableOtrosGastos, -1, CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), ImporteMX: ImporteComisionMN, CveIEDevolucion: gvr.DataKey("CveIE").ToEntero(), TipoCambio: TC, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyectoPago.SelectedValue.ToEntero())) { MsgError = "No se pudo insertar concepto de pago acreedor"; @@ -464,46 +435,18 @@ public partial class Bancos_PagoAcreedor : ClsPaginas } if (CveMonedaPago != 1) - { - if (UsaComplementaria) - { - ImporteMNBanco = ImporteBanco; + { ImporteComplementaria = (ImporteBanco * TCPago - ImporteBanco).RoundSQL(); - } - else - { - ImporteMNBanco = (ImporteBanco * TCPago).RoundSQL(); - ImporteComplementaria = 0; - } } - if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, ImporteBanco, Ref, 30, Conc, DateTime.Now, IDCtaContableBancos, -1, CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), ImporteMX: ImporteMNBanco, ImporteME: ImporteBanco, TipoCambio: TCPago, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyectoPago.SelectedValue.ToEntero())) MsgError = "No se pudo insertar concepto de bancos"; + if (MsgError == "" && !ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, ImporteBanco, Ref, 30, Conc, DateTime.Now, IDCtaContableBancos, -1, CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), ImporteMX: ImporteBanco, ImporteME: ImporteBanco, TipoCambio: TCPago, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyectoPago.SelectedValue.ToEntero())) MsgError = "No se pudo insertar concepto de bancos"; //movimiento de ajuste por sino se aplicó en el proceso anterior - if (CveMonedaPago != 1 && UsaComplementaria ) + if (MsgError == "" && CveMonedaPago != 1 ) { if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, ImporteBanco, Ref, 204, Conc, DateTime.Now, IDCtaContableBancosComplementario, -1, CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), ImporteMX: ImporteComplementaria, ImporteME: ImporteBanco, TipoCambio: TCPago, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyectoPago.SelectedValue.ToEntero())) MsgError = "No se pudo insertar concepto de bancos complementaria"; - } - if (AcumImporteMN != (ImporteBanco + ImporteComplementaria) && CveConceptoDiferenciaCambiaria == 0) - { - int tCveConceptoOtIngresos = 0; - bool TipoMovtoOt = false; - decimal Dif = AcumImporteMN - (ImporteBanco + ImporteComplementaria); - if (Dif < 0) - { - tCveConceptoOtIngresos = 65; TipoMovtoOt = false; - } - else - { - tCveConceptoOtIngresos = 64; TipoMovtoOt = true; - } - - if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoOt, Dif.Abs(), Ref, tCveConceptoOtIngresos, Conc, DateTime.Now, 0, -1, CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), ImporteMX: Dif.Abs(), ImporteME: Dif.Abs(), TipoCambio: TCPago, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyectoPago.SelectedValue.ToEntero())) - { - MsgError = "No se pudo insertar concepto de ajuste en redondeo"; - } - } + } } else @@ -517,7 +460,7 @@ public partial class Bancos_PagoAcreedor : ClsPaginas } //VALIDA QUE CUADRE LA PREPOLIZA - if (ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, 5)) + if (MsgError == "" && ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, 5)) { if (ObjMov.ValorPolizaDescuadre > 0) { @@ -557,6 +500,11 @@ public partial class Bancos_PagoAcreedor : ClsPaginas Msg.AppendFormat("El Documento se guardo correctamente. Folio {1}
", CveIE, ObjIE.Folio); } + //GUARDA COMPROBANTE + if (!filemove.Equals("")) + { + filemove.FilesMove(CveIE.ToString(), string.Format(@"{0}IE", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase: false); + } System.IO.FileInfo archivo = null; if (DdlTipoTransaccion.SelectedValue.ToEntero().Contiene(2, 8, 9)) @@ -722,18 +670,8 @@ public partial class Bancos_PagoAcreedor : ClsPaginas if (CveMoneda != 1) { - - if (UsaComplementaria) - { ImporteMN = Importe; - ImporteComplementaria = Importe * TC - Importe; - } - else - { - ImporteMN = Importe * TC; - ImporteComplementaria = 0; - } - + ImporteComplementaria = Importe * TC - Importe; } @@ -757,18 +695,16 @@ public partial class Bancos_PagoAcreedor : ClsPaginas if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, Importe, Ref, CveConceptoContablePrestamo, Conc, DateTime.Now, IDCtaContableAcreedorExtranjera, -1, CveIE, CveProveedor: DdlProveedorPrestamo.SelectedValue.ToEntero(), ImporteMX: ImporteMN, TipoCambio: TC, TipoCambioPago: TC, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero())) { MsgError = "No se pudo insertar concepto de acreedor"; - } - if (UsaComplementaria) + } + if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, false, Importe, Ref, CveConceptoContableBancoComplementario, Conc, DateTime.Now, IDCtaContableBancosComplementario, -1, CveIE, CveProveedor: DdlProveedorPrestamo.SelectedValue.ToEntero(), ImporteMX: ImporteComplementaria, ImporteME: Importe, TipoCambio: TC, TipoCambioPago: TC, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero())) { - if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, false, Importe, Ref, CveConceptoContableBancoComplementario, Conc, DateTime.Now, IDCtaContableBancosComplementario, -1, CveIE, CveProveedor: DdlProveedorPrestamo.SelectedValue.ToEntero(), ImporteMX: ImporteComplementaria, ImporteME: Importe, TipoCambio: TC, TipoCambioPago: TC, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero())) - { - MsgError = "No se pudo insertar concepto de bancos complementaria"; - } - if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, Importe, Ref, CveConceptoContablePrestamoComplementario, Conc, DateTime.Now, IDCtaContableAcreedorComplementaria, -1, CveIE, CveProveedor: DdlProveedorPrestamo.SelectedValue.ToEntero(), ImporteMX: ImporteComplementaria, ImporteME: Importe, TipoCambio: TC, TipoCambioPago: TC, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero())) - { - MsgError = "No se pudo insertar concepto de acreedor complementaria"; - } + MsgError = "No se pudo insertar concepto de bancos complementaria"; } + if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, Importe, Ref, CveConceptoContablePrestamoComplementario, Conc, DateTime.Now, IDCtaContableAcreedorComplementaria, -1, CveIE, CveProveedor: DdlProveedorPrestamo.SelectedValue.ToEntero(), ImporteMX: ImporteComplementaria, ImporteME: Importe, TipoCambio: TC, TipoCambioPago: TC, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero())) + { + MsgError = "No se pudo insertar concepto de acreedor complementaria"; + } + } else { diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx index d3d5c0112..295e02fde 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -526,6 +526,7 @@ +
@@ -540,6 +541,7 @@ +
@@ -2864,7 +2866,7 @@
- + diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 9a557b9a8..05fcb23df 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -1248,15 +1248,6 @@ Partial Class Compras_Compras btnProrateo2.Visible = True End If - If UsuarioActual.Empresa.Funcionalidad(531).ToEntero = 1 Then 'cuando es emp acumuladora AndAlso DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") - divFolioGarantia.Visible = True - Using objAcum As New ClsAcumuladores - If objAcum.FoliosGarantiaGet(-1, UsuarioActual.Empresa.CveEmpresa, Estatus:=-1, TipoFolio:="-1", Area:=-1, CveSubProyecto:=-1) Then - DdlFolioGarantia.DataSource = objAcum.DtResultados.FiltraParametros("", "FechaIng DESC") - DdlFolioGarantia.DataBind() - End If - End Using - End If '**************************************************************** 'If UsuarioActual.CveEmpresa = 72 Then ' LiRecepcion.Visible = True @@ -1960,7 +1951,15 @@ Partial Class Compras_Compras TxtSerie.Enabled = False End If - 'DdlTipoComprobante.Enabled = False + If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") Then 'cuando es emp acumuladora + divFolioGarantia.Visible = True + Using objAcum As New ClsAcumuladores + If objAcum.FoliosGarantiaGet(-1, UsuarioActual.Empresa.CveEmpresa, Estatus:=2, TipoFolio:="-1", Area:=-1, CveSubProyecto:=-1) Then + DdlFolioGarantia.DataSource = objAcum.DtResultados.FiltraParametros("", "FechaIng DESC") + DdlFolioGarantia.DataBind() + End If + End Using + End If 'PERMISO PARA MODIFICACIÓN DE FECHA AUN CON FACTURA TxtFecha.Enabled = UsuarioActual.TienePermisoProceso(216) @@ -2842,6 +2841,12 @@ Partial Class Compras_Compras TxtRembolsoNumero.Enabled = If(IdPoliza > 0, False, True) + If dr("CveFolioGarantia").ToString <> "" Then + divFolioGarantia.Visible = True + DdlFolioGarantia.Items.Insert(0, New ListItem(dr("FolioGarantia").ToString, dr("CveFolioGarantia").ToString)) + DdlFolioGarantia.SelectedValue = dr("CveFolioGarantia").ToString + End If + 'CargaDetalle If ObjCompra.GetCompraDetalle(CveCompra, UsuarioActual.CveEmpresa) Then TmpDT = ObjCompra.DtResultados @@ -5467,7 +5472,7 @@ Partial Class Compras_Compras ' If DdlMoneda.SelectedValue.ToEntero = 1 Or (DdlMoneda.SelectedValue.ToEntero > 1 AndAlso GlobalTipoCambio(TxtFecha.Text.ToDate) > 0) Then ''ALMACEN CONSIGNACION - If CveConsignacion > 0 Then + If CveConsignacion > 0 AndAlso CveCompraRefacturacion <= 0 Then 'actualizamos cvecompraconsignacion For Each gvr As GridViewRow In GvInv.Rows @@ -5590,7 +5595,7 @@ Partial Class Compras_Compras Dim indice = 0 Dim ImporteConcepto As Decimal = 0 - If DdlTipoComprobante.SelectedValue = "Fac" Then + If DdlTipoComprobante.SelectedValue = "Fac" AndAlso CveCompraRefacturacion <= 0 Then For Each tCveAlmacen As Integer In ListAlmacenes If GvInv.Rows(indice).FCDropDownList("DdlRecibirInv").SelectedValue = "1" Then @@ -8137,9 +8142,9 @@ Partial Class Compras_Compras End If If UsuarioActual.TienePermisoProceso(354) Then 'visualizar la póliza al registros - Msg.AppendFormat("

Ver Póliza. ", CvePrePoliza) + Msg.AppendFormat("

Ver Póliza   ", CvePrePoliza) Dim TempParametros = Encripta(String.Format("OP=PREPO&CvePrePoliza={0}", CvePrePoliza)) - Msg.Append($" Imprimir PDF ") + Msg.Append($" Imprimir ") @@ -8736,6 +8741,7 @@ Partial Class Compras_Compras Pago.OtroGastoIngreso = ImporComisionAnticipo Pago.CveMonedaPago = CveMonedaAnticipo Pago.TCPago = TipoCambioAnt + Pago.CveProveedor = gvr.DataKey("CveProveedor").ToEntero Select Case gvr.DataKey("TipoDocto") Case "NC", "DEV" @@ -8750,6 +8756,7 @@ Partial Class Compras_Compras CveConceptoCompraComplementaria = 266 IdCtaContable = If(CveMonedaAnticipo = 1, CtaProveedorAnticipos, CtaProveedorAnticiposExtranjera) IdCtaContableComp = CtaProveedorAnticiposComplementaria + 'vinculo la compra actual, y no la compra como si fuera nota de credito CveCompraNC = -1 CveIE = gvr.DataKey("CveIE").ToEntero @@ -9331,8 +9338,10 @@ Partial Class Compras_Compras PSS.Dispose() End If - Dim CvePersonal = GvPersonal.Rows(Cont).FCDropDownList("DdlPersonalGv").SelectedValue.ToEntero - Dim Referencia = GvPersonal.Rows(Cont).FCTextBox("TxtReferencia").Text + Dim CvePersonal As Integer = 0 + If Cont < GvPersonal.Rows.Count Then CvePersonal = GvPersonal.Rows(Cont).FCDropDownList("DdlPersonalGv").SelectedValue.ToEntero + Dim Referencia As String + If Cont < GvPersonal.Rows.Count Then Referencia = GvPersonal.Rows(Cont).FCTextBox("TxtReferencia").Text Cont = Cont + 1 'Si es AF-INSUMO se guarda en CveActivoFIjo @@ -9389,8 +9398,6 @@ Partial Class Compras_Compras End If End If End If - - Next For Each item As String In ClavesBorradas @@ -9411,20 +9418,14 @@ Partial Class Compras_Compras If Not ObjContabilidad.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveEmpresa, UsuarioActual.Empresa, MinFecha, String.Format("{0}-{1}", Serie, Folio), ObjContaAC, pIDPoliza:=ViewState("IdPoliza").ToString.ToEntero) Then Retorno = False End If - End If End If - - - Else Retorno = False End If - 'Retorno = True 'Alert("La Compra se actualizó correctamente.") Else - If IdPoliza > 0 Then If Not ObjContabilidad.UpdatePrePolizasDetalleBloquear(CvePrePoliza, True) Then Retorno = False @@ -9434,7 +9435,6 @@ Partial Class Compras_Compras Retorno = False End If End If - End If @@ -9683,9 +9683,27 @@ Partial Class Compras_Compras 'OBTIENE METODO DE CONTABILIZACIÓN AL GUARDAR - Dim ConceptoContabilizacionAlmacen = 0 + Dim CveConceptoContableAlmacen = 0 If ObjCompra.GetCompras(CveCompra, "-1", "-1", -1, -1, UsuarioActual.CveEmpresa) AndAlso ObjCompra.DtResultados.Rows.Count > 0 Then - ConceptoContabilizacionAlmacen = ObjCompra.DtResultados.FiltroPrimeroValor("CveConceptoContableAlmacen").ToEntero + CveConceptoContableAlmacen = ObjCompra.DtResultados.FiltroPrimeroValor("CveConceptoContableAlmacen").ToEntero + + If CveConceptoContableAlmacen = 0 Then + If Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") Then + If (CveImportacion > 0 Or CveFlete > 0) Then + CveConceptoContableAlmacen = CveConceptoContableAlmacen + Else + CveConceptoContableAlmacen = 205 + End If + If OCVinculada AndAlso DdlOCVinculaInv.Visible AndAlso Not (CveImportacion > 0 Or CveFlete > 0) Then + CveConceptoContableAlmacen = DdlOCVinculaInv.SelectedValue.ToEntero + End If + If UsuarioActual.CveEmpresa.Contiene(72, 80, 140, 141, 152) And Not (CveImportacion > 0 Or CveFlete > 0) Then 'se comento, RMF. 2020.08.19, no le hallo sentido + CveConceptoContableAlmacen = 205 + End If + Else + CveConceptoContableAlmacen = 225 + End If + End If End If 'AF @@ -9714,7 +9732,7 @@ Partial Class Compras_Compras 'COSTO ALMACEN Dim DtAlmacenes = GlobalDTAlmacen(UsuarioActual.CveEmpresa) - If UsuarioActual.Empresa.UsaInventarios AndAlso Not UsuarioActual.Empresa.Funcionalidad(126) = "1" And ConceptoContabilizacionAlmacen = 0 Or DdlTipoCompra.SelectedValue.ToEntero = 10 Then + If UsuarioActual.Empresa.UsaInventarios AndAlso Not UsuarioActual.Empresa.Funcionalidad(126) = "1" And CveConceptoContableAlmacen = 0 Or DdlTipoCompra.SelectedValue.ToEntero = 10 Then DT = TmpDT.FiltraParametros("ISNULL(TipoAF,0) <> 2 AND ISNULL(CveAlmacen,0) > 0", "", {"CveAlmacen"}) 'RECORREMOS PARA DETECTAR LA MODALIDAD DEL ALMACEN, EN CASO DE SER SOLO EXISTENCIA LIMPIAMOS CVEALMACEN @@ -9755,11 +9773,11 @@ Partial Class Compras_Compras 'INV [MERCANCIA RECIBIDA POR ADELANTADO (OC) | MERCANCIA PENDIENTE POR RECIBIR (COMPRA) ] - If DdlTipoCompra.SelectedValue.ToEntero <> 10 AndAlso UsuarioActual.Empresa.UsaInventarios And Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" And ConceptoContabilizacionAlmacen.Contiene(176, 205) Then + If DdlTipoCompra.SelectedValue.ToEntero <> 10 AndAlso UsuarioActual.Empresa.UsaInventarios And Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" And CveConceptoContableAlmacen.Contiene(176, 205) Then importeMovimiento = TmpDT.SUM("Total", $"ISNULL(TipoAF,0) <> 2 AND ISNULL(AplicaCostoIndirecto,0) <> 1 AND CveTipoPS = 2").ToString.ToDecimal importeMN = importeMovimiento * tipoCambioActual * Multiplicador - If ObjConta.GetRetCuenta(ConceptoContabilizacionAlmacen, UsuarioActual.CveEmpresa) Then + If ObjConta.GetRetCuenta(CveConceptoContableAlmacen, UsuarioActual.CveEmpresa) Then If ObjConta.DtResultados.Rows.Count > 0 Then IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero End If @@ -9767,7 +9785,7 @@ Partial Class Compras_Compras If importeMovimiento <> 0 Then Concepto = $"{NombreProveedor} {TxtSerie.Text} - {TxtFolio.Text}" - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContabilizacionAlmacen, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento)) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, CveConceptoContableAlmacen, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento)) Then ErrorPrepoliza = True End If End If @@ -9776,11 +9794,11 @@ Partial Class Compras_Compras 'NC CON PRODUCTOS - CUENTA PUENTE - If UsuarioActual.Empresa.UsaInventarios And Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" And ConceptoContabilizacionAlmacen.Contiene(225) Then + If UsuarioActual.Empresa.UsaInventarios And Not DdlTipoComprobante.SelectedValue.Contiene("Ant") And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" And CveConceptoContableAlmacen.Contiene(225) Then importeMovimiento = TmpDT.SUM("Total", $"ISNULL(TipoAF,0) <> 2 AND ISNULL(AplicaCostoIndirecto,0) <> 1 AND CveTipoPS = 2").ToString.ToDecimal importeMN = importeMovimiento * tipoCambioActual * Multiplicador - If ObjConta.GetRetCuenta(ConceptoContabilizacionAlmacen, UsuarioActual.CveEmpresa) Then + If ObjConta.GetRetCuenta(CveConceptoContableAlmacen, UsuarioActual.CveEmpresa) Then If ObjConta.DtResultados.Rows.Count > 0 Then IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero End If @@ -9788,7 +9806,7 @@ Partial Class Compras_Compras If importeMovimiento <> 0 Then Concepto = $"{NombreProveedor} {TxtSerie.Text} - {TxtFolio.Text}" - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContabilizacionAlmacen, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento)) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, CveConceptoContableAlmacen, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento)) Then ErrorPrepoliza = True End If End If @@ -9811,7 +9829,7 @@ Partial Class Compras_Compras If DdlTipoCompra.SelectedValue.ToEntero <> 10 Then 'QUITA 1-[MERCANCIA RECIBIDA POR ADELANTADO (OC) | MERCANCIA PENDIENTE POR RECIBIR (COMPRA)] 2-[NC CON PRODUCTOS] - If UsuarioActual.Empresa.UsaInventarios And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" And ConceptoContabilizacionAlmacen > 0 Then + If UsuarioActual.Empresa.UsaInventarios And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" And CveConceptoContableAlmacen > 0 Then DT = DT.FiltraParametros("CveTipoPS <> 2") End If End If @@ -9958,14 +9976,14 @@ Partial Class Compras_Compras Next End If - 'VALIDAR PREPOLIZA DE COMPRA - If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, 4) Then - If ObjConta.ValorPolizaDescuadre > 0 Then - ErrorPrepoliza = True - Alert("Error en validacion de prepoliza cuadre", TipoMensaje.MsgAdvertencia) - GuardaLogAD($"Compras/Compras-Actualizar | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") - End If - End If + ''VALIDAR PREPOLIZA DE COMPRA + 'If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, 4) Then + ' If ObjConta.ValorPolizaDescuadre > 0 Then + ' ErrorPrepoliza = True + ' Alert("Error en validacion de prepoliza cuadre", TipoMensaje.MsgAdvertencia) + ' GuardaLogAD($"Compras/Compras-Actualizar | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") + ' End If + 'End If If Not ErrorPrepoliza Then Retorno = True @@ -20016,7 +20034,7 @@ Partial Class Compras_Compras 'Agrupa los CvePS iguales y suma sus cantidades For Each row In TmpDT.AsEnumerable() Dim cvePS As Integer = row.Field(Of Integer)("CvePS") - Dim cantidad As Decimal = row.Field(Of Decimal)("Cantidad") + Dim cantidad As Decimal = row("Cantidad").Tostring.ToDecimal If ExistenciasPSFactura.ContainsKey(cvePS) Then ExistenciasPSFactura(cvePS) += cantidad Else @@ -20731,39 +20749,30 @@ Partial Class Compras_Compras End Sub - 'Private Function ObtConceptoContableProvisionCompra(CveTipoConcepto As Integer, TipoDocto As String, CveMoneda As Integer, Optional EsComplementaria As Boolean = False) As Integer - ' Dim Retorno As Integer = -1 - - ' 'If CveTipoConcepto = 1 Then ''PROVEEDOR - ' If EsComplementaria Then - ' Retorno = If(TipoDocto = "Fac", 201, 234) - ' Return Retorno - ' End If - ' If CveMoneda = 1 Then - ' Retorno = If(TipoDocto = "Fac", 5, 18) - ' Else - ' Retorno = If(TipoDocto = "Fac", 311, 341) - ' End If - ' Else ''ACREEDOR - ' If EsComplementaria Then - ' Retorno = If(TipoDocto = "Fac", -1, -1) - ' Return Retorno - ' End If - ' If CveMoneda = 1 Then - ' Retorno = If(TipoDocto = "Fac", 305, 323) - ' Else - ' Retorno = If(TipoDocto = "Fac", 306, 343) - ' End If - ' End If - - ' Return Retorno - - 'End Function - - + Protected Sub BtnFolioGarantiaRestantes_Click(sender As Object, e As EventArgs) + Using ObjAcum As New ClsAcumuladores + If ObjAcum.GetFoliosGarantiasDetalleDisponibles(DdlFolioGarantia.SelectedValue.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa) Then + Dim dtt As DataTable = ObjAcum.DtResultados.FiltraParametros("CantidadDisponible > 0") + Dim Porcentaje As Decimal = TmpDT.MAX("IVAPorcentaje").ToDecimal + Dim tCveSub As Integer = TmpDT.MAX("CveSubProyecto").ToEntero + Dim tCveTipoGasto As Integer = TmpDT.MAX("CveTipoGasto").ToEntero + Dim Total As Decimal = TmpDT.SUMD("Total") + For Each drr As DataRow In TmpDT.Rows + ClavesBorradas.Add(drr("CveCompraDetalle").ToString) + Next + TmpDT.Clear() + For Each dr As DataRow In dtt.Rows + Dim pu As Decimal = Total / dtt.SUMD("CantidadDisponible") + Dim cantidad As Decimal = dr("CantidadDisponible").ToString.ToDecimal + AddPS(cantidad, dr("CveUM").ToString.ToEntero, "", dr("CveClasificacion").ToString.ToEntero, "", dr("CvePS").ToString.ToEntero, dr("PS").ToString, 2, tCveSub.ToString, "SE", "SE", "", "", pu, Total, Porcentaje, 0, 0, 0, 0, 0, PorcentajeIVA:=Porcentaje, TCalculaTotales:=True, CveTipoGasto:=tCveTipoGasto) + Next + AddPS2() + End If + End Using + End Sub End Class diff --git a/Compras/eFacturas.aspx.vb b/Compras/eFacturas.aspx.vb index 8aa6f6ece..6f4633835 100644 --- a/Compras/eFacturas.aspx.vb +++ b/Compras/eFacturas.aspx.vb @@ -4276,11 +4276,12 @@ Partial Class Compras_eFacturas Alert($"PDF Error se genero nulo", TipoMensaje.MsgAdvertencia) End If + CargaDatos() + Catch ex As Exception Alert($"PDF Error {ex.Message} -- > {ex.StackTrace}", TipoMensaje.MsgAdvertencia) End Try - Alert("PDF Finaliza", TipoMensaje.MsgAdvertencia) diff --git a/CxC/RepCxCDetalle.aspx.vb b/CxC/RepCxCDetalle.aspx.vb index a62db7b56..c598ec10f 100644 --- a/CxC/RepCxCDetalle.aspx.vb +++ b/CxC/RepCxCDetalle.aspx.vb @@ -922,7 +922,7 @@ Partial Class RepCxCDetalle Dim Filtro As String = $"{Cliente}{Sucursal}{Grupo}{Vendedor}{FechaIn}{FechaFn}{Registro}{Responsable}{TipoDocto}{EstatusCob}{FVI}{FVF}{ClasificacionCli}{CorteA}" - ExportToExcelGembox(GvDatos, "ReporteCxCDetalle", UsuarioActual, "REPORTE DE CUENTAS POR COBRAR DEL CLIENTE CON DETALLE", DatoTituloExtra:=$"", DatosFiltros:=Filtro) + GvDatos.ExportToExcelGembox("ReporteCxCDetalle", UsuarioActual, "REPORTE DE CUENTAS POR COBRAR DEL CLIENTE CON DETALLE", DatoTituloExtra:=$"", DatosFiltros:=Filtro) 'GvDatos.ExportToExcelG("ReporteCxCDetalle", "REPORTE DE CUENTAS POR COBRAR DEL CLIENTE CON DETALLE", UsuarioActual, Filtro) 'SpreadsheetInfo.SetLicense(SerialGemBoxSpreadsheet()) diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index 2c538f4b3..18e714c79 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -3941,12 +3941,12 @@ Partial Class Inventarios_EntradasSalidas IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero End If - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, ValorInventario, Concepto, tCveConcepto, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=ValorInventario, CveSubProyecto:=tCveSubProyecto) Then - ErrorMovInv = True - Exit For - End If + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, ValorInventario, Concepto, tCveConcepto, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=ValorInventario, CveSubProyecto:=tCveSubProyecto, Contabilizable:=Contabilizable) Then + ErrorMovInv = True + Exit For + End If - Next + Next End If End If End If diff --git a/Inventarios/RecepcionAlmacen.aspx b/Inventarios/RecepcionAlmacen.aspx index 35fdb222e..d66ae6da0 100644 --- a/Inventarios/RecepcionAlmacen.aspx +++ b/Inventarios/RecepcionAlmacen.aspx @@ -3,6 +3,11 @@ +
  • @@ -454,51 +459,62 @@ <%-- GV DATOS --%>
    -
    +
    Entrada a Inventario
    - - -
    -
    - - - <%-- --%> - - - - -
    - - - - - - - - - -
    -
    -
    -
    -
    + + diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb index b1237c243..3de1b14ea 100644 --- a/Inventarios/RecepcionAlmacen.aspx.vb +++ b/Inventarios/RecepcionAlmacen.aspx.vb @@ -475,7 +475,7 @@ Partial Class Inventarios_RecepcionAlmacen CargaPermisos() If UsuarioActual.CveEmpresa.Contiene(72, 80) Then DdlAlmacen.AutoPostBack = True Dim PermisoEspecialCambioFecha As Boolean = False - If UsuarioActual.CveUsuario = 1937 Then PermisoEspecialCambioFecha = True + If UsuarioActual.CveUsuario.Contiene(100, 1937) Then PermisoEspecialCambioFecha = True If UsuarioActual.Empresa.Funcionalidad(281).ToEntero = 1 AndAlso Not PermisoEspecialCambioFecha Then @@ -1478,7 +1478,7 @@ Partial Class Inventarios_RecepcionAlmacen e.Row.FCCheckBox("cbInv").Enabled = True If UsuarioActual.TienePermisoProceso(345) Then 'carga la cantidad con el rol AD - e.Row.FCTextBox("TbCantidadF").Text = e.Row.DBCampo("CantidadF").FormatoNumero + e.Row.FCTextBox("TbCantidadF").Text = e.Row.DBCampo("CantidadF").ToDecimal().ToString("{#,###.##}") End If End If End If diff --git a/OC/OC.aspx b/OC/OC.aspx index 4b0f83c28..db50d4266 100644 --- a/OC/OC.aspx +++ b/OC/OC.aspx @@ -1029,7 +1029,8 @@ <%-- 8 --%> - + <%----%> + diff --git a/Sistemas/UsuarioDetalle.aspx.vb b/Sistemas/UsuarioDetalle.aspx.vb index ae83edfa9..4b7bbcf57 100644 --- a/Sistemas/UsuarioDetalle.aspx.vb +++ b/Sistemas/UsuarioDetalle.aspx.vb @@ -1383,6 +1383,9 @@ Partial Class Sistemas_UsuarioDetalle GlobalDTAlmacenUsuarios(-1, UsuarioActual.CveEmpresa) = Nothing GlobalDTUsuarioResponsable(UsuarioActual.CveEmpresa) = Nothing GlobalDTUsuarios(CveEmpresa:=UsuarioActual.CveEmpresa) = Nothing + If UsuarioActual.CveUsuario = 100 Then + Alert("Globals Recargados") + End If 'If ObjUsuarios.GetUsuariosEmpresas(-1, UsuarioActual.CveEmpresa) Then ' Application("GlobalDTUsuarios") = ObjUsuarios.DtResultados ' Application("GlobalDTUsuarioResponsable") = ObjUsuarios.DtResultados.FiltraParametros("ProveedoresResponsables > 0") diff --git a/Ventas/RepLineasAdicionales.aspx.cs b/Ventas/RepLineasAdicionales.aspx.cs index 9f3eedff3..f742824ee 100644 --- a/Ventas/RepLineasAdicionales.aspx.cs +++ b/Ventas/RepLineasAdicionales.aspx.cs @@ -404,7 +404,7 @@ public partial class Ventas_RepLineasAdicionales : ClsPaginas //int cveestatus = e.CommandArgument.ToEntero() + 2; //pasar al siguiente estatus ClsVentas objVentas = new ClsVentas(); - if (!objVentas.UpdateVentaLineaAdicional(CveLineaAdicional, CveVenta,"", 2, UsuarioActual.CveEmpresa)) + if (!objVentas.UpdateVentaLineaAdicional(CveLineaAdicionalActualizarEstatus, CveVenta,"", 2, UsuarioActual.CveEmpresa)) { errorCambioEstatus = true; } diff --git a/Ventas/RepVentaDetalle.aspx b/Ventas/RepVentaDetalle.aspx index 303c51bf1..670edb5c3 100644 --- a/Ventas/RepVentaDetalle.aspx +++ b/Ventas/RepVentaDetalle.aspx @@ -330,7 +330,7 @@
    - + @@ -344,7 +344,7 @@ - + @@ -354,12 +354,12 @@ - + - + @@ -369,37 +369,37 @@ - + - + - + - + - + - + - + @@ -444,7 +444,7 @@ - + @@ -505,8 +505,6 @@ - - @@ -557,8 +555,6 @@ - - diff --git a/Ventas/RepVentaDetalle.aspx.vb b/Ventas/RepVentaDetalle.aspx.vb index 04073217c..d0b713f61 100644 --- a/Ventas/RepVentaDetalle.aspx.vb +++ b/Ventas/RepVentaDetalle.aspx.vb @@ -289,21 +289,14 @@ Partial Class RepVentaDetalle Private Sub CargaCombos() CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, LblProyecto, LblSubProyecto, divProyecto:=DivProyecto) - CargaClientes() - 'DdlClientes.setEsWebService(False) - - 'Dim ObjClientes As New ClsClientes - 'If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then - ' DdlClientes.DataSource = ObjClientes.DtResultados - 'Else - ' DdlClientes.DataSource = Nothing - 'End If - 'ObjClientes.Dispose() - 'DdlClientes.DataBind() - - 'DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1")) - - 'Vendedor + CargaClientes() + + + 'DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1")) + txtFechaI.Text = Now.FirstDayOfMonth.ToShortDateString + txtFechaF.Text = Now.LastDayOfMonth.ToShortDateString + + 'Vendedor DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa) DdlVendedor.DataBind() DdlVendedor.Items.Insert(0, New ListItem("Sin Vendedor", "-2")) @@ -493,23 +486,23 @@ Partial Class RepVentaDetalle e.Row.FCLiteral("LtlFacturaCotizacion").Text = "" & e.Row.DBCampo("FolioVenta") & "" End If - e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Center - e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Center - e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Center - e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Left - e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Right - e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Right - e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Right - e.Row.Cells(7).HorizontalAlign = HorizontalAlign.Right - e.Row.Cells(8).HorizontalAlign = HorizontalAlign.Right - e.Row.Cells(9).HorizontalAlign = HorizontalAlign.Right - e.Row.Cells(10).HorizontalAlign = HorizontalAlign.Right - e.Row.Cells(11).HorizontalAlign = HorizontalAlign.Right - e.Row.Cells(12).HorizontalAlign = HorizontalAlign.Center - e.Row.Cells(13).HorizontalAlign = HorizontalAlign.Left - e.Row.Cells(14).HorizontalAlign = HorizontalAlign.Center - e.Row.Cells(15).HorizontalAlign = HorizontalAlign.Center - e.Row.Cells(20).HorizontalAlign = HorizontalAlign.Left + 'e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Center + 'e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Center + 'e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Center + 'e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Left + 'e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Right + 'e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Right + 'e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Right + 'e.Row.Cells(7).HorizontalAlign = HorizontalAlign.Right + 'e.Row.Cells(8).HorizontalAlign = HorizontalAlign.Right + 'e.Row.Cells(9).HorizontalAlign = HorizontalAlign.Right + 'e.Row.Cells(10).HorizontalAlign = HorizontalAlign.Right + 'e.Row.Cells(11).HorizontalAlign = HorizontalAlign.Right + 'e.Row.Cells(12).HorizontalAlign = HorizontalAlign.Center + 'e.Row.Cells(13).HorizontalAlign = HorizontalAlign.Left + 'e.Row.Cells(14).HorizontalAlign = HorizontalAlign.Center + 'e.Row.Cells(15).HorizontalAlign = HorizontalAlign.Center + 'e.Row.Cells(20).HorizontalAlign = HorizontalAlign.Left If e.Row.DBCampo("SubTotal").ToDouble = 0 Then e.Row.FCLiteral("LtlSubTotal").Text = "-" diff --git a/Ventas/RepVentas.aspx.vb b/Ventas/RepVentas.aspx.vb index afec7c32d..5fd05be8a 100644 --- a/Ventas/RepVentas.aspx.vb +++ b/Ventas/RepVentas.aspx.vb @@ -135,7 +135,7 @@ Partial Class Ventas_RepVentas DdlGrupo.Items.Insert(2, New ListItem("Año/Mes", "3")) DdlGrupo.Items.Insert(3, New ListItem("Fecha", "4")) DdlGrupo.Items.Insert(4, New ListItem("Cliente", "5")) - DdlGrupo.Items.Insert(4, New ListItem("SubProyecto", "6")) + DdlGrupo.Items.Insert(4, New ListItem(LblSubProyecto.Text, "6")) DdlGrupo.Items.Insert(5, New ListItem("Corte", "16")) DdlGrupo.Items.Insert(6, New ListItem("Vendedor", "7")) DdlGrupo.Items.Insert(7, New ListItem("Usuario", "8")) diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index 9df8b7f41..d17da5c8e 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -242,8 +242,8 @@ OnClick="LnkAplicarRNCDevolucion_Click" />
  • - +
  • <%--TERMINA: CANCELAR - NC - DEVOLUCION [NEW]--%> @@ -1675,7 +1675,12 @@ - + + + + Almacen + + <%-- @@ -1719,6 +1724,7 @@ +