This commit is contained in:
rakcsle
2022-09-08 11:59:44 -07:00
12 changed files with 215 additions and 138 deletions

View File

@@ -319,7 +319,7 @@ Public Class ClsContratos
Optional CveContratosEstatus As Integer = -1, Optional CveContratoTipo As Integer = -1, Optional TipoCambio As Double = 1, Optional CveSucursalCliente As Integer = -1, Optional CveAlmacenOrigen As Integer = -1, Optional CveAlmacenDestino As Integer = -1, Optional PorcentajeComision As Integer = -1,
Optional TipoGarantia As Integer = -1, Optional Folio As Integer = -1, Optional FechaVenc As Date = Nothing, Optional EstatusFianza As Integer = -1, Optional CvePeriodo As Integer = -1, Optional CveContratoPlantilla As Integer = -1, Optional CveCuentaEquipo As Integer = -1,
Optional CveVendedor As Integer = -1, Optional Observaciones As String = "", Optional CveDireccionEnvio As Integer = -1, Optional AplicaImpuestosLocales As Boolean = False, Optional CorreoNotificacionPedDev As String = "",
Optional FacturacionCicilica As Boolean = False, Optional FacturacionCiclicaAutomatico As Boolean = False, Optional DiaMesFacturacion As Integer = 1) As Integer
Optional FacturacionCicilica As Boolean = False, Optional FacturacionCiclicaAutomatico As Boolean = False, Optional DiaMesFacturacion As Integer = 1, Optional ObservacionesGenerales As String = "") As Integer
Dim Retorno As Integer = -1
DataAdapter("PA_Con_ContratosAdd")
@@ -374,6 +374,7 @@ Public Class ClsContratos
.Add("@FacturacionCicilica", SqlDbType.Bit).Value = FacturacionCicilica
.Add("@FacturacionCiclicaAutomatico", SqlDbType.Bit).Value = FacturacionCiclicaAutomatico
.Add("@DiaMesFacturacion", SqlDbType.TinyInt).Value = DiaMesFacturacion
.Add("@ObservacionesGenerales", SqlDbType.VarChar).Value = ObservacionesGenerales
End With
@@ -399,7 +400,7 @@ Public Class ClsContratos
Optional CveContratosEstatus As Integer = -1, Optional CveContratoTipo As Integer = -1, Optional TipoCambio As Double = 1.0, Optional CveSucursalCliente As Integer = -1, Optional CveAlmacenOrigen As Integer = -1, Optional CveAlmacenDestino As Integer = -1, Optional PorcentajeComision As Integer = -1,
Optional TipoGarantia As Integer = -1, Optional Folio As Integer = -1, Optional FechaVenc As Date = Nothing, Optional EstatusFianza As Integer = -1, Optional CveContratoPlantilla As Integer = -1, Optional CveCuentaEquipo As Integer = -1,
Optional CveVendedor As Integer = -1, Optional Observaciones As String = "", Optional CveDireccionEnvio As Integer = -1, Optional AplicaImpuestosLocales As Boolean = False, Optional CorreoNotificacionPedDev As String = "", Optional FacturacionCicilica As Boolean = False, Optional FacturacionCiclicaAutomatico As Boolean = False,
Optional DiaMesFacturacion As Integer = 1, Optional CvePeriodo As Integer = -1) As Boolean
Optional DiaMesFacturacion As Integer = 1, Optional CvePeriodo As Integer = -1, Optional ObservacionesGenerales As String = "") As Boolean
Dim Retorno = False
DataAdapter("PA_Con_ContratosUpdate")
@@ -453,7 +454,9 @@ Public Class ClsContratos
.Add("@FacturacionCicilica", SqlDbType.Bit).Value = FacturacionCicilica
.Add("@FacturacionCiclicaAutomatico", SqlDbType.Bit).Value = FacturacionCiclicaAutomatico
.Add("@DiaMesFacturacion", SqlDbType.TinyInt).Value = DiaMesFacturacion
.Add("@CvePeriodo", SqlDbType.Int).Value = CvePeriodo
.Add("@CvePeriodo", SqlDbType.Int).Value = CvePeriodo
.Add("@ObservacionesGenerales", SqlDbType.VarChar).Value = ObservacionesGenerales
End With
Try

View File

