Ruta personalizada por Empresa

This commit is contained in:
2021-07-31 09:54:05 -07:00
parent d59dc01317
commit fbde0a2e58
79 changed files with 2710 additions and 2685 deletions

View File

@@ -6949,6 +6949,11 @@ Partial Class Ventas
GvPS.Rows(e.NewEditIndex).FCDropDownList("DdlUnidadMedida").Enabled = False
GvPS.Rows(e.NewEditIndex).FCDropDownList("DdlClasificacion").Enabled = False
End If
If GvPS.Rows(e.NewEditIndex).DataKey("CvePromocionDetalle").ToString().ToEntero() > 0 Then
GvPS.Rows(e.NewEditIndex).FCTextBox("TxtDescuento").Enabled = False
GvPS.Rows(e.NewEditIndex).FCTextBox("TxtDescuento").ToolTip = "No se puede editar el descuento porque viene de una promoción"
End If
End Sub
Protected Sub GvPS_RowCancelingEdit(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvPS.RowCancelingEdit
GvPS.EditIndex = -1
@@ -6971,7 +6976,7 @@ Partial Class Ventas
Exit Sub
End If
If UsuarioActual.CveEmpresa = 140 Then
If UsuarioActual.CveEmpresa = 140 OrElse DtPromociones IsNot Nothing AndAlso DtPromociones.Rows.Count > 0 Then
ObjDescuento = CalcularDescuentos(TmpDT.Rows(e.RowIndex)("CvePS").ToString().ToEntero(), Cantidad, PU)
End If
@@ -7214,6 +7219,10 @@ Partial Class Ventas
TmpDT.Rows(e.RowIndex)("PorcentajeRetISR") = ClienteRetISR
TmpDT.Rows(e.RowIndex)("CuentaPredial") = CuentaPredial
If ObjDescuento IsNot Nothing Then
TmpDT.Rows(e.RowIndex)("CvePromocionDetalle") = ObjDescuento.CvePromocionDetalle
End If
If GvPS.Rows(e.RowIndex).FCDropDownList("DdlProyecto").Items.Count = 0 Then
TmpDT.Rows(e.RowIndex)("Proyecto") = "Sin Proyecto Asignado"
TmpDT.Rows(e.RowIndex)("CveSubProyecto") = -1
@@ -8442,7 +8451,7 @@ Partial Class Ventas
Try
Dim DirectoriArchivoXML As String = System.IO.Path.Combine(ModExtensiones.DirectorioBaseEmpresas, "Empresas", UsuarioActual.CveEmpresa.ToString(), ObjFactura.TipoDocto)
Dim DirectoriArchivoXML As String = String.Format("{0}{1}", UsuarioActual.Empresa.Ruta, ObjFactura.TipoDocto) ' System.IO.Path.Combine()
If Not Directory.Exists(DirectoriArchivoXML) Then
Directory.CreateDirectory(DirectoriArchivoXML)
End If
@@ -13727,7 +13736,7 @@ Partial Class Ventas
End If
If UsuarioActual.Empresa.CvePlataforma = 2 Then
PdfFacturaPyME(ObjFactura, TmpDT)
PdfFacturaPyME(ObjFactura, TmpDT, False)
Else
'REINICIA VALORES DE CONVERSION DE MONEDA
@@ -13779,7 +13788,7 @@ Partial Class Ventas
End Select
ImprimirbytesPDF(PdfFactura(ObjFactura), "Factura", "PDF")
ImprimirbytesPDF(PdfFactura(ObjFactura, Guardar:=False), "Factura", "PDF")
Select Case ConversionRemision
Case "*"
@@ -16694,11 +16703,11 @@ Partial Class Ventas
Dim dr As DataRow = Nothing
If DtPromociones IsNot Nothing AndAlso DtPromociones.Rows.Count > 0 Then
dr = DtPromociones.FiltroPrimero(String.Format("CvePS = {0} AND (CveSubProyecto = {1} OR CveSubProyecto IS NULL) AND (CveRinTamaño = {2} OR CveRinTamaño IS NULL) AND ((TipoPromocion <> 3 AND (CantidadMinima <= {3} OR CantidadMinima IS NULL)) OR (TipoPromocion = 3 AND CantidadMinima <= {3} ))", CvePS, DdlSubProyectoDatos.SelectedValue, CveRinTamañoPS, TxtCantidad.Text), Orderby:="CantidadMinima desc ")
dr = DtPromociones.FiltroPrimero(String.Format("CvePS = {0} AND (CveSubProyecto = {1} OR CveSubProyecto IS NULL) AND (CveRinTamaño = {2} OR CveRinTamaño IS NULL) AND ((TipoPromocion <> 3 AND (CantidadMinima <= {3} OR CantidadMinima IS NULL)) OR (TipoPromocion = 3 AND CantidadMinima <= {3} ))", CvePS, DdlSubProyectoDatos.SelectedValue, CveRinTamañoPS, Cantidad), Orderby:="CantidadMinima desc ")
If dr Is Nothing Then
'verifica marca, si tiene asignada la promocion
dr = DtPromociones.FiltroPrimero(String.Format("CvePS IS NULL AND CveClasificacion = {0} AND (CveMarca = {1} OR CveMarca IS NULL) AND (CveSubProyecto = {2} OR CveSubProyecto IS NULL) AND (CveRinTamaño = {3} OR CveRinTamaño IS NULL) AND ((TipoPromocion <> 3 AND (CantidadMinima <= {4} OR CantidadMinima IS NULL)) OR (TipoPromocion = 3 AND CantidadMinima <= {4} )) ", CveClasifPS, CveMarcaPS, DdlSubProyectoDatos.SelectedValue, CveRinTamañoPS, TxtCantidad.Text), Orderby:="CantidadMinima desc")
dr = DtPromociones.FiltroPrimero(String.Format("CvePS IS NULL AND CveClasificacion = {0} AND (CveMarca = {1} OR CveMarca IS NULL) AND (CveSubProyecto = {2} OR CveSubProyecto IS NULL) AND (CveRinTamaño = {3} OR CveRinTamaño IS NULL) AND ((TipoPromocion <> 3 AND (CantidadMinima <= {4} OR CantidadMinima IS NULL)) OR (TipoPromocion = 3 AND CantidadMinima <= {4} )) ", CveClasifPS, CveMarcaPS, DdlSubProyectoDatos.SelectedValue, CveRinTamañoPS, Cantidad), Orderby:="CantidadMinima desc")
End If
End If
@@ -16714,7 +16723,7 @@ Partial Class Ventas
TipoAplicacion = dr("TipoAplicacion").ToString().ToEntero()
If CantMinima > 0 Then
Cant = Math.Floor(TxtCantidad.Text.ToDecimal / CantMinima).ToEntero()
Cant = Math.Floor(Cantidad / CantMinima).ToEntero()
End If
End If
@@ -21517,7 +21526,7 @@ Partial Class Ventas
Dim RFC As String = ""
Dim XMLDoc As New XmlDocument
Dim Archivo As String = String.Format("{0}Empresas\{1}\Ventas\{2}\{3}", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, Request("RFC"), $"{Request("CveFactura")}.xml")
Dim Archivo As String = String.Format("{0}Ventas\{1}\{2}", UsuarioActual.Empresa.Ruta, Request("RFC"), $"{Request("CveFactura")}.xml")
If IO.File.Exists(Archivo) Then
Dim Validada As Boolean = True
@@ -22987,7 +22996,7 @@ Partial Class Ventas
RequiereAlmacenOrigen = True
DdlAlmacenOrigen.Items.Clear()
DdlAlmacenOrigen.Items.Insert(0, New ListItem(" Seleccione ", "-1"))
DdlAlmacenOrigen.SelectedValue = "-1"
DdlAlmacenOrigen.SelectedValueExist("-1")
DdlAlmacenOrigen.DataBind()
DdlAlmacenOrigen.Items.Insert(0, New ListItem("Almacen", DbRowVenta("CveAlmacenTraspasoDestino").ToString()))
DdlAlmacenOrigen.SelectedValueExist(DbRowVenta("CveAlmacenTraspasoDestino").ToString())
@@ -30052,7 +30061,7 @@ Partial Class Ventas
For Each drow As DataRow In factura.DtDetalle.Rows
If drow("CveTamaño").ToString.ToEntero > 0 And (CvePSPSA <> drow("CvePS").ToString.ToEntero) Then
If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, drow("Cantidad").ToString.ToEntero, drow("CveTamaño").ToString.ToEntero, CveConcepto, factura.CveVenta, UsuarioActual.CveUsuario,
If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, drow("Cantidad").ToString.ToDecimal, drow("CveTamaño").ToString.ToEntero, CveConcepto, factura.CveVenta, UsuarioActual.CveUsuario,
UsuarioActual.CveEmpresa, 0D, "") Then
Resultado = False
Exit For
@@ -31939,8 +31948,7 @@ Partial Class Ventas
Adjunto = String.Format("{0}-{1}.{2}", LblSerie.Text, TxtFolio.Text, FileExtension)
Dim objVentas As New ClsVentas
Dim Path As String
Path = Extensiones.DirectorioBaseEmpresas
Path += String.Format("Empresas/{0}/Ventas", UsuarioActual.CveEmpresa)
Path = String.Format("{0}Ventas", UsuarioActual.Empresa.Ruta)
If Not Directory.Exists(Path) Then
Directory.CreateDirectory(Path)
End If
@@ -31967,8 +31975,7 @@ Partial Class Ventas
Protected Sub BtnArchivoAdjunto_Click(sender As Object, e As System.EventArgs) Handles BtnArchivoAdjunto.Click
Dim ruta As String = HttpContext.Current.Request.ApplicationPath
ruta = Extensiones.DirectorioBaseEmpresas
ruta += String.Format("Empresas/{0}/Ventas", UsuarioActual.CveEmpresa)
ruta = String.Format("{0}Ventas", UsuarioActual.Empresa.Ruta)
ruta += $"/{Adjunto}"
Dim Archivo As New System.IO.FileInfo(ruta)
@@ -32003,7 +32010,7 @@ Partial Class Ventas
Protected Sub BtnEliminarAdjunto_Click(sender As Object, e As System.EventArgs) Handles BtnEliminarAdjunto.Click
Dim objVentas As New ClsVentas
Dim Path As String
Path = String.Format("{0}Empresas/{1}/Ventas/{2}", Extensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, Adjunto)
Path = String.Format("{0}Ventas/{1}", UsuarioActual.Empresa.Ruta, Adjunto)
If File.Exists(Path) Then
File.Delete(Path)
End If