This commit is contained in:
rrene
2020-05-04 10:38:56 -07:00
87 changed files with 73642 additions and 3588 deletions

View File

@@ -1698,9 +1698,9 @@ Partial Class Clientes
Return Retorno
End Function
Private Sub CargaHistorial(Optional SelectTop As Integer = 21, Optional CveClienteSucursal As Integer = -1)
Private Sub CargaHistorial(Optional SelectTop As Integer = 21, Optional CveClienteSucursal As Integer = -1, Optional TipoDocto As String = "-1")
Dim ObjClientes As New ClsClientes()
If ObjClientes.GetHistorialVentas(CveCliente, SelectTop, CveClienteSucursal:=DdlSucursalCliente.SelectedValue.ToEntero) Then
If ObjClientes.GetHistorialVentas(CveCliente, SelectTop, CveClienteSucursal:=DdlSucursalCliente.SelectedValue.ToEntero, TipoDocto:=TipoDocto) Then
If ObjClientes.DtResultados.Rows.Count > 0 Then
'Carga Generales
LtlCantidad.Text = ObjClientes.DtResultados.Rows(0)("CountTotal").ToString.FormatoNumero(0)
@@ -1894,10 +1894,10 @@ Partial Class Clientes
Protected Sub BtnVerMasVentas_Click(sender As Object, e As EventArgs)
If BtnVerMasVentas.Text = "Ver Más" Then
CargaHistorial(-1)
CargaHistorial(-1, TipoDocto:=RblTipo.SelectedValue)
BtnVerMasVentas.Text = "Ver Menos"
Else
CargaHistorial(21)
CargaHistorial(21, TipoDocto:=RblTipo.SelectedValue)
BtnVerMasVentas.Text = "Ver Más"
End If
End Sub
@@ -5426,26 +5426,7 @@ Partial Class Clientes
#Region "M E T O D O S "
Protected Sub RblTipo_SelectedIndexChanged(sender As Object, e As EventArgs) Handles RblTipo.SelectedIndexChanged
If DTHistorialVentas IsNot Nothing AndAlso RblTipo.SelectedValue <> "-1" Then
Dim tmp As DataTable = DTHistorialVentas.FiltraParametros($"TipoDocto = '{RblTipo.SelectedValue}'")
If tmp.Rows.Count > 0 Then
Dim Totales As DataRow = tmp.NewRow
Totales("SubTotal") = tmp.SUM("SubTotal")
Totales("Total") = tmp.SUM("Total")
Totales("Descuento") = tmp.SUM("Descuento")
Totales("Amortizacion") = tmp.SUM("Amortizacion")
Totales("MAX_Total") = tmp.MAX("MAX_Total")
Totales("AVG_Total") = tmp.AVG("AVG_Total")
Totales("MIN_Total") = tmp.MIN("MIN_Total")
Totales("CountTotal") = tmp.COUNT("CountTotal")
tmp.Rows.InsertAt(Totales, 0)
End If
GVHistorial.DataSource = tmp
ElseIf DTHistorialVentas IsNot Nothing AndAlso RblTipo.SelectedValue = "-1" Then
GVHistorial.DataSource = DTHistorialVentas
End If
GVHistorial.DataBind()
CargaHistorial(TipoDocto:=RblTipo.SelectedValue)
End Sub
Private Sub DdlSucursalCliente_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlSucursalCliente.SelectedIndexChanged
CargaCotizaciones(CveClienteSucursal:=DdlSucursalCliente.SelectedValue.ToEntero) 'listo

File diff suppressed because it is too large Load Diff

View File

@@ -73,6 +73,22 @@
</li>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDescargaZipPDF" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<li>
<asp:LinkButton ID="BtnDescargarZipPDF" runat="server"> <i class="fa fa-cloud-download"></i> Descargar Facturas</asp:LinkButton>
</li>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID= "BtnDescargarZipPDF" />
</Triggers>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Reporte de Productos Servicios
@@ -294,7 +310,9 @@
</asp:UpdatePanel>
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" Width="99%" AutoGenerateColumns="False" EmptyDataText="No se encontraron Ventas con los filtros especificados" ToolTip="Listado de Ventas" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" GridLines="None">
<asp:GridView ID="GvDatos" runat="server" Width="99%" AutoGenerateColumns="False" EmptyDataText="No se encontraron Ventas con los filtros especificados" ToolTip="Listado de Ventas"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" GridLines="None" DataKeyNames="TipoDocumento,SerieFolio" >
<Columns>
<asp:HyperLinkField HeaderText="Serie Folio" DataTextField="SerieFolio" Target="_blank" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="~/Ventas/Ventas.aspx?CveVenta={0}" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Fecha" DataField="Fecha" DataFormatString="{0:d}" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center" />
@@ -316,6 +334,7 @@
<RowStyle CssClass="Texto" />
<HeaderStyle CssClass="Titulos" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel runat="server" ID="UPPersonalizar" UpdateMode="Conditional">

