diff --git a/Bancos/CuentasBancariasDetalle.aspx b/Bancos/CuentasBancariasDetalle.aspx
index a046b1e1a..68474870f 100644
--- a/Bancos/CuentasBancariasDetalle.aspx
+++ b/Bancos/CuentasBancariasDetalle.aspx
@@ -197,7 +197,9 @@
-
+
+
+<%--
Número de Tarjeta:
@@ -222,9 +224,7 @@
-
- <%--
-
--%>
+
@@ -242,13 +242,21 @@
Agregar
-
+ --%>
-
+
+
+
+
+
+
+
+
+ <%--
@@ -317,7 +325,9 @@
-
+ --%>
+
+
diff --git a/Bancos/CuentasBancariasDetalle.aspx.vb b/Bancos/CuentasBancariasDetalle.aspx.vb
index 490c0b79c..3d5b641a6 100644
--- a/Bancos/CuentasBancariasDetalle.aspx.vb
+++ b/Bancos/CuentasBancariasDetalle.aspx.vb
@@ -682,112 +682,124 @@ Partial Class Bancos_CuentasBancariasDetalle
Else
DivTarjeta.Visible = False
End If
- End Sub
-
-
+ End Sub
+
+
#End Region
-
+
#Region "D A T O S T A R J E TA - C R E D I T O"
- Private Sub LkbAgregarTarjera_Click(sender As Object, e As EventArgs) Handles LkbAgregarTarjera.Click
- Dim ObjTarjeta As New ClsBancos()
- Dim TieneError = False
-
- If Not ObjTarjeta.AddTarjetaCredito(CveCuenta, TxtNumTarjeta.Text, TxtNombreResponsable.Text, TxtFechaVencimiento.Text.ToDate, UsuarioActual.CveUsuario) Then
- TieneError = True
- End If
-
- If Not TieneError Then
- Alert("Se guardo la tarjeta de credito correctamente", TipoMensaje.MsgInformacion)
- TxtNumTarjeta.Text = ""
- TxtNombreResponsable.Text = ""
- TxtFechaVencimiento.Text = ""
- CargaDatosTarjeta()
- Else
- Alert("Ocurrio un Error al Guardar la tarjeta de credito", TipoMensaje.MsgError)
- End If
-
- ObjTarjeta.Dispose()
- UpDatos.Update()
- End Sub
-
+ 'Private Sub LkbAgregarTarjera_Click(sender As Object, e As EventArgs) Handles LkbAgregarTarjera.Click
+ ' Dim ObjTarjeta As New ClsBancos()
+ ' Dim TieneError = False
+
+ ' If Not ObjTarjeta.AddTarjetaCredito(CveCuenta, TxtNumTarjeta.Text, TxtNombreResponsable.Text, TxtFechaVencimiento.Text.ToDate, UsuarioActual.CveUsuario) Then
+ ' TieneError = True
+ ' End If
+
+ ' If Not TieneError Then
+ ' Alert("Se guardo la tarjeta de credito correctamente", TipoMensaje.MsgInformacion)
+ ' TxtNumTarjeta.Text = ""
+ ' TxtNombreResponsable.Text = ""
+ ' TxtFechaVencimiento.Text = ""
+ ' CargaDatosTarjeta()
+ ' Else
+ ' Alert("Ocurrio un Error al Guardar la tarjeta de credito", TipoMensaje.MsgError)
+ ' End If
+
+ ' ObjTarjeta.Dispose()
+ ' UpDatos.Update()
+ 'End Sub
+
Private Sub CargaDatosTarjeta()
- Dim ObjTarjeta As New ClsBancos()
+ 'Dim ObjTarjeta As New ClsBancos()
+
+ 'If ObjTarjeta.GetTarjetaCredito(-1, CveCuenta, -1) Then
+ ' GvTarjetas.DataSource = ObjTarjeta.DtResultados()
+ 'Else
+ ' GvTarjetas.DataSource = Nothing
+ 'End If
+ 'GvTarjetas.DataBind()
+ 'ObjTarjeta.Dispose()
+
+ Dim ObjCreditos As New ClsBancos
+ If ObjCreditos.GetTarjetasCreditos(CveCuenta) Then
+ If ObjCreditos.DtResultados.Rows.Count > 0 Then
+ GvTC.DataSource = ObjCreditos.DtResultados
+ End If
+ GvTC.Visible = True
+ End If
+ ObjCreditos.Dispose()
+
+ GvTC.DataBind()
- If ObjTarjeta.GetTarjetaCredito(-1, CveCuenta, -1) Then
- GvTarjetas.DataSource = ObjTarjeta.DtResultados()
- Else
- GvTarjetas.DataSource = Nothing
- End If
- GvTarjetas.DataBind()
- ObjTarjeta.Dispose()
UpDatos.Update()
End Sub
- Private Sub GvTarjetas_RowEditing(sender As Object, e As GridViewEditEventArgs) Handles GvTarjetas.RowEditing
- GvTarjetas.EditIndex = e.NewEditIndex
- CargaDatosTarjeta()
- End Sub
+ 'Private Sub GvTarjetas_RowEditing(sender As Object, e As GridViewEditEventArgs) Handles GvTarjetas.RowEditing
+ ' GvTarjetas.EditIndex = e.NewEditIndex
+ ' CargaDatosTarjeta()
+ 'End Sub
- Private Sub GvTarjetas_RowCancelingEdit(sender As Object, e As GridViewCancelEditEventArgs) Handles GvTarjetas.RowCancelingEdit
- GvTarjetas.EditIndex = -1
- CargaDatosTarjeta()
- End Sub
+ 'Private Sub GvTarjetas_RowCancelingEdit(sender As Object, e As GridViewCancelEditEventArgs) Handles GvTarjetas.RowCancelingEdit
+ ' GvTarjetas.EditIndex = -1
+ ' CargaDatosTarjeta()
+ 'End Sub
- Private Sub GvTarjetas_RowUpdating(sender As Object, e As GridViewUpdateEventArgs) Handles GvTarjetas.RowUpdating
- Dim ObjTarjeta As New ClsBancos()
- Dim TieneError = False
+ 'Private Sub GvTarjetas_RowUpdating(sender As Object, e As GridViewUpdateEventArgs) Handles GvTarjetas.RowUpdating
+ ' Dim ObjTarjeta As New ClsBancos()
+ ' Dim TieneError = False
- Dim CveCuentaTarjeta = GvTarjetas.Rows(e.RowIndex).DataKey("CveCuentaTarjeta").ToEntero
- Dim CveCuenta As Integer = GvTarjetas.Rows(e.RowIndex).DataKey("CveCuenta").ToEntero
- Dim Numero = DirectCast(GvTarjetas.Rows(e.RowIndex).FindControl("TxtNumeroEdit"), TextBox).Text.Trim
- Dim Responsable = DirectCast(GvTarjetas.Rows(e.RowIndex).FindControl("TxtResponsableEdit"), TextBox).Text.Trim
- Dim Vencimiento = DirectCast(GvTarjetas.Rows(e.RowIndex).FindControl("TxtFechaVencimientoEdit"), TextBox).Text.ToDate
+ ' Dim CveCuentaTarjeta = GvTarjetas.Rows(e.RowIndex).DataKey("CveCuentaTarjeta").ToEntero
+ ' Dim CveCuenta As Integer = GvTarjetas.Rows(e.RowIndex).DataKey("CveCuenta").ToEntero
+ ' Dim Numero = DirectCast(GvTarjetas.Rows(e.RowIndex).FindControl("TxtNumeroEdit"), TextBox).Text.Trim
+ ' Dim Responsable = DirectCast(GvTarjetas.Rows(e.RowIndex).FindControl("TxtResponsableEdit"), TextBox).Text.Trim
+ ' Dim Vencimiento = DirectCast(GvTarjetas.Rows(e.RowIndex).FindControl("TxtFechaVencimientoEdit"), TextBox).Text.ToDate
- If Not ObjTarjeta.UpdateTarjetaCredito(CveCuentaTarjeta, CveCuenta, Numero, Responsable, Vencimiento, UsuarioActual.CveUsuario) Then
- TieneError = True
- Else
- GvTarjetas.EditIndex = -1
- End If
+ ' If Not ObjTarjeta.UpdateTarjetaCredito(CveCuentaTarjeta, CveCuenta, Numero, Responsable, Vencimiento, UsuarioActual.CveUsuario) Then
+ ' TieneError = True
+ ' Else
+ ' GvTarjetas.EditIndex = -1
+ ' End If
- If Not TieneError Then
- Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
- CargaDatosTarjeta()
- Else
- Alert("Error al actualizar los cambios.", TipoMensaje.MsgError)
- End If
+ ' If Not TieneError Then
+ ' Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
+ ' CargaDatosTarjeta()
+ ' Else
+ ' Alert("Error al actualizar los cambios.", TipoMensaje.MsgError)
+ ' End If
- ObjTarjeta.Dispose()
- UpDatos.Update()
- End Sub
+ ' ObjTarjeta.Dispose()
+ ' UpDatos.Update()
+ 'End Sub
- Private Sub GvTarjetas_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GvTarjetas.RowDeleting
- Dim ObjTarjeta As New ClsBancos()
- Dim TieneError = False
+ 'Private Sub GvTarjetas_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GvTarjetas.RowDeleting
+ ' Dim ObjTarjeta As New ClsBancos()
+ ' Dim TieneError = False
- Dim CveCuentaTarjeta = GvTarjetas.Rows(e.RowIndex).DataKey("CveCuentaTarjeta").ToEntero
+ ' Dim CveCuentaTarjeta = GvTarjetas.Rows(e.RowIndex).DataKey("CveCuentaTarjeta").ToEntero
- If ObjTarjeta.RemoveTarjetaCredito(CveCuentaTarjeta, UsuarioActual.CveUsuario) Then
- CargaDatosTarjeta()
- Alert("Se eliminaron datos correctamente", TipoMensaje.MsgInformacion)
- Else
- Alert("Error al eliminar", TipoMensaje.MsgError)
- End If
+ ' If ObjTarjeta.RemoveTarjetaCredito(CveCuentaTarjeta, UsuarioActual.CveUsuario) Then
+ ' CargaDatosTarjeta()
+ ' Alert("Se eliminaron datos correctamente", TipoMensaje.MsgInformacion)
+ ' Else
+ ' Alert("Error al eliminar", TipoMensaje.MsgError)
+ ' End If
- ObjTarjeta.Dispose()
- UpDatos.Update()
- End Sub
+ ' ObjTarjeta.Dispose()
+ ' UpDatos.Update()
+ 'End Sub
- Private Sub GvTarjetas_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvTarjetas.RowDataBound
- If e.Row.RowType = DataControlRowType.DataRow Then
- If e.Row.RowIndex = 0 Then
- e.Row.Cells(0).Width = Unit.Pixel(100)
- e.Row.Cells(1).Width = Unit.Pixel(100)
- e.Row.Cells(2).Width = Unit.Pixel(200)
- e.Row.Cells(3).Width = Unit.Pixel(20)
- e.Row.Cells(4).Width = Unit.Pixel(20)
- End If
- End If
- End Sub
+ 'Private Sub GvTarjetas_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvTarjetas.RowDataBound
+ ' If e.Row.RowType = DataControlRowType.DataRow Then
+ ' If e.Row.RowIndex = 0 Then
+ ' e.Row.Cells(0).Width = Unit.Pixel(100)
+ ' e.Row.Cells(1).Width = Unit.Pixel(100)
+ ' e.Row.Cells(2).Width = Unit.Pixel(200)
+ ' e.Row.Cells(3).Width = Unit.Pixel(20)
+ ' e.Row.Cells(4).Width = Unit.Pixel(20)
+ ' End If
+ ' End If
+ 'End Sub
Private Function CargarDdlUsuarios(UsuariosGlobal As DataTable) As DataTable
Dim tablaUsuariosFormateada As DataTable = New DataTable("Usuarios")
diff --git a/Bancos/FluctuacionCambiaria.aspx b/Bancos/FluctuacionCambiaria.aspx
index e675c9d97..343bfe9ce 100644
--- a/Bancos/FluctuacionCambiaria.aspx
+++ b/Bancos/FluctuacionCambiaria.aspx
@@ -734,11 +734,11 @@
-
+
-
+
-
+
-
-
-
+
0 Then
CveConceptoContable = 64 : TipoMovto = True
Else
CveConceptoContable = 65 : TipoMovto = False
@@ -1087,7 +1085,7 @@ Partial Class Bancos_FluctuacionCambiaria
Next
If Not ErrorRegistrar Then
- If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(TotalAcumulado), Math.Abs(TotalAcumulado), CveConceptoContable, ConceptoFluctuacion, ConceptoFluctuacion, CveSubProyecto:=DdlSubProyectoAcreedoresDiversos.SelectedValue.ToEntero) Then
+ If Not Conta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovto, Math.Abs(TotalAcumulado), Math.Abs(TotalAcumulado), CveConceptoContable, ConceptoFluctuacion, ConceptoFluctuacion, CveSubProyecto:=DdlSubProyectoAcreedoresDiversos.SelectedValue.ToEntero) Then
ErrorRegistrar = True
End If
End If
diff --git a/Bancos/Transferencias.aspx b/Bancos/Transferencias.aspx
index d48cdc4c6..d95f297b0 100644
--- a/Bancos/Transferencias.aspx
+++ b/Bancos/Transferencias.aspx
@@ -181,6 +181,7 @@
diff --git a/Bancos/Transferencias.aspx.vb b/Bancos/Transferencias.aspx.vb
index 3c9cabdea..e813dc9e2 100644
--- a/Bancos/Transferencias.aspx.vb
+++ b/Bancos/Transferencias.aspx.vb
@@ -380,7 +380,6 @@ Partial Class Bancos_Transferencias
Exit For
Else
AlertaGlobal.AppendFormat("{1}
", CveIEDestino, FolioDestino)
- 'FolioDestino = (FolioDestino.ToLong + 1).ToString
End If
Next
@@ -407,7 +406,6 @@ Partial Class Bancos_Transferencias
End If
End If
-
If MsgError = "" Then
If ObjMov.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual) Then
If ObjMov.ValorPolizaDescuadre > 0 Then
@@ -419,9 +417,6 @@ Partial Class Bancos_Transferencias
End If
End If
-
-
-
If MsgError = "" Then
'Conta ContPAQ
diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx
index 7a342327b..98d818134 100644
--- a/Compras/Compras.aspx
+++ b/Compras/Compras.aspx
@@ -729,7 +729,7 @@
-
+
<%-- 0 --%>
@@ -2863,7 +2863,7 @@
-
+
@@ -4886,7 +4886,7 @@
-
+
diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb
index 16b31667c..a8905c129 100644
--- a/Compras/Compras.aspx.vb
+++ b/Compras/Compras.aspx.vb
@@ -10,7 +10,8 @@ Imports System.Threading.Tasks
Imports Newtonsoft.Json
Imports Extensiones
Imports MoreLinq
-Imports Profact.TimbraCFDI40
+
+
Partial Class Compras_Compras
@@ -3916,6 +3917,7 @@ Partial Class Compras_Compras
Protected Sub BtnGuardar_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnGuardar.Click
+
'------------------ INICIA VALIDACIONES ------------------
Dim CveSubProyectoPrincipal As Integer = AsignarSubProyectoPrincipal()
@@ -4370,14 +4372,35 @@ Partial Class Compras_Compras
Exit Sub
End If
- 'If DdlFolioGarantia.Visible AndAlso DdlFolioGarantia.SelectedValue <> "-1" Then
- ' If Not ValidaFolioGarantia() Then Exit Sub
- 'End If
-
-
'------------------TERMINA VALIDACIONES------------------
+
+ Dim EntradaComoGastoConAlmacen As Boolean = False
+ If GvInv.Rows.Count > 0 AndAlso GvInv.HeaderRow.FCCheckBox("cbAll").Checked Then
+
+ Dim CvealamcenSeleccionado As Integer = -1
+
+ For Each GvRow As GridViewRow In GvInv.Rows
+ If GvRow.RowType = DataControlRowType.DataRow Then
+ CvealamcenSeleccionado = GvRow.FCDropDownList("ddlEAlmacen").SelectedValue.ToEntero
+ If CvealamcenSeleccionado > 0 Then
+ Exit For
+ End If
+ End If
+ Next
+
+ If CvealamcenSeleccionado > 0 Then
+ Dim ModalidadAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CvealamcenSeleccionado).FiltroPrimeroValor("Modalidad").ToEntero
+ If ModalidadAlmacen = 0 Then
+ EntradaComoGastoConAlmacen = True
+ End If
+ End If
+
+ End If
+
+
+
'si hay necesidad de actualizar el globaldtps
If RegeneraPS Then
'Dim Hilo As New System.Threading.Thread(AddressOf GeneraGlobalDT)
@@ -4605,8 +4628,8 @@ Partial Class Compras_Compras
CveConceptoContableAlmacen = HdnRefacturacionConcepto.Value.ToEntero
End If
End If
- 'se activa que es un importación en la compra, para que se afecten los conceptos de iva correspondientes
- If UsuarioActual.CveEmpresa.Contiene(119, 158) AndAlso CveImportacion > 0 Then
+ 'se activa que es un importación en la compra, para que se afecten los conceptos de iva correspondientes, solo se manejará el iva de importación en RFC extranjeros
+ If UsuarioActual.CveEmpresa.Contiene(119, 158) AndAlso CveImportacion > 0 AndAlso RFCProveedor = "XEXX010101000" Then
chkImportacion.Checked = True : EsImportacion = True
End If
@@ -5178,7 +5201,7 @@ Partial Class Compras_Compras
Dim indice As Integer = 0
Dim importeconcepto As Decimal = 0
- Dim listalmacenes = (From cvealmacen In DtInv.AsEnumerable() Where cvealmacen.Field(Of Integer)("cvealmacen") > 0 Select cvealmacen.Field(Of Integer)("cvealmacen")).Distinct().ToList
+ Dim listalmacenes As List(Of Integer) = (From cvealmacen In DtInv.AsEnumerable() Where cvealmacen.Field(Of Integer)("cvealmacen") > 0 Select cvealmacen.Field(Of Integer)("cvealmacen")).Distinct().ToList
For Each tcvealmacen As Integer In listalmacenes
If GvInv.Rows(indice).FCDropDownList("ddlrecibirinv").SelectedValue = "1" Then
@@ -5208,7 +5231,6 @@ Partial Class Compras_Compras
End If
End If
Next
-
End If
'agregamos la salida
@@ -5227,7 +5249,6 @@ Partial Class Compras_Compras
Next
End If
End If
-
Next
End If
@@ -5608,7 +5629,7 @@ Partial Class Compras_Compras
'Creditos/Documentos (59)
Dim importeCreditos As Decimal = 0
- Dim CveIECreditos = -1
+ Dim CveIECreditos As Integer = -1
If RBLPago.SelectedValue.ToEntero = 2 AndAlso RBLContado.SelectedValue = "3" AndAlso DdlTipoCredito.SelectedValue.ToEntero = 2 Then
If ObjIE.GetCreditosDetalle(DdlCredito.SelectedValue.ToEntero, -1) Then
CveIECreditos = ObjIE.DtResultados.FiltroPrimero($"CveCreditoDetalle = {DdlCreditoDetalle.SelectedValue.ToEntero}")("CveIE").ToString.ToEntero
@@ -6020,10 +6041,14 @@ Partial Class Compras_Compras
If DdlTipoCompra.SelectedValue <> "10" Then
For Each Dr As DataRow In DT.Rows
+
If DtAlmacenes.FiltroPrimeroValor("Modalidad", $"CveAlmacen = {Dr("CveAlmacen").ToString.ToEntero}").ToString = "Solo Existencia" Then
- Dr("CveAlmacen") = 0
+ If Not EntradaComoGastoConAlmacen Then
+ Dr("CveAlmacen") = 0
+ End If
AlmacenSoloExistencia = True
End If
+
Dr.AcceptChanges()
Next
End If
@@ -6032,6 +6057,8 @@ Partial Class Compras_Compras
DT = DT.FiltraParametros("ISNULL(CveAlmacen,0) > 0")
If DT.Rows.Count > 0 AndAlso Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") Then
+
+
'SI ES GASTO CON ALMACEN
If DdlTipoCompra.SelectedValue = "10" Then
For Each RowDetalle As DataRow In TmpDT.FiltraParametros("ISNULL(TipoAF,0) <> 2 And ISNULL(CveAlmacen,0) > 0", "", {"CveAlmacen", "CveClasificacion", "CveSubProyecto"}).Rows
@@ -6050,18 +6077,44 @@ Partial Class Compras_Compras
For Each Row2 As DataRow In DT.Rows
+ Dim ContabilizableAlmacen As Boolean = If(EntradaComoGastoConAlmacen Or DdlTipoCompra.SelectedValue = "10", False, SeContabiliza)
+
importeMovimiento = TmpDT.SUM(If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, "ImporteSinImpuestos", "Total"), $"CveAlmacen = {Row2("CveAlmacen")}").ToString.ToDecimal + TmpDT.SUM("CostoIndirectoAlmacen", $"CveAlmacen = {Row2("CveAlmacen")}").ToString.ToDecimal 'Row2("Total").ToString.ToDecimal + Row2("CostoIndirectoAlmacen").ToString.ToDecimal
importeMN = importeMovimiento * tipoCambioActual * Multiplicador
If importeMN <> 0 Then
- 'SI ES GASTO CON ALMACEN NO DEBE CONTABILIZAR CONCEPTO 68
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMN.RoundSQL(2), importeMN.RoundSQL(2), 68, Referencia, Concepto, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveIE:=CveIE, CvePersonal:=CvePersonal, CveMovimientoAlmacen:=CveMovimientoInventario, CveCreditoDetalle:=CveCreditoDetalle, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=tipoCambioActual, Contabilizable:=If(DdlTipoCompra.SelectedValue = "10", False, SeContabiliza)) Then
- ErrorPrepoliza = True
+
+ If (TxtFecha.Text <> Now.ToString("dd/MM/yyyy")) And Not EntradaComoGastoConAlmacen Then
+
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMN.RoundSQL(2), importeMN.RoundSQL(2), 205, Referencia, Concepto, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveIE:=CveIE, CvePersonal:=CvePersonal, CveMovimientoAlmacen:=CveMovimientoInventario, CveCreditoDetalle:=CveCreditoDetalle, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=tipoCambioActual, Contabilizable:=ContabilizableAlmacen) Then
+ ErrorPrepoliza = True
+ End If
+
+ Dim CvePrePoliza2Almacen As Integer = ObjConta.AddPrePolizas("Compras/Registrar/Almacen", If(EsContado And CvePlantillaPrePoliza = 1, 2, CvePlantillaPrePoliza), ImporteCompra, TxtTotal.Text.ToDouble, DdlMoneda.SelectedValue.ToEntero, Now, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo:=FolioFijo, ReglaFolioPoliza:=ObjCompras.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, DdlTipoTransaccionCaja.SelectedValue, UsuarioActual.CveEmpresa), CveTipoPoliza:=ObjConta.ObtenerTipoPoliza(DdlTipoTransaccion.SelectedValue, DdlTipoTransaccionCaja.SelectedValue, UsuarioActual.CveEmpresa))
+
+ If CvePrePoliza2Almacen > 0 Then
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza2Almacen, True, importeMN.RoundSQL(2), importeMN.RoundSQL(2), 205, Referencia, Concepto, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveIE:=CveIE, CvePersonal:=CvePersonal, CveMovimientoAlmacen:=CveMovimientoInventario, CveCreditoDetalle:=CveCreditoDetalle, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=tipoCambioActual, Contabilizable:=ContabilizableAlmacen) Then
+ ErrorPrepoliza = True
+ End If
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza2Almacen, False, importeMN.RoundSQL(2), importeMN.RoundSQL(2), 68, Referencia, Concepto, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveIE:=CveIE, CvePersonal:=CvePersonal, CveMovimientoAlmacen:=CveMovimientoInventario, CveCreditoDetalle:=CveCreditoDetalle, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=tipoCambioActual, Contabilizable:=ContabilizableAlmacen) Then
+ ErrorPrepoliza = True
+ End If
+ Else
+ ErrorPrepoliza = True
+ End If
+
+ Else
+ 'SI ES GASTO CON ALMACEN NO DEBE CONTABILIZAR CONCEPTO 68
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMN.RoundSQL(2), importeMN.RoundSQL(2), 68, Referencia, Concepto, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveIE:=CveIE, CvePersonal:=CvePersonal, CveMovimientoAlmacen:=CveMovimientoInventario, CveCreditoDetalle:=CveCreditoDetalle, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=tipoCambioActual, Contabilizable:=ContabilizableAlmacen) Then
+ ErrorPrepoliza = True
+ End If
+
End If
+
'SI ES GASTO CON ALMACEN REGISTRA EL CONCEPTO 95
- If DdlTipoCompra.SelectedValue = "10" Then
+ If DdlTipoCompra.SelectedValue = "10" Or EntradaComoGastoConAlmacen Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, importeMN.RoundSQL(2), importeMN.RoundSQL(2), 95, Referencia, Concepto, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveIE:=CveIE, CvePersonal:=CvePersonal, CveMovimientoAlmacen:=CveMovimientoInventario, CveCreditoDetalle:=CveCreditoDetalle, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=tipoCambioActual, Contabilizable:=False) Then
ErrorPrepoliza = True
End If
@@ -6093,7 +6146,7 @@ Partial Class Compras_Compras
Dim UsaComplementariaFleteImportaciones As Boolean = False
'DEBE METER EL CONCEPTO DE COMPRAS SI EL TIPO ES GASTO CON ALMACEN
- If DdlTipoCompra.SelectedValue = "10" Then
+ If DdlTipoCompra.SelectedValue = "10" Or EntradaComoGastoConAlmacen Then
ConceptoContabilizacion = 6
End If
@@ -6585,82 +6638,71 @@ Partial Class Compras_Compras
If tipoCambioActual > 1 Then Concepto += $" TC{tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}"
If importeMovimiento <> 0 Then
GuardoConcepto18 = True
- If DdlMoneda.SelectedValue.ToEntero <> 1 And UsuarioActual.CveEmpresa.Contiene(119, 158) Then
- 'PROVISION de NC
- Dim ConPreP As ConceptosTipoSaldo = ClsPaginas.ObtenerCveConceptoPrePoliza(15, DdlMoneda.SelectedValue.ToEntero, False, CveTipoConcepto)
- 'Dim CveCon As Integer = ObtConceptoContableProvisionCompra(CveTipoConcepto, DdlTipoComprobante.SelectedValue, DdlMoneda.SelectedValue.ToEntero, False)
+ 'If DdlMoneda.SelectedValue.ToEntero <> 1 And UsuarioActual.CveEmpresa.Contiene(119, 158) Then
- If ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importeMovimiento, importeMovimiento, ConPreP.CveConcepto, Referencia, Concepto, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, ImporteME:=importeMovimiento, Contabilizable:=SeContabiliza, TipoCambio:=tipoCambioActual) Then
+ 'PROVISION de NC
+ Dim ConPreP As ConceptosTipoSaldo = ClsPaginas.ObtenerCveConceptoPrePoliza(15, DdlMoneda.SelectedValue.ToEntero, False, CveTipoConcepto)
+ 'Dim CveCon As Integer = ObtConceptoContableProvisionCompra(CveTipoConcepto, DdlTipoComprobante.SelectedValue, DdlMoneda.SelectedValue.ToEntero, False)
+
+ If ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importeMovimiento, importeMovimiento, ConPreP.CveConcepto, Referencia, Concepto, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, ImporteME:=importeMovimiento, Contabilizable:=SeContabiliza, TipoCambio:=tipoCambioActual) Then
+
+ If DdlMoneda.SelectedValue.ToEntero >= 2 Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importeMN - importeMovimiento, importeMN - importeMovimiento, ConPreP.CveConceptoComplementario, Referencia, Concepto, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, ImporteME:=importeMovimiento, Contabilizable:=SeContabiliza, TipoCambio:=tipoCambioActual) Then
ErrorPrepoliza = True
Exit Select
End If
- Else
- ErrorPrepoliza = True
- Exit Select
End If
- 'AMORTIZACIÓN EN EL REGISTRO
- For Each Gvr As GridViewRow In GvFacturaNC.Rows
- If Gvr.FCCheckBox("ChkFacturaNC").Checked Then
- Dim importeMovimientoNC As Decimal = Gvr.FCTextBox("TxtImporte").Text.ToDecimal
- Dim Pago As New CompraPago
- Pago.ImportePago = importeMovimientoNC
- Pago.CveMonedaPago = CompraActual.CveMoneda
- Pago.CveCompraAmortizacion = CompraActual.CveCompra
- Pago.Referencia = CompraActual.SerieFolio
- Pago.TCPago = CompraActual.TC
- Pago.AplicaAcreditable = False
- Pago.TipoPago = "NC"
- Pago.Fecha = CompraActual.Fecha 'toma la misma fecha de la provisión en el pago de NC
-
- Dim CompraPago As New Compra
- 'datos de la compra tipodocto:Fac, para sobreescribirlos
- CompraPago.CveCompra = Gvr.DataKey("CveCompra").ToEntero
- CompraPago.CveProveedor = Gvr.DataKey("CveProveedor").ToEntero
- CompraPago.SerieFolio = Gvr.DataKey("SerieFolio")
- CompraPago.TC = Gvr.DataKey("TipoCambio").ToDecimal
- CompraPago.Fecha = Gvr.DataKey("Fecha").ToDate
- CompraPago.CveMoneda = Gvr.DataKey("CveMoneda").ToEntero
- CompraPago.Total = Gvr.DataKey("Total").ToDecimal
- CompraPago.CveTipoConceptoProveedor = Gvr.DataKey("CveTipoConcepto").ToEntero
- CompraPago.CveSubProyecto = CompraActual.CveSubProyecto
-
- ErrorPrepoliza = AplicaPrePolizaPagoCompra(CompraPago, Pago, CvePrePoliza, ObjConta)
- If ErrorPrepoliza Then
- Exit For
- End If
- End If
- Next
-
- If ErrorPrepoliza Then
- ErrorMovtosCxP = True
- Exit Select
- End If
Else
- If ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, importeMN, ConceptoContable, Referencia, Concepto, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), Contabilizable:=SeContabiliza) Then
- For Each Gvr As GridViewRow In GvFacturaNC.Rows
- If Gvr.FCCheckBox("ChkFacturaNC").Checked Then
- 'Dim CvePrePolizaTemp = ObjConta.AddPrePolizas("Compras/Registrar", If(EsContado And CvePlantillaPrePoliza = 1, 2, CvePlantillaPrePoliza), ImporteCompra, TxtTotal.Text.ToDouble, DdlMoneda.SelectedValue.ToEntero, TxtFecha.Text.ToDate, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo:=FolioFijo, ReglaFolioPoliza:=ObjCompras.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, DdlTipoTransaccionCaja.SelectedValue, UsuarioActual.CveEmpresa), CveTipoPoliza:=ObjConta.ObtenerTipoPoliza(DdlTipoTransaccion.SelectedValue, DdlTipoTransaccionCaja.SelectedValue, UsuarioActual.CveEmpresa))
- Dim importeMovimientoNC As Decimal = Gvr.FCTextBox("TxtImporte").Text.ToDecimal
- Dim importeMNNC As Decimal = importeMovimientoNC * tipoCambioActual * Multiplicador
- If ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimientoNC, importeMNNC, 272, Referencia, Concepto, CveCompra:=Gvr.DataKey("CveCompra").ToEntero, CveProveedor:=CveProveedorConcepto, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimientoNC), CveCompraAmortizacion:=CveCompra, Contabilizable:=SeContabiliza) Then
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, importeMovimientoNC, importeMNNC, 60, Referencia, Concepto, CveCompra:=CveCompra, CveCompraAmortizacion:=Gvr.DataKey("CveCompra").ToEntero, CveProveedor:=CveProveedorConcepto, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimientoNC), Contabilizable:=SeContabiliza) Then
- ErrorPrepoliza = True
- End If
- Else
- ErrorPrepoliza = True
- End If
- 'ObjConta.PrePolizaUnificacion(CvePrePoliza, CvePrePolizaTemp)
- End If
- Next
- End If
+ ErrorPrepoliza = True
+ Exit Select
End If
- End If
+ 'AMORTIZACIÓN EN EL REGISTRO
+ For Each Gvr As GridViewRow In GvFacturaNC.Rows
+ If Gvr.FCCheckBox("ChkFacturaNC").Checked Then
+ Dim importeMovimientoNC As Decimal = Gvr.FCTextBox("TxtImporte").Text.ToDecimal
+
+ Dim Pago As New CompraPago
+ Pago.ImportePago = importeMovimientoNC
+ Pago.CveMonedaPago = CompraActual.CveMoneda
+ Pago.CveCompraAmortizacion = CompraActual.CveCompra
+ Pago.Referencia = CompraActual.SerieFolio
+ Pago.TCPago = CompraActual.TC
+ Pago.AplicaAcreditable = False
+ Pago.TipoPago = "NC"
+ Pago.Fecha = CompraActual.Fecha 'toma la misma fecha de la provisión en el pago de NC
+
+ Dim CompraPago As New Compra
+ 'datos de la compra tipodocto:Fac, para sobreescribirlos
+ CompraPago.CveCompra = Gvr.DataKey("CveCompra").ToEntero
+ CompraPago.CveProveedor = Gvr.DataKey("CveProveedor").ToEntero
+ CompraPago.SerieFolio = Gvr.DataKey("SerieFolio")
+ CompraPago.TC = Gvr.DataKey("TipoCambio").ToDecimal
+ CompraPago.Fecha = Gvr.DataKey("Fecha").ToDate
+ CompraPago.CveMoneda = Gvr.DataKey("CveMoneda").ToEntero
+ CompraPago.Total = Gvr.DataKey("Total").ToDecimal
+ CompraPago.CveTipoConceptoProveedor = Gvr.DataKey("CveTipoConcepto").ToEntero
+ CompraPago.CveSubProyecto = CompraActual.CveSubProyecto
+
+ ErrorPrepoliza = AplicaPrePolizaPagoCompra(CompraPago, Pago, CvePrePoliza, ObjConta)
+ If ErrorPrepoliza Then
+ Exit For
+ End If
+ End If
+ Next
+
+ If ErrorPrepoliza Then
+ ErrorMovtosCxP = True
+ Exit Select
+ End If
+
+
+
+ End If
importeMovimiento = 0
Case 29 'Funcionarios y Empleados
@@ -7000,7 +7042,7 @@ Partial Class Compras_Compras
Dim ArrayCveEstatusOC As String() = HdnCveEstatusOC.Value.Split(New Char() {","c})
If ArrayCveEstatusOC.Count = ArrayCveOC.Count Then
- For i = 0 To ArrayCveEstatusOC.Count - 1
+ For i As Integer = 0 To ArrayCveEstatusOC.Count - 1
If Not ObjOC.UpdateOrdenCompraCompletada(ArrayCveEstatusOC(i).ToEntero, ArrayCveOC(i).ToEntero, UsuarioActual.CveUsuario, "Se vinculó Compra", CveCompra) Then
ErrorOC = True
Exit For
@@ -7346,8 +7388,7 @@ Partial Class Compras_Compras
Dim CveSubProyectoActual As Integer = dRow("CveSubProyecto").ToString.ToEntero
If CveSubProyectoActual > 0 Then
-
- Dim nRow = DTSubProyectoPrincipal.NewRow
+ Dim nRow As DataRow = DTSubProyectoPrincipal.NewRow
nRow("CveSubProyecto") = dRow("CveSubProyecto").ToString.ToEntero
nRow("Total") = TmpDT.SUMD("Total", $"CveSubProyecto={CveSubProyectoActual}")
DTSubProyectoPrincipal.Rows.Add(nRow)
@@ -8004,6 +8045,14 @@ Partial Class Compras_Compras
End If
+ If ErrorMovtosCxP = 0 AndAlso Not ObjConta.ValidacionesPrePoliza(CvePrePolizaNueva, UsuarioActual) Then
+ ErrorMovtosCxP = 1
+ 'If ObjConta.ValorPolizaDescuadre > 0 Then
+ ' GuardaLogAD($"Compras/Compras-Guardar | Error{ObjConta.MensajePolizaDescuadre} Diferencia{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
+ ' ErrorPrepolizaDescuadre = True
+ 'End If
+ End If
+
Select Case ErrorMovtosCxP
Case 0
@@ -8418,9 +8467,9 @@ Partial Class Compras_Compras
ElseIf grp.CveActivoFijo > 0 Then
- Dim CtaAF = -1
- Dim AF = ""
- Dim CuentaInicial = -1
+ Dim CtaAF As Integer = -1
+ Dim AF As String = ""
+ Dim CuentaInicial As Integer = -1
If ObjAF.GetActivosFijos(grp.CveActivoFijo, UsuarioActual.CveEmpresa, "-1", "-1", -1, -1, "-1", -1, -1, -1, -1, -1, "", -1, UsuarioActual.CveEmpresa) Then
CtaAF = ObjAF.Cuenta
@@ -8442,7 +8491,7 @@ Partial Class Compras_Compras
If drCuenta IsNot Nothing Then
CuentaAbono = drCuenta("Id").ToString.ToEntero
- Dim FolioAF = ObjContaAC.GetFolioProveedores(String.Format("0{0}0000000000000", CuentaInicial)).ToString
+ Dim FolioAF As String = ObjContaAC.GetFolioProveedores(String.Format("0{0}0000000000000", CuentaInicial)).ToString
CtaAF = ObjContaAC.AddCuenta(String.Format("0{0}{1}000000000", CuentaInicial, FolioAF.PadLeft(4, "0"c)), AF, "A", 2, 0, 1, 0, "", 1, CuentaAbono)
ObjAF.UpdateActivosFijosCuentaAC(grp.CveActivoFijo, CtaAF, UsuarioActual.CveUsuario)
@@ -8752,7 +8801,9 @@ Partial Class Compras_Compras
Dim NumRow As Integer = 0
For Each row1 As DataRow In TmpDT.Rows
Dim NumRow2 As Integer = 0
+
For Each row2 As DataRow In TmpDTOriginal.Rows
+
If NumRow2 = NumRow Then
If (row1("CveSubProyecto").ToString.ToEntero <> row2("CveSubProyecto").ToString.ToEntero) Or
(row1("CveClasificacion").ToString.ToEntero <> row2("CveClasificacion").ToString.ToEntero) Or
@@ -8769,9 +8820,24 @@ Partial Class Compras_Compras
End If
NumRow2 += 1
Next
+
+ Dim CvePersonal As Integer = 0
+ If NumRow < GvPersonal.Rows.Count Then
+ CvePersonal = GvPersonal.Rows(NumRow).FCDropDownList("DdlPersonalGv").SelectedValue.ToEntero
+ If CvePersonal = -1 Then
+ CvePersonal = 0
+ End If
+ End If
+
+ If row1("CvePersonal").ToString.ToEntero <> CvePersonal Then
+ Return False
+ End If
+
NumRow += 1
Next
+
Return True
+
End Function
Private Function ActualizarPrePoliza(ObjConta As ClsContabilidad, ObjCompra As ClsCompras) As Boolean
@@ -14542,12 +14608,11 @@ Partial Class Compras_Compras
End Sub
Protected Sub BtnAlertaPUCero_Click(sender As Object, e As EventArgs)
- Dim Argumentos = HdnAlertaPUCero.Value.Split("|"c)
- Dim PS = Argumentos(0)
- Dim Cantidad = Argumentos(1)
+ Dim Argumentos As String() = HdnAlertaPUCero.Value.Split("|"c)
+ Dim PS As String = Argumentos(0)
+ Dim Cantidad As String = Argumentos(1)
'Alert($"El concepto tiene especificada una cantidad pero con costo de cero ($0).
br /<> b > En caso de vincular la OC de esta manera la cantidad especificada sera considerada como recibida.
De ser correcto Continue o de lo contrario rectifique.", TipoMensaje.MsgAdvertencia)
-
Alert($"El concepto {PS} tiene especificada la cantidad {Cantidad} pero un costo de cero ($0).
En caso de vincular la OC de esta manera la cantidad especificada sera considerada como recibida.
De ser correcto Continue o de lo contrario rectifique.", TipoMensaje.MsgAdvertencia)
End Sub
#End Region
@@ -15978,6 +16043,16 @@ Partial Class Compras_Compras
TxtIEPSModal.Text = ""
TxtDescuentoModal.Text = ""
+
+ TxtCantidad.Enabled = True
+ DdlClasificacion.Enabled = True
+ DdlPS.Enabled = True
+ DdlPS.ddlWS.Disabled = False
+ ddlUM.Enabled = True
+ TxtPrecio.Enabled = True
+ TxtDescuentoModal.Enabled = True
+ DdlIVA.Enabled = True
+
DivAddProductoAliasPS.Visible = False
LbAgregar.Text = "Agregar"
@@ -15989,6 +16064,8 @@ Partial Class Compras_Compras
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
+
+
Con = GvRow.DataKey("Consec").ToEntero
Index = Con
@@ -16106,8 +16183,33 @@ Partial Class Compras_Compras
divIVA.Visible = True
+
+
+ If GvInvMov.Rows.Count > 0 AndAlso GvRow.DataKey("CveTipoPS").ToEntero = 2 Then
+ TxtCantidad.Enabled = False
+ DdlClasificacion.Enabled = False
+ DdlPS.Enabled = False
+ DdlPS.ddl.Enabled = False
+ DdlPS.ddlWS.Disabled = True
+ ddlUM.Enabled = False
+ TxtPrecio.Enabled = False
+ TxtDescuentoModal.Enabled = False
+ DdlIVA.Enabled = False
+ Else
+ TxtCantidad.Enabled = True
+ DdlClasificacion.Enabled = True
+ DdlPS.Enabled = True
+ DdlPS.ddlWS.Disabled = False
+ ddlUM.Enabled = True
+ TxtPrecio.Enabled = True
+ TxtDescuentoModal.Enabled = True
+ DdlIVA.Enabled = True
+ End If
+
+
UpPSS.Update()
RegistraScript("$('#divAddProducto').modal('show');")
+
End Sub
Protected Sub DdlClasificacion_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlClasificacion.SelectedIndexChanged
DdlClasificacionChange()
@@ -17747,32 +17849,19 @@ Partial Class Compras_Compras
End Sub
Protected Sub BtnNCInvAlmacen_Click(sender As Object, e As EventArgs)
-
- 'Dim ObjCompras As New ClsCompras
- 'Dim ObjConta As New ClsContabilidad(ObjCompras.IniciaTransacSQL)
- 'Dim TieneError = False
- Dim i As Integer = 0
- For Each Gvr As GridViewRow In GVNCInvAlmacen.Rows
- If Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble > 0 Then
- If i < TmpDT.Rows.Count Then
- TmpDT.Rows(i)("CveOrdenCompraDetalle") = Gvr.DataKey("CveOrdenCompraDetalle")
- End If
- 'If Not ObjCompras.ComprasDetalleDevolucionesAdd(Gvr.DataKey("CveCompraDetalle").ToEntero, Gvr.DataKey("CveCompra").ToEntero, Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble, UsuarioActual.CveEmpresa) Then
- ' TieneError = True
- ' Exit For
- 'End If
- End If
- Next
-
- 'If Not TieneError Then
- ' Alert("Se guardo la devolución correctamente", TipoMensaje.MsgInformacion)
- ' ObjCompras.Commit()
- 'Else
- ' Alert("Ocurrió un error al guardar la devolución", TipoMensaje.MsgError)
- ' ObjCompras.RollBack()
- 'End If
-
- 'ObjCompras.Dispose()
+ ' se comenta RMF.2023/09/08, genera negativos en el rep recibir oc
+ 'Dim i As Integer = 0
+ 'For Each Gvr As GridViewRow In GVNCInvAlmacen.Rows
+ ' If Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble > 0 Then
+ ' If i < TmpDT.Rows.Count Then
+ ' TmpDT.Rows(i)("CveOrdenCompraDetalle") = Gvr.DataKey("CveOrdenCompraDetalle")
+ ' End If
+ ' 'If Not ObjCompras.ComprasDetalleDevolucionesAdd(Gvr.DataKey("CveCompraDetalle").ToEntero, Gvr.DataKey("CveCompra").ToEntero, Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble, UsuarioActual.CveEmpresa) Then
+ ' ' TieneError = True
+ ' ' Exit For
+ ' 'End If
+ ' End If
+ 'Next
RegistraScript("$('#FacturaNC').modal('hide');", "ModalNCInv")
End Sub
@@ -19878,27 +19967,18 @@ Partial Class Compras_Compras
#End Region
-
-
Protected Sub BtnCancelarCompra_Click(sender As Object, e As EventArgs)
Dim objCompras As New ClsCompras
-
-
If objCompras.GetFechaCancelacionMovimiento(CveCompra:=CveCompra, CveEmpresa:=UsuarioActual.CveEmpresa) Then
FechaCancelacionMovimiento = objCompras.FechaCancelacionMovto
Else
FechaCancelacionMovimiento = MinFecha
End If
-
TxtFechaCancelacion.Text = TxtFecha.Text
-
objCompras.Dispose()
-
UpCancelarCompra.Update()
-
RegistraScript(" $('#DivCancelarCompra').modal();")
-
End Sub
Protected Sub CheckDevAuto_CheckedChanged(sender As Object, e As EventArgs)
diff --git a/Contabilidad/RepIVA.aspx b/Contabilidad/RepIVA.aspx
index 030dbd568..64fc2841f 100644
--- a/Contabilidad/RepIVA.aspx
+++ b/Contabilidad/RepIVA.aspx
@@ -264,14 +264,14 @@
-
-
-
-
+
+
+
+
-
-
-
+
+
+
diff --git a/Empresas/119/Formatos/RepIVAAcreditable.rpt b/Empresas/119/Formatos/RepIVAAcreditable.rpt
index 785773459..1a6a8b78b 100644
Binary files a/Empresas/119/Formatos/RepIVAAcreditable.rpt and b/Empresas/119/Formatos/RepIVAAcreditable.rpt differ
diff --git a/Empresas/7/Formatos/27_Gafette.docx b/Empresas/7/Formatos/27_Gafette.docx
index 2be6d4748..890a13d2d 100644
Binary files a/Empresas/7/Formatos/27_Gafette.docx and b/Empresas/7/Formatos/27_Gafette.docx differ
diff --git a/Imagenes/SinImagenB.jpg b/Imagenes/SinImagenB.jpg
new file mode 100644
index 000000000..164e05b4f
Binary files /dev/null and b/Imagenes/SinImagenB.jpg differ
diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb
index f986b9cfa..8654ebf70 100644
--- a/OC/OC.aspx.vb
+++ b/OC/OC.aspx.vb
@@ -2608,6 +2608,10 @@ Partial Class OC_OC
'VALIDACIONES PARA GUARDAR
If ValidaGuardar() Then Exit Sub
+ If UsuarioActual.CveEmpresa.Contiene(119) Then
+ ChkCotizacion.Checked = False
+ End If
+
Dim MsgError As String = "Hubo un error al registrar"
'VARIABLES
Dim CveProveedorSucursal As Integer = -1
@@ -2666,6 +2670,7 @@ Partial Class OC_OC
CveProveedorContacto = IIf(DdlProveedorContacto.SelectedValue.ToEntero = 0, "-1", DdlProveedorContacto.SelectedValue).ToString.ToEntero
End If
+
Dim CveOrdenCompraPadre As Integer = -1
If GeneraReq Then
diff --git a/RH/Personal.aspx b/RH/Personal.aspx
index 394ab0825..1458c87e2 100644
--- a/RH/Personal.aspx
+++ b/RH/Personal.aspx
@@ -49,10 +49,19 @@
Expediente de personal
-
- Gafete
-
-
+
+ <%--
+
+
+ Gafete
+
+
+
+
+
+ --%>
+
+
Agregar cuenta bancaria
@@ -80,7 +89,7 @@
- PDF consumo
+ PDF consumo
diff --git a/RH/Personal.aspx.vb b/RH/Personal.aspx.vb
index b7b2b3239..476c8fa39 100644
--- a/RH/Personal.aspx.vb
+++ b/RH/Personal.aspx.vb
@@ -10,6 +10,8 @@ Imports Microsoft.Reporting.WebForms
Imports System.Globalization
Imports System.Xml
Imports System.Web.Script.Services
+Imports System.Linq
+
Partial Class RH_Personal
Inherits ClsPaginas
@@ -1740,6 +1742,11 @@ Partial Class RH_Personal
'Dim LogoRutaFisica As String = String.Format("Empresas\{0}\RH\Personal\{1}.bmp", UsuarioActual.CveEmpresa, CvePersonal)
Dim LogoRutaFisica As String = String.Format("{0}RH\Personal\{1}.bmp", UsuarioActual.Empresa.Ruta, CvePersonal)
Dim logouri = String.Format("{0}://{1}:{2}/ashx/sigfiles.ashx?Ru={3}", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, Encripta(LogoRutaFisica))
+ ImgPersonal.ImageUrl = logouri
+ ElseIf File.Exists(UsuarioActual.Empresa.Ruta & "RH\Personal\" & CvePersonal & ".jpeg") Then
+ 'Dim LogoRutaFisica As String = String.Format("Empresas\{0}\RH\Personal\{1}.png", UsuarioActual.CveEmpresa, CvePersonal)
+ Dim LogoRutaFisica As String = String.Format("{0}RH\Personal\{1}.jpeg", UsuarioActual.Empresa.Ruta, CvePersonal)
+ Dim logouri = String.Format("{0}://{1}:{2}/ashx/sigfiles.ashx?Ru={3}", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, Encripta(LogoRutaFisica))
ImgPersonal.ImageUrl = logouri
End If
@@ -3897,40 +3904,95 @@ Partial Class RH_Personal
End If
ObjPersonal.Dispose()
End Sub
- Private Sub LbGafete_Click(sender As Object, e As EventArgs) Handles LbGafete.Click
- Dim params As New List(Of ReportParameter)
- Dim ObjPersonal As New ClsRH()
- If ObjPersonal.GetPersonal(CvePersonal, "-1", "-1", "-1", "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "-1", -1, -1, -1, -1, -1, -1, "-1", "-1", "-1", "-1", UsuarioActual.CveEmpresa) Then
- If ObjPersonal.DtResultados.Rows.Count > 0 Then
+ 'Eliminar hasta 15 de septiembre 2023
+ 'Private Sub LbGafete_Click(sender As Object, e As EventArgs) Handles LbGafete.Click
- params.Add(New ReportParameter("Nombre", String.Format("{0} {1} {2}", TxtAPaterno.Text.Trim, TxtAMaterno.Text.Trim, TxtNombres.Text.Trim)))
- params.Add(New ReportParameter("Vigencia", TxtFechaFinContrato.Text))
- params.Add(New ReportParameter("Puesto", If(DdlPuesto.SelectedValue.ToEntero() > 0, DdlPuesto.SelectedItem.Text, "")))
- params.Add(New ReportParameter("CURP", TxtCURP.Text))
- params.Add(New ReportParameter("NoRegistro", ""))
- params.Add(New ReportParameter("RegIMSS", TxtNumeroSS.Text))
- params.Add(New ReportParameter("FechaIngreso", TxtFechaIngreso.Text))
- params.Add(New ReportParameter("DomPart", String.Format("{0} NoExt:{1} NoInt:{2} {3}", TxtCalle.Text, TxtNumExt.Text, TxtNumInt.Text, TxtColonia.Text)))
- params.Add(New ReportParameter("Emergencia", ""))
- params.Add(New ReportParameter("CUIP", ""))
- params.Add(New ReportParameter("TipoSangre", ""))
- params.Add(New ReportParameter("RFC", TxtRFC.Text))
- params.Add(New ReportParameter("Denominacion", TxtRFC.Text))
+ ' Dim PathSource As String = UsuarioActual.Empresa.Ruta & "Formatos\Gafete.docx"
+ ' If File.Exists(PathSource) Then
+
+ ' Dim PathRoot As String = AppDomain.CurrentDomain.BaseDirectory
+ ' Dim pathDesti As String
+
+ ' PathSource = UsuarioActual.Empresa.Ruta & "Formatos\Gafete.docx"
+ ' pathDesti = PathRoot & "Temp\" & CvePersonal & "Gafete.docx"
+
+ ' If File.Exists(pathDesti) Then
+ ' File.Delete(pathDesti)
+ ' End If
+
+ ' File.Copy(PathSource, pathDesti)
+
+ ' Dim objDoc As New clsGemBoxDocument(pathDesti)
+ ' Dim objRH As New ClsRH
+ ' Dim FechaActual As String = Now.Day.ToString("0#") & " de " & CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(1).ToString() & " del " & Now.Year.ToString()
+
+
+ ' objDoc.SustituirTags(objRH.GetDatosTagsDocumentos(CvePersonal, UsuarioActual.CveEmpresa))
+ ' objRH.Dispose()
- If File.Exists(UsuarioActual.Empresa.Ruta & "RH\Personal\" & ObjPersonal.CvePersonal & ".png") Then
- params.Add(New ReportParameter("LogoUri", String.Format("{0}://{1}:{2}/Empresas/{3}/RH/Personal/{4}.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa, ObjPersonal.CvePersonal)))
- Else
- params.Add(New ReportParameter("LogoUri", ""))
- End If
+ ' objDoc.Guardar(pathDesti)
- ImprimirPDF("Empresas/Grales/Formatos/RHGafete.rdlc", New DataTable, params, String.Format("Gafete_{0}", ObjPersonal.CvePersonal), "PDF")
- End If
- End If
- ObjPersonal.Dispose()
- End Sub
+ ' Dim fileinfo As New FileInfo(pathDesti)
+
+
+ ' If fileinfo.Exists Then
+
+ ' Response.ContentType = "application/docx"
+ ' Response.AppendHeader("Content-Disposition", $"attachment; filename=Gafete_{CvePersonal}.docx")
+ ' Response.TransmitFile(pathDesti)
+ ' Response.End()
+
+ ' End If
+
+ ' 'Dim baseUrl As String = Request.Url.GetLeftPart(UriPartial.Authority)
+ ' 'baseUrl = baseUrl & "/temp/" & fileinfo.Name
+
+ ' 'RegistraDescargaJavaScript(baseUrl)
+
+
+ ' Else
+
+ ' Dim params As New List(Of ReportParameter)
+ ' Dim ObjPersonal As New ClsRH()
+
+ ' If ObjPersonal.GetPersonal(CvePersonal, "-1", "-1", "-1", "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "-1", -1, -1, -1, -1, -1, -1, "-1", "-1", "-1", "-1", UsuarioActual.CveEmpresa) Then
+
+ ' If ObjPersonal.DtResultados.Rows.Count > 0 Then
+
+ ' params.Add(New ReportParameter("Nombre", String.Format("{0} {1} {2}", TxtAPaterno.Text.Trim, TxtAMaterno.Text.Trim, TxtNombres.Text.Trim)))
+ ' params.Add(New ReportParameter("Vigencia", TxtFechaFinContrato.Text))
+ ' params.Add(New ReportParameter("Puesto", If(DdlPuesto.SelectedValue.ToEntero() > 0, DdlPuesto.SelectedItem.Text, "")))
+ ' params.Add(New ReportParameter("CURP", TxtCURP.Text))
+ ' params.Add(New ReportParameter("NoRegistro", ""))
+ ' params.Add(New ReportParameter("RegIMSS", TxtNumeroSS.Text))
+ ' params.Add(New ReportParameter("FechaIngreso", TxtFechaIngreso.Text))
+ ' params.Add(New ReportParameter("DomPart", String.Format("{0} NoExt:{1} NoInt:{2} {3}", TxtCalle.Text, TxtNumExt.Text, TxtNumInt.Text, TxtColonia.Text)))
+ ' params.Add(New ReportParameter("Emergencia", TxtTelefonoEmergencia.Text))
+ ' params.Add(New ReportParameter("CUIP", ""))
+ ' params.Add(New ReportParameter("TipoSangre", DdlTipoSangre.SelectedItem.Text))
+ ' params.Add(New ReportParameter("RFC", TxtRFC.Text))
+ ' params.Add(New ReportParameter("Denominacion", TxtRFC.Text))
+
+ ' If File.Exists(UsuarioActual.Empresa.Ruta & "RH\Personal\" & ObjPersonal.CvePersonal & ".png") Then
+ ' params.Add(New ReportParameter("LogoUri", String.Format("{0}://{1}:{2}/Empresas/{3}/RH/Personal/{4}.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa, ObjPersonal.CvePersonal)))
+ ' Else
+ ' params.Add(New ReportParameter("LogoUri", ""))
+ ' End If
+
+ ' ImprimirPDF("Empresas/Grales/Formatos/RHGafete.rdlc", New DataTable, params, String.Format("Gafete_{0}", ObjPersonal.CvePersonal), "PDF")
+
+ ' End If
+ ' End If
+ ' ObjPersonal.Dispose()
+
+ ' End If
+
+
+
+ 'End Sub
Private Sub GenerarPDFGastosXComp(Optional Formato As String = "PDF")
If CvePersonal > 0 Then
If RBLTipoGastos.SelectedValue = "1" Then
@@ -4367,10 +4429,94 @@ Partial Class RH_Personal
objDoc.SustituirTags(objRH.GetDatosTagsDocumentos(CvePersonal, UsuarioActual.CveEmpresa))
objRH.Dispose()
-
-
objDoc.Guardar(pathDesti)
+ If pathDesti.ToUpper.Contains("GAFETTE") Or pathDesti.ToUpper.Contains("GAFETE") Then
+
+ GemBox.Document.ComponentInfo.SetLicense(SerialGemBoxDocument)
+
+ Dim document = GemBox.Document.DocumentModel.Load(pathDesti)
+
+
+
+
+ Dim imgPersonalURL As String = ""
+ If File.Exists(UsuarioActual.Empresa.Ruta & "RH\Personal\" & CvePersonal & ".jpg") Then
+ imgPersonalURL = UsuarioActual.Empresa.Ruta & "RH\Personal\" & CvePersonal & ".jpg"
+ ElseIf File.Exists(UsuarioActual.Empresa.Ruta & "RH\Personal\" & CvePersonal & ".png") Then
+ imgPersonalURL = UsuarioActual.Empresa.Ruta & "RH\Personal\" & CvePersonal & ".png"
+ ElseIf File.Exists(UsuarioActual.Empresa.Ruta & "RH\Personal\" & CvePersonal & ".bmp") Then
+ imgPersonalURL = UsuarioActual.Empresa.Ruta & "RH\Personal\" & CvePersonal & ".bmp"
+ ElseIf File.Exists(UsuarioActual.Empresa.Ruta & "RH\Personal\" & CvePersonal & ".jpeg") Then
+ imgPersonalURL = UsuarioActual.Empresa.Ruta & "RH\Personal\" & CvePersonal & ".jpeg"
+ End If
+
+ 'imgPersonalURL = UsuarioActual.Empresa.Ruta & "RH\Personal\" & CvePersonal & ".png"
+
+ If imgPersonalURL.Trim.Length = 0 Then
+ imgPersonalURL = ModExtensiones.DirectorioBaseEmpresas & "\wwwSIG\Imagenes\SinImagenB.jpg"
+ End If
+
+ 'Dim document As New GemBox.Document.DocumentModel()
+ 'Dim section As New GemBox.Document.Section(document)
+ 'Dim paragraph As New GemBox.Document.Paragraph(document)
+ 'section.Blocks.Add(paragraph)
+
+ 'Dim picture1 As New GemBox.Document.Picture(document, imgPersonalURL, 61, 53, GemBox.Document.LengthUnit.Pixel)
+
+ 'paragraph.Inlines.Add(picture1)
+
+ 'Dim Zahnrad As String = UsuarioActual.Empresa.Ruta & "RH\Personal\Zahnrad.gif"
+ 'Dim Dices As String = UsuarioActual.Empresa.Ruta & "RH\Personal\Dices.png"
+ 'Dim Graphics1 As String = UsuarioActual.Empresa.Ruta & "RH\Personal\Graphics1.svg"
+
+ 'Dim section As New GemBox.Document.Section(document)
+ 'document.Sections.Add(section)
+
+ 'Dim paragraph As New GemBox.Document.Paragraph(document)
+ 'section.Blocks.Add(paragraph)
+
+
+ 'Dim picture1 As New GemBox.Document.Picture(document, imgPersonalURL, 61, 53, GemBox.Document.LengthUnit.Pixel)
+ 'paragraph.Inlines.Add(picture1)
+
+ ' Get the first section and the first paragraph (or create them if necessary)
+
+ '**************************************************************
+
+ Dim firstSection As GemBox.Document.Section = document.Sections.FirstOrDefault()
+ If firstSection Is Nothing Then
+ firstSection = New GemBox.Document.Section(document)
+ document.Sections.Add(firstSection)
+ End If
+
+ Dim firstParagraph As GemBox.Document.Paragraph = firstSection.Blocks.OfType(Of GemBox.Document.Paragraph)().FirstOrDefault()
+ If firstParagraph Is Nothing Then
+ firstParagraph = New GemBox.Document.Paragraph(document)
+ firstSection.Blocks.Add(firstParagraph)
+ End If
+
+ Dim imageParagraph As New GemBox.Document.Paragraph(document)
+ Dim picture1 As New GemBox.Document.Picture(document, imgPersonalURL, 83, 100, GemBox.Document.LengthUnit.Pixel)
+
+ Dim layout3 As New GemBox.Document.FloatingLayout(
+ New GemBox.Document.HorizontalPosition(1.79, GemBox.Document.LengthUnit.Inch, GemBox.Document.HorizontalPositionAnchor.LeftMargin),
+ New GemBox.Document.VerticalPosition(2.55, GemBox.Document.LengthUnit.Inch, GemBox.Document.VerticalPositionAnchor.TopMargin),
+ picture1.Layout.Size)
+ 'layout3.WrappingStyle = GemBox.Document.TextWrappingStyle.Through
+
+ picture1.Layout = layout3
+
+ imageParagraph.Inlines.Add(picture1)
+ firstSection.Blocks.Insert(0, imageParagraph)
+
+ document.Sections(0).Blocks.RemoveAt(9)
+
+ document.Save(pathDesti)
+
+ End If
+
+
Dim fileinfo As New FileInfo(pathDesti)
Dim baseUrl As String = Request.Url.GetLeftPart(UriPartial.Authority)
diff --git a/Ventas/ProductosServicios.aspx.vb b/Ventas/ProductosServicios.aspx.vb
index 204742102..fa0a64b08 100644
--- a/Ventas/ProductosServicios.aspx.vb
+++ b/Ventas/ProductosServicios.aspx.vb
@@ -324,7 +324,7 @@ Partial Class ProductosyServicios
ChkAplicaParaVenta.Checked = True
- Dim DrSAT = GlobalDTPS(UsuarioActual.CveEmpresa, SATClavePS:="84111506", AplicaParaVenta:=1).FiltroPrimero("") ', SATClavePS:=CveSATNC
+ Dim DrSAT As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, SATClavePS:="84111506", AplicaParaVenta:=1).FiltroPrimero("") ', SATClavePS:=CveSATNC
DdlSATPS.SelectedValue = DrSAT("CveSATPS").ToString()
DdlSATPS.SelectedText = DrSAT("SATClaveProductoServicio").ToString()
@@ -984,7 +984,7 @@ Partial Class ProductosyServicios
DdlTamanio.SelectedValueExist(ObjProductosServicios.DtResultados.Rows(0)("CveTamaño").ToString)
If DdlTamanio.SelectedValue.ToEntero() > 0 Then
- Dim Dr = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveClasificacion={0}", DdlClasificacion.SelectedValue.ToEntero()))(0)
+ Dim Dr As DataRow = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveClasificacion={0}", DdlClasificacion.SelectedValue.ToEntero()))(0)
Dim DebeTenerTamanio As Boolean = Boolean.Parse(Dr("EsAcumulador").ToString)
@@ -1393,7 +1393,7 @@ Partial Class ProductosyServicios
'VALIDAR TAMAÑOS Y ACUMULADORES
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
- Dim Dr = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveClasificacion={0}", DdlClasificacion.SelectedValue.ToEntero()))(0)
+ Dim Dr As DataRow = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveClasificacion={0}", DdlClasificacion.SelectedValue.ToEntero()))(0)
Dim DebeTenerTamanio As Boolean = Boolean.Parse(Dr("EsAcumulador").ToString)
@@ -1418,8 +1418,8 @@ Partial Class ProductosyServicios
Dim ObjInv As New ClsInventarios(ObjProductosServicios.IniciaTransacSQL())
Dim ObjEmpresas As New ClsSisEmpresas(ObjProductosServicios.IniciaTransacSQL())
- Dim TieneError = False
- Dim AccionJS = ""
+ Dim TieneError As Boolean = False
+ Dim AccionJS As String = ""
Try
@@ -1643,7 +1643,7 @@ Partial Class ProductosyServicios
End Sub
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
Dim ObjAliasAdd As New ClsProductosServicios
- Dim TieneError = False
+ Dim TieneError As Boolean = False
If ObjAliasAdd.AddPSAlias(TxtAlias.Text.ToString, CvePS, False, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
CargarAlias()
@@ -2425,8 +2425,6 @@ Partial Class ProductosyServicios
#End Region
-
-
#Region " ECOMMERCE "
Private Sub InicializaEcommerce()
AplicaEcommerce = False
@@ -3165,6 +3163,7 @@ Partial Class ProductosyServicios
End If
GlobalDTPSSimplificado(CveEmpresaFranquicia) = Nothing
+ GlobalDTProductosServiciosEquivalencias(-1, -1, CveEmpresaFranquicia) = Nothing
Next
Return False
diff --git a/Ventas/RepVentas.aspx b/Ventas/RepVentas.aspx
index 05c643949..a7632d710 100644
--- a/Ventas/RepVentas.aspx
+++ b/Ventas/RepVentas.aspx
@@ -376,7 +376,7 @@
<%--6--%>
<%--7--%>
-
+
<%--8--%>
<%--9--%>
diff --git a/Ventas/RepVentas.aspx.vb b/Ventas/RepVentas.aspx.vb
index bfcb41745..5b6727577 100644
--- a/Ventas/RepVentas.aspx.vb
+++ b/Ventas/RepVentas.aspx.vb
@@ -193,7 +193,7 @@ Partial Class Ventas_RepVentas
CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, LblProyecto, LblSubProyecto, divProyecto:=DivProyecto)
'CargaClientes
- Dim EsWS = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False)
+ Dim EsWS As Boolean = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False)
If EsWS Then
DdlClientes.setEsWebService(True)
Else