-- cambios
This commit is contained in:
@@ -23,6 +23,7 @@ Partial Class Ventas
|
||||
|
||||
Dim ColumnaDescuento As Integer = 10
|
||||
Dim ColumnaPredial As Integer = 11
|
||||
Dim ColumnaSubProyecto As Integer = 8
|
||||
Dim ColumnaIVA As Integer = 12
|
||||
Dim ColumnaIEPS As Integer = 13
|
||||
Dim ColumnaRetIVA As Integer = 14
|
||||
@@ -2293,31 +2294,6 @@ Partial Class Ventas
|
||||
End Property
|
||||
#End Region
|
||||
|
||||
'#Region "AuxiliarConta"
|
||||
' Property CvePrePolizaNegativa As Integer
|
||||
' Get
|
||||
' If ViewState("CvePrePolizaNegativa") Is Nothing Then
|
||||
' Return -1
|
||||
' Else
|
||||
' Return ViewState("CvePrePolizaNegativa").ToString.ToEntero
|
||||
' End If
|
||||
|
||||
' End Get
|
||||
' Set(value As Integer)
|
||||
' ViewState("CvePrePolizaNegativa") = value
|
||||
' End Set
|
||||
' End Property
|
||||
|
||||
' Private Property DTDatos As DataTable
|
||||
' Get
|
||||
' Return CType(ViewState("DTDatos"), DataTable)
|
||||
' End Get
|
||||
' Set(value As DataTable)
|
||||
' ViewState("DTDatos") = value
|
||||
' End Set
|
||||
' End Property
|
||||
'#End Region
|
||||
|
||||
#Region " A C U M U L A D O R E S"
|
||||
|
||||
Private Property ClienteEsDistribuidor As Boolean
|
||||
@@ -2477,9 +2453,16 @@ Partial Class Ventas
|
||||
DdlTipoComprobante.Items.Insert(DdlTipoComprobante.Items.Count, New ListItem("Autorización", "PA"))
|
||||
End If
|
||||
|
||||
If Not UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
|
||||
If Not (UsuarioActual.Empresa.Funcionalidad(558) = "1") Then '
|
||||
LnkAgregarCliente.Visible = False
|
||||
End If
|
||||
If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
|
||||
LnkAgregarCliente.Visible = True
|
||||
'ocultar la columna de subproyecto
|
||||
GvPS.Columns(ColumnaSubProyecto).Visible = False
|
||||
ThProyecto.Visible = False
|
||||
ThProyecto2.Visible = False
|
||||
End If
|
||||
|
||||
DdlTipoComprobante.Items.Insert(DdlTipoComprobante.Items.Count, New ListItem("Pedido", "Ped"))
|
||||
|
||||
@@ -2600,12 +2583,10 @@ Partial Class Ventas
|
||||
CargaMonedas()
|
||||
CargaVendedores()
|
||||
CargarAlmacenes()
|
||||
CargaFormaEntrega()
|
||||
'CargaFormaEntrega()
|
||||
CargaCuentasTerminal()
|
||||
CargaDdlNCPS()
|
||||
'CargaDdlNCPS()
|
||||
CargarCamiones()
|
||||
|
||||
|
||||
CargaMedicos()
|
||||
CargaProcedimientos()
|
||||
CargaDdlClientes()
|
||||
@@ -2775,17 +2756,9 @@ Partial Class Ventas
|
||||
|
||||
ImgAddObs.Visible = True
|
||||
CargaEventoBitacora()
|
||||
|
||||
ConfiguraTipoDocto()
|
||||
|
||||
TrFolioFiscal.Visible = True
|
||||
|
||||
' Si esta cancelado el compromiso/Pedido no se puede editar el estatus
|
||||
'If DdlEstatus.SelectedValue.Contiene({"9", "14", "17"}) Then
|
||||
' DdlEstatus.Enabled = False
|
||||
'End If
|
||||
|
||||
'CargaDetalle de Almacen
|
||||
'PERMISO PARA CANCELAR PEDIDO
|
||||
If GvInv.Rows.Count = 0 Then
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Ped") And Not CveEstatus = 14 Then
|
||||
@@ -2809,16 +2782,6 @@ Partial Class Ventas
|
||||
LnkImprimirFormatoTelcel.Visible = True
|
||||
End If
|
||||
|
||||
'If UsuarioActual.TienePermisoProceso(269) AndAlso Not DevolucionAlmacen = 2 Then
|
||||
' Dim ObjInventario As New ClsInventarios
|
||||
' If ObjInventario.GetInv_Mov(CveVenta, UsuarioActual.CveEmpresa) Then
|
||||
' If ObjInventario.DtResultados.Rows.Count > 0 Then
|
||||
' DivDevAlm.Visible = True
|
||||
' End If
|
||||
' End If
|
||||
' ObjInventario.Dispose()
|
||||
'End If
|
||||
|
||||
If DdlTipoComprobante.SelectedValue = "Ing" Then
|
||||
CargaVentaCortePorte(Me.CveVenta)
|
||||
End If
|
||||
@@ -3026,6 +2989,7 @@ Partial Class Ventas
|
||||
CveEstatus = 2
|
||||
End If
|
||||
End If
|
||||
BtnAdjuntar.Visible = True
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -3212,7 +3176,7 @@ Partial Class Ventas
|
||||
TabDetalleVentas.Visible = False
|
||||
'TabE.Visible = False
|
||||
LnkOCs.Visible = False
|
||||
GvPS.Columns(8).Visible = False
|
||||
GvPS.Columns(ColumnaSubProyecto).Visible = False
|
||||
DdlSubProyecto.Visible = False
|
||||
TrEdit.Visible = True
|
||||
|
||||
@@ -3236,7 +3200,6 @@ Partial Class Ventas
|
||||
ThProyecto.Visible = False
|
||||
For Each Gvr As GridViewRow In GvPS.Rows
|
||||
Gvr.FCLinkButton("imgE").Visible = False
|
||||
Gvr.FCLinkButton("imgEPyME").Visible = True
|
||||
Next
|
||||
LnkAddVenta.Visible = True
|
||||
End If
|
||||
@@ -4753,12 +4716,6 @@ Partial Class Ventas
|
||||
BtnArchivoAdjunto.Visible = True
|
||||
BtnEliminarAdjunto.Visible = False
|
||||
BtnAdjuntar.Visible = False
|
||||
|
||||
tdAdjuntar.Style.Item("display") = "none"
|
||||
tdAdjunto.Style.Item("display") = "block"
|
||||
|
||||
Else
|
||||
DivAdjuntar.Visible = False
|
||||
End If
|
||||
|
||||
ViewState("CveSubProyectoVenta") = DbRowVenta("CveSubProyecto").ToString().ToEntero()
|
||||
@@ -7806,19 +7763,19 @@ Partial Class Ventas
|
||||
End Sub
|
||||
|
||||
Private Sub CargaProcedimientos()
|
||||
DdlMedico.DataSource = GlobalDTMedicos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ")
|
||||
DdlMedico.DataBind()
|
||||
|
||||
DdlMedicoModal.DataSource = GlobalDTMedicos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ")
|
||||
DdlMedicoModal.DataBind()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaMedicos()
|
||||
DdlProcedimiento.DataSource = GlobalDTProcedimientos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ")
|
||||
DdlProcedimiento.DataBind()
|
||||
|
||||
DdlProcedimientoModal.DataSource = GlobalDTProcedimientos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ")
|
||||
DdlProcedimientoModal.DataBind()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaMedicos()
|
||||
DdlMedico.DataSource = GlobalDTMedicos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ")
|
||||
DdlMedico.DataBind()
|
||||
|
||||
DdlMedicoModal.DataSource = GlobalDTMedicos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ")
|
||||
DdlMedicoModal.DataBind()
|
||||
|
||||
End Sub
|
||||
|
||||
@@ -7954,7 +7911,7 @@ Partial Class Ventas
|
||||
|
||||
Dim CveSATNC As String = "84111506"
|
||||
Dim dtt As New DataTable
|
||||
dtt = GlobalDTPS(UsuarioActual.CveEmpresa, SATClavePS:=CveSATNC, AplicaParaVenta:=1) ', SATClavePS:=CveSATNC
|
||||
dtt = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CodigoSATPS:=CveSATNC, AplicaParaVenta:=1) ', SATClavePS:=CveSATNC
|
||||
|
||||
If dtt IsNot Nothing Then
|
||||
DdlNCPS.DataSource = dtt
|
||||
@@ -15177,21 +15134,27 @@ Partial Class Ventas
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoInventario, UsuarioActual.CveEmpresa) Then
|
||||
DtCostos = ObjInventario.DtResultados
|
||||
TotalCosto = DtCostos.SUMD("Total").RoundSQL
|
||||
Dim tmpCostos As DataTable = DtCostos.FiltraParametros("", "", {"CveClasificacion"})
|
||||
'Dim tmpCostos As DataTable = DtCostos.FiltraParametros("", "", {"CveClasificacion", "CveSubProyecto", "SubProyecto"})
|
||||
Dim GroupBycostos As String() = {"CveClasificacion", "CveSubProyecto", "SubProyecto"}
|
||||
Dim tmpCostos As DataTable = DtCostos.GroupByDT("", "", {GroupBycostos}, SumColumns:={"Total"}).FiltraParametros("GroupADSType = 1")
|
||||
|
||||
If tmpCostos.Rows.Count > 0 Then
|
||||
Dim TotalCostoAcumulado As Decimal = 0
|
||||
Dim cont As Integer = 1
|
||||
Dim tCveSubProyecto As Integer = factura.CveSubProyecto
|
||||
'Se agrega movimiento separado por la cuenta de ventas (ER)
|
||||
For Each RowInv As DataRow In tmpCostos.Rows
|
||||
ValorInventario = DtCostos.SUMD("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").RoundSQL
|
||||
ValorInventario = RowInv("Total").ToString.ToDecimal.RoundSQL
|
||||
'ValorInventario =tmpCostos.SUMD("") 'DtCostos.SUMD("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").RoundSQL
|
||||
TotalCostoAcumulado += ValorInventario
|
||||
If UsuarioActual.CveEmpresa <> 119 Then tCveSubProyecto = RowInv("CveSubProyecto").ToString.ToEntero()
|
||||
|
||||
'cuando es el último movimiento y hay diferencias en los importes
|
||||
If cont = tmpCostos.Rows.Count AndAlso TotalCosto <> TotalCostoAcumulado Then
|
||||
ValorInventario = ValorInventario + (TotalCosto - TotalCostoAcumulado)
|
||||
End If
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, TipoMovto69, ValorInventario, ValorInventario, 69, factura.SerieFolio, factura.SerieFolio, CveVenta:=factura.CveVenta, CveCliente:=factura.CveCliente, CveSubProyecto:=factura.CveSubProyecto, CveClasificacion:=RowInv("CveClasificacion").ToString().ToEntero(), CveMovimientoAlmacen:=CveMovimientoInventario) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, TipoMovto69, ValorInventario, ValorInventario, 69, factura.SerieFolio, factura.SerieFolio, CveVenta:=factura.CveVenta, CveCliente:=factura.CveCliente, CveSubProyecto:=tCveSubProyecto, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero(), CveMovimientoAlmacen:=CveMovimientoInventario) Then
|
||||
OcurrioError = True
|
||||
End If
|
||||
|
||||
@@ -26938,11 +26901,6 @@ Partial Class Ventas
|
||||
LnkAplicarRNCDevolucion.Visible = True
|
||||
End If
|
||||
'LkNotaCredito.Visible = False
|
||||
DivGvCxC.Visible = True
|
||||
CargaCxC()
|
||||
'CARGAR RNC
|
||||
RblRNCTipo_SelectedIndexChanged(RblRNCTipo, EventArgs.Empty)
|
||||
|
||||
TxtNCPorcentaje.Attributes.Add("onkeyup", "CalculaImporteNCMasivo();")
|
||||
TxtNCImporte.Text = "0.00"
|
||||
TxtNCImporte.Enabled = False
|
||||
@@ -26964,6 +26922,7 @@ Partial Class Ventas
|
||||
End If
|
||||
ObjMovtos.Dispose()
|
||||
GvCxC.DataBind()
|
||||
UpAplicarNC.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub RblRNCTipo_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
@@ -31984,27 +31943,16 @@ Partial Class Ventas
|
||||
HabilitarControlesCartaPorte(True)
|
||||
End If
|
||||
|
||||
If DivAdjuntar.Visible Then
|
||||
Dim FolioNuevo As String = TxtFolio.Text
|
||||
If FolioNuevo <> FolioOriginal Then
|
||||
If Adjunto <> "" Then
|
||||
Adjunto = ""
|
||||
BtnArchivoAdjunto.Text = ""
|
||||
BtnArchivoAdjunto.Visible = False
|
||||
BtnEliminarAdjunto.Visible = False
|
||||
BtnAdjuntar.Visible = True
|
||||
|
||||
tdAdjuntar.Style.Item("display") = "block"
|
||||
tdAdjunto.Style.Item("display") = "none"
|
||||
Else
|
||||
DivAdjuntar.Visible = True
|
||||
End If
|
||||
Else
|
||||
DivAdjuntar.Visible = False
|
||||
Dim FolioNuevo As String = TxtFolio.Text
|
||||
If FolioNuevo <> FolioOriginal Then
|
||||
If Adjunto <> "" Then
|
||||
Adjunto = ""
|
||||
BtnArchivoAdjunto.Text = ""
|
||||
BtnArchivoAdjunto.Visible = False
|
||||
BtnEliminarAdjunto.Visible = False
|
||||
BtnAdjuntar.Visible = True
|
||||
End If
|
||||
UpAdjuntar.Update()
|
||||
Else
|
||||
DivAdjuntar.Visible = True
|
||||
End If
|
||||
|
||||
'REMOVER EVENTO PARA RECARGAR ALMACEN
|
||||
@@ -32836,10 +32784,10 @@ Partial Class Ventas
|
||||
Dim ArrayNC As String() = UsuarioActual.Empresa.Funcionalidad(591).Split(",".ToCharArray())
|
||||
If ArrayNC.Length >= 4 Then
|
||||
Dim CvePSNC As Integer = ArrayNC(3).ToEntero()
|
||||
DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSNC, AplicaParaVenta:=1).FiltroPrimero("")
|
||||
DrPS = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=CvePSNC, AplicaParaVenta:=1).FiltroPrimero("")
|
||||
Else
|
||||
Dim CveSATNC As String = "84111506"
|
||||
DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, SATClavePS:=CveSATNC, AplicaParaVenta:=1).Rows(0)
|
||||
DrPS = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CodigoSATPS:=CveSATNC, AplicaParaVenta:=1).Rows(0)
|
||||
End If
|
||||
|
||||
If DrPS Is Nothing Then
|
||||
@@ -34408,9 +34356,6 @@ Partial Class Ventas
|
||||
BtnArchivoAdjunto.Text = Adjunto
|
||||
BtnArchivoAdjunto.Visible = True
|
||||
BtnEliminarAdjunto.Visible = True
|
||||
tdAdjuntar.Style.Item("display") = "none"
|
||||
tdAdjunto.Style.Item("display") = "block"
|
||||
UpAdjuntar.Update()
|
||||
Alert("Documento cargado", TipoMensaje.MsgInformacion)
|
||||
objVentas.Dispose()
|
||||
|
||||
@@ -34462,12 +34407,9 @@ Partial Class Ventas
|
||||
File.Delete(Path)
|
||||
End If
|
||||
BtnAdjuntar.Visible = True
|
||||
tdAdjuntar.Style.Item("display") = "block"
|
||||
BtnArchivoAdjunto.Text = ""
|
||||
BtnArchivoAdjunto.Visible = False
|
||||
tdAdjunto.Style.Item("display") = "none"
|
||||
BtnEliminarAdjunto.Visible = False
|
||||
UpAdjuntar.Update()
|
||||
End Sub
|
||||
Protected Sub LnkSolicitarCredito_Click(sender As Object, e As EventArgs) Handles LnkSolicitarCredito.Click
|
||||
If CveCliente <= 0 Then
|
||||
@@ -36256,7 +36198,13 @@ Partial Class Ventas
|
||||
|
||||
'End Sub
|
||||
|
||||
|
||||
|
||||
Protected Sub LBNotaCredito_Click(sender As Object, e As EventArgs)
|
||||
CargaDdlNCPS()
|
||||
DivGvCxC.Visible = True
|
||||
CargaCxC()
|
||||
'CARGAR RNC
|
||||
RblRNCTipo_SelectedIndexChanged(RblRNCTipo, EventArgs.Empty)
|
||||
RegistraScript("$('#ModalAplicarNC').modal('show');", "ModalNC")
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user