@@ -579,9 +579,9 @@ public partial class Bancos_Devoluciones : ClsPaginas
// OTROS INGRESOS
if (gvr.FCTextBox("TxtComision").Text.ToDecimal() != 0)
{
int tcvecon = 78;
int tcvecon = 255;
if (gvr.FCTextBox("TxtComision").Text.ToDecimal() > 0)
tcvecon = 255;
tcvecon = 78;
if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoDevolucion, gvr.FCTextBox("TxtComision").Text.ToDecimal(), Ref, tcvecon, Conc, DateTime.Now, UsuarioActual.Empresa.IdCuentaOtrosIngresos, -1, CveIE: gvr.DataKey("CveIE").ToEntero(), CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero(), CveProveedor: cveProveedor, CvePersonal: cvePersonal, ImporteMX: gvr.FCTextBox("TxtComision").Text.ToDecimal(), CveIEDevolucion: CveIE))
{

View File

@@ -25,11 +25,7 @@
<asp:LinkButton ID="LnkComplementoPago" runat="server" Visible="false" Style="color: #686868;"><i class="fa fa-money" style="color:#686868;"></i> Complemento Pago</asp:LinkButton>
</li>
</ContentTemplate>
</asp:UpdatePanel>
<li>
<asp:HyperLink ID="HLModalActualizarTC" NavigateUrl="#" runat="server" Visible="false" data-toggle="modal" data-target="#ModalActualizarTC" Style="color: #686868;"><i class="fa fa-usd" style="color:#686868;"></i> Actualizar Tipo Cambio</asp:HyperLink>
</li>
</asp:UpdatePanel>
<li>
<asp:HyperLink ID="HpLPrePoliza" NavigateUrl="#" runat="server" Visible="false" Style="color: #686868;"><i class="" style="color:#686868;"></i> PrePoliza</asp:HyperLink>
</li>
@@ -268,7 +264,7 @@
<asp:RadioButtonList ID="RBL" runat="server" RepeatDirection="Horizontal" AutoPostBack="True">
<asp:ListItem Value="C">Clientes</asp:ListItem>
<asp:ListItem Value="P">Proveedor</asp:ListItem>
<asp:ListItem Value="FE">Viaticos - Personal</asp:ListItem>
<asp:ListItem Value="FE">Viáticos</asp:ListItem>
</asp:RadioButtonList>
<asp:HiddenField ID="HdnCveCliente" runat="server" ClientIDMode="Static" Value="-1" />
<asp:HiddenField ID="HdnCveProveedor" runat="server" ClientIDMode="Static" Value="-1" />
@@ -1473,44 +1469,7 @@
</ContentTemplate>
</asp:UpdatePanel>
</div>
<%-- ACTUALIZAR TIPO CAMBIO PREPOLIZA --%>
<div id="ModalActualizarTC" class="modal ADS fade" role="dialog">
<asp:UpdatePanel ID="UpActualizarTC" class="modal-dialog rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Actualizar Tipo Cambio</h4>
</div>
<div class="modal-body">
<div class="form-group">
<label for="<%=TxtActualizarTC_TCActual.ClientID.ToString()%>" class="col-md-4 col-md-offset-2 control-label">Tipo Cambio Actual:</label>
<div class="input-group col-md-6">
<span class="input-group-addon">$</span>
<asp:TextBox ID="TxtActualizarTC_TCActual" disabled Width="100" Text="0.00" CssClass="form-control input-sm text-right" runat="server" />
</div>
</div>
<div class="form-group">
<label for="<%=TxtActualizarTC_TCActualizar.ClientID.ToString()%>" class="col-md-4 col-md-offset-2 control-label">Tipo Cambio Actualizar:</label>
<div class="input-group col-md-6">
<span class="input-group-addon">$</span>
<asp:TextBox ID="TxtActualizarTC_TCActualizar" Width="100" Text="0.00" CssClass="form-control input-sm text-right" runat="server" />
<ajax:FilteredTextBoxExtender ID="FTB_TCActualizar" runat="server" TargetControlID="TxtActualizarTC_TCActualizar" FilterType="Custom, Numbers" ValidChars="." />
</div>
</div>
</div>
<div class="modal-footer">
<button id="CancelarActualizarTC" type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
<asp:Button Text="Actualizar" ID="BtnActualizarTC" OnClick="BtnActualizarTC_Click" CssClass="btn btn-primary" ValidationGroup="GrpModalActualizarTC" runat="server" />
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div id="ModalDivMail" class="modal ADS fade" role="dialog">
<div class="modal-dialog">

View File

@@ -826,8 +826,6 @@ Partial Class Bancos_IE
UppEliminarIE.Update()
InicializaActualizarTC()
'22/06/2018 - VIATICOS
If Request("CveSolicitudViatico") IsNot Nothing AndAlso IsNumeric(Request("CveSolicitudViatico")) AndAlso Request("CveSolicitudViatico").ToEntero > 0 Then
CargaDatosViaticos()
@@ -3330,21 +3328,14 @@ Partial Class Bancos_IE
PorcentajeCompraDevDinC = ObjCompras.DtResultados.Rows(0)("PorcentajeIVA").ToString.ToDecimal
Dim DTCuentas As DataTable = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeCompraDevDinC)
Dim CveCuentaIVAxAcreditarDevDinC = 0
Dim CveCuentaIVAAcreditableDevDinC = 0
Dim IdCtaIVAXAcreditarDevDinC = DTCuentas.Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero
Dim IdCtaIVAAcreditableDevDinC = DTCuentas.Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero
Dim IVADevMN As Decimal = 0
Dim IEPSDevMN As Decimal = 0
Dim PorcentajeDevolucion As Decimal = ((ImporteAplicar * 100D / TotalCompraDev) / 100).RoundSQL(2)
IVADev = Math.Round(IVADev * PorcentajeDevolucion, 2)
IEPSDev = Math.Round(IEPSDev * PorcentajeDevolucion, 2)
Dim IdCtaIVADevolucionIMPUESTOS As Integer = -1
If DdlMoneda.SelectedValue.ToEntero > 1 Then
@@ -3355,7 +3346,6 @@ Partial Class Bancos_IE
IEPSDevMN = (IEPSDev * If(CveMonedaDev = 1, 1, TxtTipoCambio.Text.ToDecimal)).RoundSQL(2)
End If
Dim ErrorDevolucionImpuestos As Boolean = False
If IVADev > 0 Then
@@ -3554,12 +3544,12 @@ Partial Class Bancos_IE
Dim IdCtaIVAXAcreditarDevDinC As Integer
Dim IdCtaIVAAcreditableDevDinC As Integer
'If DTCuentas IsNot Nothing AndAlso DTCuentas.Rows.Count > 0 Then
' IdCtaIVAXAcreditarDevDinC = DTCuentas.Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero
' IdCtaIVAAcreditableDevDinC = DTCuentas.Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero
'Else
' MsgError = "Sin Registros de porcentaje impuesto"
'End If
If DTCuentas IsNot Nothing AndAlso DTCuentas.Rows.Count > 0 Then
IdCtaIVAXAcreditarDevDinC = DTCuentas.Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero
IdCtaIVAAcreditableDevDinC = DTCuentas.Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero
Else
MsgError = "Sin Registros de porcentaje impuesto"
End If
Dim IVADevMN As Decimal = 0
Dim IEPSDevMN As Decimal = 0
@@ -5900,49 +5890,6 @@ Partial Class Bancos_IE
#End Region
#Region " ACTUALIZAR TIPO CAMBIO PREPOLIZA "
Private Sub InicializaActualizarTC()
If CveIE > 0 And DdlMoneda.SelectedValue.ToEntero = 2 And CvePrePoliza > 0 Then
TxtActualizarTC_TCActual.Text = TxtTipoCambio.Text
TxtActualizarTC_TCActualizar.Text = GlobalTipoCambio(TxtFechaDocumento.Text.ToDate).FormatoNumero(4)
HLModalActualizarTC.Visible = True
End If
End Sub
Protected Sub BtnActualizarTC_Click(sender As Object, e As EventArgs)
Dim ObjContabilidad As New ClsContabilidad
Dim ObjBancos As New ClsBancos(ObjContabilidad.IniciaTransacSQL())
Dim ObjEventos As New ClsOIEventos(ObjContabilidad.IniciaTransacSQL())
Dim TieneError = False
Dim MensajeError = ""
If ObjEventos.AddEventoBitacora($"Se actualizó el Tipo de Cambio de la compra. TC anterior: {TxtActualizarTC_TCActual.Text.FormatoNumero(4)} | TC actual: {TxtActualizarTC_TCActualizar.Text.FormatoNumero(4)}", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveIE:=CveIE) Then
If ObjBancos.UpdateBancos_IETipoCambio(TxtActualizarTC_TCActualizar.Text.ToDouble, CveIE, CvePrePoliza, UsuarioActual.CveEmpresa) Then
If Not ObjContabilidad.ReconstruirPP_PagoCompraVenta(CveIE) Then
TieneError = True
MensajeError = "Ocurrió un error al actualizar el asiento contable"
End If
Else
TieneError = True
MensajeError = "Ocurrió un error al actualizar el Tipo de Cambio al documento"
End If
Else
TieneError = True
MensajeError = "Ocurrió un error al guardar el historal al actualizar el Tipo de Cambio al documento"
End If
If Not TieneError Then
ObjContabilidad.Commit()
Alert("Se actualizó correctamente el tipo de cambio del documento.", TipoMensaje.MsgInformacion)
RegistraScript("$('#ModalActualizarTC').modal('hide');")
Else
ObjContabilidad.RollBack()
Alert(MensajeError, TipoMensaje.MsgError)
End If
ObjContabilidad.Dispose()
End Sub
#End Region
#Region "SOLICITAR VIATICOS VIATICOS"
Protected Sub CargaDatosViaticos()

