osito cariñosito
This commit is contained in:
@@ -504,7 +504,7 @@ Public Class ClsContabilidad
|
|||||||
If ex.Message.Contains("50015;") Then
|
If ex.Message.Contains("50015;") Then
|
||||||
OnError("No se puede eliminar una póliza en un ejercicio Cerrado", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
OnError("No se puede eliminar una póliza en un ejercicio Cerrado", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
Else
|
Else
|
||||||
OnError("Ocurrió un error al Guardar", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
OnError("Ocurrió un error al Eliminar", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
End If
|
End If
|
||||||
End Try
|
End Try
|
||||||
|
|
||||||
@@ -536,7 +536,11 @@ Public Class ClsContabilidad
|
|||||||
SqlAdapter.Fill(Data)
|
SqlAdapter.Fill(Data)
|
||||||
Retorno = True
|
Retorno = True
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
OnError("Ocurrió un error al eliminar el detalle de la prepoliza", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
If ex.Message.Contains("50015;") Then
|
||||||
|
OnError("No se puede eliminar una póliza en un ejercicio Cerrado", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
Else
|
||||||
|
OnError("Ocurrió un error al eliminar el detalle de la prepoliza", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
End If
|
||||||
End Try
|
End Try
|
||||||
|
|
||||||
Return Retorno
|
Return Retorno
|
||||||
@@ -790,9 +794,17 @@ Public Class ClsContabilidad
|
|||||||
SqlAdapter.Fill(Data)
|
SqlAdapter.Fill(Data)
|
||||||
Retorno = True
|
Retorno = True
|
||||||
Catch ex1 As SqlException
|
Catch ex1 As SqlException
|
||||||
OnError("Ocurrió un error al Guardar", ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
If ex1.Message.Contains("50015;") Then
|
||||||
|
OnError("No se puede registrar una póliza en un ejercicio Cerrado", ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
Else
|
||||||
|
OnError("Ocurrió un error al Guardar", ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
End If
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
OnError("Ocurrió un error al Guardar", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
If ex.Message.Contains("50015;") Then
|
||||||
|
OnError("No se puede registrar una póliza en un ejercicio Cerrado", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
Else
|
||||||
|
OnError("Ocurrió un error al Guardar", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
End If
|
||||||
End Try
|
End Try
|
||||||
|
|
||||||
Return Retorno
|
Return Retorno
|
||||||
@@ -949,7 +961,11 @@ Public Class ClsContabilidad
|
|||||||
SqlAdapter.Fill(Data)
|
SqlAdapter.Fill(Data)
|
||||||
Retorno = True
|
Retorno = True
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
OnError("Ocurrió un error al bloquear o desbloquear las prepolizas detalle.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
If ex.Message.Contains("50015;") Then
|
||||||
|
OnError("No se puede actualizar una póliza en un ejercicio Cerrado", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
Else
|
||||||
|
OnError("Ocurrió un error al bloquear o desbloquear las prepolizas detalle.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||||
|
End If
|
||||||
End Try
|
End Try
|
||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
@@ -1276,6 +1292,11 @@ Public Class ClsContabilidad
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If Not OcurrioError Then
|
||||||
|
If Not UpdatePrePolizasDetalleBloquear(CvePrePoliza, True) Then
|
||||||
|
OcurrioError = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
If Not OcurrioError Then
|
If Not OcurrioError Then
|
||||||
If Not UpdatePrePoliza(Fecha, ObjConta.Folio, CveTipoPoliza, tIdPoliza, CvePrePoliza, Empresa.CveEmpresa) Then
|
If Not UpdatePrePoliza(Fecha, ObjConta.Folio, CveTipoPoliza, tIdPoliza, CvePrePoliza, Empresa.CveEmpresa) Then
|
||||||
@@ -1283,11 +1304,7 @@ Public Class ClsContabilidad
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If Not OcurrioError Then
|
|
||||||
If Not UpdatePrePolizasDetalleBloquear(CvePrePoliza, True) Then
|
|
||||||
OcurrioError = True
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
'If Empresa.Funcionalidad(522).ToString = "1" And Empresa.UsaContabilidad Then
|
'If Empresa.Funcionalidad(522).ToString = "1" And Empresa.UsaContabilidad Then
|
||||||
|
|
||||||
@@ -1741,7 +1758,12 @@ Public Class ClsContabilidad
|
|||||||
SqlAdapter.Fill(Data)
|
SqlAdapter.Fill(Data)
|
||||||
Retorno = True
|
Retorno = True
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
OnError("Ocurrió un error al actualizar prepoliza del movimiento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
|
||||||
|
If ex.Message.Contains("50015;") Then
|
||||||
|
OnError("No se puede actualizar una póliza en un ejercicio Cerrado", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
Else
|
||||||
|
OnError("Ocurrió un error al actualizar prepoliza del movimiento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
End If
|
||||||
End Try
|
End Try
|
||||||
|
|
||||||
Return Retorno
|
Return Retorno
|
||||||
|
|||||||
@@ -5192,7 +5192,6 @@ Partial Class Compras_Compras
|
|||||||
Dim tipoCambioPago As Decimal
|
Dim tipoCambioPago As Decimal
|
||||||
Dim alertaContabilizacion As String = "Se enviaron correctamente las siguientes pólizas:<br><br>"
|
Dim alertaContabilizacion As String = "Se enviaron correctamente las siguientes pólizas:<br><br>"
|
||||||
Dim idCuentaContabilizacion As Long = 1
|
Dim idCuentaContabilizacion As Long = 1
|
||||||
Dim BanderaContilizar = True
|
|
||||||
Dim CveCuentaContabilizacion As Long = 1
|
Dim CveCuentaContabilizacion As Long = 1
|
||||||
Dim FechaMovimiento As Date = TxtFecha.Text.ToDate
|
Dim FechaMovimiento As Date = TxtFecha.Text.ToDate
|
||||||
Dim DT As DataTable = Nothing
|
Dim DT As DataTable = Nothing
|
||||||
@@ -6072,7 +6071,6 @@ Partial Class Compras_Compras
|
|||||||
If OCVinculada Or CveConceptoContableAlmacen.Contiene(237, 240) Then
|
If OCVinculada Or CveConceptoContableAlmacen.Contiene(237, 240) Then
|
||||||
ConceptoContabilizacion = CveConceptoContableAlmacen
|
ConceptoContabilizacion = CveConceptoContableAlmacen
|
||||||
End If
|
End If
|
||||||
BanderaContilizar = If(ConceptoContabilizacion = 205, False, True)
|
|
||||||
Dim UsaComplementariaFleteImportaciones As Boolean = False
|
Dim UsaComplementariaFleteImportaciones As Boolean = False
|
||||||
|
|
||||||
Select Case ConceptoContabilizacion
|
Select Case ConceptoContabilizacion
|
||||||
@@ -6990,6 +6988,12 @@ Partial Class Compras_Compras
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
'Simplificacion de PrePolizas
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(220) <> "" Then
|
||||||
|
If Not ObjConta.PrePolizaSimplificacion(CvePrePoliza, UsuarioActual.CveEmpresa) Then
|
||||||
|
ErrorPrepolizaDescuadre = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, 4) Then
|
If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, 4) Then
|
||||||
If ObjConta.ValorPolizaDescuadre > 0 Then
|
If ObjConta.ValorPolizaDescuadre > 0 Then
|
||||||
@@ -7000,19 +7004,17 @@ Partial Class Compras_Compras
|
|||||||
|
|
||||||
'Conta ContPAQ
|
'Conta ContPAQ
|
||||||
If ObjContaAC IsNot Nothing AndAlso Not ErrorPrepoliza AndAlso Not ErrorPrepolizaDescuadre AndAlso UsuarioActual.Empresa.UsaContabilidad Then
|
If ObjContaAC IsNot Nothing AndAlso Not ErrorPrepoliza AndAlso Not ErrorPrepolizaDescuadre AndAlso UsuarioActual.Empresa.UsaContabilidad Then
|
||||||
If BanderaContilizar Then
|
If idCuentaContabilizacion > 0 Then
|
||||||
If idCuentaContabilizacion > 0 Then
|
If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContaAC) Then
|
||||||
If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContaAC) Then
|
' Alert(alertaContabilizacion, ModExtensiones.TipoMensaje.MsgInformacion)
|
||||||
' Alert(alertaContabilizacion, ModExtensiones.TipoMensaje.MsgInformacion)
|
IdPoliza = ObjConta.ContaIdPoliza
|
||||||
IdPoliza = ObjConta.ContaIdPoliza
|
|
||||||
Else
|
|
||||||
ErrorPrepoliza = True
|
|
||||||
Alert($"Ocurrio un error al contabilizar {ObjConta.AlertaMensaje}", TipoMensaje.MsgAdvertencia)
|
|
||||||
End If
|
|
||||||
Else
|
Else
|
||||||
Alert(String.Format("No se puede contabilizar la Prepoliza debido a que las siguientes cuentas son inválidas: <br>{0}", CuentasContablesInvalidas), TipoMensaje.MsgAdvertencia)
|
|
||||||
ErrorPrepoliza = True
|
ErrorPrepoliza = True
|
||||||
|
Alert($"Ocurrio un error al contabilizar {ObjConta.AlertaMensaje}", TipoMensaje.MsgAdvertencia)
|
||||||
End If
|
End If
|
||||||
|
Else
|
||||||
|
Alert(String.Format("No se puede contabilizar la Prepoliza debido a que las siguientes cuentas son inválidas: <br>{0}", CuentasContablesInvalidas), TipoMensaje.MsgAdvertencia)
|
||||||
|
ErrorPrepoliza = True
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -7614,12 +7616,7 @@ Partial Class Compras_Compras
|
|||||||
MsgAccionAceptar = "location.href =""Compras.aspx"""
|
MsgAccionAceptar = "location.href =""Compras.aspx"""
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'Simplificacion de PrePolizas
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(220) <> "" Then
|
|
||||||
If Not ObjConta.PrePolizaSimplificacion(CvePrePoliza, UsuarioActual.CveEmpresa) Then
|
|
||||||
Alert("No se pudo simplificar los movimientos", TipoMensaje.MsgError)
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
'CUANDO ES REEMBOLSO COMPROBACION Y CAJA CHICA
|
'CUANDO ES REEMBOLSO COMPROBACION Y CAJA CHICA
|
||||||
If UsuarioActual.CveEmpresa.Contiene(1, 119) AndAlso TxtNumeroReembolso.Text.Trim <> "" AndAlso (DdlPersonalReembolso.SelectedValue.ToEntero > 0 Or DdlCuentaCajaChicaReembolso.SelectedValue.ToEntero > 0) Then
|
If UsuarioActual.CveEmpresa.Contiene(1, 119) AndAlso TxtNumeroReembolso.Text.Trim <> "" AndAlso (DdlPersonalReembolso.SelectedValue.ToEntero > 0 Or DdlCuentaCajaChicaReembolso.SelectedValue.ToEntero > 0) Then
|
||||||
@@ -11223,10 +11220,10 @@ Partial Class Compras_Compras
|
|||||||
Dim dr1 As DataRow = TmpDT.Rows(Index)
|
Dim dr1 As DataRow = TmpDT.Rows(Index)
|
||||||
Dim dr As DataRow = TmpDT.NewRow
|
Dim dr As DataRow = TmpDT.NewRow
|
||||||
dr.ItemArray = dr1.ItemArray
|
dr.ItemArray = dr1.ItemArray
|
||||||
Dim IVA = dr1("IVA").ToString.ToDouble / (dr1("Cantidad").ToString.ToDouble * dr1("PU").ToString.ToDouble)
|
|
||||||
dr1("Cantidad") = (dr1("Cantidad").ToString.ToDouble - Cantidad.ToDouble)
|
dr1("Cantidad") = (dr1("Cantidad").ToString.ToDouble - Cantidad.ToDouble)
|
||||||
dr1("IVA") = IVA * dr1("Cantidad").ToString.ToDouble * dr1("PU").ToString.ToDouble
|
|
||||||
dr1("Total") = dr1("PU").ToString.ToDouble * dr1("Cantidad").ToString.ToDouble
|
dr1("Total") = dr1("PU").ToString.ToDouble * dr1("Cantidad").ToString.ToDouble
|
||||||
|
dr1("IVA") = Math.Round(dr1("IVAPorcentaje").ToString.ToDouble * dr1("Total").ToString.ToDouble, 6)
|
||||||
|
|
||||||
TmpDT.AcceptChanges()
|
TmpDT.AcceptChanges()
|
||||||
|
|
||||||
dr("CvePersonal") = 0
|
dr("CvePersonal") = 0
|
||||||
@@ -11234,8 +11231,8 @@ Partial Class Compras_Compras
|
|||||||
dr("CveActivoFijo") = 0
|
dr("CveActivoFijo") = 0
|
||||||
dr("CodAF") = 0
|
dr("CodAF") = 0
|
||||||
dr("Cantidad") = Cantidad.ToDouble
|
dr("Cantidad") = Cantidad.ToDouble
|
||||||
dr("IVA") = IVA * dr("Cantidad").ToString.ToDouble * dr("PU").ToString.ToDouble
|
|
||||||
dr("Total") = dr("PU").ToString.ToDouble * Cantidad.ToDouble
|
dr("Total") = dr("PU").ToString.ToDouble * Cantidad.ToDouble
|
||||||
|
dr("IVA") = Math.Round(dr("IVAPorcentaje").ToString.ToDouble * dr("Total").ToString.ToDouble, 6)
|
||||||
TmpDT.Rows.InsertAt(dr, Index)
|
TmpDT.Rows.InsertAt(dr, Index)
|
||||||
TmpDT.AcceptChanges()
|
TmpDT.AcceptChanges()
|
||||||
|
|
||||||
@@ -11435,6 +11432,7 @@ Partial Class Compras_Compras
|
|||||||
|
|
||||||
dr1("Cantidad") = (dr1("Cantidad").ToString.ToDouble - Cantidad.ToDouble)
|
dr1("Cantidad") = (dr1("Cantidad").ToString.ToDouble - Cantidad.ToDouble)
|
||||||
dr1("Total") = dr1("PU").ToString.ToDouble * dr1("Cantidad").ToString.ToDouble
|
dr1("Total") = dr1("PU").ToString.ToDouble * dr1("Cantidad").ToString.ToDouble
|
||||||
|
dr1("IVA") = Math.Round(dr1("IVAPorcentaje").ToString.ToDouble * dr1("Total").ToString.ToDouble, 6)
|
||||||
TmpDT.AcceptChanges()
|
TmpDT.AcceptChanges()
|
||||||
|
|
||||||
|
|
||||||
@@ -11442,6 +11440,7 @@ Partial Class Compras_Compras
|
|||||||
dr("CodAF") = ""
|
dr("CodAF") = ""
|
||||||
dr("Cantidad") = Cantidad.ToDouble
|
dr("Cantidad") = Cantidad.ToDouble
|
||||||
dr("Total") = dr("PU").ToString.ToDouble * Cantidad.ToDouble
|
dr("Total") = dr("PU").ToString.ToDouble * Cantidad.ToDouble
|
||||||
|
dr("IVA") = Math.Round(dr("IVAPorcentaje").ToString.ToDouble * dr("Total").ToString.ToDouble, 6)
|
||||||
|
|
||||||
TmpDT.Rows.InsertAt(dr, Index + 1)
|
TmpDT.Rows.InsertAt(dr, Index + 1)
|
||||||
|
|
||||||
@@ -16756,6 +16755,8 @@ Partial Class Compras_Compras
|
|||||||
Row("CveClasificacionOG") = DdlACGeneral5.SelectedValue.ToEntero
|
Row("CveClasificacionOG") = DdlACGeneral5.SelectedValue.ToEntero
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TmpDT.Rows.Add(Row)
|
TmpDT.Rows.Add(Row)
|
||||||
TmpDT.Rows.IndexOf(Row)
|
TmpDT.Rows.IndexOf(Row)
|
||||||
|
|
||||||
@@ -16857,6 +16858,10 @@ Partial Class Compras_Compras
|
|||||||
DrPS("CveTipoGasto") = DdlTipoGasto.SelectedValue.ToEntero
|
DrPS("CveTipoGasto") = DdlTipoGasto.SelectedValue.ToEntero
|
||||||
DrPS("TipoGasto") = If(DdlTipoGasto.SelectedValue.ToEntero > 0, DdlTipoGasto.SelectedItem.Text, "")
|
DrPS("TipoGasto") = If(DdlTipoGasto.SelectedValue.ToEntero > 0, DdlTipoGasto.SelectedItem.Text, "")
|
||||||
|
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(562).ToEntero > 0 Then
|
||||||
|
DrPS("AplicaCostoIndirecto") = "0"
|
||||||
|
End If
|
||||||
|
|
||||||
'IMPUESTOS: SI ES COMPRA, FACUTRA O CON OC, NO MODIFICA IMPUESTOS!!
|
'IMPUESTOS: SI ES COMPRA, FACUTRA O CON OC, NO MODIFICA IMPUESTOS!!
|
||||||
'Dim IVA = (TxtIVAModal.Text.ToDouble / 100)
|
'Dim IVA = (TxtIVAModal.Text.ToDouble / 100)
|
||||||
Dim IVA = Math.Round(DdlIVA.SelectedValue.ToDouble - 1, 2)
|
Dim IVA = Math.Round(DdlIVA.SelectedValue.ToDouble - 1, 2)
|
||||||
|
|||||||
@@ -624,6 +624,11 @@ Partial Class Compras_ReembolsosComprobaciones
|
|||||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, False, gvr.FCTextBox("TxtComision").Text.ToDecimal, Referencia, 211, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, IdCtaProveedor, -1, CveIE:=CveIERegistrado, CvePersonal:=CvePersonal, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.FCTextBox("TxtComision").Text.ToDecimal), ImporteMX:=gvr.FCTextBox("TxtComision").Text.ToDecimal * tipoCambio, CveCuenta:=CveCuentaProveedor) Then
|
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, False, gvr.FCTextBox("TxtComision").Text.ToDecimal, Referencia, 211, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, IdCtaProveedor, -1, CveIE:=CveIERegistrado, CvePersonal:=CvePersonal, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.FCTextBox("TxtComision").Text.ToDecimal), ImporteMX:=gvr.FCTextBox("TxtComision").Text.ToDecimal * tipoCambio, CveCuenta:=CveCuentaProveedor) Then
|
||||||
MsgError = "no se pudo insertar el detalle de la poliza de otros ingresos"
|
MsgError = "no se pudo insertar el detalle de la poliza de otros ingresos"
|
||||||
End If
|
End If
|
||||||
|
If CveCajaChica > 0 Then
|
||||||
|
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, True, gvr.FCTextBox("TxtComision").Text.ToDecimal, Referencia, 211, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, IdCtaProveedor, -1, CveIE:=CveIERegistrado, CvePersonal:=CvePersonal, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.FCTextBox("TxtComision").Text.ToDecimal), ImporteMX:=gvr.FCTextBox("TxtComision").Text.ToDecimal * tipoCambio, CveCuenta:=CveCuentaProveedor, Contabilizable:=False) Then
|
||||||
|
MsgError = "no se pudo insertar el detalle de la poliza de otros ingresos"
|
||||||
|
End If
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If gvr.DataKey("Original").ToDecimal > 0 Then PorcentajePago = (ImporteMovto / gvr.DataKey("Original").ToDecimal).RoundSQL(6) Else PorcentajePago = 1
|
If gvr.DataKey("Original").ToDecimal > 0 Then PorcentajePago = (ImporteMovto / gvr.DataKey("Original").ToDecimal).RoundSQL(6) Else PorcentajePago = 1
|
||||||
|
|||||||
@@ -161,7 +161,7 @@ Partial Class Compras_RepRembolsoComprobaciones
|
|||||||
Dim ObjComp As New ClsCompras()
|
Dim ObjComp As New ClsCompras()
|
||||||
Dim ObjMov As New ClsContabilidad(ObjComp.IniciaTransacSQL)
|
Dim ObjMov As New ClsContabilidad(ObjComp.IniciaTransacSQL)
|
||||||
Dim ObjAC As ClsContPAQi = Nothing
|
Dim ObjAC As ClsContPAQi = Nothing
|
||||||
If UsuarioActual.Empresa.UsaAC Then
|
If UsuarioActual.Empresa.UsaContabilidad Then
|
||||||
ObjAC = New ClsContPAQi(UsuarioActual.Empresa)
|
ObjAC = New ClsContPAQi(UsuarioActual.Empresa)
|
||||||
ObjAC.IniciaTransacSQL()
|
ObjAC.IniciaTransacSQL()
|
||||||
End If
|
End If
|
||||||
@@ -198,7 +198,7 @@ Partial Class Compras_RepRembolsoComprobaciones
|
|||||||
Msg.AppendFormat("Se unificaron todas las compras con éxito")
|
Msg.AppendFormat("Se unificaron todas las compras con éxito")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If UsuarioActual.Empresa.UsaAC AndAlso Not TieneError Then
|
If UsuarioActual.Empresa.UsaContabilidad AndAlso Not TieneError Then
|
||||||
If ObjAC Is Nothing Then
|
If ObjAC Is Nothing Then
|
||||||
TieneError = True
|
TieneError = True
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -617,7 +617,7 @@
|
|||||||
</Style>
|
</Style>
|
||||||
</TextRun>
|
</TextRun>
|
||||||
<TextRun>
|
<TextRun>
|
||||||
<Value>=Parameters!Folio.Value</Value>
|
<Value>=IIF(Parameters!Serie.Value.ToString="",Parameters!Folio.Value,Parameters!Serie.Value & "-" &Parameters!Folio.Value)</Value>
|
||||||
<Style>
|
<Style>
|
||||||
<FontFamily>Bahnschrift</FontFamily>
|
<FontFamily>Bahnschrift</FontFamily>
|
||||||
<FontSize>8pt</FontSize>
|
<FontSize>8pt</FontSize>
|
||||||
@@ -1739,7 +1739,7 @@ Celular: </Value>
|
|||||||
</Style>
|
</Style>
|
||||||
</TextRun>
|
</TextRun>
|
||||||
<TextRun>
|
<TextRun>
|
||||||
<Value>=Parameters!VendedorMail.Value</Value>
|
<Value>SERVICIOSESPECIALIZADOSENTI@GMAIL.COM</Value>
|
||||||
<Style>
|
<Style>
|
||||||
<FontFamily>bahnschrift</FontFamily>
|
<FontFamily>bahnschrift</FontFamily>
|
||||||
<FontSize>8pt</FontSize>
|
<FontSize>8pt</FontSize>
|
||||||
@@ -1755,7 +1755,7 @@ Celular: </Value>
|
|||||||
<Top>0.86675cm</Top>
|
<Top>0.86675cm</Top>
|
||||||
<Left>0.31387cm</Left>
|
<Left>0.31387cm</Left>
|
||||||
<Height>1.8206cm</Height>
|
<Height>1.8206cm</Height>
|
||||||
<Width>6.29968cm</Width>
|
<Width>7.42333cm</Width>
|
||||||
<ZIndex>8</ZIndex>
|
<ZIndex>8</ZIndex>
|
||||||
<Style>
|
<Style>
|
||||||
<Border>
|
<Border>
|
||||||
|
|||||||
@@ -198,7 +198,7 @@
|
|||||||
<Paragraph>
|
<Paragraph>
|
||||||
<TextRuns>
|
<TextRuns>
|
||||||
<TextRun>
|
<TextRun>
|
||||||
<Value>|www.adsistemas.mx | julian@adsistemas.mx|</Value>
|
<Value>|www.adssistemas.mx | julian@adssistemas.mx|</Value>
|
||||||
<Style>
|
<Style>
|
||||||
<FontFamily>Calibri</FontFamily>
|
<FontFamily>Calibri</FontFamily>
|
||||||
<FontSize>8pt</FontSize>
|
<FontSize>8pt</FontSize>
|
||||||
|
|||||||
@@ -203,7 +203,7 @@
|
|||||||
<Paragraph>
|
<Paragraph>
|
||||||
<TextRuns>
|
<TextRuns>
|
||||||
<TextRun>
|
<TextRun>
|
||||||
<Value>www.adsistemas.mx|facturacion@adssistemas.mx</Value>
|
<Value>www.adssistemas.mx|facturacion@adssistemas.mx</Value>
|
||||||
<Style>
|
<Style>
|
||||||
<FontStyle>Normal</FontStyle>
|
<FontStyle>Normal</FontStyle>
|
||||||
<FontFamily>Calibri</FontFamily>
|
<FontFamily>Calibri</FontFamily>
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -8,14 +8,6 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
#DivShipment {
|
|
||||||
z-index: 1999;
|
|
||||||
}
|
|
||||||
|
|
||||||
#DivStop {
|
|
||||||
z-index: 2000;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||||
@@ -257,11 +249,13 @@
|
|||||||
<asp:RequiredFieldValidator ID="RFVName" runat="server" ControlToValidate="TxtLocName" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Name''</b> es necesario, por favor ingréselo." ValidationGroup="GrpStop"></asp:RequiredFieldValidator>
|
<asp:RequiredFieldValidator ID="RFVName" runat="server" ControlToValidate="TxtLocName" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Name''</b> es necesario, por favor ingréselo." ValidationGroup="GrpStop"></asp:RequiredFieldValidator>
|
||||||
<label for="<%= TxtLocName.ClientID.ToString()%>">Name:</label>
|
<label for="<%= TxtLocName.ClientID.ToString()%>">Name:</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group form-md-line-input input-iconright">
|
<form method="post">
|
||||||
<asp:TextBox ID="TxtLocID" CssClass="form-control " runat="server"></asp:TextBox>
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TxtLocID" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Location''</b> es necesario, por favor ingréselo." ValidationGroup="GrpStop"></asp:RequiredFieldValidator>
|
<asp:TextBox ID="TxtLocID" CssClass="form-control " runat="server"></asp:TextBox>
|
||||||
<label for="<%= TxtLocID.ClientID.ToString()%>">Location ID:</label>
|
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TxtLocID" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Location''</b> es necesario, por favor ingréselo." ValidationGroup="GrpStop"></asp:RequiredFieldValidator>
|
||||||
</div>
|
<label for="<%= TxtLocID.ClientID.ToString()%>">Location ID:</label>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
<div class="portlet light smmallpadding traspasorow bordered">
|
<div class="portlet light smmallpadding traspasorow bordered">
|
||||||
<div class="portlet-title">
|
<div class="portlet-title">
|
||||||
<div class="caption font-green">
|
<div class="caption font-green">
|
||||||
@@ -306,19 +300,27 @@
|
|||||||
<div class="row v-center">
|
<div class="row v-center">
|
||||||
<label class="col-md-12" style="color: gray">Early Arrival Time:</label>
|
<label class="col-md-12" style="color: gray">Early Arrival Time:</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy hh:mm" style="display: inline-block;">
|
<div class="row">
|
||||||
<asp:TextBox ID="TxtFechaStopI" runat="server" CssClass="form-control input-sm ADDateTimePicker" CausesValidation="true" MaxLength="18" Width="132px "></asp:TextBox>
|
<div class="col-md-12">
|
||||||
<asp:RequiredFieldValidator ID="RFVFechaIStop" runat="server" ControlToValidate="TxtFechaStopI" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Early Arrival Time''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpStop"></asp:RequiredFieldValidator>
|
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy hh:mm">
|
||||||
<ajax:ValidatorCalloutExtender ID="VCEI" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaIStop" Width="350px"></ajax:ValidatorCalloutExtender>
|
<asp:TextBox ID="TxtFechaStopI" runat="server" CssClass="form-control input-sm ADDateTimePicker" CausesValidation="true" MaxLength="18" Width="132px "></asp:TextBox>
|
||||||
|
<asp:RequiredFieldValidator ID="RFVFechaIStop" runat="server" ControlToValidate="TxtFechaStopI" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Early Arrival Time''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpStop"></asp:RequiredFieldValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="VCEI" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaIStop" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
<div class="row v-center">
|
<div class="row v-center">
|
||||||
<label class="col-md-12" style="color: gray">Late Arrival Time:</label>
|
<label class="col-md-12" style="color: gray">Late Arrival Time:</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy hh:mm" style="display: inline-block;">
|
<div class="row">
|
||||||
<asp:TextBox ID="TxtFechaStopF" runat="server" CssClass="form-control input-sm ADDateTimePicker" CausesValidation="true" MaxLength="18" Width="132px "></asp:TextBox>
|
<div class="col-md-12">
|
||||||
<asp:RequiredFieldValidator ID="RFVFechaFStop" runat="server" ControlToValidate="TxtFechaStopF" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Late Arrival Time''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpStop"></asp:RequiredFieldValidator>
|
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy hh:mm">
|
||||||
<ajax:ValidatorCalloutExtender ID="VCEF" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaFStop" Width="350px"></ajax:ValidatorCalloutExtender>
|
<asp:TextBox ID="TxtFechaStopF" runat="server" CssClass="form-control input-sm ADDateTimePicker" CausesValidation="true" MaxLength="18" Width="132px "></asp:TextBox>
|
||||||
|
<asp:RequiredFieldValidator ID="RFVFechaFStop" runat="server" ControlToValidate="TxtFechaStopF" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Late Arrival Time''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpStop"></asp:RequiredFieldValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="VCEF" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaFStop" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
@@ -346,9 +348,16 @@
|
|||||||
<asp:RequiredFieldValidator ID="RFVStopRole" runat="server" ControlToValidate="DdlStopRole" InitialValue="-1" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Stop Role''</b> es necesario, por favor ingréselo." ValidationGroup="GrpStop"></asp:RequiredFieldValidator>
|
<asp:RequiredFieldValidator ID="RFVStopRole" runat="server" ControlToValidate="DdlStopRole" InitialValue="-1" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Stop Role''</b> es necesario, por favor ingréselo." ValidationGroup="GrpStop"></asp:RequiredFieldValidator>
|
||||||
<label for="<%= DdlStopRole.ClientID.ToString()%>">Stop Role:</label>
|
<label for="<%= DdlStopRole.ClientID.ToString()%>">Stop Role:</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group form-md-line-input input-iconright">
|
<div class="row v-center">
|
||||||
<asp:TextBox ID="TxtLoc" CssClass="form-control " runat="server"></asp:TextBox>
|
<div class="col-md-9">
|
||||||
<label for="<%= TxtLoc.ClientID.ToString()%>">Search Location:</label>
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
|
<asp:TextBox ID="TxtLoc" CssClass="form-control" runat="server"></asp:TextBox>
|
||||||
|
<label for="<%= TxtLoc.ClientID.ToString()%>">Search Location:</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3 v-center">
|
||||||
|
<button type="button" class="btn btn-primary" onclick="BtnBuscar();">Buscar</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="portlet light smmallpadding traspasorow bordered">
|
<div class="portlet light smmallpadding traspasorow bordered">
|
||||||
<div class="portlet-title">
|
<div class="portlet-title">
|
||||||
@@ -510,6 +519,9 @@
|
|||||||
var markersEvent = [];
|
var markersEvent = [];
|
||||||
var markerEvent;
|
var markerEvent;
|
||||||
|
|
||||||
|
var searchBox;
|
||||||
|
var searchBoxEvent;
|
||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
initMap();
|
initMap();
|
||||||
Sys.Application.add_load(function (s, e) {
|
Sys.Application.add_load(function (s, e) {
|
||||||
@@ -517,9 +529,10 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#DivShipment').on('hidden.bs.modal', function () {
|
|
||||||
return false;
|
//$("form").submit(function (event) {
|
||||||
});
|
// event.preventDefault();
|
||||||
|
//});
|
||||||
|
|
||||||
function initMap() {
|
function initMap() {
|
||||||
|
|
||||||
@@ -544,65 +557,23 @@
|
|||||||
directionsDisplayEvent.setOptions({ suppressMarkers: true });
|
directionsDisplayEvent.setOptions({ suppressMarkers: true });
|
||||||
directionsDisplayEvent.setMap(mapEvent);
|
directionsDisplayEvent.setMap(mapEvent);
|
||||||
|
|
||||||
var searchBox = new google.maps.places.SearchBox(document.getElementById("<%= TxtLoc.ClientID%>"));
|
searchBox = new google.maps.places.SearchBox(document.getElementById("<%= TxtLoc.ClientID%>"));
|
||||||
var searchBoxEvent = new google.maps.places.SearchBox(document.getElementById("<%= TxtLoc2.ClientID%>"));
|
searchBoxEvent = new google.maps.places.SearchBox(document.getElementById("<%= TxtLoc2.ClientID%>"));
|
||||||
|
|
||||||
|
$("#<%= TxtLoc.ClientID%>").bind('keypress', function (e) {
|
||||||
|
if (e.keyCode == 13) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$("#<%= TxtLoc2.ClientID%>").bind('keypress', function (e) {
|
||||||
|
if (e.keyCode == 13) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
searchBox.addListener('places_changed', function () {
|
searchBox.addListener('places_changed', function () {
|
||||||
var places = searchBox.getPlaces();
|
var places = searchBox.getPlaces();
|
||||||
if (places.length == 0) {
|
BuscarDireccion(places);
|
||||||
return;
|
|
||||||
}
|
|
||||||
var bounds = new google.maps.LatLngBounds();
|
|
||||||
places.forEach(function (place) {
|
|
||||||
if (!place.geometry) {
|
|
||||||
console.log("Returned place contains no geometry");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var lat = place.geometry.location.lat();
|
|
||||||
var lng = place.geometry.location.lng();
|
|
||||||
|
|
||||||
$("#<%= TxtLatLong.ClientID%>").val(lat + ',' + lng);
|
|
||||||
|
|
||||||
getDirecciones(lat, lng);
|
|
||||||
|
|
||||||
var icon = {
|
|
||||||
url: 'http://maps.google.com/mapfiles/ms/micons/truck.png',
|
|
||||||
size: new google.maps.Size(71, 71),
|
|
||||||
origin: new google.maps.Point(0, 0),
|
|
||||||
anchor: new google.maps.Point(17, 34),
|
|
||||||
scaledSize: new google.maps.Size(25, 25)
|
|
||||||
};
|
|
||||||
|
|
||||||
marker = new google.maps.Marker({
|
|
||||||
map: map,
|
|
||||||
icon: icon,
|
|
||||||
title: place.name,
|
|
||||||
position: place.geometry.location,
|
|
||||||
draggable: true,
|
|
||||||
animation: google.maps.Animation.DROP
|
|
||||||
});
|
|
||||||
|
|
||||||
google.maps.event.addListener(marker, 'dragend', function () {
|
|
||||||
var pos = marker.getPosition();
|
|
||||||
getDirecciones(pos.lat(), pos.lng());
|
|
||||||
});
|
|
||||||
// Create a marker for each place.
|
|
||||||
deleteMarkers(markers);
|
|
||||||
markers.push(marker);
|
|
||||||
|
|
||||||
if (place.geometry.viewport) {
|
|
||||||
// Only geocodes have viewport.
|
|
||||||
bounds.union(place.geometry.viewport);
|
|
||||||
} else {
|
|
||||||
bounds.extend(place.geometry.location);
|
|
||||||
}
|
|
||||||
|
|
||||||
map.fitBounds(bounds);
|
|
||||||
map.setCenter(bounds.getCenter());
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
searchBoxEvent.addListener('places_changed', function () {
|
searchBoxEvent.addListener('places_changed', function () {
|
||||||
@@ -632,6 +603,67 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
function BtnBuscar() {
|
||||||
|
var input = document.getElementById("<%= TxtLoc.ClientID%>");
|
||||||
|
|
||||||
|
google.maps.event.trigger(input, 'focus', {});
|
||||||
|
google.maps.event.trigger(input, 'keydown', { keyCode: 13 });
|
||||||
|
google.maps.event.trigger(this, 'focus', {});
|
||||||
|
}
|
||||||
|
function BuscarDireccion(places) {
|
||||||
|
if (places.length == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var bounds = new google.maps.LatLngBounds();
|
||||||
|
places.forEach(function (place) {
|
||||||
|
if (!place.geometry) {
|
||||||
|
console.log("Returned place contains no geometry");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var lat = place.geometry.location.lat();
|
||||||
|
var lng = place.geometry.location.lng();
|
||||||
|
|
||||||
|
$("#<%= TxtLatLong.ClientID%>").val(lat + ',' + lng);
|
||||||
|
|
||||||
|
getDirecciones(lat, lng);
|
||||||
|
|
||||||
|
var icon = {
|
||||||
|
url: 'http://maps.google.com/mapfiles/ms/micons/truck.png',
|
||||||
|
size: new google.maps.Size(71, 71),
|
||||||
|
origin: new google.maps.Point(0, 0),
|
||||||
|
anchor: new google.maps.Point(17, 34),
|
||||||
|
scaledSize: new google.maps.Size(25, 25)
|
||||||
|
};
|
||||||
|
|
||||||
|
marker = new google.maps.Marker({
|
||||||
|
map: map,
|
||||||
|
icon: icon,
|
||||||
|
title: place.name,
|
||||||
|
position: place.geometry.location,
|
||||||
|
draggable: true,
|
||||||
|
animation: google.maps.Animation.DROP
|
||||||
|
});
|
||||||
|
|
||||||
|
google.maps.event.addListener(marker, 'dragend', function () {
|
||||||
|
var pos = marker.getPosition();
|
||||||
|
getDirecciones(pos.lat(), pos.lng());
|
||||||
|
});
|
||||||
|
// Create a marker for each place.
|
||||||
|
deleteMarkers(markers);
|
||||||
|
markers.push(marker);
|
||||||
|
|
||||||
|
if (place.geometry.viewport) {
|
||||||
|
// Only geocodes have viewport.
|
||||||
|
bounds.union(place.geometry.viewport);
|
||||||
|
} else {
|
||||||
|
bounds.extend(place.geometry.location);
|
||||||
|
}
|
||||||
|
|
||||||
|
map.fitBounds(bounds);
|
||||||
|
map.setCenter(bounds.getCenter());
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
function cargapin(lat, lng) {
|
function cargapin(lat, lng) {
|
||||||
setTimeout(function () { SetMapPinEvent(lat, lng) }, 1000);
|
setTimeout(function () { SetMapPinEvent(lat, lng) }, 1000);
|
||||||
}
|
}
|
||||||
@@ -682,22 +714,21 @@
|
|||||||
}
|
}
|
||||||
markers = [];
|
markers = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
function getDirecciones(lat, lng) {
|
function getDirecciones(lat, lng) {
|
||||||
var url = '<%= ClsPaginas.UrlDirecciones%>' + 'nominatim/reverse.php?format=jsonv2&zoom=18&addressdetails=1&lat=' + lat + '&lon=' + lng;
|
var url = '<%= ClsPaginas.UrlDirecciones%>' + 'nominatim/reverse.php?format=jsonv2&zoom=18&addressdetails=1&lat=' + lat + '&lon=' + lng;
|
||||||
$.getJSON(url, function (data) {
|
$.getJSON(url, function (data) {
|
||||||
if (typeof (data.error) === 'undefined') {
|
if (typeof (data.error) === 'undefined') {
|
||||||
|
|
||||||
$("#<%= TxtLatLong.ClientID%>").val(lat + ',' + lng);
|
$("#<%= TxtLatLong.ClientID%>").val(lat + ',' + lng);
|
||||||
$("#<%= TxtAddress.ClientID%>").val(data.display_name);
|
$("#<%= TxtAddress.ClientID%>").val(data.display_name);
|
||||||
$("#<%= TxtCity.ClientID%>").val(data.address.city);
|
$("#<%= TxtCity.ClientID%>").val(data.address.city);
|
||||||
$("#<%= TxtState.ClientID%>").val(data.address.state);
|
$("#<%= TxtState.ClientID%>").val(data.address.state);
|
||||||
$("#<%= TxtContry.ClientID%>").val(data.address.country);
|
$("#<%= TxtContry.ClientID%>").val(data.address.country);
|
||||||
$("#<%= TxtPostalCode.ClientID%>").val(data.address.postcode);
|
$("#<%= TxtPostalCode.ClientID%>").val(data.address.postcode);
|
||||||
|
}
|
||||||
$('#DivShipment').modal({ backdrop: 'static', keyboard: false });
|
});
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<script
|
<script
|
||||||
|
|||||||
@@ -1311,31 +1311,32 @@ Partial Class Inventarios_RecepcionEntrega
|
|||||||
Dim TxtCantidad = GvDatos.Rows(Gvr.RowIndex).FCTextBox("TbCantidadF")
|
Dim TxtCantidad = GvDatos.Rows(Gvr.RowIndex).FCTextBox("TbCantidadF")
|
||||||
If Gvr.DataKey("CantidadF").ToDecimal - TxtCantidad.Text.ToDecimal - 1 >= 0 Then
|
If Gvr.DataKey("CantidadF").ToDecimal - TxtCantidad.Text.ToDecimal - 1 >= 0 Then
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
''VALIDA EXISTENCIA
|
''VALIDA EXISTENCIA
|
||||||
If TipoMovimiento = 1 Then
|
If Not TipoDocto.Contiene("Dev") Then
|
||||||
Dim ObjInventario As New ClsInventarios
|
If TipoMovimiento = 1 Then
|
||||||
Dim Existencia = ObjInventario.GetExistenciasPS(Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.DataKey("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), CveVendedor:=CveVendedor, CveSubProyecto:=CveSubProyecto, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeApartados:=If(TipoEntrega = 2, 1, -1))
|
Dim ObjInventario As New ClsInventarios
|
||||||
ObjInventario.Dispose()
|
Dim Existencia = ObjInventario.GetExistenciasPS(Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.DataKey("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), CveVendedor:=CveVendedor, CveSubProyecto:=CveSubProyecto, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeApartados:=If(TipoEntrega = 2, 1, -1))
|
||||||
If Not Existencia >= TxtCantidad.Text.ToDecimal + 1 Then
|
ObjInventario.Dispose()
|
||||||
TxtCodigoPS.Text = ""
|
|
||||||
Alert($"No hay existencias suficientes del producto: <br/><b>""{Gvr.DataKey("Codigo")}-{Gvr.DataKey("PS")}""</b>. <br/>Solo hay disponibles <b>{Existencia.FormatoNumero}</b> en Almacen. Por favor Verifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia, "window.setTimeout(Focus,200);")
|
|
||||||
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
|
|
||||||
Exit Sub
|
|
||||||
End If
|
|
||||||
Else
|
|
||||||
If DtExistencias IsNot Nothing Then
|
|
||||||
Dim Existencia = DtExistencias.SUM("Cantidad", $"CvePS = {Gvr.DataKey("CvePS")} AND CveUM = {Gvr.DataKey("CveUM").ToString.ToEntero}")
|
|
||||||
If Not Existencia >= TxtCantidad.Text.ToDecimal + 1 Then
|
If Not Existencia >= TxtCantidad.Text.ToDecimal + 1 Then
|
||||||
TxtCodigoPS.Text = ""
|
TxtCodigoPS.Text = ""
|
||||||
Alert($"No hay existencias suficientes del producto: <br/><b>""{Gvr.DataKey("Codigo")}-{Gvr.DataKey("PS")}""</b>. <br/>Solo hay disponibles <b>{Existencia.FormatoNumero}</b> en Almacen. Por favor Verifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia, "window.setTimeout(Focus,200);")
|
Alert($"No hay existencias suficientes del producto: <br/><b>""{Gvr.DataKey("Codigo")}-{Gvr.DataKey("PS")}""</b>. <br/>Solo hay disponibles <b>{Existencia.FormatoNumero}</b> en Almacen. Por favor Verifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia, "window.setTimeout(Focus,200);")
|
||||||
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
|
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
|
||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
Else
|
||||||
|
If DtExistencias IsNot Nothing Then
|
||||||
|
Dim Existencia = DtExistencias.SUM("Cantidad", $"CvePS = {Gvr.DataKey("CvePS")} AND CveUM = {Gvr.DataKey("CveUM").ToString.ToEntero}")
|
||||||
|
If Not Existencia >= TxtCantidad.Text.ToDecimal + 1 Then
|
||||||
|
TxtCodigoPS.Text = ""
|
||||||
|
Alert($"No hay existencias suficientes del producto: <br/><b>""{Gvr.DataKey("Codigo")}-{Gvr.DataKey("PS")}""</b>. <br/>Solo hay disponibles <b>{Existencia.FormatoNumero}</b> en Almacen. Por favor Verifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia, "window.setTimeout(Focus,200);")
|
||||||
|
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
If Gvr.DataKey("AplicaSerieLote") = "True" Then
|
If Gvr.DataKey("AplicaSerieLote") = "True" Then
|
||||||
TdSeriePS.Visible = True
|
TdSeriePS.Visible = True
|
||||||
TxtSeriePS.Focus()
|
TxtSeriePS.Focus()
|
||||||
|
|||||||
@@ -2700,8 +2700,27 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="form-group form-md-line-input input-iconright">
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
|
<asp:DropDownList ID="DdlFacturas" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="SerieFolio" DataValueField="CveVenta" OnSelectedIndexChanged="DdlFacturas_SelectedIndexChanged" Width="100%" AutoPostBack="true">
|
||||||
|
</asp:DropDownList>
|
||||||
|
<label for="<%= DdlFacturas.ClientID.ToString()%>">Facturas:</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-9">
|
||||||
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
|
<asp:DropDownList ID="DdlPSAjuste" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="PSCodigo" DataValueField="CvePS" OnSelectedIndexChanged="DdlPSAjuste_selectedindexchange" Width="100%" AutoPostBack="true">
|
||||||
|
</asp:DropDownList>
|
||||||
<label for="<%= DdlPSAjuste.ClientID.ToString()%>">Producto/Servicio a Recibir:</label>
|
<label for="<%= DdlPSAjuste.ClientID.ToString()%>">Producto/Servicio a Recibir:</label>
|
||||||
<ADS:Dropdownlost runat="server" ID="DdlPSAjuste" CssStyle="width: 100%;" CssClassDdl="select2me form-control" DataTextField="PSCodigo" DataValueField="CvePS" Onselectedindexchange="DdlPSAjuste_selectedindexchange" />
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3">
|
||||||
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
|
<asp:TextBox ID="TxtPUFactura" CssClass="form-control" runat="server" MaxLength="50" ></asp:TextBox>
|
||||||
|
<asp:RequiredFieldValidator ID="RFVPUFactura" runat="server" ControlToValidate="TxtPUFactura" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''PU Factura''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="VCEPUFactura" runat="server" HighlightCssClass="vco" TargetControlID="RFVPUFactura"></ajax:ValidatorCalloutExtender>
|
||||||
|
<ajax:FilteredTextBoxExtender ID="FTBEPUFactura" runat="server" TargetControlID="TxtPUFactura" FilterType="Custom, Numbers" ValidChars="." />
|
||||||
|
<label for="<%= TxtPUFactura.ClientID.ToString()%>">PU Factura:</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -2811,7 +2830,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6">
|
<div class="col-md-3">
|
||||||
<div class="form-group form-md-line-input input-iconright">
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
<asp:TextBox ID="TxtPoliza" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
|
<asp:TextBox ID="TxtPoliza" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
|
||||||
<%--<asp:RequiredFieldValidator ID="RFVPoliza" runat="server" ControlToValidate="TxtPoliza" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Poliza''</b> es necesario, por favor ingréselo." ValidationGroup="VGMAjuste"></asp:RequiredFieldValidator>--%>
|
<%--<asp:RequiredFieldValidator ID="RFVPoliza" runat="server" ControlToValidate="TxtPoliza" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Poliza''</b> es necesario, por favor ingréselo." ValidationGroup="VGMAjuste"></asp:RequiredFieldValidator>--%>
|
||||||
@@ -2828,6 +2847,9 @@
|
|||||||
<label for="<%= TxtImporteAjuste.ClientID.ToString()%>">Importe:</label>
|
<label for="<%= TxtImporteAjuste.ClientID.ToString()%>">Importe:</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-md-3">
|
||||||
|
<asp:Button ID="BtnCalcularImporteAjuste" CssClass="btn green-haze btn-outline btn-circle btn-sm" OnClick="BtnCalcularImporteAjuste_Click" runat="server" Text="Recalcular" />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -924,6 +924,14 @@ Partial Class PV
|
|||||||
ViewState("DtPagos") = value
|
ViewState("DtPagos") = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
Private Property DtPUFacturas As DataTable
|
||||||
|
Get
|
||||||
|
Return CType(ViewState("DtPUFacturas"), DataTable)
|
||||||
|
End Get
|
||||||
|
Set(value As DataTable)
|
||||||
|
ViewState("DtPUFacturas") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "PROPIEDADES ACUMULADORES"
|
#Region "PROPIEDADES ACUMULADORES"
|
||||||
@@ -996,6 +1004,8 @@ Partial Class PV
|
|||||||
EsCreaApartirDe = False
|
EsCreaApartirDe = False
|
||||||
RequiereAlmacenDestino = False
|
RequiereAlmacenDestino = False
|
||||||
TmpDTComplementos = New DataTable
|
TmpDTComplementos = New DataTable
|
||||||
|
DtPUFacturas = New DataTable
|
||||||
|
|
||||||
Modalidad = ""
|
Modalidad = ""
|
||||||
Index = -1
|
Index = -1
|
||||||
|
|
||||||
@@ -1680,6 +1690,7 @@ Partial Class PV
|
|||||||
UpComplementos.Update()
|
UpComplementos.Update()
|
||||||
|
|
||||||
CargarAlmacenes()
|
CargarAlmacenes()
|
||||||
|
CargaFacturasAjuste()
|
||||||
Else
|
Else
|
||||||
Alert("El cliente solicitado no existe, por favor intente de nuevo.", TipoMensaje.MsgError)
|
Alert("El cliente solicitado no existe, por favor intente de nuevo.", TipoMensaje.MsgError)
|
||||||
End If
|
End If
|
||||||
@@ -2684,6 +2695,10 @@ Partial Class PV
|
|||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "SELECTED INDEX CHANGE"
|
#Region "SELECTED INDEX CHANGE"
|
||||||
|
Protected Sub DdlFacturas_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||||
|
CargaPSAjuste()
|
||||||
|
End Sub
|
||||||
|
|
||||||
Private Sub DdlPSIndexChange(CvePSParametro As Integer, Ddl As ADServerControl.Dropdownlost)
|
Private Sub DdlPSIndexChange(CvePSParametro As Integer, Ddl As ADServerControl.Dropdownlost)
|
||||||
|
|
||||||
If Not CveCliente > 0 Then
|
If Not CveCliente > 0 Then
|
||||||
@@ -4848,9 +4863,22 @@ Partial Class PV
|
|||||||
TmpDTAjustes.Columns.Add("Cantidad", GetType(Decimal))
|
TmpDTAjustes.Columns.Add("Cantidad", GetType(Decimal))
|
||||||
TmpDTAjustes.Columns.Add("CveUM", GetType(Integer))
|
TmpDTAjustes.Columns.Add("CveUM", GetType(Integer))
|
||||||
TmpDTAjustes.Columns.Add("CveVentaDetalle", GetType(Integer))
|
TmpDTAjustes.Columns.Add("CveVentaDetalle", GetType(Integer))
|
||||||
|
TmpDTAjustes.Columns.Add("CveVenta", GetType(Integer))
|
||||||
|
TmpDTAjustes.Columns.Add("PUFactura", GetType(Integer))
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
Private Sub CargaFacturasAjuste()
|
||||||
|
DdlFacturas.Items.Clear()
|
||||||
|
Dim ObjVenta As New ClsVentas
|
||||||
|
If ObjVenta.GetVentas(UsuarioActual.CveEmpresa, "Ing", "-1", -1, "-1", CveCliente, -1, -1, -1, "-1", "-1", "-1", CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then
|
||||||
|
DdlFacturas.DataSource = ObjVenta.DtResultados
|
||||||
|
DdlFacturas.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||||
|
End If
|
||||||
|
ObjVenta.Dispose()
|
||||||
|
DdlFacturas.DataBind()
|
||||||
|
UpAjuste.Update()
|
||||||
|
End Sub
|
||||||
|
|
||||||
Private Sub CargaAjuste()
|
Private Sub CargaAjuste()
|
||||||
Dim ObjAcum As New ClsAcumuladores
|
Dim ObjAcum As New ClsAcumuladores
|
||||||
@@ -4859,6 +4887,9 @@ Partial Class PV
|
|||||||
DdlFolioGarantia.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
DdlFolioGarantia.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
DdlFacturas.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||||
|
|
||||||
DdlTipoUso.DataSource = GlobalDTAcumTiposUso.FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa}")
|
DdlTipoUso.DataSource = GlobalDTAcumTiposUso.FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa}")
|
||||||
DdlTipoUso.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
DdlTipoUso.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||||
|
|
||||||
@@ -4872,19 +4903,9 @@ Partial Class PV
|
|||||||
DdlTipoUso.DataBind()
|
DdlTipoUso.DataBind()
|
||||||
DdlTipoDefecto.DataBind()
|
DdlTipoDefecto.DataBind()
|
||||||
GvRecepcionUsados.DataBind()
|
GvRecepcionUsados.DataBind()
|
||||||
|
DdlFacturas.DataBind()
|
||||||
|
|
||||||
DdlPSAjuste.setEsWebService(UsuarioActual.Empresa.Funcionalidad(141) = "1")
|
CargaPSAjuste()
|
||||||
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(141) = "1" Then
|
|
||||||
DdlPSAjuste.ddlWS.Attributes.Add("data-cveclasificacion", "-1")
|
|
||||||
DdlPSAjuste.SelectedText = "Seleccione"
|
|
||||||
DdlPSAjuste.SelectedValue = "-1"
|
|
||||||
Else
|
|
||||||
DdlPSAjuste.ddl.Items.Clear()
|
|
||||||
DdlPSAjuste.ddl.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
|
|
||||||
DdlPSAjuste.ddl.DataBind()
|
|
||||||
DdlPSAjuste.ddl.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
|
||||||
End If
|
|
||||||
|
|
||||||
CreaDTmpDTAjustes()
|
CreaDTmpDTAjustes()
|
||||||
CreaDTmpDTRecepcionUsados()
|
CreaDTmpDTRecepcionUsados()
|
||||||
@@ -4894,6 +4915,29 @@ Partial Class PV
|
|||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub CargaPSAjuste()
|
||||||
|
DdlPSAjuste.Items.Clear()
|
||||||
|
DtPUFacturas.Rows.Clear()
|
||||||
|
|
||||||
|
If DdlFacturas.SelectedValue.ToEntero > 0 Then
|
||||||
|
TxtPUFactura.Enabled = False
|
||||||
|
Dim ObjVenta As New ClsVentas
|
||||||
|
If ObjVenta.GetVentaDetalle(DdlFacturas.SelectedValue.ToEntero) Then
|
||||||
|
DdlPSAjuste.DataSource = ObjVenta.DtResultados
|
||||||
|
DtPUFacturas = ObjVenta.DtResultados
|
||||||
|
End If
|
||||||
|
ObjVenta.Dispose()
|
||||||
|
Else
|
||||||
|
TxtPUFactura.Enabled = True
|
||||||
|
TxtPUFactura.Text = ""
|
||||||
|
DdlPSAjuste.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
|
||||||
|
End If
|
||||||
|
DdlPSAjuste.DataBind()
|
||||||
|
DdlPSAjuste.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||||
|
DtPUFacturas.AcceptChanges()
|
||||||
|
UpAjuste.Update()
|
||||||
|
End Sub
|
||||||
|
|
||||||
Private Sub Ajuste()
|
Private Sub Ajuste()
|
||||||
LimpiaAjuste()
|
LimpiaAjuste()
|
||||||
If TmpDTAjustes IsNot Nothing AndAlso TmpDTAjustes.FiltraParametros($"ConsecutivoVenta = {ConsecutivoVenta}").Rows.Count > 0 Then
|
If TmpDTAjustes IsNot Nothing AndAlso TmpDTAjustes.FiltraParametros($"ConsecutivoVenta = {ConsecutivoVenta}").Rows.Count > 0 Then
|
||||||
@@ -4920,15 +4964,22 @@ Partial Class PV
|
|||||||
TxtPorcentajeAjuste.Text = ""
|
TxtPorcentajeAjuste.Text = ""
|
||||||
TxtPoliza.Text = ""
|
TxtPoliza.Text = ""
|
||||||
TxtImporteAjuste.Text = ""
|
TxtImporteAjuste.Text = ""
|
||||||
DdlPSAjuste.SelectedValue = "-1"
|
DdlPSAjuste.SelectedIndex = 0
|
||||||
DdlPSAjuste.SelectedText = "Seleccione"
|
|
||||||
ChkAjuste.Checked = False
|
ChkAjuste.Checked = False
|
||||||
DivAjuste.Visible = False
|
DivAjuste.Visible = False
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
Private Sub CargaAjusteDetalle()
|
Private Sub CargaAjusteDetalle()
|
||||||
Dim Dr As DataRow = TmpDTAjustes.FiltraParametros($"ConsecutivoVenta = {ConsecutivoVenta}").Rows(0)
|
Dim Dr As DataRow = Nothing
|
||||||
|
IndexAjuste = 0
|
||||||
|
For Each Dr2 As DataRow In TmpDTAjustes.Rows
|
||||||
|
If Dr2("ConsecutivoVenta").ToString.ToEntero = ConsecutivoVenta Then
|
||||||
|
Dr = Dr2
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
IndexAjuste += 1
|
||||||
|
Next
|
||||||
If Dr IsNot Nothing Then
|
If Dr IsNot Nothing Then
|
||||||
IndexAjuste = TmpDTAjustes.Rows.IndexOf(Dr)
|
IndexAjuste = TmpDTAjustes.Rows.IndexOf(Dr)
|
||||||
DdlFolioGarantia.SelectedValueExist(Dr("CveFolioGarantia").ToString)
|
DdlFolioGarantia.SelectedValueExist(Dr("CveFolioGarantia").ToString)
|
||||||
@@ -4943,8 +4994,11 @@ Partial Class PV
|
|||||||
TxtPorcentajeAjuste.Text = Dr("PorcentajeAjuste").ToString
|
TxtPorcentajeAjuste.Text = Dr("PorcentajeAjuste").ToString
|
||||||
TxtPoliza.Text = Dr("NumPoliza").ToString
|
TxtPoliza.Text = Dr("NumPoliza").ToString
|
||||||
TxtImporteAjuste.Text = Dr("Importe").ToString
|
TxtImporteAjuste.Text = Dr("Importe").ToString
|
||||||
DdlPSAjuste.SelectedValue = Dr("CvePS").ToString
|
DdlFacturas.SelectedValueExist(Dr("CveVenta").ToString)
|
||||||
DdlPSAjuste.SelectedText = Dr("PS").ToString
|
CargaPSAjuste()
|
||||||
|
DdlPSAjuste.SelectedValueExist(Dr("CvePS").ToString)
|
||||||
|
TxtPUFactura.Text = Dr("PUFactura").ToString.ToDecimal.FormatoNumero(4)
|
||||||
|
TxtPUFactura.Enabled = Not Dr("CveVenta").ToString.ToEntero > 0
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
Protected Sub BtnCalculaMesesUso_Click(sender As Object, e As EventArgs)
|
Protected Sub BtnCalculaMesesUso_Click(sender As Object, e As EventArgs)
|
||||||
@@ -4957,6 +5011,23 @@ Partial Class PV
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Sub DdlPSAjuste_selectedindexchange(sender As Object, e As EventArgs)
|
Protected Sub DdlPSAjuste_selectedindexchange(sender As Object, e As EventArgs)
|
||||||
|
If DdlPSAjuste.SelectedValue.ToEntero > 0 AndAlso DdlFacturas.SelectedValue.ToEntero > 0 Then
|
||||||
|
Dim Index As Integer = DdlPSAjuste.SelectedIndex
|
||||||
|
Dim Contador As Integer = 1
|
||||||
|
Dim PUFactura As Decimal = 0
|
||||||
|
For Each Dr As DataRow In DtPUFacturas.Rows
|
||||||
|
If Index = Contador Then
|
||||||
|
PUFactura = Dr("PU").ToString.ToDecimal
|
||||||
|
End If
|
||||||
|
Contador += 1
|
||||||
|
Next
|
||||||
|
TxtPUFactura.Text = PUFactura.FormatoNumero(4)
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Not DdlPSAjuste.SelectedValue.ToEntero > 0 AndAlso DdlFacturas.SelectedValue.ToEntero > 0 Then
|
||||||
|
TxtPUFactura.Text = ""
|
||||||
|
End If
|
||||||
|
|
||||||
CalculaPorcentajeAjuste()
|
CalculaPorcentajeAjuste()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -4964,6 +5035,10 @@ Partial Class PV
|
|||||||
CalculaPorcentajeAjuste()
|
CalculaPorcentajeAjuste()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub BtnCalcularImporteAjuste_Click(sender As Object, e As EventArgs)
|
||||||
|
CalculaPorcentajeAjuste()
|
||||||
|
End Sub
|
||||||
|
|
||||||
Private Sub CalculaPorcentajeAjuste()
|
Private Sub CalculaPorcentajeAjuste()
|
||||||
If DdlTipoUso.SelectedValue.ToEntero > 0 AndAlso DdlPSAjuste.SelectedValue.ToEntero > 0 AndAlso TxtMesesUso.Text <> "" Then
|
If DdlTipoUso.SelectedValue.ToEntero > 0 AndAlso DdlPSAjuste.SelectedValue.ToEntero > 0 AndAlso TxtMesesUso.Text <> "" Then
|
||||||
Dim CveMarca As Integer = -1
|
Dim CveMarca As Integer = -1
|
||||||
@@ -4974,7 +5049,7 @@ Partial Class PV
|
|||||||
If ObjAcum.GarantiasMesesGet(-1, UsuarioActual.CveEmpresa, CveMarca, DdlTipoUso.SelectedValue.ToEntero, TxtMesesUso.Text.ToEntero) Then
|
If ObjAcum.GarantiasMesesGet(-1, UsuarioActual.CveEmpresa, CveMarca, DdlTipoUso.SelectedValue.ToEntero, TxtMesesUso.Text.ToEntero) Then
|
||||||
If ObjAcum.DtResultados.Rows.Count > 0 Then
|
If ObjAcum.DtResultados.Rows.Count > 0 Then
|
||||||
TxtPorcentajeAjuste.Text = (ObjAcum.DtResultados.Rows(0)("Valor").ToString.ToDouble / 100).ToString
|
TxtPorcentajeAjuste.Text = (ObjAcum.DtResultados.Rows(0)("Valor").ToString.ToDouble / 100).ToString
|
||||||
TxtImporteAjuste.Text = (TxtPorcentajeAjuste.Text.ToDouble * AsignaPUFijo(DdlPSAjuste.SelectedValue.ToEntero)).FormatoNumero
|
TxtImporteAjuste.Text = (TxtPorcentajeAjuste.Text.ToDouble * TxtPUFactura.Text.ToDouble).FormatoNumero
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
ObjAcum.Dispose()
|
ObjAcum.Dispose()
|
||||||
@@ -4982,30 +5057,30 @@ Partial Class PV
|
|||||||
UpAjuste.Update()
|
UpAjuste.Update()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Function AsignaPUFijo(CvePS As Integer) As Double
|
'Private Function AsignaPUFijo(CvePS As Integer) As Double
|
||||||
Select Case CvePS
|
' Select Case CvePS
|
||||||
Case 360449
|
' Case 360449
|
||||||
Return 500
|
' Return 500
|
||||||
Case 360450
|
' Case 360450
|
||||||
Return 1000
|
' Return 1000
|
||||||
Case 360451
|
' Case 360451
|
||||||
Return 2000
|
' Return 2000
|
||||||
Case 360452
|
' Case 360452
|
||||||
Return 3000
|
' Return 3000
|
||||||
Case 360453
|
' Case 360453
|
||||||
Return 4000
|
' Return 4000
|
||||||
Case 360455
|
' Case 360455
|
||||||
Return 5000
|
' Return 5000
|
||||||
Case 365353
|
' Case 365353
|
||||||
Return 6000
|
' Return 6000
|
||||||
Case 360454
|
' Case 360454
|
||||||
Return 1500 'lth. acumulador
|
' Return 1500 'lth. acumulador
|
||||||
Case 370810
|
' Case 370810
|
||||||
Return 2500 'lth. 1872
|
' Return 2500 'lth. 1872
|
||||||
Case Else
|
' Case Else
|
||||||
Return 5000
|
' Return 5000
|
||||||
End Select
|
' End Select
|
||||||
End Function
|
'End Function
|
||||||
|
|
||||||
Private Sub GuardaAjuste()
|
Private Sub GuardaAjuste()
|
||||||
Dim CargoAnterior As Double = 0
|
Dim CargoAnterior As Double = 0
|
||||||
@@ -5015,7 +5090,7 @@ Partial Class PV
|
|||||||
Row = TmpDTAjustes.NewRow
|
Row = TmpDTAjustes.NewRow
|
||||||
Row("CveFolioGarantia") = DdlFolioGarantia.SelectedValue.ToEntero
|
Row("CveFolioGarantia") = DdlFolioGarantia.SelectedValue.ToEntero
|
||||||
Row("CveTipoUso") = DdlTipoUso.SelectedValue.ToEntero
|
Row("CveTipoUso") = DdlTipoUso.SelectedValue.ToEntero
|
||||||
Row("CveTipoDefecto") = DdlTipoDefecto.ToEntero
|
Row("CveTipoDefecto") = DdlTipoDefecto.SelectedValue.ToEntero
|
||||||
Row("CodigoEnsamble") = TxtCodEnsamble.Text
|
Row("CodigoEnsamble") = TxtCodEnsamble.Text
|
||||||
Row("CodigoLinea") = TxtCodLinea.Text
|
Row("CodigoLinea") = TxtCodLinea.Text
|
||||||
Row("CodigoInspeccion") = TxtCodInspeccion.Text
|
Row("CodigoInspeccion") = TxtCodInspeccion.Text
|
||||||
@@ -5027,7 +5102,9 @@ Partial Class PV
|
|||||||
Row("Importe") = TxtImporteAjuste.Text.ToDouble
|
Row("Importe") = TxtImporteAjuste.Text.ToDouble
|
||||||
Row("ConsecutivoVenta") = ConsecutivoVenta
|
Row("ConsecutivoVenta") = ConsecutivoVenta
|
||||||
Row("CvePS") = DdlPSAjuste.SelectedValue
|
Row("CvePS") = DdlPSAjuste.SelectedValue
|
||||||
Row("PS") = DdlPSAjuste.SelectedText
|
Row("PS") = DdlPSAjuste.SelectedItem.Text
|
||||||
|
Row("CveVenta") = DdlFacturas.SelectedValue
|
||||||
|
Row("PUFactura") = TxtPUFactura.Text.ToDouble
|
||||||
Row("Cantidad") = 1
|
Row("Cantidad") = 1
|
||||||
Dim CveUM As Integer = -1
|
Dim CveUM As Integer = -1
|
||||||
If DdlPSAjuste.SelectedValue.ToEntero > 0 Then
|
If DdlPSAjuste.SelectedValue.ToEntero > 0 Then
|
||||||
@@ -5043,7 +5120,7 @@ Partial Class PV
|
|||||||
ElseIf ModalidadAjuste = "U" Then
|
ElseIf ModalidadAjuste = "U" Then
|
||||||
TmpDTAjustes.Rows(IndexAjuste)("CveFolioGarantia") = DdlFolioGarantia.SelectedValue.ToEntero
|
TmpDTAjustes.Rows(IndexAjuste)("CveFolioGarantia") = DdlFolioGarantia.SelectedValue.ToEntero
|
||||||
TmpDTAjustes.Rows(IndexAjuste)("CveTipoUso") = DdlTipoUso.SelectedValue.ToEntero
|
TmpDTAjustes.Rows(IndexAjuste)("CveTipoUso") = DdlTipoUso.SelectedValue.ToEntero
|
||||||
TmpDTAjustes.Rows(IndexAjuste)("CveTipoDefecto") = DdlTipoDefecto.ToEntero
|
TmpDTAjustes.Rows(IndexAjuste)("CveTipoDefecto") = DdlTipoDefecto.SelectedValue.ToEntero
|
||||||
TmpDTAjustes.Rows(IndexAjuste)("CodigoEnsamble") = TxtCodEnsamble.Text
|
TmpDTAjustes.Rows(IndexAjuste)("CodigoEnsamble") = TxtCodEnsamble.Text
|
||||||
TmpDTAjustes.Rows(IndexAjuste)("CodigoLinea") = TxtCodLinea.Text
|
TmpDTAjustes.Rows(IndexAjuste)("CodigoLinea") = TxtCodLinea.Text
|
||||||
TmpDTAjustes.Rows(IndexAjuste)("CodigoInspeccion") = TxtCodInspeccion.Text
|
TmpDTAjustes.Rows(IndexAjuste)("CodigoInspeccion") = TxtCodInspeccion.Text
|
||||||
@@ -5055,7 +5132,9 @@ Partial Class PV
|
|||||||
TmpDTAjustes.Rows(IndexAjuste)("Importe") = TxtImporteAjuste.Text.ToDouble
|
TmpDTAjustes.Rows(IndexAjuste)("Importe") = TxtImporteAjuste.Text.ToDouble
|
||||||
TmpDTAjustes.Rows(IndexAjuste)("ConsecutivoVenta") = ConsecutivoVenta
|
TmpDTAjustes.Rows(IndexAjuste)("ConsecutivoVenta") = ConsecutivoVenta
|
||||||
TmpDTAjustes.Rows(IndexAjuste)("CvePS") = DdlPSAjuste.SelectedValue
|
TmpDTAjustes.Rows(IndexAjuste)("CvePS") = DdlPSAjuste.SelectedValue
|
||||||
TmpDTAjustes.Rows(IndexAjuste)("PS") = DdlPSAjuste.SelectedText
|
TmpDTAjustes.Rows(IndexAjuste)("PS") = DdlPSAjuste.SelectedItem.Text
|
||||||
|
TmpDTAjustes.Rows(IndexAjuste)("CveVenta") = DdlFacturas.SelectedValue
|
||||||
|
TmpDTAjustes.Rows(IndexAjuste)("PUFactura") = TxtPUFactura.Text.ToDouble
|
||||||
TmpDTAjustes.Rows(IndexAjuste)("Cantidad") = 1
|
TmpDTAjustes.Rows(IndexAjuste)("Cantidad") = 1
|
||||||
Dim CveUM As Integer = -1
|
Dim CveUM As Integer = -1
|
||||||
If DdlPSAjuste.SelectedValue.ToEntero > 0 Then
|
If DdlPSAjuste.SelectedValue.ToEntero > 0 Then
|
||||||
@@ -5082,7 +5161,7 @@ Partial Class PV
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dr("Descuento") = Math.Round((AsignaPUFijo(DdlPSAjuste.SelectedValue.ToEntero) - TxtImporteAjuste.Text.ToDouble) - (CargoActual - CargoAnterior), NumeroDecimales)
|
Dr("Descuento") = Math.Round((TxtPUFactura.Text.ToDouble - TxtImporteAjuste.Text.ToDouble) - (CargoActual - CargoAnterior), NumeroDecimales)
|
||||||
|
|
||||||
Dim TotalCalculableImpuestos As Decimal = (Dr("Cantidad").ToString.ToDecimal * (Dr("PU").ToString.ToDecimal)) - Dr("Descuento").ToString.ToDecimal
|
Dim TotalCalculableImpuestos As Decimal = (Dr("Cantidad").ToString.ToDecimal * (Dr("PU").ToString.ToDecimal)) - Dr("Descuento").ToString.ToDecimal
|
||||||
Dr("ImporteIVA") = Math.Round(Dr("PorcentajeIVA").ToString.ToDecimal * TotalCalculableImpuestos, NumeroDecimales)
|
Dr("ImporteIVA") = Math.Round(Dr("PorcentajeIVA").ToString.ToDecimal * TotalCalculableImpuestos, NumeroDecimales)
|
||||||
@@ -5390,4 +5469,6 @@ Partial Class PV
|
|||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
Reference in New Issue
Block a user