This commit is contained in:
Antonio Gonzalez
2019-10-18 10:35:39 -05:00
23 changed files with 11146 additions and 10787 deletions

View File

@@ -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
@@ -6769,7 +6771,7 @@ Public Class ClsPaginas
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

View File

@@ -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

View File

@@ -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

View File

@@ -246,6 +246,17 @@
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
</asp:Panel> </asp:Panel>
<div id="DivOtrosIngresosEgresos" runat="server" visible="false" class="row">
<label class="col-md-2 control-label"></label>
<div class="col-md-2"></div>
<div class="col-md-4"></div>
<label class="col-md-1 control-label text-right">Otr:</label>
<div class="col-md-2 input-icon">
<i style="margin: 0px;">$</i>
<asp:TextBox ID="TxtOtrosIngresosEgresos" runat="server" CssClass="form-control input-sm" ClientIDMode="Static" Style="text-align: right;" AutoComplete="off"></asp:TextBox>
</div>
</div>
<br /> <br />
<asp:Panel ID="PnlRecibidoPor" runat="server" Visible="false"> <asp:Panel ID="PnlRecibidoPor" runat="server" Visible="false">
<asp:UpdatePanel ID="UpRecibidoPor" class="row" style="padding: 0px; min-height: 22px; margin-top: 3px;" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UpRecibidoPor" class="row" style="padding: 0px; min-height: 22px; margin-top: 3px;" runat="server" UpdateMode="Conditional">

View File

@@ -2686,6 +2686,30 @@ Partial Class Bancos_IE
Exit Select Exit Select
End If End If
'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 '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)

View File

@@ -143,7 +143,7 @@ Partial Class Compras_RepNotasCredito
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

View File

@@ -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">

View File

@@ -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

View File

@@ -167,6 +167,7 @@
<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:Label ID="LblMsgAcreditable" runat="server" Text="" ForeColor="Red"></asp:Label>
<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: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">
<Columns> <Columns>
<asp:BoundField HeaderText="Docto" DataField="TipoDocto" ItemStyle-HorizontalAlign="Center" /> <asp:BoundField HeaderText="Docto" DataField="TipoDocto" ItemStyle-HorizontalAlign="Center" />

View File