View File

@@ -1973,6 +1973,16 @@
<asp:Button ID="BtnVerPlantilla" runat="server" Text="Ver Plantilla" CssClass="btn btn-sm btn-primary" Width="100%" OnClick="BtnVerPlantilla_Click"/>
</div>
</div>
<br />
<div class="row">
<label class="col-md-3 truncate ">Observación General:</label>
<div class="col-md-7">
<asp:TextBox ID="TxtObsGeneral" runat="server" Width="100%" TextMode="MultiLine" Rows="2"></asp:TextBox>
</div>
<div class="col-md-2">
<asp:Button ID="BtnVerPlantilla2" runat="server" Text="Ver Plantilla" CssClass="btn btn-sm btn-primary" Width="100%" OnClick="BtnVerPlantilla2_Click"/>
</div>
</div>
<div class="row">
<div class="col-md-12" style="vertical-align: middle;" align="center">
<div style="z-index: 5; position: relative;">

View File

@@ -1383,7 +1383,8 @@ Partial Class Contratos_Default
CveAlmacenOrigen:=DdlAlmacenOrigen.SelectedValue.ToEntero, CveAlmacenDestino:=DdlAlmacenDestino.SelectedValue.ToEntero, PorcentajeComision:=TxtPorcentajeComision.Text.ToEntero,
TipoGarantia:=DdlTipoGarantia.SelectedValue.ToEntero, Folio:=TxtFolio.Text.ToEntero, FechaVenc:=txtFechaVenc.Text.ToDate, EstatusFianza:=DdlEstatusFianza.SelectedValue.ToEntero, CveContratoPlantilla:=DdlPlantillaContrato.SelectedValue.ToEntero,
CveCuentaEquipo:=DdlCuentaEquipo.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, Observaciones:=TxtObservaciones.Text, CveDireccionEnvio:=DdlClienteDireccionEnvio.SelectedValue.ToEntero, AplicaImpuestosLocales:=ChkImpuestosLocales.Checked,
CorreoNotificacionPedDev:=TxtCorreoNotificacion.Text.Trim(), FacturacionCicilica:=ChkAplicaFacCiclica.Checked, FacturacionCiclicaAutomatico:=ChkFacAutomatica.Checked, DiaMesFacturacion:=If(DdlDiaFact.SelectedValue.ToEntero() < 0, 0, DdlDiaFact.SelectedValue.ToEntero()), CvePeriodo:=DdlPeriodo.SelectedValue.ToEntero()) Then
CorreoNotificacionPedDev:=TxtCorreoNotificacion.Text.Trim(), FacturacionCicilica:=ChkAplicaFacCiclica.Checked, FacturacionCiclicaAutomatico:=ChkFacAutomatica.Checked, DiaMesFacturacion:=If(DdlDiaFact.SelectedValue.ToEntero() < 0, 0, DdlDiaFact.SelectedValue.ToEntero()),
CvePeriodo:=DdlPeriodo.SelectedValue.ToEntero(), ObservacionesGenerales:=TxtObsGeneral.Text.Trim) Then
TieneError = Not GuardaFianzas(ObjContratos)
@@ -4028,7 +4029,8 @@ Partial Class Contratos_Default
TxtUbicacion.Text, TxtResponsable.Text, DdlSubProyectoContrato.SelectedValue.ToEntero, TxtPorIVA.Text.ToDouble, TxtPorAnticipo.Text.ToDouble, TxtPorAmortizacionAnticipo.Text.ToDouble,
TxtPorGarantia.Text.ToDouble, "." & Session("FileExtension").ToString, "", CveContrato, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, Minimo, Maximo, Total,
DdlMoneda.SelectedValue.ToEntero, ModalidadDetalle, If(UsuarioActual.Empresa.CvePlataforma = 3, 1, CveEstatusInicial), TipoContrato, TxtTipoCambio.Text.ToDouble, CveSucursalCliente:=DdlSucursalCliente.SelectedValue.ToEntero, CveAlmacenOrigen:=DdlAlmacenOrigen.SelectedValue.ToEntero, CveAlmacenDestino:=DdlAlmacenDestino.SelectedValue.ToEntero, PorcentajeComision:=TxtPorcentajeComision.Text.ToEntero,
TipoGarantia:=DdlTipoGarantia.SelectedValue.ToEntero, Folio:=TxtFolio.Text.ToEntero, FechaVenc:=txtFechaVenc.Text.ToDate, EstatusFianza:=DdlEstatusFianza.SelectedValue.ToEntero, CvePeriodo:=DdlPeriodo.SelectedValue.ToEntero, CveCuentaEquipo:=DdlCuentaEquipo.SelectedValue.ToEntero, CveContratoPlantilla:=DdlPlantillaContrato.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero)
TipoGarantia:=DdlTipoGarantia.SelectedValue.ToEntero, Folio:=TxtFolio.Text.ToEntero, FechaVenc:=txtFechaVenc.Text.ToDate, EstatusFianza:=DdlEstatusFianza.SelectedValue.ToEntero, CvePeriodo:=DdlPeriodo.SelectedValue.ToEntero, CveCuentaEquipo:=DdlCuentaEquipo.SelectedValue.ToEntero, CveContratoPlantilla:=DdlPlantillaContrato.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero,
ObservacionesGenerales:=TxtObsGeneral.Text.Trim)
If CveContratoHijo > 0 Then
@@ -4578,6 +4580,61 @@ Partial Class Contratos_Default
Plantilla = Plantilla.ToString().Replace("{FINMESANTERIOR}", mesAnterior)
End If
Alert(Plantilla)
End Sub
Protected Sub BtnVerPlantilla2_Click(sender As Object, e As EventArgs)
Dim Plantilla As String = TxtObsGeneral.Text
If Plantilla.Contains("{DIA}") Then
Plantilla = Plantilla.Replace("{DIA}", DateTime.Now.Day.ToString())
End If
If Plantilla.Contains("{MES}") Then
Dim fecha As DateTime = DateTime.Now
Dim formatoFecha = Globalization.CultureInfo.CurrentCulture.DateTimeFormat
Dim nombreMes = formatoFecha.GetMonthName(fecha.Month).ToUpper()
Plantilla = Plantilla.ToString().Replace("{MES}", nombreMes)
End If
If Plantilla.Contains("{AÑO}") Then
Plantilla = Plantilla.Replace("{AÑO}", DateTime.Now.Year.ToString())
End If
If Plantilla.Contains("{TC}") Then
Plantilla = Plantilla.Replace("{TC}", GlobalTipoCambio(Now).FormatoNumero)
End If
If Plantilla.Contains("{MESANTERIOR}") Then
Dim fecha As DateTime = DateTime.Now.AddMonths(-1)
Dim formatoFecha = Globalization.CultureInfo.CurrentCulture.DateTimeFormat
Dim nombreMes = formatoFecha.GetMonthName(fecha.Month).ToUpper()
Plantilla = Plantilla.ToString().Replace("{MESANTERIOR}", nombreMes)
End If
If Plantilla.Contains("{INICIOMESANTERIOR}") Then
Dim fecha As DateTime = DateTime.Now.AddMonths(-1)
Dim formatoFecha = Globalization.CultureInfo.CurrentCulture.DateTimeFormat
Dim nombreMes = formatoFecha.GetMonthName(fecha.Month).ToUpper()
Dim mesAnterior As String = String.Format("01 {0} {1}", nombreMes, fecha.Year)
Plantilla = Plantilla.ToString().Replace("{INICIOMESANTERIOR}", mesAnterior)
End If
If Plantilla.Contains("{FINMESANTERIOR}") Then
Dim fecha As DateTime = DateTime.Now.AddMonths(-1)
Dim formatoFecha = Globalization.CultureInfo.CurrentCulture.DateTimeFormat
Dim nombreMes = formatoFecha.GetMonthName(fecha.Month).ToUpper()
Dim LastDayOfMonth = DateTime.DaysInMonth(fecha.Year, fecha.Month)
Dim mesAnterior As String = String.Format("{0} {1} {2}", LastDayOfMonth, nombreMes, fecha.Year)
Plantilla = Plantilla.ToString().Replace("{FINMESANTERIOR}", mesAnterior)
End If
Alert(Plantilla)
End Sub
End Class