View File

@@ -2,12 +2,14 @@
Option Strict On
Imports System.Data
Imports System.IO
Imports Extensiones
Imports Microsoft.Reporting.WebForms
Imports System.IO.Compression
Partial Class Ventas_RepProductosServiciosDetalle
Inherits ClsPaginas
Inherits ClsPaginas
#Region "PROPIEDADES"
Private Property TmpDT As DataTable
Get
@@ -57,9 +59,9 @@ Partial Class Ventas_RepProductosServiciosDetalle
Set(value As String)
ViewState("Agrupador") = value
End Set
End Property
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
@@ -68,11 +70,11 @@ Partial Class Ventas_RepProductosServiciosDetalle
CargaParametrosDetalle()
End If
End Sub
End Sub
#Region " CARGA DATOS INICIALES "
Private Sub CargaGrupo()
DdlGrupo.Items.Insert(0, New ListItem("Categoria", "3"))
DdlGrupo.Items.Insert(1, New ListItem("Clasificacion", "4"))
@@ -382,9 +384,9 @@ Partial Class Ventas_RepProductosServiciosDetalle
DdlTipoPSDes.SelectedValueExist(CveClasificacionDetalle)
CargaDatos(CveProyecto, CveSubProyecto, CveCategoria, CveClasificacion, CvePS, Mes, MesEjec, CveCliente, CveSubProyectoEjecucion, CveVendedor, CveUsuario, CveEstatus, GPO.ToEntero, TipoDocto, CveMarca)
CargarMarcas(CveMarca)
End Sub
End Sub
#End Region
#Region " CARGA DATOS "
Protected Sub BtnConsultar_Click(sender As Object, e As System.EventArgs) Handles BtnConsultar.Click
CargaDatos()
@@ -465,11 +467,11 @@ Partial Class Ventas_RepProductosServiciosDetalle
End If
DdlMarcaPSDes.Items.Insert(0, New ListItem(" - ", "-1"))
DdlMarcaPSDes.Items.FindByValue(CStr(CveMarca)).Selected = True
End Sub
End Sub
#End Region
#Region "TIPO CAMBIO"
Private Sub RblTipoCambio_SelectedIndexChanged(sender As Object, e As EventArgs) Handles RblTipoCambio.SelectedIndexChanged
TipoCambio = RblTipoCambio.SelectedValue.ToEntero
If RblTipoCambio.SelectedValue.ToEntero = 3 Then
@@ -481,10 +483,10 @@ Partial Class Ventas_RepProductosServiciosDetalle
LiEspecifico.Visible = False
End If
UpBodyTipoCambio.Update()
End Sub
End Sub
#End Region
#Region " GV DATOS - PERSONALIZAR "
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
@@ -545,11 +547,11 @@ Partial Class Ventas_RepProductosServiciosDetalle
CargaDatos()
UPDatos.Update()
End Sub
End Sub
#End Region
#Region " SELECTED INDEX CHANGED"
Protected Sub DdlClienteClasificacion_SelectedIndexChanged(sender As Object, e As EventArgs)
CargaClientes()
End Sub
@@ -641,17 +643,17 @@ Partial Class Ventas_RepProductosServiciosDetalle
End If
DdlEstatus.Items.Add(New ListItem("Todos", "-1"))
DdlEstatus.DataBind()
End Sub
End Sub
#End Region
#Region " EXCEL "
Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
GvDatos.ExportToExcel("ReporteProductosServicios" & Now.ToShortDateString)
End Sub
End Sub
#End Region
#Region " PDF "
Protected Sub ImgImprimir_Click(sender As Object, e As EventArgs) Handles ImgImprimir.Click
ImprimirReporte()
@@ -684,11 +686,11 @@ Partial Class Ventas_RepProductosServiciosDetalle
End If
ObjVentas.Dispose()
End Sub
End Sub
#End Region
#Region "GRAFICA"
Protected Sub LnkVerGrafica_Click(sender As Object, e As EventArgs)
If Not TmpDT IsNot Nothing AndAlso TmpDT.Rows.Count > 0 Then
Alert("No hay datos disponibles", TipoMensaje.MsgAdvertencia)
@@ -818,9 +820,74 @@ Partial Class Ventas_RepProductosServiciosDetalle
Protected Sub DdlVer_SelectedIndexChanged(sender As Object, e As EventArgs)
CambioGrafica()
End Sub
End Sub
#End Region
#Region " D E S C A R G A S "
Private Sub BtnDescargarPDF_Click(sender As Object, e As EventArgs) Handles BtnDescargarZipPDF.Click
'If Not Directory.Exists(AppDomain.CurrentDomain.BaseDirectory & "Temp\" & UsuarioActual.CveUsuario.ToString & "\") Then
' Directory.CreateDirectory(AppDomain.CurrentDomain.BaseDirectory & "Temp\" & UsuarioActual.CveUsuario.ToString & "\")
'End If
Dim Archivo As String = String.Empty
Dim HuboInexistentes As Boolean = False
Dim SBInexistentes As New StringBuilder : SBInexistentes.Append("No se pudieron anexar los siguientes archivos:<br />")
Dim ArchivoDestino As String = String.Format("{0}Temp\{1}.zip", AppDomain.CurrentDomain.BaseDirectory, Now.ToString("yyyyMMddhhmmss") & UsuarioActual.CveUsuario.ToString)
Dim archiveZip As ZipArchive = ZipFile.Open(ArchivoDestino, ZipArchiveMode.Create)
Dim DTVentas As DataTable = TmpDT.FiltraParametros("", "", {"CveVenta", "TipoDocumento", "Folio", "SerieFolio"})
Try
For Each Drow As DataRow In DTVentas.Rows
Dim SerieFolio As String = Drow("SerieFolio").ToString.Replace("-", "_")
If Drow("TipoDocumento").ToString.Trim <> String.Empty Then
Archivo = String.Format("{0}PDF/{1}/{2}.pdf", UsuarioActual.Empresa.Ruta.Replace("\", "/"), Drow("TipoDocumento").ToString, Drow("SerieFolio").ToString)
If File.Exists(Archivo) Then
archiveZip.CreateEntryFromFile(Archivo, Drow("SerieFolio").ToString & ".pdf")
' Exit For
Else
HuboInexistentes = True
SBInexistentes.AppendFormat("Tipo {0}, Folio {1} - {2}<br />", Drow("TipoDocumento").ToString, SerieFolio, Archivo)
End If
End If
Next
Catch ex As Exception
End Try
archiveZip.Dispose()
Response.Clear()
Response.ContentType = "application/zip"
Response.AddHeader("content-disposition", $"attachment; filename=facturas{Now.ToString("yyyyMMddhhmmss")}.zip")
Response.TransmitFile(ArchivoDestino)
Response.Flush()
Try
File.Delete(ArchivoDestino)
Catch ex As Exception
End Try
Response.End()
End Sub
#End Region
End Class

View File

@@ -74,15 +74,14 @@ Partial Class RepRemisiones
CargaContrato()
CargaVendedor()
CargaDatos()
OrdenaDatos()
End If
End Sub
#Region " C A R G A - D A T O S "
Public Sub CargaDatos()
Dim ObjVentas As New ClsVentas
Public Sub CargaDatos()
FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim(), "-1")
FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim(), "-1")
FechaV = If(IsDate(TxtFechaVencimiento.Text.Trim()), TxtFechaVencimiento.Text.Trim(), "-1")
@@ -90,29 +89,20 @@ Partial Class RepRemisiones
CveContrato = If(DdlContrato.SelectedValue.ToEntero > 0, DdlContrato.SelectedValue.ToEntero, -1)
Sucursales = IIf(DdlSubProyectos.GetSelectedValuesM = "", "-1", DdlSubProyectos.GetSelectedValuesM).ToString
Dim Vendedores As String = IIf(DdlVendedor.GetSelectedValuesM = "", "-1", DdlVendedor.GetSelectedValuesM).ToString
Dim Vendedores As String = IIf(DdlVendedor.GetSelectedValuesM = "", "-1", DdlVendedor.GetSelectedValuesM).ToString
Dim ObjVentas As New ClsVentas
If ObjVentas.GetRepRemisionesSinFacturar(FechaI, FechaF, FechaV, Sucursales, CveCliente, CveContrato, Vendedores, UsuarioActual.CveEmpresa, CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then
GvDatos.DataSource = ObjVentas.DtResultados
DtVentas = ObjVentas.DtResultados
GvDatos.DataBind()
UPDatos.Update()
End If
ObjVentas.Dispose()
End Sub
ObjVentas.Dispose()
GvDatos.DataBind()
UPDatos.Update()
End Sub
#End Region
#Region "O R D E N A M I E N T O"
Private Sub OrdenaDatos()
'If (GvDatos.Rows.Count > 0) Then
' GvDatos.UseAccessibleHeader = True
' GvDatos.HeaderRow.TableSection = TableRowSection.TableHeader
' RegistraScript("OrdenarGV();")
'End If
End Sub
#End Region
#Region "G V - D A T O S "
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
@@ -134,7 +124,7 @@ Partial Class RepRemisiones
e.Row.Cells(5).Text = e.Row.Cells(5).Text + "%"
End If
e.Row.FCLiteral("LtlTotal").Text = "<a class=""Texto"" target=""_blank"" href=""/Ventas/RepRemisionesDetalle.aspx?CveVenta=" & e.Row.DBCampo("CveVenta") & "&FechaI=" & FechaI & "&FechaF=" & FechaF & "&FechaV=" & FechaV & "&CveCliente=" & e.Row.DBCampo("CveCliente") & "&CveContrato=" & CveContrato & "&CveSubProyecto=" & Sucursales & "&CveMoneda=" & e.Row.DBCampo("CveMoneda") & """>" & e.Row.FCLiteral("LtlTotal").Text & "</a>"
e.Row.FCLiteral("LtlTotal").Text = "<a class=""Texto"" target=""_blank"" href=""/Ventas/RepRemisionesDetalle.aspx?CveVenta=" & e.Row.DBCampo("CveVenta") & "&FechaI=" & FechaI & "&FechaF=" & FechaF & "&FechaV=" & FechaV & "&CveCliente=" & If(e.Row.DBCampo("CveCliente").ToString().ToEntero() > 0, e.Row.DBCampo("CveCliente").ToString(), DdlClientes.SelectedValue) & "&CveContrato=" & CveContrato & "&CveSubProyecto=" & Sucursales & "&CveMoneda=" & e.Row.DBCampo("CveMoneda") & """>" & e.Row.FCLiteral("LtlTotal").Text & "</a>"
End If
End Sub

View File

@@ -165,11 +165,11 @@ Partial Class RepRemisionesDetalle
DtVentas = ObjVentas.DtResultados
End If
GvDatos.DataSource = DtVentas
GvDatos.DataBind()
UPDatos.Update()
End If
ObjVentas.Dispose()
ObjVentas.Dispose()
GvDatos.DataBind()
UPDatos.Update()
End Sub
Public Sub CargaCombos()
CargaCliente()
@@ -207,21 +207,10 @@ Partial Class RepRemisionesDetalle
DdlSubProyectos.DataSource() = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1)
DdlSubProyectos.DataBind()
'DdlSubProyectos.Items.Insert(0, New ListItem("Todos", "-1"))
End Sub
#End Region
#Region "O R D E N A M I E N T O"
Private Sub OrdenaDatos()
If (GvDatos.Rows.Count > 0) Then
GvDatos.UseAccessibleHeader = True
GvDatos.HeaderRow.TableSection = TableRowSection.TableHeader
RegistraScript("OrdenarGV();")
End If
End Sub
#End Region
End Sub
#End Region
#Region "G V - D A T O S "
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
@@ -230,13 +219,11 @@ Partial Class RepRemisionesDetalle
e.Row.Cells(2).ForeColor = Drawing.Color.Red
End If
End If
End Sub
End Sub
#End Region
#Region "CARGA COMBOS FILTRO"
#End Region
#Region "PDF"
Private Sub LnkPdf_Click(sender As Object, e As EventArgs) Handles LnkPdf.Click
If DtVentas IsNot Nothing Then

