This commit is contained in:
2024-12-13 11:20:05 -07:00
17 changed files with 3677 additions and 1414 deletions

View File

@@ -1530,13 +1530,14 @@ Public Class ClsInventarios
Return Retorno
End Function
Public Function GetRepResumenMovimientosDiario(Fecha As Date, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
Public Function GetRepResumenMovimientosDiario(Fecha As Date, CveUsuario As Integer, CveEmpresa As Integer, CveAlmacen As Integer) As Boolean
Dim retorno As Boolean = False
DataAdapter("PA_Inv_RepResumenMovimientosDiarioGet", CommandType.StoredProcedure)
With SqlAdapter.SelectCommand.Parameters
.Add("@Fecha", SqlDbType.Date).Value = Fecha
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen
End With
Try
SqlAdapter.Fill(Data)

View File

@@ -715,7 +715,7 @@ Public Class ClsOC
Optional PorcentajeIVA As Decimal = 0.16D, Optional IVA As Decimal = 0, Optional RetIVA As Decimal = 0, Optional RetISR As Decimal = 0, Optional FechaExpiracion As Date = Nothing, Optional CveCotizacion As Integer = -1,
Optional FolioAdicional As String = "", Optional EntregaDirecta As Integer = -1, Optional CveDireccionEnvio As Integer = -1, Optional Guia As String = "-1", Optional IEPS As Decimal = -1,
Optional CveIEAnticipo As Integer = -1, Optional ImporteAnticipo As Decimal = 0, Optional UsoCFDI As Integer = -1, Optional Promocion As String = "-1", Optional CveProveedorContacto As Integer = -1, Optional NumRemision As String = "-1",
Optional CveColectiva As Integer = -1, Optional MetodoPago As Integer = -1, Optional CveSubProyectoEntrega As Integer = -1, Optional PorcentajeProntoPago As Decimal = 0) As Boolean
Optional CveColectiva As Integer = -1, Optional MetodoPago As Integer = -1, Optional CveSubProyectoEntrega As Integer = -1, Optional PorcentajeProntoPago As Decimal = 0, Optional EsTemporal As Boolean = False) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_OC_OrdenesCompraAdd")
@@ -763,6 +763,8 @@ Public Class ClsOC
.Add("@MetodoPago", SqlDbType.Int).Value = MetodoPago ' 0 Contado, 1 Credito
.Add("@CveSubProyectoEntrega", SqlDbType.Int).Value = CveSubProyectoEntrega ' 0 Contado, 1 Credito
.Add("@PorcentajeProntoPago", SqlDbType.Decimal).Value = PorcentajeProntoPago
.Add("@EsTemporal", SqlDbType.Bit).Value = EsTemporal
.Add("@vCveOrdenCompra", SqlDbType.Int).Direction = ParameterDirection.Output
.Add("@vFolio", SqlDbType.Int).Direction = ParameterDirection.Output

View File

@@ -4599,12 +4599,14 @@ Public Class ClsVentas
Public Function GetRepPSPeriodo(FechaI As Date, FechaF As Date, FechaIEjec As Date, FechaFEjec As Date, CveCliente As Integer, CveSubProyectoEjecucion As Integer,
CveVendedor As Integer, CveUsuario As Integer, CveEstatus As Integer, IVA As String, CveEmpresa As Integer, Gpo As Integer, Optional TipoDocto As String = "-1",
Optional CveProyecto As Integer = -1, Optional CveSubProyecto As Integer = -1, Optional TipoCambio As Integer = 1, Optional TCEspecifico As Decimal = -1,
Optional CveUsuarioConsulta As Integer = -1, Optional VerEn As Integer = -1, Optional CvePS As Integer = -1, Optional CveClasificacion As Integer = -1,
Optional CveCategoria As Integer = -1, Optional TipoFecha As Integer = 1, Optional CveClienteClasificacion As Integer = -1, Optional ModalidadContable As Boolean = False) As Boolean
CveVendedor As Integer, CveUsuario As Integer, CveEstatus As Integer, IVA As String, CveEmpresa As Integer, Gpo As Integer, Optional TipoDocto As String = "-1",
Optional CveProyecto As Integer = -1, Optional CveSubProyecto As Integer = -1, Optional TipoCambio As Integer = 1, Optional TCEspecifico As Decimal = -1,
Optional CveUsuarioConsulta As Integer = -1, Optional VerEn As Integer = -1, Optional CvePS As Integer = -1, Optional CveClasificacion As Integer = -1,
Optional CveCategoria As Integer = -1, Optional TipoFecha As Integer = 1, Optional CveClienteClasificacion As Integer = -1, Optional ModalidadContable As Boolean = False,
Optional OpVista As Integer = 1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_VentasGetRepPeriodoPS")
SqlAdapter.SelectCommand.CommandTimeout = 0
With SqlAdapter.SelectCommand.Parameters
'.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
.Add("@FechaI", SqlDbType.Date).Value = FechaI
@@ -4632,6 +4634,7 @@ Public Class ClsVentas
.Add("@TipoFecha", SqlDbType.Int).Value = TipoFecha
.Add("@CveClienteClasificacion", SqlDbType.Int).Value = CveClienteClasificacion
.Add("@ModalidadContable", SqlDbType.Bit).Value = ModalidadContable
.Add("@OpVista", SqlDbType.Int).Value = OpVista
End With
Try
SqlAdapter.Fill(Data)

View File

@@ -7395,6 +7395,7 @@ Partial Class Compras_Compras
End If
End If
Pago.OtroGastoIngreso = -ImporComisionAnticipo
ErrorPrepoliza = AplicaPrePolizaPagoCompra(CompraActual, Pago, CvePrePoliza, ObjConta)

View File

@@ -155,6 +155,12 @@
<asp:GridView ID="GvDatos" CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn"
runat="server" GridLines="None" EmptyDataText="No se encontraron cuentas con los parametros establecidos." AutoGenerateColumns="False" OnRowDataBound="GvIngresos_RowDataBound">
<Columns>
<asp:TemplateField HeaderText="Nivel" >
<ItemTemplate>
<asp:Label ID="LblNivelSAT" runat="server" Text='<%# Eval("Nivel")%>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" Width="20px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Cuenta" HeaderStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LbCodigo" runat="server" Text='<%# Eval("Codigo")%>'></asp:Label>