View File

@@ -142,6 +142,14 @@ Partial Class Contratos_FacturacionMasiva
Row("Observaciones") = Row("Observaciones").ToString().Replace("{MES}", nombreMes)
End If
If Row("Observaciones").ToString().Contains("{MESANTERIOR}") Then
Dim fecha As DateTime = DateTime.Now.AddMonths(-1)
Dim formatoFecha = Globalization.CultureInfo.CurrentCulture.DateTimeFormat
Dim nombreMes = formatoFecha.GetMonthName(fecha.Month).ToUpper()
Row("Observaciones") = Row("Observaciones").ToString().Replace("{MESANTERIOR}", nombreMes)
End If
If Row("Observaciones").ToString().Contains("{AÑO}") Then
Row("Observaciones") = Row("Observaciones").ToString().Replace("{AÑO}", DateTime.Now.Year.ToString())
End If

View File

@@ -2980,6 +2980,9 @@ Partial Class Inventarios_RecepcionUsados
Dim CveTamanio As Integer = -1
Dim drPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSParametro).FiltroPrimero("")
DdlBCIAjuste.SelectedValue = Nothing
DdlBCIAjuste.Items.Clear()
If drPS IsNot Nothing Then
Dim CvePrecioListaPS As Integer = GlobalDTCliente(UsuarioActual.CveEmpresa, Estatus:=-1, CveCliente:=DdlClientes.SelectedValue.ToEntero).FiltroPrimeroValor("CvePrecioLista").ToEntero()
If CvePrecioListaPS > 0 Then
@@ -2994,6 +2997,17 @@ Partial Class Inventarios_RecepcionUsados
CveClasificacion = drPS("CveClasificacion").ToString.ToEntero
CveTamanio = drPS("CveTamaño").ToString.ToEntero
If DTBCIUsados IsNot Nothing AndAlso CveTamanio > 0 Then
DdlBCIAjuste.DataSource = DTBCIUsados.FiltraParametros($"CveTamaño={CveTamanio}")
DdlBCIAjuste.DataBind()
DdlBCIAjuste.Items.Insert(0, New ListItem("Seleccione", "-1"))
If CveTamanio = 16 Then 'motobaterias
DdlBCIAjuste.Items.Insert(0, New ListItem(" - ", "0"))
End If
Else
DdlBCIAjuste.Items.Insert(0, New ListItem(" - ", "0"))
End If
Dim Arr = PS.Split("-"c)
If Arr.Count > 1 Then
If (DdlBCIAjuste.Items.FindByText(Arr(1).ToString) IsNot Nothing) Then
@@ -3001,7 +3015,6 @@ Partial Class Inventarios_RecepcionUsados
End If
End If
End If
HdnPSAjusteMarca.Value = CveMarca.ToString()
@@ -3054,19 +3067,6 @@ Partial Class Inventarios_RecepcionUsados
'CvePrecioLista = CvePrecioListaPS
End If
DdlBCIAjuste.Items.Clear()
If DTBCIUsados IsNot Nothing AndAlso CveTamanio > 0 Then
DdlBCIAjuste.DataSource = DTBCIUsados.FiltraParametros($"CveTamaño={CveTamanio}")
DdlBCIAjuste.DataBind()
DdlBCIAjuste.Items.Insert(0, New ListItem("Seleccione", "-1"))
If CveTamanio = 16 Then 'motobaterias
DdlBCIAjuste.Items.Insert(0, New ListItem(" - ", "0"))
End If
'UPPDatosUsado.Update() ''refresca el RFV
Else
DdlBCIAjuste.Items.Insert(0, New ListItem(" - ", "0"))
End If
DdlTipoUso.Items.Clear()
DdlTipoUso.DataSource = GlobalDTAcumGarantiasMesesTipoUso(UsuarioActual.CveEmpresa, CveMarca)
DdlTipoUso.Items.Insert(0, New ListItem("Seleccione", "-1"))

