Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -212,9 +212,11 @@ Partial Class Acarreos_CatChoferes
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
HdnID.Value = GvRow.DataKey("CveChofer")
|
||||
UpDatos.Update()
|
||||
If ObjAcar.RemoveChofer(HdnID.Value) Then
|
||||
If ObjAcar.RemoveChofer(HdnID.Value, UsuarioActual.CveEmpresa) Then
|
||||
CargaDatos()
|
||||
Alert("Eliminado Correctamente.", TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
Alert("No se puede eliminar el chofer. verifique que no tenga movimientos registrados.", TipoMensaje.MsgError)
|
||||
End If
|
||||
ObjAcar.Dispose()
|
||||
UpDatos.Update()
|
||||
@@ -312,7 +314,7 @@ Partial Class Acarreos_CatChoferes
|
||||
If CPTxt > 0 And CveColonia > 0 Then
|
||||
Dim CP As Integer = GlobalDTGralColonias("-1", "-1", "-1", CveColonia:=CveColonia).FiltroPrimeroValor("CP", "").ToEntero
|
||||
If CPTxt <> CP Then
|
||||
Alert("El código postal selecionado es diferente del codigo postal de la Colonia.", TipoMensaje.MsgAdvertencia)
|
||||
Alert("El código postal seleccionado es diferente del codigo postal de la Colonia.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -207,26 +207,27 @@ Public Class ClsAcarreos
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function RemoveChofer(CveChofer As Integer) As Boolean
|
||||
Public Function RemoveChofer(CveChofer As Integer, CveEmpresa As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Acar_ChoferesRemove")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveChofer", SqlDbType.Int).Value = CveChofer
|
||||
|
||||
.Add("@CveChofer", SqlDbType.Int).Value = CveChofer
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@vRetorno", SqlDbType.Int).Direction = ParameterDirection.Output
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Retorno = SqlAdapter.SelectCommand.Parameters("@vRetorno").Value.ToString = "1"
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al eliminar el chofer.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "Transportistas"
|
||||
Public Function AddTransportista(Transportista As String, CveUsuario As Integer, CveEmpresa As Integer, CveProveedor As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
@@ -3353,8 +3353,8 @@ Public Class ClsBancos
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
Public Function AddFluctuacionesBitacora(IdPoliza As Integer, Fecha As Date, TipoFluctuacion As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
Public Function AddFluctuacionesBitacora(IdPoliza As Integer, Fecha As Date, TipoFluctuacion As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Integer
|
||||
Dim Retorno As Integer = 0
|
||||
|
||||
DataAdapter("PA_Banc_FluctuacionesBitacoraAdd")
|
||||
|
||||
@@ -3364,11 +3364,13 @@ Public Class ClsBancos
|
||||
.Add("@TipoFluctuacion", SqlDbType.SmallInt).Value = TipoFluctuacion
|
||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@vCveFluctuacionBitacora", SqlDbType.Int).Direction = ParameterDirection.Output
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Retorno = SqlAdapter.SelectCommand.Parameters("@vCveFluctuacionBitacora").Value.ToString.ToEntero
|
||||
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al agregar a la bitacora de Fluctuaciones", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
@@ -3395,6 +3397,52 @@ Public Class ClsBancos
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function UpdateFluctuacionesBitacoraPrePoliza(CvePrePoliza As Integer, TipoFluctuacion As Integer, CveFluctuacionBitacora As Integer, CveEmpresa As Integer) As Boolean
|
||||
Dim Retorno As Boolean = True
|
||||
|
||||
DataAdapter("PA_Banc_FluctuacionesBitacoraPrePolizaUpdate")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CvePrePoliza", SqlDbType.VarChar).Value = CvePrePoliza
|
||||
.Add("@TipoFluctuacion", SqlDbType.SmallInt).Value = TipoFluctuacion
|
||||
.Add("@CveFluctuacionBitacora", SqlDbType.Int).Value = CveFluctuacionBitacora
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al agregar a la bitacora de Fluctuaciones", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function FluctuacionesBitacoraPrePolizaRemove(CvePrePoliza As Integer, TipoFluctuacion As Integer, CveFluctuacionBitacora As Integer, CveEmpresa As Integer) As Boolean
|
||||
Dim Retorno As Boolean = True
|
||||
|
||||
DataAdapter("PA_Banc_FluctuacionesBitacoraPrePolizaRemove")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CvePrePoliza", SqlDbType.VarChar).Value = CvePrePoliza
|
||||
.Add("@TipoFluctuacion", SqlDbType.SmallInt).Value = TipoFluctuacion
|
||||
.Add("@CveFluctuacionBitacora", SqlDbType.Int).Value = CveFluctuacionBitacora
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al eliminar a la bitacora de Fluctuaciones", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "B A N C O S - T A R J E T A S C R E D I T O S"
|
||||
|
||||
@@ -1505,7 +1505,7 @@ Public Class ClsMovimientos
|
||||
Optional TipoCambio As Integer = -1, Optional TCEspecifico As Double = 0, Optional CveClienteClasificacion As Integer = -1,
|
||||
Optional EsDistribuidor As Integer = -1, Optional FechaAplicadoI As Date = MinFecha, Optional FechaAplicadoF As Date = MaxFecha,
|
||||
Optional FechaRegistroIEI As Date = MinFecha, Optional FechaRegistroIEF As Date = MaxFecha,
|
||||
Optional CveCondicionesPago As Integer = -1) As Boolean
|
||||
Optional CveCondicionesPago As Integer = -1, Optional CveTipoTransaccion As Integer = -1) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_RepRecuperacion")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
@@ -1530,6 +1530,7 @@ Public Class ClsMovimientos
|
||||
.Add("@CveClienteClasificacion", SqlDbType.Int).Value = CveClienteClasificacion
|
||||
.Add("@EsDistribuidor", SqlDbType.Int).Value = EsDistribuidor
|
||||
.Add("@CveCondicionesPago", SqlDbType.Int).Value = CveCondicionesPago
|
||||
.Add("@CveTipoTransaccion", SqlDbType.Int).Value = CveTipoTransaccion
|
||||
|
||||
.Add("@FechaAplicadoI", SqlDbType.Date).Value = FechaAplicadoI.ToShortDateString
|
||||
.Add("@FechaAplicadoF", SqlDbType.Date).Value = FechaAplicadoF.ToShortDateString
|
||||
@@ -1590,7 +1591,8 @@ Public Class ClsMovimientos
|
||||
Optional TipoCambio As Integer = -1, Optional TCEspecifico As Double = 0,
|
||||
Optional CveMoneda As Integer = -1, Optional CveClienteClasificacion As Integer = -1, Optional Tipo As Integer = -1,
|
||||
Optional EsDistribuidor As Integer = -1, Optional FechaAplicadoI As Date = Nothing, Optional FechaAplicadoF As Date = Nothing,
|
||||
Optional FechaRegistroIEI As Date = MinFecha, Optional FechaRegistroIEF As Date = MaxFecha) As Boolean
|
||||
Optional FechaRegistroIEI As Date = MinFecha, Optional FechaRegistroIEF As Date = MaxFecha,
|
||||
Optional CveCondicionesPago As Integer = -1, Optional CveTipoTransaccion As Integer = -1) As Boolean
|
||||
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
@@ -1620,6 +1622,8 @@ Public Class ClsMovimientos
|
||||
.Add("@CveClienteClasificacion", SqlDbType.Int).Value = CveClienteClasificacion
|
||||
.Add("@Tipo", SqlDbType.Int).Value = Tipo
|
||||
.Add("@EsDistribuidor", SqlDbType.Int).Value = EsDistribuidor
|
||||
.Add("@CveCondicionesPago", SqlDbType.Int).Value = CveCondicionesPago
|
||||
.Add("@CveTipoTransaccion", SqlDbType.Int).Value = CveTipoTransaccion
|
||||
|
||||
.Add("@FechaAplicadoI", SqlDbType.Date).Value = FechaAplicadoI.ToShortDateString
|
||||
.Add("@FechaAplicadoF", SqlDbType.Date).Value = FechaAplicadoF.ToShortDateString
|
||||
|
||||
@@ -7554,11 +7554,12 @@ Public Class ClsPaginas
|
||||
If Dr("EstadoDestino").ToString.Length > 0 Then SBDireccionD.AppendFormat(", Edo: {0}", Dr("EstadoDestino").ToString)
|
||||
If Dr("PaisDestino").ToString.Length > 0 Then SBDireccionD.AppendFormat(", País: {0}", Dr("PaisDestino").ToString)
|
||||
End If
|
||||
|
||||
|
||||
|
||||
End If
|
||||
|
||||
params.Add(New ReportParameter("Chofer", Dr("Chofer").ToString))
|
||||
params.Add(New ReportParameter("Placa", Dr("Placa").ToString))
|
||||
params.Add(New ReportParameter("EspecifUnidad", Dr("Especificacion").ToString))
|
||||
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -20,7 +20,7 @@ Public Class Timbrado
|
||||
Public Property CancelacionState As Integer
|
||||
Public Property CancelacionMensaje As String
|
||||
Public Property CancelacionFecha As Date
|
||||
|
||||
Public Const LigaVerificacionSAT = "https://verificacfdi.facturaelectronica.sat.gob.mx/default.aspx"
|
||||
|
||||
Public Class AcuseCancelacionSAT
|
||||
Public Property CodigoEstatus As String
|
||||
@@ -1956,8 +1956,9 @@ Public Class Timbrado
|
||||
If Not IO.Directory.Exists($"{UsuarioActual.Empresa.Ruta}CBB\") Then IO.Directory.CreateDirectory($"{UsuarioActual.Empresa.Ruta}CBB\")
|
||||
|
||||
Dim RutaCBB As String = $"{UsuarioActual.Empresa.Ruta}CBB\{ObjCFDITimbre.Comprobante.SerieFolio}.jpg"
|
||||
Dim b As Byte() = cfdi.ConvertirQrCode($"?re={UsuarioActual.Empresa.RFC}&rr={ObjCFDITimbre.Receptor.RFC}&tt={String.Format("{0,12:F6}", ObjCFDITimbre.Comprobante.Total).Trim()}&id={FolioFiscal}")
|
||||
File.WriteAllBytes(RutaCBB, b)
|
||||
Dim CBB As New ClbNegBICFDv3_2.ClsNegCBBGenerar()
|
||||
CBB.GenerarCBB(UsuarioActual.Empresa.RFC, ObjCFDITimbre.Receptor.RFC, ObjCFDITimbre.Comprobante.Total, FolioFiscal, RutaCBB)
|
||||
CBB = Nothing
|
||||
|
||||
Retorno = ""
|
||||
Else
|
||||
@@ -2342,7 +2343,7 @@ Public Class Timbrado
|
||||
cfdi.CartaPorteMercancias(Carta.Mercancias.PesoBrutoTotal, Carta.Mercancias.UnidadPeso, Carta.Mercancias.PesoNetoTotal, Carta.Mercancias.NumTotalMercancias, Carta.Mercancias.CargoporTasacion)
|
||||
If Carta.Mercancias IsNot Nothing AndAlso Carta.Mercancias.Mercancias.Count > 0 Then
|
||||
For Each concep As CFDICartaPorteMercancia In Carta.Mercancias.Mercancias
|
||||
cfdi.CartaPorteMercancia(concep.BienesTransp, concep.ClaveSTCC, concep.Descripción, concep.Cantidad, concep.ClaveUnidad, concep.Unidad, concep.Dimensiones, concep.MaterialPeligroso, concep.ClaveMaterialPeligroso, If(concep.ClaveMaterialPeligroso <> "", concep.Embalaje, ""), concep.DescripEmbalaje, concep.PesoenKg, concep.ValorMercancia, concep.Moneda, concep.FraccionArrancelaria, concep.UUIDComercioExt)
|
||||
cfdi.CartaPorteMercancia(concep.BienesTransp, concep.ClaveSTCC, concep.Descripción, concep.Cantidad, concep.ClaveUnidad, concep.Unidad, concep.Dimensiones, concep.MaterialPeligroso, concep.ClaveMaterialPeligroso, If(concep.ClaveMaterialPeligroso <> "", concep.Embalaje, ""), If(concep.ClaveMaterialPeligroso <> "", concep.DescripEmbalaje, ""), concep.PesoenKg, concep.ValorMercancia, concep.Moneda, concep.FraccionArrancelaria, concep.UUIDComercioExt)
|
||||
For Each transp In concep.MercanciasCantidadTransporta
|
||||
cfdi.CartaPorteCantidadTransporta(transp.Cantidad, transp.IDOrigen, transp.IDDestino, transp.CvesTransportes)
|
||||
Next
|
||||
@@ -2665,8 +2666,9 @@ Public Class Timbrado
|
||||
|
||||
Try
|
||||
Dim RutaCBB As String = $"{UsuarioActual.Empresa.Ruta}CBB\{ObjCFDITimbre.Comprobante.SerieFolio}.jpg"
|
||||
Dim b As Byte() = cfdi.QrCode($"?re={UsuarioActual.Empresa.RFC}&rr={ObjCFDITimbre.Receptor.RFC}&tt={String.Format("{0,12:F6}", ObjCFDITimbre.Comprobante.Total).Trim()}&id={FolioFiscal}")
|
||||
File.WriteAllBytes(RutaCBB, b)
|
||||
Dim bCBB As Byte() = cfdi.QrCode($"{LigaVerificacionSAT}?re={UsuarioActual.Empresa.RFC}&rr={ObjCFDITimbre.Receptor.RFC}&tt={String.Format("{0,12:F6}", ObjCFDITimbre.Comprobante.Total).Trim()}&id={FolioFiscal}&fe=ELleDg==")
|
||||
File.WriteAllBytes(RutaCBB, bCBB)
|
||||
bCBB = Nothing
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al generar el QR", ex)
|
||||
End Try
|
||||
@@ -3268,8 +3270,9 @@ Public Class Timbrado
|
||||
|
||||
Try
|
||||
Dim RutaCBB As String = $"{UsuarioActual.Empresa.Ruta}CBB\{ObjCFDITimbre.Comprobante.SerieFolio}.jpg"
|
||||
Dim b As Byte() = cfdi.QrCode($"?re={UsuarioActual.Empresa.RFC}&rr={ObjCFDITimbre.Receptor.RFC}&tt={String.Format("{0,12:F6}", ObjCFDITimbre.Comprobante.Total).Trim()}&id={FolioFiscal}")
|
||||
File.WriteAllBytes(RutaCBB, b)
|
||||
Dim CBB As New ClbNegBICFDv3_2.ClsNegCBBGenerar()
|
||||
CBB.GenerarCBB(UsuarioActual.Empresa.RFC, ObjCFDITimbre.Receptor.RFC, ObjCFDITimbre.Comprobante.Total, FolioFiscal, RutaCBB)
|
||||
CBB = Nothing
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al generar el QR", ex)
|
||||
End Try
|
||||
@@ -3684,7 +3687,7 @@ Public Class Timbrado
|
||||
cfdi.CartaPorteMercancias(Carta.Mercancias.PesoBrutoTotal, Carta.Mercancias.UnidadPeso, Carta.Mercancias.PesoNetoTotal, Carta.Mercancias.NumTotalMercancias, Carta.Mercancias.CargoporTasacion)
|
||||
If Carta.Mercancias IsNot Nothing AndAlso Carta.Mercancias.Mercancias.Count > 0 Then
|
||||
For Each concep As CFDICartaPorteMercancia In Carta.Mercancias.Mercancias
|
||||
cfdi.CartaPorteMercancia(concep.BienesTransp, concep.ClaveSTCC, concep.Descripción, concep.Cantidad, concep.ClaveUnidad, concep.Unidad, concep.Dimensiones, concep.MaterialPeligroso, concep.ClaveMaterialPeligroso, If(concep.ClaveMaterialPeligroso <> "", concep.Embalaje, ""), concep.DescripEmbalaje, concep.PesoenKg, concep.ValorMercancia, concep.Moneda, concep.FraccionArrancelaria, concep.UUIDComercioExt)
|
||||
cfdi.CartaPorteMercancia(concep.BienesTransp, concep.ClaveSTCC, concep.Descripción, concep.Cantidad, concep.ClaveUnidad, concep.Unidad, concep.Dimensiones, concep.MaterialPeligroso, concep.ClaveMaterialPeligroso, If(concep.ClaveMaterialPeligroso <> "", concep.Embalaje, ""), If(concep.ClaveMaterialPeligroso <> "", concep.DescripEmbalaje, ""), concep.PesoenKg, concep.ValorMercancia, concep.Moneda, concep.FraccionArrancelaria, concep.UUIDComercioExt)
|
||||
For Each transp In concep.MercanciasCantidadTransporta
|
||||
cfdi.CartaPorteCantidadTransporta(transp.Cantidad, transp.IDOrigen, transp.IDDestino, transp.CvesTransportes)
|
||||
Next
|
||||
|
||||
@@ -416,13 +416,19 @@
|
||||
comisionNegativa = txtcomision * -1;
|
||||
}
|
||||
if (comisionNegativa > saldo) {
|
||||
$('#C_TxtComision').val(0);
|
||||
comision = 0;
|
||||
descuento = 0;
|
||||
txtcomision = 0;
|
||||
alert("No es posible poner un importe Faltante/Sobrante superior a lo seleccionado");
|
||||
saldo = 0;
|
||||
$('#C_lblValorTotal').text(FormatoNumero(ValorTotalSeleccionado, 2));
|
||||
|
||||
//var opcion = confirm("El importe especificado es superior a lo seleccionado, está seguro?");
|
||||
//if (opcion != true) {
|
||||
// debugger;
|
||||
// $('#C_TxtComision').val(0);
|
||||
// comision = 0;
|
||||
// descuento = 0;
|
||||
// txtcomision = 0;
|
||||
// //alert("No es posible poner un importe Faltante/Sobrante superior a lo seleccionado");
|
||||
// saldo = 0;
|
||||
// $('#C_lblValorTotal').text(FormatoNumero(ValorTotalSeleccionado, 2));
|
||||
//}
|
||||
|
||||
} else {
|
||||
|
||||
//debugger;
|
||||
@@ -509,14 +515,18 @@
|
||||
if (comision2 < 0) {
|
||||
comisionNegativa = comision2 * -1;
|
||||
}
|
||||
if (comisionNegativa > ValorTotalSeleccionado) {
|
||||
$('#C_TxtComision').val(0)
|
||||
alert("No es posible poner una comision superior a lo seleccionado")
|
||||
} else {
|
||||
//if (comisionNegativa > ValorTotalSeleccionado) {
|
||||
// var opcion = confirm("El importe especificado es superior a lo seleccionado, está seguro?");
|
||||
// if (opcion != true) {
|
||||
// debugger;
|
||||
// $('#C_TxtComision').val(0)
|
||||
// // alert("No es posible poner una comision superior a lo seleccionado")
|
||||
// }
|
||||
//} else {
|
||||
saldo = ValorTotalSeleccionado + comision2 + descuento - IVA - ComisionIntermediario;
|
||||
$('#C_lblValorTotal').text(FormatoNumero(saldo, 2));
|
||||
comision = ToDouble($('#C_TxtComision').val())
|
||||
}
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -236,17 +236,21 @@ Partial Class Bancos_DepositosCaja
|
||||
End If
|
||||
|
||||
End If
|
||||
Dim CveTransaccionBanco As Integer = 13
|
||||
|
||||
If TotalImporte < 0 Then 'que es una devolución, entonces como es negativo, se cambia el concetpo de bancos, por condición de trigger
|
||||
CveTransaccionBanco = 6
|
||||
End If
|
||||
|
||||
'Entrada a bancos
|
||||
FolioIE = ObjBancos.GetNextFolio(DdlCuentaDeposito.SelectedValue.ToEntero, 13)
|
||||
FolioIE = ObjBancos.GetNextFolio(DdlCuentaDeposito.SelectedValue.ToEntero, CveTransaccionBanco)
|
||||
If Not FolioIE > 0 Then
|
||||
OcurrioError = True
|
||||
End If
|
||||
CveIEOrigen = ObjBancos.AddBancos_IE(DdlCuentaDeposito.SelectedValue.ToEntero, 13, Fecha, FolioIE.ToString, "Depósito Bancario", TotalImporte, CveMoneda, 1, "Depósito Bancario", "", False, False, -1, NuevaCvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveProveedorIntermediario:=CveProveedorIntermediario)
|
||||
|
||||
documentos += String.Format("<a href='/Bancos/IE.aspx?CveIE={0}' target='_blank' class='Texto'>Depósito: {1}</a>     <br/> ", CveIEOrigen, FolioIE)
|
||||
|
||||
CveIEOrigen = ObjBancos.AddBancos_IE(DdlCuentaDeposito.SelectedValue.ToEntero, CveTransaccionBanco, Fecha, FolioIE.ToString, "Depósito Bancario", TotalImporte, CveMoneda, 1, "Depósito Bancario", "", False, False, -1, NuevaCvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveProveedorIntermediario:=CveProveedorIntermediario)
|
||||
|
||||
documentos += String.Format("<a href='/Bancos/IE.aspx?CveIE={0}' target='_blank' class='Texto'>Depósito: {1}</a>     <br/> ", CveIEOrigen, FolioIE)
|
||||
|
||||
If ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, False, TotalImporte, "Depósito Bancario", 30, "Depósito Bancario", Fecha, IdCuentaBancariaOrigen, -1, CveClasificacion:=CveClasificacion, CveSubProyecto:=CveSubProyecto, CveIE:=CveIEOrigen, ImporteMX:=TotalImporte * TipoCambio) Then
|
||||
|
||||
If ChkFaltante.Checked Then
|
||||
@@ -256,9 +260,7 @@ Partial Class Bancos_DepositosCaja
|
||||
If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, True, Comision, DdlClasificacion.SelectedItem.Text, 51, DdlClasificacion.SelectedItem.Text, Fecha, IdCuentaBancariaOrigen, -1, CveClasificacion:=CveClasificacionComision, CveSubProyecto:=CveSubProyectoComision, ImporteMX:=Comision * TipoCambio) Then
|
||||
OcurrioError = True
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
If ChkDescuento.Checked Then
|
||||
@@ -268,68 +270,64 @@ Partial Class Bancos_DepositosCaja
|
||||
If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, False, Descuento, DdlClasificacionDescuento.SelectedItem.Text, 51, DdlClasificacionDescuento.SelectedItem.Text & " " & DdlPersonal.SelectedItem.Text, Fecha, IdCuentaBancariaOrigen, -1, CveClasificacion:=CveClasificacionDescuento, CveSubProyecto:=CveSubProyectoDescuento, ImporteMX:=Descuento * TipoCambio, CvePersonal:=DdlPersonal.SelectedValue.ToEntero) Then
|
||||
OcurrioError = True
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
End If
|
||||
|
||||
Else
|
||||
OcurrioError = True
|
||||
End If
|
||||
|
||||
For Each Gvr As GridViewRow In GvFacturas.Rows
|
||||
|
||||
If Gvr.FCCheckBox("ChkFactura").Checked Then
|
||||
'Datos de las Nuevas PrePolizas
|
||||
'Entrada a Bancos
|
||||
|
||||
Dim Importe As Decimal = Gvr.DataKey("Importe").ToDecimal
|
||||
Dim SerieFolio As String = Gvr.DataKey("SerieFolio").ToString
|
||||
|
||||
'Datos de las Prepolizas A Cancelar
|
||||
Dim CveIE As Integer = Gvr.DataKey("CveIE").ToEntero
|
||||
Dim CveVenta As Integer = Gvr.DataKey("CveVenta").ToEntero
|
||||
Dim CvePrePoliza As Integer = Gvr.DataKey("CvePrePoliza").ToEntero
|
||||
|
||||
FolioIE = ObjBancos.GetNextFolio(DdlCajaChica.SelectedValue.ToEntero, 2)
|
||||
If Not FolioIE > 0 Then
|
||||
OcurrioError = True
|
||||
Exit For
|
||||
End If
|
||||
CveIEDestino = ObjBancos.AddBancos_IE(DdlCajaChica.SelectedValue.ToEntero, 2, Fecha, FolioIE.ToString, String.Format("Depósito Bancario: {0}", SerieFolio), Importe, CveMoneda, 1, "Depósito Bancario", "", False, False, -1, NuevaCvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
|
||||
|
||||
If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, True, Importe, SerieFolio, 30, String.Format("Depósito Bancario: {0}", SerieFolio), Fecha, IdCuentaBancariaDestino, -1, CveClasificacion:=CveClasificacion, CveSubProyecto:=CveSubProyecto, CveVenta:=CveVenta, CveIE:=CveIEDestino, ImporteMX:=Importe * TipoCambio, CveCuenta:=CveCuentaBancariaDestino) Then
|
||||
OcurrioError = True
|
||||
Exit For
|
||||
End If
|
||||
|
||||
'Asignamos la cuenta Deposito
|
||||
If Not OcurrioError AndAlso Not ObjBancos.UpdateBancos_IECuentaDeposito(CveIEOrigen, CveIE) Then
|
||||
OcurrioError = True
|
||||
Exit For
|
||||
If Not OcurrioError Then
|
||||
For Each Gvr As GridViewRow In GvFacturas.Rows
|
||||
|
||||
If Gvr.FCCheckBox("ChkFactura").Checked Then
|
||||
'Datos de las Nuevas PrePolizas
|
||||
'Entrada a Bancos
|
||||
|
||||
Dim Importe As Decimal = Gvr.DataKey("Importe").ToDecimal
|
||||
Dim SerieFolio As String = Gvr.DataKey("SerieFolio").ToString
|
||||
|
||||
'Datos de las Prepolizas A Cancelar
|
||||
Dim CveIE As Integer = Gvr.DataKey("CveIE").ToEntero
|
||||
Dim CveVenta As Integer = Gvr.DataKey("CveVenta").ToEntero
|
||||
Dim CvePrePoliza As Integer = Gvr.DataKey("CvePrePoliza").ToEntero
|
||||
|
||||
FolioIE = ObjBancos.GetNextFolio(DdlCajaChica.SelectedValue.ToEntero, 2)
|
||||
If Not FolioIE > 0 Then
|
||||
OcurrioError = True
|
||||
Exit For
|
||||
End If
|
||||
CveIEDestino = ObjBancos.AddBancos_IE(DdlCajaChica.SelectedValue.ToEntero, 2, Fecha, FolioIE.ToString, String.Format("Depósito Bancario: {0}", SerieFolio), Importe, CveMoneda, 1, "Depósito Bancario", "", False, False, -1, NuevaCvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
|
||||
|
||||
If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, True, Importe, SerieFolio, 30, String.Format("Depósito Bancario: {0}", SerieFolio), Fecha, IdCuentaBancariaDestino, -1, CveClasificacion:=CveClasificacion, CveSubProyecto:=CveSubProyecto, CveVenta:=CveVenta, CveIE:=CveIEDestino, ImporteMX:=Importe * TipoCambio, CveCuenta:=CveCuentaBancariaDestino) Then
|
||||
OcurrioError = True
|
||||
Exit For
|
||||
End If
|
||||
|
||||
'Asignamos la cuenta Deposito
|
||||
If Not OcurrioError AndAlso Not ObjBancos.UpdateBancos_IECuentaDeposito(CveIEOrigen, CveIE) Then
|
||||
OcurrioError = True
|
||||
Exit For
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
End If
|
||||
|
||||
Next
|
||||
Dim StrEncript As String = Encripta($"OP=DC&CveIE={CveIEOrigen}&CuentaCaja={DdlCajaChica.SelectedItem.Text}&CuentaDepo={DdlCuentaDeposito.SelectedItem.Text}")
|
||||
|
||||
Dim StrEncript As String = Encripta($"OP=DC&CveIE={CveIEOrigen}&CuentaCaja={DdlCajaChica.SelectedItem.Text}&CuentaDepo={DdlCuentaDeposito.SelectedItem.Text}")
|
||||
documentos += String.Format("<br/> <a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir {1}</a> <br/><br/> ", StrEncript, "Depósito Bancario")
|
||||
|
||||
End If
|
||||
|
||||
documentos += String.Format("<br/> <a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir {1}</a> <br/><br/> ", StrEncript, "Depósito Bancario")
|
||||
|
||||
If OcurrioError Then
|
||||
ObjContabilidad.RollBack()
|
||||
Alert("Ocurrio un error al realizar los depositos", TipoMensaje.MsgError)
|
||||
Else
|
||||
ObjContabilidad.Commit()
|
||||
CargaDatos()
|
||||
|
||||
ObjContabilidad.Commit()
|
||||
documentos += String.Format("<a class=""Texto"" target='_blank' href=""/Contabilidad/RegPrePolizas.aspx?CvePrePoliza={0}"">Prepóliza</a> <br/><br/> ", NuevaCvePrePoliza)
|
||||
|
||||
Alert(documentos.ToString)
|
||||
|
||||
Alert(documentos.ToString)
|
||||
CargaDatos()
|
||||
|
||||
End If
|
||||
TxtComision.Text = ""
|
||||
|
||||
@@ -151,6 +151,7 @@
|
||||
</div>
|
||||
<div style="float: right; margin-right: 10px;">
|
||||
<asp:Label runat="server" ID="LtlUltimaFluctuacion" Font-Italic="True"></asp:Label>
|
||||
<asp:HiddenField ID="HdnCveFluctuacionBitacora" runat="server" />
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
@@ -159,7 +160,7 @@
|
||||
<asp:UpdatePanel ID="UpTabs" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<ajax:TabContainer runat="server" ID="T">
|
||||
<ajax:TabPanel runat="server" ID="TabCompras" HeaderText="Compras">
|
||||
<ajax:TabPanel runat="server" ID="TabCompras" HeaderText="Proveedores">
|
||||
<ContentTemplate>
|
||||
<asp:UpdatePanel ID="UpIndicadores" UpdateMode="Conditional" runat="server" Visible="False">
|
||||
<ContentTemplate>
|
||||
@@ -222,8 +223,7 @@
|
||||
|
||||
|
||||
<div class="row">
|
||||
|
||||
|
||||
|
||||
<div class="col-md-5 form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtConceptoCompras" Style="text-transform: uppercase;" runat="server" MaxLength="100" CssClass="form-control marginFixRow" Width="96%"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVTxtConceptoCompras" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtConceptoCompras"
|
||||
@@ -244,15 +244,14 @@
|
||||
<div class="col-md-6" style="text-align: right!important">
|
||||
<asp:Button Text="Generar Proveedores" runat="server" ID="BtnGeneraCompras" OnClick="BtnGeneraCompras_Click" Style="margin-left: 30px;" class="btn btn-primary" ValidationGroup="GrpGuardarCompras" />
|
||||
</div>
|
||||
<div> <asp:HiddenField ID="HdnProveedorCvePrePoliza" runat="server" />
|
||||
<asp:Button ID="BtnProveedoresRemove" runat="server" Text="Eliminar" OnClick="BtnProveedoresRemove_Click" /></div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<br />
|
||||
<asp:GridView ID="GvCompras" Width="99%" runat="server" AutoGenerateColumns="False"
|
||||
DataKeyNames="CveCompra,CveProveedor,Fluctuacion,SerieFolio,FluctuacionTotal,PerdidaGanancia,IdCtaContComplementaria"
|
||||
DataKeyNames="CveCompra,CveProveedor,TipoCambio, Fluctuacion,SerieFolio, CveConceptoContable,FluctuacionTotal,PerdidaGanancia,IdCtaContComplementaria"
|
||||
EmptyDataText="No se Encontraron compras pendientes de pagar." ToolTip="Listado de Compras"
|
||||
CssClass="table table-hover table-striped ScrollAD mysmallbtn" GridLines="None">
|
||||
<Columns>
|
||||
@@ -267,7 +266,7 @@
|
||||
<%--<asp:Label ID="LblTotalCompras" runat="server" Text=""></asp:Label>--%>
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
<ajax:TabPanel runat="server" ID="TabVentas" HeaderText="Ventas">
|
||||
<ajax:TabPanel runat="server" ID="TabVentas" HeaderText="Clientes">
|
||||
<ContentTemplate>
|
||||
<asp:UpdatePanel ID="UpIndicadoresVentas" UpdateMode="Conditional" runat="server" Visible="false">
|
||||
<ContentTemplate>
|
||||
@@ -308,6 +307,7 @@
|
||||
<div class="widget-thumb text-uppercase bordered">
|
||||
<h4 class="widget-thumb-heading">
|
||||
<asp:Label ID="LblVentasPerdidaGanancia" runat="server" Text=""></asp:Label></h4>
|
||||
|
||||
<div class="widget-thumb-wrap">
|
||||
<i id="IImagenFinalVentas" runat="server" class=""></i>
|
||||
<div class="widget-thumb-body">
|
||||
@@ -322,7 +322,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
@@ -353,7 +353,7 @@
|
||||
|
||||
<div class="col-md-6" style="text-align: right!important">
|
||||
<asp:Button Text="Generar Clientes" runat="server" ID="BtnGeneraVentas" OnClick="BtnGeneraVentas_Click" Style="margin-left: 30px;" class="btn btn-primary" ValidationGroup="GrpGuardarVentas" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -131,6 +131,8 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
Dim GanaciaAux As Double = Ganancias.SUM("Fluctuacion")
|
||||
|
||||
Dim Final As Double = GanaciaAux - PerdidaAux
|
||||
HdnProveedorCvePrePoliza.Value = ObjBancos.DtResultados.MAX("CvePrePoliza").ToString
|
||||
HdnCveFluctuacionBitacora.Value = ObjBancos.DtResultados.MAX("CveFluctuacionBitacora").ToString
|
||||
|
||||
IImagenResultado.Attributes("class") = If(Final > 0, "widget-thumb-icon bg-green-jungle fa fa-usd", "widget-thumb-icon bg-red fa fa-usd")
|
||||
|
||||
@@ -280,8 +282,8 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
Protected Sub BtnGeneraCompras_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim Total As Decimal = 0
|
||||
Dim Conta As New ClsContabilidad
|
||||
Conta.IniciaTransacSQL()
|
||||
Dim Conta As New ClsContabilidad
|
||||
Dim Banco As New ClsBancos(Conta.IniciaTransacSQL())
|
||||
Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaC", 1, 0, 0, 1, FechaUltimoDiaMes, TxtConceptoCompras.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
|
||||
Dim idCta As Integer = 0
|
||||
@@ -316,7 +318,12 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
|
||||
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), "Fluctuación Compras", CveConceptoContable, "Fluctuación Compras", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveSubProyecto:=DdlSubProyectoCompras.SelectedValue.ToEntero) Then
|
||||
ErrorRegistrar = True
|
||||
End If
|
||||
End If
|
||||
|
||||
'Dim CveBitacora As Integer = Banco.AddFluctuacionesBitacora(-1, FechaUltimoDiaMes, 1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
'If CveBitacora <= 0 Then
|
||||
' ErrorRegistrar = True
|
||||
'End If
|
||||
|
||||
|
||||
'saco las cuentas de pérdida y ganancia
|
||||
@@ -326,18 +333,20 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
|
||||
IdCtaComplementaria = gvr.DataKey("IdCtaContComplementaria").ToString().ToEntero()
|
||||
'movimiento de complementaria
|
||||
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, False, Total, gvr.DataKey("SerieFolio"), 201, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveCompra:=gvr.DataKey("CveCompra").ToEntero, TipoCambio:=TC, ImporteMX:=Total, ImporteME:=Total) Then
|
||||
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, False, Total, gvr.DataKey("SerieFolio"), gvr.DataKey("CveConceptoContable").ToEntero, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveCompra:=gvr.DataKey("CveCompra").ToEntero, TipoCambio:=TC, TipoCambioPago:=gvr.DataKey("TipoCambio").ToDecimal, ImporteMX:=Total, ImporteME:=Total) Then
|
||||
ErrorRegistrar = True
|
||||
Exit For
|
||||
End If
|
||||
|
||||
If Not Conta.UpdateCompraTCValuacion(gvr.DataKey("CveCompra").ToEntero, TCValuacion:=TCUltimaFluctuacion) Then
|
||||
ErrorRegistrar = True
|
||||
Exit For
|
||||
End If
|
||||
'If Not Conta.UpdateCompraTCValuacion(gvr.DataKey("CveCompra").ToEntero, TCValuacion:=TCUltimaFluctuacion) Then
|
||||
' ErrorRegistrar = True
|
||||
' Exit For
|
||||
'End If
|
||||
|
||||
Next
|
||||
|
||||
'Banco.UpdateFluctuacionesBitacoraPrePoliza(CvePrePoliza, 1, CveBitacora, UsuarioActual.CveEmpresa)
|
||||
|
||||
If Not ErrorRegistrar Then
|
||||
Conta.Commit()
|
||||
Alert(String.Format("La Fluctuación se ha generado <br/> <a href='/Contabilidad/RegPrePoliza.aspx?CvePrePoliza={0}'>Ver PrePóliza</a>", CvePrePoliza), TipoMensaje.MsgInformacion)
|
||||
@@ -393,13 +402,17 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
End If
|
||||
|
||||
Dim Conta As New ClsContabilidad
|
||||
Conta.IniciaTransacSQL()
|
||||
Dim Banco As New ClsBancos(Conta.IniciaTransacSQL())
|
||||
Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaV", 1, 0, 0, 1, FechaUltimoDiaMes, TxtConceptoVentas.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
|
||||
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), "Fluctuación Ventas", CveConceptoContable, "Fluctuación Ventas", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta, CveSubProyecto:=DdlsubProyectoVentas.SelectedValue.ToEntero) Then
|
||||
ErrorRegistrar = True
|
||||
End If
|
||||
|
||||
If Not Banco.UpdateFluctuacionesBitacoraPrePoliza(CvePrePoliza, 1, HdnCveFluctuacionBitacora.Value.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
ErrorRegistrar = True
|
||||
End If
|
||||
|
||||
Dim CveConconceptoCliente As Integer = 203
|
||||
|
||||
'saco las cuentas de pérdida y ganancia
|
||||
@@ -414,10 +427,10 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
CveConconceptoCliente = 203
|
||||
End If
|
||||
|
||||
If Not Conta.UpdateVentaTCValuacion(gvr.DataKey("CveVenta").ToEntero, TCValuacion:=TCUltimaFluctuacion) Then
|
||||
ErrorRegistrar = True
|
||||
Exit For
|
||||
End If
|
||||
'If Not Conta.UpdateVentaTCValuacion(gvr.DataKey("CveVenta").ToEntero, TCValuacion:=TCUltimaFluctuacion) Then
|
||||
' ErrorRegistrar = True
|
||||
' Exit For
|
||||
'End If
|
||||
|
||||
'movimiento de complementaria
|
||||
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, True, Total, gvr.DataKey("SerieFolio"), CveConconceptoCliente, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveVenta:=gvr.DataKey("CveVenta").ToEntero, TipoCambio:=TC, ImporteMX:=Total, ImporteME:=Total, CveIE:=gvr.DataKey("CveIE").ToEntero) Then
|
||||
@@ -981,4 +994,13 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
#End Region
|
||||
|
||||
|
||||
Protected Sub BtnProveedoresRemove_Click(sender As Object, e As EventArgs)
|
||||
Dim Banco As New ClsBancos
|
||||
If Not Banco.FluctuacionesBitacoraPrePolizaRemove(HdnProveedorCvePrePoliza.Value.ToEntero, 1, 1, UsuarioActual.CveEmpresa) Then
|
||||
Alert("Flucturación eliminada.")
|
||||
End If
|
||||
Banco.Dispose()
|
||||
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
@@ -2194,6 +2194,9 @@ Partial Class Compras_Compras
|
||||
DdlRetISRConcepto.Items.Clear()
|
||||
DdlRetISRConcepto.Items.Insert(0, New ListItem("Honorarios", "1"))
|
||||
DdlRetISRConcepto.Items.Insert(1, New ListItem("Arrendamiento", "2"))
|
||||
If UsuarioActual.CveEmpresa = 119 Then
|
||||
DdlRetISRConcepto.Items.Insert(1, New ListItem("Resico", "3"))
|
||||
End If
|
||||
End If
|
||||
UpPS.Update()
|
||||
End Sub
|
||||
@@ -6315,7 +6318,10 @@ Partial Class Compras_Compras
|
||||
funcionalidad = 318
|
||||
ConceptoContable = 244
|
||||
ConceptoContableContra = 243
|
||||
|
||||
ElseIf DdlRetISRConcepto.SelectedValue.ToEntero = 3 Then
|
||||
funcionalidad = 348
|
||||
ConceptoContable = 328
|
||||
ConceptoContableContra = 327
|
||||
End If
|
||||
|
||||
importeMovimiento = importeRetISRAcreditable
|
||||
@@ -6352,7 +6358,9 @@ Partial Class Compras_Compras
|
||||
ElseIf DdlRetISRConcepto.SelectedValue.ToEntero = 2 Then
|
||||
funcionalidad = 317
|
||||
ConceptoContable = 243
|
||||
|
||||
ElseIf DdlRetISRConcepto.SelectedValue.ToEntero = 3 Then
|
||||
funcionalidad = 348
|
||||
ConceptoContable = 327
|
||||
End If
|
||||
importeMovimiento = importeRetISRxAcreditar
|
||||
importeMN = Math.Round(importeMovimiento, 2) * tipoCambioActual * Multiplicador
|
||||
@@ -6891,24 +6899,34 @@ Partial Class Compras_Compras
|
||||
|
||||
Dim DiferenciaDevolucion As Decimal = importeMovimiento - TotalRealDevolucion
|
||||
|
||||
If Math.Abs(DiferenciaDevolucion) > 0 Then
|
||||
|
||||
If TotalRealDevolucion <> 0 Then
|
||||
|
||||
If Math.Abs(DiferenciaDevolucion) > 0 Then
|
||||
|
||||
|
||||
Dim CveSubProyecto69 As Integer = TmpDT.FiltroPrimeroValor("CveSubProyecto", "CveSubProyecto > 0 ").ToEntero
|
||||
Dim CveClasificacion69 As Integer = TmpDT.FiltroPrimeroValor("CveClasificacion", "CveClasificacion > 0 ").ToEntero
|
||||
Dim CveSubProyecto69 As Integer = TmpDT.FiltroPrimeroValor("CveSubProyecto", "CveSubProyecto > 0 ").ToEntero
|
||||
Dim CveClasificacion69 As Integer = TmpDT.FiltroPrimeroValor("CveClasificacion", "CveClasificacion > 0 ").ToEntero
|
||||
|
||||
|
||||
Dim IdCtaContable69 As Integer = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {CveClasificacion69}").ToString.ToEntero
|
||||
Dim IdCtaContable69 As Integer = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {CveClasificacion69}").ToString.ToEntero
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, DiferenciaDevolucion, Referencia, 69, Concepto, FechaMovimiento, IdCtaContable69, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=DiferenciaDevolucion, ImporteME:=If(tipoCambioActual = 1, 0, DiferenciaDevolucion), TipoCambio:=tipoCambioActual, CveMovimientoAlmacen:=CveMovimientoDevolucion, Contabilizable:=SeContabiliza, CveSubProyecto:=CveSubProyecto69, CveClasificacion:=CveClasificacion69) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, DiferenciaDevolucion, Referencia, 69, Concepto, FechaMovimiento, IdCtaContable69, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=DiferenciaDevolucion, ImporteME:=If(tipoCambioActual = 1, 0, DiferenciaDevolucion), TipoCambio:=tipoCambioActual, CveMovimientoAlmacen:=CveMovimientoDevolucion, Contabilizable:=SeContabiliza, CveSubProyecto:=CveSubProyecto69, CveClasificacion:=CveClasificacion69) Then
|
||||
ErrorPrepoliza = True
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, TotalRealDevolucion, Referencia, ConceptoContabilizacionNC, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMovimiento * tipoCambioActual, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=tipoCambioActual, CveMovimientoAlmacen:=CveMovimientoDevolucion, Contabilizable:=SeContabiliza) Then
|
||||
ErrorPrepoliza = True
|
||||
End If
|
||||
Else
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContabilizacionNC, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMovimiento * tipoCambioActual, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=tipoCambioActual, CveMovimientoAlmacen:=CveMovimientoDevolucion, Contabilizable:=SeContabiliza) Then
|
||||
ErrorPrepoliza = True
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, TotalRealDevolucion, Referencia, ConceptoContabilizacionNC, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=TotalRealDevolucion, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=tipoCambioActual, CveMovimientoAlmacen:=CveMovimientoDevolucion, Contabilizable:=SeContabiliza) Then
|
||||
ErrorPrepoliza = True
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -1016,7 +1016,7 @@ Partial Class PopUpVerFactura
|
||||
Private Sub ImprimeFormatoCartaPorte(CveMovimiento As Integer)
|
||||
If CveMovimiento > 0 Then
|
||||
Dim ObjInv As New ClsInventarios
|
||||
Dim ObjAcar As New ClsAcarreos
|
||||
|
||||
Dim SerieFolio As String = ""
|
||||
Dim DomicilioSucursal As String = ""
|
||||
Dim LugarFecha As String = ""
|
||||
@@ -1037,6 +1037,10 @@ Partial Class PopUpVerFactura
|
||||
Dim Ciudad As String = ""
|
||||
Dim Licencia As String = ""
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Dim SBDireccionO As New StringBuilder()
|
||||
Dim SBDireccionD As New StringBuilder()
|
||||
|
||||
@@ -1051,9 +1055,8 @@ Partial Class PopUpVerFactura
|
||||
Destino = Dr("AlmacenDestino").ToString
|
||||
Observaciones = Dr("Observaciones").ToString
|
||||
CveChofer = Dr("CveChofer").ToString
|
||||
If ObjAcar.GetChofer(CveChofer.ToEntero, UsuarioActual.CveEmpresa, -1, -1) Then
|
||||
Chofer = ObjAcar.DtResultados.FiltroPrimeroValor("Chofer")
|
||||
End If
|
||||
|
||||
|
||||
Placa = Dr("Traslado_Placa").ToString
|
||||
Recibio = Dr("Recibio").ToString
|
||||
FechaEntrega = Dr("FechaEntrega").ToString
|
||||
@@ -1087,10 +1090,18 @@ Partial Class PopUpVerFactura
|
||||
Telefono = Dr("Telefono1").ToString
|
||||
Ciudad = Dr("Ciudad").ToString
|
||||
Licencia = Dr("Licencia").ToString
|
||||
|
||||
|
||||
Chofer = Dr("Chofer").ToString
|
||||
Placa = Dr("Placa").ToString
|
||||
EspecifUnidad = Dr("Especificacion").ToString
|
||||
|
||||
|
||||
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
ObjAcar.Dispose()
|
||||
|
||||
|
||||
Dim Dt As DataTable = Nothing
|
||||
If ObjInv.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then
|
||||
@@ -1103,18 +1114,19 @@ Partial Class PopUpVerFactura
|
||||
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
|
||||
|
||||
|
||||
|
||||
'params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, ImageToBase64(Drawing.Image.FromFile(Imagen.FullName), Drawing.Imaging.ImageFormat.Png), "")))
|
||||
Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName)
|
||||
|
||||
|
||||
|
||||
If Imagen.Exists Then
|
||||
Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName)
|
||||
params.Add(New ReportParameter("LogoPath", LogoRuta))
|
||||
|
||||
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
|
||||
|
||||
|
||||
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
|
||||
@@ -1129,6 +1141,7 @@ Partial Class PopUpVerFactura
|
||||
params.Add(New ReportParameter("Destinatario", ""))
|
||||
params.Add(New ReportParameter("Observaciones", Observaciones))
|
||||
params.Add(New ReportParameter("Chofer", Chofer))
|
||||
params.Add(New ReportParameter("ResponsableRecibio", Chofer))
|
||||
params.Add(New ReportParameter("Placa", Placa))
|
||||
params.Add(New ReportParameter("Recibio", Recibio))
|
||||
params.Add(New ReportParameter("FechaEntrega", FechaEntrega.ToDateTime().ToString("dd/MM/yyyy")))
|
||||
@@ -1142,6 +1155,7 @@ Partial Class PopUpVerFactura
|
||||
params.Add(New ReportParameter("Telefono", Telefono))
|
||||
params.Add(New ReportParameter("Ciudad", Ciudad))
|
||||
params.Add(New ReportParameter("Licencia", Licencia))
|
||||
|
||||
ImprimirPDF("Empresas/Grales/Formatos/CartaPorte.rdlc", Dt, params, String.Format("Carta Porte -{0}", Now.ToDateTime.ToShortDateString))
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -19,6 +19,14 @@ Partial Class OC
|
||||
ViewState("CveEmpresaActual") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property EmpresaActualOC As Empresa
|
||||
Get
|
||||
EmpresaActualOC = If(IsNothing(ViewState("EmpresaActualOC")), Nothing, DirectCast(ViewState("EmpresaActualOC"), Empresa))
|
||||
End Get
|
||||
Set(value As Empresa)
|
||||
ViewState("EmpresaActualOC") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CveUsuarioAsignado As Integer
|
||||
Get
|
||||
Return If(IsNothing(ViewState("CveUsuarioAsignado")), -1, ViewState("CveUsuarioAsignado").ToString.ToEntero)
|
||||
@@ -584,6 +592,9 @@ Partial Class OC
|
||||
CveProveedorOriginal = -1
|
||||
'MODALIDAD MULTIEMPRESA
|
||||
CveEmpresaActual = UsuarioActual.CveEmpresa
|
||||
If CveEmpresaActual > 0 Then
|
||||
EmpresaActualOC = UsuarioActual.Empresa
|
||||
End If
|
||||
CargaEstatusUsuariosClasificaciones()
|
||||
|
||||
TxtObsPS.Attributes.Add("maxlength", "750")
|
||||
@@ -1275,6 +1286,9 @@ Partial Class OC
|
||||
|
||||
If objOC.GetOC(pCveOrdenCompra, CveEmpresaActual, CveUsuario:=UsuarioActual.CveUsuario) AndAlso objOC.DtResultados.Rows.Count > 0 Then
|
||||
CveEmpresaActual = objOC.CveEmpresa
|
||||
If CveEmpresaActual > 0 Then
|
||||
EmpresaActualOC = CreaObjetoEmpresa(CveEmpresaActual)
|
||||
End If
|
||||
InicializarValores()
|
||||
|
||||
ViewState("CveOrdenCompra") = pCveOrdenCompra
|
||||
@@ -4956,6 +4970,27 @@ Partial Class OC
|
||||
|
||||
End Sub
|
||||
|
||||
Private Function CreaObjetoEmpresa(CveEmpresa As Integer) As Empresa
|
||||
Dim Retorno As Empresa = Nothing
|
||||
|
||||
Dim ObjEmpresa As New ClsSisEmpresas()
|
||||
If ObjEmpresa.GetEmpresas(CveEmpresa, "-1", "-1", "-1", "-1") Then
|
||||
If ObjEmpresa.GetEmpresasFuncionalidades(CveEmpresa) Then
|
||||
Dim dttmp As Data.DataTable = ObjEmpresa.DtResultados
|
||||
|
||||
Dim EmpresasFuncionalidades As New HybridDictionary
|
||||
For Each Row As Data.DataRow In dttmp.Rows
|
||||
EmpresasFuncionalidades.Add(Convert.ToInt32(Row("CveFuncionalidad")), Row("Valor").ToString)
|
||||
Next
|
||||
ObjEmpresa.Empresa.SetFuncionalidades(EmpresasFuncionalidades)
|
||||
End If
|
||||
|
||||
Retorno = ObjEmpresa.Empresa
|
||||
End If
|
||||
ObjEmpresa.Dispose()
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
#Region " GUARDA DIRECTO "
|
||||
Private Sub GuardaBitacora(Optional EsCotizacion As Boolean = False)
|
||||
@@ -4974,7 +5009,12 @@ Partial Class OC
|
||||
If ObjEventoBitacora.AddEventoBitacora(descripcion, String.Format("{0}", FileExtension), UsuarioActual.CveUsuario, CveEmpresaActual, CveOC:=CveOrdenCompra, Prioridad:=Prioridad) Then
|
||||
|
||||
If Filename <> "" Then
|
||||
Filename.FilesMove(String.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString), String.Format("Empresas\{0}\OI", CveEmpresaActual))
|
||||
If EmpresaActualOC IsNot Nothing Then
|
||||
Filename.FilesMove(String.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString), String.Format("{0}\OI", EmpresaActualOC.Ruta), ConcatenarDirectorioBase:=False)
|
||||
Else
|
||||
Filename.FilesMove(String.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString), String.Format("Empresas\{0}\OI", CveEmpresaActual))
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
GvEB.DataSource = ObjEventoBitacora.DtResultados
|
||||
@@ -5061,7 +5101,11 @@ Partial Class OC
|
||||
End If
|
||||
|
||||
If Filename <> "" Then
|
||||
Filename.FilesMove(String.Format("OI{0}{1}", UsuarioActual.CveUsuario, DtDetalle.Rows.Count), String.Format("Empresas\{0}\OI\Temp", CveEmpresaActual))
|
||||
If EmpresaActualOC IsNot Nothing Then
|
||||
Filename.FilesMove(String.Format("OI{0}{1}", UsuarioActual.CveUsuario, DtDetalle.Rows.Count), String.Format("{0}OI\Temp", EmpresaActualOC.Ruta), ConcatenarDirectorioBase:=False)
|
||||
Else
|
||||
Filename.FilesMove(String.Format("OI{0}{1}", UsuarioActual.CveUsuario, DtDetalle.Rows.Count), String.Format("Empresas\{0}\OI\Temp", CveEmpresaActual))
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveMeta,CveVendedor,CveMarca,CveClasificacion,CveClasificacionSup,Vendedor,MesAño,Marca,Clasificacion,MetaCantidad,MetaImporte" EmptyDataText="No se encontraron metas registradas" ToolTip="Listado de Metas Vendedor" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center; width: 100%" GridLines="None">
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveMeta,CveVendedor,CveMarca,CveClasificacion,CveClasificacionSup,Vendedor,MesAño,Marca,Clasificacion,MetaCantidad,MetaImporte" EmptyDataText="No se encontraron metas registradas" ToolTip="Listado de Metas Vendedor" CssClass="table table-striped table-advance table-hover" Style=" width: 100%" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Vendedor" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
@@ -122,7 +122,7 @@
|
||||
<ajax:ValidatorCalloutExtender ID="VCMesAño" runat="server" HighlightCssClass="vco" TargetControlID="RFVMesAño" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Meta Cantidad">
|
||||
<asp:TemplateField HeaderText="Meta" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlMetaCantidad" runat="server" Text='<%# Eval("MetaCantidad", "{0}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
@@ -132,9 +132,9 @@
|
||||
<ajax:ValidatorCalloutExtender ID="VCMetaCantidad" runat="server" HighlightCssClass="vco" TargetControlID="RFVMetaCantidad" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Meta Importe">
|
||||
<asp:TemplateField HeaderText="$ Meta" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlMetaImporte" runat="server" Text='<%# Eval("MetaImporte", "{0}") %>'></asp:Literal>
|
||||
<asp:Literal ID="LtlMetaImporte" runat="server" Text='<%# Eval("MetaImporte", "{0:N2}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtMetaImporte" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("MetaImporte") %>' ValidationGroup="GrpGV" Width="234px"></asp:TextBox>
|
||||
|
||||
@@ -15,6 +15,7 @@ Partial Class CatMetasVendedores
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
txtMesAnio.Text = Now.FirstDayOfMonth.ToShortDateString
|
||||
CargaDatosModal()
|
||||
CargaCombos()
|
||||
CargaDatos()
|
||||
@@ -87,7 +88,7 @@ Partial Class CatMetasVendedores
|
||||
Dim ObjVentas As New ClsVentas
|
||||
If BtnAgregarMetaVendedor.Text = "Agregar" Then
|
||||
If ObjVentas.AddMetasVendedores(DdlVendedores.SelectedValue.ToEntero, TxtFechaI.Text, DdlMarcas.SelectedValue.ToEntero, TxtMetaCantidad.Text.ToEntero,
|
||||
TxtMetaImporte.Text.ToDecimal, DdlClasificacion.SelectedValue.ToEntero, DdlClasificacionSup.SelectedValue.ToEntero) Then
|
||||
TxtMetaImporte.Text.ToDecimal, DdlClasificacion.SelectedValue.ToEntero, DdlClasificacionSup.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
Alert("Se agregó la meta al vendedor")
|
||||
Else
|
||||
Alert("No se pudo agregar la meta al vendedor", TipoMensaje.MsgError)
|
||||
@@ -279,105 +280,75 @@ Partial Class CatMetasVendedores
|
||||
Dim ProductosNoCargados As New StringBuilder()
|
||||
Dim RowsCargados As Integer = 0
|
||||
Dim RowsNoCargados As Integer = 0
|
||||
Dim ObjMetas As New ClsVentas
|
||||
'ObjPS.IniciaTransacSQL()
|
||||
Dim ObjMetas As New ClsVentas
|
||||
Dim Correcto As Boolean = True
|
||||
ObjMetas.IniciaTransacSQL()
|
||||
Try
|
||||
Dim DtVendedores As DataTable = GlobalDTVendedores(UsuarioActual.CveEmpresa)
|
||||
Dim DtClasificaciones As DataTable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa)
|
||||
Dim DtClasificaciones2 As DataTable = GlobalDTClasificaciones2(UsuarioActual.CveEmpresa)
|
||||
|
||||
For Each row As DataRow In dt.Rows
|
||||
Dim Correcto As Boolean = False
|
||||
Dim TieneError As Boolean = False
|
||||
Dim CveVendedor As Integer = DtVendedores.FiltroPrimeroValor("CveVendedor", String.Format("Vendedor LIKE '%{0}%'", row("Vendedor").ToString().TrimStart().TrimEnd())).ToEntero
|
||||
Dim CveClasificacion As Integer = DtClasificaciones.FiltroPrimeroValor("CveClasificacion", String.Format("Clasificacion='{0}'", row("Clasificación Superior").ToString().TrimStart().TrimEnd())).ToEntero
|
||||
Dim CveClasificacion2 As Integer = DtClasificaciones2.FiltroPrimeroValor("CveClasificacion", String.Format("Clasificacion='{0}'", row("Clasificación").ToString().TrimStart().TrimEnd())).ToEntero
|
||||
Dim CveMarca As Integer = DtMarcas.FiltroPrimeroValor("CveMarca", String.Format("Marca='{0}'", row("Marca").ToString().TrimStart().TrimEnd())).ToEntero
|
||||
|
||||
Dim Mes As Decimal = row("Mes").ToString().ToDecimal()
|
||||
Dim Anio As Decimal = row("Año").ToString().ToDecimal()
|
||||
Dim Cantidad As Decimal = row("Cantidad").ToString().ToDecimal()
|
||||
Dim Importe As Decimal = row("Importe").ToString().ToDecimal()
|
||||
|
||||
Dim FechaRef As New DateTime(Anio, Mes, 1)
|
||||
If CveVendedor > 0 AndAlso CveVendedor > 0 AndAlso CveClasificacion > 0 AndAlso CveClasificacion2 > 0 AndAlso CveMarca > 0 Then
|
||||
Correcto = ObjMetas.AddMetasVendedores(CveVendedor, FechaRef, CveMarca, Cantidad, Importe, CveClasificacion2, CveClasificacion)
|
||||
If Correcto Then
|
||||
RowsCargados += 1
|
||||
End If
|
||||
End If
|
||||
|
||||
If Not Correcto Then
|
||||
RowsNoCargados += 1
|
||||
End If
|
||||
Dim DtClasificaciones2 As DataTable = GlobalDTClasificaciones2(UsuarioActual.CveEmpresa)
|
||||
|
||||
|
||||
For Each row As DataRow In dt.Rows
|
||||
|
||||
If Correcto Then
|
||||
Dim TieneError As Boolean = False
|
||||
Dim CveVendedor As Integer = DtVendedores.FiltroPrimeroValor("CveVendedor", String.Format("trim(Vendedor) LIKE '%{0}%'", row("Vendedor").ToString().TrimStart().TrimEnd())).ToEntero
|
||||
Dim CveClasificacion As Integer = DtClasificaciones.FiltroPrimeroValor("CveClasificacion", String.Format("trim(Clasificacion)='{0}'", row("Clasificación Superior").ToString().TrimStart().TrimEnd())).ToEntero
|
||||
Dim CveClasificacion2 As Integer = DtClasificaciones2.FiltroPrimeroValor("CveClasificacion", String.Format("trim(Clasificacion)='{0}'", row("Clasificación").ToString().TrimStart().TrimEnd())).ToEntero
|
||||
Dim CveMarca As Integer = DtMarcas.FiltroPrimeroValor("CveMarca", String.Format("Marca='{0}'", row("Marca").ToString().TrimStart().TrimEnd())).ToEntero
|
||||
|
||||
Dim Mes As Decimal = row("Mes").ToString().ToDecimal()
|
||||
Dim Anio As Decimal = row("Año").ToString().ToDecimal()
|
||||
Dim Cantidad As Decimal = row("Cantidad").ToString().ToDecimal()
|
||||
Dim Importe As Decimal = row("Importe").ToString().ToDecimal()
|
||||
|
||||
Dim FechaRef As New DateTime(Anio, Mes, 1)
|
||||
If CveVendedor > 0 AndAlso CveVendedor > 0 AndAlso CveClasificacion > 0 AndAlso CveClasificacion2 > 0 AndAlso CveMarca > 0 Then
|
||||
Correcto = ObjMetas.AddMetasVendedores(CveVendedor, FechaRef, CveMarca, Cantidad, Importe, CveClasificacion2, CveClasificacion, UsuarioActual.CveEmpresa)
|
||||
If Correcto Then
|
||||
RowsCargados += 1
|
||||
End If
|
||||
End If
|
||||
|
||||
If Not Correcto Then
|
||||
RowsNoCargados += 1
|
||||
End If
|
||||
End If
|
||||
|
||||
Next
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al cargar los precios.", ex)
|
||||
Finally
|
||||
ObjMarcas.Dispose()
|
||||
|
||||
Dim MensajeFinal As New StringBuilder()
|
||||
If RowsNoCargados = 0 AndAlso RowsCargados > 0 Then
|
||||
MensajeFinal.Append("Las metas se cargaron correctamente. <br/><br/>")
|
||||
End If
|
||||
If RowsCargados > 0 Then
|
||||
MensajeFinal.Append("Se cargaron <b>" & RowsCargados & "</b> metas correctamente.")
|
||||
End If
|
||||
If RowsNoCargados > 0 Then
|
||||
MensajeFinal.Append("No se pudieron actualizar <b>" & RowsNoCargados & "</b> metas. <br/>")
|
||||
End If
|
||||
|
||||
Alert(MensajeFinal.ToString())
|
||||
Dim MensajeFinal As New StringBuilder()
|
||||
|
||||
If Correcto Then
|
||||
ObjMetas.Commit()
|
||||
If RowsNoCargados = 0 AndAlso RowsCargados > 0 Then
|
||||
MensajeFinal.Append("Las metas se cargaron correctamente. <br/><br/>")
|
||||
End If
|
||||
If RowsCargados > 0 Then
|
||||
MensajeFinal.Append("Se cargaron <b>" & RowsCargados & "</b> metas correctamente.")
|
||||
End If
|
||||
If RowsNoCargados > 0 Then
|
||||
MensajeFinal.Append("No se pudieron actualizar <b>" & RowsNoCargados & "</b> metas. <br/>")
|
||||
End If
|
||||
|
||||
Alert(MensajeFinal.ToString())
|
||||
Else
|
||||
ObjMetas.RollBack()
|
||||
If RowsNoCargados > 0 Then
|
||||
MensajeFinal.Append("No se pudieron actualizar <b>" & RowsNoCargados & "</b> metas. <br/>")
|
||||
End If
|
||||
Alert(MensajeFinal.ToString())
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
End Try
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function ReadExcelFile(ByVal flatFilePath As String, ByVal firstRowHasHeaders As Boolean) As DataTable
|
||||
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
|
||||
Dim excelFile As ExcelFile = ExcelFile.Load(flatFilePath)
|
||||
|
||||
Dim unnamed As Integer = 0
|
||||
Dim cols As Integer
|
||||
Dim columns As String()
|
||||
Dim curRow As Integer = 0
|
||||
Dim curCol As Integer = 0
|
||||
Dim dataTable As DataTable = New DataTable()
|
||||
Dim worksheet As ExcelWorksheet = excelFile.Worksheets(0)
|
||||
|
||||
For cols = 0 To worksheet.Rows(0).AllocatedCells.Count - 1
|
||||
|
||||
If firstRowHasHeaders Then
|
||||
|
||||
If worksheet.Rows(0).Cells(cols).Value IsNot Nothing Then
|
||||
dataTable.Columns.Add(worksheet.Rows(0).Cells(cols).Value.ToString())
|
||||
Else
|
||||
dataTable.Columns.Add("Unnamed Column " & (System.Threading.Interlocked.Increment(unnamed)))
|
||||
End If
|
||||
|
||||
curRow = 1
|
||||
Else
|
||||
dataTable.Columns.Add("Column " & (cols + 1))
|
||||
End If
|
||||
Next
|
||||
|
||||
While curRow < worksheet.Rows.Count
|
||||
columns = New String(cols - 1) {}
|
||||
|
||||
For curCol = 0 To cols - 1
|
||||
|
||||
If worksheet.Rows(curRow).Cells(curCol).Value Is Nothing Then
|
||||
columns(curCol) = ""
|
||||
Else
|
||||
columns(curCol) = worksheet.Rows(curRow).Cells(curCol).Value.ToString()
|
||||
End If
|
||||
Next
|
||||
|
||||
dataTable.Rows.Add(columns)
|
||||
curRow += 1
|
||||
End While
|
||||
|
||||
Return dataTable
|
||||
End Function
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -4434,7 +4434,7 @@
|
||||
<ContentTemplate>
|
||||
|
||||
<asp:GridView ID="GvAcum" Width="100%" runat="server" GridLines="None"
|
||||
DataKeyNames="CveMovto, CveCliente,Cantidad,CvePSCargo,CveTamaño,Puntos,ImporteCargo,ImporteBonificacion,Cargo,Bonificacion,ImporteCompra,CveConcepto,CveVenta,Observaciones,CveUsuario,FechaIng,FacturadoCargo,FacturadoBonificacion,CveSubProyecto"
|
||||
DataKeyNames="CveMovto, CveCliente,Cantidad,CvePSCargo,CveTamaño,Puntos,ImporteCargo,ImporteBonificacion,Cargo,Bonificacion,ImporteCompra,CveConcepto,CveVenta,Observaciones,CveUsuario,FechaIng,FacturadoCargo,FacturadoBonificacion,CveSubProyecto,TipoEstatus"
|
||||
CssClass="table table-striped table-advance table-hover ScrollAD " ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true"
|
||||
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False">
|
||||
<Columns>
|
||||
|
||||
@@ -9420,7 +9420,7 @@ Partial Class Clientes
|
||||
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
If e.Row.DataKey("CveConcepto").ToEntero() = 1 Then
|
||||
If e.Row.DataKey("CveConcepto").ToEntero() = 1 AndAlso e.Row.DataKey("TipoEstatus").ToEntero() <> 5 Then
|
||||
|
||||
Dim FacturadoCargo As Boolean = Boolean.Parse(e.Row.DataKey("FacturadoCargo"))
|
||||
Dim FacturadoBonificacion As Boolean = Boolean.Parse(e.Row.DataKey("FacturadoBonificacion"))
|
||||
|
||||
@@ -144,59 +144,86 @@
|
||||
CssClass="table table-advance Widthall ScrollAD" data-sort="true" ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true"
|
||||
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Grupo" ItemStyle-HorizontalAlign="Left">
|
||||
<asp:TemplateField HeaderText="Grupo" ItemStyle-HorizontalAlign="Left" HeaderStyle-Width="250px">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="HlkGrupo" runat="server" Target="_blank" Text='<%# Eval("Titulo").ToString() %>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Real Mes" ItemStyle-HorizontalAlign="Center">
|
||||
<asp:TemplateField HeaderText="Real" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblRealMes" runat="server" Target="_blank" Text='<%# Eval("RealMes").ToString() %>'> </asp:Label>
|
||||
<asp:Label ID="lblRealMes" runat="server" Target="_blank" Text='<%# Eval("RealMes", "{0:#,###}").ToString() %>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Real Mes %" ItemStyle-HorizontalAlign="Center">
|
||||
<asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Center">
|
||||
<HeaderTemplate>
|
||||
%Inte
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblRealMesPorcentaje" runat="server" Target="_blank" Text='<%# Eval("RealMesPorcentaje").ToString() %>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Venta Mes Año Anterior" ItemStyle-HorizontalAlign="Center">
|
||||
<asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Center">
|
||||
<HeaderTemplate>
|
||||
Año<br />Anterior
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblVtaMesAA" runat="server" Target="_blank" Text='<%# Eval("VtaMesAA").ToString() %>'> </asp:Label>
|
||||
<asp:Label ID="lblVtaMesAA" runat="server" Target="_blank" Text='<%# Eval("VtaMesAA", "{0:#,###}").ToString() %>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Obj Mes" ItemStyle-HorizontalAlign="Center">
|
||||
<asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Right">
|
||||
<HeaderTemplate>
|
||||
Obj.<br />Mes
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblObjMes" runat="server" Target="_blank" Text='<%# Eval("ObjMes").ToString() %>'> </asp:Label>
|
||||
<asp:Label ID="lblObjMes" runat="server" Target="_blank" Text='<%# Eval("ObjMes", "{0:#,###}").ToString() %>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Var Mes A.A" ItemStyle-HorizontalAlign="Center">
|
||||
<asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Right">
|
||||
<HeaderTemplate>
|
||||
Var <br />Mes A.A
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblVarMesAA" runat="server" Target="_blank" Text='<%# Eval("VarMesAA").ToString() %>'> </asp:Label>
|
||||
<asp:Label ID="lblVarMesAA" runat="server" Target="_blank" Text='<%# Eval("VarMesAA", "{0:#,###}").ToString() %>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Var Mes Obj" ItemStyle-HorizontalAlign="Center">
|
||||
<asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Right">
|
||||
<HeaderTemplate>
|
||||
Var <br />Obj.
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblVarMesObj" runat="server" Target="_blank" Text='<%# Eval("VarMesObj").ToString() %>'> </asp:Label>
|
||||
<asp:Label ID="lblVarMesObj" runat="server" Target="_blank" Text='<%# Eval("VarMesObj", "{0:#,###}").ToString() %>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Real Acumulado" ItemStyle-HorizontalAlign="Center">
|
||||
<asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Right">
|
||||
<HeaderTemplate>
|
||||
Real<br/>Acum.
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblRealAcumulado" runat="server" Target="_blank" Text='<%# Eval("RealAcumulado").ToString() %>'> </asp:Label>
|
||||
<asp:Label ID="lblRealAcumulado" runat="server" Target="_blank" Text='<%# Eval("RealAcumulado", "{0:#,###}").ToString() %>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Real Acumulado %" ItemStyle-HorizontalAlign="Center">
|
||||
<asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Center">
|
||||
<HeaderTemplate>
|
||||
%Inte
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblRealAcumuladoPorcentaje" runat="server" Target="_blank" Text='<%# Eval("RealAcumuladoPorcentaje").ToString() %>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="A. Ant. Acumulado" ItemStyle-HorizontalAlign="Center">
|
||||
<asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Center">
|
||||
<HeaderTemplate>
|
||||
Acum<br />Año Ant
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblAAntAcumulado" runat="server" Target="_blank" Text='<%# Eval("AAntAcumulado").ToString() %>'> </asp:Label>
|
||||
<asp:Label ID="lblAAntAcumulado" runat="server" Target="_blank" Text='<%# Eval("AAntAcumulado", "{0:#,###}").ToString() %>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Obj Acumulado" ItemStyle-HorizontalAlign="Center">
|
||||
<asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Center">
|
||||
<HeaderTemplate>
|
||||
Obj.<br />Acum
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblObjAcumulado" runat="server" Target="_blank" Text='<%# Eval("ObjAcumulado").ToString() %>'> </asp:Label>
|
||||
<asp:Label ID="lblObjAcumulado" runat="server" Target="_blank" Text='<%# Eval("ObjAcumulado", "{0:#,###}").ToString() %>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<%-- <asp:TemplateField HeaderText="%Var vs AA" ItemStyle-HorizontalAlign="Center">
|
||||
@@ -204,14 +231,20 @@
|
||||
<asp:Label ID="lblVarVSAAPerc" runat="server" Target="_blank" Text='<%# Eval("VarVSAAPerc").ToString() %>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>--%>
|
||||
<asp:TemplateField HeaderText="Var vs AA" ItemStyle-HorizontalAlign="Center">
|
||||
<asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Center">
|
||||
<HeaderTemplate>
|
||||
Var <br />vs AA
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblVarVSAA" runat="server" Target="_blank" Text='<%# Eval("VarVSAA").ToString() %>'> </asp:Label>
|
||||
<asp:Label ID="lblVarVSAA" runat="server" Target="_blank" Text='<%# Eval("VarVSAA", "{0:#,###}").ToString() %>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Var vs ObjAcum" ItemStyle-HorizontalAlign="Center">
|
||||
<asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Center">
|
||||
<HeaderTemplate>
|
||||
Var<br /> Obj.
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblVarVSObjAcum" runat="server" Target="_blank" Text='<%# Eval("VarVSObjAcum").ToString() %>'> </asp:Label>
|
||||
<asp:Label ID="lblVarVSObjAcum" runat="server" Target="_blank" Text='<%# Eval("VarVSObjAcum", "{0:#,###}").ToString() %>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
|
||||
@@ -86,7 +86,7 @@ Partial Class MetasVendedores
|
||||
|
||||
Select Case e.Row.DBCampo("TipoFila")
|
||||
Case "1"
|
||||
e.Row.CssClass = "GrupoSuperior"
|
||||
e.Row.CssClass = "Totales"
|
||||
' e.Row.FCLabel("lblRealMes").Text = ""
|
||||
' e.Row.FCLabel("lblVtaMesAA").Text = ""
|
||||
' e.Row.FCLabel("lblObjMes").Text = ""
|
||||
@@ -98,11 +98,11 @@ Partial Class MetasVendedores
|
||||
' e.Row.FCLabel("lblVarVSAA").Text = ""
|
||||
' e.Row.FCLabel("lblVarVSObjAcum").Text = ""
|
||||
Case "2"
|
||||
e.Row.CssClass = "Totales"
|
||||
Case "3"
|
||||
e.Row.CssClass = "SubTotales2"
|
||||
Case "4"
|
||||
Case "3"
|
||||
e.Row.CssClass = "SubTotales"
|
||||
Case "4"
|
||||
e.Row.CssClass = "SubTotales3"
|
||||
End Select
|
||||
|
||||
If e.Row.DataKey("Titulo") = "" Then
|
||||
|
||||
@@ -1286,6 +1286,7 @@ Partial Class PV
|
||||
If UsuarioActual.Empresa.Funcionalidad(569) = "1" Then
|
||||
DdlTipoComprobante.Items.Add(New ListItem("Remisión", "Rem"))
|
||||
DdlTipoComprobante.SelectedValueExist("Rem")
|
||||
DdlTipoComprobante_SelectedIndexChanged(DdlTipoComprobante, EventArgs.Empty)
|
||||
End If
|
||||
DdlTipoDefecto.Width = New Unit(260%)
|
||||
|
||||
@@ -5964,7 +5965,7 @@ Partial Class PV
|
||||
Case 1 'CREDITO
|
||||
TxtFechaPago.Text = Now.AddDays(PlazoCobranza).ToShortDateString
|
||||
Case 2 'CONTADO
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem") Then
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant") Then
|
||||
DivContado.Visible = True
|
||||
TxtImporteContado.Text = TxtTotal.Text
|
||||
End If
|
||||
@@ -6165,6 +6166,11 @@ Partial Class PV
|
||||
Retorno = True
|
||||
End If
|
||||
|
||||
If DtPagos IsNot Nothing AndAlso DtPagos.SUM("Importe").ToString.ToDecimal() > 0 AndAlso DdlTipoComprobante.SelectedValue = "Rem" Then
|
||||
Alert("Los pagos no deben ser aplicados a una remisión.", TipoMensaje.MsgAdvertencia)
|
||||
Retorno = True
|
||||
End If
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
@@ -7315,12 +7321,10 @@ Partial Class PV
|
||||
TxtPrecio.Text = TxtPrecio.Text
|
||||
TxtObsPS.Text = "Descuento por garantía"
|
||||
Else
|
||||
'For Each Gvr As GridViewRow In GvRecepcionUsados.Rows
|
||||
' If Gvr.RowType = DataControlRowType.DataRow Then
|
||||
' Gvr.FCTextBox("TxtCantidad").Text = ""
|
||||
' Gvr.FCTextBox("TxtCantidad").Enabled = True
|
||||
' End If
|
||||
'Next
|
||||
If TmpDTAjustes IsNot Nothing Then
|
||||
TmpDTAjustes.Clear()
|
||||
End If
|
||||
TxtObsPS.Text = TxtObsPS.Text.Replace("Descuento por garantía", "")
|
||||
|
||||
DdlRecepcionUsados.SelectedValueExist("-1")
|
||||
DdlRecepcionUsados.Enabled = True
|
||||
|
||||
@@ -194,7 +194,7 @@ Partial Class Ventas_RepProductosServicios
|
||||
DdlSubProyectoEjecucion.DataBind()
|
||||
|
||||
'Vendedor
|
||||
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
|
||||
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa, VendedorTipo:=-1).FiltraParametros("VendedorTipo in (1,3)") 'vendedores y vendedores de piso
|
||||
DdlVendedor.DataBind()
|
||||
|
||||
'CargaUsuarios
|
||||
|
||||
@@ -180,15 +180,15 @@ Partial Class Ventas_RepRecuperacion
|
||||
End If
|
||||
End If
|
||||
|
||||
Dim Liga4 As String = String.Format("/Ventas/RepRecuperacionDetalle.aspx?GPO={0}&CveCliente={1}&CveSubProyecto={2}&Vendedor={3}&CveUsuario={4}&CveEstatusFactura={5}&IVA={6}&FechaI={7}&FechaF={8}&CveResponsable={9}&TipoDocto={10}&CveClienteSucursal={11}&CveBanco{12}&CveCuenta{13}&Grupo={14}&TipoCambio={15}&TCEspecifico={16}&CveMoneda={17}&Tipo={18}&EsDistribuidor={19}&FechaAplicadoI={20}&FechaAplicadoF={21}&FechaRegistroIEI={22}&FechaRegistroIEF={23}",
|
||||
Dim Liga4 As String = String.Format("/Ventas/RepRecuperacionDetalle.aspx?GPO={0}&CveCliente={1}&CveSubProyecto={2}&Vendedor={3}&CveUsuario={4}&CveEstatusFactura={5}&IVA={6}&FechaI={7}&FechaF={8}&CveResponsable={9}&TipoDocto={10}&CveClienteSucursal={11}&CveBanco{12}&CveCuenta{13}&Grupo={14}&TipoCambio={15}&TCEspecifico={16}&CveMoneda={17}&Tipo={18}&EsDistribuidor={19}&FechaAplicadoI={20}&FechaAplicadoF={21}&FechaRegistroIEI={22}&FechaRegistroIEF={23}&CveCondicionesPago={24}&CveTipoTransaccion={25}",
|
||||
DdlGrupo.SelectedValue, e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"),
|
||||
e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), CveClienteSucursal, e.Row.DBCampo("CveBanco"), e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("GPO"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), e.Row.DBCampo("CveMoneda"), 2, e.Row.DBCampo("EsDistribuidor"), FechaAplicadoI, FechaAplicadoF, FechaRegistroIEI, FechaRegistroIEF)
|
||||
e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), CveClienteSucursal, e.Row.DBCampo("CveBanco"), e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("GPO"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), e.Row.DBCampo("CveMoneda"), 2, e.Row.DBCampo("EsDistribuidor"), FechaAplicadoI, FechaAplicadoF, FechaRegistroIEI, FechaRegistroIEF, -1, e.Row.DBCampo("CveTipoTransaccion"))
|
||||
|
||||
e.Row.FCHyperLink("HplPagado").NavigateUrl = Liga4
|
||||
|
||||
Dim Liga5 As String = String.Format("/Ventas/RepRecuperacionDetalle.aspx?GPO={0}&CveCliente={1}&CveSubProyecto={2}&Vendedor={3}&CveUsuario={4}&CveEstatusFactura={5}&IVA={6}&FechaI={7}&FechaF={8}&CveResponsable={9}&TipoDocto={10}&CveClienteSucursal={11}&CveBanco{12}&CveCuenta{13}&Grupo={14}&TipoCambio={15}&TCEspecifico={16}&CveMoneda={17}&Tipo={18}&EsDistribuidor={19}&FechaAplicadoI={20}&FechaAplicadoF={21}&FechaRegistroIEI={22}&FechaRegistroIEF={23}",
|
||||
Dim Liga5 As String = String.Format("/Ventas/RepRecuperacionDetalle.aspx?GPO={0}&CveCliente={1}&CveSubProyecto={2}&Vendedor={3}&CveUsuario={4}&CveEstatusFactura={5}&IVA={6}&FechaI={7}&FechaF={8}&CveResponsable={9}&TipoDocto={10}&CveClienteSucursal={11}&CveBanco{12}&CveCuenta{13}&Grupo={14}&TipoCambio={15}&TCEspecifico={16}&CveMoneda={17}&Tipo={18}&EsDistribuidor={19}&FechaAplicadoI={20}&FechaAplicadoF={21}&FechaRegistroIEI={22}&FechaRegistroIEF={23}&CveCondicionesPago={24}&CveTipoTransaccion={25}",
|
||||
DdlGrupo.SelectedValue, e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"),
|
||||
e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), CveClienteSucursal, e.Row.DBCampo("CveBanco"), e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("GPO"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), e.Row.DBCampo("CveMoneda"), 1, e.Row.DBCampo("EsDistribuidor"), FechaAplicadoI, FechaAplicadoF, FechaRegistroIEI, FechaRegistroIEF)
|
||||
e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), CveClienteSucursal, e.Row.DBCampo("CveBanco"), e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("GPO"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), e.Row.DBCampo("CveMoneda"), 1, e.Row.DBCampo("EsDistribuidor"), FechaAplicadoI, FechaAplicadoF, FechaRegistroIEI, FechaRegistroIEF, -1, e.Row.DBCampo("CveTipoTransaccion"))
|
||||
|
||||
e.Row.FCHyperLink("HplVendido").NavigateUrl = Liga5
|
||||
|
||||
|
||||
@@ -219,6 +219,12 @@
|
||||
<asp:ListItem Text="No" Value="0"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<label id="Label2" class="col-md-1 truncate">Tipo Transacción:</label>
|
||||
<div class="col-md-2" id="div1" >
|
||||
<asp:DropDownList ID="DdlTipoTransaccion" runat="server" DataTextField="TipoTransaccion" DataValueField="CveTipoTransaccion" AppendDataBoundItems="true" CssClass="form-control input-small input-sm select2me" Width="100%">
|
||||
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<div class="col-md-1 truncate">F. Registro IE inicio:</div>
|
||||
<div class="col-md-1" style="padding-left: 0px !important;">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; ">
|
||||
@@ -249,6 +255,7 @@
|
||||
<ajax:ValidatorCalloutExtender ID="vcoFfvFRegistroIEF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaRegistroIEF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFRegistroIEF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaRegistroIEF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -133,10 +133,11 @@ Partial Class Ventas_RepRecuperacionDetalle
|
||||
DdlMoneda.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
DdlMoneda.DataBind()
|
||||
|
||||
'txtFechaI.Text = $"01/{Now.Month}/{Now.Year}"
|
||||
'txtFechaF.Text = Now.ToShortDateString
|
||||
|
||||
'Cargamos las fechas
|
||||
DdlTipoTransaccion.DataSource = GlobalDTTipoTransacciones().FiltraParametros("Tipo = 'Ing' and Estatus = True ")
|
||||
DdlTipoTransaccion.DataBind()
|
||||
DdlTipoTransaccion.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
'Cargamos las fechas
|
||||
FechaI = If(Request("FechaI") IsNot Nothing, Request("FechaI").ToString, "-1").ToString
|
||||
FechaF = If(Request("FechaF") IsNot Nothing, Request("FechaF").ToString, "-1").ToString
|
||||
If FechaF <> "-1" Then
|
||||
@@ -186,6 +187,7 @@ Partial Class Ventas_RepRecuperacionDetalle
|
||||
CveClienteClasificacion = IfNull(Request("CveClienteClasificacion"), "-1").ToString.ToEntero
|
||||
Tipo = IfNull(Request("Tipo"), "-1").ToString.ToEntero
|
||||
EsDistribuidor = IfNull(Request("EsDistribuidor"), "-1").ToString.ToEntero
|
||||
Dim CveTipoTransaccion As Integer = IfNull(Request("CveTipoTransaccion"), "-1").ToString.ToEntero
|
||||
|
||||
'Carga Clasificacion Cliente'
|
||||
Dim ObjCliente As New ClsClientes
|
||||
@@ -230,6 +232,7 @@ Partial Class Ventas_RepRecuperacionDetalle
|
||||
DdlClienteClasificacion.SelectedValueExist(CveClienteClasificacion)
|
||||
DdlClienteSucursal.SelectedValueExist(CveClienteSucursal)
|
||||
DdlDistribuidor.SelectedValueExist(EsDistribuidor)
|
||||
DdlTipoTransaccion.SelectedValueExist(CveTipoTransaccion)
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
lblEsDistribuidor.Visible = True
|
||||
@@ -256,7 +259,8 @@ Partial Class Ventas_RepRecuperacionDetalle
|
||||
Iva.ToString, DdlGrupo.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlResponsable.SelectedValue.ToEntero,
|
||||
DdlTipoDocto.SelectedValue, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveBanco:=DdlBanco.SelectedValue.ToEntero, CveCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero, Grupo:=Grupo,
|
||||
TipoCambio:=RblTipoCambio.SelectedValue.ToEntero, TCEspecifico:=TCEspecifico, CveMoneda:=DdlMoneda.SelectedValue.ToEntero, CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero, Tipo:=Tipo,
|
||||
EsDistribuidor:=DdlDistribuidor.SelectedValue.ToEntero(), FechaAplicadoI:=FechaAplicadoI, FechaAplicadoF:=FechaAplicadoF, FechaRegistroIEI:=FechaRegistroIEI, FechaRegistroIEF:=FechaRegistroIEF) Then
|
||||
EsDistribuidor:=DdlDistribuidor.SelectedValue.ToEntero(), FechaAplicadoI:=FechaAplicadoI, FechaAplicadoF:=FechaAplicadoF, FechaRegistroIEI:=FechaRegistroIEI, FechaRegistroIEF:=FechaRegistroIEF,
|
||||
CveTipoTransaccion:=DdlTipoTransaccion.SelectedValue.ToEntero) Then
|
||||
|
||||
GvDatos.DataSource = ObjMovtos.DtResultados
|
||||
DtDatos = ObjMovtos.DtResultados
|
||||
|
||||
@@ -6602,6 +6602,30 @@ Partial Class Ventas
|
||||
LnkOCs.Visible = False
|
||||
End If
|
||||
|
||||
If DdlTipoComprobante.SelectedValue = "Cot" AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
Dim Autorizacion As Integer = 0
|
||||
|
||||
Dim ObjVentas As New ClsVentas
|
||||
If ObjVentas.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, DdlVendedor.SelectedValue.ToEntero, "Ing", CveEstatus:=1) Then
|
||||
Dim RowAutorizacion As DataRow = Nothing
|
||||
'SI TIENE DIAS VENCIDOS BUSCAR POR TIPO VENCIMIENTO
|
||||
If TieneDiasVencidos Then
|
||||
RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion IN(1,2) AND CveVenta IS NULL AND CveTipoDocumento='Ing'", Orderby:="Importe DESC")
|
||||
Else
|
||||
RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion = 1 AND CveVenta IS NULL AND CveTipoDocumento='Ing'", Orderby:="Importe DESC")
|
||||
End If
|
||||
|
||||
If RowAutorizacion IsNot Nothing Then
|
||||
Autorizacion = RowAutorizacion("CveAutorizacion").ToString().ToEntero()
|
||||
End If
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
|
||||
'SI NO TIENE AUTORIZACION, MANTIENE EL BLOQUEO POR CONDICIONES DE CREDITO
|
||||
If Autorizacion > 0 Then
|
||||
BtnsFacturar.Visible = True
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
Else
|
||||
@@ -6620,6 +6644,32 @@ Partial Class Ventas
|
||||
DdlTipoComprobante.SelectedValueExistInsert("Cot", "Cotización")
|
||||
End If
|
||||
TxtFechaPago.Text = If(DdlTipoComprobante.SelectedValue = "Rem", Now.AddDays(PlazoCobranzaRemision), Now.AddDays(PlazoCobranza)).ToShortDateString
|
||||
|
||||
If EsCotizacion AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
Dim Autorizacion As Integer = 0
|
||||
|
||||
Dim ObjVentas As New ClsVentas
|
||||
If ObjVentas.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, DdlVendedor.SelectedValue.ToEntero, "Ing", CveEstatus:=1) Then
|
||||
Dim RowAutorizacion As DataRow = Nothing
|
||||
'SI TIENE DIAS VENCIDOS BUSCAR POR TIPO VENCIMIENTO
|
||||
If TieneDiasVencidos Then
|
||||
RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion IN(1,2) AND CveVenta IS NULL AND CveTipoDocumento='Ing'", Orderby:="Importe DESC")
|
||||
Else
|
||||
RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion = 1 AND CveVenta IS NULL AND CveTipoDocumento='Ing'", Orderby:="Importe DESC")
|
||||
End If
|
||||
|
||||
If RowAutorizacion IsNot Nothing Then
|
||||
Autorizacion = RowAutorizacion("CveAutorizacion").ToString().ToEntero()
|
||||
End If
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
|
||||
'SI NO TIENE AUTORIZACION, MANTIENE EL BLOQUEO POR CONDICIONES DE CREDITO
|
||||
If Autorizacion > 0 Then
|
||||
BtnsFacturar.Visible = True
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
@@ -6753,10 +6803,39 @@ Partial Class Ventas
|
||||
Dim Opcion As Integer = Vta.ObtenerClienteLimitesVenta(CveCliente, UsuarioActual.CveEmpresa)
|
||||
Dim OpcionMsg As String = String.Format("El Cliente se encuentra bloqueado por la siguiente razón: <br> <br> {0}", Vta.SerieVenta)
|
||||
Vta.Dispose()
|
||||
If Opcion > 0 Then
|
||||
Alert(OpcionMsg, TipoMensaje.MsgAdvertencia)
|
||||
BtnsFacturar.Visible = False
|
||||
BtnGenerarRemision.Visible = False
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
Dim Autorizacion As Integer = 0
|
||||
|
||||
Dim ObjVentas As New ClsVentas
|
||||
If ObjVentas.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, DdlVendedor.SelectedValue.ToEntero, "Ing", CveEstatus:=1) Then
|
||||
Dim RowAutorizacion As DataRow = Nothing
|
||||
'SI TIENE DIAS VENCIDOS BUSCAR POR TIPO VENCIMIENTO
|
||||
If TieneDiasVencidos Then
|
||||
RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion IN(1,2) AND CveVenta IS NULL AND CveTipoDocumento='Ing'", Orderby:="Importe DESC")
|
||||
Else
|
||||
RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion = 1 AND CveVenta IS NULL AND CveTipoDocumento='Ing'", Orderby:="Importe DESC")
|
||||
End If
|
||||
|
||||
If RowAutorizacion IsNot Nothing Then
|
||||
Autorizacion = RowAutorizacion("CveAutorizacion").ToString().ToEntero()
|
||||
End If
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
|
||||
'SI NO TIENE AUTORIZACION, MANTIENE EL BLOQUEO POR CONDICIONES DE CREDITO
|
||||
If Opcion > 0 AndAlso Autorizacion <= 0 Then
|
||||
Alert(OpcionMsg, TipoMensaje.MsgAdvertencia)
|
||||
BtnsFacturar.Visible = False
|
||||
BtnGenerarRemision.Visible = False
|
||||
End If
|
||||
|
||||
Else
|
||||
If Opcion > 0 Then
|
||||
Alert(OpcionMsg, TipoMensaje.MsgAdvertencia)
|
||||
BtnsFacturar.Visible = False
|
||||
BtnGenerarRemision.Visible = False
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
Reference in New Issue
Block a user