View File

@@ -155,10 +155,13 @@ Partial Class Contabilidad2_RepBalanzaComprobacion
Alert("Ocurrio un error al cargar los datos del Anexo del Catálogo", TipoMensaje.MsgError)
End If
ObjConta.Dispose()
If DdlVista.SelectedValue = "1" Then
GvDatos.Columns(6).Visible = True
GvDatos.Columns(7).Visible = True
GvDatos.Columns(0).Visible = True
Else
GvDatos.Columns(6).Visible = False
GvDatos.Columns(7).Visible = False
GvDatos.Columns(0).Visible = False
End If
CargaGrid()
@@ -220,7 +223,7 @@ Partial Class Contabilidad2_RepBalanzaComprobacion
e.Row.FCLabel("LbSaldoActual").Visible = True
e.Row.FCLabel("LbSaldoActual").Text = String.Format("{0} <br/>{1}", e.Row.DBCampo("SaldoAD").FormatoNumero, e.Row.DBCampo("SaldoAA").FormatoNumero)
Else
If ModoImpresion Then e.Row.Cells(5).Text = e.Row.FCHyperLink("HLSaldoActual").Text Else e.Row.FCHyperLink("HLSaldoActual").NavigateUrl = String.Format("/Contabilidad/RepMovimientosAuxiliaresCatalogo.aspx?CveCuenta={0}&FI={1}&FF={2}&CveProyecto={3}&CveSubProyecto={4}", e.Row.DBCampo("ID"), FechaInicio.ToShortDateString, FechaFin.ToShortDateString, CveProyecto, CveSubProyecto)
If ModoImpresion Then e.Row.Cells(6).Text = e.Row.FCHyperLink("HLSaldoActual").Text Else e.Row.FCHyperLink("HLSaldoActual").NavigateUrl = String.Format("/Contabilidad/RepMovimientosAuxiliaresCatalogo.aspx?CveCuenta={0}&FI={1}&FF={2}&CveProyecto={3}&CveSubProyecto={4}", e.Row.DBCampo("ID"), FechaInicio.ToShortDateString, FechaFin.ToShortDateString, CveProyecto, CveSubProyecto)
End If
End If
End Sub
@@ -247,8 +250,14 @@ Partial Class Contabilidad2_RepBalanzaComprobacion
End Sub
Private Sub ImprimirReporte(Optional Formato As String = "PDF")
Dim reportpath As String = "Contabilidad/Reportes/RepBalanzaComprobacion.rdlc" 'Contable
'ubicacion del rdlc
Dim reportpath As String = "Contabilidad/Reportes/RepBalanzaComprobacion.rdlc"
If DdlVista.SelectedValue.ToEntero = 1 Then 'SAT
reportpath = "Contabilidad/Reportes/RepBalanzaComprobacionSAT.rdlc" 'Contable
End If
'nombre del reporte
Dim fileName As String = "BalanzaComprobacion"
'parametros a enviar al reporte
@@ -273,6 +282,12 @@ Partial Class Contabilidad2_RepBalanzaComprobacion
Function WSDocumento(SubProyecto As String, DtDatos As DataTable) As IXLWorksheet
Dim ColumnaAumento As Integer = 0
If DdlVista.SelectedValue.ToEntero = 1 Then
ColumnaAumento = 1
End If
Dim WBAnexoSalvar = New ClosedXML.Excel.XLWorkbook
Dim WBReporte = New ClosedXML.Excel.XLWorkbook()

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -145,7 +145,7 @@
<div class="titlefiltros caption magindate">
<div class="row">
<div class="col-md-1 truncate text-right">Fecha del mes: </div>
<div class="col-md-3">
<div class="col-md-1">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 95px !important; padding: 0px;">
<asp:TextBox Style="width: 80px !important;" ID="TxtFechaMes" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
@@ -155,6 +155,13 @@
<ajax:MaskedEditExtender ID="MaskedEditExtender1" runat="server" TargetControlID="TxtFechaMes" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CalendarExtender1" TargetControlID="TxtFechaMes" PopupButtonID="ImgFechaMes" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
</div>
<label class="col-md-1 truncate text-right" runat="server">Almacén:</label>
<div class="col-md-2">
<asp:DropDownList ID="ddlAlmacen" runat="server" CssClass="select2me" DataTextField="Almacen" DataValueField="CveAlmacen"></asp:DropDownList>
</div>
</div>
</div>
</div>

View File

