diff --git a/Bancos/FluctuacionCambiaria.aspx.vb b/Bancos/FluctuacionCambiaria.aspx.vb
index a9981710e..64f05ff7c 100644
--- a/Bancos/FluctuacionCambiaria.aspx.vb
+++ b/Bancos/FluctuacionCambiaria.aspx.vb
@@ -465,6 +465,8 @@ Partial Class Bancos_FluctuacionCambiaria
Dim Total As Decimal = 0
Dim Conta As New ClsContabilidad
Dim Banco As New ClsBancos(Conta.IniciaTransacSQL())
+ Dim ObjContPaq As New ClsContPAQi(UsuarioActual.Empresa)
+ ObjContPaq.IniciaTransacSQL()
Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaFilial", 1, 0, 0, 1, TxtFecha.Text.ToDate, "Fluctuación Filiales", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
Dim idCta As Integer = 0
Dim CveCuenta As Integer = 0
@@ -524,13 +526,29 @@ Partial Class Bancos_FluctuacionCambiaria
Next
If Not ErrorRegistrar Then
+
+ 'Inicio auto conta
+ Dim AutoConta As Boolean = UsuarioActual.Empresa.Funcionalidad(200) = "1"
+ If AutoConta Then
+
+ If Conta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContPaq) Then
+ Else
+ Alert("Ocurrio un Error al contabilizar, pongase en contacto con Soporte Técnico", TipoMensaje.MsgError)
+ End If
+ End If
+
+ If ObjContPaq IsNot Nothing Then ObjContPaq.Commit()
+ 'Fin autoconta
Conta.Commit()
+
Alert(String.Format("La Fluctuación se ha generado
Ver Póliza", CvePrePoliza), TipoMensaje.MsgInformacion)
Else
Conta.RollBack()
+ ObjContPaq.RollBack()
End If
Conta.Dispose()
Banco.Dispose()
+ ObjContPaq.Dispose()
End Sub
#End Region
diff --git a/Bancos/PopIEVentas.aspx.vb b/Bancos/PopIEVentas.aspx.vb
index cf4f7d2b5..db600b31e 100644
--- a/Bancos/PopIEVentas.aspx.vb
+++ b/Bancos/PopIEVentas.aspx.vb
@@ -1556,6 +1556,7 @@ Partial Class Bancos_PopIEVentas
Select Case ConceptoContable
Case 2 'Pago Cliente
If RBLContado.SelectedValue.Contiene("3", "4", "5") Then
+ 'If CveMonedaVenta > 1 Then ConceptoContable = 292
For Each rw As GridViewRow In GvIngresos.Rows
If rw.FCCheckBox("Chk").Checked Then
If CveMoneda = 1 AndAlso CveMonedaVenta = 1 Then
diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb
index cc7f2c705..6d3b6c35f 100644
--- a/Compras/Compras.aspx.vb
+++ b/Compras/Compras.aspx.vb
@@ -19094,7 +19094,7 @@ Partial Class Compras_Compras
Dim ObjPS As New ClsProductosServicios
If ObjPS.AddPSSimplificado(PS) > 0 Then
Alert("El P/S fue agregado correctamente.")
- RecargaGlobalEquivalencias()
+ GeneraGlobalDT(Nothing)
End If
ObjPS.Dispose()
@@ -19106,18 +19106,11 @@ Partial Class Compras_Compras
UpAgregarPS.Update()
- RegistraScript("$('#DivAgregarPS').modal('hide');")
- RecargaPSGlobal()
- End Sub
- Private Sub RecargaPSGlobal()
- 'GlobalDTPSSimplificado(UsuarioActual.CveEmpresa) = Nothing
- 'Dim ObjPS As New ClsProductosServicios
+ RegistraScript("$('#DivAgregarPS').modal('hide');")
- 'If ObjPS.GetPSSimplificado(-1) Then Application("GlobalDTPSSimplificado") = ObjPS.DtResultados.AsEnumerable()
-
- 'ObjPS.Dispose()
End Sub
+
#End Region
#Region "TIPO DE COMPRA"
diff --git a/General/SaldosIniciales.aspx.vb b/General/SaldosIniciales.aspx.vb
index 930cd697c..004b752d8 100644
--- a/General/SaldosIniciales.aspx.vb
+++ b/General/SaldosIniciales.aspx.vb
@@ -296,17 +296,17 @@ Partial Class General_SaldosIniciales
Exit Sub
End If
- If RblFormato.SelectedValue = "4" Then
- If Not dt.Columns(15).ColumnName = "ImpuestoLocal" Then
- Alert("El nombre de la diesciseisava columna debe ser 'ImpuestoLocal'. Favor de corregirlo", TipoMensaje.MsgError)
- Exit Sub
- End If
+ 'If RblFormato.SelectedValue = "4" Then
+ ' If Not dt.Columns(15).ColumnName = "ImpuestoLocal" Then
+ ' Alert("El nombre de la diesciseisava columna debe ser 'ImpuestoLocal'. Favor de corregirlo", TipoMensaje.MsgError)
+ ' Exit Sub
+ ' End If
- If Not dt.Columns(16).ColumnName = "Amort.Ant" Then
- Alert("El nombre de la diescisieteava columna debe ser 'Amort.Ant'. Favor de corregirlo", TipoMensaje.MsgError)
- Exit Sub
- End If
- End If
+ ' If Not dt.Columns(16).ColumnName = "Amort.Ant" Then
+ ' Alert("El nombre de la diescisieteava columna debe ser 'Amort.Ant'. Favor de corregirlo", TipoMensaje.MsgError)
+ ' Exit Sub
+ ' End If
+ 'End If
ElseIf RblFormato.SelectedValue = "5" Then
@@ -1356,8 +1356,8 @@ Partial Class General_SaldosIniciales
Dim Folio As Integer = Row("Folio").ToString.ToEntero
Dim Fecha As Date = Row("Fecha").ToString.ToDate
Dim FechaVencimiento As Date = Row("Fecha Vencimiento").ToString.ToDate
- Dim ImpuestoLocal As Double = Row("ImpuestoLocal").ToString.ToDouble
- Dim Amortizacion As Double = Row("Amort.Ant").ToString.ToDouble
+ Dim ImpuestoLocal As Double = If(dt.Columns.Contains("ImpuestoLocal"), Row("ImpuestoLocal").ToString.ToDouble, 0.0)
+ Dim Amortizacion As Double = If(dt.Columns.Contains("Amort.Ant"), Row("Amort.Ant").ToString.ToDouble, 0.0)
Dim SubTotal As Decimal = Row("SubTotal").ToString.ToDecimal
Dim IVA As Decimal = Row("IVA").ToString.ToDecimal
Dim Total As Decimal = Row("Total").ToString.ToDecimal
@@ -1372,7 +1372,8 @@ Partial Class General_SaldosIniciales
Dim CveVendedor As Integer = 0
Dim IEPS As Decimal = 0 'Row("IEPS").ToString.ToDecimal
Dim CveClienteSucursal As Integer = 0 'Row("CveClienteSucursal").ToString.ToEntero
- Dim ImpuestosLocales As Decimal = Row("ImpuestoLocal").ToString.ToDecimal
+ Dim ImpuestosLocales As Decimal = If(dt.Columns.Contains("ImpuestoLocal"), Row("ImpuestoLocal").ToString.ToDecimal, 0)
+ Dim FolioFiscal As String = If(dt.Columns.Contains("Folio Fiscal"), Row("Folio Fiscal").ToString, "")
GuardaLog(Sucursal + "-" + Row("Folio").ToString)
'Temporalmente SE BORRARA
@@ -1437,6 +1438,12 @@ Partial Class General_SaldosIniciales
ConceptoContablePago = 91
End If
+ If FolioFiscal <> "" Then
+ If Not ObjVentas.UpdateVentaFolioFiscal(FolioFiscal, CveVenta, UsuarioActual.CveEmpresa) Then
+ ErrorVentas = True
+ Exit For
+ End If
+ End If
'PrePólizaDetalle
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, SubTotal, Folio.ToString, 4, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveClasificacion:=CveClasificacion, ImporteMX:=SubTotal, CveSubProyecto:=Sucursal.ToEntero) Then ErrorVentas = True : Exit For
diff --git a/Inventarios/CatAlmacenes.aspx.vb b/Inventarios/CatAlmacenes.aspx.vb
index 072edd0a3..d28cd35dd 100644
--- a/Inventarios/CatAlmacenes.aspx.vb
+++ b/Inventarios/CatAlmacenes.aspx.vb
@@ -297,6 +297,7 @@ Partial Class Inventarios_CatAlmacenes
Private Sub DdlModalidad_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlModalidad.SelectedIndexChanged
If DdlModalidad.SelectedValue = 1 Then
divddlcc.Visible = True
+ CargaCuentasContables()
Else
divddlcc.Visible = False
End If
diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb
index 44e5f7e9c..7906f4e00 100644
--- a/Inventarios/RecepcionAlmacen.aspx.vb
+++ b/Inventarios/RecepcionAlmacen.aspx.vb
@@ -2155,7 +2155,7 @@ Partial Class Inventarios_RecepcionAlmacen
ErrorMovInv = True
End If
- If Not ErrorMovInv Then
+ If Not ErrorMovInv AndAlso Dt IsNot Nothing Then
For Each Dr As DataRow In Dt.Rows
If Not ObjInventario.AddMovimientoDetalle(CveMovtoSalidaDirecta, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero, Dr("CveSeccionAlmacen").ToString.ToEntero, Dr("SerieLote").ToString, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
ErrorMovInv = True
diff --git a/Inventarios/RecepcionUsados.aspx.vb b/Inventarios/RecepcionUsados.aspx.vb
index a22ed7047..113da0acf 100644
--- a/Inventarios/RecepcionUsados.aspx.vb
+++ b/Inventarios/RecepcionUsados.aspx.vb
@@ -309,6 +309,14 @@ Partial Class Inventarios_RecepcionUsados
ViewState("TmpDTAjustes") = value
End Set
End Property
+ Private Property DtPorcentajeMarcas As DataTable
+ Get
+ Return If(IsNothing(ViewState("DtPorcentajeMarcas")), Nothing, CType(ViewState("DtPorcentajeMarcas"), DataTable))
+ End Get
+ Set(value As DataTable)
+ ViewState("DtPorcentajeMarcas") = value
+ End Set
+ End Property
#End Region
@@ -2442,13 +2450,18 @@ Partial Class Inventarios_RecepcionUsados
Public Sub OnRblUsadosAjuste_Change(sender As Object, e As EventArgs)
DdlAlmacen.Items.Clear()
If RblUsadosAjuste.SelectedValue = "1" Then
- CargaAjuste()
- DivAjuste.Visible = True
- 'Llenar el dropdownlist de almacén
- DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 6)
- LnkAgregarUsado.Visible = False
- UppAcciones.Update()
-
+ If DdlClientes.SelectedValue <> "-1" Then
+ CargaAjuste()
+ DivAjuste.Visible = True
+ 'Llenar el dropdownlist de almacén
+ DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 6)
+ CargarDescuento()
+ LnkAgregarUsado.Visible = False
+ UppAcciones.Update()
+ Else
+ Alert("hace falta seleccionar un cliente")
+ RblUsadosAjuste.SelectedValue = "0"
+ End If
Else
DivAjuste.Visible = False
'Llenar el dropdownlist de almacén
@@ -2535,7 +2548,32 @@ Partial Class Inventarios_RecepcionUsados
If drPS IsNot Nothing Then
PrecioSugerido = drPS("Precio").ToString.ToDecimal
+ Dim PS As String = drPS("PS").ToString
+ Dim Arr = PS.Split("-"c)
+ If Arr.Count > 0 Then
+ If (DdlBCIAjuste.Items.FindByText(Arr(1).ToString) IsNot Nothing) Then
+ DdlBCIAjuste.SelectedValueExist(DdlBCIAjuste.Items.FindByText(Arr(1).ToString).Value)
+ End If
+
+ End If
+
End If
+ Dim MarcaPorcentaje As DataRow = DtPorcentajeMarcas.FiltroPrimero(String.Format("CveMarca = {0}", drPS("CveMarca").ToString))
+ If MarcaPorcentaje IsNot Nothing Then
+ Dim PorcentajeProducto As Decimal = MarcaPorcentaje("PorcentajeProducto").ToString.ToDecimal / 100
+ Dim MontoDescuento As Decimal = PrecioSugerido * PorcentajeProducto
+ PrecioSugerido -= MontoDescuento
+
+ Dim PorcentajeProducto2 As Decimal = MarcaPorcentaje("PorcentajeProducto2").ToString.ToDecimal / 100
+ MontoDescuento = PrecioSugerido * PorcentajeProducto2
+ PrecioSugerido -= MontoDescuento
+
+ Dim PorcentajeProducto3 As Decimal = MarcaPorcentaje("PorcentajeProducto3").ToString.ToDecimal / 100
+ MontoDescuento = PrecioSugerido * PorcentajeProducto3
+ PrecioSugerido -= MontoDescuento
+
+ End If
+
txtPrecio.Text = PrecioSugerido.FormatoNumero(2)
TxtPUFactura.Text = PrecioSugerido.FormatoNumero(2)
End If
@@ -2704,6 +2742,14 @@ Partial Class Inventarios_RecepcionUsados
End If
ObjPS.Dispose()
End Sub
+
+ Protected Sub CargarDescuento()
+ Dim ObjPS As New ClsProductosServicios
+ If ObjPS.GetPorcentajeMarcas(DdlClientes.SelectedValue.ToEntero) Then
+ DtPorcentajeMarcas = ObjPS.DtResultados.Copy()
+ End If
+ ObjPS.Dispose()
+ End Sub
#End Region
End Class
diff --git a/Ventas/ClientesAbonar.aspx.vb b/Ventas/ClientesAbonar.aspx.vb
index 25766dd80..e91c73d26 100644
--- a/Ventas/ClientesAbonar.aspx.vb
+++ b/Ventas/ClientesAbonar.aspx.vb
@@ -900,6 +900,7 @@ Partial Class Ventas_ClientesAbonar
Select Case ConceptoContable
Case 2 'Pago Cliente
+ 'If gvr.DataKey("CveMoneda").ToEntero > 1 Then ConceptoContable = 292
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = gvr.FCTextBox("TxtAbonar").Text.ToDecimal
importeMX = ImporteMovimiento
diff --git a/Ventas/PV.aspx b/Ventas/PV.aspx
index f2660bbdf..656670d36 100644
--- a/Ventas/PV.aspx
+++ b/Ventas/PV.aspx
@@ -616,8 +616,7 @@