@@ -62,6 +62,7 @@ public partial class Contabilidad_RepIVA : ClsPaginas
{ {
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(); ClsContabilidad ObjCont = new ClsContabilidad();
if (ObjCont.GetRepIVA(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), 1, UsuarioActual.CveUsuario, Conciliado, UsuarioActual.CveEmpresa, TipoCambio, TCEspecifico)) if (ObjCont.GetRepIVA(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), 1, UsuarioActual.CveUsuario, Conciliado, UsuarioActual.CveEmpresa, TipoCambio, TCEspecifico))
@@ -83,10 +84,18 @@ public partial class Contabilidad_RepIVA : ClsPaginas
{ {
GvA.DataSource = ObjCont.DtResultados; GvA.DataSource = ObjCont.DtResultados;
DtIVAAcreditable = ObjCont.DtResultados; DtIVAAcreditable = ObjCont.DtResultados;
if (DtIVAAcreditable.FiltraParametros("IVA < 0 OR IEPS < 0 ").Rows.Count > 0)
{
LblMsgAcreditable.Text = "La información presenta importes en negativo, estos no se incluirán en el archivo generado para DIOT";
}
if (ObjCont.GetRepIVAAcumulado(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), Conciliado, 3, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) if (ObjCont.GetRepIVAAcumulado(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), Conciliado, 3, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
{ {
GvIVA2.DataSource = ObjCont.DtResultados; GvIVA2.DataSource = ObjCont.DtResultados;
} }
} }
ObjCont.Dispose(); ObjCont.Dispose();
GvT.DataBind(); GvT.DataBind();

View File

@@ -1632,44 +1632,10 @@
</Style> </Style>
</PageHeader> </PageHeader>
<PageFooter> <PageFooter>
<Height>6.50904cm</Height> <Height>5.95342cm</Height>
<PrintOnFirstPage>true</PrintOnFirstPage> <PrintOnFirstPage>true</PrintOnFirstPage>
<PrintOnLastPage>true</PrintOnLastPage> <PrintOnLastPage>true</PrintOnLastPage>
<ReportItems> <ReportItems>
<Textbox Name="Textbox20">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>I.V.A.</Value>
<Style>
<FontFamily>myriad Pro</FontFamily>
<FontSize>9pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Left</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox20</rd:DefaultName>
<Top>0.91629cm</Top>
<Left>15.88909cm</Left>
<Height>0.45183cm</Height>
<Width>2.5cm</Width>
<Style>
<Border>
<Style>None</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<Textbox Name="Textbox28"> <Textbox Name="Textbox28">
<CanGrow>true</CanGrow> <CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether> <KeepTogether>true</KeepTogether>
@@ -1690,11 +1656,10 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox20</rd:DefaultName> <rd:DefaultName>Textbox20</rd:DefaultName>
<Top>3.0156cm</Top> <Top>3.17435cm</Top>
<Left>15.89438cm</Left> <Left>15.89438cm</Left>
<Height>0.45183cm</Height> <Height>0.45183cm</Height>
<Width>2.5cm</Width> <Width>2.5cm</Width>
<ZIndex>1</ZIndex>
<Style> <Style>
<Border> <Border>
<Style>None</Style> <Style>None</Style>
@@ -1705,44 +1670,6 @@
<PaddingBottom>2pt</PaddingBottom> <PaddingBottom>2pt</PaddingBottom>
</Style> </Style>
</Textbox> </Textbox>
<Textbox Name="Textbox27">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Parameters!IVA.Value</Value>
<Style>
<FontFamily>myriad Pro</FontFamily>
<FontSize>9pt</FontSize>
<Format>'$'#,0.00</Format>
<Language>es-MX</Language>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Right</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox20</rd:DefaultName>
<Top>0.91629cm</Top>
<Left>18.38909cm</Left>
<Height>0.45183cm</Height>
<Width>2.4365cm</Width>
<ZIndex>2</ZIndex>
<Style>
<Border>
<Style>None</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
<rd:FormatSymbolCulture>es-MX</rd:FormatSymbolCulture>
</Style>
</Textbox>
<Textbox Name="Textbox29"> <Textbox Name="Textbox29">
<CanGrow>true</CanGrow> <CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether> <KeepTogether>true</KeepTogether>
@@ -1765,84 +1692,11 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox20</rd:DefaultName> <rd:DefaultName>Textbox20</rd:DefaultName>
<Top>3.0156cm</Top> <Top>3.2061cm</Top>
<Left>18.39438cm</Left> <Left>18.39438cm</Left>
<Height>0.45183cm</Height> <Height>0.45183cm</Height>
<Width>2.43121cm</Width> <Width>2.43121cm</Width>
<ZIndex>3</ZIndex> <ZIndex>1</ZIndex>
<Style>
<Border>
<Style>None</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
<rd:FormatSymbolCulture>es-MX</rd:FormatSymbolCulture>
</Style>
</Textbox>
<Textbox Name="Textbox41">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>SUB-TOTAL</Value>
<Style>
<FontFamily>myriad Pro</FontFamily>
<FontSize>9pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Left</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox20</rd:DefaultName>
<Top>0.39363cm</Top>
<Left>15.88909cm</Left>
<Height>0.45183cm</Height>
<Width>2.5cm</Width>
<ZIndex>4</ZIndex>
<Style>
<Border>
<Style>None</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<Textbox Name="Textbox42">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Parameters!SubTotal.Value</Value>
<Style>
<FontFamily>myriad Pro</FontFamily>
<FontSize>9pt</FontSize>
<Format>'$'#,0.00</Format>
<Language>es-MX</Language>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Right</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox20</rd:DefaultName>
<Top>0.39363cm</Top>
<Left>18.38909cm</Left>
<Height>0.45183cm</Height>
<Width>2.4365cm</Width>
<ZIndex>5</ZIndex>
<Style> <Style>
<Border> <Border>
<Style>None</Style> <Style>None</Style>
@@ -1871,11 +1725,11 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox46</rd:DefaultName> <rd:DefaultName>Textbox46</rd:DefaultName>
<Top>3.82764cm</Top> <Top>4.14514cm</Top>
<Left>0.37861cm</Left> <Left>0.37861cm</Left>
<Height>0.45183cm</Height> <Height>0.45183cm</Height>
<Width>19.46272cm</Width> <Width>19.46272cm</Width>
<ZIndex>6</ZIndex> <ZIndex>2</ZIndex>
<Style> <Style>
<Border> <Border>
<Style>None</Style> <Style>None</Style>
@@ -1905,7 +1759,7 @@
<Left>0.12161cm</Left> <Left>0.12161cm</Left>
<Height>0.14316cm</Height> <Height>0.14316cm</Height>
<Width>20.70398cm</Width> <Width>20.70398cm</Width>
<ZIndex>7</ZIndex> <ZIndex>3</ZIndex>
<Style> <Style>
<Border> <Border>
<Style>None</Style> <Style>None</Style>
@@ -1934,11 +1788,11 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox5</rd:DefaultName> <rd:DefaultName>Textbox5</rd:DefaultName>
<Top>2.83716cm</Top> <Top>2.99591cm</Top>
<Left>15.37903cm</Left> <Left>15.37903cm</Left>
<Height>0.14316cm</Height> <Height>0.14316cm</Height>
<Width>5.44656cm</Width> <Width>5.44656cm</Width>
<ZIndex>8</ZIndex> <ZIndex>4</ZIndex>
<Style> <Style>
<Border> <Border>
<Style>None</Style> <Style>None</Style>
@@ -1967,11 +1821,11 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox5</rd:DefaultName> <rd:DefaultName>Textbox5</rd:DefaultName>
<Top>3.54151cm</Top> <Top>3.70026cm</Top>
<Left>15.34727cm</Left> <Left>15.34727cm</Left>
<Height>0.14502cm</Height> <Height>0.14502cm</Height>
<Width>5.47832cm</Width> <Width>5.47832cm</Width>
<ZIndex>9</ZIndex> <ZIndex>5</ZIndex>
<Style> <Style>
<Border> <Border>
<Style>None</Style> <Style>None</Style>
@@ -2008,11 +1862,11 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox29</rd:DefaultName> <rd:DefaultName>Textbox29</rd:DefaultName>
<Top>5.01502cm</Top> <Top>5.33252cm</Top>
<Left>0.12161cm</Left> <Left>0.12161cm</Left>
<Height>0.41981cm</Height> <Height>0.41981cm</Height>
<Width>6.83917cm</Width> <Width>6.83917cm</Width>
<ZIndex>10</ZIndex> <ZIndex>6</ZIndex>
<Style> <Style>
<Border> <Border>
<Style>None</Style> <Style>None</Style>
@@ -2048,11 +1902,11 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox31</rd:DefaultName> <rd:DefaultName>Textbox31</rd:DefaultName>
<Top>5.01502cm</Top> <Top>5.33252cm</Top>
<Left>9.76514cm</Left> <Left>9.76514cm</Left>
<Height>0.41981cm</Height> <Height>0.41981cm</Height>
<Width>6.02198cm</Width> <Width>6.02198cm</Width>
<ZIndex>11</ZIndex> <ZIndex>7</ZIndex>
<Style> <Style>
<Border> <Border>
<Style>None</Style> <Style>None</Style>
@@ -2083,11 +1937,11 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox35</rd:DefaultName> <rd:DefaultName>Textbox35</rd:DefaultName>
<Top>5.01502cm</Top> <Top>5.33252cm</Top>
<Left>18.19908cm</Left> <Left>18.19908cm</Left>
<Height>0.41981cm</Height> <Height>0.41981cm</Height>
<Width>2.5cm</Width> <Width>2.5cm</Width>
<ZIndex>12</ZIndex> <ZIndex>8</ZIndex>
<Style> <Style>
<Border> <Border>
<Style>None</Style> <Style>None</Style>
@@ -2120,6 +1974,147 @@
<Left>0.12162cm</Left> <Left>0.12162cm</Left>
<Height>0.41479cm</Height> <Height>0.41479cm</Height>
<Width>14.67376cm</Width> <Width>14.67376cm</Width>
<ZIndex>9</ZIndex>
<Style>
<Border>
<Style>None</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<Textbox Name="Textbox20">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>I.V.A.</Value>
<Style>
<FontSize>9pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Left</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox20</rd:DefaultName>
<Top>1.22239cm</Top>
<Left>15.89517cm</Left>
<Height>0.45183cm</Height>
<Width>2.5cm</Width>
<ZIndex>10</ZIndex>
<Style>
<Border>
<Style>None</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<Textbox Name="Textbox27">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Parameters!IVA.Value</Value>
<Style>
<FontSize>9pt</FontSize>
<Format>'$'#,0.00</Format>
<Language>es-MX</Language>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Right</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox20</rd:DefaultName>
<Top>1.22239cm</Top>
<Left>18.39517cm</Left>
<Height>0.45183cm</Height>
<Width>2.4365cm</Width>
<ZIndex>11</ZIndex>
<Style>
<Border>
<Style>None</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
<rd:FormatSymbolCulture>es-MX</rd:FormatSymbolCulture>
</Style>
</Textbox>
<Textbox Name="Textbox41">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>SUB-TOTAL</Value>
<Style>
<FontSize>9pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Left</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox20</rd:DefaultName>
<Top>0.41398cm</Top>
<Left>15.89517cm</Left>
<Height>0.45183cm</Height>
<Width>2.5cm</Width>
<ZIndex>12</ZIndex>
<Style>
<Border>
<Style>None</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<Textbox Name="Textbox42">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Parameters!SubTotal.Value</Value>
<Style>
<FontSize>9pt</FontSize>
<Format>'$'#,0.00</Format>
<Language>es-MX</Language>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Right</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox20</rd:DefaultName>
<Top>0.41398cm</Top>
<Left>18.39517cm</Left>
<Height>0.45183cm</Height>
<Width>2.4365cm</Width>
<ZIndex>13</ZIndex> <ZIndex>13</ZIndex>
<Style> <Style>
<Border> <Border>
@@ -2129,6 +2124,7 @@
<PaddingRight>2pt</PaddingRight> <PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop> <PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom> <PaddingBottom>2pt</PaddingBottom>
<rd:FormatSymbolCulture>es-MX</rd:FormatSymbolCulture>
</Style> </Style>
</Textbox> </Textbox>
<Textbox Name="Textbox22"> <Textbox Name="Textbox22">
@@ -2140,7 +2136,6 @@
<TextRun> <TextRun>
<Value>Ret I.V.A</Value> <Value>Ret I.V.A</Value>
<Style> <Style>
<FontFamily>myriad Pro</FontFamily>
<FontSize>9pt</FontSize> <FontSize>9pt</FontSize>
</Style> </Style>
</TextRun> </TextRun>
@@ -2151,8 +2146,8 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox20</rd:DefaultName> <rd:DefaultName>Textbox20</rd:DefaultName>
<Top>1.36812cm</Top> <Top>1.67422cm</Top>
<Left>15.8883cm</Left> <Left>15.89438cm</Left>
<Height>0.45183cm</Height> <Height>0.45183cm</Height>
<Width>2.5cm</Width> <Width>2.5cm</Width>
<ZIndex>14</ZIndex> <ZIndex>14</ZIndex>
@@ -2178,7 +2173,6 @@
<TextRun> <TextRun>
<Value>=Parameters!RetIVA.Value</Value> <Value>=Parameters!RetIVA.Value</Value>
<Style> <Style>
<FontFamily>myriad Pro</FontFamily>
<FontSize>9pt</FontSize> <FontSize>9pt</FontSize>
<Format>'$'#,0.00</Format> <Format>'$'#,0.00</Format>
<Language>es-MX</Language> <Language>es-MX</Language>
@@ -2191,8 +2185,8 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox20</rd:DefaultName> <rd:DefaultName>Textbox20</rd:DefaultName>
<Top>1.36812cm</Top> <Top>1.67422cm</Top>
<Left>18.3883cm</Left> <Left>18.39438cm</Left>
<Height>0.45183cm</Height> <Height>0.45183cm</Height>
<Width>2.4365cm</Width> <Width>2.4365cm</Width>
<ZIndex>15</ZIndex> <ZIndex>15</ZIndex>
@@ -2219,7 +2213,6 @@
<TextRun> <TextRun>
<Value>Ret I.S.R</Value> <Value>Ret I.S.R</Value>
<Style> <Style>
<FontFamily>myriad Pro</FontFamily>
<FontSize>9pt</FontSize> <FontSize>9pt</FontSize>
</Style> </Style>
</TextRun> </TextRun>
@@ -2230,8 +2223,8 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox20</rd:DefaultName> <rd:DefaultName>Textbox20</rd:DefaultName>
<Top>1.81995cm</Top> <Top>2.12605cm</Top>
<Left>15.8883cm</Left> <Left>15.89438cm</Left>
<Height>0.45183cm</Height> <Height>0.45183cm</Height>
<Width>2.5cm</Width> <Width>2.5cm</Width>
<ZIndex>16</ZIndex> <ZIndex>16</ZIndex>
@@ -2257,7 +2250,6 @@
<TextRun> <TextRun>
<Value>=Parameters!RetISR.Value</Value> <Value>=Parameters!RetISR.Value</Value>
<Style> <Style>
<FontFamily>myriad Pro</FontFamily>
<FontSize>9pt</FontSize> <FontSize>9pt</FontSize>
<Format>'$'#,0.00</Format> <Format>'$'#,0.00</Format>
<Language>es-MX</Language> <Language>es-MX</Language>
@@ -2270,8 +2262,8 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox20</rd:DefaultName> <rd:DefaultName>Textbox20</rd:DefaultName>
<Top>1.81995cm</Top> <Top>2.12605cm</Top>
<Left>18.3883cm</Left> <Left>18.39438cm</Left>
<Height>0.45183cm</Height> <Height>0.45183cm</Height>
<Width>2.4365cm</Width> <Width>2.4365cm</Width>
<ZIndex>17</ZIndex> <ZIndex>17</ZIndex>
@@ -2298,7 +2290,6 @@
<TextRun> <TextRun>
<Value>I.E.P.S</Value> <Value>I.E.P.S</Value>
<Style> <Style>
<FontFamily>myriad Pro</FontFamily>
<FontSize>9pt</FontSize> <FontSize>9pt</FontSize>
</Style> </Style>
</TextRun> </TextRun>
@@ -2309,8 +2300,8 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox20</rd:DefaultName> <rd:DefaultName>Textbox20</rd:DefaultName>
<Top>2.27178cm</Top> <Top>2.57788cm</Top>
<Left>15.8883cm</Left> <Left>15.89438cm</Left>
<Height>0.45183cm</Height> <Height>0.45183cm</Height>
<Width>2.5cm</Width> <Width>2.5cm</Width>
<ZIndex>18</ZIndex> <ZIndex>18</ZIndex>
@@ -2336,7 +2327,6 @@
<TextRun> <TextRun>
<Value>=Sum(Fields!IEPS.Value, "DsOC")</Value> <Value>=Sum(Fields!IEPS.Value, "DsOC")</Value>
<Style> <Style>
<FontFamily>myriad Pro</FontFamily>
<FontSize>9pt</FontSize> <FontSize>9pt</FontSize>
<Format>'$'#,0.00</Format> <Format>'$'#,0.00</Format>
<Language>es-MX</Language> <Language>es-MX</Language>
@@ -2349,8 +2339,8 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox20</rd:DefaultName> <rd:DefaultName>Textbox20</rd:DefaultName>
<Top>2.27178cm</Top> <Top>2.57788cm</Top>
<Left>18.3883cm</Left> <Left>18.39438cm</Left>
<Height>0.45183cm</Height> <Height>0.45183cm</Height>
<Width>2.4365cm</Width> <Width>2.4365cm</Width>
<ZIndex>19</ZIndex> <ZIndex>19</ZIndex>
@@ -2368,6 +2358,83 @@
<rd:FormatSymbolCulture>es-MX</rd:FormatSymbolCulture> <rd:FormatSymbolCulture>es-MX</rd:FormatSymbolCulture>
</Style> </Style>
</Textbox> </Textbox>
<Textbox Name="Textbox31">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>DESCUENTO</Value>
<Style>
<FontSize>9pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Left</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox20</rd:DefaultName>
<Top>0.83759cm</Top>
<Left>15.90124cm</Left>
<Height>0.45183cm</Height>
<Width>2.5cm</Width>
<ZIndex>20</ZIndex>
<Visibility>
<Hidden>=IIF(Parameters!Descuento.Value &gt; 0,FALSE,TRUE)</Hidden>
</Visibility>
<Style>
<Border>
<Style>None</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<Textbox Name="Textbox47">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Parameters!Descuento.Value</Value>
<Style>
<FontSize>9pt</FontSize>
<Format>'$'#,0.00</Format>
<Language>es-MX</Language>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Right</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox20</rd:DefaultName>
<Top>0.83759cm</Top>
<Left>18.40124cm</Left>
<Height>0.45183cm</Height>
<Width>2.4365cm</Width>
<ZIndex>21</ZIndex>
<Visibility>
<Hidden>=IIF(Parameters!Descuento.Value &gt; 0,FALSE,TRUE)</Hidden>
</Visibility>
<Style>
<Border>
<Style>None</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
<rd:FormatSymbolCulture>es-MX</rd:FormatSymbolCulture>
</Style>
</Textbox>
</ReportItems> </ReportItems>
<Style> <Style>
<Border> <Border>
@@ -2905,6 +2972,11 @@
<AllowBlank>true</AllowBlank> <AllowBlank>true</AllowBlank>
<Prompt>ReportParameter1</Prompt> <Prompt>ReportParameter1</Prompt>
</ReportParameter> </ReportParameter>
<ReportParameter Name="Descuenti">
<DataType>Float</DataType>
<Nullable>true</Nullable>
<Prompt>ReportParameter1</Prompt>
</ReportParameter>
</ReportParameters> </ReportParameters>
<EmbeddedImages> <EmbeddedImages>
<EmbeddedImage Name="compuproveedores"> <EmbeddedImage Name="compuproveedores">

View File

@@ -1010,7 +1010,7 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox20</rd:DefaultName> <rd:DefaultName>Textbox20</rd:DefaultName>
<Top>5.84792cm</Top> <Top>6.29242cm</Top>
<Left>16.1331cm</Left> <Left>16.1331cm</Left>
<Height>0.45183cm</Height> <Height>0.45183cm</Height>
<Width>2.06968cm</Width> <Width>2.06968cm</Width>
@@ -1065,7 +1065,7 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox20</rd:DefaultName> <rd:DefaultName>Textbox20</rd:DefaultName>
<Top>6.29975cm</Top> <Top>6.74425cm</Top>
<Left>16.1331cm</Left> <Left>16.1331cm</Left>
<Height>0.45183cm</Height> <Height>0.45183cm</Height>
<Width>2.06968cm</Width> <Width>2.06968cm</Width>
@@ -1108,7 +1108,7 @@
<Paragraph> <Paragraph>
<TextRuns> <TextRuns>
<TextRun> <TextRun>
<Value>SubTotal</Value> <Value>Descuento</Value>
<Style> <Style>
<FontSize>8pt</FontSize> <FontSize>8pt</FontSize>
</Style> </Style>
@@ -1120,7 +1120,7 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox20</rd:DefaultName> <rd:DefaultName>Textbox20</rd:DefaultName>
<Top>5.42431cm</Top> <Top>5.86881cm</Top>
<Left>16.1331cm</Left> <Left>16.1331cm</Left>
<Height>0.42361cm</Height> <Height>0.42361cm</Height>
<Width>2.06968cm</Width> <Width>2.06968cm</Width>
@@ -1177,7 +1177,7 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox20</rd:DefaultName> <rd:DefaultName>Textbox20</rd:DefaultName>
<Top>5.84792cm</Top> <Top>6.29242cm</Top>
<Left>18.20277cm</Left> <Left>18.20277cm</Left>
<Height>0.45183cm</Height> <Height>0.45183cm</Height>
<Width>2.26019cm</Width> <Width>2.26019cm</Width>
@@ -1234,7 +1234,7 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox20</rd:DefaultName> <rd:DefaultName>Textbox20</rd:DefaultName>
<Top>6.29975cm</Top> <Top>6.74425cm</Top>
<Left>18.20276cm</Left> <Left>18.20276cm</Left>
<Height>0.45183cm</Height> <Height>0.45183cm</Height>
<Width>2.26019cm</Width> <Width>2.26019cm</Width>
@@ -1277,7 +1277,7 @@
<Paragraph> <Paragraph>
<TextRuns> <TextRuns>
<TextRun> <TextRun>
<Value>=Parameters!SubTotal.Value</Value> <Value>=Parameters!Descuento.Value</Value>
<Style> <Style>
<FontSize>8pt</FontSize> <FontSize>8pt</FontSize>
<Format>#,0.00</Format> <Format>#,0.00</Format>
@@ -1291,7 +1291,7 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox20</rd:DefaultName> <rd:DefaultName>Textbox20</rd:DefaultName>
<Top>5.42431cm</Top> <Top>5.86881cm</Top>
<Left>18.20276cm</Left> <Left>18.20276cm</Left>
<Height>0.42361cm</Height> <Height>0.42361cm</Height>
<Width>2.26019cm</Width> <Width>2.26019cm</Width>
@@ -1301,26 +1301,6 @@
<Color>LightGrey</Color> <Color>LightGrey</Color>
<Style>Solid</Style> <Style>Solid</Style>
</Border> </Border>
<TopBorder>
<Color>LightGrey</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</TopBorder>
<BottomBorder>
<Color>LightGrey</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</BottomBorder>
<LeftBorder>
<Color>LightGrey</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</LeftBorder>
<RightBorder>
<Color>LightGrey</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</RightBorder>
<PaddingLeft>2pt</PaddingLeft> <PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight> <PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop> <PaddingTop>2pt</PaddingTop>
@@ -1345,7 +1325,7 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox46</rd:DefaultName> <rd:DefaultName>Textbox46</rd:DefaultName>
<Top>6.29975cm</Top> <Top>6.74425cm</Top>
<Left>0.20457cm</Left> <Left>0.20457cm</Left>
<Height>0.45183cm</Height> <Height>0.45183cm</Height>
<Width>15.92855cm</Width> <Width>15.92855cm</Width>
@@ -2367,7 +2347,7 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox12</rd:DefaultName> <rd:DefaultName>Textbox12</rd:DefaultName>
<Top>8.49815cm</Top> <Top>8.9744cm</Top>
<Left>3.07712cm</Left> <Left>3.07712cm</Left>
<Height>0.44478cm</Height> <Height>0.44478cm</Height>
<Width>5.83844cm</Width> <Width>5.83844cm</Width>
@@ -2403,7 +2383,7 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox12</rd:DefaultName> <rd:DefaultName>Textbox12</rd:DefaultName>
<Top>8.94293cm</Top> <Top>9.41918cm</Top>
<Left>3.07712cm</Left> <Left>3.07712cm</Left>
<Height>0.4095cm</Height> <Height>0.4095cm</Height>
<Width>5.83844cm</Width> <Width>5.83844cm</Width>
@@ -2443,7 +2423,7 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox12</rd:DefaultName> <rd:DefaultName>Textbox12</rd:DefaultName>
<Top>9.38771cm</Top> <Top>9.86396cm</Top>
<Left>3.07712cm</Left> <Left>3.07712cm</Left>
<Height>0.44478cm</Height> <Height>0.44478cm</Height>
<Width>5.83844cm</Width> <Width>5.83844cm</Width>
@@ -2479,7 +2459,7 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox12</rd:DefaultName> <rd:DefaultName>Textbox12</rd:DefaultName>
<Top>8.49815cm</Top> <Top>8.9744cm</Top>
<Left>11.4732cm</Left> <Left>11.4732cm</Left>
<Height>0.44478cm</Height> <Height>0.44478cm</Height>
<Width>5.83844cm</Width> <Width>5.83844cm</Width>
@@ -2515,7 +2495,7 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox12</rd:DefaultName> <rd:DefaultName>Textbox12</rd:DefaultName>
<Top>8.94293cm</Top> <Top>9.41918cm</Top>
<Left>11.4732cm</Left> <Left>11.4732cm</Left>
<Height>0.4095cm</Height> <Height>0.4095cm</Height>
<Width>5.83844cm</Width> <Width>5.83844cm</Width>
@@ -2555,7 +2535,7 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox12</rd:DefaultName> <rd:DefaultName>Textbox12</rd:DefaultName>
<Top>9.38771cm</Top> <Top>9.86396cm</Top>
<Left>11.4732cm</Left> <Left>11.4732cm</Left>
<Height>0.44478cm</Height> <Height>0.44478cm</Height>
<Width>5.83844cm</Width> <Width>5.83844cm</Width>
@@ -2575,7 +2555,7 @@
<Source>External</Source> <Source>External</Source>
<Value>=Parameters!FirmaAutorizo.Value</Value> <Value>=Parameters!FirmaAutorizo.Value</Value>
<Sizing>Fit</Sizing> <Sizing>Fit</Sizing>
<Top>6.92797cm</Top> <Top>7.40422cm</Top>
<Left>12.49243cm</Left> <Left>12.49243cm</Left>
<Height>3.5cm</Height> <Height>3.5cm</Height>
<Width>3.5cm</Width> <Width>3.5cm</Width>
@@ -2593,7 +2573,7 @@
<Source>External</Source> <Source>External</Source>
<Value>=Parameters!FirmaSolicito.Value</Value> <Value>=Parameters!FirmaSolicito.Value</Value>
<Sizing>Fit</Sizing> <Sizing>Fit</Sizing>
<Top>6.92797cm</Top> <Top>7.40422cm</Top>
<Left>4.23541cm</Left> <Left>4.23541cm</Left>
<Height>3.5cm</Height> <Height>3.5cm</Height>
<Width>3.5cm</Width> <Width>3.5cm</Width>
@@ -2722,8 +2702,120 @@
<PaddingBottom>2pt</PaddingBottom> <PaddingBottom>2pt</PaddingBottom>
</Style> </Style>
</Textbox> </Textbox>
<Textbox Name="Textbox37">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>SubTotal</Value>
<Style>
<FontSize>8pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Right</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox20</rd:DefaultName>
<Top>5.43618cm</Top>
<Left>16.13311cm</Left>
<Height>0.42361cm</Height>
<Width>2.0597cm</Width>
<ZIndex>36</ZIndex>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>Solid</Style>
</Border>
<TopBorder>
<Color>LightGrey</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</TopBorder>
<BottomBorder>
<Color>LightGrey</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</BottomBorder>
<LeftBorder>
<Color>LightGrey</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</LeftBorder>
<RightBorder>
<Color>LightGrey</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</RightBorder>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<Textbox Name="Textbox38">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Parameters!SubTotal.Value</Value>
<Style>
<FontSize>8pt</FontSize>
<Format>#,0.00</Format>
<Language>es-MX</Language>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Right</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox20</rd:DefaultName>
<Top>5.43618cm</Top>
<Left>18.19279cm</Left>
<Height>0.42361cm</Height>
<Width>2.26019cm</Width>
<ZIndex>37</ZIndex>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>Solid</Style>
</Border>
<TopBorder>
<Color>LightGrey</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</TopBorder>
<BottomBorder>
<Color>LightGrey</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</BottomBorder>
<LeftBorder>
<Color>LightGrey</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</LeftBorder>
<RightBorder>
<Color>LightGrey</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</RightBorder>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</ReportItems> </ReportItems>
<Height>4.12223in</Height> <Height>4.55973in</Height>
<Style /> <Style />
</Body> </Body>
<Width>8.07504in</Width> <Width>8.07504in</Width>

View File

@@ -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
@@ -773,6 +802,8 @@ 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,22 +814,129 @@ 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, '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 ' "-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
' ErrorClientes = True ' ErrorClientes = True
@@ -806,13 +944,18 @@ Partial Class General_SaldosIniciales
' Exit For ' Exit For
'End If '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

View File

@@ -876,6 +876,17 @@ Partial Class Inventarios_EntradasSalidas
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
'[IPP] Se invalida por necesidad de JAM de modificar fechas para cuadrar con CIFRA - 19Abril2018 '[IPP] Se invalida por necesidad de JAM de modificar fechas para cuadrar con CIFRA - 19Abril2018

View File

@@ -1898,81 +1898,89 @@ 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 ValorInventario As Decimal = 0
Dim ValorInventarioME As Decimal = 0
Dim CveConcepto As Integer = 3
Dim Retorno As Boolean = True Dim Retorno As Boolean = True
Try
Dim DtCostos As DataTable = Nothing
Dim ValorInventario As Decimal = 0
Dim ValorInventarioME As Decimal = 0
Dim CveConcepto As Integer = 3
ObjInventario.GetMovimientos(CveMovimiento, -1, -1, UsuarioActual.CveEmpresa) ObjInventario.GetMovimientos(CveMovimiento, -1, -1, UsuarioActual.CveEmpresa)
Dim CveVenta As Integer = ObjInventario.CveVenta Dim CveVenta As Integer = ObjInventario.CveVenta
Dim CveAlmacen As Integer = ObjInventario.CveAlmacen Dim CveAlmacen As Integer = ObjInventario.CveAlmacen
Dim SerieFolio As String = ObjInventario.DtResultados.Rows(0)("SerieFolioVenta").ToString Dim SerieFolio As String = ObjInventario.DtResultados.Rows(0)("SerieFolioVenta").ToString
Dim MovAlmacen As Boolean = True Dim MovAlmacen As Boolean = True
Dim OrigenMov As Integer = GlobalDTInvConceptos.FiltroPrimeroValor("Origen", "CveConcepto = " & CveConcepto).ToEntero Dim OrigenMov As Integer = GlobalDTInvConceptos.FiltroPrimeroValor("Origen", "CveConcepto = " & CveConcepto).ToEntero
If OrigenMov = 1 Then MovAlmacen = False Else MovAlmacen = True If OrigenMov = 1 Then MovAlmacen = False Else MovAlmacen = True
If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then
DtCostos = ObjInventario.DtResultados DtCostos = ObjInventario.DtResultados
Dim tmpCostos As DataTable = DtCostos.FiltraParametros("", "", {"CveClasificacion"}) Dim tmpCostos As DataTable = DtCostos.FiltraParametros("", "", {"CveClasificacion"})
Dim IdCtaContable As Integer = 0 Dim IdCtaContable As Integer = 0
Dim ConceptoPoliza As String = String.Format("{0}-{1}", "Salida de Almacen", SerieFolio) Dim ConceptoPoliza As String = String.Format("{0}-{1}", "Salida de Almacen", SerieFolio)
If tmpCostos.Rows.Count > 0 Then If tmpCostos.Rows.Count > 0 Then
Dim Concepto As String = ConceptoPoliza Dim Concepto As String = ConceptoPoliza
Dim CvePrePoliza = ObjConta.AddPrePolizas("Inv_EntradaSalida", 74, DtCostos.SUM("Total"), DtCostos.SUM("Total"), 1, TxtFecha.Text.ToDate, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Dim CvePrePoliza = ObjConta.AddPrePolizas("Inv_EntradaSalida", 74, DtCostos.SUM("Total"), DtCostos.SUM("Total"), 1, TxtFecha.Text.ToDate, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
Dim tCveSubProyecto = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen={CveAlmacen}").ToEntero Dim tCveSubProyecto = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen={CveAlmacen}").ToEntero
Dim tCveConcepto As Integer = 69 Dim tCveConcepto As Integer = 69
For Each RowInv As DataRow In tmpCostos.Rows For Each RowInv As DataRow In tmpCostos.Rows
ValorInventario = DtCostos.SUM("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").ToString.ToDecimal.RoundSQL ValorInventario = DtCostos.SUM("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").ToString.ToDecimal.RoundSQL
If tCveConcepto = 69 Then If tCveConcepto = 69 Then
IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero
End If 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 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
Exit For
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
Retorno = False Retorno = False
Exit For
End If 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 If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, -1) Then
If ObjConta.ValorPolizaDescuadre > 0 Then
GuardaLogAD($"Inventarios/RecepcionAlmacen-PPCompOC | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
Retorno = False
End If
End If
'CONTABILIZAR - SIMPLIFICAR
If Retorno Then
If UsuarioActual.Empresa.Funcionalidad(220) <> "" Then
If Not ObjConta.PrePolizaSimplificacion(CvePrePoliza, UsuarioActual.CveEmpresa) Then
Retorno = False
End If
End If
If UsuarioActual.Empresa.Funcionalidad(200) = "1" Then
If ObjContaContPAQ Is Nothing Then
ObjContaContPAQ = New ClsContPAQi(UsuarioActual.Empresa)
ObjContaContPAQ.IniciaTransacSQL()
End If
If Not ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContaContPAQ) Then
Retorno = False
End If
End If
End If
Else
Retorno = False Retorno = False
End If End If
Else
Retorno = False
If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, -1) Then
If ObjConta.ValorPolizaDescuadre > 0 Then
GuardaLogAD($"Inventarios/RecepcionAlmacen-PPCompOC | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
Retorno = False
End If
End If
'CONTABILIZAR - SIMPLIFICAR
If Retorno Then
If UsuarioActual.Empresa.Funcionalidad(220) <> "" Then
If Not ObjConta.PrePolizaSimplificacion(CvePrePoliza, UsuarioActual.CveEmpresa) Then
Retorno = False
End If
End If
If UsuarioActual.Empresa.Funcionalidad(200) = "1" Then
If ObjContaContPAQ Is Nothing Then
ObjContaContPAQ = New ClsContPAQi(UsuarioActual.Empresa)
ObjContaContPAQ.IniciaTransacSQL()
End If
If Not ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContaContPAQ) Then
Retorno = False
End If
End If
End If
End If End If
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