@@ -18,13 +18,25 @@ Partial Class Inventarios_RepResumenMovimientosDiario
End Property
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
TxtFechaMes.Text = NowADS().ToString("dd/MM/yyyy")
InicializaControles()
End If
End Sub
Private Sub InicializaControles()
ddlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1)
ddlAlmacen.DataBind()
ddlAlmacen.Items.Insert(0, New ListItem("Todos", "-1"))
TxtFechaMes.Text = NowADS().ToString("dd/MM/yyyy")
End Sub
Private Sub CargarDatos()
Dim ObjInventarios As New ClsInventarios
If ObjInventarios.GetRepResumenMovimientosDiario(TxtFechaMes.Text.ToDate, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
If ObjInventarios.GetRepResumenMovimientosDiario(TxtFechaMes.Text.ToDate, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, ddlAlmacen.SelectedValue.ToEntero) Then
DtDatos = ObjInventarios.DtResultados.Copy()
GvDatos.DataSource = DtDatos
End If

View File

@@ -320,7 +320,7 @@ Partial Class Inventarios_TrasladoSolicitud
End If
If Not GvDatos.Rows.Count > 0 Then
Alert("No se ha seleccionado ningún Producto para trasladar.", TipoMensaje.MsgAdvertencia)
Alert("No se ha seleccionado ningún producto para trasladar.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
@@ -479,6 +479,20 @@ Partial Class Inventarios_TrasladoSolicitud
Exit Sub
End If
Dim HaySeleccion As Boolean = False
For Each gvr As GridViewRow In GvSolicitudes.Rows
Dim Cantidad As Decimal = gvr.FCTextBox("TxtCantidad").Text.ToDecimal
If gvr.FCCheckBox("Chk").Checked AndAlso Cantidad > 0 Then
HaySeleccion = True
Exit For
End If
Next
If Not HaySeleccion Then
Alert("No se ha seleccionado ningún producto para trasladar.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim ErrorMovInv As Boolean = False
Dim ErrorExistencia As Boolean = False
@@ -749,8 +763,8 @@ Partial Class Inventarios_TrasladoSolicitud
If e.Row.RowType = DataControlRowType.DataRow Then
Dim PermisoOrigen As Boolean = If(e.Row.DataKey("PermisoOrigen").ToEntero = 1, True, False)
Dim PermisoDestino As Boolean = If(e.Row.DataKey("PermisoDestino").ToEntero = 1, True, False)
'Dim PermisoOrigen As Boolean = If(e.Row.DataKey("PermisoOrigen").ToEntero = 1, True, False)
'Dim PermisoDestino As Boolean = If(e.Row.DataKey("PermisoDestino").ToEntero = 1, True, False)
Dim CveMovimientoAlmacen As Integer = e.Row.DataKey("CveMovimientoAlmacen").ToEntero
Dim FolioMovimiento As Integer = e.Row.DataKey("FolioMovimiento").ToEntero
@@ -758,6 +772,9 @@ Partial Class Inventarios_TrasladoSolicitud
Dim CveMovimientoTransitorio As Integer = e.Row.DataKey("CveMovimientoTransitorio").ToEntero
Dim CveAlmacenTransitorio As Integer = e.Row.DataKey("CveAlmacenTransitorio").ToEntero
Dim PermisoOrigen As Boolean = If(GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveAlmacen = {e.Row.DataKey("CveAlmacenOrigen").ToEntero}").ToEntero > 0, True, False)
Dim PermisoDestino As Boolean = If(GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveAlmacen = {CveAlmacenDestino}").ToEntero > 0, True, False)
'Dim CveMovimientoEntrada As Integer = e.Row.DataKey("CveAlmacenTransitorio").ToEntero ' Este es el movmiento de recepcion de traspaso
e.Row.FCLinkButton("LnkMostrarTraspaso").Visible = True

View File

@@ -168,6 +168,9 @@
.select2anothertable > table > tbody > tr.active {
background-color: #5897fb;
}
#C_TrDescuentoProntoPago > td:nth-child(3) > span:nth-child(1) > label:nth-child(2){
white-space: nowrap;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="E" runat="Server">
@@ -446,7 +449,7 @@
</tr>
<tr>
<td><b>Capturó:</b></td>
<td>
<td colspan="2">
<asp:Label ID="lblNombreUsuario" runat="server"></asp:Label>
</td>
</tr>
@@ -492,15 +495,25 @@
<td>
<asp:TextBox ID="TxtDescuentoEscalonado" runat="server" Width="80px" Height="28px"></asp:TextBox>
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtDescuentoEscalonado" ValidChars="1234567890+." />
</td>
<td>
<asp:Button runat="server" ID="BtnDescuenEscalonado" Text="Aplicar" CssClass="btn btn-primary" OnClick="BtnDescuenEscalonado_Click" />
</td>
</tr>
<tr id="TrDescuentoProntoPago" runat="server" visible="false">
<tr id="TrDescuentoProntoPago" runat="server" visible="false">
<td><b>%Desc. Pronto Pago:</b></td>
<td>
<asp:TextBox ID="TxtPorcentajeProntoPago" CssClass="form-control " runat="server" MaxLength="50" Width="80px" Height="28px"></asp:TextBox>
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtPorcentajeProntoPago" ValidChars="1234567890." />
</td>
<td><asp:CheckBox runat="server" ID="ChkEsTemporal" Text=" Es Temporal" Width="100px" /></td>
</tr>
<tr id="TrBotonesInvTemporal" runat="server" visible="false">
<td></td>
<td><asp:Button runat="server" ID="BtnInvTempEntrada" Text="Entrada" CssClass="btn btn-primary" OnClick="BtnInvTempEntrada_Click" /> </td>
<td><asp:Button runat="server" ID="BtnInvTempSalida" Text="Salida" CssClass="btn btn-primary" OnClick="BtnInvTempSalida_Click" /> </td>
</tr>

View File

@@ -7,7 +7,7 @@ Imports System.IO
Imports Extensiones
Imports GemBox.Spreadsheet
Imports Newtonsoft.Json
Imports Telerik.Web.Apoc
Partial Class OC_OC
Inherits ClsPaginas
@@ -657,6 +657,19 @@ Partial Class OC_OC
End Set
End Property
Private Property EsGrupoDiaz As Boolean
Get
If ViewState("EsGrupoDiaz") Is Nothing Then
ViewState("EsGrupoDiaz") = False
End If
Return Boolean.Parse(ViewState("EsGrupoDiaz").ToString)
End Get
Set(value As Boolean)
ViewState("EsGrupoDiaz") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
@@ -664,7 +677,11 @@ Partial Class OC_OC
If Not Page.IsPostBack Then
GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa) = Nothing
NotificacionCorreo = True
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then NotificacionCorreo = False
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
NotificacionCorreo = False
EsGrupoDiaz = True
End If
CargaDatosAgregarPS()
CveProveedorOriginal = -1
@@ -1031,20 +1048,21 @@ Partial Class OC_OC
End If
End If
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
If EsGrupoDiaz Then
chkSubProyectoEntrega.Visible = True
LblPrioridad.Text = "Sucursal"
DdlPrioridad.Visible = False
DdlSubProyectoGral.Visible = True
TrDescuentoEscalonado.Visible = True
TrDescuentoProntoPago.Visible = True
TrBotonesInvTemporal.Visible = True
End If
If UsuarioActual.Empresa.CveEmpresa = 189 AndAlso CveOrdenCompra <> Nothing AndAlso CveOrdenCompra > 0 Then
BtnEdicionMasiva.Visible = True
End If
If CveOrdenCompra > 0 AndAlso UsuarioActual.Empresa.Funcionalidad(382) = "1" OrElse UsuarioActual.CveRol = 1 Then
If CveOrdenCompra > 0 AndAlso EsGrupoDiaz OrElse UsuarioActual.CveRol = 1 Then
LnkDescargarPSExcel.Visible = True
End If
@@ -1056,7 +1074,7 @@ Partial Class OC_OC
If CveOrdenCompra > 0 Then
GvD.Columns(20).Visible = False
Else
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
If EsGrupoDiaz Then
TxtCant.Text = "1"
TxtCant.Focus()
RegistraScript("abrirDdlPS();", "A1")
@@ -2032,7 +2050,7 @@ Partial Class OC_OC
objOC.Dispose()
GvVentaRelacionadas.DataBind()
If TieneInventario Then
If TieneInventario Or EsGrupoDiaz Then
'CARGA MOVTOS DE ALMACEN
InicializaMovtosAlmacen()
End If
@@ -2377,7 +2395,7 @@ Partial Class OC_OC
End If
End If
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
If EsGrupoDiaz Then
txtPrecioUnitario.Focus()
UPPDetalle.Update()
End If
@@ -2918,7 +2936,7 @@ Partial Class OC_OC
RequiereCotizacion:=ChkCotizacion.Checked, CveCliente:=Ddlcliente.txtValue.Value.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PrioridadObservacion:=txtobsprioridad.Text, PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2), IVA:=IVA, RetIVA:=TxtRetIVA.Text.ToDecimal,
RetISR:=TxtRetISR.Text.ToDecimal, CveCotizacion:=CveCotizacion, FolioAdicional:=TxtFolioAdicional.Text, EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), Guia:=TxtGuia.Text.Trim,
IEPS:=TxtIEPS.Text.ToDecimal, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero, Promocion:=Promocion, CveProveedorContacto:=CveProveedorContacto, NumRemision:=TxtNumRemision.Text.Trim(), MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero(),
CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero, PorcentajeProntoPago:=PorcentajeProntoPago) Then
CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero, PorcentajeProntoPago:=PorcentajeProntoPago, EsTemporal:=ChkEsTemporal.Checked) Then
CveOrdenCompraPadre = OC.CveOrdenCompra
If CveOrdenCompraPadre > 0 Then
@@ -2965,7 +2983,7 @@ Partial Class OC_OC
PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2), IVA:=IVA, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, CveCotizacion:=CveCotizacion, FolioAdicional:=TxtFolioAdicional.Text, EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1),
CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), Guia:=TxtGuia.Text.Trim, IEPS:=TxtIEPS.Text.ToDecimal, CveIEAnticipo:=CveIEAnticipo, ImporteAnticipo:=ImporteAnticipos, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero,
Promocion:=Promocion, CveProveedorContacto:=CveProveedorContacto, NumRemision:=TxtNumRemision.Text, MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero(), CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero,
PorcentajeProntoPago:=PorcentajeProntoPago) Then
PorcentajeProntoPago:=PorcentajeProntoPago, EsTemporal:=ChkEsTemporal.Checked) Then
CveOrdenCompra = OC.CveOrdenCompra
CveEstatus = CboE.SelectedValue.ToEntero
@@ -3061,6 +3079,8 @@ Partial Class OC_OC
End If
If Not TieneError Then
If Conta IsNot Nothing Then Conta.Commit()
OC.Commit()
@@ -3635,7 +3655,7 @@ Partial Class OC_OC
PorcentajeIVA:=PorIVA, IVA:=IVACot, RetIVA:=RetIVA.ToString.ToDecimal, RetISR:=RetISR.ToString.ToDecimal, IDPoliza:=IdPoliza, CveCotizacion:=CveCotizacion, FolioAdicional:=TxtFolioAdicional.Text,
EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), IEPS:=TxtIEPS.Text.ToDecimal,
CveIEAnticipo:=CveIEAnticipo, ImporteAnticipo:=ImporteAnticipos, Promocion:=Promocion, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero, NumRemision:=TxtNumRemision.Text.Trim, MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero(),
CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero, PorcentajeProntoPago:=PorcentajeProntoPago) Then
CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero, PorcentajeProntoPago:=PorcentajeProntoPago, EsTemporal:=ChkEsTemporal.Checked) Then
'CREA POLIZA POR CADA PROVEEDOR
@@ -3717,7 +3737,9 @@ Partial Class OC_OC
CveUsuario, CveEmpresaActual, 0, pCveProveedor:=DdlProveedores.SelectedValue.ToEntero, pCveProveedorSucursal:=DdlProveedorSucursal.SelectedValue.ToEntero, CveUsuarioAsignado:=DdlUsuariosAsignado.SelectedValue.ToEntero(), CveCliente:=Ddlcliente.txtValue.Value.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PrioridadObservacion:=txtobsprioridad.Text,
PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2), IVA:=IVA, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, IDPoliza:=IDPolizaPresupuestal, CveCotizacion:=CveCotizacion, FolioAdicional:=TxtFolioAdicional.Text,
EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), IEPS:=TxtIEPS.Text.ToDecimal, CveIEAnticipo:=CveIEAnticipo, ImporteAnticipo:=ImporteAnticipos, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero,
Promocion:=Promocion, NumRemision:=TxtNumRemision.Text.Trim, MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero(), CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero, PorcentajeProntoPago:=PorcentajeProntoPago) Then
Promocion:=Promocion, NumRemision:=TxtNumRemision.Text.Trim, MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero(), CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero, PorcentajeProntoPago:=PorcentajeProntoPago,
EsTemporal:=ChkEsTemporal.Checked) Then
'USA AC
@@ -7497,7 +7519,9 @@ Partial Class OC_OC
Dim ObjInventarios As New ClsInventarios
If ObjInventarios.GetMovimientosOC(CveOrdenCompra, CveEmpresaActual) Then
TabAlmacen.Visible = True
If ObjInventarios.DtResultados.Rows.Count > 0 Then
GVInv.DataSource = ObjInventarios.DtResultados
If ObjInventarios.DtResultados.Rows.Count > 0 Then
@@ -7508,6 +7532,10 @@ Partial Class OC_OC
LnkCambiarMoneda.Visible = True
End If
End If
Else
If EsGrupoDiaz Then
TabAlmacen.Visible = False
End If
End If
End If
@@ -9698,6 +9726,248 @@ Partial Class OC_OC
FileExcel.Save(Response, $"OC_{CveOrdenCompra}.xlsx", SaveOptions.XlsxDefault)
End Sub
Function RegistroInventarioTemporal(ByRef transaccion As SqlTransaction, CveOCInv As Integer, CveConceptoInv As Integer) As Boolean
Dim Respuesta As Boolean = True
Dim ObjOC As New ClsOC(transaccion)
Dim DTDetalleOC As New DataTable
If ObjOC.GetOrdenesDetalle(CveOCInv, UsuarioActual.CveEmpresa) Then
DTDetalleOC = ObjOC.DtResultados.FiltraParametros(" CveTipoPS = 2 ")
If DTDetalleOC.Rows.Count = 0 Then 'No hay PSs Tipo Producto
Return True
End If
Else
Return False
End If
Dim tCveSubProyecto As Integer = UsuarioActual.CveSubProyecto
If ModalidadSubProyectoGeneral Then tCveSubProyecto = DdlSubProyectoGral.SelectedValue.ToEntero
If tCveSubProyecto <= 0 Then
tCveSubProyecto = GetCveSubProyectoDetalles()
End If
If tCveSubProyecto <= 0 Then
Alert("Sub Proyecto no asignado.")
Return False
End If
Dim CveAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveSubProyecto = {tCveSubProyecto} AND CveTipoAlmacen = 1 ").ToEntero
If CveAlmacen <= 0 Then
Alert("Almacén no asignado.")
Return False
End If
Dim ObjConta As New ClsContabilidad(transaccion)
Dim ObjInventario As New ClsInventarios(transaccion)
'Dim CveConceptoInv As Integer = If(TipoTermino = 1, 3, 2)
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inv/OC", 53, 0, 0, 1, TxtFecha.Text.Replace(",", "").ToDate, TxtDescrip.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=3)
Dim CveMovimiento As Integer = ObjInventario.AddMovimiento(CveAlmacen, CveConceptoInv, 1, NowADS, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, tCveSubProyecto, -1, Observaciones:=TxtDescrip.Text, Modulo:="OC/1")
Dim FolioMto As Integer = ObjInventario.Folio
If CveMovimiento <= 0 OrElse CvePrePoliza <= 0 Then
Alert("No se pudo almacenar el movimiento correctamente", TipoMensaje.MsgError)
ObjInventario.RollBack() 'deshace lo insertado
Else
Dim Mensaje As String = ""
''VALIDA EXISTENCIAS
Dim Cont As Integer = 0
If CveConceptoInv = 3 Then
For Each Dr As DataRow In DTDetalleOC.Rows
'Dim FechaCaducidadVal As Date = If(Dr("AplicaCaducidad").ToString = "True", Dr("FechaCaducidad").ToString.ToDate, MinFecha)
Dim FechaMovtoExistenciaStr As String = $"{NowADS.ToString("yyyy/MM/dd")} {NowADS.ToString("HH:mm")}"
If ObjInventario.GetExistenciasPS(Dr("CvePS").ToString.ToEntero, Dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, CveAlmacen, FechaMovto:=FechaMovtoExistenciaStr) >= Dr("Cantidad").ToString.ToDouble Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, -1, Observaciones:=Dr("Descripcion").ToString, CveUsuarioModifico:=UsuarioActual.CveUsuario, CveOrdenCompraDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then
Mensaje = "Error al guardar los movimientos"
Respuesta = False
Exit For
End If
Else
If UsuarioActual.TienePermisoProceso(114) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, -1, Observaciones:=Dr("Descripcion").ToString, CveUsuarioModifico:=UsuarioActual.CveUsuario, CveOrdenCompraDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then
Mensaje = "Error al guardar los movimientos"
Respuesta = False
Exit For
End If
Else
Mensaje = String.Format("No hay existencias suficientes del producto: {0}", Dr("PS"))
Alert(Mensaje, TipoMensaje.MsgAdvertencia)
Respuesta = False
Exit For
End If
End If
Cont += 1
Next
Else
For Each Dr As DataRow In DTDetalleOC.Rows
Dim ImporteConcepto As Decimal = 0
If CveConceptoInv = 2 AndAlso DdlMoneda.SelectedValue.ToEntero = 2 Then
ImporteConcepto = Dr("PU").ToString.ToDecimal * GlobalTipoCambio(TxtFecha.Text.Replace(",", "").ToDate).ToDecimal
Else
ImporteConcepto = Dr("PU").ToString.ToDecimal
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, ImporteConcepto, Observaciones:=Dr("Descripcion").ToString, CveUsuarioModifico:=UsuarioActual.CveUsuario, CveOrdenCompraDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then
Mensaje = "Error al guardar los movimientos"
Respuesta = False
Exit For
End If
Cont += 1
Next
End If
Dim EsContabilizable As Boolean = False
'Registro la prepóliza
If Respuesta AndAlso ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then
Dim tValorInventario As Decimal = ObjInventario.DtResultados.SUMD("Total", "").RoundSQL()
Dim tValorOtro As Decimal = tValorInventario
Dim TipoMovtoAlmacen As Boolean = False
Dim TipoMovtoOtro As Boolean = True
Dim drA2 As DataRow = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveAlmacen = {0}", CveAlmacen))
If drA2 IsNot Nothing Then
tCveSubProyecto = drA2("CveSubProyecto").ToString.ToEntero
End If
Dim OrigenMov As Integer = GlobalDTInvConceptos.FiltroPrimeroValor("Origen", "CveConcepto = " & CveConceptoInv).ToEntero
If OrigenMov = 1 Then TipoMovtoAlmacen = False Else TipoMovtoAlmacen = True
TipoMovtoOtro = Not TipoMovtoAlmacen
Dim CveConceptoContable As Integer = 260
Dim CveClasificacion As Integer = -1
Select Case CveConceptoInv
Case 2, 32
CveConceptoContable = 78
EsContabilizable = True
Case 28, 31
CveConceptoContable = 51
If CveConceptoInv = 28 Then
''cuando es 28, es otros ingresos.78
CveConceptoContable = 78
End If
EsContabilizable = True
Case 30
CveConceptoContable = 181
TipoMovtoOtro = False
If DdlSubProyecto.Visible = True AndAlso DdlSubProyecto.SelectedValue.ToEntero > 0 Then tCveSubProyecto = DdlSubProyecto.SelectedValue.ToEntero
Case 34
CveConceptoContable = 51
EsContabilizable = True
Case 13, 29
CveConceptoContable = 69
TipoMovtoOtro = True
tValorOtro = -tValorOtro
Dim drr As DataRow = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimero("")
If drr IsNot Nothing Then
CveClasificacion = drr("CveClasificacion").ToString.ToEntero
End If
Case 3
CveConceptoContable = 51
EsContabilizable = True
Case Else
CveConceptoContable = 95
End Select
'2-78
Dim Obs As String = TxtDescrip.Text
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoAlmacen, tValorInventario, tValorInventario, 68, Obs, Obs, CveMovimientoAlmacen:=CveMovimiento, CveClasificacion:=CveClasificacion, Contabilizable:=EsContabilizable) Then
Respuesta = False
Else
'Dim Total As Decimal = 0
If CveConceptoContable.Contiene(181, 78, 51, 69) Then
Dim Dt As DataTable = ObjInventario.DtResultados.FiltraParametros("", "", {"CveClasificacion"}).Copy
For Each Dr As DataRow In Dt.Rows
Dim Total As Decimal = ObjInventario.DtResultados.FiltraParametros($"CveClasificacion = {Dr("CveClasificacion")}").SUM("Total").RoundSQL()
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovtoAlmacen, Total, Total, CveConceptoContable, lblFolio.Text, Obs, 0, CveMovimientoAlmacen:=CveMovimiento, CveClasificacion:=Dr("CveClasificacion").ToString.ToEntero, CveSubProyecto:=tCveSubProyecto) Then
Respuesta = False
End If
Next
Else
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovtoAlmacen, tValorInventario, tValorInventario, CveConceptoContable, Obs, Obs, CveMovimientoAlmacen:=CveMovimiento, CveClasificacion:=CveClasificacion, Contabilizable:=EsContabilizable) Then
Respuesta = False
End If
End If
End If
Else
Respuesta = False
End If
End If
If Respuesta Then
Alert($"Movimiento Guardado Correctamente Folio:{FolioMto} CveMovmiento: {CveMovimiento}")
End If
Return Respuesta
End Function
Protected Sub BtnInvTempEntrada_Click(sender As Object, e As EventArgs)
Dim ObjOC As New ClsOC
Try
If RegistroInventarioTemporal(ObjOC.IniciaTransacSQL(), CveOrdenCompra, 2) Then
ObjOC.Commit()
Else
ObjOC.RollBack()
End If
Catch ex As Exception
ObjOC.RollBack()
Finally
ObjOC.Dispose()
End Try
End Sub
Protected Sub BtnInvTempSalida_Click(sender As Object, e As EventArgs)
Dim ObjOC As New ClsOC
Try
If RegistroInventarioTemporal(ObjOC.IniciaTransacSQL(), CveOrdenCompra, 3) Then
ObjOC.Commit()
Else
ObjOC.RollBack()
End If
Catch ex As Exception
ObjOC.RollBack()
Finally
ObjOC.Dispose()
End Try
End Sub
End Class

