diff --git a/App_Code/CFDITimbreRetenciones.vb b/App_Code/CFDITimbreRetenciones.vb
index 12cc0135b..f7a977353 100644
--- a/App_Code/CFDITimbreRetenciones.vb
+++ b/App_Code/CFDITimbreRetenciones.vb
@@ -27,7 +27,6 @@ Public Class CFDITimbreRetenciones
Public ReadOnly Property TotalImpuestosGravado As Decimal
Get
Return (From c In RetencionesImpuestos
- Where c.ImpuestoRetencion = "001"
Select c.MontoRetencion).Sum
End Get
End Property
@@ -35,7 +34,6 @@ Public Class CFDITimbreRetenciones
Public ReadOnly Property TotalImpuestosRetenidos As Decimal
Get
Return (From c In RetencionesImpuestos
- Where c.ImpuestoRetencion = "001"
Select c.MontoRetencion).Sum
End Get
End Property
diff --git a/Ashx/SIGWeb.ashx b/Ashx/SIGWeb.ashx
index eedb48556..47b1d2821 100644
--- a/Ashx/SIGWeb.ashx
+++ b/Ashx/SIGWeb.ashx
@@ -759,9 +759,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
End If
Dim EsDistribuidor As Integer = IfNull(context.Request("esdistribuidor"), "-1").ToString.ToEntero
-
Dim cveclienteclasificacion = IfNull(context.Request("cveclienteclasificacion"), "-1").ToString.ToEntero
-
Dim usuario As Usuario = UsuarioActual(context)
Dim CveEmpresa As Integer
If IsNothing(usuario) Then
@@ -799,7 +797,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
Else
context.Response.Write("[]")
End If
- DtRetorno.Dispose()
+ If DtRetorno IsNot Nothing Then DtRetorno.Dispose()
DtRetorno = Nothing
Return retorno
diff --git a/Bin/Profact.TimbraCFDI.dll b/Bin/Profact.TimbraCFDI.dll
index ceaa9cf16..b6310cead 100644
Binary files a/Bin/Profact.TimbraCFDI.dll and b/Bin/Profact.TimbraCFDI.dll differ
diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb
index 6f1b1b0c9..15a385678 100644
--- a/Compras/Compras.aspx.vb
+++ b/Compras/Compras.aspx.vb
@@ -6271,21 +6271,15 @@ Partial Class Compras_Compras
If Not DdlTipoComprobante.SelectedValue.Contiene("Ant") Then
If DdlRetIVAConcepto.Items.Count > 0 AndAlso DdlRetIVAConcepto.SelectedValue.ToEntero() > 0 Then
- Dim Funcionalidad As Integer = 0
If DdlRetIVAConcepto.SelectedValue.ToEntero = 1 Then
- Funcionalidad = 307
ConceptoContable = 15
ElseIf DdlRetIVAConcepto.SelectedValue.ToEntero = 2 Then
- Funcionalidad = 309
ConceptoContable = 183
ElseIf DdlRetIVAConcepto.SelectedValue.ToEntero = 3 Then
- Funcionalidad = 311
ConceptoContable = 185
ElseIf DdlRetIVAConcepto.SelectedValue.ToEntero = 4 Then
- Funcionalidad = 313
ConceptoContable = 248
ElseIf DdlRetIVAConcepto.SelectedValue.ToEntero = 5 Then
- Funcionalidad = 578
ConceptoContable = 285
ElseIf DdlRetIVAConcepto.SelectedValue.ToEntero = 6 Then
ConceptoContable = 333
@@ -6302,15 +6296,11 @@ Partial Class Compras_Compras
If Not DdlTipoComprobante.SelectedValue.Contiene("Ant") Then
If DdlRetISRConcepto.Items.Count > 0 AndAlso DdlRetISRConcepto.SelectedValue.ToEntero > 0 Then
- Dim funcionalidad As Integer = 0
If DdlRetISRConcepto.SelectedValue.ToEntero = 1 Then
- funcionalidad = 315
ConceptoContable = 16
ElseIf DdlRetISRConcepto.SelectedValue.ToEntero = 2 Then
- funcionalidad = 317
ConceptoContable = 243
ElseIf DdlRetISRConcepto.SelectedValue.ToEntero = 3 Then
- funcionalidad = 348
ConceptoContable = 327
End If
importeMovimiento = CompraActual.RetISR
@@ -6320,33 +6310,33 @@ Partial Class Compras_Compras
End If
End If
- Case 64 'Ganancia
+ 'Case 64 'Ganancia
- 'CveSubProyectoInsertar = CveSubProyecto
- If CveSubProyectoInsertar <= 0 Then
- ErrorPrepoliza = True
- Alert("Concepto ganancia cambiaria sin sub proyecto", TipoMensaje.MsgAdvertencia)
- End If
+ ' 'CveSubProyectoInsertar = CveSubProyecto
+ ' If CveSubProyectoInsertar <= 0 Then
+ ' ErrorPrepoliza = True
+ ' Alert("Concepto ganancia cambiaria sin sub proyecto", TipoMensaje.MsgAdvertencia)
+ ' End If
- If TCPago > 0 AndAlso TCPago <> 1 AndAlso TxtFechaPago.Text <> TxtFecha.Text Then
+ ' If TCPago > 0 AndAlso TCPago <> 1 AndAlso TxtFechaPago.Text <> TxtFecha.Text Then
- If TipoCambioCompra > TCPago Then
- ConceptoContable = 64
- TipoMovimiento = True
- Else
- ConceptoContable = 65
- TipoMovimiento = False
- End If
- If TCPago <> TipoCambioCompra Then
- importeMovimiento = Math.Abs(TCPago - TipoCambioCompra) * importePagoProv
- importeMovimiento -= Math.Abs(TCPago - TipoCambioCompra) * importeIVAAcreditable
- importeMovimiento += Math.Abs(TCPago - TipoCambioCompra) * importeRetIVAAcreditable
- importeMovimiento += Math.Abs(TCPago - TipoCambioCompra) * importeRetISRAcreditable
- importeMN = importeMovimiento
- End If
- Else
- importeMovimiento = 0
- End If
+ ' If TipoCambioCompra > TCPago Then
+ ' ConceptoContable = 64
+ ' TipoMovimiento = True
+ ' Else
+ ' ConceptoContable = 65
+ ' TipoMovimiento = False
+ ' End If
+ ' If TCPago <> TipoCambioCompra Then
+ ' importeMovimiento = Math.Abs(TCPago - TipoCambioCompra) * importePagoProv
+ ' importeMovimiento -= Math.Abs(TCPago - TipoCambioCompra) * importeIVAAcreditable
+ ' importeMovimiento += Math.Abs(TCPago - TipoCambioCompra) * importeRetIVAAcreditable
+ ' importeMovimiento += Math.Abs(TCPago - TipoCambioCompra) * importeRetISRAcreditable
+ ' importeMN = importeMovimiento
+ ' End If
+ ' Else
+ ' importeMovimiento = 0
+ ' End If
Case 6 'Compra
@@ -6570,8 +6560,14 @@ Partial Class Compras_Compras
Dim tCveColectiva As Integer = ObjOC.DtResultados.FiltroPrimeroValor("CveColectiva").ToEntero
CveMovimientoAlmacen = ObjOC.DtResultados.FiltroPrimeroValor("CveMovimientoAlmacen").ToEntero
Dim TCAjuste As Decimal = ObjOC.DtResultados.FiltroPrimeroValor("TipoCambioAjuste").ToDecimal
- 'RMF. falta verificar el costo indirecto de la OC
- If DdlMoneda.SelectedValue.ToEntero <> 1 Then
+ 'RMF. si la Factura es USD, y la OC, en pesos, el registro debe de ser el concepto de la moneda de la oc
+ If Importe176 > 0 AndAlso DdlMoneda.SelectedValue <> "1" Then
+ 'Importe176 = (Importe176 * TxtTipoCambioOC.Text.ToDecimal).RoundSQL
+ 'ImporteMN176 = Importe176
+ TCO = TxtTC.Text.ToDecimal
+ End If
+
+ If Importe228 > 0 Then
TCO = TxtTC.Text.ToDecimal
ImporteCI176 = ObjOC.DtResultados.FiltroPrimeroValor("ImporteCI228").ToDecimal
'CostoIndirectoAcum176 += ImporteCI176
@@ -7027,22 +7023,13 @@ Partial Class Compras_Compras
importeMovimiento = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal
OtrosGastosIngresos = rw.FCTextBox("TxtOtrosGastosIngresos").Text.ToDecimal
-
importeMN = (importeMovimiento * tipoCambioActual * Multiplicador).RoundSQL
-
Dim OtrosGastosIngresosMN As Decimal = (OtrosGastosIngresos * tipoCambioActual * Multiplicador).RoundSQL
Dim importeMNOtrosIngEgs As Decimal = ((importeMovimiento + OtrosGastosIngresos) * tipoCambioActual * Multiplicador).RoundSQL
-
Dim tCveProveedor As Integer = rw.DataKey("CveProveedor").ToEntero
- If OtrosGastosIngresos = 0 Then
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, importeMN, CveConceptoContableDeudor, Referencia, Concepto, CveCompra:=CveCompra, CveProveedor:=tCveProveedor, CveIE:=rw.DataKey("CveIE").ToString.ToEntero, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), Contabilizable:=SeContabiliza) Then
- ErrorPrepoliza = True : Exit For
- End If
- Else
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, If(TipoMovimiento, False, True), (importeMovimiento + OtrosGastosIngresos), importeMNOtrosIngEgs, CveConceptoContableDeudor, Referencia, Concepto, CveCompra:=CveCompra, CveProveedor:=tCveProveedor, CveIE:=rw.DataKey("CveIE").ToString.ToEntero, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, ImporteME:=If(tipoCambioActual = 1, 0, (importeMovimiento + OtrosGastosIngresos)), Contabilizable:=SeContabiliza) Then
- ErrorPrepoliza = True : Exit For
- End If
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, (importeMovimiento + OtrosGastosIngresos), importeMNOtrosIngEgs, CveConceptoContableDeudor, Referencia, Concepto, CveCompra:=CveCompra, CveProveedor:=tCveProveedor, CveIE:=rw.DataKey("CveIE").ToString.ToEntero, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, ImporteME:=If(tipoCambioActual = 1, 0, (importeMovimiento + OtrosGastosIngresos)), Contabilizable:=SeContabiliza) Then
+ ErrorPrepoliza = True : Exit For
End If
Dim Pago As New CompraPago With {
@@ -7393,8 +7380,8 @@ Partial Class Compras_Compras
ErrorPrepoliza = True
Exit For
End If
- End If
+ End If
Next
'EMPIEZA REFACTURACION
@@ -19531,6 +19518,11 @@ Partial Class Compras_Compras
Private Function AjustarPrePolizaVinculacionOC(ByRef OC As ClsOC, ByRef OCBitacora As ClsOIEventos, ByRef ObjInventarios As ClsInventarios, ByRef ObjConta As ClsContabilidad) As Boolean
+ '' si está activado el Tipo de cambio de las OC, no debe de ajustarse, ya que hay una operación de cálculo
+ If DivTipoCambioOC.Visible Then
+ Return True
+ End If
+
'VARIABLES
Dim CveProveedorSucursal As Integer = -1
Dim CveProveedorContacto As Integer = -1
diff --git a/Contabilidad/LibroMayor2.aspx b/Contabilidad/LibroMayor2.aspx
index d0525b61d..e327102eb 100644
--- a/Contabilidad/LibroMayor2.aspx
+++ b/Contabilidad/LibroMayor2.aspx
@@ -175,7 +175,7 @@
Concepto
Referencia
Referencia Movto
-
SubProyecto
+
Cargos
Abonos
Saldo
diff --git a/Contabilidad/RegPrePolizaS.aspx b/Contabilidad/RegPrePolizaS.aspx
index b10065036..8b3e8406f 100644
--- a/Contabilidad/RegPrePolizaS.aspx
+++ b/Contabilidad/RegPrePolizaS.aspx
@@ -1027,7 +1027,7 @@
-
+
diff --git a/Contabilidad/RegPrePolizaS.aspx.vb b/Contabilidad/RegPrePolizaS.aspx.vb
index 6980f4193..8f0b6f292 100644
--- a/Contabilidad/RegPrePolizaS.aspx.vb
+++ b/Contabilidad/RegPrePolizaS.aspx.vb
@@ -308,6 +308,9 @@ Partial Class ContabilidadC_RegPrePolizaS
BtnDescontabilizar.Visible = False
LnkFolioManual.Visible = True
End If
+ If Request("Contabiliza") IsNot Nothing Then
+ Contabilizar()
+ End If
End If
@@ -359,6 +362,8 @@ Partial Class ContabilidadC_RegPrePolizaS
GvMov.Columns(5).Visible = False
End If
+
+
End If
End Sub
@@ -2145,13 +2150,12 @@ Partial Class ContabilidadC_RegPrePolizaS
dtt = ObjBancos.DtResultados
If dtt.Rows.Count > 0 Then
UpComplementoPagos.Visible = True
- 'GvComplementoPagos.Columns(7).Visible = True
' si tiene el permiso para eliminar IE o editar IE
If UsuarioActual.TienePermisoProceso(85) OrElse UsuarioActual.TienePermisoProceso(99) Then GvComplementoPagos.Columns(6).Visible = True
Else
DVGenerarComplementoModal.Visible = True
End If
- GvComplementoPagos.DataSource = ObjBancos.DtResultados.FiltraParametros("", DistinctColumns:={"CveComplementoPago", "FolioFiscal", "SerieFolioPago", "FechaComplemento", "Importe", "CveIE"})
+ GvComplementoPagos.DataSource = ObjBancos.DtResultados.FiltraParametros("", DistinctColumns:={"CveComplementoPago", "FolioFiscal", "SerieFolioPago", "FechaComplemento", "Importe", "CveIE", "RFCReceptor", "CvePAC"})
End If
ObjBancos.Dispose()
@@ -2236,7 +2240,7 @@ Partial Class ContabilidadC_RegPrePolizaS
Str.AppendFormat("Folio: {0} ", Banco.ComplementoSerieFolio)
Str.AppendFormat("XML ", Encripta(String.Format("OP=CompP&EXT=xml&SerieFolio={0}&CveComplementoPago={1}", Banco.ComplementoSerieFolio, Banco.CveComplementoPago)))
Str.AppendFormat("PDF ", Encripta(String.Format("OP=CompP&EXT=pdf&SerieFolio={0}&CveComplementoPago={1}", Banco.ComplementoSerieFolio, Banco.CveComplementoPago)))
- MandaCorreo(Banco.ComplementoSerieFolio, Banco.CobranzaCorreo)
+ 'MandaCorreo(Banco.ComplementoSerieFolio, Banco.CobranzaCorreo)
End If
Else
Banco.RollBack()
@@ -2252,7 +2256,8 @@ Partial Class ContabilidadC_RegPrePolizaS
'If e.Row.DataKey("Tipo") = "Ing" Then
e.Row.Cells(3).Text = String.Format("", Encripta(String.Format("OP=CompP&EXT=xml&SerieFolio={0}&CVECOMPLEMENTOPAGO={1}&CVEIE={2}", e.Row.DBCampo("SerieFolioPago"), e.Row.DBCampo("CveComplementoPago"), e.Row.DBCampo("CveIE"))))
- e.Row.Cells(4).Text = String.Format("", Encripta(String.Format("OP=CompP&EXT=pdf&SerieFolio={0}&CVECOMPLEMENTOPAGO={1}&CVEIE={2}", e.Row.DBCampo("SerieFolioPago"), e.Row.DBCampo("CveComplementoPago"), e.Row.DBCampo("CveIE"))))
+ 'e.Row.Cells(4).Text = String.Format("", Encripta(String.Format("OP=CompP&EXT=pdf&SerieFolio={0}&CVECOMPLEMENTOPAGO={1}&CVEIE={2}", e.Row.DBCampo("SerieFolioPago"), e.Row.DBCampo("CveComplementoPago"), e.Row.DBCampo("CveIE"))))
+
'End If
End If
diff --git a/Contabilidad/Reportes/RepCuadreContaAdmonDetalle.aspx.vb b/Contabilidad/Reportes/RepCuadreContaAdmonDetalle.aspx.vb
index fc69f2a4f..49ffeba3c 100644
--- a/Contabilidad/Reportes/RepCuadreContaAdmonDetalle.aspx.vb
+++ b/Contabilidad/Reportes/RepCuadreContaAdmonDetalle.aspx.vb
@@ -8,8 +8,6 @@ Imports Extensiones
Partial Class RepCuadreContaAdmonDetalle
Inherits ClsPaginas
- Private Shared missing As Object = System.Reflection.Missing.Value
-
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
@@ -126,7 +124,7 @@ Partial Class RepCuadreContaAdmonDetalle
End If
If e.Row.DataKey("CvePrePoliza").ToEntero > 0 Then
- Dim LigaPrePoliza As String = $"/Contabilidad/RegPrepolizaS.aspx?CvePrePoliza={e.Row.DataKey("CvePrePoliza")}&Tipo=1"
+ Dim LigaPrePoliza As String = $"/Contabilidad/RegPrePolizaS.aspx?CvePrePoliza={e.Row.DataKey("CvePrePoliza")}&Tipo=1"
e.Row.FCLiteral("LtlCargoAdmon").Text = " " & e.Row.FCLiteral("LtlCargoAdmon").Text & " "
e.Row.FCLiteral("LtlAbonoAdmon").Text = " " & e.Row.FCLiteral("LtlAbonoAdmon").Text & " "
End If
diff --git a/Contratos/ModificarPresupuesto.aspx.vb b/Contratos/ModificarPresupuesto.aspx.vb
index 1e8aaf511..13a9e9a43 100644
--- a/Contratos/ModificarPresupuesto.aspx.vb
+++ b/Contratos/ModificarPresupuesto.aspx.vb
@@ -334,6 +334,8 @@ Partial Class Contratos_ModificarPresupuesto
Dim CvePresupuesto = DdlPresupuesto.SelectedValue.ToEntero
Dim CveClasificacion As Integer = DdlModalClasificacion.SelectedValue.ToEntero
+ Dim dt As DataTable = GlobalDTTiposGastos(UsuarioActual.CveEmpresa, 1)
+
If CveClasificacion > 0 Then
Dim ObjCont As New ClsContratos
diff --git a/Contratos/Presupuestos.aspx b/Contratos/Presupuestos.aspx
index fbebd008b..1a76b526f 100644
--- a/Contratos/Presupuestos.aspx
+++ b/Contratos/Presupuestos.aspx
@@ -288,6 +288,16 @@
+
+
+
+
+
+ Total:
+
+
+
+
diff --git a/Contratos/Presupuestos.aspx.vb b/Contratos/Presupuestos.aspx.vb
index caa64a63f..34205ee7a 100644
--- a/Contratos/Presupuestos.aspx.vb
+++ b/Contratos/Presupuestos.aspx.vb
@@ -126,7 +126,10 @@ Partial Class Contratos_Presupuestos
End If
If e.Row.RowType = DataControlRowType.Footer Then
Dim Importe As Decimal = DtClasificaciones.SUM("Importe", "CveAgrupador IS NOT NULL")
+ Dim AmpReduc As Decimal = DtClasificaciones.SUM("AmpReduc", "CveAgrupador IS NOT NULL")
+
e.Row.FCLabel("LblTotal").Text = String.Format("{0:C}", Importe)
+ e.Row.FCLabel("LblAmpReducFoot").Text = String.Format("{0:C}", AmpReduc)
End If
End Sub
diff --git a/Contratos/RepPresupuestos.aspx.vb b/Contratos/RepPresupuestos.aspx.vb
index ef6cf4e23..83fa9dd0f 100644
--- a/Contratos/RepPresupuestos.aspx.vb
+++ b/Contratos/RepPresupuestos.aspx.vb
@@ -74,11 +74,19 @@ Partial Class Contratos_RepPresupuestos
Private Sub CargaSubProyecto()
DdlSubProyecto.Items.Clear()
- If DdlProyecto.SelectedValue.ToEntero > 0 Or UsuarioActual.Empresa.Tipo_CentroCosto = 1 Then
- DdlSubProyecto.DataSource = If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110), GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, DdlProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, -1, 1), GlobalDTSubProyectos(DdlProyecto.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa, 1))
+ If DdlProyecto.SelectedValue.ToEntero > 0 Or UsuarioActual.Empresa.Tipo_CentroCosto = 1 Then
+
+ If UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110) Then
+ DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, DdlProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, -1, 1)
+ Else
+ DdlSubProyecto.DataSource = GlobalDTSubProyectos(UsuarioActual.CveEmpresa, -1, DdlProyecto.SelectedValue.ToEntero, -1)
+ End If
+
+ 'DdlSubProyecto.DataSource = If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110), GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, DdlProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, -1, 1), GlobalDTSubProyectos(DdlProyecto.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa, 1))
End If
DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
DdlSubProyecto.DataBind()
+ UpFiltros.Update()
End Sub
Protected Sub BtnConsultarFiltros_Click(sender As Object, e As EventArgs)
CargaDatos()
diff --git a/General/TimbraRetencion.aspx b/General/TimbraRetencion.aspx
index 4b95fe6dc..6bbc609c1 100644
--- a/General/TimbraRetencion.aspx
+++ b/General/TimbraRetencion.aspx
@@ -24,6 +24,14 @@
+ ddd
+
+
+
+
+
+
+
@@ -131,27 +139,40 @@
-
+
+
+
+
+
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
+
+
+
+
+
+
diff --git a/General/TimbraRetencion.aspx.vb b/General/TimbraRetencion.aspx.vb
index d62ce4858..afaa76efc 100644
--- a/General/TimbraRetencion.aspx.vb
+++ b/General/TimbraRetencion.aspx.vb
@@ -42,10 +42,23 @@ Partial Class General_TimbraRetencion
Private Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then
+ EnviarNotificacionWhatsApp("6621430964", "Hola")
DdlClientes.setEsWebService(True)
+ CargaDatos()
End If
End Sub
+ Private Sub CargaDatos()
+ Dim ObjGral As New ClsGenerales
+
+ If ObjGral.GetGralTimbre(-1, "Ret", Now.AddMonths(-1), Now, -1, UsuarioActual.CveEmpresa, -1) Then
+ Dim dt As DataTable = ObjGral.DtResultados
+ GvLista.DataSource = dt
+ End If
+ ObjGral.Dispose()
+ GvLista.DataBind()
+ End Sub
+
#Region "Timbra"
Private Function TimbraRetencion(cfditimbre As CFDITimbreRetenciones, UsuarioActual As Usuario) As String
Dim sw As New Diagnostics.Stopwatch
@@ -234,7 +247,8 @@ Partial Class General_TimbraRetencion
Dim NombreArchivoXML As String = ""
Dim objGrales As New ClsGenerales
objGrales.IniciaTransacSQL()
- Dim tCveTimbre As Integer = objGrales.AddGralTimbre("Ret", 12679, cfditimbre.Fecha, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
+ Dim tCveSubProyecto As Integer = GlobalDTSubProyectos(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", "TipoSucursal = 1").ToEntero
+ Dim tCveTimbre As Integer = objGrales.AddGralTimbre("Ret", tCveSubProyecto, cfditimbre.Fecha, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
NombreArchivoXML = $"{objGrales.SerieInsertada}-{objGrales.FolioInsertado}.xml"
If Not Directory.Exists(RutaArchivo) Then Directory.CreateDirectory(RutaArchivo)
@@ -283,6 +297,19 @@ Partial Class General_TimbraRetencion
Protected Sub BtnEmitirRetencion_Click(sender As Object, e As EventArgs)
+
+ Dim dr As DataRow = GlobalDTCliente(UsuarioActual.CveEmpresa, CveCliente:=DdlClientes.SelectedValue.ToEntero).FiltroPrimero("")
+ Dim ReceptorRFC As String = ""
+ Dim ReceptorCP As String = ""
+ Dim ReceptorNombre As String = ""
+ If dr IsNot Nothing Then
+ ReceptorRFC = dr("RFC").ToString
+ ReceptorCP = dr("CP").ToString
+ ReceptorNombre = dr("Nombre").ToString
+ Else
+ Exit Sub
+ End If
+
Dim cfditimbre As New CFDITimbreRetenciones
cfditimbre.Fecha = Now
cfditimbre.Retencion.ClaveRetencion = DdlClaveRetencion.SelectedValue
@@ -290,21 +317,23 @@ Partial Class General_TimbraRetencion
cfditimbre.Retencion.PeriodoMesFin = DdlPeriodoFin.SelectedValue
cfditimbre.Retencion.PeriodoEjercicio = DdlEjercicio.SelectedValue.ToEntero
cfditimbre.Retencion.LugarExpedicion = UsuarioActual.Empresa.CP
- cfditimbre.Receptor.RFCR = "AEMV690902NM5"
+ cfditimbre.Receptor.RFCR = ReceptorRFC '"AEMV690902NM5"
cfditimbre.Receptor.NacionalidadR = "Nacional"
- cfditimbre.Receptor.DomicilioFiscalR = "11950"
- cfditimbre.Receptor.NombreDenominacionR = "VERONICA MICHELLE ARMENTA MASON"
+ cfditimbre.Receptor.DomicilioFiscalR = ReceptorCP '"11950"
+ cfditimbre.Receptor.NombreDenominacionR = ReceptorNombre '"VERONICA MICHELLE ARMENTA MASON"
cfditimbre.CFDIRelacionados.TipoRelacion = "01"
cfditimbre.CFDIRelacionados.UUID.Add("671fdb07-406a-42a6-9a89-40219f663ea1")
- cfditimbre.ISRCorrespondiente = 705
- cfditimbre.RetencionesImpuestos.Add(New CFDIImpuestosRetenidos With {.MontoRetencion = 705, .BaseRetencion = 0, .ImpuestoRetencion = "01", .TipoPagoRetencion = "04"})
+
+ 'cfditimbre.RetencionesImpuestos.Add(New CFDIImpuestosRetenidos With {.MontoRetencion = 705, .BaseRetencion = 0, .ImpuestoRetencion = "01", .TipoPagoRetencion = "04"})
For Each gvr As GridViewRow In GvD.Rows
Dim ret As New CFDIImpuestosRetenidos With {.BaseRetencion = gvr.DataKey("BaseRetencion").ToDecimal,
- .ImpuestoRetencion = gvr.DataKey("ImpuestoRetencion")}
+ .MontoRetencion = gvr.DataKey("MontoRetencion").ToDecimal,
+ .ImpuestoRetencion = gvr.DataKey("ClaveTipoImpuesto"),
+ .TipoPagoRetencion = gvr.DataKey("ClaveTipoPagoRetencion")}
cfditimbre.RetencionesImpuestos.Add(ret)
Next
-
+ cfditimbre.ISRCorrespondiente = cfditimbre.TotalImpuestosRetenidos
TimbraRetencion(cfditimbre, UsuarioActual)
@@ -320,21 +349,21 @@ Partial Class General_TimbraRetencion
DtDetalle.Columns.Add("TipoImpuesto", GetType(String))
DtDetalle.Columns.Add("ClaveTipoImpuesto", GetType(String))
DtDetalle.Columns.Add("BaseRetencion", GetType(Decimal))
- DtDetalle.Columns.Add("ClaveTipoPago", GetType(String))
- DtDetalle.Columns.Add("TipoPago", GetType(String))
- DtDetalle.Columns.Add("ImpuestoRetenido", GetType(Decimal))
+ DtDetalle.Columns.Add("ClaveTipoPagoRetencion", GetType(String))
+ DtDetalle.Columns.Add("TipoPagoRetencion", GetType(String))
+ DtDetalle.Columns.Add("MontoRetencion", GetType(Decimal))
End Sub
Protected Sub BtnAgregar_Click(sender As Object, e As EventArgs)
Dim dr As DataRow = DtDetalle.NewRow
- dr("TipoImpuesto") = DdlTipoImpuesto.Text
+ dr("TipoImpuesto") = DdlTipoImpuesto.SelectedItem.Text
dr("ClaveTipoImpuesto") = DdlTipoImpuesto.SelectedValue
dr("BaseRetencion") = TxtBase.Text.ToDecimal
- dr("ClaveTipoPago") = DdlTipoPagoRet.SelectedValue
- dr("TipoPago") = DdlTipoPagoRet.Text
- dr("ImpuestoRetenido") = TxtImpuestoRetenido.Text.ToDecimal
+ dr("ClaveTipoPagoRetencion") = DdlTipoPagoRet.SelectedValue
+ dr("TipoPagoRetencion") = DdlTipoPagoRet.SelectedItem.Text
+ dr("MontoRetencion") = TxtImpuestoRetenido.Text.ToDecimal
DtDetalle.Rows.Add(dr)
diff --git a/Inventarios/Kardex.aspx b/Inventarios/Kardex.aspx
index 0dd37e4e6..4042dd19b 100644
--- a/Inventarios/Kardex.aspx
+++ b/Inventarios/Kardex.aspx
@@ -303,20 +303,31 @@
-
+
Existencia
-
-
-
+
+
+
+
+
+
+
+
+ OC
+
+
+
+
+
-
+
Valor
@@ -340,7 +351,7 @@
-
+
Costo Promedio
@@ -364,7 +375,7 @@
-
+
Ultimo Costo
@@ -387,20 +398,7 @@
-
-
-
-
OC
-
-
-
-
-
-
-
-
-
-
+
@@ -530,18 +528,18 @@
-
+
-
+
-
+
-
+
diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb
index 1fd1718ba..03e109ac7 100644
--- a/Inventarios/RecepcionAlmacen.aspx.vb
+++ b/Inventarios/RecepcionAlmacen.aspx.vb
@@ -3051,6 +3051,7 @@ Partial Class Inventarios_RecepcionAlmacen
If Not ObjConta.AddPrePolizasDetalle(tCvePrePoliza, False, ImporteIngresoAdicional, ImporteIngresoAdicional, 68, tReferencia, tConcepto, CveCompra:=CveCompraSurtir, CveMovimientoAlmacen:=CveMovimientoVirtual) Then
ErrorMovInv = True
+ ObjConta.ValidacionesPrePoliza(tCvePrePoliza, UsuarioActual) ' contabilizar
End If
Else
ErrorMovInv = True
diff --git a/Inventarios/TrasladoSolicitud.aspx.vb b/Inventarios/TrasladoSolicitud.aspx.vb
index 0741c1373..a8afffaac 100644
--- a/Inventarios/TrasladoSolicitud.aspx.vb
+++ b/Inventarios/TrasladoSolicitud.aspx.vb
@@ -353,7 +353,7 @@ Partial Class Inventarios_TrasladoSolicitud
If TieneError = False Then
ObjInventarios.Commit()
- Alert($"El Traspaso se guardó correctamente con el folio #: {Folio}.", TipoMensaje.MsgInformacion)
+ Alert($"La Solicitud de Traspaso se guardó correctamente en el folio #: {Folio}.", TipoMensaje.MsgInformacion)
RegistraScript(String.Format("$('#{0}').modal('hide');", "DVModalSolicitudAdd"))
CargaDatos()
Else
diff --git a/OS/OrdenesServicios.aspx.vb b/OS/OrdenesServicios.aspx.vb
index 6c0f5e7cd..e5847c271 100644
--- a/OS/OrdenesServicios.aspx.vb
+++ b/OS/OrdenesServicios.aspx.vb
@@ -3281,7 +3281,7 @@ Partial Class OS_OrdenesServicios
Exit For
End If
- Dim Serie As String = "" 'GvRow.DataKey("Serie")
+ Dim Serie As String = drr("Serie").ToString
Dim Lote As String = drr("Lote").ToString
Dim FechaCaducidad As DateTime = drr("FechaCaducidad").ToString.ToDate
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Cantidad, CveUM, CvePS, PU, CveVentaDetalle:=CveVentaDetalle, CveMovimientoDetalleEntrada:=CveMovimientoDetalle, Lote:=Lote, Serie:=Serie, FechaCaducidad:=FechaCaducidad) Then
@@ -3541,6 +3541,7 @@ Partial Class OS_OrdenesServicios
TmpDTMat.Columns.Add("CveUM", GetType(Integer))
TmpDTMat.Columns.Add("Cantidad", GetType(Integer))
TmpDTMat.Columns.Add("PU", GetType(Decimal))
+ TmpDTMat.Columns.Add("Serie", GetType(String))
TmpDTMat.Columns.Add("Lote", GetType(String))
TmpDTMat.Columns.Add("FechaCaducidad", GetType(Date))
TmpDTMat.Columns.Add("CveVentaDetalle", GetType(Integer))
@@ -3560,6 +3561,7 @@ Partial Class OS_OrdenesServicios
drp("CvePS") = CvePS
drp("Cantidad") = CantidadRegistro
drp("PU") = PU
+ drp("Serie") = GvRow.DataKey("Serie")
drp("Lote") = GvRow.DataKey("Lote")
drp("FechaCaducidad") = GvRow.DataKey("FechaCaducidad").ToDate
TmpDTMat.Rows.Add(drp)
diff --git a/Transportes/RepContratoDetalle.aspx b/Transportes/RepContratoDetalle.aspx
index 4e00508b8..8c0bf6b42 100644
--- a/Transportes/RepContratoDetalle.aspx
+++ b/Transportes/RepContratoDetalle.aspx
@@ -160,7 +160,7 @@
+
+
@@ -175,5 +231,16 @@
+
diff --git a/Ventas/RepPedidosSTF.aspx.vb b/Ventas/RepPedidosSTF.aspx.vb
index e8fd6f860..7aaa02d40 100644
--- a/Ventas/RepPedidosSTF.aspx.vb
+++ b/Ventas/RepPedidosSTF.aspx.vb
@@ -1,16 +1,49 @@
Option Explicit On
Option Strict On
+Imports System.Activities.Expressions
Imports System.Data
Imports DocumentFormat.OpenXml.Office.CustomUI
Imports Extensiones
Partial Class Ventas_RepPedidosSTF
Inherits ClsPaginas
+ Public Property DTProductosEdicion As DataTable
+ Get
+ If ViewState("DTProductosEdicion") Is Nothing Then
+ ViewState("DTProductosEdicion") = New DataTable
+ End If
+ Return DirectCast(ViewState("DTProductosEdicion"), DataTable)
+ End Get
+ Set(value As DataTable)
+ ViewState("DTProductosEdicion") = value
+ End Set
+ End Property
+
+ Public Property DatosGV As DataTable
+ Get
+ If ViewState("DatosGV") Is Nothing Then
+ ViewState("DatosGV") = New DataTable
+ End If
+ Return DirectCast(ViewState("DatosGV"), DataTable)
+ End Get
+ Set(value As DataTable)
+ ViewState("DatosGV") = value
+ End Set
+ End Property
+
+
+
+
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
+
If Not IsPostBack Then
+
CargaCombos()
+ CargaProductosEdicion()
+
End If
+
End Sub
Private Sub CargaCombos()
@@ -34,6 +67,8 @@ Partial Class Ventas_RepPedidosSTF
Protected Sub CargaDatos()
+ DatosGV = New DataTable
+
Dim Opcion As Integer = 1
Dim FechaInicio As Date = MinFecha
Dim FechaFin As Date = MaxFecha
@@ -43,15 +78,26 @@ Partial Class Ventas_RepPedidosSTF
FechaInicio = txtFechaI.Text.ToDate
FechaFin = txtFechaF.Text.ToDate
Dim ObjVentas As New ClsVentas
+
If ObjVentas.GetRepPedidosSTF(DdlSubProyecto.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, Opcion, FechaInicio, FechaFin) Then
GvE.DataSource = ObjVentas.DtResultados
+
End If
ObjVentas.Dispose()
GvE.DataBind()
Else
+ FechaInicio = txtFechaI.Text.ToDate
+ FechaFin = txtFechaF.Text.ToDate
Dim ObjVentas As New ClsVentas
If ObjVentas.GetRepPedidosSTF(DdlSubProyecto.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, Opcion, FechaInicio, FechaFin) Then
- GvDatos.DataSource = ObjVentas.DtResultados
+ DatosGV = ObjVentas.DtResultados
+
+ DatosGV.Columns.Add("CantidadOrg", GetType(Decimal))
+ DatosGV.Columns.Add("CvePSOrg", GetType(Integer))
+ DatosGV.Columns.Add("CodigoPSOrg", GetType(String))
+
+ GvDatos.DataSource = DatosGV
+
End If
ObjVentas.Dispose()
GvDatos.DataBind()
@@ -59,19 +105,119 @@ Partial Class Ventas_RepPedidosSTF
End Sub
+
+
+
+ Private Sub CargaProductosEdicion()
+
+ DTProductosEdicion = New DataTable
+ Dim ObjVentas As ClsVentas = New ClsVentas()
+ If ObjVentas.GetPSSubProyectosVendedores(UsuarioActual.CveEmpresa) Then
+ DTProductosEdicion = ObjVentas.DtResultados.FiltraParametros($" CveVendedor = {UsuarioActual.CveVendedor}")
+ End If
+ ObjVentas.Dispose()
+
+ End Sub
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
+
If e.Row.RowType = DataControlRowType.DataRow Then
- If e.Row.DBCampo("CveVendedor") = "" OrElse e.Row.DBCampo("CvePS") = "" Then e.Row.FCCheckBox("Chk").Visible = False
+ If e.Row.DBCampo("CveVendedor") = "" OrElse e.Row.DBCampo("CvePS") = "" Then
+ e.Row.FCCheckBox("Chk").InputAttributes.Add("onclick", $"seleccionVenta('{e.Row.FCCheckBox("Chk").ClientID}','{e.Row.DataKey("CveVenta")}')")
+ e.Row.FCLinkButton("imgE").Visible = False
+ Else
+ e.Row.FCCheckBox("Chk").InputAttributes.Add("class", e.Row.DataKey("CveVenta"))
+ End If
+
If e.Row.DBCampo("TipoRenglon") = "1" Then e.Row.CssClass = "SubTotales"
End If
+
+ If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
+ If e.Row.DBCampo("CveVendedor") = "" OrElse e.Row.DBCampo("CvePS") = "" Then
+ Else
+
+ e.Row.FCDropDownList("DdlPS").DataSource = DTProductosEdicion
+ e.Row.FCDropDownList("DdlPS").DataBind()
+ e.Row.FCDropDownList("DdlPS").SelectedValueExist(e.Row.DBCampo("CvePS"))
+
+ End If
+ End If
+
End Sub
+
+
+ Protected Sub GvDatos_RowEditing(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatos.RowEditing
+ GvDatos.EditIndex = e.NewEditIndex
+ CargaGvDatos()
+ End Sub
+
+ Protected Sub GvDatos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatos.RowCancelingEdit
+ GvDatos.EditIndex = -1
+
+ CargaGvDatos()
+ End Sub
+
+ Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
+
+
+ Dim Cantidad As Decimal = GvDatos.Rows(e.RowIndex).FCTextBox("TxtCantidad").Text.ToDecimal
+ Dim CvePSNuevo As Integer = GvDatos.Rows(e.RowIndex).FCDropDownList("DdlPS").SelectedValue.ToEntero
+ Dim PSNuevo As String = GvDatos.Rows(e.RowIndex).FCDropDownList("DdlPS").SelectedItem.Text
+ Dim PU As Decimal = DTProductosEdicion.FiltroPrimeroValor("Precio", $"CvePS = {CvePSNuevo}").ToDecimal
+
+ If Not CvePSNuevo > 0 Then
+ Alert("Producto no encontrado.", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
+ If Not Cantidad > 0 Then
+ Alert("Debe especificar la cantidad.", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
+ If Not PU > 0 Then
+ Alert("El precio del producto no puede ser 0.", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
+ Dim CvPSOrg As Integer = DatosGV.Rows(GvDatos.EditIndex)("CvePSOrg").ToString.ToEntero
+ Dim CantidadOrg As Decimal = DatosGV.Rows(GvDatos.EditIndex)("CantidadOrg").ToString.ToDecimal
+
+ If Not (CvPSOrg > 0 Or CantidadOrg > 0) Then
+ DatosGV.Rows(GvDatos.EditIndex)("CantidadOrg") = GvDatos.Rows(GvDatos.EditIndex).DataKey("Cantidad")
+ DatosGV.Rows(GvDatos.EditIndex)("CvePSOrg") = GvDatos.Rows(GvDatos.EditIndex).DataKey("CvePS")
+ DatosGV.Rows(GvDatos.EditIndex)("CodigoPSOrg") = GvDatos.Rows(GvDatos.EditIndex).DataKey("CodigoPS")
+ End If
+
+ DatosGV.Rows(GvDatos.EditIndex)("Cantidad") = Cantidad
+ DatosGV.Rows(GvDatos.EditIndex)("CvePS") = CvePSNuevo
+ DatosGV.Rows(GvDatos.EditIndex)("CodigoPS") = PSNuevo
+ DatosGV.Rows(GvDatos.EditIndex)("PU") = PU
+
+ DatosGV.AcceptChanges()
+
+ GvDatos.EditIndex = -1
+
+ GvDatos.DataSource = DatosGV
+ GvDatos.DataBind()
+ UPDatos.Update()
+
+ End Sub
+
+ Private Sub CargaGvDatos()
+ GvDatos.DataSource = DatosGV
+ GvDatos.DataBind()
+ UPDatos.Update()
+ End Sub
+
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
CargaDatos()
UPDatos.Update()
End Sub
+
+
Protected Sub BtnEntregar_Click(sender As Object, e As EventArgs)
'validar que están seleccionados
Dim TmpDTRemis As New DataTable
@@ -84,9 +230,16 @@ Partial Class Ventas_RepPedidosSTF
TmpDTRemis.Columns.Add("PU", GetType(Decimal))
TmpDTRemis.Columns.Add("CveVendedor", GetType(Decimal))
TmpDTRemis.Columns.Add("GastosEnvio", GetType(Decimal))
+ TmpDTRemis.Columns.Add("Observacion", GetType(String))
+
+ TmpDTRemis.Columns.Add("CantidadOrg", GetType(Decimal))
+ TmpDTRemis.Columns.Add("CvePSOrg", GetType(Integer))
+ TmpDTRemis.Columns.Add("CodigoPSOrg", GetType(String))
'agruparo por cliente
+
For Each gvr As GridViewRow In GvDatos.Rows
- If gvr.FCCheckBox("chk").Checked Then
+
+ If gvr.DataKey("CveVendedor").ToEntero > 0 AndAlso gvr.DataKey("CvePS").ToEntero > 0 AndAlso gvr.FCCheckBox("chk").Checked Then
Dim drp As DataRow = TmpDTRemis.NewRow
drp("CvePS") = gvr.DataKey("CvePS").ToEntero
drp("Cantidad") = gvr.DataKey("Cantidad").ToDecimal
@@ -97,10 +250,18 @@ Partial Class Ventas_RepPedidosSTF
drp("CveVendedor") = gvr.DataKey("CveVendedor").ToEntero
drp("CveVentaDetalle") = gvr.DataKey("CveVentaDetalle").ToEntero
drp("GastosEnvio") = gvr.DataKey("GastosEnvio").ToDecimal
+ drp("Observacion") = gvr.DataKey("SerieFolio")
+
+ drp("CantidadOrg") = gvr.DataKey("CantidadOrg").ToDecimal
+ drp("CvePSOrg") = gvr.DataKey("CvePSOrg").ToEntero
+ drp("CodigoPSOrg") = gvr.DataKey("CodigoPSOrg")
+
TmpDTRemis.Rows.Add(drp)
End If
Next
+
+
If TmpDTRemis IsNot Nothing AndAlso TmpDTRemis.Rows.Count = 0 Then
Alert("No se ha seleccionado ninguna partida, favor de seleccionar", TipoMensaje.MsgAdvertencia)
Exit Sub
@@ -118,7 +279,19 @@ Partial Class Ventas_RepPedidosSTF
For Each dr As DataRow In TmpDTRemis.FiltraParametros($"CveCliente ={drt("CveCliente")} AND CveVendedor = {drt("CveVendedor")} AND CveSubProyecto = {drt("CveSubProyecto")}").Rows
If ObjFactura IsNot Nothing Then
- If Not ObjFactura.AgregarPS(dr("CvePS").ToString.ToEntero, dr("Cantidad").ToString.ToDecimal, dr("PU").ToString.ToDecimal, 0, "", CveSubProyecto:=dr("CveSubProyecto").ToString.ToEntero, CveVentaDetallePadre:=dr("CveVentaDetalle").ToString.ToEntero) Then
+
+ Dim Obs As String = dr("Observacion").ToString
+
+ If (dr("CantidadOrg").ToString.ToEntero > 0) AndAlso (dr("Cantidad").ToString.ToDecimal <> dr("CantidadOrg").ToString.ToDecimal) Then
+ Obs = $"{Obs}, Cantidad Original: {dr("CantidadOrg").ToString.ToDecimal.ToString("###,###,###.00")}"
+ End If
+
+
+ If (dr("CvePSOrg").ToString.ToEntero > 0) AndAlso (dr("CvePS").ToString.ToEntero <> dr("CvePSOrg").ToString.ToEntero) Then
+ Obs = $"{Obs}, Producto Original: {dr("CodigoPSOrg").ToString}"
+ End If
+
+ If Not ObjFactura.AgregarPS(dr("CvePS").ToString.ToEntero, dr("Cantidad").ToString.ToDecimal, dr("PU").ToString.ToDecimal, 0, Obs, CveSubProyecto:=dr("CveSubProyecto").ToString.ToEntero, CveVentaDetallePadre:=dr("CveVentaDetalle").ToString.ToEntero) Then
Alert("Error al agregar producto", TipoMensaje.MsgAdvertencia)
TieneError = True
Exit For
@@ -131,8 +304,15 @@ Partial Class Ventas_RepPedidosSTF
Next
If drt("GastosEnvio").ToString.ToDecimal > 0 Then
- Dim tCvePSEnvio As Integer = usuarioactual.empresa.Funcionalidad(160).toentero
- If Not ObjFactura.AgregarPS(tCvePSEnvio, 1, drt("GastosEnvio").ToString.ToDecimal, 0, "", CveSubProyecto:=drt("CveSubProyecto").ToString.ToEntero) Then
+ Dim tCvePSEnvio As Integer = UsuarioActual.Empresa.Funcionalidad(160).ToEntero
+
+ Dim Obs As String = drt("Observacion").ToString
+
+ If (drt("CantidadOrg").ToString.ToEntero > 0 Or drt("CvePSOrg").ToString.ToEntero > 0) AndAlso (drt("CvePS").ToString.ToEntero <> drt("CvePSOrg").ToString.ToEntero Or drt("Cantidad").ToString.ToDecimal <> drt("CantidadOrg").ToString.ToDecimal) Then
+ Obs = $"{Obs} - Cantidad Original: {drt("CantidadOrg").ToString.ToDecimal.ToString("###,###,###.00")}, Producto Original: {drt("CodigoPSOrg").ToString}"
+ End If
+
+ If Not ObjFactura.AgregarPS(tCvePSEnvio, 1, drt("GastosEnvio").ToString.ToDecimal, 0, Obs, CveSubProyecto:=drt("CveSubProyecto").ToString.ToEntero) Then
TieneError = True
End If
End If