View File

@@ -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

View File

@@ -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>

View File

@@ -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
@@ -436,30 +429,15 @@ Partial Class Inventarios_RecepcionUsados
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
@@ -488,45 +463,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
@@ -567,7 +521,6 @@ Partial Class Inventarios_RecepcionUsados
End Sub End Sub
#End Region #End Region
#Region " CARGA DATOS " #Region " CARGA DATOS "
@@ -600,7 +553,6 @@ Partial Class Inventarios_RecepcionUsados
#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)
@@ -1221,7 +1156,6 @@ Partial Class Inventarios_RecepcionUsados
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)
@@ -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
@@ -1346,7 +1252,6 @@ Partial Class Inventarios_RecepcionUsados
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
@@ -1444,13 +1349,6 @@ Partial Class Inventarios_RecepcionUsados
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
@@ -1492,7 +1390,6 @@ Partial Class Inventarios_RecepcionUsados
#End Region #End Region
#Region " BITACORA " #Region " BITACORA "
Private Sub InicializaBitacoraTemporal() Private Sub InicializaBitacoraTemporal()
@@ -1696,10 +1593,6 @@ Partial Class Inventarios_RecepcionUsados
End Sub End Sub
#End Region #End Region
#Region " CONSUMO INTERNO " #Region " CONSUMO INTERNO "
'Private Sub ActivaConsumoInterno() 'Private Sub ActivaConsumoInterno()
' EsConsumoInterno = True ' EsConsumoInterno = True
@@ -1729,7 +1622,6 @@ Partial Class Inventarios_RecepcionUsados
'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))
@@ -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
@@ -1886,10 +1798,6 @@ Partial Class Inventarios_RecepcionUsados
#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()

View File

@@ -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

View File

@@ -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);

View File

@@ -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