View File

@@ -504,6 +504,7 @@ Partial Class Ventas_PVCobranza
VentaActual.PorcentajeIVA = DbRowVenta("PorcentajeIVA").ToString.ToDecimal
VentaActual.UsuarioActual = UsuarioActual
VentaActual.CveSubProyecto = DbRowVenta("CveSubProyecto").ToString.ToEntero
Dim CveVendedor As Integer = DbRowVenta("CveVendedor").ToString.ToEntero
If tCveCorte <= 0 AndAlso DbRowVenta("CveCorte").ToString.ToEntero > 0 Then tCveCorte = DbRowVenta("CveCorte").ToString.ToEntero
@@ -529,7 +530,7 @@ Partial Class Ventas_PVCobranza
CveVentaRemision = HdnCveVenta.Value.ToEntero
respFactura = GenerarFactura(VentaActual, ObjVentas2, ObjClientes)
respFactura = GenerarFactura(CveVendedor, VentaActual, ObjVentas2, ObjClientes)
If respFactura Is Nothing Then
MsgError = "Ocurrió un error al generar la factura"
@@ -552,7 +553,7 @@ Partial Class Ventas_PVCobranza
'GENERAR NC PARA AMORTIZACION
If MsgError = "" AndAlso UsuarioActual.CveEmpresa.Contiene(189) AndAlso HdnTipoAmortizacion.Value = "2" Then
respNC = GenerarNC(VentaActual, ObjVentas2)
respNC = GenerarNC(CveVendedor, VentaActual, ObjVentas2)
If respNC IsNot Nothing Then
If respNC.TieneError Then
@@ -760,7 +761,7 @@ Partial Class Ventas_PVCobranza
UpL.Update()
End Sub
Private Function GenerarFactura(ByRef VentaRemision As Venta, ByRef ObjVentas As ClsVentas, ByRef ObjClientes As ClsClientes) As Modelos.Factura.MMensajeFactura
Private Function GenerarFactura(CveVendedor As Integer, ByRef VentaRemision As Venta, ByRef ObjVentas As ClsVentas, ByRef ObjClientes As ClsClientes) As Modelos.Factura.MMensajeFactura
Dim Retorno As Modelos.Factura.MMensajeFactura = Nothing
Dim SbAlert As New StringBuilder()
@@ -878,6 +879,8 @@ Partial Class Ventas_PVCobranza
ObjFactura.DtAnticiposAplicados = DtAnticipos
End If
ObjFactura.CveVendedor = CveVendedor
Retorno = ObjFactura.EmitirFactura(False, Transac:=ObjVentas.IniciaTransacSQL(), Modulo:="Cobranza/GuardarVenta", MostrarURL:=True)
Retorno.Factura = ObjFactura
@@ -945,7 +948,7 @@ Partial Class Ventas_PVCobranza
Return Retorno
End Function
Private Function GenerarNC(ByRef Venta As Venta, ByRef ObjVentas As ClsVentas) As Modelos.Factura.MMensajeFactura
Private Function GenerarNC(CveVendedor As Integer, ByRef Venta As Venta, ByRef ObjVentas As ClsVentas) As Modelos.Factura.MMensajeFactura
Dim Retorno As Modelos.Factura.MMensajeFactura = Nothing
Dim SbAlert As New StringBuilder()
@@ -1026,6 +1029,8 @@ Partial Class Ventas_PVCobranza
ObjNC.CveMetodoPago33 = 1
ObjNC.CveMetodoPago = 1
ObjNC.CveVendedor = CveVendedor
Retorno = ObjNC.EmitirFactura(False, Transac:=ObjVentas.IniciaTransacSQL(), Modulo:="Cobranza/GuardarVenta", MostrarURL:=True)
Retorno.Factura = ObjNC
@@ -1127,34 +1132,39 @@ Partial Class Ventas_PVCobranza
Private Function RegistraIE(Metodo As Integer, CveBancoCuenta As Integer, ImportePago As Decimal, Fecha As Date, CvePrePoliza As Integer, VentaActual As Venta, ByRef ObjIE As ClsBancos, ByRef ObjConta As ClsContabilidad, ByRef ObjVentas As ClsVentas, tCveCorte As Integer, Optional Obs As String = "", Optional CveAutorizacion As String = "", Optional CveSubProyecto As Integer = -1) As String
Dim Retorno As String = ""
Dim CveIEPago As Integer = 0
Dim ErrorConta As Boolean
If String.IsNullOrEmpty(Obs) Then
Obs = VentaActual.SerieFolio
If CveBancoCuenta > 0 Then
Dim CveIEPago As Integer = 0
Dim ErrorConta As Boolean
If String.IsNullOrEmpty(Obs) Then
Obs = VentaActual.SerieFolio
End If
CveIEPago = ObjIE.AddBancos_IE(CveBancoCuenta, Metodo, Fecha, "-1", VentaActual.ClienteNombre, ImportePago, 1, 1, Obs, "", False, True, 0, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCorte:=tCveCorte, CveAutorizacion:=CveAutorizacion, CveSubProyecto:=CveSubProyecto)
If CveIEPago > 0 Then
Dim Pago As New VentaPago
Pago.ImportePagoVenta = ImportePago
Pago.ImportePago = ImportePago
Pago.CveIE = CveIEPago
Pago.CveMonedaPago = VentaActual.CveMoneda
Pago.Fecha = NowADS()
Pago.Referencia = VentaActual.SerieFolio
ErrorConta = AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjConta)
If ErrorConta Then
Retorno = "Error en aplicación de pago"
End If
Dim MetodoPago As Integer = If(Metodo = 13, 1, If(Metodo = 12, 4, If(Metodo = 11, 5, If(Metodo = 3, 2, 3))))
If Not ErrorConta AndAlso Not ObjVentas.AddVta_VentaPago(VentaActual.CveVenta, MetodoPago, ImportePago) Then
Retorno = "Error en aplicación de pago.."
ErrorConta = True
End If
Else
Retorno = "Pago en Bancos no registrado"
ErrorConta = True
End If
Else
Retorno = "No se ha especificado la cuenta"
End If
CveIEPago = ObjIE.AddBancos_IE(CveBancoCuenta, Metodo, Fecha, "-1", VentaActual.ClienteNombre, ImportePago, 1, 1, Obs, "", False, True, 0, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCorte:=tCveCorte, CveAutorizacion:=CveAutorizacion, CveSubProyecto:=CveSubProyecto)
If CveIEPago > 0 Then
Dim Pago As New VentaPago
Pago.ImportePagoVenta = ImportePago
Pago.ImportePago = ImportePago
Pago.CveIE = CveIEPago
Pago.CveMonedaPago = VentaActual.CveMoneda
Pago.Fecha = NowADS()
Pago.Referencia = VentaActual.SerieFolio
ErrorConta = AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjConta)
If ErrorConta Then
Retorno = "Error en aplicación de pago"
End If
Dim MetodoPago As Integer = If(Metodo = 13, 1, If(Metodo = 12, 4, If(Metodo = 11, 5, If(Metodo = 3, 2, 3))))
If Not ErrorConta AndAlso Not ObjVentas.AddVta_VentaPago(VentaActual.CveVenta, MetodoPago, ImportePago) Then
Retorno = "Error en aplicación de pago.."
ErrorConta = True
End If
Else
Retorno = "Pago en Bancos no registrado"
ErrorConta = True
End If
Return Retorno
End Function

