Merge branch 'master' of http://agonzalez@192.168.10.111:8383/SIG.git
This commit is contained in:
@@ -6698,10 +6698,12 @@ Public Class ClsPaginas
|
|||||||
'If EmpresaActual = 48 Then
|
'If EmpresaActual = 48 Then
|
||||||
' nombreautorizo = "Lic. LUIS JORGE CONTRERAS LANDGRAVE"
|
' nombreautorizo = "Lic. LUIS JORGE CONTRERAS LANDGRAVE"
|
||||||
'End If
|
'End If
|
||||||
|
Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos\OC.rdlc", EmpresaActual.Ruta))
|
||||||
|
If Not Archivo.Exists OrElse EmpresaActual.CveEmpresa.Contiene(4, 145, 7, 11, 12, 72, 80, 122, 126) Then
|
||||||
|
params.Add(New ReportParameter("Descuento", DtDetalle.SUM("Descuento").ToString.FormatoNumero(2)))
|
||||||
|
End If
|
||||||
'DATOS PARA DESCUENTO
|
'DATOS PARA DESCUENTO
|
||||||
If EmpresaActual.CveEmpresa.Contiene(4, 145, 7, 11, 12, 72, 80, 122, 126) Then 'EMPRESAS QUE YA TIENEN EL AJUSTE EN EL FORMATO
|
If EmpresaActual.CveEmpresa.Contiene(4, 145, 7, 11, 12, 72, 80, 122, 126) Then 'EMPRESAS QUE YA TIENEN EL AJUSTE EN EL FORMATO
|
||||||
params.Add(New ReportParameter("Descuento", DtDetalle.SUM("Descuento").ToString.FormatoNumero(2)))
|
|
||||||
params.Add(New ReportParameter("SubTotal", ObjOC.SubTotal.ToString))
|
params.Add(New ReportParameter("SubTotal", ObjOC.SubTotal.ToString))
|
||||||
params.Add(New ReportParameter("SubTotal2", DtDetalle.SUM("Total").ToString))
|
params.Add(New ReportParameter("SubTotal2", DtDetalle.SUM("Total").ToString))
|
||||||
Else
|
Else
|
||||||
@@ -6768,8 +6770,8 @@ Public Class ClsPaginas
|
|||||||
Dim FirmaSol As New System.IO.FileInfo(String.Format("{0}Firmas\{1}.png", EmpresaActual.Ruta, CveUsuarioSol))
|
Dim FirmaSol As New System.IO.FileInfo(String.Format("{0}Firmas\{1}.png", EmpresaActual.Ruta, CveUsuarioSol))
|
||||||
params.Add(New ReportParameter("FirmaSolicito", If(FirmaSol.Exists, New Uri(Server.MapPath(String.Format("~/Empresas/{0}/Firmas/{1}.png", EmpresaActual.CveEmpresa, CveUsuarioSol))).AbsoluteUri, "")))
|
params.Add(New ReportParameter("FirmaSolicito", If(FirmaSol.Exists, New Uri(Server.MapPath(String.Format("~/Empresas/{0}/Firmas/{1}.png", EmpresaActual.CveEmpresa, CveUsuarioSol))).AbsoluteUri, "")))
|
||||||
Dim FirmaAut As New System.IO.FileInfo(String.Format("{0}Firmas\{1}.png", EmpresaActual.Ruta, CveUsuarioAut))
|
Dim FirmaAut As New System.IO.FileInfo(String.Format("{0}Firmas\{1}.png", EmpresaActual.Ruta, CveUsuarioAut))
|
||||||
params.Add(New ReportParameter("FirmaAutorizo", If(FirmaAut.Exists, New Uri(Server.MapPath(String.Format("~/Empresas/{0}/Firmas/{1}.png", EmpresaActual.CveEmpresa, CveUsuarioAut))).AbsoluteUri, "")))
|
params.Add(New ReportParameter("FirmaAutorizo", If(FirmaAut.Exists, New Uri(Server.MapPath(String.Format("~/Empresas/{0}/Firmas/{1}.png", EmpresaActual.CveEmpresa, CveUsuarioAut))).AbsoluteUri, "")))
|
||||||
Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos\OC.rdlc", EmpresaActual.Ruta))
|
|
||||||
If Archivo.Exists Then
|
If Archivo.Exists Then
|
||||||
bytes = StreamPDF(String.Format("{0}Formatos\OC.rdlc", EmpresaActual.Ruta), DtDetalle, params, $"OC_{ObjOC.Folio.ToString}", RDSName:="DsOC", MR:=MR)
|
bytes = StreamPDF(String.Format("{0}Formatos\OC.rdlc", EmpresaActual.Ruta), DtDetalle, params, $"OC_{ObjOC.Folio.ToString}", RDSName:="DsOC", MR:=MR)
|
||||||
Else
|
Else
|
||||||
|
|||||||
@@ -3823,13 +3823,6 @@ Namespace Modelos
|
|||||||
|
|
||||||
Dim TieneAlmacen As Boolean = False
|
Dim TieneAlmacen As Boolean = False
|
||||||
|
|
||||||
'If Not EsRefacturacion AndAlso ObjFactura.SaldoAlmacen <> 0 Then
|
|
||||||
' Retorno.Mensaje = "El pedido no se puede cancelar ya que tiene movimientos de almacén.<br/>Nota: Primero hay que hacer la devolución al almacén."
|
|
||||||
' Retorno.TipoMensaje = TipoMensaje.MsgAdvertencia
|
|
||||||
|
|
||||||
' Return Retorno
|
|
||||||
'End If
|
|
||||||
|
|
||||||
'VALIDA QUE LA FACTURA NO TENGA PAGOS
|
'VALIDA QUE LA FACTURA NO TENGA PAGOS
|
||||||
If ObjFactura.TipoDocto.Contiene("Ing", "Rem") AndAlso ObjFactura.Pagado > 0 Then
|
If ObjFactura.TipoDocto.Contiene("Ing", "Rem") AndAlso ObjFactura.Pagado > 0 Then
|
||||||
Retorno.Mensaje = "La factura no se puede cancelar debido a que tiene pagos vinculados."
|
Retorno.Mensaje = "La factura no se puede cancelar debido a que tiene pagos vinculados."
|
||||||
@@ -4286,13 +4279,6 @@ Namespace Modelos
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If Not ErrorCancelar Then
|
|
||||||
If Not GeneraMovimientosApartados(ObjInventario) Then
|
|
||||||
ErrorCancelar = True
|
|
||||||
MensajeError = "Ocurrió un error al guardar los movimientos de control de apartados"
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
'DEVOLUCION REMISION - REGRESA LAS EXISTENCIAS A ENTREGA POR ADELANTADO SI LA FACTURA VIENE DE REMISION
|
'DEVOLUCION REMISION - REGRESA LAS EXISTENCIAS A ENTREGA POR ADELANTADO SI LA FACTURA VIENE DE REMISION
|
||||||
If Not ErrorCancelar AndAlso RevivirRemisiones Then
|
If Not ErrorCancelar AndAlso RevivirRemisiones Then
|
||||||
If Not GeneraMovimientosEntregaPorAdelantadoRemision(CveMovimiento, ObjVentas, ObjInventario, DtDevRem, ListaRemisionesCancelar) Then
|
If Not GeneraMovimientosEntregaPorAdelantadoRemision(CveMovimiento, ObjVentas, ObjInventario, DtDevRem, ListaRemisionesCancelar) Then
|
||||||
@@ -4302,22 +4288,25 @@ Namespace Modelos
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If Not ErrorCancelar Then
|
If Not ErrorCancelar Then
|
||||||
'QUEMA DEVOLUCION | QUEMA = LA QUITA DE PENDIENTE POR RECIBIR (DEVOLVER)
|
If Not GeneraMovimientosApartados(ObjInventario) Then
|
||||||
If CveMovimiento > 0 AndAlso RealizarDevolucionAlmacen Then
|
ErrorCancelar = True
|
||||||
If Not ErrorCancelar Then
|
MensajeError = "Ocurrió un error al guardar los movimientos de control de apartados"
|
||||||
If Not ObjVentas.UpdateVentasDevolucionAlmacen(2, CveVenta) Then
|
End If
|
||||||
MensajeError = "Ocurrió un error al hacer la devolucion. Por favor vuelva a intentar."
|
End If
|
||||||
ErrorCancelar = True
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
'AGREGA BITACORA A VENTA
|
'QUEMA DEVOLUCION | QUEMA = LA QUITA DE PENDIENTE POR RECIBIR (DEVOLVER)
|
||||||
If Not ErrorCancelar Then
|
If Not ErrorCancelar Then
|
||||||
Dim MensajeBitacora = "Devuelta"
|
If Not ObjVentas.UpdateVentasDevolucionAlmacen(2, CveVenta) Then
|
||||||
If Not ObjEventos.AddEventoBitacora(String.Format("Venta {2} en Folio: <a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"">{1}</a>", CveMovimiento, Folio, MensajeBitacora), "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveVenta) Then
|
MensajeError = "Ocurrió un error al hacer la devolucion. Por favor vuelva a intentar."
|
||||||
ErrorCancelar = True
|
ErrorCancelar = True
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
'AGREGA BITACORA A VENTA
|
||||||
|
If Not ErrorCancelar AndAlso RealizarDevolucionAlmacen AndAlso CveMovimiento > 0 Then
|
||||||
|
Dim MensajeBitacora = "Devuelta"
|
||||||
|
If Not ObjEventos.AddEventoBitacora(String.Format("Venta {2} en Folio: <a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"">{1}</a>", CveMovimiento, Folio, MensajeBitacora), "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveVenta) Then
|
||||||
|
ErrorCancelar = True
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -4432,7 +4421,7 @@ Namespace Modelos
|
|||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
If Not ObjVentas.UpdateEstatusFactura(CveEstatus, FolioFiscal, CancelacionAcuse, CancelacionFecha, CveVenta, IDPoliza, CvePAC:=CvePACCancelacion, CveEstatusRefacturacion:=CveEstatusRefacturacion,
|
If Not ObjVentas.UpdateEstatusFactura(CveEstatus, FolioFiscal, CancelacionAcuse, CancelacionFecha, CveVenta, IDPoliza, CvePAC:=CvePACCancelacion, CveEstatusRefacturacion:=CveEstatusRefacturacion,
|
||||||
CveUsuarioCambiaEstatus:=UsuarioActual.CveUsuario, FechaCambioEstatus:=Now.ToString("yyyy-MM-dd hh:mm:ss.mmm")) Then
|
CveUsuarioCambiaEstatus:=UsuarioActual.CveUsuario, FechaCambioEstatus:=Now.ToString("yyyy-MM-dd HH:mm:ss.mmm")) Then
|
||||||
ErrorCancelar = True
|
ErrorCancelar = True
|
||||||
MensajeError = "Ocurrió un error al guardar el estatus de cancelación."
|
MensajeError = "Ocurrió un error al guardar el estatus de cancelación."
|
||||||
End If
|
End If
|
||||||
@@ -4551,58 +4540,47 @@ Namespace Modelos
|
|||||||
Dim SeCancela As Boolean = (ListaRemisionesCancelar IsNot Nothing) AndAlso (ListaRemisionesCancelar.Any(Function(CveRemisionCancelar) CveRemisionCancelar = DrMovtos("CveRem").ToString.ToEntero()))
|
Dim SeCancela As Boolean = (ListaRemisionesCancelar IsNot Nothing) AndAlso (ListaRemisionesCancelar.Any(Function(CveRemisionCancelar) CveRemisionCancelar = DrMovtos("CveRem").ToString.ToEntero()))
|
||||||
|
|
||||||
If Not SeCancela Then
|
If Not SeCancela Then
|
||||||
|
Dim ObjRem As New Modelos.Factura(UsuarioActual, DrMovtos("CveRem").ToString.ToEntero(), UsuarioActual.CveEmpresa)
|
||||||
|
|
||||||
CveAlmacenTraspasoDestinoDevRem = DrMovtos("CveAlmacenTraspasoDestino").ToString.ToEntero
|
If ObjRem.SaldoAlmacen = 0 Then
|
||||||
|
CveAlmacenTraspasoDestinoDevRem = DrMovtos("CveAlmacenTraspasoDestino").ToString.ToEntero
|
||||||
|
|
||||||
If Not CveAlmacenTraspasoDestinoDevRem > 0 Then
|
If Not CveAlmacenTraspasoDestinoDevRem > 0 Then
|
||||||
ErrorCancelar = True
|
|
||||||
Exit For
|
|
||||||
End If
|
|
||||||
|
|
||||||
'SALIDA GENERAL
|
|
||||||
CveMovimientoSalidaDevRem = ObjInventario.AddMovimiento(CveAlmacenDevolucion, 8, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, DrMovtos("CveRem").ToString.ToEntero, -1, -1, Observaciones:="", Guia:="", CveContrato:=CveContrato, CveMovimientoRelacionado:=CveMovimiento, CveAlmacenDestino:=CveAlmacenTraspasoDestinoDevRem)
|
|
||||||
FolioMovimientoSalidaDevRem = ObjInventario.Folio
|
|
||||||
|
|
||||||
'ENTRADA ADELANTADO
|
|
||||||
CveMovimientoEntradaDevRem = ObjInventario.AddMovimiento(CveAlmacenTraspasoDestinoDevRem, 9, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, DrMovtos("CveRem").ToString.ToEntero, -1, -1, Observaciones:="", Guia:="", CveContrato:=CveContrato, CveMovimientoRelacionado:=CveMovimientoSalidaDevRem, CveAlmacenDestino:=CveAlmacenDevolucion)
|
|
||||||
FolioMovimientoEntradaDevRem = ObjInventario.Folio
|
|
||||||
|
|
||||||
If Not (CveMovimientoSalidaDevRem > 0 And CveMovimientoEntradaDevRem > 0) Then
|
|
||||||
ErrorCancelar = True
|
|
||||||
Exit For
|
|
||||||
End If
|
|
||||||
|
|
||||||
'SALIDA POR TRAPASO DE GENERAL
|
|
||||||
For Each DrRem As DataRow In DtDevRem.FiltraParametros($"CveRem = {DrMovtos("CveRem")}").Rows
|
|
||||||
CveVentaDetalleRem = DrRem("CveVentaDetalleRem").ToString.ToEntero
|
|
||||||
CantidadRem = DrRem("CantidadFacturada").ToString.ToDecimal
|
|
||||||
|
|
||||||
If Not CveVentaDetalleRem > 0 Then
|
|
||||||
ErrorCancelar = True
|
ErrorCancelar = True
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
|
|
||||||
For Each Dr As DataRow In DtMovtosDev.FiltraParametros($"CveVentaDetalle = {DrRem("CveVentaDetalle").ToString.ToEntero}").Rows
|
'SALIDA GENERAL
|
||||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaDevRem, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveVentaDetalle:=CveVentaDetalleRem, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString) Then
|
CveMovimientoSalidaDevRem = ObjInventario.AddMovimiento(CveAlmacenDevolucion, 8, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, DrMovtos("CveRem").ToString.ToEntero, -1, -1, Observaciones:="", Guia:="", CveContrato:=CveContrato, CveMovimientoRelacionado:=CveMovimiento, CveAlmacenDestino:=CveAlmacenTraspasoDestinoDevRem)
|
||||||
|
FolioMovimientoSalidaDevRem = ObjInventario.Folio
|
||||||
|
|
||||||
|
'ENTRADA ADELANTADO
|
||||||
|
CveMovimientoEntradaDevRem = ObjInventario.AddMovimiento(CveAlmacenTraspasoDestinoDevRem, 9, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, DrMovtos("CveRem").ToString.ToEntero, -1, -1, Observaciones:="", Guia:="", CveContrato:=CveContrato, CveMovimientoRelacionado:=CveMovimientoSalidaDevRem, CveAlmacenDestino:=CveAlmacenDevolucion)
|
||||||
|
FolioMovimientoEntradaDevRem = ObjInventario.Folio
|
||||||
|
|
||||||
|
If Not (CveMovimientoSalidaDevRem > 0 And CveMovimientoEntradaDevRem > 0) Then
|
||||||
|
ErrorCancelar = True
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
|
||||||
|
'SALIDA POR TRAPASO DE GENERAL
|
||||||
|
For Each DrRem As DataRow In DtDevRem.FiltraParametros($"CveRem = {DrMovtos("CveRem")}").Rows
|
||||||
|
CveVentaDetalleRem = DrRem("CveVentaDetalleRem").ToString.ToEntero
|
||||||
|
CantidadRem = DrRem("CantidadFacturada").ToString.ToDecimal
|
||||||
|
|
||||||
|
If Not CveVentaDetalleRem > 0 Then
|
||||||
ErrorCancelar = True
|
ErrorCancelar = True
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
Next
|
|
||||||
|
|
||||||
If ErrorCancelar Then
|
For Each Dr As DataRow In DtMovtosDev.FiltraParametros($"CveVentaDetalle = {DrRem("CveVentaDetalle").ToString.ToEntero}").Rows
|
||||||
Exit For
|
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaDevRem, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveVentaDetalle:=CveVentaDetalleRem, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString) Then
|
||||||
End If
|
ErrorCancelar = True
|
||||||
Next
|
Exit For
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
If ErrorCancelar Then
|
If ErrorCancelar Then
|
||||||
Exit For
|
|
||||||
End If
|
|
||||||
|
|
||||||
'ENTRADA POR TRAPASO A ENTREGA POR ADELANTADO
|
|
||||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaDevRem, UsuarioActual.CveEmpresa) Then
|
|
||||||
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
|
||||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaDevRem, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString) Then
|
|
||||||
ErrorCancelar = True
|
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
@@ -4611,16 +4589,31 @@ Namespace Modelos
|
|||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Else
|
'ENTRADA POR TRAPASO A ENTREGA POR ADELANTADO
|
||||||
ErrorCancelar = True
|
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaDevRem, UsuarioActual.CveEmpresa) Then
|
||||||
Exit For
|
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
||||||
End If
|
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaDevRem, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString) Then
|
||||||
|
ErrorCancelar = True
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
|
If ErrorCancelar Then
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
|
||||||
|
Else
|
||||||
|
ErrorCancelar = True
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
If Not ObjVentas.UpdateVentasDevolucionAlmacen(0, DrMovtos("CveRem").ToString.ToEntero) Then
|
If Not ObjVentas.UpdateVentasDevolucionAlmacen(0, DrMovtos("CveRem").ToString.ToEntero) Then
|
||||||
ErrorCancelar = True
|
ErrorCancelar = True
|
||||||
Exit For
|
Exit For
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
|
ObjRem.Dispose()
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|||||||
@@ -769,7 +769,7 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
|
|||||||
Using httpClient = New HttpClient()
|
Using httpClient = New HttpClient()
|
||||||
httpClient.Timeout = New TimeSpan(0, 15, 0)
|
httpClient.Timeout = New TimeSpan(0, 15, 0)
|
||||||
Using request = New HttpRequestMessage(HttpMethod.Get, Url)
|
Using request = New HttpRequestMessage(HttpMethod.Get, Url)
|
||||||
request.Headers.Add("ADSToken", Encripta(String.Format("CVEEMPRESA={0}&TICKS={1}", CveEmpresa, DateTime.UtcNow.Ticks)))
|
request.Headers.Add("ADSToken", Encripta(String.Format("CVEEMPRESA={0}&TICKS={1}&CVEUSUARIO=100", CveEmpresa, DateTime.UtcNow.Ticks)))
|
||||||
Dim response = httpClient.SendAsync(request).Result
|
Dim response = httpClient.SendAsync(request).Result
|
||||||
If response.StatusCode = Net.HttpStatusCode.OK Then
|
If response.StatusCode = Net.HttpStatusCode.OK Then
|
||||||
File = response.Content.ReadAsByteArrayAsync().Result
|
File = response.Content.ReadAsByteArrayAsync().Result
|
||||||
|
|||||||
3119
Bancos/IE.aspx
3119
Bancos/IE.aspx
File diff suppressed because it is too large
Load Diff
@@ -2686,7 +2686,31 @@ Partial Class Bancos_IE
|
|||||||
Exit Select
|
Exit Select
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'IMPUESTOS
|
'OTROS INGRESOS/EGRESOS
|
||||||
|
|
||||||
|
If TxtOtrosIngresosEgresos.Text.ToDecimal <> 0 Then
|
||||||
|
Dim Impo As Decimal = TxtOtrosIngresosEgresos.Text.ToDecimal
|
||||||
|
Dim TipoMovtoIE As Boolean = False
|
||||||
|
Dim CveConcIE As Integer = 78
|
||||||
|
If Impo > 0 Then
|
||||||
|
TipoMovtoIE = True
|
||||||
|
Impo = Math.Abs(Impo)
|
||||||
|
CveConcIE = 78
|
||||||
|
Else
|
||||||
|
TipoMovtoIE = False
|
||||||
|
Impo = Math.Abs(Impo)
|
||||||
|
CveConcIE = 211
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoIE, Impo, ReferenciaAplicar, CveConcIE, ConceptoAplicar, Now, IdCtaContableAplicar, -1, CveIE, CveVenta:=CveVentaDevDin, CveCliente:=CveCliente, ImporteMX:=Impo, ImporteME:=0) Then
|
||||||
|
MsgError = "Ocurrió un error al registrar el asiento de pago de devolución"
|
||||||
|
Exit Select
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
'IMPUESTOS
|
||||||
If ObjMov.GetPrePolizasDetalle(CvePrePolizaDevDin) Then
|
If ObjMov.GetPrePolizasDetalle(CvePrePolizaDevDin) Then
|
||||||
Dim PorcentajePagoDevDin = (TxtImporte.Text.ToDecimal / ImporteOriginalDevDin).RoundSQL(6)
|
Dim PorcentajePagoDevDin = (TxtImporte.Text.ToDecimal / ImporteOriginalDevDin).RoundSQL(6)
|
||||||
Dim CveConceptoContableAplciar = -1
|
Dim CveConceptoContableAplciar = -1
|
||||||
|
|||||||
@@ -1,281 +1,281 @@
|
|||||||
Option Explicit On
|
Option Explicit On
|
||||||
Option Strict On
|
Option Strict On
|
||||||
|
|
||||||
Imports System.Data
|
Imports System.Data
|
||||||
Imports Extensiones
|
Imports Extensiones
|
||||||
Imports Microsoft.Reporting.WebForms
|
Imports Microsoft.Reporting.WebForms
|
||||||
|
|
||||||
Partial Class Compras_RepNotasCredito
|
Partial Class Compras_RepNotasCredito
|
||||||
Inherits ClsPaginas
|
Inherits ClsPaginas
|
||||||
|
|
||||||
#Region "PROPIEDADES"
|
#Region "PROPIEDADES"
|
||||||
Private Property DtDatos As DataTable
|
Private Property DtDatos As DataTable
|
||||||
Get
|
Get
|
||||||
DtDatos = CType(ViewState("DtDatos"), DataTable)
|
DtDatos = CType(ViewState("DtDatos"), DataTable)
|
||||||
End Get
|
End Get
|
||||||
Set(value As DataTable)
|
Set(value As DataTable)
|
||||||
ViewState("DtDatos") = value
|
ViewState("DtDatos") = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
#End Region
|
#End Region
|
||||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||||
If Not Page.IsPostBack Then
|
If Not Page.IsPostBack Then
|
||||||
DdlProveedores.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
|
DdlProveedores.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
|
||||||
DdlProveedores.DataBind()
|
DdlProveedores.DataBind()
|
||||||
TxtFechaSaldar.Text = Now.ToShortDateString
|
TxtFechaSaldar.Text = Now.ToShortDateString
|
||||||
CargaDatos()
|
CargaDatos()
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub CargaDatos()
|
Private Sub CargaDatos()
|
||||||
Dim ObjCompras As New ClsCompras
|
Dim ObjCompras As New ClsCompras
|
||||||
Dim FechaI, FechaF As String
|
Dim FechaI, FechaF As String
|
||||||
|
|
||||||
If txtFechaI.Text <> "" Then FechaI = txtFechaI.Text Else FechaI = "-1"
|
If txtFechaI.Text <> "" Then FechaI = txtFechaI.Text Else FechaI = "-1"
|
||||||
If txtFechaF.Text <> "" Then FechaF = txtFechaF.Text Else FechaF = "-1"
|
If txtFechaF.Text <> "" Then FechaF = txtFechaF.Text Else FechaF = "-1"
|
||||||
|
|
||||||
|
|
||||||
If ObjCompras.GetNotasCreditoRep(DdlProveedores.SelectedValue.ToEntero, DdlOpcion.SelectedValue.ToEntero, FechaI, FechaF, UsuarioActual.CveEmpresa) Then
|
If ObjCompras.GetNotasCreditoRep(DdlProveedores.SelectedValue.ToEntero, DdlOpcion.SelectedValue.ToEntero, FechaI, FechaF, UsuarioActual.CveEmpresa) Then
|
||||||
DtDatos = ObjCompras.DtResultados
|
DtDatos = ObjCompras.DtResultados
|
||||||
CargaGrid("")
|
CargaGrid("")
|
||||||
Else
|
Else
|
||||||
Alert("Ocurrió un error al obtener el catálogo de Notas de Crédito", Extensiones.TipoMensaje.MsgError)
|
Alert("Ocurrió un error al obtener el catálogo de Notas de Crédito", Extensiones.TipoMensaje.MsgError)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
ObjCompras.Dispose()
|
ObjCompras.Dispose()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||||
e.Row.FCHyperLink("HLRazonSocial").NavigateUrl = String.Format("/Compras/Proveedores.aspx?CveProveedor={0}", e.Row.DBCampo("CveProveedor"))
|
e.Row.FCHyperLink("HLRazonSocial").NavigateUrl = String.Format("/Compras/Proveedores.aspx?CveProveedor={0}", e.Row.DBCampo("CveProveedor"))
|
||||||
e.Row.FCHyperLink("HLSerieFolio").NavigateUrl = String.Format("/Compras/Compras.aspx?CveCompra={0}", e.Row.DBCampo("CveCompra"))
|
e.Row.FCHyperLink("HLSerieFolio").NavigateUrl = String.Format("/Compras/Compras.aspx?CveCompra={0}", e.Row.DBCampo("CveCompra"))
|
||||||
|
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
|
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
|
||||||
CargaDatos()
|
CargaDatos()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
|
Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
|
||||||
GvDatos.ExportToExcel("RepNotasCredito." & Now.ToShortDateString)
|
GvDatos.ExportToExcel("RepNotasCredito." & Now.ToShortDateString)
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
Private Sub GenerarPDF(Optional Formato As String = "PDF")
|
Private Sub GenerarPDF(Optional Formato As String = "PDF")
|
||||||
If DtDatos IsNot Nothing Then
|
If DtDatos IsNot Nothing Then
|
||||||
Dim StrFiltro As New StringBuilder
|
Dim StrFiltro As New StringBuilder
|
||||||
'StrFiltro.AppendFormat(String.Format("<b>Proveedor:</b> {0}, <b>Estatus:</b> {1}", DdlProveedores.SelectedItem.Text, DdlOpcion.SelectedItem.Text))
|
'StrFiltro.AppendFormat(String.Format("<b>Proveedor:</b> {0}, <b>Estatus:</b> {1}", DdlProveedores.SelectedItem.Text, DdlOpcion.SelectedItem.Text))
|
||||||
' If DdlTipoComprobante.SelectedValue <> "-1" Then StrFiltro.AppendFormat(" <b>Tipo Documento</b>: {0}", DdlTipoComprobante.SelectedItem.Text)
|
' If DdlTipoComprobante.SelectedValue <> "-1" Then StrFiltro.AppendFormat(" <b>Tipo Documento</b>: {0}", DdlTipoComprobante.SelectedItem.Text)
|
||||||
If DdlProveedores.SelectedValue <> "-1" Then StrFiltro.AppendFormat(" <b>Proveedor:</b> {0}", DdlProveedores.SelectedItem.Text)
|
If DdlProveedores.SelectedValue <> "-1" Then StrFiltro.AppendFormat(" <b>Proveedor:</b> {0}", DdlProveedores.SelectedItem.Text)
|
||||||
If DdlOpcion.SelectedValue <> "-1" Then StrFiltro.AppendFormat(" <b>Estatus:</b> {0}", DdlOpcion.SelectedItem.Text)
|
If DdlOpcion.SelectedValue <> "-1" Then StrFiltro.AppendFormat(" <b>Estatus:</b> {0}", DdlOpcion.SelectedItem.Text)
|
||||||
|
|
||||||
If txtFechaI.Text <> "" Then StrFiltro.AppendFormat(" <b>Fecha Inicio </b>: {0}", txtFechaI.Text.ToDate.ToShortDateString)
|
If txtFechaI.Text <> "" Then StrFiltro.AppendFormat(" <b>Fecha Inicio </b>: {0}", txtFechaI.Text.ToDate.ToShortDateString)
|
||||||
If txtFechaF.Text <> "" Then StrFiltro.AppendFormat(" <b>Fecha Fin </b>: {0}", txtFechaF.Text.ToDate.ToShortDateString)
|
If txtFechaF.Text <> "" Then StrFiltro.AppendFormat(" <b>Fecha Fin </b>: {0}", txtFechaF.Text.ToDate.ToShortDateString)
|
||||||
|
|
||||||
|
|
||||||
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
|
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
|
||||||
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
|
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
|
||||||
'Dim dt As DataTable = DtVentas.FiltraParametros("", "Orden") '.FiltraParametros("Total > 0", DistinctColumns:={"GPO", "Cantidad", "SubTotal", "Descuento", "Amortizacion", "IVA", "Total"})
|
'Dim dt As DataTable = DtVentas.FiltraParametros("", "Orden") '.FiltraParametros("Total > 0", DistinctColumns:={"GPO", "Cantidad", "SubTotal", "Descuento", "Amortizacion", "IVA", "Total"})
|
||||||
Dim FechaI, FechaF As String
|
Dim FechaI, FechaF As String
|
||||||
FechaI = If(txtFechaI.Text = "" Or txtFechaI.Text = "__/__/____", "-1", txtFechaI.Text)
|
FechaI = If(txtFechaI.Text = "" Or txtFechaI.Text = "__/__/____", "-1", txtFechaI.Text)
|
||||||
FechaF = If(txtFechaF.Text = "" Or txtFechaF.Text = "__/__/____", "-1", txtFechaF.Text)
|
FechaF = If(txtFechaF.Text = "" Or txtFechaF.Text = "__/__/____", "-1", txtFechaF.Text)
|
||||||
Dim params As New List(Of ReportParameter)
|
Dim params As New List(Of ReportParameter)
|
||||||
|
|
||||||
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
|
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
|
||||||
params.Add(New ReportParameter("FechaInicio", FechaI))
|
params.Add(New ReportParameter("FechaInicio", FechaI))
|
||||||
params.Add(New ReportParameter("FechaFin", FechaF))
|
params.Add(New ReportParameter("FechaFin", FechaF))
|
||||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
||||||
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
|
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
|
||||||
params.Add(New ReportParameter("Filtros", StrFiltro.ToString))
|
params.Add(New ReportParameter("Filtros", StrFiltro.ToString))
|
||||||
|
|
||||||
If Imagen.Exists Then
|
If Imagen.Exists Then
|
||||||
params.Add(New ReportParameter("LogoPath", logouri))
|
params.Add(New ReportParameter("LogoPath", logouri))
|
||||||
Else
|
Else
|
||||||
params.Add(New ReportParameter("LogoPath", ""))
|
params.Add(New ReportParameter("LogoPath", ""))
|
||||||
End If
|
End If
|
||||||
ImprimirPDF("Empresas/Grales/Formatos/RepNotasCredito.rdlc", DtDatos, params, String.Format("ReporteVentas-{0}", Now.ToDateTime.ToShortDateString), Formato:=Formato)
|
ImprimirPDF("Empresas/Grales/Formatos/RepNotasCredito.rdlc", DtDatos, params, String.Format("ReporteVentas-{0}", Now.ToDateTime.ToShortDateString), Formato:=Formato)
|
||||||
Else
|
Else
|
||||||
Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
|
Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Sub ImgImprimir_Click(sender As Object, e As EventArgs) Handles ImgImprimir.Click
|
Protected Sub ImgImprimir_Click(sender As Object, e As EventArgs) Handles ImgImprimir.Click
|
||||||
GenerarPDF()
|
GenerarPDF()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub LnkHabilitarSaldar_Click(sender As Object, e As EventArgs) Handles LnkHabilitarSaldar.Click
|
Private Sub LnkHabilitarSaldar_Click(sender As Object, e As EventArgs) Handles LnkHabilitarSaldar.Click
|
||||||
For Each gr As GridViewRow In GvDatos.Rows
|
For Each gr As GridViewRow In GvDatos.Rows
|
||||||
If gr.DataKey("CveCompra") <> "" Then
|
If gr.DataKey("CveCompra") <> "" Then
|
||||||
gr.FCCheckBox("Chk").Visible = True
|
gr.FCCheckBox("Chk").Visible = True
|
||||||
HLSaldar.Visible = True
|
HLSaldar.Visible = True
|
||||||
LnkHabilitarSaldar.Visible = False
|
LnkHabilitarSaldar.Visible = False
|
||||||
UpDatos.Update()
|
UpDatos.Update()
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Sub BtnSaldar_Click(sender As Object, e As EventArgs)
|
Protected Sub BtnSaldar_Click(sender As Object, e As EventArgs)
|
||||||
Dim ObjConta As New ClsContabilidad
|
Dim ObjConta As New ClsContabilidad
|
||||||
ObjConta.IniciaTransacSQL()
|
ObjConta.IniciaTransacSQL()
|
||||||
Dim CvePrePoliza As Integer = 0
|
Dim CvePrePoliza As Integer = 0
|
||||||
Dim MsgError As String = ""
|
Dim MsgError As String = ""
|
||||||
Dim IdCtaContable As Integer = 0
|
Dim IdCtaContable As Integer = 0
|
||||||
Dim IdCtaContableComplementaria As Integer = 0
|
Dim IdCtaContableComplementaria As Integer = 0
|
||||||
Dim Importe As Decimal = 0
|
Dim Importe As Decimal = 0
|
||||||
Dim ImporteMN As Decimal = 0
|
Dim ImporteMN As Decimal = 0
|
||||||
Dim ImporteComplementaria As Decimal = 0
|
Dim ImporteComplementaria As Decimal = 0
|
||||||
Dim CveMoneda As Integer = 0
|
Dim CveMoneda As Integer = 0
|
||||||
Dim TC As Decimal = GlobalTipoCambio(TxtFechaSaldar.Text.ToDate).ToDecimal
|
Dim TC As Decimal = GlobalTipoCambio(TxtFechaSaldar.Text.ToDate).ToDecimal
|
||||||
Dim TCCompra As Decimal = 0
|
Dim TCCompra As Decimal = 0
|
||||||
Dim Concepto As String = TxtConcepto.Text
|
Dim Concepto As String = TxtConcepto.Text
|
||||||
Dim UsaComplementaria As Boolean = UsuarioActual.CveEmpresa.Contiene(119)
|
Dim UsaComplementaria As Boolean = UsuarioActual.CveEmpresa.Contiene(119)
|
||||||
Dim MensajeAlert = New StringBuilder
|
Dim MensajeAlert = New StringBuilder
|
||||||
|
|
||||||
For Each gr As GridViewRow In GvDatos.Rows
|
For Each gr As GridViewRow In GvDatos.Rows
|
||||||
If gr.FCCheckBox("Chk").Checked Then
|
If gr.FCCheckBox("Chk").Checked Then
|
||||||
IdCtaContable = 0
|
IdCtaContable = 0
|
||||||
IdCtaContableComplementaria = 0
|
IdCtaContableComplementaria = 0
|
||||||
Importe = gr.DataKey("Saldo").ToDecimal.RoundSQL
|
Importe = gr.DataKey("Saldo").ToDecimal.RoundSQL
|
||||||
ImporteMN = gr.DataKey("Saldo").ToDecimal.RoundSQL
|
ImporteMN = gr.DataKey("Saldo").ToDecimal.RoundSQL
|
||||||
TCCompra = gr.DataKey("TipoCambio").ToDecimal
|
TCCompra = gr.DataKey("TipoCambio").ToDecimal
|
||||||
CveMoneda = gr.DataKey("CveMoneda").ToEntero
|
CveMoneda = gr.DataKey("CveMoneda").ToEntero
|
||||||
|
|
||||||
CvePrePoliza = ObjConta.AddPrePolizas("Compras/RepNotasCredito", 2, gr.DataKey("Saldo").ToDecimal, gr.DataKey("Saldo").ToDecimal, gr.DataKey("CveMoneda").ToEntero, Now, "Saldado manual", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
CvePrePoliza = ObjConta.AddPrePolizas("Compras/RepNotasCredito", 103, gr.DataKey("Saldo").ToDecimal, gr.DataKey("Saldo").ToDecimal, gr.DataKey("CveMoneda").ToEntero, Now, "Saldado manual", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||||
|
|
||||||
If CveMoneda > 1 Then
|
If CveMoneda > 1 Then
|
||||||
IdCtaContable = gr.DataKey("IdCtaContExtranjera").ToEntero
|
IdCtaContable = gr.DataKey("IdCtaContExtranjera").ToEntero
|
||||||
ImporteMN = (gr.DataKey("Saldo").ToDecimal * TCCompra).RoundSQL
|
ImporteMN = (gr.DataKey("Saldo").ToDecimal * TCCompra).RoundSQL
|
||||||
Else
|
Else
|
||||||
IdCtaContable = gr.DataKey("IdCtaContProveedores").ToEntero
|
IdCtaContable = gr.DataKey("IdCtaContProveedores").ToEntero
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, -Importe, "", 18, Concepto, TxtFechaSaldar.Text.ToDate, IdCtaContable, -1, gr.DataKey("CveIE").ToEntero, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CvePersonal:=gr.DataKey("CvePersonal").ToEntero, ImporteMX:=-If(CveMoneda > 1 AndAlso UsaComplementaria, Importe, ImporteMN), ImporteME:=-If(CveMoneda > 1, Importe, 0), CveCompra:=gr.DataKey("CveCompra").ToEntero, CveCompraAmortizacion:=gr.DataKey("CveCompra").ToEntero, TipoCambio:=TCCompra) Then
|
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, -Importe, "", 18, Concepto, TxtFechaSaldar.Text.ToDate, IdCtaContable, -1, gr.DataKey("CveIE").ToEntero, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CvePersonal:=gr.DataKey("CvePersonal").ToEntero, ImporteMX:=-If(CveMoneda > 1 AndAlso UsaComplementaria, Importe, ImporteMN), ImporteME:=-If(CveMoneda > 1, Importe, 0), CveCompra:=gr.DataKey("CveCompra").ToEntero, CveCompraAmortizacion:=gr.DataKey("CveCompra").ToEntero, TipoCambio:=TCCompra) Then
|
||||||
MsgError = "Ocurrio un Error al saldar el movimiento"
|
MsgError = "Ocurrio un Error al saldar el movimiento"
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If UsaComplementaria AndAlso CveMoneda > 1 Then
|
If UsaComplementaria AndAlso CveMoneda > 1 Then
|
||||||
ImporteComplementaria = (Importe * TCCompra - Importe).RoundSQL
|
ImporteComplementaria = (Importe * TCCompra - Importe).RoundSQL
|
||||||
IdCtaContableComplementaria = gr.DataKey("IdCtaContComplementaria").ToEntero
|
IdCtaContableComplementaria = gr.DataKey("IdCtaContComplementaria").ToEntero
|
||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, -ImporteComplementaria, "", 235, Concepto, TxtFechaSaldar.Text.ToDate, IdCtaContableComplementaria, -1, CveCompra:=gr.DataKey("CveCompra").ToEntero, CveCompraAmortizacion:=gr.DataKey("CveCompra").ToEntero, CvePersonal:=gr.DataKey("CvePersonal").ToEntero, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, ImporteMX:=-ImporteComplementaria, ImporteME:=-ImporteComplementaria, TipoCambioPago:=TC, TipoCambio:=TCCompra) Then
|
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, -ImporteComplementaria, "", 235, Concepto, TxtFechaSaldar.Text.ToDate, IdCtaContableComplementaria, -1, CveCompra:=gr.DataKey("CveCompra").ToEntero, CveCompraAmortizacion:=gr.DataKey("CveCompra").ToEntero, CvePersonal:=gr.DataKey("CvePersonal").ToEntero, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, ImporteMX:=-ImporteComplementaria, ImporteME:=-ImporteComplementaria, TipoCambioPago:=TC, TipoCambio:=TCCompra) Then
|
||||||
MsgError = "Ocurrio un Error al saldar el movimiento"
|
MsgError = "Ocurrio un Error al saldar el movimiento"
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(564).ToString.ToEntero
|
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(564).ToString.ToEntero
|
||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Importe, "", 211, Concepto, TxtFechaSaldar.Text.ToDate, IdCtaContable, -1, gr.DataKey("CveIE").ToEntero, ImporteMX:=If(CveMoneda > 1, (Importe * TC), Importe).RoundSQL, CveCuenta:=-1, CveCompra:=gr.DataKey("CveCompra").ToEntero, CveProveedor:=gr.DataKey("CveProveedor").ToEntero) Then
|
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Importe, "", 211, Concepto, TxtFechaSaldar.Text.ToDate, IdCtaContable, -1, gr.DataKey("CveIE").ToEntero, ImporteMX:=If(CveMoneda > 1, (Importe * TC), Importe).RoundSQL, CveCuenta:=-1, CveCompra:=gr.DataKey("CveCompra").ToEntero, CveProveedor:=gr.DataKey("CveProveedor").ToEntero) Then
|
||||||
MsgError = "Ocurrio un Error al saldar el movimiento"
|
MsgError = "Ocurrio un Error al saldar el movimiento"
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If TC <> TCCompra AndAlso CveMoneda > 1 AndAlso UsaComplementaria Then
|
If TC <> TCCompra AndAlso CveMoneda > 1 AndAlso UsaComplementaria Then
|
||||||
Dim difFluctuacion As Decimal = TC - TCCompra
|
Dim difFluctuacion As Decimal = TC - TCCompra
|
||||||
Dim CveConceptoFluctua As Integer = 64 '64.ganacia, 65.perdida
|
Dim CveConceptoFluctua As Integer = 64 '64.ganacia, 65.perdida
|
||||||
Dim TipoMovtoFluctua As Boolean = True
|
Dim TipoMovtoFluctua As Boolean = True
|
||||||
Dim IdCtaContableFluctua As Integer
|
Dim IdCtaContableFluctua As Integer
|
||||||
Dim CveCuenta As Integer = 0
|
Dim CveCuenta As Integer = 0
|
||||||
If difFluctuacion < 0 Then
|
If difFluctuacion < 0 Then
|
||||||
CveConceptoFluctua = 65
|
CveConceptoFluctua = 65
|
||||||
TipoMovtoFluctua = False
|
TipoMovtoFluctua = False
|
||||||
IdCtaContableFluctua = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria
|
IdCtaContableFluctua = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria
|
||||||
CveCuenta = UsuarioActual.Empresa.CveCuentaPerdidaCambiaria
|
CveCuenta = UsuarioActual.Empresa.CveCuentaPerdidaCambiaria
|
||||||
Else
|
Else
|
||||||
CveConceptoFluctua = 64
|
CveConceptoFluctua = 64
|
||||||
TipoMovtoFluctua = True
|
TipoMovtoFluctua = True
|
||||||
IdCtaContableFluctua = UsuarioActual.Empresa.IdCuentaGananciaCambiaria
|
IdCtaContableFluctua = UsuarioActual.Empresa.IdCuentaGananciaCambiaria
|
||||||
CveCuenta = UsuarioActual.Empresa.CveCuentaGananciaCambiaria
|
CveCuenta = UsuarioActual.Empresa.CveCuentaGananciaCambiaria
|
||||||
End If
|
End If
|
||||||
Dim ImporteFluctuacion As Decimal = Math.Abs((Importe * difFluctuacion).RoundSQL)
|
Dim ImporteFluctuacion As Decimal = Math.Abs((Importe * difFluctuacion).RoundSQL)
|
||||||
|
|
||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoFluctua, ImporteFluctuacion, "", CveConceptoFluctua, Concepto, Now, IdCtaContableFluctua, -1, CveCompra:=gr.DataKey("CveCompra").ToEntero, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, ImporteMX:=ImporteFluctuacion, ImporteME:=ImporteFluctuacion, TipoCambio:=TCCompra, TipoCambioPago:=TC, CveCuenta:=CveCuenta) Then
|
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoFluctua, ImporteFluctuacion, "", CveConceptoFluctua, Concepto, Now, IdCtaContableFluctua, -1, CveCompra:=gr.DataKey("CveCompra").ToEntero, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, ImporteMX:=ImporteFluctuacion, ImporteME:=ImporteFluctuacion, TipoCambio:=TCCompra, TipoCambioPago:=TC, CveCuenta:=CveCuenta) Then
|
||||||
MsgError = "Ocurrio un Error al saldar el movimiento"
|
MsgError = "Ocurrio un Error al saldar el movimiento"
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, 5) Then
|
If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, 5) Then
|
||||||
If ObjConta.ValorPolizaDescuadre > 0 Then
|
If ObjConta.ValorPolizaDescuadre > 0 Then
|
||||||
MsgError = ObjConta.MensajePolizaDescuadre
|
MsgError = ObjConta.MensajePolizaDescuadre
|
||||||
GuardaLogAD($"Ventas/Ventas-ProcesoPrePolizas | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
|
GuardaLogAD($"Ventas/Ventas-ProcesoPrePolizas | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(200) = "1" AndAlso MsgError = "" Then
|
If UsuarioActual.Empresa.Funcionalidad(200) = "1" AndAlso MsgError = "" Then
|
||||||
If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then
|
If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then
|
||||||
If MensajeAlert.ToString = "" Then
|
If MensajeAlert.ToString = "" Then
|
||||||
MensajeAlert.AppendFormat("Los siguientes movimientos fueron saldados correctamente: <br/>")
|
MensajeAlert.AppendFormat("Los siguientes movimientos fueron saldados correctamente: <br/>")
|
||||||
End If
|
End If
|
||||||
MensajeAlert.AppendFormat("<ul><li><a Class=""Texto"" href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Poliza {1}</a></li></ul>", ObjConta.ContaIdPoliza, ObjConta.ContaFolio)
|
MensajeAlert.AppendFormat("<ul><li><a Class=""Texto"" href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Poliza {1}</a></li></ul>", ObjConta.ContaIdPoliza, ObjConta.ContaFolio)
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If MsgError <> "" Then Exit For
|
If MsgError <> "" Then Exit For
|
||||||
|
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
|
|
||||||
|
|
||||||
If MsgError = "" Then
|
If MsgError = "" Then
|
||||||
ObjConta.Commit()
|
ObjConta.Commit()
|
||||||
If MensajeAlert.ToString <> "" Then
|
If MensajeAlert.ToString <> "" Then
|
||||||
Alert(MensajeAlert.ToString)
|
Alert(MensajeAlert.ToString)
|
||||||
Else
|
Else
|
||||||
Alert("Los movimientos fueron saldados correctamente.")
|
Alert("Los movimientos fueron saldados correctamente.")
|
||||||
End If
|
End If
|
||||||
Alert(MensajeAlert.ToString)
|
Alert(MensajeAlert.ToString)
|
||||||
CargaDatos()
|
CargaDatos()
|
||||||
HLSaldar.Visible = False
|
HLSaldar.Visible = False
|
||||||
RegistraScript("$('#DivSaldar').modal('hide')")
|
RegistraScript("$('#DivSaldar').modal('hide')")
|
||||||
LnkHabilitarSaldar.Visible = True
|
LnkHabilitarSaldar.Visible = True
|
||||||
Else
|
Else
|
||||||
ObjConta.RollBack()
|
ObjConta.RollBack()
|
||||||
Alert(MsgError, TipoMensaje.MsgError)
|
Alert(MsgError, TipoMensaje.MsgError)
|
||||||
End If
|
End If
|
||||||
ObjConta.Dispose()
|
ObjConta.Dispose()
|
||||||
End Sub
|
End Sub
|
||||||
Protected Sub LnkSaldar_Click(sender As Object, e As EventArgs)
|
Protected Sub LnkSaldar_Click(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
#Region "O R D E N A M I E N T O"
|
#Region "O R D E N A M I E N T O"
|
||||||
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
|
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
|
||||||
Dim Orden As String = ""
|
Dim Orden As String = ""
|
||||||
Dim Campo As String = ""
|
Dim Campo As String = ""
|
||||||
Dim Literal As Literal = Nothing
|
Dim Literal As Literal = Nothing
|
||||||
Const OrdenInicial As String = ""
|
Const OrdenInicial As String = ""
|
||||||
Dim Arg(2) As String
|
Dim Arg(2) As String
|
||||||
|
|
||||||
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
|
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
|
||||||
Campo = Arg(0)
|
Campo = Arg(0)
|
||||||
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(", ", "_")), Literal)
|
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(", ", "_")), Literal)
|
||||||
|
|
||||||
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
|
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
|
||||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
|
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
|
||||||
Literal.Text = String.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>")
|
Literal.Text = String.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>")
|
||||||
Else
|
Else
|
||||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo)
|
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo)
|
||||||
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
|
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
|
||||||
End If
|
End If
|
||||||
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
|
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
|
||||||
ViewState("Orden") = Orden
|
ViewState("Orden") = Orden
|
||||||
CargaGrid(Orden)
|
CargaGrid(Orden)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Sub CargaGrid(Orden As String)
|
Protected Sub CargaGrid(Orden As String)
|
||||||
Dim DV As DataView = Nothing
|
Dim DV As DataView = Nothing
|
||||||
DV = New DataView(DtDatos, "", Orden, DataViewRowState.CurrentRows)
|
DV = New DataView(DtDatos, "", Orden, DataViewRowState.CurrentRows)
|
||||||
If Orden <> String.Empty Then
|
If Orden <> String.Empty Then
|
||||||
GvDatos.DataSource = DV.ToTable()
|
GvDatos.DataSource = DV.ToTable()
|
||||||
Else
|
Else
|
||||||
GvDatos.DataSource = DtDatos
|
GvDatos.DataSource = DtDatos
|
||||||
End If
|
End If
|
||||||
|
|
||||||
GvDatos.DataBind()
|
GvDatos.DataBind()
|
||||||
UpDatos.Update()
|
UpDatos.Update()
|
||||||
DV.Dispose()
|
DV.Dispose()
|
||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -140,12 +140,14 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row" id="trNotificar" runat="server" visible="False">
|
<div class="row" id="trNotificar" runat="server" visible="False">
|
||||||
<label class="col-md-2">Notificar:</label>
|
<label class="col-md-2">Notificar:</label>
|
||||||
<div class="col-md-10">
|
<div class="col-md-10">
|
||||||
<asp:TextBox ID="TxtNotificarA" CssClass="form-control input-sm" runat="server" MaxLength="12" Width="400px" Rows="2" TextMode="MultiLine" ClientIDMode="Static"></asp:TextBox>
|
<asp:TextBox ID="TxtNotificarA" CssClass="form-control input-sm" runat="server" MaxLength="12" Width="400px" Rows="2" TextMode="MultiLine" ClientIDMode="Static"></asp:TextBox>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row" id="trCuentaDeposito" runat="server" visible="False">
|
<div class="row" id="trCuentaDeposito" runat="server" visible="False">
|
||||||
<label class="col-md-2">Cuenta Depósito:</label>
|
<label class="col-md-2">Cuenta Depósito:</label>
|
||||||
<div class="col-md-10">
|
<div class="col-md-10">
|
||||||
|
|||||||
@@ -212,8 +212,14 @@ Partial Class ContabilidadC_RegPrePoliza
|
|||||||
End If
|
End If
|
||||||
Exit Sub
|
Exit Sub
|
||||||
Else
|
Else
|
||||||
|
|
||||||
CreaDT()
|
CreaDT()
|
||||||
BtnEliminar.Visible = False
|
BtnEliminar.Visible = False
|
||||||
|
|
||||||
|
If UsuarioActual.Empresa.UsaAC Then
|
||||||
|
ChkAutoConta.Checked = True
|
||||||
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
@@ -816,7 +822,7 @@ Partial Class ContabilidadC_RegPrePoliza
|
|||||||
Dim Conta As ClsContPAQi = Nothing
|
Dim Conta As ClsContPAQi = Nothing
|
||||||
Dim IDPoliza As Integer = 0
|
Dim IDPoliza As Integer = 0
|
||||||
Dim MsgError As String = ""
|
Dim MsgError As String = ""
|
||||||
Dim CveIE As Integer
|
Dim CveIE As Integer = -1
|
||||||
Dim CveIEInsertado As Integer = -1
|
Dim CveIEInsertado As Integer = -1
|
||||||
Dim FolioIE As String = ""
|
Dim FolioIE As String = ""
|
||||||
|
|
||||||
@@ -889,7 +895,7 @@ Partial Class ContabilidadC_RegPrePoliza
|
|||||||
Next
|
Next
|
||||||
|
|
||||||
'El movimiento 2 es el de Pago
|
'El movimiento 2 es el de Pago
|
||||||
If ChkAutoConta.Checked AndAlso UsuarioActual.Empresa.Funcionalidad(200) = "1" AndAlso MsgError = "" Then
|
If ChkAutoConta.Checked AndAlso MsgError = "" Or UsuarioActual.Empresa.Funcionalidad(200) = "1" And MsgError = "" Then
|
||||||
If idCuentaContabilizacion > 0 Then
|
If idCuentaContabilizacion > 0 Then
|
||||||
If ObjMov.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then
|
If ObjMov.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then
|
||||||
|
|
||||||
@@ -925,7 +931,7 @@ Partial Class ContabilidadC_RegPrePoliza
|
|||||||
|
|
||||||
If MsgError = "" Then
|
If MsgError = "" Then
|
||||||
'MENSAJE IE
|
'MENSAJE IE
|
||||||
If CveIE Then
|
If CveIE > 0 Then
|
||||||
MensajeAlert.AppendFormat("<br/><br/>Folio Bancario: <b><a href = ""/Bancos/IE.aspx?CveIE={0}"" class=""texto"" target=""_blank"" >{1}</a></b>", CveIE, FolioIE)
|
MensajeAlert.AppendFormat("<br/><br/>Folio Bancario: <b><a href = ""/Bancos/IE.aspx?CveIE={0}"" class=""texto"" target=""_blank"" >{1}</a></b>", CveIE, FolioIE)
|
||||||
Alert(MensajeAlert.ToString, ModExtensiones.TipoMensaje.MsgInformacion, "window.location.reload()")
|
Alert(MensajeAlert.ToString, ModExtensiones.TipoMensaje.MsgInformacion, "window.location.reload()")
|
||||||
Else
|
Else
|
||||||
|
|||||||
@@ -1,267 +1,268 @@
|
|||||||
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepIVA.aspx.cs" Inherits="Contabilidad_RepIVA" %>
|
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepIVA.aspx.cs" Inherits="Contabilidad_RepIVA" %>
|
||||||
|
|
||||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||||
<style>
|
<style>
|
||||||
.truncate2 {
|
.truncate2 {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
max-width:100px;
|
max-width:100px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||||
Reporte de Impuestos
|
Reporte de Impuestos
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||||
<li>
|
<li>
|
||||||
<asp:LinkButton ID="LnkPdf" OnClick="LnkPdf_Click" runat="server"> <i class="fa fa-file-pdf-o" style="font-weight:bold;"></i> PDF</asp:LinkButton>
|
<asp:LinkButton ID="LnkPdf" OnClick="LnkPdf_Click" runat="server"> <i class="fa fa-file-pdf-o" style="font-weight:bold;"></i> PDF</asp:LinkButton>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<asp:LinkButton ID="LnkExcel" OnClick="LnkExcel_Click" runat="server"><i class="fa fa-file-excel-o" style="font-weight:bold;"></i> Excel</asp:LinkButton>
|
<asp:LinkButton ID="LnkExcel" OnClick="LnkExcel_Click" runat="server"><i class="fa fa-file-excel-o" style="font-weight:bold;"></i> Excel</asp:LinkButton>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<asp:HyperLink NavigateUrl="javascript:;" data-toggle="modal" data-target="#DivTipoCambio" ID="ImgTipoCambio" runat="server"> <i class="fa fa-money"></i> Ver Dlls en pesos</asp:HyperLink>
|
<asp:HyperLink NavigateUrl="javascript:;" data-toggle="modal" data-target="#DivTipoCambio" ID="ImgTipoCambio" runat="server"> <i class="fa fa-money"></i> Ver Dlls en pesos</asp:HyperLink>
|
||||||
</li>
|
</li>
|
||||||
<asp:UpdatePanel runat="server" ID="UpAccionesDIOT" UpdateMode="Conditional" >
|
<asp:UpdatePanel runat="server" ID="UpAccionesDIOT" UpdateMode="Conditional" >
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
<asp:LinkButton ID="LnkAccionesDIOT" OnClick="LnkAccionesDIOT_Click" runat="server" Visible="false"> <i class="fa fa-file-pdf-o" style="font-weight:bold;"></i> Generar DIOT</asp:LinkButton>
|
<asp:LinkButton ID="LnkAccionesDIOT" OnClick="LnkAccionesDIOT_Click" runat="server" Visible="false"> <i class="fa fa-file-pdf-o" style="font-weight:bold;"></i> Generar DIOT</asp:LinkButton>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
<Triggers>
|
<Triggers>
|
||||||
<asp:PostBackTrigger ControlID="LnkAccionesDIOT" />
|
<asp:PostBackTrigger ControlID="LnkAccionesDIOT" />
|
||||||
</Triggers>
|
</Triggers>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||||
<asp:UpdatePanel ID="UPPFiltros" runat="server" UpdateMode="Conditional">
|
<asp:UpdatePanel ID="UPPFiltros" runat="server" UpdateMode="Conditional">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
<div class="portlet solid grey-cascade portlet-filter">
|
<div class="portlet solid grey-cascade portlet-filter">
|
||||||
<div class="portlet-title portlet-filterT smalltitle">
|
<div class="portlet-title portlet-filterT smalltitle">
|
||||||
<div class="tools">
|
<div class="tools">
|
||||||
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" OnClick="BtnConsultar_Click" CssClass="btn btn-primary" />
|
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" OnClick="BtnConsultar_Click" CssClass="btn btn-primary" />
|
||||||
</div>
|
</div>
|
||||||
<div class="titlefiltros caption ">
|
<div class="titlefiltros caption ">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<label class="col-md-1 truncate">Fecha Inicio:</label>
|
<label class="col-md-1 truncate">Fecha Inicio:</label>
|
||||||
<div class="col-md-2">
|
<div class="col-md-2">
|
||||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
|
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
|
||||||
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control" Width="99%" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control" Width="99%" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||||
<span class="input-group-btn ">
|
<span class="input-group-btn ">
|
||||||
<asp:LinkButton ID="ImgCalendarioI" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
<asp:LinkButton ID="ImgCalendarioI" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||||
</span>
|
</span>
|
||||||
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||||
<ajax:CalendarExtender runat="server" ID="CalendarExtender1" TargetControlID="txtFechaI" PopupButtonID="ImgCalendarioI" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
<ajax:CalendarExtender runat="server" ID="CalendarExtender1" TargetControlID="txtFechaI" PopupButtonID="ImgCalendarioI" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||||
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
||||||
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||||
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||||
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<label class="col-md-1 truncate">Fecha Fin:</label>
|
<label class="col-md-1 truncate">Fecha Fin:</label>
|
||||||
<div class="col-md-2">
|
<div class="col-md-2">
|
||||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
|
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
|
||||||
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control" Width="99%" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control" Width="99%" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||||
<span class="input-group-btn ">
|
<span class="input-group-btn ">
|
||||||
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||||
</span>
|
</span>
|
||||||
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||||
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||||
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
||||||
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||||
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||||
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<label class="col-md-1 truncate">Tipo Movto:</label>
|
<label class="col-md-1 truncate">Tipo Movto:</label>
|
||||||
<div class="col-md-2">
|
<div class="col-md-2">
|
||||||
<asp:DropDownList ID="DdlTipoMovto" runat="server">
|
<asp:DropDownList ID="DdlTipoMovto" runat="server">
|
||||||
<asp:ListItem Text="Todos" Value="-1"></asp:ListItem>
|
<asp:ListItem Text="Todos" Value="-1"></asp:ListItem>
|
||||||
<asp:ListItem Text="Conciliados" Value="1"></asp:ListItem>
|
<asp:ListItem Text="Conciliados" Value="1"></asp:ListItem>
|
||||||
</asp:DropDownList>
|
</asp:DropDownList>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="portlet-body">
|
<div class="portlet-body">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
|
|
||||||
<ajax:TabContainer ID="TT" runat="server" ActiveTabIndex="0" Width="100%">
|
<ajax:TabContainer ID="TT" runat="server" ActiveTabIndex="0" Width="100%">
|
||||||
<ajax:TabPanel ID="TTr" runat="server" HeaderText="IVA Trasladado">
|
<ajax:TabPanel ID="TTr" runat="server" HeaderText="IVA Trasladado">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
|
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
|
|
||||||
<h4><b>IVA Trasladado</b></h4>
|
<h4><b>IVA Trasladado</b></h4>
|
||||||
<asp:GridView ID="GvT" runat="server" EmptyDataText="No se encontraron datos con los filtros seleccionados" OnRowDataBound="GvIVATrasladado_RowDataBound" CssClass="table table-hover table-striped ScrollAD mysmallbtn" data-sort="true" Width="99%" GridLines="None" AutoGenerateColumns="false">
|
<asp:GridView ID="GvT" runat="server" EmptyDataText="No se encontraron datos con los filtros seleccionados" OnRowDataBound="GvIVATrasladado_RowDataBound" CssClass="table table-hover table-striped ScrollAD mysmallbtn" data-sort="true" Width="99%" GridLines="None" AutoGenerateColumns="false">
|
||||||
<Columns>
|
<Columns>
|
||||||
<asp:BoundField HeaderText="Docto" DataField="TipoDocto" ItemStyle-HorizontalAlign="Center" />
|
<asp:BoundField HeaderText="Docto" DataField="TipoDocto" ItemStyle-HorizontalAlign="Center" />
|
||||||
<asp:BoundField HeaderText="Fecha Documento" DataField="FechaDocumento" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" />
|
<asp:BoundField HeaderText="Fecha Documento" DataField="FechaDocumento" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" />
|
||||||
<asp:HyperLinkField DataTextField="SerieFolio" DataNavigateUrlFields="CveVenta" Target="_blank" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" HeaderText="Folio" ControlStyle-Width="85px" />
|
<asp:HyperLinkField DataTextField="SerieFolio" DataNavigateUrlFields="CveVenta" Target="_blank" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" HeaderText="Folio" ControlStyle-Width="85px" />
|
||||||
<asp:BoundField HeaderText="SubTotal" DataField="SubTotal" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
<asp:BoundField HeaderText="SubTotal" DataField="SubTotal" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||||
<asp:BoundField HeaderText="IVA" DataField="IVA" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
<asp:BoundField HeaderText="IVA" DataField="IVA" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||||
<asp:BoundField HeaderText="%IVA" DataField="PorcentajeIVA" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
<asp:BoundField HeaderText="%IVA" DataField="PorcentajeIVA" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||||
<asp:BoundField HeaderText="IEPS" DataField="IEPS" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
<asp:BoundField HeaderText="IEPS" DataField="IEPS" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||||
<asp:BoundField HeaderText="RetIVA" DataField="RetIVA" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
<asp:BoundField HeaderText="RetIVA" DataField="RetIVA" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||||
<asp:BoundField HeaderText="RetISR" DataField="RetISR" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
<asp:BoundField HeaderText="RetISR" DataField="RetISR" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||||
<asp:BoundField HeaderText="Total" DataField="Total" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
<asp:BoundField HeaderText="Total" DataField="Total" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||||
|
|
||||||
|
|
||||||
<asp:HyperLinkField HeaderText="Cliente" DataNavigateUrlFields="CveCliente" DataNavigateUrlFormatString="/Ventas/Clientes.aspx?CveCliente={0}" DataTextField="Nombre" ControlStyle-CssClass="truncate2" />
|
<asp:HyperLinkField HeaderText="Cliente" DataNavigateUrlFields="CveCliente" DataNavigateUrlFormatString="/Ventas/Clientes.aspx?CveCliente={0}" DataTextField="Nombre" ControlStyle-CssClass="truncate2" />
|
||||||
<asp:HyperLinkField HeaderText="Folio Bancario" DataNavigateUrlFields="CveIE" DataNavigateUrlFormatString="/Bancos/IE.aspx?CveIE={0}" DataTextField="FolioIE" Target="_blank" />
|
<asp:HyperLinkField HeaderText="Folio Bancario" DataNavigateUrlFields="CveIE" DataNavigateUrlFormatString="/Bancos/IE.aspx?CveIE={0}" DataTextField="FolioIE" Target="_blank" />
|
||||||
|
|
||||||
<asp:BoundField HeaderText="Num. Cuenta" DataField="NumCuenta" ItemStyle-CssClass="truncate2" />
|
<asp:BoundField HeaderText="Num. Cuenta" DataField="NumCuenta" ItemStyle-CssClass="truncate2" />
|
||||||
</Columns>
|
</Columns>
|
||||||
</asp:GridView>
|
</asp:GridView>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
<div id="DvTipo" class="col-md-6">
|
<div id="DvTipo" class="col-md-6">
|
||||||
<h4><b>IEPS por Porcentaje</b></h4>
|
<h4><b>IEPS por Porcentaje</b></h4>
|
||||||
<asp:GridView ID="GvIEPSA" runat="server" EmptyDataText="" CssClass="table table-hover table-striped ScrollAD mysmallbtn" data-sort="true" Width="400px" GridLines="None" AutoGenerateColumns="false">
|
<asp:GridView ID="GvIEPSA" runat="server" EmptyDataText="" CssClass="table table-hover table-striped ScrollAD mysmallbtn" data-sort="true" Width="400px" GridLines="None" AutoGenerateColumns="false">
|
||||||
<Columns>
|
<Columns>
|
||||||
<asp:BoundField HeaderText="Porcentaje" DataField="PorcentajeIEPS" />
|
<asp:BoundField HeaderText="Porcentaje" DataField="PorcentajeIEPS" />
|
||||||
<asp:BoundField HeaderText="Categoria" DataField="Categoria" />
|
<asp:BoundField HeaderText="Categoria" DataField="Categoria" />
|
||||||
<asp:BoundField HeaderText="IEPS" DataField="IEPS" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
<asp:BoundField HeaderText="IEPS" DataField="IEPS" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||||
<asp:BoundField HeaderText="Base" DataField="Base" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
<asp:BoundField HeaderText="Base" DataField="Base" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||||
|
|
||||||
</Columns>
|
</Columns>
|
||||||
</asp:GridView>
|
</asp:GridView>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<h4><b>IVA por Porcentaje</b></h4>
|
<h4><b>IVA por Porcentaje</b></h4>
|
||||||
<asp:GridView ID="GvIVAA" runat="server" EmptyDataText="" CssClass="table table-hover table-striped ScrollAD mysmallbtn" data-sort="true" Width="400px" GridLines="None" AutoGenerateColumns="false">
|
<asp:GridView ID="GvIVAA" runat="server" EmptyDataText="" CssClass="table table-hover table-striped ScrollAD mysmallbtn" data-sort="true" Width="400px" GridLines="None" AutoGenerateColumns="false">
|
||||||
<Columns>
|
<Columns>
|
||||||
<asp:BoundField HeaderText="Porcentaje" DataField="PorcentajeIVA" />
|
<asp:BoundField HeaderText="Porcentaje" DataField="PorcentajeIVA" />
|
||||||
<asp:BoundField HeaderText="IVA" DataField="IVA" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
<asp:BoundField HeaderText="IVA" DataField="IVA" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||||
<asp:BoundField HeaderText="Base" DataField="Base" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
<asp:BoundField HeaderText="Base" DataField="Base" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||||
|
|
||||||
</Columns>
|
</Columns>
|
||||||
</asp:GridView>
|
</asp:GridView>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</ajax:TabPanel>
|
</ajax:TabPanel>
|
||||||
|
|
||||||
<ajax:TabPanel ID="TA" runat="server" HeaderText="IVA Acreditable">
|
<ajax:TabPanel ID="TA" runat="server" HeaderText="IVA Acreditable">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
<h4><b>IVA Acreditable</b></h4>
|
<h4><b>IVA Acreditable</b></h4>
|
||||||
<asp:GridView ID="GvA" runat="server" EmptyDataText="No se encontraron datos con los filtros seleccionados" OnRowDataBound="GvIVAAcreditable_RowDataBound" CssClass="table table-hover table-striped ScrollAD mysmallbtn" data-sort="true" Width="99%" GridLines="None" AutoGenerateColumns="false">
|
<asp:Label ID="LblMsgAcreditable" runat="server" Text="" ForeColor="Red"></asp:Label>
|
||||||
<Columns>
|
<asp:GridView ID="GvA" runat="server" EmptyDataText="No se encontraron datos con los filtros seleccionados" OnRowDataBound="GvIVAAcreditable_RowDataBound" CssClass="table table-hover table-striped ScrollAD mysmallbtn" data-sort="true" Width="99%" GridLines="None" AutoGenerateColumns="false">
|
||||||
<asp:BoundField HeaderText="Docto" DataField="TipoDocto" ItemStyle-HorizontalAlign="Center" />
|
<Columns>
|
||||||
<asp:BoundField HeaderText="RFC" DataField="RFC" ItemStyle-HorizontalAlign="Center" />
|
<asp:BoundField HeaderText="Docto" DataField="TipoDocto" ItemStyle-HorizontalAlign="Center" />
|
||||||
<asp:HyperLinkField HeaderText="Proveedor" DataNavigateUrlFields="CveProveedor" DataNavigateUrlFormatString="/Compras/Proveedores.aspx?CveProveedor={0}" DataTextField="RazonSocial" ControlStyle-CssClass="truncate2" />
|
<asp:BoundField HeaderText="RFC" DataField="RFC" ItemStyle-HorizontalAlign="Center" />
|
||||||
<asp:BoundField HeaderText="Fecha Documento" DataField="FechaDocumento" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" />
|
<asp:HyperLinkField HeaderText="Proveedor" DataNavigateUrlFields="CveProveedor" DataNavigateUrlFormatString="/Compras/Proveedores.aspx?CveProveedor={0}" DataTextField="RazonSocial" ControlStyle-CssClass="truncate2" />
|
||||||
<asp:HyperLinkField DataTextField="SerieFolio" DataNavigateUrlFields="CveCompra" Target="_blank" DataNavigateUrlFormatString="/Compras/Compras.aspx?CveCompra={0}" HeaderText="Folio" />
|
<asp:BoundField HeaderText="Fecha Documento" DataField="FechaDocumento" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" />
|
||||||
<asp:BoundField HeaderText="SubTotal 16%" DataField="valorActos1516" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
<asp:HyperLinkField DataTextField="SerieFolio" DataNavigateUrlFields="CveCompra" Target="_blank" DataNavigateUrlFormatString="/Compras/Compras.aspx?CveCompra={0}" HeaderText="Folio" />
|
||||||
<asp:BoundField HeaderText="SubTotal 8%" DataField="valorActosImp8" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
<asp:BoundField HeaderText="SubTotal 16%" DataField="valorActos1516" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||||
<asp:BoundField HeaderText="SubTotal 0%" DataField="valorActosImp0" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
<asp:BoundField HeaderText="SubTotal 8%" DataField="valorActosImp8" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||||
<asp:BoundField HeaderText="IVA" DataField="IVA" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
<asp:BoundField HeaderText="SubTotal 0%" DataField="valorActosImp0" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||||
<asp:BoundField HeaderText="%IVA" DataField="PorcentajeIVA" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
<asp:BoundField HeaderText="IVA" DataField="IVA" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||||
<asp:BoundField HeaderText="IEPS" DataField="IEPS" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
<asp:BoundField HeaderText="%IVA" DataField="PorcentajeIVA" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||||
<asp:TemplateField ItemStyle-HorizontalAlign="Right">
|
<asp:BoundField HeaderText="IEPS" DataField="IEPS" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||||
<HeaderTemplate>
|
<asp:TemplateField ItemStyle-HorizontalAlign="Right">
|
||||||
<asp:Label ID="LblHRetIVAHon" data-toggle="tooltip" data-placement="top" ToolTip="Ret IVA Honorario/Serv. Prof." runat="server">RetIVA <br/>Hon/Ser.Prof.</asp:Label>
|
<HeaderTemplate>
|
||||||
</HeaderTemplate>
|
<asp:Label ID="LblHRetIVAHon" data-toggle="tooltip" data-placement="top" ToolTip="Ret IVA Honorario/Serv. Prof." runat="server">RetIVA <br/>Hon/Ser.Prof.</asp:Label>
|
||||||
<ItemTemplate>
|
</HeaderTemplate>
|
||||||
<asp:Label ID="LblRetIVAHon" runat="server" Text='<%# Eval("RetIVAHonorario", "{0:N2}") %>'></asp:Label>
|
<ItemTemplate>
|
||||||
</ItemTemplate>
|
<asp:Label ID="LblRetIVAHon" runat="server" Text='<%# Eval("RetIVAHonorario", "{0:N2}") %>'></asp:Label>
|
||||||
</asp:TemplateField>
|
</ItemTemplate>
|
||||||
<asp:BoundField HeaderText="RetIVA <br/> Fletes P.F" HtmlEncode="False" DataField="RetIVAFletePF" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
</asp:TemplateField>
|
||||||
<asp:BoundField HeaderText="RetIVA <br/> Fletes P.M." HtmlEncode="False" DataField="RetIVAFletePM" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
<asp:BoundField HeaderText="RetIVA <br/> Fletes P.F" HtmlEncode="False" DataField="RetIVAFletePF" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||||
<asp:BoundField HeaderText="RetIVA <br/> Arrenda." HtmlEncode="False" DataField="RetIVAArrend" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
<asp:BoundField HeaderText="RetIVA <br/> Fletes P.M." HtmlEncode="False" DataField="RetIVAFletePM" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||||
|
<asp:BoundField HeaderText="RetIVA <br/> Arrenda." HtmlEncode="False" DataField="RetIVAArrend" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||||
<asp:BoundField HeaderText="RetISR <br/> Honorario" HtmlEncode="False" DataField="RetISR" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
|
||||||
<asp:BoundField HeaderText="RetISR <br/> Arrendamiento" HtmlEncode="False" DataField="RetISRArrend" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
<asp:BoundField HeaderText="RetISR <br/> Honorario" HtmlEncode="False" DataField="RetISR" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||||
<asp:BoundField HeaderText="Total" DataField="Total" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
<asp:BoundField HeaderText="RetISR <br/> Arrendamiento" HtmlEncode="False" DataField="RetISRArrend" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||||
|
<asp:BoundField HeaderText="Total" DataField="Total" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||||
<%-- <asp:BoundField HeaderText="IEPS 3%" DataField="IEPS3" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
|
||||||
<asp:BoundField HeaderText="IEPS 6%" DataField="IEPS6" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
<%-- <asp:BoundField HeaderText="IEPS 3%" DataField="IEPS3" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||||
<asp:BoundField HeaderText="IEPS 7%" DataField="IEPS7" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
<asp:BoundField HeaderText="IEPS 6%" DataField="IEPS6" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||||
<asp:BoundField HeaderText="IEPS 9%" DataField="IEPS9" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />--%>
|
<asp:BoundField HeaderText="IEPS 7%" DataField="IEPS7" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||||
|
<asp:BoundField HeaderText="IEPS 9%" DataField="IEPS9" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />--%>
|
||||||
|
|
||||||
<asp:HyperLinkField HeaderText="Folio Bancario" DataNavigateUrlFields="CveIE" DataNavigateUrlFormatString="/Bancos/IE.aspx?CveIE={0}" DataTextField="FolioIE" Target="_blank" />
|
|
||||||
|
<asp:HyperLinkField HeaderText="Folio Bancario" DataNavigateUrlFields="CveIE" DataNavigateUrlFormatString="/Bancos/IE.aspx?CveIE={0}" DataTextField="FolioIE" Target="_blank" />
|
||||||
<asp:BoundField HeaderText="Num. Cuenta" DataField="NumCuenta" ItemStyle-CssClass ="truncate2"/>
|
|
||||||
</Columns>
|
<asp:BoundField HeaderText="Num. Cuenta" DataField="NumCuenta" ItemStyle-CssClass ="truncate2"/>
|
||||||
</asp:GridView>
|
</Columns>
|
||||||
|
</asp:GridView>
|
||||||
<div class="row">
|
|
||||||
<h4><b>IVA por Porcentaje</b></h4>
|
<div class="row">
|
||||||
<asp:GridView ID="GvIVA2" runat="server" EmptyDataText="" CssClass="table table-hover table-striped ScrollAD mysmallbtn" data-sort="true" Width="400px" GridLines="None" AutoGenerateColumns="false">
|
<h4><b>IVA por Porcentaje</b></h4>
|
||||||
<Columns>
|
<asp:GridView ID="GvIVA2" runat="server" EmptyDataText="" CssClass="table table-hover table-striped ScrollAD mysmallbtn" data-sort="true" Width="400px" GridLines="None" AutoGenerateColumns="false">
|
||||||
<asp:BoundField HeaderText="Porcentaje" DataField="PorcentajeIVA" />
|
<Columns>
|
||||||
<asp:BoundField HeaderText="IVA" DataField="IVA" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
<asp:BoundField HeaderText="Porcentaje" DataField="PorcentajeIVA" />
|
||||||
<asp:BoundField HeaderText="Base" DataField="Base" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
<asp:BoundField HeaderText="IVA" DataField="IVA" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||||
|
<asp:BoundField HeaderText="Base" DataField="Base" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||||
</Columns>
|
|
||||||
</asp:GridView>
|
</Columns>
|
||||||
</div>
|
</asp:GridView>
|
||||||
|
</div>
|
||||||
</ContentTemplate>
|
|
||||||
</ajax:TabPanel>
|
</ContentTemplate>
|
||||||
</ajax:TabContainer>
|
</ajax:TabPanel>
|
||||||
|
</ajax:TabContainer>
|
||||||
</ContentTemplate>
|
|
||||||
</asp:UpdatePanel>
|
</ContentTemplate>
|
||||||
<asp:UpdatePanel runat="server" ID="UpTipoCambio" UpdateMode="Conditional">
|
</asp:UpdatePanel>
|
||||||
<ContentTemplate>
|
<asp:UpdatePanel runat="server" ID="UpTipoCambio" UpdateMode="Conditional">
|
||||||
<div id="DivTipoCambio" class="modal fade" role="dialog">
|
<ContentTemplate>
|
||||||
<div class="modal-dialog">
|
<div id="DivTipoCambio" class="modal fade" role="dialog">
|
||||||
<div class="modal-content">
|
<div class="modal-dialog">
|
||||||
<div class="modal-header">
|
<div class="modal-content">
|
||||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
<div class="modal-header">
|
||||||
<h4 class="modal-title">
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||||
<asp:Label ID="Label2" runat="server" ClientIDMode="Static" Text="Cambiar Tipo Cambio de Dólares"></asp:Label>
|
<h4 class="modal-title">
|
||||||
</h4>
|
<asp:Label ID="Label2" runat="server" ClientIDMode="Static" Text="Cambiar Tipo Cambio de Dólares"></asp:Label>
|
||||||
</div>
|
</h4>
|
||||||
<div class="modal-body">
|
</div>
|
||||||
<asp:UpdatePanel runat="server" ID="UpBodyTipoCambio" UpdateMode="Conditional">
|
<div class="modal-body">
|
||||||
<ContentTemplate>
|
<asp:UpdatePanel runat="server" ID="UpBodyTipoCambio" UpdateMode="Conditional">
|
||||||
<asp:RadioButtonList runat="server" ID="RblTipoCambio" OnSelectedIndexChanged="RblTipoCambio_SelectedIndexChanged" AutoPostBack="true">
|
<ContentTemplate>
|
||||||
<asp:ListItem Selected="true" Text="Moneda Original" Value="1"></asp:ListItem>
|
<asp:RadioButtonList runat="server" ID="RblTipoCambio" OnSelectedIndexChanged="RblTipoCambio_SelectedIndexChanged" AutoPostBack="true">
|
||||||
<asp:ListItem Text="Dólares en Tipo Cambio de la Fecha Venta" Value="2"></asp:ListItem>
|
<asp:ListItem Selected="true" Text="Moneda Original" Value="1"></asp:ListItem>
|
||||||
<asp:ListItem Text="Tipo Cambio Especifico" Value="3"></asp:ListItem>
|
<asp:ListItem Text="Dólares en Tipo Cambio de la Fecha Venta" Value="2"></asp:ListItem>
|
||||||
</asp:RadioButtonList>
|
<asp:ListItem Text="Tipo Cambio Especifico" Value="3"></asp:ListItem>
|
||||||
<div class="row" style="margin-left: 10px;" runat="server" id="LiEspecifico" visible="false">
|
</asp:RadioButtonList>
|
||||||
Especifico:
|
<div class="row" style="margin-left: 10px;" runat="server" id="LiEspecifico" visible="false">
|
||||||
<asp:TextBox ID="TxtEspecifico" runat="server" Width="55px" />
|
Especifico:
|
||||||
</div>
|
<asp:TextBox ID="TxtEspecifico" runat="server" Width="55px" />
|
||||||
</ContentTemplate>
|
</div>
|
||||||
</asp:UpdatePanel>
|
</ContentTemplate>
|
||||||
</div>
|
</asp:UpdatePanel>
|
||||||
<div class="modal-footer">
|
</div>
|
||||||
<asp:Button ID="BtnTipoCambio" runat="server" OnClick="BtnTipoCambio_Click" Text="Aceptar" class="btn btn-primary" />
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
|
<asp:Button ID="BtnTipoCambio" runat="server" OnClick="BtnTipoCambio_Click" Text="Aceptar" class="btn btn-primary" />
|
||||||
</div>
|
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ContentTemplate>
|
</div>
|
||||||
</asp:UpdatePanel>
|
</ContentTemplate>
|
||||||
</asp:Content>
|
</asp:UpdatePanel>
|
||||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
</asp:Content>
|
||||||
</asp:Content>
|
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||||
|
</asp:Content>
|
||||||
|
|
||||||
|
|||||||
@@ -1,307 +1,316 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
using System.Web.UI.WebControls;
|
using System.Web.UI.WebControls;
|
||||||
using Extensiones;
|
using Extensiones;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using static Extensiones.ModExtensiones;
|
using static Extensiones.ModExtensiones;
|
||||||
using Microsoft.Reporting.WebForms;
|
using Microsoft.Reporting.WebForms;
|
||||||
using System.Activities.Expressions;
|
using System.Activities.Expressions;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
public partial class Contabilidad_RepIVA : ClsPaginas
|
public partial class Contabilidad_RepIVA : ClsPaginas
|
||||||
{
|
{
|
||||||
#region PROPIEDADES
|
#region PROPIEDADES
|
||||||
|
|
||||||
private DataTable DtIVATrasladado
|
private DataTable DtIVATrasladado
|
||||||
{
|
{
|
||||||
get { return DtIVATrasladado = (DataTable)ViewState["DtIVATrasladado"]; }
|
get { return DtIVATrasladado = (DataTable)ViewState["DtIVATrasladado"]; }
|
||||||
set { ViewState["DtIVATrasladado"] = value; }
|
set { ViewState["DtIVATrasladado"] = value; }
|
||||||
}
|
}
|
||||||
private DataTable DtIVAAcreditable
|
private DataTable DtIVAAcreditable
|
||||||
{
|
{
|
||||||
get { return DtIVAAcreditable = (DataTable)ViewState["DtIVAAcreditable"]; }
|
get { return DtIVAAcreditable = (DataTable)ViewState["DtIVAAcreditable"]; }
|
||||||
set { ViewState["DtIVAAcreditable"] = value; }
|
set { ViewState["DtIVAAcreditable"] = value; }
|
||||||
}
|
}
|
||||||
private double TCEspecifico
|
private double TCEspecifico
|
||||||
{
|
{
|
||||||
get { return TCEspecifico = (double)ViewState["TCEspecifico"]; }
|
get { return TCEspecifico = (double)ViewState["TCEspecifico"]; }
|
||||||
set { ViewState["TCEspecifico"] = value; }
|
set { ViewState["TCEspecifico"] = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
private int TipoCambio
|
private int TipoCambio
|
||||||
{
|
{
|
||||||
get { return TipoCambio = (int)ViewState["TipoCambio"]; }
|
get { return TipoCambio = (int)ViewState["TipoCambio"]; }
|
||||||
set { ViewState["TipoCambio"] = value; }
|
set { ViewState["TipoCambio"] = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
protected void Page_Load(object sender, EventArgs e)
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (!IsPostBack)
|
if (!IsPostBack)
|
||||||
{
|
{
|
||||||
InicializaValores();
|
InicializaValores();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void InicializaValores()
|
public void InicializaValores()
|
||||||
{
|
{
|
||||||
TipoCambio = 1;
|
TipoCambio = 1;
|
||||||
TCEspecifico = -1;
|
TCEspecifico = -1;
|
||||||
txtFechaI.Text = $"01/{DateTime.Now.Month}/{DateTime.Now.Year}";
|
txtFechaI.Text = $"01/{DateTime.Now.Month}/{DateTime.Now.Year}";
|
||||||
txtFechaF.Text = DateTime.Now.ToShortDateString();
|
txtFechaF.Text = DateTime.Now.ToShortDateString();
|
||||||
|
|
||||||
LnkAccionesDIOT.Visible = true;
|
LnkAccionesDIOT.Visible = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Consulta()
|
public void Consulta()
|
||||||
{
|
{
|
||||||
if (TipoCambio == 3 && TxtEspecifico.Text != "") { TCEspecifico = TxtEspecifico.Text.ToDouble(); } else { TCEspecifico = -1; }
|
if (TipoCambio == 3 && TxtEspecifico.Text != "") { TCEspecifico = TxtEspecifico.Text.ToDouble(); } else { TCEspecifico = -1; }
|
||||||
int Conciliado = DdlTipoMovto.SelectedValue.ToEntero();
|
int Conciliado = DdlTipoMovto.SelectedValue.ToEntero();
|
||||||
|
LblMsgAcreditable.Text = ""; // lbl de mensajes de negativos
|
||||||
ClsContabilidad ObjCont = new ClsContabilidad();
|
|
||||||
if (ObjCont.GetRepIVA(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), 1, UsuarioActual.CveUsuario, Conciliado, UsuarioActual.CveEmpresa, TipoCambio, TCEspecifico))
|
ClsContabilidad ObjCont = new ClsContabilidad();
|
||||||
{
|
if (ObjCont.GetRepIVA(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), 1, UsuarioActual.CveUsuario, Conciliado, UsuarioActual.CveEmpresa, TipoCambio, TCEspecifico))
|
||||||
GvT.DataSource = ObjCont.DtResultados;
|
{
|
||||||
DtIVATrasladado = ObjCont.DtResultados;
|
GvT.DataSource = ObjCont.DtResultados;
|
||||||
if (ObjCont.GetRepIVAAcumulado(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), Conciliado, 1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
|
DtIVATrasladado = ObjCont.DtResultados;
|
||||||
{
|
if (ObjCont.GetRepIVAAcumulado(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), Conciliado, 1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
|
||||||
GvIEPSA.DataSource = ObjCont.DtResultados;
|
{
|
||||||
}
|
GvIEPSA.DataSource = ObjCont.DtResultados;
|
||||||
|
}
|
||||||
if (ObjCont.GetRepIVAAcumulado(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), Conciliado, 2, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
|
|
||||||
{
|
if (ObjCont.GetRepIVAAcumulado(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), Conciliado, 2, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
|
||||||
GvIVAA.DataSource = ObjCont.DtResultados;
|
{
|
||||||
}
|
GvIVAA.DataSource = ObjCont.DtResultados;
|
||||||
|
}
|
||||||
}
|
|
||||||
if (ObjCont.GetRepIVA(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), 2, UsuarioActual.CveUsuario, Conciliado, UsuarioActual.CveEmpresa, TipoCambio, TCEspecifico))
|
}
|
||||||
{
|
if (ObjCont.GetRepIVA(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), 2, UsuarioActual.CveUsuario, Conciliado, UsuarioActual.CveEmpresa, TipoCambio, TCEspecifico))
|
||||||
GvA.DataSource = ObjCont.DtResultados;
|
{
|
||||||
DtIVAAcreditable = ObjCont.DtResultados;
|
GvA.DataSource = ObjCont.DtResultados;
|
||||||
if (ObjCont.GetRepIVAAcumulado(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), Conciliado, 3, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
|
DtIVAAcreditable = ObjCont.DtResultados;
|
||||||
{
|
if (DtIVAAcreditable.FiltraParametros("IVA < 0 OR IEPS < 0 ").Rows.Count > 0)
|
||||||
GvIVA2.DataSource = ObjCont.DtResultados;
|
{
|
||||||
}
|
LblMsgAcreditable.Text = "La información presenta importes en negativo, estos no se incluirán en el archivo generado para DIOT";
|
||||||
}
|
}
|
||||||
ObjCont.Dispose();
|
|
||||||
GvT.DataBind();
|
|
||||||
GvA.DataBind();
|
if (ObjCont.GetRepIVAAcumulado(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), Conciliado, 3, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
|
||||||
GvIEPSA.DataBind();
|
{
|
||||||
GvIVAA.DataBind();
|
GvIVA2.DataSource = ObjCont.DtResultados;
|
||||||
GvIVA2.DataBind();
|
}
|
||||||
UpDatos.Update();
|
|
||||||
}
|
|
||||||
|
}
|
||||||
protected void BtnConsultar_Click(object sender, EventArgs e)
|
ObjCont.Dispose();
|
||||||
{
|
GvT.DataBind();
|
||||||
Consulta();
|
GvA.DataBind();
|
||||||
}
|
GvIEPSA.DataBind();
|
||||||
|
GvIVAA.DataBind();
|
||||||
protected void GvIVATrasladado_RowDataBound(object sender, GridViewRowEventArgs e)
|
GvIVA2.DataBind();
|
||||||
{
|
UpDatos.Update();
|
||||||
if (e.Row.RowType == DataControlRowType.DataRow)
|
}
|
||||||
{
|
|
||||||
if (e.Row.DBCampo("CveVenta").ToEntero() < 1)
|
protected void BtnConsultar_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
e.Row.CssClass = "Totales";
|
Consulta();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
protected void GvIVATrasladado_RowDataBound(object sender, GridViewRowEventArgs e)
|
||||||
|
{
|
||||||
protected void GvIVAAcreditable_RowDataBound(object sender, GridViewRowEventArgs e)
|
if (e.Row.RowType == DataControlRowType.DataRow)
|
||||||
{
|
{
|
||||||
if (e.Row.RowType == DataControlRowType.DataRow)
|
if (e.Row.DBCampo("CveVenta").ToEntero() < 1)
|
||||||
{
|
{
|
||||||
if (e.Row.DBCampo("CveCompra").ToEntero() < 1)
|
e.Row.CssClass = "Totales";
|
||||||
{
|
}
|
||||||
e.Row.CssClass = "Totales";
|
}
|
||||||
}
|
}
|
||||||
if (e.Row.DBCampo("PorcentajeIVA").ToDecimal() > 0 )
|
|
||||||
{
|
protected void GvIVAAcreditable_RowDataBound(object sender, GridViewRowEventArgs e)
|
||||||
Decimal SubTotal = (e.Row.DBCampo("SubTotal16").ToDecimal() > 0? e.Row.DBCampo("SubTotal16").ToDecimal() : (e.Row.DBCampo("SubTotal8").ToDecimal() > 0? e.Row.DBCampo("SubTotal8").ToDecimal() : (Decimal)0.0) );
|
{
|
||||||
|
if (e.Row.RowType == DataControlRowType.DataRow)
|
||||||
Decimal dif = Math.Round(SubTotal * e.Row.DBCampo("PorcentajeIVA").ToDecimal(), 2) - Math.Round(e.Row.DBCampo("IVA").ToDecimal(), 2);
|
{
|
||||||
if (dif > 1)
|
if (e.Row.DBCampo("CveCompra").ToEntero() < 1)
|
||||||
{
|
{
|
||||||
e.Row.ForeColor = System.Drawing.Color.Red;
|
e.Row.CssClass = "Totales";
|
||||||
e.Row.Cells[0].Text = e.Row.Cells[0].Text + "Err";
|
}
|
||||||
|
if (e.Row.DBCampo("PorcentajeIVA").ToDecimal() > 0 )
|
||||||
e.Row.ToolTip = "Dif:" + dif.ToString() + "- Sub:" + e.Row.DBCampo("SubTotal")+ " - IVA:"+ e.Row.DBCampo("IVA");
|
{
|
||||||
}
|
Decimal SubTotal = (e.Row.DBCampo("SubTotal16").ToDecimal() > 0? e.Row.DBCampo("SubTotal16").ToDecimal() : (e.Row.DBCampo("SubTotal8").ToDecimal() > 0? e.Row.DBCampo("SubTotal8").ToDecimal() : (Decimal)0.0) );
|
||||||
}
|
|
||||||
}
|
Decimal dif = Math.Round(SubTotal * e.Row.DBCampo("PorcentajeIVA").ToDecimal(), 2) - Math.Round(e.Row.DBCampo("IVA").ToDecimal(), 2);
|
||||||
}
|
if (dif > 1)
|
||||||
|
{
|
||||||
protected void LnkPdf_Click(object sender, EventArgs e)
|
e.Row.ForeColor = System.Drawing.Color.Red;
|
||||||
{
|
e.Row.Cells[0].Text = e.Row.Cells[0].Text + "Err";
|
||||||
Imprimir("PDF");
|
|
||||||
}
|
e.Row.ToolTip = "Dif:" + dif.ToString() + "- Sub:" + e.Row.DBCampo("SubTotal")+ " - IVA:"+ e.Row.DBCampo("IVA");
|
||||||
|
}
|
||||||
protected void LnkExcel_Click(object sender, EventArgs e)
|
}
|
||||||
{
|
}
|
||||||
Imprimir("EXCEL");
|
}
|
||||||
}
|
|
||||||
|
protected void LnkPdf_Click(object sender, EventArgs e)
|
||||||
public void Imprimir(String Opcion)
|
{
|
||||||
{
|
Imprimir("PDF");
|
||||||
String FechaF;
|
}
|
||||||
if (txtFechaF.Text == "" || txtFechaF.Text == "__/__/____") { FechaF = "-1"; } else { FechaF = $" <b>Fecha Final:</b> {txtFechaF.Text}"; }
|
|
||||||
String FechaI;
|
protected void LnkExcel_Click(object sender, EventArgs e)
|
||||||
if (txtFechaI.Text == "" || txtFechaI.Text == "__/__/____") { FechaI = "-1"; } else { FechaI = $" <b>Fecha Inicial:</b> {txtFechaI.Text}"; }
|
{
|
||||||
if (DtIVATrasladado.Rows.Count > 0 || DtIVAAcreditable.Rows.Count > 0)
|
Imprimir("EXCEL");
|
||||||
{
|
}
|
||||||
System.IO.FileInfo Imagen;
|
|
||||||
String logouri = "";
|
public void Imprimir(String Opcion)
|
||||||
|
{
|
||||||
if (UsuarioActual.CveEmpresa.Contiene(119))
|
String FechaF;
|
||||||
{
|
if (txtFechaF.Text == "" || txtFechaF.Text == "__/__/____") { FechaF = "-1"; } else { FechaF = $" <b>Fecha Final:</b> {txtFechaF.Text}"; }
|
||||||
Imagen = new System.IO.FileInfo(String.Format("{0}/Logo.jpg", UsuarioActual.Empresa.Ruta));
|
String FechaI;
|
||||||
logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.jpg", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa);
|
if (txtFechaI.Text == "" || txtFechaI.Text == "__/__/____") { FechaI = "-1"; } else { FechaI = $" <b>Fecha Inicial:</b> {txtFechaI.Text}"; }
|
||||||
}
|
if (DtIVATrasladado.Rows.Count > 0 || DtIVAAcreditable.Rows.Count > 0)
|
||||||
else
|
{
|
||||||
{
|
System.IO.FileInfo Imagen;
|
||||||
Imagen = new System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta));
|
String logouri = "";
|
||||||
logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa);
|
|
||||||
}
|
if (UsuarioActual.CveEmpresa.Contiene(119))
|
||||||
|
{
|
||||||
List<CrystalParametro> para = new List<CrystalParametro>();
|
Imagen = new System.IO.FileInfo(String.Format("{0}/Logo.jpg", UsuarioActual.Empresa.Ruta));
|
||||||
para.Add(new CrystalParametro("Empresa", UsuarioActual.Empresa.Empresa));
|
logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.jpg", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa);
|
||||||
para.Add(new CrystalParametro("UsuarioImprimio", UsuarioActual.Nombre));
|
}
|
||||||
para.Add(new CrystalParametro("Filtros", $"<b>Filtros:</b> {FechaI}{FechaF}"));
|
else
|
||||||
if (Imagen.Exists)
|
{
|
||||||
{
|
Imagen = new System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta));
|
||||||
para.Add(new CrystalParametro("LogoPath", logouri));
|
logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
List<CrystalParametro> para = new List<CrystalParametro>();
|
||||||
para.Add(new CrystalParametro("LogoPath", ""));
|
para.Add(new CrystalParametro("Empresa", UsuarioActual.Empresa.Empresa));
|
||||||
}
|
para.Add(new CrystalParametro("UsuarioImprimio", UsuarioActual.Nombre));
|
||||||
|
para.Add(new CrystalParametro("Filtros", $"<b>Filtros:</b> {FechaI}{FechaF}"));
|
||||||
DataTable Dt = TT.ActiveTabIndex == 0 ? DtIVATrasladado.Copy() : DtIVAAcreditable.Copy();
|
if (Imagen.Exists)
|
||||||
string Formato = TT.ActiveTabIndex == 0 ? "RepIVA.rpt" : "RepIVAAcreditable.rpt";
|
{
|
||||||
para.Add(new CrystalParametro("Excel", Formato));
|
para.Add(new CrystalParametro("LogoPath", logouri));
|
||||||
|
}
|
||||||
ImprimirbytesPDF(ImprimirPDFCrystal(Server.MapPath($"~/Empresas/Grales/Formatos/{Formato}"),Dt,para, "Reporte de IVA", Opcion), "Reporte de IVA", Opcion);
|
else
|
||||||
}
|
{
|
||||||
else
|
para.Add(new CrystalParametro("LogoPath", ""));
|
||||||
{
|
}
|
||||||
Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia);
|
|
||||||
}
|
DataTable Dt = TT.ActiveTabIndex == 0 ? DtIVATrasladado.Copy() : DtIVAAcreditable.Copy();
|
||||||
}
|
string Formato = TT.ActiveTabIndex == 0 ? "RepIVA.rpt" : "RepIVAAcreditable.rpt";
|
||||||
|
para.Add(new CrystalParametro("Excel", Formato));
|
||||||
protected void BtnTipoCambio_Click(object sender, EventArgs e)
|
|
||||||
{
|
ImprimirbytesPDF(ImprimirPDFCrystal(Server.MapPath($"~/Empresas/Grales/Formatos/{Formato}"),Dt,para, "Reporte de IVA", Opcion), "Reporte de IVA", Opcion);
|
||||||
Consulta();
|
}
|
||||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivTipoCambio"));
|
else
|
||||||
}
|
{
|
||||||
|
Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia);
|
||||||
protected void RblTipoCambio_SelectedIndexChanged(object sender, EventArgs e)
|
}
|
||||||
{
|
}
|
||||||
TipoCambio = RblTipoCambio.SelectedValue.ToEntero();
|
|
||||||
if (TipoCambio == 3)
|
protected void BtnTipoCambio_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
LiEspecifico.Visible = true;
|
Consulta();
|
||||||
TCEspecifico = get_GlobalTipoCambio(DateTime.Now).ToString().ToDouble();
|
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivTipoCambio"));
|
||||||
TxtEspecifico.Text = TCEspecifico.ToString();
|
}
|
||||||
}
|
|
||||||
else
|
protected void RblTipoCambio_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
LiEspecifico.Visible = false;
|
TipoCambio = RblTipoCambio.SelectedValue.ToEntero();
|
||||||
}
|
if (TipoCambio == 3)
|
||||||
UpBodyTipoCambio.Update();
|
{
|
||||||
}
|
LiEspecifico.Visible = true;
|
||||||
|
TCEspecifico = get_GlobalTipoCambio(DateTime.Now).ToString().ToDouble();
|
||||||
|
TxtEspecifico.Text = TCEspecifico.ToString();
|
||||||
protected string GenerarDIOT()
|
}
|
||||||
{
|
else
|
||||||
System.Text.StringBuilder Respuesta = new System.Text.StringBuilder();
|
{
|
||||||
|
LiEspecifico.Visible = false;
|
||||||
|
}
|
||||||
|
UpBodyTipoCambio.Update();
|
||||||
return Respuesta.ToString();
|
}
|
||||||
}
|
|
||||||
|
|
||||||
protected void LnkAccionesDIOT_Click(object sender, EventArgs e)
|
protected string GenerarDIOT()
|
||||||
{
|
{
|
||||||
|
System.Text.StringBuilder Respuesta = new System.Text.StringBuilder();
|
||||||
ClsContabilidad Objconta = new ClsContabilidad();
|
|
||||||
StringBuilder SBDIOT = new StringBuilder();
|
|
||||||
int Conciliado = DdlTipoMovto.SelectedValue.ToEntero();
|
|
||||||
|
return Respuesta.ToString();
|
||||||
if (Objconta.GetRepIVA(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), 2, UsuarioActual.CveUsuario, Conciliado, UsuarioActual.CveEmpresa, TipoCambio, TCEspecifico))
|
}
|
||||||
{
|
|
||||||
|
protected void LnkAccionesDIOT_Click(object sender, EventArgs e)
|
||||||
foreach (DataRow Drow in Objconta.DtResultados.FiltraParametros("CveCompra is null and CveProveedor > 0 and SubTotal >= 1 ").Rows) // and(IVA > 1 OR IEPS > 0)
|
{
|
||||||
{
|
|
||||||
SBDIOT.AppendLine(
|
ClsContabilidad Objconta = new ClsContabilidad();
|
||||||
Drow["TipoTercero"].ToString() + "|" +
|
StringBuilder SBDIOT = new StringBuilder();
|
||||||
Drow["TipoOperacion"].ToString() + "|" +
|
int Conciliado = DdlTipoMovto.SelectedValue.ToEntero();
|
||||||
Drow["RFC"].ToString() +"|"+
|
|
||||||
Drow["NumeroIDFiscal"].ToString() + "|" +
|
if (Objconta.GetRepIVA(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), 2, UsuarioActual.CveUsuario, Conciliado, UsuarioActual.CveEmpresa, TipoCambio, TCEspecifico))
|
||||||
Drow["NombreExtranjero"].ToString() +"|"+
|
{
|
||||||
Drow["PaisResidencia"].ToString() + "|" +
|
|
||||||
Drow["Nacionalidad"].ToString() +"|"+
|
foreach (DataRow Drow in Objconta.DtResultados.FiltraParametros("CveCompra is null and CveProveedor > 0 and SubTotal >= 1 ").Rows) // and(IVA > 1 OR IEPS > 0)
|
||||||
LV(Drow["valorActos1516"].ToString()) + "|"+
|
{
|
||||||
LV(Drow["valorActos15"].ToString()) + "|" +
|
SBDIOT.AppendLine(
|
||||||
LV(Drow["ValorIvaNo1516"].ToString()) +"|"+
|
Drow["TipoTercero"].ToString() + "|" +
|
||||||
|
Drow["TipoOperacion"].ToString() + "|" +
|
||||||
LV(Drow["valorActos1011"].ToString()) + "|" +
|
Drow["RFC"].ToString() +"|"+
|
||||||
LV(Drow["valorActos10"].ToString()) + "|" +
|
Drow["NumeroIDFiscal"].ToString() + "|" +
|
||||||
LV(Drow["valorActosImp8"].ToString()) + "|" +
|
Drow["NombreExtranjero"].ToString() +"|"+
|
||||||
LV(Drow["ValorIvaNo10"].ToString()) + "|" +
|
Drow["PaisResidencia"].ToString() + "|" +
|
||||||
LV(Drow["ValorIvaNo08"].ToString()) + "|" +
|
Drow["Nacionalidad"].ToString() +"|"+
|
||||||
|
LV(Drow["valorActos1516"].ToString()) + "|"+
|
||||||
LV(Drow["valorActosImp1516"].ToString()) + "|" +
|
LV(Drow["valorActos15"].ToString()) + "|" +
|
||||||
LV(Drow["ValorIvaNoImp16"].ToString()) + "|" +
|
LV(Drow["ValorIvaNo1516"].ToString()) +"|"+
|
||||||
|
|
||||||
LV(Drow["valorActosImp10"].ToString()) + "|" +
|
LV(Drow["valorActos1011"].ToString()) + "|" +
|
||||||
LV(Drow["ValorIvaNoImp10"].ToString()) + "|" +
|
LV(Drow["valorActos10"].ToString()) + "|" +
|
||||||
|
LV(Drow["valorActosImp8"].ToString()) + "|" +
|
||||||
LV(Drow["IvaExentoImpo"].ToString()) + "|"+
|
LV(Drow["ValorIvaNo10"].ToString()) + "|" +
|
||||||
LV(Drow["IVACero"].ToString()) + "|" +
|
LV(Drow["ValorIvaNo08"].ToString()) + "|" +
|
||||||
LV(Drow["IvaExento"].ToString()) + "|"+
|
|
||||||
LV(Drow["IvaRetenido"].ToString()) + "|" +
|
LV(Drow["valorActosImp1516"].ToString()) + "|" +
|
||||||
LV(Drow["IvaDevoluciones"].ToString()) + "|");
|
LV(Drow["ValorIvaNoImp16"].ToString()) + "|" +
|
||||||
}
|
|
||||||
}
|
LV(Drow["valorActosImp10"].ToString()) + "|" +
|
||||||
|
LV(Drow["ValorIvaNoImp10"].ToString()) + "|" +
|
||||||
Objconta.Dispose();
|
|
||||||
|
LV(Drow["IvaExentoImpo"].ToString()) + "|"+
|
||||||
//MemoryStream ms = new MemoryStream();
|
LV(Drow["IVACero"].ToString()) + "|" +
|
||||||
//TextWriter tw = new StreamWriter(ms, System.Text.Encoding.UTF8);
|
LV(Drow["IvaExento"].ToString()) + "|"+
|
||||||
|
LV(Drow["IvaRetenido"].ToString()) + "|" +
|
||||||
//tw.Write(SBDIOT.ToString());
|
LV(Drow["IvaDevoluciones"].ToString()) + "|");
|
||||||
|
}
|
||||||
//tw.Flush();
|
}
|
||||||
|
|
||||||
//byte[] bytes = ms.ToArray();
|
Objconta.Dispose();
|
||||||
//ms.Close();
|
|
||||||
|
//MemoryStream ms = new MemoryStream();
|
||||||
//Response.Clear();
|
//TextWriter tw = new StreamWriter(ms, System.Text.Encoding.UTF8);
|
||||||
//Response.AppendHeader("Content-Length", text.Length.ToString());
|
|
||||||
//Response.ContentType = "text/plain";
|
//tw.Write(SBDIOT.ToString());
|
||||||
//Response.AddHeader("content-disposition", $"attachment; filename=DIOT_{ txtFechaI.Text.ToDate().ToString("ddMMyyyy") }_{txtFechaI.Text.ToDate().ToString("ddMMyyyy") }.txt");
|
|
||||||
//Response.BinaryWrite(bytes);
|
//tw.Flush();
|
||||||
//Response.End();
|
|
||||||
|
//byte[] bytes = ms.ToArray();
|
||||||
Response.Clear();
|
//ms.Close();
|
||||||
Response.ClearHeaders();
|
|
||||||
|
//Response.Clear();
|
||||||
Response.AppendHeader("Content-Length", SBDIOT.ToString().Length.ToString());
|
//Response.AppendHeader("Content-Length", text.Length.ToString());
|
||||||
Response.ContentType = "text/plain";
|
//Response.ContentType = "text/plain";
|
||||||
Response.AppendHeader("Content-Disposition", $"attachment;filename=DIOT_{ txtFechaI.Text.ToDate().ToString("ddMMyyyy") }_{txtFechaI.Text.ToDate().ToString("ddMMyyyy") }.txt");
|
//Response.AddHeader("content-disposition", $"attachment; filename=DIOT_{ txtFechaI.Text.ToDate().ToString("ddMMyyyy") }_{txtFechaI.Text.ToDate().ToString("ddMMyyyy") }.txt");
|
||||||
|
//Response.BinaryWrite(bytes);
|
||||||
Response.Write(SBDIOT.ToString());
|
//Response.End();
|
||||||
Response.End();
|
|
||||||
}
|
Response.Clear();
|
||||||
|
Response.ClearHeaders();
|
||||||
protected string LV(string Valor )
|
|
||||||
{
|
Response.AppendHeader("Content-Length", SBDIOT.ToString().Length.ToString());
|
||||||
return (Valor.ToDecimal() > 0) ? Valor.ToDecimal().ToString().FormatoNumero(0).Replace(",", string.Empty) : "";
|
Response.ContentType = "text/plain";
|
||||||
}
|
Response.AppendHeader("Content-Disposition", $"attachment;filename=DIOT_{ txtFechaI.Text.ToDate().ToString("ddMMyyyy") }_{txtFechaI.Text.ToDate().ToString("ddMMyyyy") }.txt");
|
||||||
|
|
||||||
|
Response.Write(SBDIOT.ToString());
|
||||||
|
Response.End();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected string LV(string Valor )
|
||||||
|
{
|
||||||
|
return (Valor.ToDecimal() > 0) ? Valor.ToDecimal().ToString().FormatoNumero(0).Replace(",", string.Empty) : "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -271,8 +271,13 @@ Partial Class General_SaldosIniciales
|
|||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If Not dt.Columns(12).ColumnName = "Litraje" Then
|
If Not dt.Columns(12).ColumnName = "Servicio" Then
|
||||||
Alert("El nombre de la treceava columna debe ser 'Litraje'. Favor de corregirlo", TipoMensaje.MsgError)
|
Alert("El nombre de la treceava columna debe ser 'Servicio'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Not dt.Columns(13).ColumnName = "Conversion Unidad" Then
|
||||||
|
Alert("El nombre de la catorceava columna debe ser 'Conversion Unidad'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -563,7 +568,8 @@ Partial Class General_SaldosIniciales
|
|||||||
Dim IEPS As Decimal = Row("IEPS").ToString.ToDecimal
|
Dim IEPS As Decimal = Row("IEPS").ToString.ToDecimal
|
||||||
Dim Tamaño As String = Row("Tamaño").ToString.Trim
|
Dim Tamaño As String = Row("Tamaño").ToString.Trim
|
||||||
Dim SATClavePS As String = Row("Código SAT").ToString.Trim
|
Dim SATClavePS As String = Row("Código SAT").ToString.Trim
|
||||||
Dim Litraje As Double = Row("Litraje").ToString.ToDouble
|
Dim Clasificacion2 As String = Row("Servicio").ToString.Trim
|
||||||
|
Dim Litraje As Double = Row("Conversion Unidad").ToString.ToDouble
|
||||||
Dim RinTamaño As String = If(Row.Table.Columns.Contains("Tamaño de Rin"), Row("Tamaño de Rin").ToString.Trim, "")
|
Dim RinTamaño As String = If(Row.Table.Columns.Contains("Tamaño de Rin"), Row("Tamaño de Rin").ToString.Trim, "")
|
||||||
Dim Medida As String = If(Row.Table.Columns.Contains("Medida"), Row("Medida").ToString.Trim, "")
|
Dim Medida As String = If(Row.Table.Columns.Contains("Medida"), Row("Medida").ToString.Trim, "")
|
||||||
Dim SATClaveUnidadMedida As String = If(Row.Table.Columns.Contains("Clave Unidad"), Row("Clave Unidad").ToString.Trim, "")
|
Dim SATClaveUnidadMedida As String = If(Row.Table.Columns.Contains("Clave Unidad"), Row("Clave Unidad").ToString.Trim, "")
|
||||||
@@ -572,11 +578,12 @@ Partial Class General_SaldosIniciales
|
|||||||
|
|
||||||
Dim CvePS As Integer = DTPS.FiltroPrimeroValor("CvePS", $"Codigo = '{Codigo}'").ToString.ToEntero
|
Dim CvePS As Integer = DTPS.FiltroPrimeroValor("CvePS", $"Codigo = '{Codigo}'").ToString.ToEntero
|
||||||
|
|
||||||
Dim CveTipoPS As Integer = If(TipoPS = "PRODUCTO", 2, 1)
|
Dim CveTipoPS As Integer = If(TipoPS.ToUpper = "PRODUCTO", 2, 1)
|
||||||
Dim CveClasificacion As Integer = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveClasificacion", $"Clasificacion = '{Clasificacion}'").ToString.ToEntero
|
Dim CveClasificacion As Integer = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveClasificacion", $"Clasificacion = '{Clasificacion}'").ToString.ToEntero
|
||||||
Dim CveUnidadMedida As Integer = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveUnidadMedida", $"UnidadMedida = '{UnidadMedida}'").ToString.ToEntero
|
Dim CveUnidadMedida As Integer = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveUnidadMedida", $"UnidadMedida = '{UnidadMedida}'").ToString.ToEntero
|
||||||
Dim CveSATPS As Integer = GlobalDTPSATPS.FiltroPrimeroValor("CveSATPS", $"SATClavePS = '{SATClavePS}'").ToString.ToEntero
|
Dim CveSATPS As Integer = GlobalDTPSATPS.FiltroPrimeroValor("CveSATPS", $"SATClavePS = '{SATClavePS}'").ToString.ToEntero
|
||||||
Dim CveTamaño As Integer = GlobalDTAcumTamaños.FiltroPrimeroValor("CveTamaño", $"Tamaño = '{Tamaño}'").ToString.ToEntero
|
Dim CveTamaño As Integer = GlobalDTAcumTamaños.FiltroPrimeroValor("CveTamaño", $"Tamaño = '{Tamaño}' AND CveEmpresa = {UsuarioActual.CveEmpresa}").ToString.ToEntero
|
||||||
|
Dim CveClasificacion2 As Integer = GlobalDTClasificaciones2(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveClasificacion", $"Clasificacion = '{Clasificacion2}'").ToString.ToEntero
|
||||||
|
|
||||||
If Not CveClasificacion > 0 AndAlso Clasificacion <> "" Then
|
If Not CveClasificacion > 0 AndAlso Clasificacion <> "" Then
|
||||||
If ObjClas.AddClasificaciones(Clasificacion, "", -1, "-1", -1, "-1", -1, "-1",
|
If ObjClas.AddClasificaciones(Clasificacion, "", -1, "-1", -1, "-1", -1, "-1",
|
||||||
@@ -588,7 +595,7 @@ Partial Class General_SaldosIniciales
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If Not CveUnidadMedida > 0 AndAlso UnidadMedida <> "" Then
|
If Not CveUnidadMedida > 0 AndAlso UnidadMedida <> "" Then
|
||||||
If ObjUM.AddUnidadMedida(UnidadMedida, "", "", "", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).ToEntero > 0 Then
|
If ObjUM.AddUnidadMedida(UnidadMedida, UnidadMedida, "", "", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).ToEntero > 0 Then
|
||||||
If ObjUM.GetUnidadesMedida() Then Application("GlobalDTUnidadesMedida") = ObjUM.DtResultados
|
If ObjUM.GetUnidadesMedida() Then Application("GlobalDTUnidadesMedida") = ObjUM.DtResultados
|
||||||
CveUnidadMedida = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveUnidadMedida", $"UnidadMedida = '{UnidadMedida}'").ToString.ToEntero
|
CveUnidadMedida = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveUnidadMedida", $"UnidadMedida = '{UnidadMedida}'").ToString.ToEntero
|
||||||
End If
|
End If
|
||||||
@@ -646,6 +653,26 @@ Partial Class General_SaldosIniciales
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If Not CveClasificacion2 > 0 AndAlso Clasificacion2 <> "" Then
|
||||||
|
Dim CveCategoria As Integer
|
||||||
|
If ObjGral.GetCategorias(UsuarioActual.CveEmpresa, 4) Then
|
||||||
|
CveCategoria = ObjGral.DtResultados.FiltroPrimeroValor("CveCategoria", "").ToEntero
|
||||||
|
End If
|
||||||
|
If Not CveCategoria > 0 Then
|
||||||
|
If ObjGral.AddCategorias(Clasificacion2, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 4) Then
|
||||||
|
|
||||||
|
If ObjGral.GetCategorias(UsuarioActual.CveEmpresa, 4) Then
|
||||||
|
CveCategoria = ObjGral.DtResultados.FiltroPrimeroValor("CveCategoria", "").ToEntero
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
If ObjClas.AddClasificaciones(Clasificacion2, "", -1, "-1", -1, "-1", -1, "-1", CveCategoria, UsuarioActual.CveUsuario,
|
||||||
|
UsuarioActual.CveEmpresa) Then
|
||||||
|
If ObjClas.GetClasificaciones(Tipo:=4) Then Application("GlobalDTClasificaciones2") = ObjClas.DtResultados
|
||||||
|
CveClasificacion2 = GlobalDTClasificaciones2(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveClasificacion", $"Clasificacion = '{Clasificacion2}'").ToString.ToEntero
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
If Not CveClasificacion > 0 AndAlso Clasificacion <> "" Then Alert("No se encontró la Clasificación: " + Clasificacion, TipoMensaje.MsgAdvertencia) : ErrorPS = True : Exit For
|
If Not CveClasificacion > 0 AndAlso Clasificacion <> "" Then Alert("No se encontró la Clasificación: " + Clasificacion, TipoMensaje.MsgAdvertencia) : ErrorPS = True : Exit For
|
||||||
If Not CveUnidadMedida > 0 AndAlso UnidadMedida <> "" Then Alert("No se encontró la Unidad de Medida: " + UnidadMedida, TipoMensaje.MsgAdvertencia) : ErrorPS = True : Exit For
|
If Not CveUnidadMedida > 0 AndAlso UnidadMedida <> "" Then Alert("No se encontró la Unidad de Medida: " + UnidadMedida, TipoMensaje.MsgAdvertencia) : ErrorPS = True : Exit For
|
||||||
If Not CveSATPS > 0 AndAlso SATClavePS <> "" Then Alert("No se encontró la Clve SAT PS: " + SATClavePS, TipoMensaje.MsgAdvertencia) : ErrorPS = True : Exit For
|
If Not CveSATPS > 0 AndAlso SATClavePS <> "" Then Alert("No se encontró la Clve SAT PS: " + SATClavePS, TipoMensaje.MsgAdvertencia) : ErrorPS = True : Exit For
|
||||||
@@ -653,11 +680,12 @@ Partial Class General_SaldosIniciales
|
|||||||
If Not CveMedida > 0 AndAlso Medida <> "" Then Alert("No se encontró la Media: " + Medida, TipoMensaje.MsgAdvertencia) : ErrorPS = True : Exit For
|
If Not CveMedida > 0 AndAlso Medida <> "" Then Alert("No se encontró la Media: " + Medida, TipoMensaje.MsgAdvertencia) : ErrorPS = True : Exit For
|
||||||
If Not CveRinTamaño > 0 AndAlso RinTamaño <> "" Then Alert("No se encontró el Tamaño: " + RinTamaño, TipoMensaje.MsgAdvertencia) : ErrorPS = True : Exit For
|
If Not CveRinTamaño > 0 AndAlso RinTamaño <> "" Then Alert("No se encontró el Tamaño: " + RinTamaño, TipoMensaje.MsgAdvertencia) : ErrorPS = True : Exit For
|
||||||
If Not CveModelo > 0 AndAlso Modelo <> "" Then Alert("No se encontró el Modelo: " + Modelo, TipoMensaje.MsgAdvertencia) : ErrorPS = True : Exit For
|
If Not CveModelo > 0 AndAlso Modelo <> "" Then Alert("No se encontró el Modelo: " + Modelo, TipoMensaje.MsgAdvertencia) : ErrorPS = True : Exit For
|
||||||
|
If Not CveClasificacion2 > 0 AndAlso Clasificacion2 <> "" Then Alert("No se encontró la Serie: " + Clasificacion2, TipoMensaje.MsgAdvertencia) : ErrorPS = True : Exit For
|
||||||
|
|
||||||
If CvePS > 0 Then
|
If CvePS > 0 Then
|
||||||
If Not ObjPS.UpdatePS(CveClasificacion, 1, CveUnidadMedida, Codigo, "", CodigoBarras, Descripcion, Precio, 1, 1, False, 0, True, True, True, UsuarioActual.CveUsuario, CvePS, -1, -1, CveSATPS,
|
If Not ObjPS.UpdatePS(CveClasificacion, 1, CveUnidadMedida, Codigo, "", CodigoBarras, Descripcion, Precio, 1, 1, False, 0, True, True, True, UsuarioActual.CveUsuario, CvePS, -1, -1, CveSATPS,
|
||||||
CveTipoPS:=CveTipoPS, CveMarca:=CveMarca, CveMedida:=CveMedida, CveRinTamaño:=CveRinTamaño,
|
CveTipoPS:=CveTipoPS, CveMarca:=CveMarca, CveMedida:=CveMedida, CveRinTamaño:=CveRinTamaño,
|
||||||
CveModelo:=CveModelo, Litraje:=Litraje, IEPSPorcentaje:=IEPS) Then
|
CveModelo:=CveModelo, Litraje:=Litraje, IEPSPorcentaje:=IEPS, CveClasificacion2:=CveClasificacion2, CveTamaño:=CveTamaño) Then
|
||||||
'If Not ObjPS.UpdatePS(CveClasificacion, 1, CveUnidadMedida, Codigo, "", CodigoBarras, Descripcion, 0, 1, 1, False, 0, True, True, True, UsuarioActual.CveUsuario, CvePS, -1, -1, CveSATPS,
|
'If Not ObjPS.UpdatePS(CveClasificacion, 1, CveUnidadMedida, Codigo, "", CodigoBarras, Descripcion, 0, 1, 1, False, 0, True, True, True, UsuarioActual.CveUsuario, CvePS, -1, -1, CveSATPS,
|
||||||
' CveTipoPS:=CveTipoPS, CveMarca:=CveMarca, CveTamaño:=CveTamaño, CveMedida:=CveMedida) Then
|
' CveTipoPS:=CveTipoPS, CveMarca:=CveMarca, CveTamaño:=CveTamaño, CveMedida:=CveMedida) Then
|
||||||
ErrorPS = True
|
ErrorPS = True
|
||||||
@@ -666,10 +694,11 @@ Partial Class General_SaldosIniciales
|
|||||||
Else
|
Else
|
||||||
Contador += 1
|
Contador += 1
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Else
|
Else
|
||||||
If ObjPS.AddPS(CveClasificacion, 1, CveUnidadMedida, Codigo, "", CodigoBarras, Descripcion, Precio, 0, 0, False, 0, False, True, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, 1,
|
If ObjPS.AddPS(CveClasificacion, 1, CveUnidadMedida, Codigo, "", CodigoBarras, Descripcion, Precio, 0, 0, False, 0, False, True, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, 1,
|
||||||
CveTipoPS:=CveTipoPS, CveSATPS:=CveSATPS, CveMarca:=CveMarca, CveTamaño:=CveTamaño, CveMedida:=CveMedida, CveRinTamaño:=CveRinTamaño,
|
CveTipoPS:=CveTipoPS, CveSATPS:=CveSATPS, CveMarca:=CveMarca, CveTamaño:=CveTamaño, CveMedida:=CveMedida, CveRinTamaño:=CveRinTamaño,
|
||||||
CveModelo:=CveModelo, Litraje:=Litraje, IEPSPorcentaje:=IEPS) <= 0 Then
|
CveModelo:=CveModelo, Litraje:=Litraje, IEPSPorcentaje:=IEPS, CveClasificacion2:=CveClasificacion2) <= 0 Then
|
||||||
'If ObjPS.AddPS(CveClasificacion, 1, CveUnidadMedida, Codigo, "", "", Descripcion, 0, 0, 0, False, 0, False, True, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, 1,
|
'If ObjPS.AddPS(CveClasificacion, 1, CveUnidadMedida, Codigo, "", "", Descripcion, 0, 0, 0, False, 0, False, True, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, 1,
|
||||||
' CveTipoPS:=CveTipoPS, CveSATPS:=CveSATPS, CveMarca:=CveMarca, CveTamaño:=CveTamaño, CveMedida:=CveMedida) <= 0 Then
|
' CveTipoPS:=CveTipoPS, CveSATPS:=CveSATPS, CveMarca:=CveMarca, CveTamaño:=CveTamaño, CveMedida:=CveMedida) <= 0 Then
|
||||||
ErrorPS = True
|
ErrorPS = True
|
||||||
@@ -772,7 +801,9 @@ Partial Class General_SaldosIniciales
|
|||||||
|
|
||||||
ObjClientes.IniciaTransacSQL()
|
ObjClientes.IniciaTransacSQL()
|
||||||
For Each Row As DataRow In dt.FiltraParametros("RFC <> ''").Rows
|
For Each Row As DataRow In dt.FiltraParametros("RFC <> ''").Rows
|
||||||
NumRow = NumRow + 1
|
NumRow = NumRow + 1
|
||||||
|
|
||||||
|
|
||||||
Dim Codigo As String = Row("Codigo").ToString
|
Dim Codigo As String = Row("Codigo").ToString
|
||||||
Dim RazonSocial As String = Row("RazonSocial").ToString
|
Dim RazonSocial As String = Row("RazonSocial").ToString
|
||||||
Dim RFC As String = Row("RFC").ToString.Trim
|
Dim RFC As String = Row("RFC").ToString.Trim
|
||||||
@@ -783,36 +814,148 @@ Partial Class General_SaldosIniciales
|
|||||||
Dim Poblacion As String = Row("Población").ToString
|
Dim Poblacion As String = Row("Población").ToString
|
||||||
Dim Estado As String = Row("Estado").ToString
|
Dim Estado As String = Row("Estado").ToString
|
||||||
Dim Pais As String = Row("Pais").ToString
|
Dim Pais As String = Row("Pais").ToString
|
||||||
Dim Telefono As String = Row("Teléfono").ToString
|
Dim Telefono As String = Row("Teléfono").ToString.Replace("-", "").Replace(" ", "").Replace("(", "").Replace(")", "")
|
||||||
Dim Contacto As String = Row("Contacto").ToString
|
Dim Contacto As String = Row("Contacto").ToString
|
||||||
Dim CelularContacto As String = Row("Celular Contacto").ToString
|
|
||||||
|
|
||||||
Dim Vendedor As String = Row("Vendedor").ToString
|
Dim Vendedor As String = Row("Vendedor").ToString
|
||||||
Dim Clasificacion As String = Row("Clasificación").ToString
|
Dim Clasificacion As String = Row("Clasificación").ToString
|
||||||
Dim CveCliente As Integer = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveCliente", $"RFC = '{RFC}'").ToString.ToEntero
|
Dim CveCliente As Integer = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveCliente", $"RFC = '{RFC}'").ToString.ToEntero
|
||||||
|
|
||||||
Dim CveVendedor As Integer = GlobalDTVendedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveVendedor", $"Vendedor = '{Vendedor}'").ToString.ToEntero
|
Dim CveVendedor As Integer = GlobalDTVendedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveVendedor", $"Vendedor = '{Vendedor}'").ToString.ToEntero
|
||||||
Dim CveClasificación As Integer = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveClasificacion", $"Clasificacion = '{Clasificacion}'").ToString.ToEntero
|
Dim CveClasificación As Integer = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveClasificacion", $"Clasificacion = '{Clasificacion}'").ToString.ToEntero
|
||||||
Dim EsDistribuidor As Boolean = If(Row("Es distribuidor").ToString = "si", True, False)
|
Dim EsDistribuidor As Boolean = If(Row("Es distribuidor").ToString.ToUpper = "SI", True, False)
|
||||||
Dim CargoUsado As Boolean = If(Row("CargoUsado").ToString = "si", True, False)
|
Dim CargoUsado As Boolean = If(Row("Cargo Usados").ToString.ToUpper = "SI", True, False)
|
||||||
Dim BonificacionUsado As Boolean = If(Row("BonificacionUsado").ToString = "si", True, False)
|
Dim BonificacionUsado As Boolean = If(Row("EmitirBon Usado").ToString.ToUpper = "SI", True, False)
|
||||||
|
|
||||||
|
Dim LimiteCredito As Decimal = Row("Limite Credito").ToString.ToDecimal
|
||||||
|
Dim CobranzaCorreo As String = Row("CorreoPago").ToString
|
||||||
|
Dim PlazoCobranza As Integer = Row("Plazo Cobranza").ToString.ToEntero
|
||||||
|
|
||||||
|
Dim DìaVisita As String = Row("Dia Pago").ToString
|
||||||
|
Dim DiasPagoEspecifico As String = Row("Dìa Visita").ToString
|
||||||
|
Dim CobranzaContacto As String = Row("Encargado Pago").ToString
|
||||||
|
Dim CobranzaTelefono As String = Row("Celular Contacto").ToString.Replace("-", "").Replace(" ", "").Replace("(", "").Replace(")", "")
|
||||||
|
|
||||||
|
|
||||||
|
' CobranzaContacto = Regex.Replace(CobranzaContacto, "[^0-9]", "")
|
||||||
|
|
||||||
|
'Telefono
|
||||||
|
|
||||||
|
If Telefono.Trim.Length > 10 Then
|
||||||
|
Telefono = ""
|
||||||
|
End If
|
||||||
|
|
||||||
|
If CobranzaTelefono.Trim.Length > 10 Then
|
||||||
|
|
||||||
|
CobranzaTelefono = ""
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim FormaPago As String = Row("Forma Pago").ToString
|
||||||
|
Dim CveFormaPago33 As Integer = 99
|
||||||
|
|
||||||
|
Select Case FormaPago
|
||||||
|
|
||||||
|
Case "01"
|
||||||
|
CveFormaPago33 = 1
|
||||||
|
Exit Select
|
||||||
|
Case "02"
|
||||||
|
CveFormaPago33 = 2
|
||||||
|
Exit Select
|
||||||
|
Case "03"
|
||||||
|
CveFormaPago33 = 3
|
||||||
|
Exit Select
|
||||||
|
Case "04"
|
||||||
|
CveFormaPago33 = 4
|
||||||
|
Exit Select
|
||||||
|
Case "05"
|
||||||
|
CveFormaPago33 = 5
|
||||||
|
Exit Select
|
||||||
|
Case "06"
|
||||||
|
CveFormaPago33 = 6
|
||||||
|
Exit Select
|
||||||
|
Case "08"
|
||||||
|
CveFormaPago33 = 7
|
||||||
|
Exit Select
|
||||||
|
Case "12"
|
||||||
|
CveFormaPago33 = 8
|
||||||
|
Exit Select
|
||||||
|
Case "13"
|
||||||
|
CveFormaPago33 = 9
|
||||||
|
Exit Select
|
||||||
|
Case "14"
|
||||||
|
CveFormaPago33 = 10
|
||||||
|
Exit Select
|
||||||
|
Case "15"
|
||||||
|
CveFormaPago33 = 11
|
||||||
|
Exit Select
|
||||||
|
Case "17"
|
||||||
|
CveFormaPago33 = 12
|
||||||
|
Exit Select
|
||||||
|
Case "23"
|
||||||
|
CveFormaPago33 = 13
|
||||||
|
Exit Select
|
||||||
|
Case "24"
|
||||||
|
CveFormaPago33 = 14
|
||||||
|
Exit Select
|
||||||
|
Case "25"
|
||||||
|
CveFormaPago33 = 15
|
||||||
|
Exit Select
|
||||||
|
Case "26"
|
||||||
|
CveFormaPago33 = 16
|
||||||
|
Exit Select
|
||||||
|
Case "27"
|
||||||
|
CveFormaPago33 = 17
|
||||||
|
Exit Select
|
||||||
|
Case "28"
|
||||||
|
CveFormaPago33 = 18
|
||||||
|
Exit Select
|
||||||
|
Case "29"
|
||||||
|
CveFormaPago33 = 19
|
||||||
|
Exit Select
|
||||||
|
Case "99"
|
||||||
|
CveFormaPago33 = 20
|
||||||
|
Exit Select
|
||||||
|
Case "30"
|
||||||
|
CveFormaPago33 = 21
|
||||||
|
Exit Select
|
||||||
|
Case "31"
|
||||||
|
CveFormaPago33 = 22
|
||||||
|
Exit Select
|
||||||
|
Case Else
|
||||||
|
CveFormaPago33 = 99
|
||||||
|
|
||||||
|
End Select
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
'Dim RazonSocial As String = Row("RazonSocial").ToString
|
||||||
|
|
||||||
|
'Contacto
|
||||||
|
|
||||||
If CveCliente > 0 Then
|
If CveCliente > 0 Then
|
||||||
ExisteCliente = True
|
ExisteCliente = True
|
||||||
Contador = Contador + 1
|
Contador = Contador + 1
|
||||||
'If Not ObjClientes.UpdateCliente(RazonSocial, RazonSocial, Calle, "", "", Colonia, "", "", Estado, RFC, CodigoPostal, "", "", Contacto, "", "", "", "", -1, False, 1, -1, False, True, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "", -1, -1, -1,
|
|
||||||
' "-1", -1, -1, -1, -1, "0", -1, "0", 0, "", 0, "", 0, "", 0, "", "", "", "", 0, "", 1, False, "", "", "", False, "", "", "", "", "", False, "", "", "", False, 0, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "", "", False, -1) Then
|
'If Not ObjClientes.UpdateCliente(RazonSocial, RazonSocial, Calle, "", "", Colonia, "", "", Estado, RFC, CodigoPostal, "", "", Contacto, "", "", "", "", -1, False, 1, -1, False, True, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "", -1, -1, -1,
|
||||||
' ErrorClientes = True
|
' "-1", -1, -1, -1, -1, "0", -1, "0", 0, "", 0, "", 0, "", 0, "", "", "", "", 0, "", 1, False, "", "", "", False, "", "", "", "", "", False, "", "", "", False, 0, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "", "", False, -1) Then
|
||||||
' RFC.GuardaLog
|
' ErrorClientes = True
|
||||||
' Exit For
|
' RFC.GuardaLog
|
||||||
'End If
|
' Exit For
|
||||||
|
'End If
|
||||||
Else
|
Else
|
||||||
If Not ObjClientes.AddCliente(RazonSocial, RazonSocial, Calle, "", "", Colonia, "", "", Estado, Pais, RFC, CodigoPostal, "", "", Contacto, "", "", "", "", -1, False, 0, 0, False, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "", CveVendedor, -1, -1,
|
|
||||||
"-1", "-1", -1, "-1", -1, "0", -1, "0", 0, "", 0, "", 0, "", 0, "", "", "", Codigo, 0, "", 1, False, "", "", "", False, "", "", "", "", "", False, "", "", "", False, 0, -1, EsDistribuidor:=EsDistribuidor, CveClienteClasificacion:=CveClasificación, CargoUsado:=CargoUsado, BonificacionUsado:=BonificacionUsado) Then
|
If Not ObjClientes.AddCliente(RazonSocial, RazonSocial, Calle, NumExt.ToString, "", Colonia, Poblacion, Poblacion, Estado, Pais, RFC, CodigoPostal, Telefono, Contacto, "", "", "", "", "", -1, False, 0, 0, False, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "", CveVendedor, PlazoCobranza, -1,
|
||||||
|
"-1", "-1", -1, "-1", -1, "0", -1, "0", 0, "", 0, "", 0, "", 0, "", "", "", Codigo, LimiteCredito, "", 1, False, "", "", "", False, "", "", "", "", "", False, "", "", "", False, 0, -1, EsDistribuidor:=EsDistribuidor, CveClienteClasificacion:=CveClasificación, CargoUsado:=CargoUsado,
|
||||||
|
BonificacionUsado:=BonificacionUsado, CobranzaContacto:=CobranzaContacto, CobranzaCorreo:=CobranzaCorreo, DiasEspecifico:=DiasPagoEspecifico, DiasRevision:=DìaVisita, CobranzaTelefono:=CobranzaTelefono, CveFormaPago33:=CveFormaPago33) Then
|
||||||
|
|
||||||
ErrorClientes = True
|
ErrorClientes = True
|
||||||
RFC.GuardaLog
|
RFC.GuardaLog
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Next
|
Next
|
||||||
|
|
||||||
|
|
||||||
@@ -1684,7 +1827,7 @@ Partial Class General_SaldosIniciales
|
|||||||
If firstRowHasHeaders Then
|
If firstRowHasHeaders Then
|
||||||
|
|
||||||
If worksheet.Rows(0).Cells(cols).Value IsNot Nothing Then
|
If worksheet.Rows(0).Cells(cols).Value IsNot Nothing Then
|
||||||
dataTable.Columns.Add(worksheet.Rows(0).Cells(cols).Value.ToString())
|
dataTable.Columns.Add(worksheet.Rows(0).Cells(cols).Value.ToString().Trim)
|
||||||
Else
|
Else
|
||||||
dataTable.Columns.Add("Unnamed Column " & (System.Threading.Interlocked.Increment(unnamed)))
|
dataTable.Columns.Add("Unnamed Column " & (System.Threading.Interlocked.Increment(unnamed)))
|
||||||
End If
|
End If
|
||||||
@@ -1693,9 +1836,11 @@ Partial Class General_SaldosIniciales
|
|||||||
Else
|
Else
|
||||||
dataTable.Columns.Add("Column " & (cols + 1))
|
dataTable.Columns.Add("Column " & (cols + 1))
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Next
|
Next
|
||||||
|
|
||||||
While curRow < worksheet.Rows.Count
|
While curRow < worksheet.Rows.Count
|
||||||
|
|
||||||
columns = New String(cols - 1) {}
|
columns = New String(cols - 1) {}
|
||||||
|
|
||||||
For curCol = 0 To cols - 1
|
For curCol = 0 To cols - 1
|
||||||
@@ -1705,13 +1850,16 @@ Partial Class General_SaldosIniciales
|
|||||||
Else
|
Else
|
||||||
columns(curCol) = worksheet.Rows(curRow).Cells(curCol).Value.ToString()
|
columns(curCol) = worksheet.Rows(curRow).Cells(curCol).Value.ToString()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Next
|
Next
|
||||||
|
|
||||||
dataTable.Rows.Add(columns)
|
dataTable.Rows.Add(columns)
|
||||||
curRow += 1
|
curRow += 1
|
||||||
|
|
||||||
End While
|
End While
|
||||||
|
|
||||||
Return dataTable
|
Return dataTable
|
||||||
|
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -588,8 +588,8 @@ Partial Class Inventarios_EntradasSalidas
|
|||||||
If DtMov.Rows(0)("CvePrePoliza").ToString.ToEntero > 0 Then
|
If DtMov.Rows(0)("CvePrePoliza").ToString.ToEntero > 0 Then
|
||||||
HplPrePoliza.Visible = True
|
HplPrePoliza.Visible = True
|
||||||
HplPrePoliza.NavigateUrl = String.Format("/Contabilidad/RegPrePoliza.aspx?CvePrePoliza={0}", DtMov.Rows(0)("CvePrePoliza"))
|
HplPrePoliza.NavigateUrl = String.Format("/Contabilidad/RegPrePoliza.aspx?CvePrePoliza={0}", DtMov.Rows(0)("CvePrePoliza"))
|
||||||
CvePrePoliza = DtMov.Rows(0)("CvePrePoliza").ToString.ToEntero
|
CvePrePoliza = DtMov.Rows(0)("CvePrePoliza").ToString.ToEntero
|
||||||
Else
|
Else
|
||||||
If UsuarioActual.CveRol = 1 Then
|
If UsuarioActual.CveRol = 1 Then
|
||||||
BtnGeneraPrepoliza.Visible = True
|
BtnGeneraPrepoliza.Visible = True
|
||||||
End If
|
End If
|
||||||
@@ -874,7 +874,18 @@ Partial Class Inventarios_EntradasSalidas
|
|||||||
TxtFecha.Enabled = True
|
TxtFecha.Enabled = True
|
||||||
ImgFecha.Enabled = True
|
ImgFecha.Enabled = True
|
||||||
TxtObservaciones.Enabled = True
|
TxtObservaciones.Enabled = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
Dim ObjContabilidad As New ClsContabilidad
|
||||||
|
If ObjContabilidad.GetPrePoliza(CvePrePoliza, UsuarioActual.CveEmpresa) Then
|
||||||
|
Dim dr As DataRow = ObjContabilidad.DtResultados.FiltroPrimero("")
|
||||||
|
If dr IsNot Nothing Then
|
||||||
|
If dr("IdPoliza").ToString.ToEntero > 0 Then
|
||||||
|
BtnEliminar.Visible = False
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
ObjContabilidad.Dispose()
|
||||||
|
|
||||||
'SI TIENE PREPOLIZA NO SE DEBE PODER EDITAR
|
'SI TIENE PREPOLIZA NO SE DEBE PODER EDITAR
|
||||||
If Mov.TienePrePoliza > 0 Then
|
If Mov.TienePrePoliza > 0 Then
|
||||||
|
|||||||
@@ -1897,83 +1897,91 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Function GeneraPrePolizaSalidaEntregaDirecta(CveMovimiento As Integer, ByRef ObjInventario As ClsInventarios, ByRef ObjConta As ClsContabilidad, ByRef ObjContaContPAQ As ClsContPAQi) As Boolean
|
Private Function GeneraPrePolizaSalidaEntregaDirecta(CveMovimiento As Integer, ByRef ObjInventario As ClsInventarios, ByRef ObjConta As ClsContabilidad, ByRef ObjContaContPAQ As ClsContPAQi) As Boolean
|
||||||
Dim DtCostos As DataTable = Nothing
|
Dim Retorno As Boolean = True
|
||||||
Dim ValorInventario As Decimal = 0
|
Try
|
||||||
Dim ValorInventarioME As Decimal = 0
|
Dim DtCostos As DataTable = Nothing
|
||||||
Dim CveConcepto As Integer = 3
|
Dim ValorInventario As Decimal = 0
|
||||||
Dim Retorno As Boolean = True
|
Dim ValorInventarioME As Decimal = 0
|
||||||
|
Dim CveConcepto As Integer = 3
|
||||||
ObjInventario.GetMovimientos(CveMovimiento, -1, -1, UsuarioActual.CveEmpresa)
|
|
||||||
Dim CveVenta As Integer = ObjInventario.CveVenta
|
ObjInventario.GetMovimientos(CveMovimiento, -1, -1, UsuarioActual.CveEmpresa)
|
||||||
Dim CveAlmacen As Integer = ObjInventario.CveAlmacen
|
Dim CveVenta As Integer = ObjInventario.CveVenta
|
||||||
Dim SerieFolio As String = ObjInventario.DtResultados.Rows(0)("SerieFolioVenta").ToString
|
Dim CveAlmacen As Integer = ObjInventario.CveAlmacen
|
||||||
Dim MovAlmacen As Boolean = True
|
Dim SerieFolio As String = ObjInventario.DtResultados.Rows(0)("SerieFolioVenta").ToString
|
||||||
|
Dim MovAlmacen As Boolean = True
|
||||||
Dim OrigenMov As Integer = GlobalDTInvConceptos.FiltroPrimeroValor("Origen", "CveConcepto = " & CveConcepto).ToEntero
|
|
||||||
If OrigenMov = 1 Then MovAlmacen = False Else MovAlmacen = True
|
Dim OrigenMov As Integer = GlobalDTInvConceptos.FiltroPrimeroValor("Origen", "CveConcepto = " & CveConcepto).ToEntero
|
||||||
|
If OrigenMov = 1 Then MovAlmacen = False Else MovAlmacen = True
|
||||||
If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then
|
|
||||||
DtCostos = ObjInventario.DtResultados
|
If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then
|
||||||
Dim tmpCostos As DataTable = DtCostos.FiltraParametros("", "", {"CveClasificacion"})
|
DtCostos = ObjInventario.DtResultados
|
||||||
Dim IdCtaContable As Integer = 0
|
Dim tmpCostos As DataTable = DtCostos.FiltraParametros("", "", {"CveClasificacion"})
|
||||||
Dim ConceptoPoliza As String = String.Format("{0}-{1}", "Salida de Almacen", SerieFolio)
|
Dim IdCtaContable As Integer = 0
|
||||||
|
Dim ConceptoPoliza As String = String.Format("{0}-{1}", "Salida de Almacen", SerieFolio)
|
||||||
If tmpCostos.Rows.Count > 0 Then
|
|
||||||
Dim Concepto As String = ConceptoPoliza
|
If tmpCostos.Rows.Count > 0 Then
|
||||||
Dim CvePrePoliza = ObjConta.AddPrePolizas("Inv_EntradaSalida", 74, DtCostos.SUM("Total"), DtCostos.SUM("Total"), 1, TxtFecha.Text.ToDate, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
Dim Concepto As String = ConceptoPoliza
|
||||||
Dim tCveSubProyecto = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen={CveAlmacen}").ToEntero
|
Dim CvePrePoliza = ObjConta.AddPrePolizas("Inv_EntradaSalida", 74, DtCostos.SUM("Total"), DtCostos.SUM("Total"), 1, TxtFecha.Text.ToDate, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||||
Dim tCveConcepto As Integer = 69
|
Dim tCveSubProyecto = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen={CveAlmacen}").ToEntero
|
||||||
|
Dim tCveConcepto As Integer = 69
|
||||||
For Each RowInv As DataRow In tmpCostos.Rows
|
|
||||||
ValorInventario = DtCostos.SUM("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").ToString.ToDecimal.RoundSQL
|
For Each RowInv As DataRow In tmpCostos.Rows
|
||||||
If tCveConcepto = 69 Then
|
ValorInventario = DtCostos.SUM("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").ToString.ToDecimal.RoundSQL
|
||||||
IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero
|
If tCveConcepto = 69 Then
|
||||||
End If
|
IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero
|
||||||
|
End If
|
||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, ValorInventario, Concepto, tCveConcepto, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=ValorInventario, CveSubProyecto:=tCveSubProyecto) Then
|
|
||||||
Retorno = False
|
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, ValorInventario, Concepto, tCveConcepto, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=ValorInventario, CveSubProyecto:=tCveSubProyecto) Then
|
||||||
Exit For
|
Retorno = False
|
||||||
End If
|
Exit For
|
||||||
Next
|
End If
|
||||||
|
Next
|
||||||
IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen={CveAlmacen}").ToEntero
|
|
||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, MovAlmacen, DtCostos.SUMD("Total").RoundSQL, Concepto, 68, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=DtCostos.SUMD("Total").RoundSQL) Then
|
IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen={CveAlmacen}").ToEntero
|
||||||
Retorno = False
|
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, MovAlmacen, DtCostos.SUMD("Total").RoundSQL, Concepto, 68, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=DtCostos.SUMD("Total").RoundSQL) Then
|
||||||
End If
|
Retorno = False
|
||||||
|
End If
|
||||||
|
|
||||||
If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, -1) Then
|
|
||||||
If ObjConta.ValorPolizaDescuadre > 0 Then
|
If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, -1) Then
|
||||||
GuardaLogAD($"Inventarios/RecepcionAlmacen-PPCompOC | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
|
If ObjConta.ValorPolizaDescuadre > 0 Then
|
||||||
Retorno = False
|
GuardaLogAD($"Inventarios/RecepcionAlmacen-PPCompOC | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
|
||||||
End If
|
Retorno = False
|
||||||
End If
|
End If
|
||||||
|
End If
|
||||||
'CONTABILIZAR - SIMPLIFICAR
|
|
||||||
If Retorno Then
|
'CONTABILIZAR - SIMPLIFICAR
|
||||||
If UsuarioActual.Empresa.Funcionalidad(220) <> "" Then
|
If Retorno Then
|
||||||
If Not ObjConta.PrePolizaSimplificacion(CvePrePoliza, UsuarioActual.CveEmpresa) Then
|
If UsuarioActual.Empresa.Funcionalidad(220) <> "" Then
|
||||||
Retorno = False
|
If Not ObjConta.PrePolizaSimplificacion(CvePrePoliza, UsuarioActual.CveEmpresa) Then
|
||||||
End If
|
Retorno = False
|
||||||
End If
|
End If
|
||||||
|
End If
|
||||||
If UsuarioActual.Empresa.Funcionalidad(200) = "1" Then
|
|
||||||
If ObjContaContPAQ Is Nothing Then
|
If UsuarioActual.Empresa.Funcionalidad(200) = "1" Then
|
||||||
ObjContaContPAQ = New ClsContPAQi(UsuarioActual.Empresa)
|
If ObjContaContPAQ Is Nothing Then
|
||||||
ObjContaContPAQ.IniciaTransacSQL()
|
ObjContaContPAQ = New ClsContPAQi(UsuarioActual.Empresa)
|
||||||
End If
|
ObjContaContPAQ.IniciaTransacSQL()
|
||||||
|
End If
|
||||||
If Not ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContaContPAQ) Then
|
|
||||||
Retorno = False
|
If Not ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContaContPAQ) Then
|
||||||
End If
|
Retorno = False
|
||||||
End If
|
End If
|
||||||
|
End If
|
||||||
End If
|
|
||||||
|
End If
|
||||||
End If
|
Else
|
||||||
End If
|
Retorno = False
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
Retorno = False
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al guadar la prepoliza", ex)
|
||||||
|
Retorno = False
|
||||||
|
End Try
|
||||||
|
|
||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|||||||
@@ -1465,8 +1465,6 @@ Partial Class Inventarios_RecepcionEntrega
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
'VALIDA CANTIDAD DE SALIDA
|
'VALIDA CANTIDAD DE SALIDA
|
||||||
Dim Cantidad As Decimal = 0.0D
|
Dim Cantidad As Decimal = 0.0D
|
||||||
For Each Gvr As GridViewRow In GvDatos.Rows
|
For Each Gvr As GridViewRow In GvDatos.Rows
|
||||||
@@ -2214,122 +2212,123 @@ Partial Class Inventarios_RecepcionEntrega
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
' SE REALIZARA AL MOMENTO DE CANCELAR LA FACTURA {
|
||||||
'DEVOLUCION REMISION - REGRESA LAS EXISTENCIAS A ENTREGA POR ADELANTADO SI LA FACTURA VIENE DE REMISION
|
'DEVOLUCION REMISION - REGRESA LAS EXISTENCIAS A ENTREGA POR ADELANTADO SI LA FACTURA VIENE DE REMISION
|
||||||
If Not ErrorMovInv And EsDevolucionVenta = 1 And TipoDocto = "Ing" Then
|
|
||||||
Dim DtDevRem As New DataTable
|
|
||||||
Dim DtMovtosDev As New DataTable
|
|
||||||
Dim CveAlmacenTraspasoDestinoDevRem = -1
|
|
||||||
|
|
||||||
Dim CveVentaDetalleRem = -1
|
'If Not ErrorMovInv And EsDevolucionVenta = 1 And TipoDocto = "Ing" Then
|
||||||
Dim CantidadDevolver As Decimal = 0
|
' Dim DtDevRem As New DataTable
|
||||||
Dim CantidadRem As Decimal = 0
|
' Dim DtMovtosDev As New DataTable
|
||||||
|
' Dim CveAlmacenTraspasoDestinoDevRem = -1
|
||||||
|
|
||||||
'CARGA REMISIONES DE LA VENTA DEVUELTA
|
' Dim CveVentaDetalleRem = -1
|
||||||
If ObjInventario.GetDevolucionRemisionesFacturadas(CveVentaSurtir) Then
|
' Dim CantidadDevolver As Decimal = 0
|
||||||
DtDevRem = ObjInventario.DtResultados.FiltraParametros("CantidadAlmacen > 0")
|
' Dim CantidadRem As Decimal = 0
|
||||||
Else
|
|
||||||
ErrorMovInv = True
|
|
||||||
End If
|
|
||||||
|
|
||||||
'CARGA CONCEPTOS DEVUELTOS EN LA VENTA
|
' 'CARGA REMISIONES DE LA VENTA DEVUELTA
|
||||||
If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then
|
' If ObjInventario.GetDevolucionRemisionesFacturadas(CveVentaSurtir) Then
|
||||||
DtMovtosDev = ObjInventario.DtResultados
|
' DtDevRem = ObjInventario.DtResultados.FiltraParametros("CantidadAlmacen > 0")
|
||||||
Else
|
' Else
|
||||||
ErrorMovInv = True
|
' ErrorMovInv = True
|
||||||
End If
|
' End If
|
||||||
|
|
||||||
If Not ErrorMovInv Then
|
' 'CARGA CONCEPTOS DEVUELTOS EN LA VENTA
|
||||||
If DtDevRem.Rows.Count > 0 And DtMovtosDev.Rows.Count > 0 Then
|
' If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then
|
||||||
|
' DtMovtosDev = ObjInventario.DtResultados
|
||||||
|
' Else
|
||||||
|
' ErrorMovInv = True
|
||||||
|
' End If
|
||||||
|
|
||||||
For Each DrMovtos As DataRow In DtDevRem.FiltraParametros("", "CveRem", {"CveRem", "CveAlmacenTraspasoDestino"}).Rows
|
' If Not ErrorMovInv Then
|
||||||
CveAlmacenTraspasoDestinoDevRem = DrMovtos("CveAlmacenTraspasoDestino").ToString.ToEntero
|
' If DtDevRem.Rows.Count > 0 And DtMovtosDev.Rows.Count > 0 Then
|
||||||
If Not CveAlmacenTraspasoDestinoDevRem > 0 Then
|
|
||||||
ErrorMovInv = True
|
|
||||||
TextoError = "Ocurrió un error al obtener el almacén de devolucion de remisión."
|
|
||||||
Exit For
|
|
||||||
End If
|
|
||||||
|
|
||||||
'SALIDA GENERAL
|
' For Each DrMovtos As DataRow In DtDevRem.FiltraParametros("", "CveRem", {"CveRem", "CveAlmacenTraspasoDestino"}).Rows
|
||||||
CveMovimientoSalidaDevRem = ObjInventario.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero, 8, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveMovimientoRelacionado:=CveMovimiento, CveAlmacenDestino:=CveAlmacenTraspasoDestinoDevRem)
|
' CveAlmacenTraspasoDestinoDevRem = DrMovtos("CveAlmacenTraspasoDestino").ToString.ToEntero
|
||||||
FolioMovimientoSalidaDevRem = ObjInventario.Folio
|
' If Not CveAlmacenTraspasoDestinoDevRem > 0 Then
|
||||||
|
' ErrorMovInv = True
|
||||||
|
' TextoError = "Ocurrió un error al obtener el almacén de devolucion de remisión."
|
||||||
|
' Exit For
|
||||||
|
' End If
|
||||||
|
|
||||||
'ENTRADA ADELANTADO
|
' 'SALIDA GENERAL
|
||||||
CveMovimientoEntradaDevRem = ObjInventario.AddMovimiento(CveAlmacenTraspasoDestinoDevRem, 9, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveMovimientoRelacionado:=CveMovimientoSalidaDevRem, CveAlmacenDestino:=DdlAlmacen.SelectedValue.ToEntero)
|
' CveMovimientoSalidaDevRem = ObjInventario.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero, 8, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveMovimientoRelacionado:=CveMovimiento, CveAlmacenDestino:=CveAlmacenTraspasoDestinoDevRem)
|
||||||
FolioMovimientoEntradaDevRem = ObjInventario.Folio
|
' FolioMovimientoSalidaDevRem = ObjInventario.Folio
|
||||||
|
|
||||||
If Not (CveMovimientoSalidaDevRem > 0 And CveMovimientoEntradaDevRem > 0) Then
|
' 'ENTRADA ADELANTADO
|
||||||
ErrorMovInv = True
|
' CveMovimientoEntradaDevRem = ObjInventario.AddMovimiento(CveAlmacenTraspasoDestinoDevRem, 9, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveMovimientoRelacionado:=CveMovimientoSalidaDevRem, CveAlmacenDestino:=DdlAlmacen.SelectedValue.ToEntero)
|
||||||
TextoError = "Ocurrió un error al generar los movimientos de devolución a remisión."
|
' FolioMovimientoEntradaDevRem = ObjInventario.Folio
|
||||||
Exit For
|
|
||||||
End If
|
' If Not (CveMovimientoSalidaDevRem > 0 And CveMovimientoEntradaDevRem > 0) Then
|
||||||
|
' ErrorMovInv = True
|
||||||
|
' TextoError = "Ocurrió un error al generar los movimientos de devolución a remisión."
|
||||||
|
' Exit For
|
||||||
|
' End If
|
||||||
|
|
||||||
|
|
||||||
'SALIDA POR TRAPASO DE GENERAL
|
' 'SALIDA POR TRAPASO DE GENERAL
|
||||||
For Each DrRem As DataRow In DtDevRem.FiltraParametros($"CveRem = {DrMovtos("CveRem")}").Rows
|
' For Each DrRem As DataRow In DtDevRem.FiltraParametros($"CveRem = {DrMovtos("CveRem")}").Rows
|
||||||
CveVentaDetalleRem = DrRem("CveVentaDetalleRem").ToString.ToEntero
|
' CveVentaDetalleRem = DrRem("CveVentaDetalleRem").ToString.ToEntero
|
||||||
CantidadRem = DrRem("CantidadFacturada").ToString.ToDecimal
|
' CantidadRem = DrRem("CantidadFacturada").ToString.ToDecimal
|
||||||
'CantidadDevolver = DtMovtosDev.FiltroPrimeroValor("Cantidad", $"CveVentaDetalle = {DrRem("CveVentaDetalle").ToString.ToEntero}").ToDouble
|
' 'CantidadDevolver = DtMovtosDev.FiltroPrimeroValor("Cantidad", $"CveVentaDetalle = {DrRem("CveVentaDetalle").ToString.ToEntero}").ToDouble
|
||||||
'If (Dr("Cantidad").ToString.ToDouble > CantidadRem, CantidadRem, Dr("Cantidad").ToString.ToDouble) Then
|
' 'If (Dr("Cantidad").ToString.ToDouble > CantidadRem, CantidadRem, Dr("Cantidad").ToString.ToDouble) Then
|
||||||
|
|
||||||
If Not CveVentaDetalleRem > 0 Then
|
' If Not CveVentaDetalleRem > 0 Then
|
||||||
ErrorMovInv = True
|
' ErrorMovInv = True
|
||||||
TextoError = "Ocurrió un error al obtener la relación de la venta con la remisión."
|
' TextoError = "Ocurrió un error al obtener la relación de la venta con la remisión."
|
||||||
Exit For
|
' Exit For
|
||||||
End If
|
' End If
|
||||||
|
|
||||||
For Each Dr As DataRow In DtMovtosDev.FiltraParametros($"CveVentaDetalle = {DrRem("CveVentaDetalle").ToString.ToEntero}").Rows
|
' For Each Dr As DataRow In DtMovtosDev.FiltraParametros($"CveVentaDetalle = {DrRem("CveVentaDetalle").ToString.ToEntero}").Rows
|
||||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaDevRem, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveVentaDetalle:=CveVentaDetalleRem, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString) Then
|
' If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaDevRem, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveVentaDetalle:=CveVentaDetalleRem, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString) Then
|
||||||
ErrorMovInv = True
|
' ErrorMovInv = True
|
||||||
TextoError = "Ocurrió un error al guardar los movimientos de salida de traspaso de devolucion de remisión."
|
' TextoError = "Ocurrió un error al guardar los movimientos de salida de traspaso de devolucion de remisión."
|
||||||
Exit For
|
' Exit For
|
||||||
End If
|
' End If
|
||||||
Next
|
' Next
|
||||||
|
|
||||||
If ErrorMovInv Then
|
' If ErrorMovInv Then
|
||||||
Exit For
|
' Exit For
|
||||||
End If
|
' End If
|
||||||
Next
|
' Next
|
||||||
|
|
||||||
If ErrorMovInv Then
|
' If ErrorMovInv Then
|
||||||
Exit For
|
' Exit For
|
||||||
End If
|
' End If
|
||||||
|
|
||||||
'ENTRADA POR TRAPASO A ENTREGA POR ADELANTADO
|
' 'ENTRADA POR TRAPASO A ENTREGA POR ADELANTADO
|
||||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaDevRem, UsuarioActual.CveEmpresa) Then
|
' If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaDevRem, UsuarioActual.CveEmpresa) Then
|
||||||
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
' For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
||||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaDevRem, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString) Then
|
' If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaDevRem, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString) Then
|
||||||
ErrorMovInv = True
|
' ErrorMovInv = True
|
||||||
TextoError = "Ocurrió un error al guardar los movimientos de entrada de traspaso de devolucion de remisión."
|
' TextoError = "Ocurrió un error al guardar los movimientos de entrada de traspaso de devolucion de remisión."
|
||||||
Exit For
|
' Exit For
|
||||||
End If
|
' End If
|
||||||
Next
|
' Next
|
||||||
|
|
||||||
If ErrorMovInv Then
|
' If ErrorMovInv Then
|
||||||
Exit For
|
' Exit For
|
||||||
End If
|
' End If
|
||||||
|
|
||||||
Else
|
' Else
|
||||||
ErrorMovInv = True
|
' ErrorMovInv = True
|
||||||
TextoError = "Ocurrió un error al obtener los detalles de la devolución de almacén"
|
' TextoError = "Ocurrió un error al obtener los detalles de la devolución de almacén"
|
||||||
Exit For
|
' Exit For
|
||||||
End If
|
' End If
|
||||||
|
|
||||||
|
|
||||||
If Not ObjVentas.UpdateVentasDevolucionAlmacen(0, DrMovtos("CveRem").ToString.ToEntero) Then
|
' If Not ObjVentas.UpdateVentasDevolucionAlmacen(0, DrMovtos("CveRem").ToString.ToEntero) Then
|
||||||
TextoError = "Ocurrió un error al hacer la devolucion hacia la remision. Por favor vuelva a intentar."
|
' TextoError = "Ocurrió un error al hacer la devolucion hacia la remision. Por favor vuelva a intentar."
|
||||||
ErrorMovInv = True
|
' ErrorMovInv = True
|
||||||
Exit For
|
' Exit For
|
||||||
End If
|
' End If
|
||||||
|
|
||||||
Next
|
' Next
|
||||||
End If
|
' End If
|
||||||
Else
|
' Else
|
||||||
TextoError = "Ocurrió un error al hacer la devolucion a remisión. Por favor vuelva a intentar."
|
' TextoError = "Ocurrió un error al hacer la devolucion a remisión. Por favor vuelva a intentar."
|
||||||
ErrorMovInv = True
|
' ErrorMovInv = True
|
||||||
End If
|
' End If
|
||||||
|
'End If
|
||||||
End If
|
'}
|
||||||
|
|
||||||
'QUEMA DEVOLUCION | QUEMA = LA QUITA DE PENDIENTE POR RECIBIR (DEVOLVER)
|
'QUEMA DEVOLUCION | QUEMA = LA QUITA DE PENDIENTE POR RECIBIR (DEVOLVER)
|
||||||
If Not ErrorMovInv And EsDevolucionVenta = 1 Then
|
If Not ErrorMovInv And EsDevolucionVenta = 1 Then
|
||||||
|
|||||||
@@ -148,7 +148,13 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="row" id="DivFactura" runat="server" visible="false">
|
||||||
|
<label class="col-md-1 truncate" style="width: 110px">Factura:</label>
|
||||||
|
<div class="col-md-2">
|
||||||
|
<asp:DropDownList ID="DdlFactura" runat="server" CssClass="form-control input-sm select2me" Style="max-width: 200px" DataTextField="SerieFolio" DataValueField="CveVenta">
|
||||||
|
</asp:DropDownList>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="row" id="DivDepartamentoEntrega" runat="server" visible="False">
|
<div class="row" id="DivDepartamentoEntrega" runat="server" visible="False">
|
||||||
<label class="col-md-1 truncate" style="width: 110px">
|
<label class="col-md-1 truncate" style="width: 110px">
|
||||||
<asp:Label runat="server" ID="LblDepartamentoEntrega"> Depto. entrega:</asp:Label>
|
<asp:Label runat="server" ID="LblDepartamentoEntrega"> Depto. entrega:</asp:Label>
|
||||||
|
|||||||
@@ -373,18 +373,11 @@ Partial Class Inventarios_RecepcionUsados
|
|||||||
End Sub
|
End Sub
|
||||||
Private Sub PermisoVerImportes()
|
Private Sub PermisoVerImportes()
|
||||||
Dim TienePermisoImportes As Boolean = UsuarioActual.TienePermisoProceso(201)
|
Dim TienePermisoImportes As Boolean = UsuarioActual.TienePermisoProceso(201)
|
||||||
|
End Sub
|
||||||
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
|
||||||
Private Function isWhitFamily() As Boolean
|
|
||||||
Return (UsuarioActual.CveEmpresa = 66)
|
|
||||||
End Function
|
|
||||||
|
|
||||||
#Region " VALORES INICIALES "
|
#Region " VALORES INICIALES "
|
||||||
Protected Sub CreaDT()
|
Protected Sub CreaDT()
|
||||||
Dim dt As New DataTable
|
Dim dt As New DataTable
|
||||||
@@ -435,31 +428,16 @@ Partial Class Inventarios_RecepcionUsados
|
|||||||
DtMovimientosSalidaInvFisico = dt.Clone
|
DtMovimientosSalidaInvFisico = dt.Clone
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub CargaCombos()
|
Private Sub CargaCombos()
|
||||||
'Llenar el dropdownlist de Secciones
|
|
||||||
If UsuarioActual.CveEmpresa = 66 Then
|
|
||||||
'DdlClasificacion.DataSource = GlobalDTSubFamilias(UsuarioActual.CveEmpresa).FiltraParametros("", Orderby:="Clasificacion")
|
|
||||||
Else
|
|
||||||
Dim ObjClasificaciones As New ClsClasificaciones
|
|
||||||
If ObjClasificaciones.GetClasificacionesExistencias(UsuarioActual.CveEmpresa) Then
|
|
||||||
' DdlClasificacion.DataSource = ObjClasificaciones.DtResultados
|
|
||||||
End If
|
|
||||||
ObjClasificaciones.Dispose()
|
|
||||||
End If
|
|
||||||
'DdlClasificacion.DataBind()
|
|
||||||
|
|
||||||
DdlSeccion.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa)
|
DdlSeccion.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa)
|
||||||
DdlSeccion.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
DdlSeccion.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||||
DdlSeccion.DataBind()
|
DdlSeccion.DataBind()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
'Llenar el dropdownlist de monedas
|
'Llenar el dropdownlist de monedas
|
||||||
DdlMoneda.DataSource = GlobalDTMonedas
|
DdlMoneda.DataSource = GlobalDTMonedas
|
||||||
DdlMoneda.DataBind()
|
DdlMoneda.DataBind()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
'Llenar el dropdownlist de almacén
|
'Llenar el dropdownlist de almacén
|
||||||
DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen IN (22)") 'GlobalDTAlmacen(UsuarioActual.CveEmpresa)
|
DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen IN (22)") 'GlobalDTAlmacen(UsuarioActual.CveEmpresa)
|
||||||
|
|
||||||
@@ -472,10 +450,7 @@ Partial Class Inventarios_RecepcionUsados
|
|||||||
DdlAlmacen_SelectedIndexChanged(DdlAlmacen, EventArgs.Empty)
|
DdlAlmacen_SelectedIndexChanged(DdlAlmacen, EventArgs.Empty)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
CargaPS()
|
CargaPS()
|
||||||
|
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub CargaPS()
|
Private Sub CargaPS()
|
||||||
Dim ObjAcum As New ClsAcumuladores
|
Dim ObjAcum As New ClsAcumuladores
|
||||||
@@ -487,45 +462,24 @@ Partial Class Inventarios_RecepcionUsados
|
|||||||
|
|
||||||
If drow("CvePSCargo").ToString.ToEntero > 0 Then
|
If drow("CvePSCargo").ToString.ToEntero > 0 Then
|
||||||
lista.Add(drow("CvePSCargo").ToString)
|
lista.Add(drow("CvePSCargo").ToString)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Next
|
Next
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If lista.Count > 0 Then
|
If lista.Count > 0 Then
|
||||||
|
|
||||||
Filtro = "CvePS in(" & String.Join(",", lista) & ")"
|
Filtro = "CvePS in(" & String.Join(",", lista) & ")"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
'DdlProducto2.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltraParametros("CveTamaño > 0")
|
|
||||||
' Filtro
|
|
||||||
|
|
||||||
DdlProducto2.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltraParametros(Filtro)
|
DdlProducto2.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltraParametros(Filtro)
|
||||||
DdlProducto2.DataBind()
|
DdlProducto2.DataBind()
|
||||||
DdlProducto2.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
DdlProducto2.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'DdlProducto2.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1")
|
|
||||||
|
|
||||||
'If UsuarioActual.CveEmpresa = 66 Then
|
|
||||||
' DdlProducto2.ddlWS.Attributes.Add("data-pagina", "Inventarios")
|
|
||||||
'End If
|
|
||||||
|
|
||||||
'If Not DdlProducto2.UsaWebService AndAlso CType(DdlProducto2.DataSource, DataTable) Is Nothing Then
|
|
||||||
|
|
||||||
' DdlProducto2.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltraParametros("CveTipoPS = 2")
|
|
||||||
' DdlProducto2.DataBind()
|
|
||||||
' DdlProducto2.ddl.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
|
||||||
|
|
||||||
'End If
|
|
||||||
ObjAcum.Dispose()
|
ObjAcum.Dispose()
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub CargaSubProyectos()
|
Private Sub CargaSubProyectos()
|
||||||
DdlSubProyecto.DataSource = If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110), GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1), GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa, 1))
|
DdlSubProyecto.DataSource = If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110), GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1), GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa, 1))
|
||||||
DdlSubProyecto.DataBind()
|
DdlSubProyecto.DataBind()
|
||||||
|
|
||||||
|
|
||||||
'DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
'DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||||
End Sub
|
End Sub
|
||||||
@@ -564,13 +518,12 @@ Partial Class Inventarios_RecepcionUsados
|
|||||||
DdlPersonal.DataSource = dt
|
DdlPersonal.DataSource = dt
|
||||||
DdlPersonal.DataBind()
|
DdlPersonal.DataBind()
|
||||||
'DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
'DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
|
||||||
#Region " CARGA DATOS "
|
#Region " CARGA DATOS "
|
||||||
|
|
||||||
|
|
||||||
Private Sub BloqueaEdicionEncabezado()
|
Private Sub BloqueaEdicionEncabezado()
|
||||||
|
|
||||||
|
|
||||||
@@ -596,11 +549,10 @@ Partial Class Inventarios_RecepcionUsados
|
|||||||
DdlSeccion.Enabled = False
|
DdlSeccion.Enabled = False
|
||||||
End If
|
End If
|
||||||
UppGrid.Update()
|
UppGrid.Update()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
|
||||||
#Region " BOTONES: ELIMINAR, NUEVO "
|
#Region " BOTONES: ELIMINAR, NUEVO "
|
||||||
Protected Sub BtnNuevo_Click(sender As Object, e As EventArgs) Handles BtnNuevo.Click
|
Protected Sub BtnNuevo_Click(sender As Object, e As EventArgs) Handles BtnNuevo.Click
|
||||||
'Response.Redirect("EntradasSalidas.aspx")
|
'Response.Redirect("EntradasSalidas.aspx")
|
||||||
@@ -993,8 +945,6 @@ Partial Class Inventarios_RecepcionUsados
|
|||||||
Dim ImporteConcepto = 0.0
|
Dim ImporteConcepto = 0.0
|
||||||
|
|
||||||
Try
|
Try
|
||||||
|
|
||||||
|
|
||||||
Dim CveSubProyecto = -1
|
Dim CveSubProyecto = -1
|
||||||
Dim ActivoFijo = -1
|
Dim ActivoFijo = -1
|
||||||
|
|
||||||
@@ -1015,16 +965,18 @@ Partial Class Inventarios_RecepcionUsados
|
|||||||
Dim tCveProveedor As Integer = -1
|
Dim tCveProveedor As Integer = -1
|
||||||
If DdlProveedor.SelectedValue.ToEntero > 0 Then tCveProveedor = DdlProveedor.SelectedValue.ToEntero
|
If DdlProveedor.SelectedValue.ToEntero > 0 Then tCveProveedor = DdlProveedor.SelectedValue.ToEntero
|
||||||
Dim CveVenta As Integer = -1
|
Dim CveVenta As Integer = -1
|
||||||
|
|
||||||
If CveRemisionRecibida > 0 Then
|
If CveRemisionRecibida > 0 Then
|
||||||
CveVenta = CveRemisionRecibida
|
CveVenta = CveRemisionRecibida
|
||||||
|
ElseIf EsDistribuidor AndAlso DdlFactura.SelectedValue.ToEntero() > 0 Then
|
||||||
|
CveVenta = DdlFactura.SelectedValue.ToEntero()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inv/ES", 53, 0, 0, 1, TxtFecha.Text.ToDate, $" {TxtObservaciones.Text}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=3)
|
'Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inv/ES", 53, 0, 0, 1, TxtFecha.Text.ToDate, $" {TxtObservaciones.Text}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=3)
|
||||||
CveMovimiento = ObjInventario.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero, CveConcepto, 1, Fecha, tFolio, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta,
|
CveMovimiento = ObjInventario.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero, CveConcepto, 1, Fecha, tFolio, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta,
|
||||||
CveSubProyecto, ActivoFijo, Guia:=TxtGuia.Text, Observaciones:=TxtObservaciones.Text, CvePersonal:=DdlPersonal.SelectedValue.ToEntero,
|
CveSubProyecto, ActivoFijo, Guia:=TxtGuia.Text, Observaciones:=TxtObservaciones.Text, CvePersonal:=DdlPersonal.SelectedValue.ToEntero,
|
||||||
Recibio:=TxtResponsable.Text.Trim, CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal, DepartamentoEntrega:=TxtDepartamentoEntrega.Text,
|
Recibio:=TxtResponsable.Text.Trim, CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal, DepartamentoEntrega:=TxtDepartamentoEntrega.Text,
|
||||||
PedidoContrato:=TxtPedidoContrato.Text, CveProveedor:=tCveProveedor)
|
PedidoContrato:=TxtPedidoContrato.Text, CveProveedor:=tCveProveedor)
|
||||||
|
|
||||||
|
|
||||||
If CveMovimiento <= 0 Then
|
If CveMovimiento <= 0 Then
|
||||||
Alert("No se pudo almacenar el movimiento correctamente", TipoMensaje.MsgError)
|
Alert("No se pudo almacenar el movimiento correctamente", TipoMensaje.MsgError)
|
||||||
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
|
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
|
||||||
@@ -1054,13 +1006,10 @@ Partial Class Inventarios_RecepcionUsados
|
|||||||
|
|
||||||
Dim CveConceptoUsados As Integer = If(RBLOpcion.SelectedValue.ToEntero = 2, 1, 2)
|
Dim CveConceptoUsados As Integer = If(RBLOpcion.SelectedValue.ToEntero = 2, 1, 2)
|
||||||
|
|
||||||
|
|
||||||
If RBLOpcion.SelectedValue.ToEntero <> 3 Then
|
If RBLOpcion.SelectedValue.ToEntero <> 3 Then
|
||||||
If EsDistribuidor Then
|
If EsDistribuidor Then
|
||||||
If Not ObjAcum.DistribuidorMovtosAdd(DdlClientes.SelectedValue.ToEntero, Dr("Cantidad").ToString.ToEntero(), Dr("CveTamaño").ToString.ToEntero, CveConceptoUsados, -1, UsuarioActual.CveUsuario,
|
If Not ObjAcum.DistribuidorMovtosAdd(DdlClientes.SelectedValue.ToEntero, Dr("Cantidad").ToString.ToEntero(), Dr("CveTamaño").ToString.ToEntero, CveConceptoUsados, -1, UsuarioActual.CveUsuario,
|
||||||
UsuarioActual.CveEmpresa, 0, Dr("Observaciones").ToString, CveMovimiento:=CveMovimiento) Then
|
UsuarioActual.CveEmpresa, 0, Dr("Observaciones").ToString, CveMovimiento:=CveMovimiento) Then
|
||||||
|
|
||||||
|
|
||||||
'CveCliente As Integer, Cantidad As Integer, CveTamaño As Integer, CveConcepto As Integer, CveVenta As Integer, CveUsuario As Integer,
|
'CveCliente As Integer, Cantidad As Integer, CveTamaño As Integer, CveConcepto As Integer, CveVenta As Integer, CveUsuario As Integer,
|
||||||
'CveEmpresa As Integer, ImporteCompras As Decimal, Observaciones As String
|
'CveEmpresa As Integer, ImporteCompras As Decimal, Observaciones As String
|
||||||
|
|
||||||
@@ -1069,11 +1018,7 @@ Partial Class Inventarios_RecepcionUsados
|
|||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
Next
|
Next
|
||||||
|
|
||||||
If Not ErrorMovInv Then
|
If Not ErrorMovInv Then
|
||||||
@@ -1088,10 +1033,8 @@ Partial Class Inventarios_RecepcionUsados
|
|||||||
ObjInventario.Commit() ' aplica los movimientos insertados
|
ObjInventario.Commit() ' aplica los movimientos insertados
|
||||||
'If ObjContaAC IsNot Nothing Then ObjContaAC.Commit()
|
'If ObjContaAC IsNot Nothing Then ObjContaAC.Commit()
|
||||||
|
|
||||||
|
|
||||||
Alert(Msg.ToString, TipoMensaje.MsgInformacion)
|
Alert(Msg.ToString, TipoMensaje.MsgInformacion)
|
||||||
|
|
||||||
|
|
||||||
'Limpia Valores cuando inserta de campos especiales
|
'Limpia Valores cuando inserta de campos especiales
|
||||||
If UsuarioActual.CveEmpresa = 66 Then
|
If UsuarioActual.CveEmpresa = 66 Then
|
||||||
DdlSubProyecto.SelectedValueExist("-1")
|
DdlSubProyecto.SelectedValueExist("-1")
|
||||||
@@ -1103,7 +1046,6 @@ Partial Class Inventarios_RecepcionUsados
|
|||||||
UPDatos.Update()
|
UPDatos.Update()
|
||||||
LimpiarMovimiento()
|
LimpiarMovimiento()
|
||||||
|
|
||||||
|
|
||||||
Else
|
Else
|
||||||
ObjInventario.RollBack() 'deshace lo insertado
|
ObjInventario.RollBack() 'deshace lo insertado
|
||||||
CveMovimiento = 0
|
CveMovimiento = 0
|
||||||
@@ -1111,18 +1053,11 @@ Partial Class Inventarios_RecepcionUsados
|
|||||||
Alert("ocurrió un Error al registrar los movimientos", TipoMensaje.MsgError)
|
Alert("ocurrió un Error al registrar los movimientos", TipoMensaje.MsgError)
|
||||||
' RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
|
' RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
CargaGVM(DtMovimientos.FiltraParametros("Estatus <> 'E' "))
|
CargaGVM(DtMovimientos.FiltraParametros("Estatus <> 'E' "))
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
ObjInventario.RollBack() 'deshace lo insertado
|
ObjInventario.RollBack() 'deshace lo insertado
|
||||||
CveMovimiento = 0
|
CveMovimiento = 0
|
||||||
@@ -1138,11 +1073,11 @@ Partial Class Inventarios_RecepcionUsados
|
|||||||
Alert("No hay ningun registro para generar el movimiento. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgError)
|
Alert("No hay ningun registro para generar el movimiento. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgError)
|
||||||
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
|
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
|
||||||
#Region " ADD INVENTARIO INICIAL "
|
#Region " ADD INVENTARIO INICIAL "
|
||||||
Protected Sub BtnCodigoBarras_Click(sender As Object, e As EventArgs)
|
Protected Sub BtnCodigoBarras_Click(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
@@ -1218,12 +1153,11 @@ Partial Class Inventarios_RecepcionUsados
|
|||||||
|
|
||||||
TxtCodigoBarras.Focus()
|
TxtCodigoBarras.Focus()
|
||||||
RegistraScript("beep-07.wav')")
|
RegistraScript("beep-07.wav')")
|
||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
|
||||||
#Region " DdlConcepto, DdlClasificacion, DdlAlmacen | Index CHANGED "
|
#Region " DdlConcepto, DdlClasificacion, DdlAlmacen | Index CHANGED "
|
||||||
|
|
||||||
Protected Sub DdlAlmacen_SelectedIndexChanged(sender As Object, e As EventArgs)
|
Protected Sub DdlAlmacen_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
If EsConsumoInterno Then
|
If EsConsumoInterno Then
|
||||||
@@ -1270,34 +1204,6 @@ Partial Class Inventarios_RecepcionUsados
|
|||||||
FolioAsignado = Folio
|
FolioAsignado = Folio
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
'Protected Sub DdlClasificacion_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlClasificacion.SelectedIndexChanged
|
|
||||||
' ChangeDdlProducto()
|
|
||||||
'End Sub
|
|
||||||
'Private Sub ChangeDdlProducto()
|
|
||||||
' If UsuarioActual.Empresa.Funcionalidad(105) = "" Then
|
|
||||||
' Dim filtro As String = ""
|
|
||||||
' If Not (DdlClasificacion.SelectedValue = "-1") Then
|
|
||||||
|
|
||||||
' If isWhitFamily() Then
|
|
||||||
' filtro = String.Format("CveSubFamilia={0}", DdlClasificacion.SelectedValue)
|
|
||||||
' Else
|
|
||||||
' filtro = String.Format("CveClasificacion={0}", DdlClasificacion.SelectedValue)
|
|
||||||
' End If
|
|
||||||
' End If
|
|
||||||
|
|
||||||
' DdlProducto2.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltraParametros($"{filtro} AND CveTipoPS = 2", "PSCodigo")
|
|
||||||
' DdlProducto2.DataBind()
|
|
||||||
' DdlProducto2.ddl.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
|
||||||
' Else
|
|
||||||
' If isWhitFamily() Then
|
|
||||||
' DdlProducto2.ddlWS.Attributes.Add("data-idSubFamilia", DdlClasificacion.SelectedValue)
|
|
||||||
' Else
|
|
||||||
' DdlProducto2.ddlWS.Attributes.Add("data-idClasificacion", DdlClasificacion.SelectedValue)
|
|
||||||
' End If
|
|
||||||
' End If
|
|
||||||
'End Sub
|
|
||||||
|
|
||||||
|
|
||||||
Protected Sub DdlProducto2_SelectedIndexChanged(sender As Object, e As EventArgs)
|
Protected Sub DdlProducto2_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||||
ElProductoChange()
|
ElProductoChange()
|
||||||
End Sub
|
End Sub
|
||||||
@@ -1343,10 +1249,9 @@ Partial Class Inventarios_RecepcionUsados
|
|||||||
ObjAcum.Dispose()
|
ObjAcum.Dispose()
|
||||||
UPDatos.Update()
|
UPDatos.Update()
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
|
||||||
#Region " GVM "
|
#Region " GVM "
|
||||||
Private Sub CargaGVM(DtTemp As DataTable)
|
Private Sub CargaGVM(DtTemp As DataTable)
|
||||||
GvM.DataSource = DtTemp
|
GvM.DataSource = DtTemp
|
||||||
@@ -1441,16 +1346,9 @@ Partial Class Inventarios_RecepcionUsados
|
|||||||
|
|
||||||
CargaGVM(DtMovimientos.FiltraParametros("Estatus <> 'E' "))
|
CargaGVM(DtMovimientos.FiltraParametros("Estatus <> 'E' "))
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#Region " TIPO DE CAMBIO "
|
#Region " TIPO DE CAMBIO "
|
||||||
Protected Sub DdlMonedaTC_SelectedIndexChanged(sender As Object, e As EventArgs)
|
Protected Sub DdlMonedaTC_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||||
Select Case DdlMonedaTC.SelectedValue.ToEntero
|
Select Case DdlMonedaTC.SelectedValue.ToEntero
|
||||||
@@ -1485,14 +1383,13 @@ Partial Class Inventarios_RecepcionUsados
|
|||||||
'LtTotal.Text = DtMovimientos.SUM("Total", "").ToString.FormatoNumero
|
'LtTotal.Text = DtMovimientos.SUM("Total", "").ToString.FormatoNumero
|
||||||
|
|
||||||
UPDatos.Update()
|
UPDatos.Update()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
|
||||||
#Region " BITACORA "
|
#Region " BITACORA "
|
||||||
Private Sub InicializaBitacoraTemporal()
|
Private Sub InicializaBitacoraTemporal()
|
||||||
|
|
||||||
@@ -1693,61 +1590,56 @@ Partial Class Inventarios_RecepcionUsados
|
|||||||
UPEventoBitacora.Update()
|
UPEventoBitacora.Update()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#Region " CONSUMO INTERNO "
|
#Region " CONSUMO INTERNO "
|
||||||
'Private Sub ActivaConsumoInterno()
|
'Private Sub ActivaConsumoInterno()
|
||||||
' EsConsumoInterno = True
|
' EsConsumoInterno = True
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
' DdlAlmacen.AutoPostBack = False
|
' DdlAlmacen.AutoPostBack = False
|
||||||
' DivFolio1.Visible = False
|
' DivFolio1.Visible = False
|
||||||
' DivFolio2.Visible = False
|
' DivFolio2.Visible = False
|
||||||
|
|
||||||
' divMonedaSeccion.Visible = False
|
' divMonedaSeccion.Visible = False
|
||||||
' divGuia.Visible = False
|
' divGuia.Visible = False
|
||||||
' TrResponsable.Visible = False
|
' TrResponsable.Visible = False
|
||||||
' CargaPersonal()
|
' CargaPersonal()
|
||||||
|
|
||||||
|
|
||||||
' 'RECARGA ALMACENES SOLO DE CONSUMO INTERNO
|
' 'RECARGA ALMACENES SOLO DE CONSUMO INTERNO
|
||||||
' DdlAlmacen.Items.Clear()
|
' DdlAlmacen.Items.Clear()
|
||||||
' DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 22) 'GlobalDTAlmacen(UsuarioActual.CveEmpresa)
|
' DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 22) 'GlobalDTAlmacen(UsuarioActual.CveEmpresa)
|
||||||
' DdlAlmacen.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
' DdlAlmacen.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||||
' DdlAlmacen.SelectedValue = "-1"
|
' DdlAlmacen.SelectedValue = "-1"
|
||||||
' DdlAlmacen.DataBind()
|
' DdlAlmacen.DataBind()
|
||||||
' If IsNothing(Request("CveMovimiento")) Then
|
' If IsNothing(Request("CveMovimiento")) Then
|
||||||
' DdlAlmacen.SelectedValueExist(UsuarioActual.CveAlmacen)
|
' DdlAlmacen.SelectedValueExist(UsuarioActual.CveAlmacen)
|
||||||
' End If
|
' End If
|
||||||
|
|
||||||
'End Sub
|
'End Sub
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
|
||||||
#Region "PAQUETERIA GUIA"
|
#Region "PAQUETERIA GUIA"
|
||||||
'Protected Sub LnkAgregarGuia_Click(sender As Object, e As EventArgs)
|
'Protected Sub LnkAgregarGuia_Click(sender As Object, e As EventArgs)
|
||||||
' RegistraScript(String.Format("AbrirVentana('/General/PopUpPaqueteriasGuias.aspx?CveMovimiento={0}',800,620);", CveMovimiento))
|
' RegistraScript(String.Format("AbrirVentana('/General/PopUpPaqueteriasGuias.aspx?CveMovimiento={0}',800,620);", CveMovimiento))
|
||||||
'End Sub
|
'End Sub
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
|
||||||
#Region "DDL CLIENTE / CLIENTE SUCURSAL - SELECTED INDEX CHANGED"
|
#Region "DDL CLIENTE / CLIENTE SUCURSAL - SELECTED INDEX CHANGED"
|
||||||
Private Sub InicializaClientes()
|
Private Sub InicializaClientes()
|
||||||
|
|
||||||
@@ -1775,6 +1667,26 @@ Partial Class Inventarios_RecepcionUsados
|
|||||||
DivClienteSucursal.Visible = False
|
DivClienteSucursal.Visible = False
|
||||||
DdlClientesSucursales.Items.Clear()
|
DdlClientesSucursales.Items.Clear()
|
||||||
CargaSucursalesCliente()
|
CargaSucursalesCliente()
|
||||||
|
CargaFacturasCliente()
|
||||||
|
|
||||||
|
UpGenerales.Update()
|
||||||
|
End Sub
|
||||||
|
Private Sub CargaFacturasCliente()
|
||||||
|
DivFactura.Visible = True
|
||||||
|
Dim CveCliente As Integer = DdlClientes.SelectedValue.ToEntero()
|
||||||
|
If CveCliente > 0 Then
|
||||||
|
Me.EsDistribuidor = True
|
||||||
|
|
||||||
|
Dim ObjVentas As New ClsVentas
|
||||||
|
If ObjVentas.GetVentas(UsuarioActual.CveEmpresa, "-1", "-1", -1, "-1", CveCliente, -1, -1, -1, "-1", "-1", "-1", CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then
|
||||||
|
DdlFactura.DataSource = ObjVentas.DtResultados.Copy()
|
||||||
|
End If
|
||||||
|
ObjVentas.Dispose()
|
||||||
|
|
||||||
|
DdlFactura.DataBind()
|
||||||
|
DdlFactura.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||||
|
End If
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
Protected Sub CargaSucursalesCliente()
|
Protected Sub CargaSucursalesCliente()
|
||||||
DdlClientesSucursales.Enabled = True
|
DdlClientesSucursales.Enabled = True
|
||||||
@@ -1882,14 +1794,10 @@ Partial Class Inventarios_RecepcionUsados
|
|||||||
ObjInventario.Dispose()
|
ObjInventario.Dispose()
|
||||||
ObjConta.Dispose()
|
ObjConta.Dispose()
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Private Sub GuardarBitacora(CveVenta As Integer, RutaAdjunto As String, Obser As String)
|
Private Sub GuardarBitacora(CveVenta As Integer, RutaAdjunto As String, Obser As String)
|
||||||
Dim ObjEventos As New ClsOIEventos()
|
Dim ObjEventos As New ClsOIEventos()
|
||||||
|
|
||||||
@@ -1907,7 +1815,6 @@ Partial Class Inventarios_RecepcionUsados
|
|||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
Protected Sub LnkAgregarUsado_Click(sender As Object, e As EventArgs)
|
Protected Sub LnkAgregarUsado_Click(sender As Object, e As EventArgs)
|
||||||
AgregarUsado = True
|
AgregarUsado = True
|
||||||
ResetModalUsados()
|
ResetModalUsados()
|
||||||
@@ -1916,8 +1823,6 @@ Partial Class Inventarios_RecepcionUsados
|
|||||||
UpModalAgregar.Update()
|
UpModalAgregar.Update()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Protected Sub LnkModalAgregarUsado_Click(sender As Object, e As EventArgs)
|
Protected Sub LnkModalAgregarUsado_Click(sender As Object, e As EventArgs)
|
||||||
AgregarPS()
|
AgregarPS()
|
||||||
End Sub
|
End Sub
|
||||||
@@ -1970,7 +1875,6 @@ Partial Class Inventarios_RecepcionUsados
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub RBLOpcion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles RBLOpcion.SelectedIndexChanged
|
Private Sub RBLOpcion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles RBLOpcion.SelectedIndexChanged
|
||||||
|
|
||||||
If RBLOpcion.SelectedValue.ToEntero = 3 Then
|
If RBLOpcion.SelectedValue.ToEntero = 3 Then
|
||||||
DivCliente.Visible = False
|
DivCliente.Visible = False
|
||||||
Else
|
Else
|
||||||
@@ -1996,7 +1900,6 @@ Partial Class Inventarios_RecepcionUsados
|
|||||||
Me.CveRemisionRecibida = -1
|
Me.CveRemisionRecibida = -1
|
||||||
Me.CveRemisionRecibida = CType(CType(sender, LinkButton).NamingContainer, GridViewRow).DataKey("CveVenta").ToEntero()
|
Me.CveRemisionRecibida = CType(CType(sender, LinkButton).NamingContainer, GridViewRow).DataKey("CveVenta").ToEntero()
|
||||||
|
|
||||||
|
|
||||||
Dim DtUsados As DataTable = Nothing
|
Dim DtUsados As DataTable = Nothing
|
||||||
Dim CveCliente As Integer = -1
|
Dim CveCliente As Integer = -1
|
||||||
|
|
||||||
@@ -2008,10 +1911,13 @@ Partial Class Inventarios_RecepcionUsados
|
|||||||
|
|
||||||
If EsDistribuidor Then
|
If EsDistribuidor Then
|
||||||
DivCliente.Visible = True
|
DivCliente.Visible = True
|
||||||
|
DdlClientes.SelectedValueExist(CveCliente)
|
||||||
|
DdlClientes_SelectedIndexChanged(DdlClientes, EventArgs.Empty)
|
||||||
|
DdlFactura.SelectedValueExist(CveRemisionRecibida)
|
||||||
Else
|
Else
|
||||||
DivCliente.Visible = False
|
DivCliente.Visible = False
|
||||||
|
DivFactura.Visible = False
|
||||||
End If
|
End If
|
||||||
DdlClientes.SelectedValueExist(CveCliente)
|
|
||||||
|
|
||||||
If ObjVentas.GetVentasUsadosDetalle(CveRemisionRecibida) Then
|
If ObjVentas.GetVentasUsadosDetalle(CveRemisionRecibida) Then
|
||||||
DtUsados = ObjVentas.DtResultados.Copy()
|
DtUsados = ObjVentas.DtResultados.Copy()
|
||||||
|
|||||||
@@ -964,6 +964,7 @@ Partial Class OC
|
|||||||
DtDetalle.Columns.Add("CveContratoDetalle", GetType(Integer))
|
DtDetalle.Columns.Add("CveContratoDetalle", GetType(Integer))
|
||||||
DtDetalle.Columns.Add("CantidadNoEditable", GetType(Double))
|
DtDetalle.Columns.Add("CantidadNoEditable", GetType(Double))
|
||||||
|
|
||||||
|
DtDetalle.Columns.Add("CveOrdenCompraDetalle", GetType(Integer))
|
||||||
|
|
||||||
' DtDetalle.Columns.Add("ClasificacionOG", GetType(String))
|
' DtDetalle.Columns.Add("ClasificacionOG", GetType(String))
|
||||||
|
|
||||||
@@ -5872,7 +5873,7 @@ Partial Class OC
|
|||||||
|
|
||||||
Private Function ReadExcelFile(ByVal flatFilePath As String, ByVal firstRowHasHeaders As Boolean) As DataTable
|
Private Function ReadExcelFile(ByVal flatFilePath As String, ByVal firstRowHasHeaders As Boolean) As DataTable
|
||||||
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
|
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
|
||||||
Dim excelFile As ExcelFile = ExcelFile.Load(flatFilePath)
|
Dim excelFile As ExcelFile = excelFile.Load(flatFilePath)
|
||||||
|
|
||||||
Dim unnamed As Integer = 0
|
Dim unnamed As Integer = 0
|
||||||
Dim cols As Integer
|
Dim cols As Integer
|
||||||
|
|||||||
@@ -6401,6 +6401,38 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function CalculaTotalRNCChk(TxtImporte, Saldo, Chk) {
|
||||||
|
if (Chk.checked) {
|
||||||
|
TxtImporte.value = FormatoNumero(Saldo, 2);
|
||||||
|
} else {
|
||||||
|
TxtImporte.value = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ('<%= UsuarioActual.Empresa.Funcionalidad(344) %>' == '1')
|
||||||
|
{
|
||||||
|
CompararNC();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function LimitaCantidadRNCMasivo(TxtImporte,Saldo, Chk) {
|
||||||
|
var ImporteNuevo = TxtImporte.value;
|
||||||
|
Chk.checked = true;
|
||||||
|
|
||||||
|
if (ImporteNuevo > Saldo) {
|
||||||
|
ImporteNuevo = Saldo;
|
||||||
|
Entro = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Entro == 1) {
|
||||||
|
TxtImporte.value = FormatoNumero(ImporteNuevo, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ('<%= UsuarioActual.Empresa.Funcionalidad(344) %>' == '1')
|
||||||
|
{
|
||||||
|
CompararNC();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function LimitaCantidadNCMasivo(Porcentaje, Saldo, Total, Subtotal, TxtTotalGv, TxtTotal, Chk, TxtImporte) {
|
function LimitaCantidadNCMasivo(Porcentaje, Saldo, Total, Subtotal, TxtTotalGv, TxtTotal, Chk, TxtImporte) {
|
||||||
var ImporteNivel = 0, ImporteNuevo = 0, Entro = 0, ValorMaximoPorPorcentaje = 0, TotalConPorcentaje = 0, TotalImportes = 0;
|
var ImporteNivel = 0, ImporteNuevo = 0, Entro = 0, ValorMaximoPorPorcentaje = 0, TotalConPorcentaje = 0, TotalImportes = 0;
|
||||||
ImporteNivel = ($('#C_DdlNCNivelImporte').val() == "1" ? Total : Subtotal);
|
ImporteNivel = ($('#C_DdlNCNivelImporte').val() == "1" ? Total : Subtotal);
|
||||||
|
|||||||
@@ -6859,6 +6859,10 @@ Partial Class Ventas
|
|||||||
If CveVenta > 0 Then MensajeAlert = New StringBuilder
|
If CveVenta > 0 Then MensajeAlert = New StringBuilder
|
||||||
Dim ArchivoCotizacion As New System.IO.FileInfo(String.Format("{0}Formatos/Cotizacion.rdlc", UsuarioActual.Empresa.Ruta))
|
Dim ArchivoCotizacion As New System.IO.FileInfo(String.Format("{0}Formatos/Cotizacion.rdlc", UsuarioActual.Empresa.Ruta))
|
||||||
|
|
||||||
|
If Opcion = "Cot" And UsuarioActual.CveEmpresa = 141 Then
|
||||||
|
MensajeAlert.AppendFormat("<b><a class='Texto' href=""Ventas.aspx?CveVenta={0}"">Facturar</a></b><br/><br/>", CveVenta)
|
||||||
|
End If
|
||||||
|
|
||||||
If ArchivoCotizacion.Exists Then
|
If ArchivoCotizacion.Exists Then
|
||||||
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul><br/>", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=0", CveVenta)))
|
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul><br/>", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=0", CveVenta)))
|
||||||
Else
|
Else
|
||||||
@@ -7306,7 +7310,7 @@ Partial Class Ventas
|
|||||||
ObjFacturaDevolucion.Timbre = PreParaTimbre(ObjFacturaDevolucion)
|
ObjFacturaDevolucion.Timbre = PreParaTimbre(ObjFacturaDevolucion)
|
||||||
|
|
||||||
'Registramos la venta
|
'Registramos la venta
|
||||||
GuardarVenta(ObjVentas, ObjConta, ObjInventario, ObjContr, factura, tmpcon, -1, ObjContPaq, ObjBancos)
|
GuardarVenta(ObjVentas, ObjConta, ObjInventario, ObjContr, factura, tmpcon, -1, ObjContPaq, ObjBancos, EsNCAmortizacion:=True)
|
||||||
|
|
||||||
''Timbramos
|
''Timbramos
|
||||||
'If factura.TipoDocto.Contiene("Ing", "Egs", "Ant") Then
|
'If factura.TipoDocto.Contiene("Ing", "Egs", "Ant") Then
|
||||||
@@ -8801,7 +8805,9 @@ Partial Class Ventas
|
|||||||
|
|
||||||
|
|
||||||
#Region " GUARDAR - VENTA, PREPOLIZAS, INV, ESTIMACIONES, AC, NOTA DE CRÉDITO "
|
#Region " GUARDAR - VENTA, PREPOLIZAS, INV, ESTIMACIONES, AC, NOTA DE CRÉDITO "
|
||||||
Private Sub GuardarVenta(ByRef ObjVentas As ClsVentas, ByRef ObjConta As ClsContabilidad, ByRef ObjInventario As ClsInventarios, ByRef ObjContr As ClsContratos, factura As Modelos.Factura, TmpDTDetalle As DataTable, CveNCaVincular As Integer, ByRef objContPaqi As ClsContPAQi, Optional ByRef ObjBancos As ClsBancos = Nothing, Optional ByRef ObjOS As ClsOS = Nothing, ByRef Optional ObjEventos As ClsOIEventos = Nothing, ByRef Optional ObjCGame As ClsCGame = Nothing, ByRef Optional ObjCliente As ClsClientes = Nothing)
|
Private Sub GuardarVenta(ByRef ObjVentas As ClsVentas, ByRef ObjConta As ClsContabilidad, ByRef ObjInventario As ClsInventarios, ByRef ObjContr As ClsContratos, factura As Modelos.Factura, TmpDTDetalle As DataTable, CveNCaVincular As Integer,
|
||||||
|
ByRef objContPaqi As ClsContPAQi, Optional ByRef ObjBancos As ClsBancos = Nothing, Optional ByRef ObjOS As ClsOS = Nothing, ByRef Optional ObjEventos As ClsOIEventos = Nothing, ByRef Optional ObjCGame As ClsCGame = Nothing,
|
||||||
|
ByRef Optional ObjCliente As ClsClientes = Nothing, Optional EsNCAmortizacion As Boolean = False)
|
||||||
|
|
||||||
Dim Msgok As New StringBuilder
|
Dim Msgok As New StringBuilder
|
||||||
Dim CveAlmacenTraspasoOrigen As Integer = -1
|
Dim CveAlmacenTraspasoOrigen As Integer = -1
|
||||||
@@ -9125,8 +9131,10 @@ Partial Class Ventas
|
|||||||
GuardarVentaPrePolizas(ObjConta, factura, TmpDTDetalle, CveNCaVincular, objContPaqi, ObjBancos, ObjVentas, ObjEventos:=ObjEventos)
|
GuardarVentaPrePolizas(ObjConta, factura, TmpDTDetalle, CveNCaVincular, objContPaqi, ObjBancos, ObjVentas, ObjEventos:=ObjEventos)
|
||||||
If ErrorList.Count = 0 Then
|
If ErrorList.Count = 0 Then
|
||||||
'inventarios
|
'inventarios
|
||||||
If GuardarVentaInventarios(ObjInventario, ObjConta, factura) Then
|
If Not EsNCAmortizacion Then
|
||||||
ErrorList.Add("Ocurrio un error al Guardar Inventario")
|
If GuardarVentaInventarios(ObjInventario, ObjConta, factura) Then
|
||||||
|
ErrorList.Add("Ocurrio un error al Guardar Inventario")
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
If ErrorList.Count = 0 Then
|
If ErrorList.Count = 0 Then
|
||||||
'estimaciones
|
'estimaciones
|
||||||
@@ -9147,7 +9155,9 @@ Partial Class Ventas
|
|||||||
|
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub GuardarVentaPrePolizas(ByRef ObjConta As ClsContabilidad, factura As Modelos.Factura, TmpDTDetalleMovimientos As DataTable, CveNCaVincular As Integer, ByRef objContPaqi As ClsContPAQi, Optional ByRef ObjBancos As ClsBancos = Nothing, ByRef Optional ObjVentas As ClsVentas = Nothing, ByRef Optional ObjEventos As ClsOIEventos = Nothing)
|
Private Sub GuardarVentaPrePolizas(ByRef ObjConta As ClsContabilidad, factura As Modelos.Factura, TmpDTDetalleMovimientos As DataTable, CveNCaVincular As Integer,
|
||||||
|
ByRef objContPaqi As ClsContPAQi, Optional ByRef ObjBancos As ClsBancos = Nothing, ByRef Optional ObjVentas As ClsVentas = Nothing,
|
||||||
|
ByRef Optional ObjEventos As ClsOIEventos = Nothing, Optional EsNCAmortizacion As Boolean = False)
|
||||||
|
|
||||||
Dim CveIE As Integer = -1
|
Dim CveIE As Integer = -1
|
||||||
Dim DT As DataTable = Nothing
|
Dim DT As DataTable = Nothing
|
||||||
@@ -9175,7 +9185,9 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
Private Function ProcesoPrepolizas(ByRef ObjConta As ClsContabilidad, ObjFactura As Modelos.Factura, CveIE As Integer, TmpDTDetalle As DataTable, ByRef objContPaqi As ClsContPAQi, Optional ValorMultiplicador As Integer = 1, ByRef Optional ObjBancos As ClsBancos = Nothing, ByRef Optional ObjVentas As ClsVentas = Nothing, ByRef Optional ObjEventos As ClsOIEventos = Nothing) As Boolean
|
Private Function ProcesoPrepolizas(ByRef ObjConta As ClsContabilidad, ObjFactura As Modelos.Factura, CveIE As Integer, TmpDTDetalle As DataTable, ByRef objContPaqi As ClsContPAQi,
|
||||||
|
Optional ValorMultiplicador As Integer = 1, ByRef Optional ObjBancos As ClsBancos = Nothing, ByRef Optional ObjVentas As ClsVentas = Nothing,
|
||||||
|
ByRef Optional ObjEventos As ClsOIEventos = Nothing, Optional EsNCAmortizacion As Boolean = False) As Boolean
|
||||||
Try
|
Try
|
||||||
Dim DT As DataTable
|
Dim DT As DataTable
|
||||||
Dim CvePlantilaPoliza As Integer
|
Dim CvePlantilaPoliza As Integer
|
||||||
@@ -9422,146 +9434,149 @@ Partial Class Ventas
|
|||||||
TipoCambioNC = GlobalTipoCambio(TxtFecha.Text.ToDate).ToDecimal
|
TipoCambioNC = GlobalTipoCambio(TxtFecha.Text.ToDate).ToDecimal
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'APLICA NC SALDOS DIRECTOS
|
If Not EsNCAmortizacion Then
|
||||||
If DtVentasNC IsNot Nothing AndAlso DtVentasNC.Rows.Count > 0 Then
|
'APLICA NC SALDOS DIRECTOS
|
||||||
For Each Dr As DataRow In DtVentasNC.Rows
|
If DtVentasNC IsNot Nothing AndAlso DtVentasNC.Rows.Count > 0 Then
|
||||||
|
For Each Dr As DataRow In DtVentasNC.Rows
|
||||||
|
|
||||||
|
|
||||||
Dim Importe91 As Decimal = 0
|
Dim Importe91 As Decimal = 0
|
||||||
Dim ImporteMN91 As Decimal = 0
|
Dim ImporteMN91 As Decimal = 0
|
||||||
Dim Importe251 As Decimal = 0
|
Dim Importe251 As Decimal = 0
|
||||||
Dim ImporteMN251 As Decimal = 0
|
Dim ImporteMN251 As Decimal = 0
|
||||||
|
|
||||||
If DdlMoneda.SelectedValue.ToEntero = 1 AndAlso Not Dr("TCCambioValuacion").ToString.ToDecimal > 1 Then
|
If DdlMoneda.SelectedValue.ToEntero = 1 AndAlso Not Dr("TCCambioValuacion").ToString.ToDecimal > 1 Then
|
||||||
Importe251 = Dr("Importe").ToString.ToDecimal
|
Importe251 = Dr("Importe").ToString.ToDecimal
|
||||||
Importe91 = Dr("Importe").ToString.ToDecimal
|
Importe91 = Dr("Importe").ToString.ToDecimal
|
||||||
ImporteMN91 = Dr("Importe").ToString.ToDecimal
|
ImporteMN91 = Dr("Importe").ToString.ToDecimal
|
||||||
TipoCambioNC = 1
|
TipoCambioNC = 1
|
||||||
ElseIf DdlMoneda.SelectedValue.ToEntero = 2 AndAlso Not Dr("TCCambioValuacion").ToString.ToDecimal > 1 Then
|
ElseIf DdlMoneda.SelectedValue.ToEntero = 2 AndAlso Not Dr("TCCambioValuacion").ToString.ToDecimal > 1 Then
|
||||||
Importe251 = Dr("Importe").ToString.ToDecimal
|
Importe251 = Dr("Importe").ToString.ToDecimal
|
||||||
Importe91 = Dr("Importe").ToString.ToDecimal
|
Importe91 = Dr("Importe").ToString.ToDecimal
|
||||||
ImporteMN91 = Dr("Importe").ToString.ToDecimal * TipoCambioNC
|
ImporteMN91 = Dr("Importe").ToString.ToDecimal * TipoCambioNC
|
||||||
ElseIf DdlMoneda.SelectedValue.ToEntero = 2 AndAlso Dr("TCCambioValuacion").ToString.ToDecimal > 1 Then
|
ElseIf DdlMoneda.SelectedValue.ToEntero = 2 AndAlso Dr("TCCambioValuacion").ToString.ToDecimal > 1 Then
|
||||||
Importe251 = Dr("Importe").ToString.ToDecimal
|
Importe251 = Dr("Importe").ToString.ToDecimal
|
||||||
Importe91 = Dr("Importe").ToString.ToDecimal
|
Importe91 = Dr("Importe").ToString.ToDecimal
|
||||||
ImporteMN91 = Dr("Importe").ToString.ToDecimal * TipoCambioNC
|
ImporteMN91 = Dr("Importe").ToString.ToDecimal * TipoCambioNC
|
||||||
ElseIf DdlMoneda.SelectedValue.ToEntero = 1 AndAlso Dr("TCCambioValuacion").ToString.ToDecimal > 1 Then
|
ElseIf DdlMoneda.SelectedValue.ToEntero = 1 AndAlso Dr("TCCambioValuacion").ToString.ToDecimal > 1 Then
|
||||||
|
|
||||||
Importe91 = Dr("Importe").ToString.ToDecimal / TipoCambioNC
|
Importe91 = Dr("Importe").ToString.ToDecimal / TipoCambioNC
|
||||||
ImporteMN91 = Dr("Importe").ToString.ToDecimal
|
ImporteMN91 = Dr("Importe").ToString.ToDecimal
|
||||||
End If
|
|
||||||
|
|
||||||
Dim TCFluctuacion As Decimal = Dr("TCCambioValuacion").ToString.ToDecimal
|
|
||||||
If TCFluctuacion = 1 AndAlso TipoCambioNC > 1 Then
|
|
||||||
TCFluctuacion = GlobalTipoCambio(TxtFecha.Text.ToDate).ToDecimal
|
|
||||||
End If
|
|
||||||
|
|
||||||
If DdlMoneda.SelectedValue.ToEntero = 2 AndAlso Not Dr("TCCambioValuacion").ToString.ToDecimal > 1 Then
|
|
||||||
ImporteMN251 = Dr("Importe").ToString.ToDecimal * TCFluctuacion
|
|
||||||
ElseIf DdlMoneda.SelectedValue.ToEntero = 2 AndAlso Dr("TCCambioValuacion").ToString.ToDecimal > 1 Then
|
|
||||||
ImporteMN251 = Dr("Importe").ToString.ToDecimal * TCFluctuacion
|
|
||||||
ElseIf DdlMoneda.SelectedValue.ToEntero = 1 AndAlso Dr("TCCambioValuacion").ToString.ToDecimal > 1 Then
|
|
||||||
Importe251 = Dr("Importe").ToString.ToDecimal / TCFluctuacion
|
|
||||||
ImporteMN251 = Dr("Importe").ToString.ToDecimal
|
|
||||||
Else
|
|
||||||
ImporteMN251 = Dr("Importe").ToString.ToDecimal
|
|
||||||
End If
|
|
||||||
|
|
||||||
Importe251 = (Importe251 * Multiplicador).RoundSQL
|
|
||||||
|
|
||||||
Importe91 = (Importe91 * ValorMultiplicador).RoundSQL
|
|
||||||
ImporteMN91 = (ImporteMN91 * Multiplicador).RoundSQL
|
|
||||||
If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${Importe91.FormatoNumero(2)}"
|
|
||||||
|
|
||||||
CveUltimaVenta = Dr("CveVenta").ToString.ToEntero
|
|
||||||
|
|
||||||
Dim ImporteComplementarioIngreso As Decimal = 0
|
|
||||||
If UsaComplementariaClientes = True AndAlso tipoCambio > 1 Then
|
|
||||||
ImporteMN91 = Importe91
|
|
||||||
ImporteComplementarioIngreso = ((Importe91 * tipoCambio) - Importe91).RoundSQL
|
|
||||||
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, False, Importe91, Referencia, 203, Concepto, FechaMovimiento, IdCtaContableClienteComplementaria, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveVentaAmortizacion:=Dr("CveVenta").ToString.ToEntero, ImporteMX:=ImporteComplementarioIngreso, ImporteME:=If(tipoCambio = 1, 0, Importe91), CveSubProyecto:=CveSubProyectoContabilizar, TipoCambio:=tipoCambio, TipoCambioPago:=Dr("TCCambioValuacion").ToString.ToDecimal) Then
|
|
||||||
ErrorPrepoliza = True
|
|
||||||
Exit For
|
|
||||||
End If
|
End If
|
||||||
End If
|
|
||||||
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, False, Importe91, Referencia, 91, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveVentaAmortizacion:=Dr("CveVenta").ToString.ToEntero, ImporteMX:=ImporteMN91, ImporteME:=If(tipoCambio = 1, 0, Importe91), CveSubProyecto:=CveSubProyectoContabilizar, TipoCambio:=tipoCambio) Then
|
|
||||||
ErrorPrepoliza = True
|
|
||||||
Exit For
|
|
||||||
End If
|
|
||||||
ImporteAcumulado91 += (ImporteMN91).RoundSQL
|
|
||||||
|
|
||||||
If UsaComplementariaClientes = True AndAlso Dr("TCCambioValuacion").ToString.ToDecimal > 1 Then
|
Dim TCFluctuacion As Decimal = Dr("TCCambioValuacion").ToString.ToDecimal
|
||||||
ImporteMN251 = Importe251
|
If TCFluctuacion = 1 AndAlso TipoCambioNC > 1 Then
|
||||||
Dim ImporteComplementarioNC As Decimal = ((Importe251 * Dr("TCCambioValuacion").ToString.ToDecimal) - Importe251).RoundSQL
|
TCFluctuacion = GlobalTipoCambio(TxtFecha.Text.ToDate).ToDecimal
|
||||||
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, Importe251, Referencia, 207, Concepto, FechaMovimiento, IdCtaContableClienteComplementaria, -1, CveVenta:=Dr("CveVenta").ToString.ToEntero, CveCliente:=ObjFactura.CveCliente, ImporteMX:=ImporteComplementarioNC, ImporteME:=If(Dr("TCCambioValuacion").ToString.ToDecimal = 1, 0, Importe251), CveSubProyecto:=CveSubProyectoContabilizar, CveVentaAmortizacion:=ObjFactura.CveVenta, TipoCambio:=Dr("TCCambioValuacion").ToString.ToDecimal) Then
|
|
||||||
ErrorPrepoliza = True
|
|
||||||
Exit For
|
|
||||||
End If
|
End If
|
||||||
End If
|
|
||||||
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, Importe251, Referencia, 251, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=Dr("CveVenta").ToString.ToEntero, CveCliente:=ObjFactura.CveCliente, ImporteMX:=ImporteMN251, ImporteME:=If(Dr("TCCambioValuacion").ToString.ToDecimal = 1, 0, Importe251), CveSubProyecto:=CveSubProyectoContabilizar, CveVentaAmortizacion:=ObjFactura.CveVenta, TipoCambio:=Dr("TCCambioValuacion").ToString.ToDecimal, TipoCambioPago:=tipoCambio) Then
|
|
||||||
ErrorPrepoliza = True
|
|
||||||
Exit For
|
|
||||||
End If
|
|
||||||
|
|
||||||
|
If DdlMoneda.SelectedValue.ToEntero = 2 AndAlso Not Dr("TCCambioValuacion").ToString.ToDecimal > 1 Then
|
||||||
'considero fluctuación.
|
ImporteMN251 = Dr("Importe").ToString.ToDecimal * TCFluctuacion
|
||||||
|
ElseIf DdlMoneda.SelectedValue.ToEntero = 2 AndAlso Dr("TCCambioValuacion").ToString.ToDecimal > 1 Then
|
||||||
|
ImporteMN251 = Dr("Importe").ToString.ToDecimal * TCFluctuacion
|
||||||
If TipoCambioNC <> TCFluctuacion AndAlso TCFluctuacion > 1 AndAlso TipoCambioNC > 1 Then
|
ElseIf DdlMoneda.SelectedValue.ToEntero = 1 AndAlso Dr("TCCambioValuacion").ToString.ToDecimal > 1 Then
|
||||||
Dim difFluctuacion As Decimal = TipoCambioNC - TCFluctuacion
|
Importe251 = Dr("Importe").ToString.ToDecimal / TCFluctuacion
|
||||||
Dim CveConceptoFluctua As Integer = 64 '64.ganacia, 65.perdida
|
ImporteMN251 = Dr("Importe").ToString.ToDecimal
|
||||||
Dim TipoMovtoFluctua As Boolean = True
|
|
||||||
Dim IdCtaContableFluctua As Integer
|
|
||||||
If difFluctuacion < 0 Then
|
|
||||||
CveConceptoFluctua = 65
|
|
||||||
TipoMovtoFluctua = False
|
|
||||||
IdCtaContableFluctua = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria
|
|
||||||
CveCuenta = UsuarioActual.Empresa.CveCuentaPerdidaCambiaria
|
|
||||||
Else
|
Else
|
||||||
CveConceptoFluctua = 64
|
ImporteMN251 = Dr("Importe").ToString.ToDecimal
|
||||||
TipoMovtoFluctua = True
|
|
||||||
IdCtaContableFluctua = UsuarioActual.Empresa.IdCuentaGananciaCambiaria
|
|
||||||
CveCuenta = UsuarioActual.Empresa.CveCuentaGananciaCambiaria
|
|
||||||
End If
|
End If
|
||||||
Dim ImporteFluctuacion As Decimal = Math.Abs((Importe251 * difFluctuacion).RoundSQL)
|
|
||||||
|
|
||||||
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovtoFluctua, ImporteFluctuacion, Referencia, CveConceptoFluctua, Concepto, FechaMovimiento, IdCtaContableFluctua, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveVentaAmortizacion:=Dr("CveVenta").ToString.ToEntero, ImporteMX:=ImporteFluctuacion, ImporteME:=ImporteFluctuacion, CveSubProyecto:=CveSubProyectoContabilizar, TipoCambio:=TipoCambioNC, TipoCambioPago:=Dr("TCCambioValuacion").ToString.ToDecimal, CveCuenta:=CveCuenta) Then
|
Importe251 = (Importe251 * Multiplicador).RoundSQL
|
||||||
|
|
||||||
|
Importe91 = (Importe91 * ValorMultiplicador).RoundSQL
|
||||||
|
ImporteMN91 = (ImporteMN91 * Multiplicador).RoundSQL
|
||||||
|
If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${Importe91.FormatoNumero(2)}"
|
||||||
|
|
||||||
|
CveUltimaVenta = Dr("CveVenta").ToString.ToEntero
|
||||||
|
|
||||||
|
Dim ImporteComplementarioIngreso As Decimal = 0
|
||||||
|
If UsaComplementariaClientes = True AndAlso tipoCambio > 1 Then
|
||||||
|
ImporteMN91 = Importe91
|
||||||
|
ImporteComplementarioIngreso = ((Importe91 * tipoCambio) - Importe91).RoundSQL
|
||||||
|
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, False, Importe91, Referencia, 203, Concepto, FechaMovimiento, IdCtaContableClienteComplementaria, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveVentaAmortizacion:=Dr("CveVenta").ToString.ToEntero, ImporteMX:=ImporteComplementarioIngreso, ImporteME:=If(tipoCambio = 1, 0, Importe91), CveSubProyecto:=CveSubProyectoContabilizar, TipoCambio:=tipoCambio, TipoCambioPago:=Dr("TCCambioValuacion").ToString.ToDecimal) Then
|
||||||
|
ErrorPrepoliza = True
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, False, Importe91, Referencia, 91, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveVentaAmortizacion:=Dr("CveVenta").ToString.ToEntero, ImporteMX:=ImporteMN91, ImporteME:=If(tipoCambio = 1, 0, Importe91), CveSubProyecto:=CveSubProyectoContabilizar, TipoCambio:=tipoCambio) Then
|
||||||
ErrorPrepoliza = True
|
ErrorPrepoliza = True
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
End If
|
ImporteAcumulado91 += (ImporteMN91).RoundSQL
|
||||||
|
|
||||||
Next
|
If UsaComplementariaClientes = True AndAlso Dr("TCCambioValuacion").ToString.ToDecimal > 1 Then
|
||||||
|
ImporteMN251 = Importe251
|
||||||
|
Dim ImporteComplementarioNC As Decimal = ((Importe251 * Dr("TCCambioValuacion").ToString.ToDecimal) - Importe251).RoundSQL
|
||||||
|
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, Importe251, Referencia, 207, Concepto, FechaMovimiento, IdCtaContableClienteComplementaria, -1, CveVenta:=Dr("CveVenta").ToString.ToEntero, CveCliente:=ObjFactura.CveCliente, ImporteMX:=ImporteComplementarioNC, ImporteME:=If(Dr("TCCambioValuacion").ToString.ToDecimal = 1, 0, Importe251), CveSubProyecto:=CveSubProyectoContabilizar, CveVentaAmortizacion:=ObjFactura.CveVenta, TipoCambio:=Dr("TCCambioValuacion").ToString.ToDecimal) Then
|
||||||
|
ErrorPrepoliza = True
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, Importe251, Referencia, 251, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=Dr("CveVenta").ToString.ToEntero, CveCliente:=ObjFactura.CveCliente, ImporteMX:=ImporteMN251, ImporteME:=If(Dr("TCCambioValuacion").ToString.ToDecimal = 1, 0, Importe251), CveSubProyecto:=CveSubProyectoContabilizar, CveVentaAmortizacion:=ObjFactura.CveVenta, TipoCambio:=Dr("TCCambioValuacion").ToString.ToDecimal, TipoCambioPago:=tipoCambio) Then
|
||||||
|
ErrorPrepoliza = True
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
|
||||||
If ImporteConcepto12 < ImporteAcumulado91 Then
|
|
||||||
Dim ImporteOtrosIngresos As Decimal = ImporteConcepto12 - ImporteAcumulado91
|
'considero fluctuación.
|
||||||
If ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, False, ImporteOtrosIngresos, Referencia, 91, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveVentaAmortizacion:=CveUltimaVenta, ImporteMX:=ImporteOtrosIngresos, ImporteME:=0, CveSubProyecto:=CveSubProyectoContabilizar, TipoCambio:=tipoCambio) Then
|
|
||||||
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, ImporteOtrosIngresos, Referencia, 211, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, ImporteME:=0, ImporteMX:=ImporteOtrosIngresos, CveSubProyecto:=CveSubProyectoContabilizar) Then
|
|
||||||
|
If TipoCambioNC <> TCFluctuacion AndAlso TCFluctuacion > 1 AndAlso TipoCambioNC > 1 Then
|
||||||
|
Dim difFluctuacion As Decimal = TipoCambioNC - TCFluctuacion
|
||||||
|
Dim CveConceptoFluctua As Integer = 64 '64.ganacia, 65.perdida
|
||||||
|
Dim TipoMovtoFluctua As Boolean = True
|
||||||
|
Dim IdCtaContableFluctua As Integer
|
||||||
|
If difFluctuacion < 0 Then
|
||||||
|
CveConceptoFluctua = 65
|
||||||
|
TipoMovtoFluctua = False
|
||||||
|
IdCtaContableFluctua = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria
|
||||||
|
CveCuenta = UsuarioActual.Empresa.CveCuentaPerdidaCambiaria
|
||||||
|
Else
|
||||||
|
CveConceptoFluctua = 64
|
||||||
|
TipoMovtoFluctua = True
|
||||||
|
IdCtaContableFluctua = UsuarioActual.Empresa.IdCuentaGananciaCambiaria
|
||||||
|
CveCuenta = UsuarioActual.Empresa.CveCuentaGananciaCambiaria
|
||||||
|
End If
|
||||||
|
Dim ImporteFluctuacion As Decimal = Math.Abs((Importe251 * difFluctuacion).RoundSQL)
|
||||||
|
|
||||||
|
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovtoFluctua, ImporteFluctuacion, Referencia, CveConceptoFluctua, Concepto, FechaMovimiento, IdCtaContableFluctua, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveVentaAmortizacion:=Dr("CveVenta").ToString.ToEntero, ImporteMX:=ImporteFluctuacion, ImporteME:=ImporteFluctuacion, CveSubProyecto:=CveSubProyectoContabilizar, TipoCambio:=TipoCambioNC, TipoCambioPago:=Dr("TCCambioValuacion").ToString.ToDecimal, CveCuenta:=CveCuenta) Then
|
||||||
|
ErrorPrepoliza = True
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
Next
|
||||||
|
|
||||||
|
If ImporteConcepto12 < ImporteAcumulado91 Then
|
||||||
|
Dim ImporteOtrosIngresos As Decimal = ImporteConcepto12 - ImporteAcumulado91
|
||||||
|
If ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, False, ImporteOtrosIngresos, Referencia, 91, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveVentaAmortizacion:=CveUltimaVenta, ImporteMX:=ImporteOtrosIngresos, ImporteME:=0, CveSubProyecto:=CveSubProyectoContabilizar, TipoCambio:=tipoCambio) Then
|
||||||
|
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, ImporteOtrosIngresos, Referencia, 211, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, ImporteME:=0, ImporteMX:=ImporteOtrosIngresos, CveSubProyecto:=CveSubProyectoContabilizar) Then
|
||||||
|
ErrorPrepoliza = True
|
||||||
|
End If
|
||||||
|
Else
|
||||||
ErrorPrepoliza = True
|
ErrorPrepoliza = True
|
||||||
End If
|
End If
|
||||||
Else
|
|
||||||
ErrorPrepoliza = True
|
|
||||||
End If
|
End If
|
||||||
End If
|
|
||||||
|
|
||||||
If ObjConta.ValidacionPrePolizaCuadre(ObjFactura.CvePrePoliza, 5) Then
|
If ObjConta.ValidacionPrePolizaCuadre(ObjFactura.CvePrePoliza, 5) Then
|
||||||
If ObjConta.ValorPolizaDescuadre > 0 Then
|
If ObjConta.ValorPolizaDescuadre > 0 Then
|
||||||
'ErrorPrepoliza = True
|
'ErrorPrepoliza = True
|
||||||
GuardaLogAD($"Ventas/Ventas-ProcesoPrePolizas | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{ObjFactura.CvePrePoliza}", "LogPrePolizas")
|
GuardaLogAD($"Ventas/Ventas-ProcesoPrePolizas | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{ObjFactura.CvePrePoliza}", "LogPrePolizas")
|
||||||
|
|
||||||
'SIRVE PARA VER LA PREPOLIZA QUE SE VALIDA
|
'SIRVE PARA VER LA PREPOLIZA QUE SE VALIDA
|
||||||
'If ObjConta.GetPrePolizasDetalle(ObjFactura.CvePrePoliza) Then
|
'If ObjConta.GetPrePolizasDetalle(ObjFactura.CvePrePoliza) Then
|
||||||
' Dim DtTest = ObjConta.DtResultados
|
' Dim DtTest = ObjConta.DtResultados
|
||||||
'End If
|
'End If
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
|
||||||
|
|
||||||
|
|
||||||
If ErrorPrepoliza Then
|
If ErrorPrepoliza Then
|
||||||
Exit For
|
Exit For
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
'APLICA DEVOLUCION SALDOS DIRECTOS
|
'APLICA DEVOLUCION SALDOS DIRECTOS
|
||||||
If AplicaDevolucion Then
|
If AplicaDevolucion Then
|
||||||
Dim importeMovimientoDev = TxtTotal.Text.ToDecimal
|
Dim importeMovimientoDev = TxtTotal.Text.ToDecimal
|
||||||
@@ -16754,6 +16769,21 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
ObjCliente.Dispose()
|
ObjCliente.Dispose()
|
||||||
|
|
||||||
|
RecargaGlobalCliente()
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub RecargaGlobalCliente()
|
||||||
|
Dim Hilo As New System.Threading.Thread(AddressOf GeneraGlobalDTCliente)
|
||||||
|
Hilo.Start()
|
||||||
|
End Sub
|
||||||
|
Private Sub GeneraGlobalDTCliente()
|
||||||
|
Dim Objclientes As New ClsClientes
|
||||||
|
If Objclientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, -1, Estatus:=-1) Then
|
||||||
|
Application("GlobalDTCliente") = Objclientes.DtResultados
|
||||||
|
End If
|
||||||
|
Objclientes.Dispose()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
@@ -20330,6 +20360,12 @@ Partial Class Ventas
|
|||||||
e.Row.FCTextBox("TxtImporte").Attributes.Add("onkeyup", $"LimitaCantidadNCMasivo({TxtNCPorcentaje.Text.ToDouble()},{e.Row.DBCampo("Saldo").ToDouble},{e.Row.DBCampo("Original").ToDouble},{e.Row.DBCampo("SubTotal").ToDouble},{TxtTotalGv.ClientID},{TxtNCImporte.ClientID},{e.Row.FCCheckBox("ChkCxC").ClientID}, this);")
|
e.Row.FCTextBox("TxtImporte").Attributes.Add("onkeyup", $"LimitaCantidadNCMasivo({TxtNCPorcentaje.Text.ToDouble()},{e.Row.DBCampo("Saldo").ToDouble},{e.Row.DBCampo("Original").ToDouble},{e.Row.DBCampo("SubTotal").ToDouble},{TxtTotalGv.ClientID},{TxtNCImporte.ClientID},{e.Row.FCCheckBox("ChkCxC").ClientID}, this);")
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
Protected Sub GvRemisionesNC_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvRemisionesNC.RowDataBound
|
||||||
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||||
|
e.Row.FCCheckBox("ChkAplicar").Attributes.Add("onclick", $"CalculaTotalRNCChk({e.Row.FCTextBox("TxtImporte").ClientID},{e.Row.DBCampo("Saldo").ToDouble}, this);")
|
||||||
|
e.Row.FCTextBox("TxtImporte").Attributes.Add("onkeyup", $"LimitaCantidadRNCMasivo({e.Row.FCTextBox("TxtImporte").ClientID},{e.Row.DBCampo("Saldo").ToDouble}, this);")
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
Protected Sub DdlNCNivelImporte_SelectedIndexChanged(sender As Object, e As EventArgs)
|
Protected Sub DdlNCNivelImporte_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||||
Dim ImporteReferencia As Double = 0, PorcentajeMaximo As Double = 0
|
Dim ImporteReferencia As Double = 0, PorcentajeMaximo As Double = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user