View File

@@ -132,6 +132,8 @@
<asp:DropDownList ID="DdlTipoDocto2" runat="server" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100px">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
<asp:ListItem Text="Factura" Value="Fac"></asp:ListItem>
<asp:ListItem Text="Nota de crédito" Value="NC"></asp:ListItem>
<asp:ListItem Text="Devolución" Value="DEV"></asp:ListItem>
</asp:DropDownList>
</div>
<%-- <div class="col-md-1 truncate" id="DivSucursal" runat="server" style="text-align: right!important;">Sucursal:</div>

View File

@@ -146,7 +146,7 @@ Partial Class RepNotasSinAlmacen
CveClienteProveedor = DdlProveedor.SelectedValue.ToEntero
End If
If Reporte.RepNotasSinAlmacen(2, CveClienteProveedor, FechaInicial, FechaFinal, DdlTipoDocto2.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.Empresa.CveEmpresa) Then
If Reporte.RepNotasSinAlmacen(2, CveClienteProveedor, FechaInicial, FechaFinal, DdlTipoDocto2.SelectedValue, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.Empresa.CveEmpresa) Then
GvCompras.DataSource = Reporte.DtResultados
DtNotasSinAlmacenCompras = Reporte.DtResultados
Else

View File

@@ -6886,7 +6886,7 @@
<div class="row" id="DivGvCxC" style="max-height: 5px" runat="server" visible="false">
<div class="col-md-12" style="height: 440px; overflow: auto">
<asp:GridView ID="GvCxC" runat="server" AutoGenerateColumns="False" OnRowDataBound="GvCxC_RowDataBound"
DataKeyNames="CveVenta,CveMetodoPago33,CveFormaPago33" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn" GridLines="None">
DataKeyNames="CveVenta,CveMetodoPago33,CveFormaPago33,CveMoneda" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn" GridLines="None">
<Columns>
<asp:TemplateField>
<ItemTemplate>