View File

@@ -239,6 +239,14 @@
<div class="col-md-2">
<asp:CheckBox ID="ChkLecturaAdmin" runat="server" Checked="false" CssClass="input-sm" />
</div>
<label class="col-md-1 truncate">Vista:</label>
<div class="col-md-2">
<asp:DropDownList runat="server" ID="DdlVista" CssClass="table-group-action-input form-control input-inline input-small input-sm select2me">
<asp:ListItem Value="1" >Importe</asp:ListItem>
<asp:ListItem Value="2">Cantidad</asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
</div>

View File

@@ -270,7 +270,7 @@ public partial class Ventas_RepProductosServiciosPeriodo : ClsPaginas
if (txtFechaI.Text.Trim() != "") { FechaI = txtFechaI.Text.ToDate(); } else { FechaI = MinFecha; }
if (txtFechaF.Text.Trim() != "") { FechaF = txtFechaF.Text.ToDate(); } else { FechaF = MaxFecha; }
if (TxtFechaIEjec.Text.Trim() != "") { FechaIEjec = TxtFechaIEjec.Text.ToDate(); } else { FechaIEjec = MinFecha; }
if (TxtFechaFEjec.Text.Trim() != "") { FechaFEjec = TxtFechaFEjec.Text.ToDate(); } else { FechaFEjec = MaxFecha; }
if (TxtFechaFEjec.Text.Trim() != "") { FechaFEjec = TxtFechaFEjec.Text.ToDate(); } else { FechaFEjec = MaxFecha; }
if (ObjVentas.GetRepPSPeriodo(FechaI, FechaF, FechaIEjec, FechaFEjec, DdlClientes.SelectedValue.ToEntero(), DdlSubProyectoEjecucion.SelectedValue.ToEntero(),
DdlVendedor.SelectedValue.ToEntero(), DdlUsuario.SelectedValue.ToEntero(), DdlEstatus.SelectedValue.ToEntero(), "-1", UsuarioActual.CveEmpresa,

View File

@@ -3629,6 +3629,8 @@ Partial Class Ventas
ImgAntiPend.Visible = False
End If
InicializaDevolucionAlmacen()
End If
End Sub
@@ -6846,6 +6848,8 @@ Partial Class Ventas
RBLPago.Items(0).Enabled = True
Dim CveUsoCFDICliente As Integer = -1
Dim ObjCliente As New ClsClientes()
If ObjCliente.GetClientes(CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, Estatus, TipoCliente:=-1) Then
@@ -6999,46 +7003,10 @@ Partial Class Ventas
DdlMetodoPago33.Enabled = True
End If
Dim CveCotizacion As Integer = IfNull(ViewState("CveCotizacion"), 0).ToString().ToEntero()
Me.CveMetodoPago33Cliente = ObjCliente.CveMetodoPago33
Me.CveFormaPago33Cliente = ObjCliente.CveFormaPago33
If (CveVenta <= 0 AndAlso CveCotizacion <= 0) Or EsCreaApartirDe Or NuevaFactura = 1 OrElse ModalidadEdicion Then
'CveMetodoPagoCliente = ObjCliente.CveMetodoPago
If UsuarioActual.Empresa.Funcionalidad(589) = "1" Then
'SI EL METODO DE PAGO ES PUE, SELECCIONA CONTADO
If Me.CveMetodoPago33Cliente = 1 Then
RBLPago.SelectedValue = "2"
ElseIf Me.CveMetodoPago33Cliente = 3 Then
RBLPago.SelectedValue = "1"
End If
RBLPago_SelectedIndexChanged(RBLPago, Nothing)
UPCondicionesPago.Update()
Else
DdlMetodoPago33.SelectedValueExist(ObjCliente.CveMetodoPago33)
CambiaMetodoPago33()
DdlFormaPago33.SelectedValueExist(ObjCliente.CveFormaPago33)
End If
DdlUsoCFDI.SelectedValueExist(ObjCliente.CveUsoCFDI)
'SI ES RFC GENERICO NO TIENE OBLIGACIONES FISCALES
If LblRFC.Text.Contiene("XAXX010101000", "XEXX010101000") Then
'S01 Sin efectos fiscales.
DdlUsoCFDI.SelectedValueExist("23")
DdlUsoCFDI.Enabled = False
RegimenFiscalCliente = "616"
ClienteCodigoRegimenFiscal = "616"
Else
If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
DdlUsoCFDI.Enabled = True
End If
If NuevaFactura = 1 Then
DdlUsoCFDI.Enabled = True
End If
End If
End If
CveUsoCFDICliente = ObjCliente.CveUsoCFDI
PlazoCobranza = ObjCliente.PlazoCobranza
PlazoCobranzaRemision = ObjCliente.PlazoCobranzaRemision
@@ -7388,6 +7356,48 @@ Partial Class Ventas
CargaRestriccionesCreditoCliente(True, CveVentaRef)
Dim CveCotizacion As Integer = IfNull(ViewState("CveCotizacion"), 0).ToString().ToEntero()
If (CveVenta <= 0 AndAlso CveCotizacion <= 0) Or EsCreaApartirDe Or NuevaFactura = 1 OrElse ModalidadEdicion Then
'CveMetodoPagoCliente = ObjCliente.CveMetodoPago
If UsuarioActual.Empresa.Funcionalidad(589) = "1" Then
'SI EL METODO DE PAGO ES PUE, SELECCIONA CONTADO
If Me.CveMetodoPago33Cliente = 1 Then
RBLPago.SelectedValue = "2"
ElseIf Me.CveMetodoPago33Cliente = 3 Then
RBLPago.SelectedValue = "1"
'SI ESTA BLOQUEADO EL CREDITO, DEJAR CONTADO
If Not RBLPago.Items(0).Enabled Then
RBLPago.SelectedValue = "2"
End If
End If
RBLPago_SelectedIndexChanged(RBLPago, Nothing)
UPCondicionesPago.Update()
Else
DdlMetodoPago33.SelectedValueExist(Me.CveMetodoPago33Cliente)
CambiaMetodoPago33()
DdlFormaPago33.SelectedValueExist(Me.CveFormaPago33Cliente)
End If
DdlUsoCFDI.SelectedValueExist(CveUsoCFDICliente)
'SI ES RFC GENERICO NO TIENE OBLIGACIONES FISCALES
If LblRFC.Text.Contiene("XAXX010101000", "XEXX010101000") Then
'S01 Sin efectos fiscales.
DdlUsoCFDI.SelectedValueExist("23")
DdlUsoCFDI.Enabled = False
RegimenFiscalCliente = "616"
ClienteCodigoRegimenFiscal = "616"
Else
If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
DdlUsoCFDI.Enabled = True
End If
If NuevaFactura = 1 Then
DdlUsoCFDI.Enabled = True
End If
End If
End If
If CveVenta <= 0 Then
CalculaLineasAdicionales()
HabilitaRemisionPublicoGeneral = 0
@@ -8986,6 +8996,17 @@ Partial Class Ventas
GvPS.Rows(e.NewEditIndex).FCTextBox("TxtDescuento").Enabled = False
End If
If (CveVenta <= 0 OrElse EsCreaApartirDe) AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
Try
If GvPS.Rows(e.NewEditIndex).DataKey("CvePrecioLista").ToString().ToEntero() > 0 Then
GvPS.Rows(e.NewEditIndex).FCTextBox("TxtPrecio").Enabled = False
End If
Catch ex As Exception
End Try
GvPS.Rows(e.NewEditIndex).FCTextBox("TxtDescuento").Enabled = False
End If
If EsVentaMedica Then
GvPS.Rows(e.NewEditIndex).FCTextBox("TxtPrecio").Enabled = False
@@ -9021,6 +9042,8 @@ Partial Class Ventas
End If
UpPS.Update()
End Sub
Protected Sub GvPS_RowCancelingEdit(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvPS.RowCancelingEdit
GvPS.EditIndex = -1
@@ -12623,7 +12646,12 @@ Partial Class Ventas
If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then
ObjFactura.Medico = DdlMedico.SelectedItem.Text
ObjFactura.Procedimiento = DdlProcedimiento.SelectedItem.Text
ObjFactura.FechaParaSurtir = TxtFechaOS.Text.Trim.ToDateTime
Dim FechaParaSurtir As DateTime = MinFecha
If TxtFechaOS.Text.Replace(",", "").ToDateTime() > MinFecha Then
FechaParaSurtir = TxtFechaOS.Text.Replace(",", "").ToDateTime()
End If
ObjFactura.FechaParaSurtir = FechaParaSurtir
End If
'CONVERTIR REMISION - TIPO MONEDA -DOLARES A PESOS