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/ClsNominas.vb b/App_Code/ClsNominas.vb
index 53cc36e26..b20d213f2 100644
--- a/App_Code/ClsNominas.vb
+++ b/App_Code/ClsNominas.vb
@@ -3139,18 +3139,18 @@ 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)
addParameters("@CveUsuario", SqlDbType.Int, cveUsuario)
addParameters("@CveEmpresa", SqlDbType.Int, cveEmpresa)
addParameters("@CveEmbarqueManifiesto", SqlDbType.Int, cveEmbarqueManifiesto)
- retorno = RunQuery("Ocurrió un error al obtener el PA_AGRO_Embarque_ManifiestoGet.")
+ retorno = RunQuery("Ocurrió un error al obtener el Embarque Manifiesto .")
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) 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)
@@ -3165,7 +3165,8 @@ Public Class ClsNominas
addParameters("@CveEmpresa", SqlDbType.Int, cveEmpresa)
addParameters("@CveEmbarqueManifiesto", SqlDbType.Int, cveEmbarqueManifiesto)
addParameters("@CveTemporada", SqlDbType.Int, cveTemporada)
- retorno = RunQuery("Ocurrió un error al obtener el PA_Agro_Embarque_PalletGet.")
+ addParameters("@Agrupado", SqlDbType.Bit, agrupado)
+ retorno = RunQuery("Ocurrió un error al obtener el Embarque Pallet .")
Return retorno
End Function
#Region "Visor sat"
diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb
index 7a6893c9d..acbed6511 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
@@ -3825,6 +3825,49 @@ Namespace Modelos
If Not (GenerarMovimientoAlmacenServicioDomicilio(ObjInventario, factura, DtInventario, factura.CveAlmacenTraspasoDestino, 9, factura.CveMoneda, factura.CveVenta, "Modelos/SD2", CveMovimientoRelacionado:=CveMovimientoSalida) > 0) Then
OcurrioError = True
End If
+
+ ' COMIENZA: GARANTIAS
+ Dim CveAlmacenGarantia As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveTipoAlmacen:=6).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={factura.CveSubProyecto}").ToEntero()
+ Dim DtGarantias As DataTable = Nothing
+
+ If ObjAcum.GetGarantiasDetalle(factura.CveVenta) Then
+ DtGarantias = ObjAcum.DtResultados.Copy()
+ End If
+
+ If DtGarantias IsNot Nothing AndAlso DtGarantias.Rows.Count > 0 AndAlso CveAlmacenGarantia > 0 Then
+ Dim TotalGarantia As Decimal = 0
+ Dim CveMovimientoGarantia = ObjInventario.AddMovimiento(CveAlmacenGarantia, 2, 1, factura.Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, factura.CveVenta, -1, -1, Observaciones:="", Guia:="", Modulo:="Modelos/SDGA")
+ Dim FolioGarantia = ObjInventario.Folio
+
+ For Each RowGarantia As DataRow In DtGarantias.Rows
+ Dim CvePS = RowGarantia("CvePS").ToString().ToEntero()
+ Dim CveTamaño As Integer = RowGarantia("CveTamaño").ToString().ToEntero()
+ Dim CveUM As Integer = RowGarantia("CveUnidadMedida").ToString().ToEntero()
+ Dim PU As Decimal = RowGarantia("Importe").ToString().ToDecimal() ' / RowGarantia("Cantidad").ToString().ToDouble()
+ Dim Serie As String = RowGarantia("Comprobante").ToString
+
+ If Not ObjInventario.AddMovimientoDetalle(CveMovimientoGarantia, RowGarantia("Cantidad").ToString().ToDouble(), CveUM, CvePS, PU, Serie:=Serie, CveVentaDetalle:=RowGarantia("CveVentaDetalle").ToString.ToEntero) Then
+ OcurrioError = True
+ Exit For
+ End If
+ TotalGarantia += (RowGarantia("Cantidad").ToString().ToDecimal() * PU)
+ Next
+
+ Dim CvePrePolizaTraspaso As Integer = ObjConta.AddPrePolizas("EA/Gar", 53, 0, 0, 1, factura.Fecha, "Entrada Garantía", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
+ If CvePrePolizaTraspaso > 0 Then
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaTraspaso, False, TotalGarantia, "MOVIMIENTO DE GARANTIA", 68, "MOVIMIENTO DE GARANTIA", factura.Fecha, -1, -1, CveMovimientoAlmacen:=CveMovimientoGarantia, Contabilizable:=True, ImporteMX:=TotalGarantia) Then
+ OcurrioError = True
+ End If
+
+ If Not OcurrioError AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePolizaTraspaso, True, TotalGarantia, "MOVIMIENTO DE GARANTIA", 331, "MOVIMIENTO DE GARANTIA", factura.Fecha, -1, -1, CveMovimientoAlmacen:=CveMovimientoGarantia, Contabilizable:=True, ImporteMX:=TotalGarantia) Then
+ OcurrioError = True
+ End If
+ Else
+ OcurrioError = True
+ End If
+
+ End If
+
Else
OcurrioError = True
End If
@@ -5095,7 +5138,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/Devoluciones.aspx.cs b/Bancos/Devoluciones.aspx.cs
index ad11e336e..dfbffe5c3 100644
--- a/Bancos/Devoluciones.aspx.cs
+++ b/Bancos/Devoluciones.aspx.cs
@@ -385,6 +385,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 +404,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 +433,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)
{
diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb
index 1c2ca9a0c..e34d14c39 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
diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb
index 387ed4951..cdd2e3557 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
diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb
index c9753e346..0ddd596fe 100644
--- a/Compras/Compras.aspx.vb
+++ b/Compras/Compras.aspx.vb
@@ -1290,7 +1290,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"))
@@ -5081,31 +5087,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 +5486,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 +5634,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 +5652,6 @@ Partial Class Compras_Compras
Capital = Ambos
Interes = Ambos
-
End If
If Capital > 0 Then
@@ -5695,8 +5661,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 +5679,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 +5717,6 @@ Partial Class Compras_Compras
IdCtaIVAAcreditable = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeIVA).Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero
End If
-
-
'********************** Variables '**********************
'****** Pagos
@@ -5864,8 +5823,6 @@ Partial Class Compras_Compras
Dim importeRetISRxAcreditar As Decimal = 0
importeRetISRxAcreditar = TxtRetISR.Text.ToDecimal
-
-
'****** Movimientos Independientes
'Pago Proveedores (17)
@@ -6276,17 +6233,6 @@ Partial Class Compras_Compras
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
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, TipoCambio:=tipoCambioActual) Then
@@ -6414,34 +6360,8 @@ Partial Class Compras_Compras
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 +6402,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"
@@ -6916,8 +6813,6 @@ Partial Class Compras_Compras
End If
Next
-
-
'la diferencia se va aplicar sobre los
'Dim diferenciaTransito As Decimal = ImporteTransito - importeMN.RoundSQL
@@ -6967,12 +6862,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
@@ -7150,15 +7042,11 @@ Partial Class Compras_Compras
End If
-
-
End If
-
Next
End If
End If
-
'LIMPIA
importeMovimiento = 0
IdCtaContable = 0
@@ -7199,12 +7087,6 @@ 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
@@ -7356,8 +7238,6 @@ Partial Class Compras_Compras
End If
End If
-
- 'ObjConta.PrePolizaUnificacion(CvePrePoliza, CvePrePolizaTemp)
End If
Next
@@ -7707,12 +7587,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 +8294,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 +8365,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 +8389,6 @@ Partial Class Compras_Compras
End If
-
-
'AJUSTA POLIZA
If IdPoliza > 0 Then
PolizaFolio = ObjContaAC.Folio
@@ -8540,6 +8410,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()
@@ -18057,9 +17932,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 +18776,7 @@ Partial Class Compras_Compras
CompruebaAgregar()
End If
- Alert("SubProyectos cambiados correctamente", TipoMensaje.MsgInformacion)
+ Alert("SubProyectos cambiados correctamente", TipoMensaje.ToastInformacion)
End Sub
@@ -18926,7 +18805,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 7908239ca..99e907c8d 100644
--- a/Compras/PopUpVerFactura.aspx.vb
+++ b/Compras/PopUpVerFactura.aspx.vb
@@ -247,6 +247,7 @@ Partial Class PopUpVerFactura
Dim SCAC As String = ""
Dim CAAT As String = ""
Dim NumeroTrailer As String = ""
+ Dim Permiso As String = ""
Dim tablaReporte As New DataTable
@@ -257,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()
@@ -282,7 +283,7 @@ Partial Class PopUpVerFactura
LineaTransportacion = row("LineaTransportacion").ToString()
SCAC = row("SCAC").ToString()
CAAT = row("CAAT").ToString()
-
+ Permiso = row("Permiso").ToString()
'If row("CveCamionRemolque1").ToString() = "1" Then
' Rem1Placa = "12-TF-5E"
' Remolque1 = "Remolque 1"
@@ -292,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) And objnom.DtResultados.Rows.Count > 0 Then
- NoPallets = objnom.DtResultados.Rows.Count.ToString()
+ 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
@@ -307,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))
@@ -317,6 +319,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("Camion", Camion))
params.Add(New ReportParameter("Rem1Placa", Rem1Placa))
params.Add(New ReportParameter("Remolque1", Remolque1))
+ params.Add(New ReportParameter("Permiso", Permiso))
params.Add(New ReportParameter("LongitudCaja", LongitudCaja))
@@ -343,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)
@@ -392,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()
@@ -438,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")
@@ -547,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()
@@ -593,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")
@@ -684,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()
@@ -754,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()
diff --git a/Compras/RepProductosServiciosDetalle.aspx.vb b/Compras/RepProductosServiciosDetalle.aspx.vb
index 879869d8f..953b668dc 100644
--- a/Compras/RepProductosServiciosDetalle.aspx.vb
+++ b/Compras/RepProductosServiciosDetalle.aspx.vb
@@ -123,6 +123,9 @@ Partial Class Compras_RepProductosServiciosDetalle
txtFechaI.Text = If(Mes <> "-1", String.Format("01/{0}/0001", Mes), txtFechaI.Text)
txtFechaI.Text = If(AnioMes <> "-1", String.Format("01/{0}/{1}", AnioMes.Substring(5, 1).PadLeft(2, "0"c), AnioMes.Substring(0, 4)), txtFechaI.Text)
+ If CveCultivo.ToEntero() > 0 AndAlso FechaI = "-1" AndAlso Anio = "-1" AndAlso Mes = "-1" AndAlso AnioMes = "-1" Then
+ txtFechaI.Text = "01/01/1900"
+ End If
If Fecha <> "-1" Then
txtFechaI.Text = Fecha
txtFechaF.Text = Fecha
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 @@
diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb
index 8893506f5..3d38484e1 100644
--- a/Inventarios/RecepcionAlmacen.aspx.vb
+++ b/Inventarios/RecepcionAlmacen.aspx.vb
@@ -4864,7 +4864,13 @@ Partial Class Inventarios_RecepcionAlmacen
Dim file As Archivo = TxtExcel.getfiles().Archivos(0)
Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.path
Dim Tipo As String = If(file.Extension.Contiene("xlsx", "xlsx", "xlsm", "xlsb", "xls"), "EXCEL", "CSV")
- CargarArchivoExcel(Directorio, file.filename)
+
+ If Tipo = "CSV" AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" Then 'empresa de acumuladores
+ CargaArchivoCSV(Directorio, file.filename, HLFolio.Text)
+ Else
+ CargarArchivoExcel(Directorio, file.filename)
+ End If
+
Else
Alert("No existe el archivo. Favor de subir un archivo excel a la plataforma.", TipoMensaje.MsgError)
End If
@@ -4903,93 +4909,97 @@ Partial Class Inventarios_RecepcionAlmacen
Exit Sub
End If
-
- dt.TableName = "Datos"
- Dim ProductosNoCargados As New StringBuilder()
- Dim RowsCargados As Integer = 0
- Dim RowsNoCargados As Integer = 0
- Dim NoPSConSerie As Integer = 0
-
- If CveCompraSurtir > 0 Then
- 'DtRecepcion
- Try
- 'Dim DtPS As DataTable = GlobalDTPS(UsuarioActual.CveEmpresa)
- 'If(dt.Columns.Contains("PorcentajeIVA"), Round(Row("PorcentajeIVA").ToString.ToDecimal, 4), 0)
- For Each RowExcel As DataRow In dt.Rows
- If RowExcel("Código").ToString() <> "" Then
-
- Dim RowPS = DtInv.FiltroPrimero(String.Format("Codigo='{0}'", RowExcel("Código").ToString()))
-
- If RowPS IsNot Nothing AndAlso RowPS("CvePS").ToString().ToEntero() > 0 Then
-
- Dim CveProducto As Integer = RowPS("CvePS").ToString().ToEntero()
- Dim CveUnidadMedida As Integer = RowPS("CveUM").ToString().ToEntero()
- CvePSSerie = CveProducto
- CveConsecSerie = DtInv.FiltroPrimeroValor("Consec", "CvePS=" & CvePSSerie).ToEntero
-
- Dim Cantidad As Double = RowExcel("Cantidad").ToString().ToDecimal()
- Dim Serie As String = RowExcel("Serie").ToString()
- Dim Lote As String = "" '= RowExcel("Lote").ToString()
- Dim FechaCaducidad As Date = MinFecha '= If(RowExcel("FechaCaducidad").ToString = "", MinFecha, RowExcel("FechaCaducidad").ToString.ToDate)
- Dim Observaciones As String = "" '= If(dt.Columns.Contains("Observaciones"), RowExcel("Observaciones").ToString, "").ToString
- LbCantidad.Text = Cantidad.ToString
-
- Dim Valido As Boolean = True
-
- If RowPS("AplicaSerie").ToString() = "True" And (String.IsNullOrEmpty(Serie.Trim()) OrElse Serie = "-1") Then
- Valido = False
- Alert($"El producto '{RowPS("PS")}' requiere 'Serie'", TipoMensaje.MsgAdvertencia)
- ProductosNoCargados.AppendFormat("{0},", RowPS("PS").ToString())
- End If
-
- If RowPS("AplicaSerie").ToString() = "True" AndAlso Not String.IsNullOrEmpty(Serie.Trim()) Then
- NoPSConSerie = NoPSConSerie + 1
- End If
-
-
- If Valido Then
- CveConsecSerie = RowPS("Consec").ToString.ToEntero
- AgregaSerie(RowExcel("Serie").ToString, 1)
-
- 'AgregarPS(Cantidad, CveProducto, CveUnidadMedida, Observaciones, CveSeccionAlmacen:=DdlSeccionAlmacen.SelectedValue.ToEntero, SeccionAlmacen:=DdlSeccionAlmacen.SelectedItem.Text, Serie:=If(Not String.IsNullOrEmpty(Serie), Serie, ""), Lote:=Lote, FechaCaducidad:=FechaCaducidad, Limpia:=False)
- RowsCargados = RowsCargados + 1
- Else
- RowsNoCargados = RowsNoCargados + 1
- ProductosNoCargados.AppendFormat("{0},", RowPS("PS").ToString())
- End If
-
- Else
- RowsNoCargados = RowsNoCargados + 1
- ProductosNoCargados.AppendFormat("{0},", RowExcel("Producto").ToString())
- End If
- End If
- Next
- Catch ex As Exception
- OnError("Ocurrió un error al cargar los productos." & ProductosNoCargados.ToString(), ex)
- Finally
-
- Dim MensajeFinal As New StringBuilder()
- If RowsNoCargados = 0 AndAlso RowsCargados > 0 Then
- MensajeFinal.Append("Los productos se cargaron correctamente.
")
- End If
- If RowsCargados > 0 Then
- MensajeFinal.Append("Se cargaron " & RowsCargados & " productos correctamente.")
- End If
- If RowsNoCargados > 0 Then
- MensajeFinal.Append("No se pudieron cargar " & RowsNoCargados & " productos. Los siguientes productos no se pudieron cargar: " & ProductosNoCargados.ToString())
- End If
-
- Alert(MensajeFinal.ToString())
-
- End Try
- Else
- Alert("No hay seleccionada compra", TipoMensaje.MsgError)
- End If
-
+ ProcesaExcel(dt)
End If
End Sub
+ Private Function ProcesaExcel(dt As DataTable) As Boolean
+ dt.TableName = "Datos"
+ Dim ProductosNoCargados As New StringBuilder()
+ Dim RowsCargados As Integer = 0
+ Dim RowsNoCargados As Integer = 0
+ Dim NoPSConSerie As Integer = 0
+
+ If CveCompraSurtir > 0 Then
+
+ Try
+
+ For Each RowExcel As DataRow In dt.Rows
+ If RowExcel("Código").ToString() <> "" Then
+
+ Dim RowPS = DtInv.FiltroPrimero(String.Format("Codigo='{0}'", RowExcel("Código").ToString()))
+
+ If RowPS IsNot Nothing AndAlso RowPS("CvePS").ToString().ToEntero() > 0 Then
+
+ Dim CveProducto As Integer = RowPS("CvePS").ToString().ToEntero()
+ Dim CveUnidadMedida As Integer = RowPS("CveUM").ToString().ToEntero()
+ CvePSSerie = CveProducto
+ CveConsecSerie = DtInv.FiltroPrimeroValor("Consec", "CvePS=" & CvePSSerie).ToEntero
+
+ Dim Cantidad As Double = RowExcel("Cantidad").ToString().ToDecimal()
+ Dim Serie As String = RowExcel("Serie").ToString()
+ Dim Lote As String = ""
+ Dim FechaCaducidad As Date = MinFecha
+ Dim Observaciones As String = ""
+ LbCantidad.Text = Cantidad.ToString
+
+ Dim Valido As Boolean = True
+
+ If RowPS("AplicaSerie").ToString() = "True" And (String.IsNullOrEmpty(Serie.Trim()) OrElse Serie = "-1") Then
+ Valido = False
+ Alert($"El producto '{RowPS("PS")}' requiere 'Serie'", TipoMensaje.MsgAdvertencia)
+ ProductosNoCargados.AppendFormat("{0},", RowPS("PS").ToString())
+ End If
+
+ If RowPS("AplicaSerie").ToString() = "True" AndAlso Not String.IsNullOrEmpty(Serie.Trim()) Then
+ NoPSConSerie = NoPSConSerie + 1
+ End If
+
+
+ If Valido Then
+ CveConsecSerie = RowPS("Consec").ToString.ToEntero
+ AgregaSerie(RowExcel("Serie").ToString, 1)
+
+ 'AgregarPS(Cantidad, CveProducto, CveUnidadMedida, Observaciones, CveSeccionAlmacen:=DdlSeccionAlmacen.SelectedValue.ToEntero, SeccionAlmacen:=DdlSeccionAlmacen.SelectedItem.Text, Serie:=If(Not String.IsNullOrEmpty(Serie), Serie, ""), Lote:=Lote, FechaCaducidad:=FechaCaducidad, Limpia:=False)
+ RowsCargados = RowsCargados + 1
+ Else
+ RowsNoCargados = RowsNoCargados + 1
+ ProductosNoCargados.AppendFormat("{0},", RowPS("PS").ToString())
+ End If
+
+ Else
+ RowsNoCargados = RowsNoCargados + 1
+ ProductosNoCargados.AppendFormat("{0},", RowExcel("Producto").ToString())
+ End If
+ End If
+ Next
+ Catch ex As Exception
+ OnError("Ocurrió un error al cargar los productos." & ProductosNoCargados.ToString(), ex)
+ Finally
+
+ Dim MensajeFinal As New StringBuilder()
+ If RowsNoCargados = 0 AndAlso RowsCargados > 0 Then
+ MensajeFinal.Append("Los productos se cargaron correctamente.
")
+ End If
+ If RowsCargados > 0 Then
+ MensajeFinal.Append("Se cargaron " & RowsCargados & " productos correctamente.")
+ End If
+ If RowsNoCargados > 0 Then
+ MensajeFinal.Append("No se pudieron cargar " & RowsNoCargados & " productos. Los siguientes productos no se pudieron cargar: " & ProductosNoCargados.ToString())
+ End If
+
+ Alert(MensajeFinal.ToString())
+
+ End Try
+ Else
+ Alert("No hay seleccionada compra", TipoMensaje.MsgError)
+ End If
+
+ Return True
+
+ End Function
+
Protected Sub LbDescargarExcelConceptos_Click(sender As Object, e As EventArgs)
DescargarFormato()
End Sub
@@ -5024,6 +5034,59 @@ Partial Class Inventarios_RecepcionAlmacen
End Sub
+
+ Private Sub CargaArchivoCSV(Ruta As String, FileName As String, Optional FolioFactura As String = "")
+
+ 'Create a DataTable.
+ Dim dt As New DataTable()
+
+ dt.Columns.AddRange(New DataColumn(9) {New DataColumn("CodBarra", GetType(String)),
+ New DataColumn("OVenta", GetType(String)),
+ New DataColumn("Factura", GetType(String)),
+ New DataColumn("FechaFac", GetType(String)),
+ New DataColumn("Pallet", GetType(String)),
+ New DataColumn("CodigoJCI", GetType(String)),
+ New DataColumn("Producto", GetType(String)),
+ New DataColumn("Serie", GetType(String)),'CodigoUnico
+ New DataColumn("Cantidad", GetType(Integer)),
+ New DataColumn("Código", GetType(String))})
+ FolioFactura = FolioFactura.Replace("-", "")
+
+ 'Read the contents of CSV file.
+ Dim csvData As String = File.ReadAllText(Ruta & FileName)
+ Dim CodigoUnico As String = "CU no escaneado" 'texto constante para determinar que no se leyó
+
+ Dim r As Integer = 1
+ 'Execute a loop over the rows.
+ For Each row As String In csvData.Split(ControlChars.Lf)
+
+ If r > 2 Then ' si es la segundo renglon
+ If Not String.IsNullOrEmpty(row) Then
+ Dim i As Integer = 0
+ Dim rr As String() = row.Split(","c)
+
+ If CodigoUnico <> rr(7).Trim AndAlso (FolioFactura = "" OrElse FolioFactura = rr(2).Trim) Then
+ dt.Rows.Add()
+ dt.Rows(dt.Rows.Count - 1)("CodBarra") = rr(0).Trim
+ dt.Rows(dt.Rows.Count - 1)("OVenta") = rr(1).Trim
+ dt.Rows(dt.Rows.Count - 1)("Factura") = rr(2).Trim
+ dt.Rows(dt.Rows.Count - 1)("FechaFac") = rr(3).Trim
+ dt.Rows(dt.Rows.Count - 1)("Pallet") = rr(4).Trim
+ dt.Rows(dt.Rows.Count - 1)("CodigoJCI") = rr(5).Trim
+ dt.Rows(dt.Rows.Count - 1)("Producto") = rr(6).Trim
+ dt.Rows(dt.Rows.Count - 1)("Serie") = rr(7).Trim
+ dt.Rows(dt.Rows.Count - 1)("Cantidad") = 1
+ dt.Rows(dt.Rows.Count - 1)("Código") = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Codigo", String.Format("Codigo2 = '{0}'", rr(5).Trim))
+
+ End If
+ End If
+ End If
+ r += 1
+ Next
+
+ ProcesaExcel(dt)
+
+ End Sub
#End Region
Private Function GuardaDocumentoBitacora(ObjEventoBitacora As ClsOIEventos, CveMovimiento As Integer) As Boolean
diff --git a/Inventarios/RepEntregaAlmacenRuta.aspx.cs b/Inventarios/RepEntregaAlmacenRuta.aspx.cs
index a58cccd61..229e939f5 100644
--- a/Inventarios/RepEntregaAlmacenRuta.aspx.cs
+++ b/Inventarios/RepEntregaAlmacenRuta.aspx.cs
@@ -537,11 +537,11 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas
{
CveTimbre = ObjGenerales.AddGralTimbre("Tra", CveSubProyecto, DateTime.Now, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEntregaAlmacen: CveEntregaAlmacen, AplicaCP: true);
}
- //regenero el timbre
- if (TimbreTipoDocto == "Ent")
- {
- CveTimbre = ObjGenerales.AddGralTimbre("Ent", CveSubProyecto, DateTime.Now, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEntregaAlmacen: CveEntregaAlmacen, AplicaCP: true);
- }
+ ////regenero el timbre
+ //if (TimbreTipoDocto == "Ent")
+ //{
+ // CveTimbre = ObjGenerales.AddGralTimbre("Ent", CveSubProyecto, DateTime.Now, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEntregaAlmacen: CveEntregaAlmacen, AplicaCP: true);
+ //}
ProcesoOK = true;
}
}
diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb
index ea04c720e..ee136e7bb 100644
--- a/OC/OC.aspx.vb
+++ b/OC/OC.aspx.vb
@@ -2549,7 +2549,8 @@ Partial Class OC
Dim ObjConta As New ClsContabilidad(OC.IniciaTransacSQL())
Dim ObjVentas As New ClsVentas(OC.IniciaTransacSQL())
Dim Conta As ClsContPAQi = Nothing
- If (UsuarioActual.Empresa.UsaAC AndAlso VerificaPresupuesto) Or UsuarioActual.Empresa.Funcionalidad(200) = "1" Then
+
+ If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso ((UsuarioActual.Empresa.UsaAC AndAlso VerificaPresupuesto) Or UsuarioActual.Empresa.Funcionalidad(200) = "1") Then
Conta = New ClsContPAQi(UsuarioActual.Empresa)
Conta.IniciaTransacSQL()
End If
diff --git a/SAT/SolicitudesNominaSat.aspx b/SAT/SolicitudesNominaSat.aspx
index 0ea64a4d1..cf60103ae 100644
--- a/SAT/SolicitudesNominaSat.aspx
+++ b/SAT/SolicitudesNominaSat.aspx
@@ -451,9 +451,16 @@
+
+
+
+
+
+
+
- Solicitar
+ Solicitar
@@ -546,6 +553,7 @@
+
diff --git a/SAT/SolicitudesNominaSat.aspx.cs b/SAT/SolicitudesNominaSat.aspx.cs
index 89225bcd0..f29aa6cef 100644
--- a/SAT/SolicitudesNominaSat.aspx.cs
+++ b/SAT/SolicitudesNominaSat.aspx.cs
@@ -2,6 +2,11 @@
using System.Collections.Generic;
using System.Data;
using System.Linq;
+using System.Net.Http;
+using System.Net.Http.Headers;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
@@ -44,9 +49,9 @@ public partial class SAT_SolicitudesNominaSat : ClsPaginas
{
if (!IsPostBack)
{
- TxtRpdFechaInicio.Text = string.Format("01/01/{0}", DateTime.Now.Year - 1);
- TxtRpdFechaFin.Text = string.Format("31/12/{0}", DateTime.Now.Year - 1);
- LnkConsultar_Click(null, null);
+ TxtRpdFechaInicio.Text = string.Format("01/{0:MM/yyyy}", DateTime.Now.AddMonths(-1));
+ TxtRpdFechaFin.Text = string.Format("{0:dd/MM/yyyy}", DateTime.Now.AddMonths(-1).LastDayOfMonth());
+ //LnkConsultar_Click(null, null);
}
}
@@ -174,6 +179,9 @@ public partial class SAT_SolicitudesNominaSat : ClsPaginas
}
}
UPModalViewSolicitudes.Update();
+ var api = new GeneralesAPI();
+ api.GeneraSolicitud();
+ api.VerificaSolicitudesNominas();
}
protected void LnkShowSolicitudes_Click(object sender, EventArgs e)
{
@@ -196,6 +204,9 @@ public partial class SAT_SolicitudesNominaSat : ClsPaginas
using (ClsNominas nom = new ClsNominas())
{
Continuar = nom.SolicitudesNominasAdd(idSolicitudCFDI, idSolicitudMetadata, estatus, observaciones, fechaInicio, fechaFin, cveUsuarioIng, cveEmpresa);
+ var api = new GeneralesAPI();
+ api.GeneraSolicitud();
+ api.VerificaSolicitudesNominas();
}
if (Continuar)
{
@@ -207,4 +218,198 @@ public partial class SAT_SolicitudesNominaSat : ClsPaginas
}
}
-}
\ No newline at end of file
+}
+
+public class GeneralesAPI : ADSNetLibrary.Helpers.Conexiones.SIGAPI.BaseSIGAPI
+{
+ public GeneralesAPI(string domainApi = "http://localhost:4001/", string token = "") : base(domainApi, token) { }
+
+
+ public object GeneraSolicitud()
+ {
+ return getData