View File

@@ -3986,9 +3986,12 @@ Partial Class Ventas
UpPS.Update()
Exit Sub
Else
Dim ObsPlantilla As String = PlantillaContrato(Row.DataKey("Observaciones"))
SeleccionadoContrato += Row.FCTextBox("TxtCant").Text.ToEntero() * Row.FCLiteral("LtlPU").Text.ToDouble
AgregarProductoServicio(Row.FCTextBox("TxtCant").Text.ToEntero(), Row.DataKey("CveUM").ToEntero(), Row.FCLiteral("LtlUM").Text, Row.DataKey("CveClasificacion").ToEntero(),
Row.DataKey("Clasificacion"), Row.DataKey("CvePS").ToEntero(), Row.FCLiteral("LtlPS").Text, If(CveCicloComercial > 0, Row.DataKey("Observaciones"), $"/ {Row.FCLiteral("LtCveInterna").Text}"), Row.FCLiteral("LtlPU").Text.ToDecimal, 0,
Row.DataKey("Clasificacion"), Row.DataKey("CvePS").ToEntero(), Row.FCLiteral("LtlPS").Text, If(CveCicloComercial > 0, ObsPlantilla, $"/ {Row.FCLiteral("LtCveInterna").Text}"), Row.FCLiteral("LtlPU").Text.ToDecimal, 0,
DrContrato("CveProyecto").ToString().ToEntero(), DrContrato("ProyectoContrato").ToString(), DrContrato("CveSubProyecto").ToString().ToEntero(), DrContrato("SubProyectoContrato").ToString(), CveContratoDetalle:=Row.DataKey("CveContratoDetalle").ToEntero())
'AddPS(Row.FCTextBox("TxtCant").Text.ToEntero(), Row.DataKey("CveUM").ToEntero(), Row.FCLiteral("LtlUM").Text, Row.DataKey("CveClasificacion").ToEntero(), Row.DataKey("Clasificacion"),
' Row.DataKey("CvePS").ToEntero(), Row.FCLiteral("LtlPS").Text, If(CveCicloComercial > 0, Row.DataKey("Observaciones"), $"/ {Row.FCLiteral("LtCveInterna").Text}"), Row.FCLiteral("LtlPU").Text.ToDouble, If(Row.DataKey("IVA").ToDouble = -1, ViewState("IVA").ToString().ToDouble, Row.DataKey("IVA").ToDouble), 0, 0, 1, 0, True, "",
@@ -5067,6 +5070,7 @@ Partial Class Ventas
VentaActual = New Venta
VentaActual.CveVenta = CveVenta
VentaActual.Fecha = DbRowVenta("Fecha").ToString.ToDate
VentaActual.CveCliente = DbRowVenta("CveCliente").ToString.ToEntero
VentaActual.CveMoneda = DbRowVenta("CveMoneda").ToString.ToEntero
VentaActual.SerieFolio = DbRowVenta("SerieFolio").ToString
@@ -7825,6 +7829,21 @@ Partial Class Ventas
GvPS.Rows(e.NewEditIndex).FCTextBox("TxtPrecio").Enabled = False
GvPS.Rows(e.NewEditIndex).FCTextBox("TxtDescuento").Enabled = False
End If
If CveCicloComercial > 0 Then
For Each gvr As GridViewRow In GvContratoDetalles.Rows
If gvr.RowType = DataControlRowType.DataRow Then
If gvr.DataKey("Cantidad").ToString().ToDecimal() = GvPS.Rows(e.NewEditIndex).DataKey("Cantidad").ToString().ToDecimal() AndAlso gvr.DataKey("CvePS").ToString().ToEntero() = GvPS.Rows(e.NewEditIndex).DataKey("CvePS").ToString().ToEntero() Then
If gvr.DataKey("LimitarCantidad").ToString() = "False" Then
GvPS.Rows(e.NewEditIndex).FCTextBox("TxtCantidad").Enabled = True
Exit For
End If
End If
End If
Next
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
@@ -8461,17 +8480,8 @@ Partial Class Ventas
Alert("El cliente no tiene asignado un régimen fiscal.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim EsPersonaMoral As Boolean = (TipoPersona = True)
If EsPersonaMoral AndAlso String.IsNullOrEmpty(RegimenSociedad) Then
Alert("El cliente no tiene asignado un regimen de sociedad.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
If (Me.FacturarSucursal AndAlso DdlSucursalCliente.SelectedValue.ToEntero() > 0 AndAlso (Me.ClienteSucursal IsNot Nothing AndAlso String.IsNullOrEmpty(Me.ClienteSucursal.RFC))) Then
Alert("La sucursal no tiene asignada un RFC.", TipoMensaje.MsgAdvertencia)
Exit Sub
@@ -12538,7 +12548,7 @@ Partial Class Ventas
CveTipoAmortizacionAnticipo:=factura.CveTipoAmortizacionAnticipo, CveEmpresaCRM:=CveEmpresaCRM, EsInterno:=EsInterno, CveAcercamientoCRM:=CveAcercamientoCRM,
DiasCredito:=factura.DiasCredito, EsDiasCreditoFijo:=factura.EsDiasCreditoFijo, AnticipoEspecial:=If(TrAntEspecial.Visible, ChkAntEspecial.Checked, False),
Kilometraje:=TxtKilometraje.Text.ToDouble, EsAmortizacion:=EsNCAmortizacion, CveTipoRetencion:=factura.CveTipoRetencion, CorreoNotificacion:=TxtCorreoNotificaciones.Text,
FormaPaqueteria:=RblPaqueteria.SelectedValue.ToEntero, FacturarSucursal:=factura.FacturarSucursal, VentaDesglosaIEPS:=factura.VentaDesglosaIEPS, RFCReceptor:=RFCReceptor, Adjunto:=Adjunto, DevolucionImportePagado:=factura.DevolucionImportePagado, EsGarantia:=factura.EsGarantia) Then
FormaPaqueteria:=RblPaqueteria.SelectedValue.ToEntero, FacturarSucursal:=factura.FacturarSucursal, VentaDesglosaIEPS:=factura.VentaDesglosaIEPS, RFCReceptor:=RFCReceptor, Adjunto:=Adjunto, DevolucionImportePagado:=factura.DevolucionImportePagado, EsGarantia:=factura.EsGarantia, ServicioDomicilio:=TrServicioDomicilio.Visible) Then
ErrorList.Add("Ocurrió un error al Generar la Venta.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
Else
If factura.TipoDocto.Contiene("Dev", "Egs") OrElse DtVentasNC IsNot Nothing OrElse CveEstatusRefacturacion > 0 OrElse CveAnticipoPadre > 0 Then
@@ -24088,7 +24098,15 @@ Partial Class Ventas
DdlContratosModal.DataSource = ObjContratos.DtResultados
DdlContratosModal.SelectedValue = ObjContratos.DtResultados(0)("CveContrato").ToString()
DdlContratosModal_SelectedIndexChanged(Nothing, Nothing)
GvContratoDetalles.HeaderRow.Cells(1).Style.Add("display", "none")
If GvContratoDetalles.HeaderRow IsNot Nothing Then
If GvContratoDetalles.HeaderRow.Cells.Count > 0 Then
GvContratoDetalles.HeaderRow.Cells(1).Style.Add("display", "none")
End If
End If
TxtObsFact.Text = PlantillaContrato(ObjContratos.DtResultados(0)("ObservacionesGenerales").ToString())
BtnCargarContratoDetalles_Click(Nothing, Nothing)
LbAgregar.Visible = True
UpPS.Update()
@@ -24103,6 +24121,62 @@ Partial Class Ventas
End If
ObjContratos.Dispose()
End Sub
Private Function PlantillaContrato(texto As String) As String
Dim Plantilla As String = texto
If Plantilla.Contains("{DIA}") Then
Plantilla = Plantilla.Replace("{DIA}", DateTime.Now.Day.ToString())
End If
If Plantilla.Contains("{MES}") Then
Dim fecha As DateTime = DateTime.Now
Dim formatoFecha = Globalization.CultureInfo.CurrentCulture.DateTimeFormat
Dim nombreMes = formatoFecha.GetMonthName(fecha.Month).ToUpper()
Plantilla = Plantilla.ToString().Replace("{MES}", nombreMes)
End If
If Plantilla.Contains("{AÑO}") Then
Plantilla = Plantilla.Replace("{AÑO}", DateTime.Now.Year.ToString())
End If
If Plantilla.Contains("{TC}") Then
Plantilla = Plantilla.Replace("{TC}", GlobalTipoCambio(Now).FormatoNumero)
End If
If Plantilla.Contains("{MESANTERIOR}") Then
Dim fecha As DateTime = DateTime.Now.AddMonths(-1)
Dim formatoFecha = Globalization.CultureInfo.CurrentCulture.DateTimeFormat
Dim nombreMes = formatoFecha.GetMonthName(fecha.Month).ToUpper()
Plantilla = Plantilla.ToString().Replace("{MESANTERIOR}", nombreMes)
End If
If Plantilla.Contains("{INICIOMESANTERIOR}") Then
Dim fecha As DateTime = DateTime.Now.AddMonths(-1)
Dim formatoFecha = Globalization.CultureInfo.CurrentCulture.DateTimeFormat
Dim nombreMes = formatoFecha.GetMonthName(fecha.Month).ToUpper()
Dim mesAnterior As String = String.Format("01 {0} {1}", nombreMes, fecha.Year)
Plantilla = Plantilla.ToString().Replace("{INICIOMESANTERIOR}", mesAnterior)
End If
If Plantilla.Contains("{FINMESANTERIOR}") Then
Dim fecha As DateTime = DateTime.Now.AddMonths(-1)
Dim formatoFecha = Globalization.CultureInfo.CurrentCulture.DateTimeFormat
Dim nombreMes = formatoFecha.GetMonthName(fecha.Month).ToUpper()
Dim LastDayOfMonth = DateTime.DaysInMonth(fecha.Year, fecha.Month)
Dim mesAnterior As String = String.Format("{0} {1} {2}", LastDayOfMonth, nombreMes, fecha.Year)
Plantilla = Plantilla.ToString().Replace("{FINMESANTERIOR}", mesAnterior)
End If
Return Plantilla
End Function
#End Region
#Region "DESCARGAR E IMPRIMIR LISTADO"
@@ -27621,6 +27695,23 @@ Partial Class Ventas
End If
End If
Dim Monedas As New List(Of Integer)
For Each gvr As GridViewRow In GvCxC.Rows
If gvr.FCCheckBox("ChkCxC").Checked Then
Monedas.Add(gvr.DataKey("CveMoneda").ToString().ToEntero())
End If
Next
Monedas = Monedas.Distinct().ToList()
If Monedas.Count > 0 Then
If Monedas.Count > 1 Then
Alert($"Debe seleccionar facturas de la misma moneda", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
DdlMoneda.SelectedValueExist(Monedas(0).ToString())
End If
RegistraScript("$('#ModalAplicarNC').modal('hide');", "EscondeModalNC")
CveVentaUsadoDevolucionEfectivo = -1