foliado en cotizacion.

registra en prepoliza si el inventario = 0
This commit is contained in:
2020-12-24 11:17:12 -07:00
parent 3c4953095f
commit df50f31641

View File

@@ -2582,7 +2582,7 @@ Partial Class Ventas
'DdlEstatus.SelectedValueExist("2")
ConfiguraTipoDocto()
CargaFolios()
BtnEmitirImprimir.Text = "Facturar"
BtnEmitirImprimir.Visible = True
@@ -2615,6 +2615,7 @@ Partial Class Ventas
End If
If Not ExFolioFactura Then SetPermisos()
If CveVenta < 1 Then CargaFolios()
'SELECCIONA VENDEDOR DEL USUARIO CUANDO SEA VENTA NUEVA Y SIN CLIENTE
If UsuarioActual.CveVendedor > 0 Then
@@ -5894,7 +5895,7 @@ Partial Class Ventas
LnkCotizaciones.Visible = False
End If
UPCondicionesPago.Update()
ElseIf UsuarioActual.CveEmpresa.Contiene(72, 80, 146, 119, 140, 158) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem", "Cot", "PA") AndAlso CveVenta < 1 Then
ElseIf UsuarioActual.CveEmpresa.Contiene(72, 80, 146, 119, 158, 140) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem", "Cot", "PA") AndAlso CveVenta < 1 Then
RBLPago.SelectedValue = "1"
RBLPago_SelectedIndexChanged(Nothing, Nothing)
UPCondicionesPago.Update()
@@ -5991,7 +5992,7 @@ Partial Class Ventas
LnkOCs.Visible = False
Else
If Alertas Then Alert("El cliente tiene su límite de crédito agotado.", TipoMensaje.MsgAdvertencia)
If Alertas AndAlso UsuarioActual.Empresa.Funcionalidad(518) = "1" Then Alert("El cliente tiene su límite de crédito agotado.", TipoMensaje.MsgAdvertencia)
End If
End If
UPPCreditoDisponible.Update()
@@ -12798,23 +12799,23 @@ Partial Class Ventas
'Concepto = String.Format("{0} - {1}", Row2("Clasificacion").ToString(), Row2("SubProyecto").ToString())
IdCtaContable = GlobalDTClasificaciones(factura.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
CveCuenta = GlobalDTClasificaciones(factura.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
If ValorInventario <> 0 Then
' CveCuenta = GlobalDTClasificaciones(factura.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
'If ValorInventario <> 0 Then
If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, TipoMovto69, ValorInventario, factura.SerieFolio, 69, factura.SerieFolio, factura.Fecha, IdCtaContable, -1, CveVenta:=factura.CveVenta, CveCliente:=factura.CveCliente, CveSubProyecto:=factura.CveSubProyecto, CveClasificacion:=RowInv("CveClasificacion").ToString().ToEntero(), CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=ValorInventario, CveCuenta:=CveCuenta) Then
OcurrioError = True
End If
If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, TipoMovto69, ValorInventario, factura.SerieFolio, 69, factura.SerieFolio, factura.Fecha, IdCtaContable, -1, CveVenta:=factura.CveVenta, CveCliente:=factura.CveCliente, CveSubProyecto:=factura.CveSubProyecto, CveClasificacion:=RowInv("CveClasificacion").ToString().ToEntero(), CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=ValorInventario, CveCuenta:=CveCuenta) Then
OcurrioError = True
End If
'End If
cont += 1
Next
End If
IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", CveAlmacen)).ToEntero()
If TotalCosto <> 0 Then
If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, TipoMovto68, TotalCosto, factura.SerieFolio, 68, factura.SerieFolio, factura.Fecha, IdCtaContable, -1, CveVenta:=factura.CveVenta, CveCliente:=factura.CveCliente, CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=TotalCosto, CveCuenta:=CveCuenta, CveSubProyecto:=factura.CveSubProyecto) Then
'If TotalCosto <> 0 Then
If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, TipoMovto68, TotalCosto, factura.SerieFolio, 68, factura.SerieFolio, factura.Fecha, IdCtaContable, -1, CveVenta:=factura.CveVenta, CveCliente:=factura.CveCliente, CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=TotalCosto, CveCuenta:=CveCuenta, CveSubProyecto:=factura.CveSubProyecto) Then
OcurrioError = True
End If
End If
'End If
Else
OcurrioError = True
@@ -15424,7 +15425,7 @@ Partial Class Ventas
UpnTools.Update()
tdTelefonoGen.Visible = False
tdTxtTelefonoGen.Visible = False
If UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 122, 145) Then
If UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 122, 145, 140) Then
ChkEnviarFactura.Checked = False
End If
@@ -15817,13 +15818,13 @@ Partial Class Ventas
If TmpDT IsNot Nothing AndAlso TmpDT.Rows.Count > 0 AndAlso (Not CveVenta > 0 Or EsCreaApartirDe Or CveDevolucion > 0) Then RecalculaIVA()
'ViewState("SubProyectoPorcentajeIVA") = dr("IVA")
ViewState("TipoFormato") = dr("TipoFormato")
ViewState("Serie") = dr("Serie")
'ViewState("Serie") = dr("Serie")
If UsuarioActual.CveEmpresa = 140 AndAlso Me.CveVenta > 0 AndAlso Not EsCreaApartirDe AndAlso Not String.IsNullOrEmpty(SerieVenta) Then
LblSerie.Text = SerieVenta
Else
LblSerie.Text = dr("Serie").ToString()
End If
'If UsuarioActual.CveEmpresa = 140 AndAlso Me.CveVenta > 0 AndAlso Not EsCreaApartirDe AndAlso Not String.IsNullOrEmpty(SerieVenta) Then
' LblSerie.Text = SerieVenta
'Else
' LblSerie.Text = dr("Serie").ToString()
'End If
If SerieXML <> "" Then LblSerie.Text = SerieXML
Dim CveSubProyecto As Integer = GetSubProyectoSucursal()