View File

@@ -4334,6 +4334,7 @@ Partial Class Ventas
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant") AndAlso GvRemisiones.Rows.Count > 0 Then
ChkDevAlm.Checked = True
ChkDevAlm.Enabled = False
LiDevolucionAlmacen.Visible = False
End If
End If
@@ -8776,10 +8777,10 @@ Partial Class Ventas
'Try
'Obj.SetSubProyecto(Me)
Timbre.Comprobante.LugarExpedicion = Obj.SubProyecto.CP
If Timbre.Comprobante.LugarExpedicion = "" Then
Dim aa As String = "no se guardo lugar de expedicion"
aa.GuardaLog()
End If
If Timbre.Comprobante.LugarExpedicion = "" Then
Dim aa As String = "no se guardo lugar de expedicion"
aa.GuardaLog()
End If
'Catch ex As Exception
'End Try
@@ -9425,15 +9426,20 @@ Partial Class Ventas
If factura.TipoDocto.Contiene("Dev", "Egs") Or DtVentasNC IsNot Nothing Then
If DtVentasNC IsNot Nothing Then
For Each row As DataRow In DtVentasNC.Rows
If Not ObjVentas.AddVentasRelacionadas(ObjVentas.CveVenta, row("CveVenta").ToString.ToEntero) Then
ErrorList.Add("Ocurrió un error al relacionar las ventas entre si comuníquese a Soporte Técnico")
If Not row("CveVenta").ToString.ToEntero = -1 Then
If Not ObjVentas.AddVentasRelacionadas(ObjVentas.CveVenta, row("CveVenta").ToString.ToEntero) Then
ErrorList.Add("Ocurrió un error al relacionar las ventas entre si comuníquese a Soporte Técnico")
End If
End If
Next
Else
If Not ObjVentas.AddVentasRelacionadas(ObjVentas.CveVenta, CveVenta) Then
ErrorList.Add("Ocurrió un error al relacionar las ventas entre si comuníquese a Soporte Técnico")
If Not CveVenta = -1 Then
If Not ObjVentas.AddVentasRelacionadas(ObjVentas.CveVenta, CveVenta) Then
ErrorList.Add("Ocurrió un error al relacionar las ventas entre si comuníquese a Soporte Técnico")
End If
End If
End If
End If
End If
@@ -11023,15 +11029,6 @@ Partial Class Ventas
End If
Dim ModalidadRefacturacion As Integer = UsuarioActual.Empresa.Funcionalidad(586).ToEntero()
'REFACTURACION CON PAGOS, DEBE CANCELAR SALDOS DEL DOCUMENTO ANTERIOR Y TRASPASAR PAGOS AL NUEVO
If ModalidadRefacturacion = 2 AndAlso ObjFactura.TipoDocto.Contiene("Ing", "Ant") AndAlso ObjFactura.NuevaFactura = 1 Then
If Not ObjConta.TraspasarSaldosPrePolizasRefacturacion(ObjFacturaNC.CveVenta, ObjFactura.CveVenta, ObjFactura.CvePrePoliza, CvePlantilaPoliza, UsuarioActual.CveEmpresa) Then
ErrorList.Add("Ocurrió un error al traspasos saldos en refacturación")
End If
End If
'Si es Facturacion de una remision cancelamos, traspasamos saldos y agregamos evento a la bitacora
If RemisionesLista.Count > 0 AndAlso ObjFactura.TipoDocto.Contiene("Ing", "Ant") Then
@@ -11124,9 +11121,18 @@ Partial Class Ventas
End If
End If
Dim ModalidadRefacturacion As Integer = UsuarioActual.Empresa.Funcionalidad(586).ToEntero()
'REFACTURACION CON PAGOS, DEBE CANCELAR SALDOS DEL DOCUMENTO ANTERIOR Y TRASPASAR PAGOS AL NUEVO
If ModalidadRefacturacion = 2 AndAlso ObjFactura.TipoDocto.Contiene("Ing", "Ant") AndAlso ObjFactura.NuevaFactura = 1 Then
If Not ObjConta.TraspasarSaldosPrePolizasRefacturacion(ObjFacturaNC.CveVenta, ObjFactura.CveVenta, ObjFactura.CvePrePoliza, CvePlantilaPoliza, UsuarioActual.CveEmpresa) Then
ErrorList.Add("Ocurrió un error al traspasos saldos en refacturación")
End If
End If
Return ErrorPrepoliza
Catch ex As Exception
GuardaLog(ex.ToString())
GuardaLog("GuardaPreP." & ex.ToString())
Return True
End Try
@@ -11169,7 +11175,7 @@ Partial Class Ventas
CveConceptoAlmacen = 18
End If
Dim CveAlmacen = ddlAlmacen.SelectedValue.ToEntero
Dim CveAlmacen = ddlAlmacen.SelectedValue.ToEnteroca
Dim CveMovimientoInventario As Integer = ObjInventario.AddMovimiento(CveAlmacen, CveConceptoAlmacen, factura.CveMoneda, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, Modulo:="Vta/E1")
If CveMovimientoInventario <= 0 Then
@@ -13462,7 +13468,7 @@ Partial Class Ventas
End If
Catch ex As Exception
GuardaLog(ex.ToString())
GuardaLog("CancelF." & ex.ToString())
ErrorCancelar = True
End Try
@@ -22047,14 +22053,14 @@ Partial Class Ventas
If UltimoRenglon = DtImpuestos.Rows.Count Then
'ajusta 5 centavos de diferencia
If Acumulado12 <> AcumuladoNC And Math.Abs(Acumulado12 - AcumuladoNC) <= 0.05 Then
Ajuste = Acumulado12 - AcumuladoNC
Ajuste = (Acumulado12 - AcumuladoNC)
End If
End If
UltimoRenglon += 1
AgregaTempDT(TmpDT, DrPS("CvePS").ToString.ToEntero, DrPS("PS").ToString, DrPS("Codigo").ToString, DrPS("PSCodigo").ToString, DrPS("CveTipoPS").ToString.ToEntero, DrPS("Inv_CveMetodoInventario").ToString.ToEntero,
DrPS("CveUM").ToString.ToEntero, DrPS("UnidadMedida").ToString, DrPS("CveClasificacion").ToString.ToEntero, DrPS("Clasificacion").ToString, CveProyecto, Proyecto, CveSubProyecto, SubProyecto,
TxtNCObservaciones.Text.Trim, 1, Dr("ImportePU").ToString.ToDecimal + Ajuste, Dr("PorcentajeIVA").ToString.ToDecimal, Dr("ImporteIVA").ToString.ToDecimal, Dr("PorcentajeRetIVA").ToString.ToDecimal, Dr("ImporteRetIVA").ToString.ToDecimal,
Dr("PorcentajeRetISR").ToString.ToDecimal, Dr("ImporteRetISR").ToString.ToDecimal, Dr("PorcentajeIEPS").ToString.ToDecimal, Dr("ImporteIEPS").ToString.ToDecimal, -1, 0.0, Dr("ImporteTotal").ToString.ToDecimal, "", "", -1, -1,
Dr("PorcentajeRetISR").ToString.ToDecimal, Dr("ImporteRetISR").ToString.ToDecimal, Dr("PorcentajeIEPS").ToString.ToDecimal, Dr("ImporteIEPS").ToString.ToDecimal, -1, 0.0, Dr("ImporteTotal").ToString.ToDecimal(), "", "", -1, -1,
DrPS("SATClavePS").ToString, DrPS("SATClaveUnidadMedida").ToString, -1, -1, -1, -1, -1, -1)
Next
@@ -22166,7 +22172,7 @@ Partial Class Ventas
'codigo para ajuste de centavo, si el importe total no cuadra con los totales
Dim difTmp As Decimal = Importe - importeNC
If Math.Abs(difTmp) >= 0.01 Then
If Math.Abs(difTmp) > 0.00D Then
'asusto la diferencia en el último concepto
Dim ImporteAjustado As Decimal = DtImpuestosLocal.Rows(DtImpuestosLocal.Rows.Count - 1)("ImporteTotal").ToString.ToDecimal + difTmp
DtImpuestosLocal.Rows(DtImpuestosLocal.Rows.Count - 1)("ImporteTotal") = ImporteAjustado