diff --git a/App_Code/ClsSubProyectos.vb b/App_Code/ClsSubProyectos.vb index 729e1c1f4..b93b363dc 100644 --- a/App_Code/ClsSubProyectos.vb +++ b/App_Code/ClsSubProyectos.vb @@ -387,7 +387,7 @@ Public Class ClsSubProyectos Public Function UpdateCentroCosto(CveSubProyecto As Integer, SubProyecto As String, IdSegNeg As Integer, Estatus As Integer, CveUsuario As Integer, CveEmpresa As Integer, CveProyecto As Integer, Optional Serie As String = "", Optional IVA As Double = 0.0, Optional Calle As String = "", Optional NoExt As String = "", Optional NoInt As String = "", Optional Colonia As String = "", Optional Localidad As String = "", Optional Municipio As String = "", Optional Estado As String = "", Optional Pais As String = "", Optional CP As String = "", Optional TipoSucursal As Integer = 0, Optional EsSucursal As Integer = 0, Optional CvePais As Integer = -1, Optional CveEstado As Integer = -1, Optional CveMunicipio As Integer = -1, Optional CveColonia As Integer = -1, Optional AplicaComercioExterior As Boolean = False, Optional Correo As String = "", Optional CvePrecioLista As Integer = -1, - Optional Telefono As String = "") As Boolean + Optional Telefono As String = "", Optional HorarioVerano As Integer = Nothing, Optional HorarioInvierno As Integer = Nothing) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_CentroCostoUpdate") @@ -421,6 +421,8 @@ Public Class ClsSubProyectos .Add("@Correo", SqlDbType.VarChar).Value = Correo .Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista .Add("@Telefono", SqlDbType.VarChar).Value = Telefono + .Add("@HorarioVerano", SqlDbType.Int).Value = HorarioVerano + .Add("@HorarioInvierno", SqlDbType.Int).Value = HorarioInvierno End With Try diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index f5d08a7ca..651133fb9 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -1981,7 +1981,7 @@ Public Class ClsVentas Return Retorno End Function - Public Function AddPromocionesDetalle(CvePromocion As Integer, CvePS As Integer, TipoPromocion As Integer, Promocion As Double, PUAnterior As Double, PUPromocion As Double, AplicaRestriccion As Boolean, AplicaLunes As Boolean, AplicaMartes As Boolean, AplicaMiercoles As Boolean, AplicaJueves As Boolean, AplicaViernes As Boolean, AplicaSabado As Boolean, AplicaDomingo As Boolean, HoraInicio As DateTime, HoraFin As DateTime) As Boolean + Public Function AddPromocionesDetalle(CvePromocion As Integer, CvePS As Integer, TipoPromocion As Integer, Promocion As Double, PUAnterior As Double, PUPromocion As Double, AplicaRestriccion As Boolean, AplicaLunes As Boolean, AplicaMartes As Boolean, AplicaMiercoles As Boolean, AplicaJueves As Boolean, AplicaViernes As Boolean, AplicaSabado As Boolean, AplicaDomingo As Boolean, HoraInicio As DateTime, HoraFin As DateTime, Optional CantidadMinima As Integer = 1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_PromocionesDetalleAdd") @@ -2003,6 +2003,7 @@ Public Class ClsVentas .Add("@AplicaDomingo", SqlDbType.Bit).Value = AplicaDomingo .Add("@HoraInicio", SqlDbType.DateTime).Value = HoraInicio .Add("@HoraFin", SqlDbType.DateTime).Value = HoraFin + .Add("@CantidadMinima", SqlDbType.Int).Value = CantidadMinima End With Try @@ -2014,7 +2015,7 @@ Public Class ClsVentas Return Retorno End Function - Public Function UpdatePromocionesDetalle(CvePromocionDetalle As Integer, CvePromocion As Integer, CvePS As Integer, TipoPromocion As Integer, Promocion As Double, PUAnterior As Double, PUPromocion As Double, AplicaRestriccion As Boolean, AplicaLunes As Boolean, AplicaMartes As Boolean, AplicaMiercoles As Boolean, AplicaJueves As Boolean, AplicaViernes As Boolean, AplicaSabado As Boolean, AplicaDomingo As Boolean, HoraInicio As DateTime, HoraFin As DateTime) As Boolean + Public Function UpdatePromocionesDetalle(CvePromocionDetalle As Integer, CvePromocion As Integer, CvePS As Integer, TipoPromocion As Integer, Promocion As Double, PUAnterior As Double, PUPromocion As Double, AplicaRestriccion As Boolean, AplicaLunes As Boolean, AplicaMartes As Boolean, AplicaMiercoles As Boolean, AplicaJueves As Boolean, AplicaViernes As Boolean, AplicaSabado As Boolean, AplicaDomingo As Boolean, HoraInicio As DateTime, HoraFin As DateTime, Optional CantidadMinima As Integer = 1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_PromocionesDetalleUpdate") @@ -2037,6 +2038,7 @@ Public Class ClsVentas .Add("@HoraInicio", SqlDbType.DateTime).Value = HoraInicio .Add("@HoraFin", SqlDbType.DateTime).Value = HoraFin .Add("@CvePromocionDetalle", SqlDbType.Int).Value = CvePromocionDetalle + .Add("@CantidadMinima", SqlDbType.Int).Value = CantidadMinima End With Try diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx index aadfa696e..e5d9d7edc 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -2657,6 +2657,21 @@
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
@@ -5234,18 +5249,29 @@ - function chkAnt(t, txt, importe, TotalSaldo) { + function chkAnt(t, txt, importe, TotalSaldo,CveMonedaAnticipo,TCAnticipo,CveMonedaOriginal) { var Total = ToDouble($get('TxtTotal').value); //TotalSaldo = Total; + var txtvalue = ToDouble(txt.value); + var importevalue = ToDouble(importe); + if (CveMonedaAnticipo = 1 && CveMonedaOriginal == 2) { + txtvalue = ToDouble(txtvalue / TCAnticipo); + importevalue = ToDouble(importevalue / TCAnticipo); + } else if (CveMonedaAnticipo = 2 && CveMonedaOriginal == 1) { + txtvalue = ToDouble(txtvalue * TCAnticipo); + importevalue = ToDouble(importevalue * TCAnticipo); + } //var SaldoCompra = parseFloat(parseFloat($get('HdnCompraSaldo').value).toFixed(2)); - var SaldoCompra = (TotalSaldo - FnSumaValoresAnt() + ToDouble(txt.value)).toFixed(2); // le agrego lo del valor actual para validarlo + var SaldoCompra = (TotalSaldo - FnSumaValoresAnt() + txtvalue).toFixed(2); // le agrego lo del valor actual para validarlo + + if (t.checked) { if (SaldoCompra > 0) { - if (SaldoCompra > importe) { - txt.value = ToDouble(importe).toFixed(2); + if (SaldoCompra > importevalue) { + txt.value = ToDouble(importevalue).toFixed(2); //SaldoCompra = SaldoCompra - importe; //$get('HdnCompraSaldo').value = SaldoCompra; @@ -5273,21 +5299,28 @@ } - function FnCambiaAnt(chk, txt, saldo, TotalSaldo) { + function FnCambiaAnt(chk, txt, saldo, TotalSaldo, CveMonedaAnticipo, TCAnticipo, CveMonedaOriginal) { var Total = ToDouble($get('TxtTotal').value); - var SaldoCompra = (TotalSaldo - FnSumaValoresAnt() + ToDouble(txt.value)).toFixed(2); // le agrego lo del valor actual para validarlo //parseFloat(parseFloat($get('HdnCompraSaldo').value).toFixed(2)); - if (SaldoCompra < 0) txt.value = SaldoCompra - txt.value; + var txtvalue = ToDouble(txt.value); + if (CveMonedaAnticipo = 1 && CveMonedaOriginal == 2) { + txtvalue = ToDouble(txtvalue / TCAnticipo); + } else if (CveMonedaAnticipo = 2 && CveMonedaOriginal == 1) { + txtvalue = ToDouble(txtvalue * TCAnticipo); + } + + var SaldoCompra = (TotalSaldo - FnSumaValoresAnt() + ToDouble(txtvalue)).toFixed(2); // le agrego lo del valor actual para validarlo //parseFloat(parseFloat($get('HdnCompraSaldo').value).toFixed(2)); + if (SaldoCompra < 0) txt.value = SaldoCompra - txtvalue; //minimo entre saldocompra y el saldoanticipo if (SaldoCompra < saldo) saldo = SaldoCompra; - if (ToDouble(txt.value) > 0) { + if (ToDouble(txtvalue) > 0) { chk.checked = true; } else { chk.checked = false; } - if (ToDouble(txt.value) > saldo) { + if (ToDouble(txtvalue) > saldo) { txt.value = saldo; alert("El Importe no debe de exceder a el saldo"); } diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index fd5cdfd60..af1d633b9 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -3238,8 +3238,10 @@ Partial Class Compras_Compras Private Sub CargaAnticipos(CveProveedor As Integer, Optional FiltroTipo As String = "-1") Dim ObjMovtos As New ClsMovimientos() - If ObjMovtos.GetAnticiposProveedor(CveProveedor, -1, CveMoneda:=DdlMoneda.SelectedValue.ToEntero, SelectTop:=-1, TipoDocto:=FiltroTipo) AndAlso ObjMovtos.DtResultados.Rows.Count > 0 Then - GVAnticipos.DataSource = ObjMovtos.DtResultados.FiltraParametros("Tipo = 'Act'") + If ObjMovtos.GetAnticiposProveedor(CveProveedor, -1, CveMoneda:=-1, SelectTop:=-1, TipoDocto:=FiltroTipo) AndAlso ObjMovtos.DtResultados.Rows.Count > 0 Then + Dim CveMoneda As Integer = If(ChkPagarConPesos.Checked, 1, If(ChkPagarConDolares.Checked, 2, DdlMoneda.SelectedValue.ToEntero)) + If DdlMoneda.SelectedValue.ToEntero = 1 AndAlso CveCompra > 0 Then DivPagarConDolares.Visible = True Else If CveCompra > 0 Then DivPagarConPesos.Visible = True + GVAnticipos.DataSource = ObjMovtos.DtResultados.FiltraParametros($"Tipo = 'Act' AND CveMoneda = {CveMoneda}") If ObjMovtos.DtResultados.FiltraParametros("Saldo > 0").Rows.Count > 0 Then BtnAceptarAnticipos.Enabled = True If DdlTipoComprobante.SelectedValue = "Fac" Then ImgAnticiposPendientes.Visible = True @@ -8037,7 +8039,7 @@ Partial Class Compras_Compras If gvr.FCCheckBox("Chk") IsNot Nothing AndAlso gvr.FCCheckBox("Chk").Checked Then CveCompraNC = gvr.DataKey("CveCompra").ToEntero - tipoCambioNC = gvr.DataKey("TCCompra").ToDecimal + tipoCambioNC = If(ChkPagarConPesos.Checked, GlobalTipoCambio(gvr.DataKey("Fecha").ToDate).ToDecimal, gvr.DataKey("TCCompra").ToDecimal) sumaAmortizacion = 0 If CvePrePolizaNueva > 0 Then @@ -8064,7 +8066,13 @@ Partial Class Compras_Compras ImporteMovimiento = gvr.FCTextBox("TxtAnticipo").Text.ToDecimal importeMN = ImporteMovimiento * tipoCambioNC sumaAmortizacion += ImporteMovimiento - sumaAmortizacionCompleto += ImporteMovimiento + sumaAmortizacionCompleto += ImporteMovimiento + + If ChkPagarConPesos.Checked Then + ImporteMovimiento = ImporteMovimiento * GlobalTipoCambio(gvr.DataKey("Fecha").ToDate).ToDecimal + ElseIf ChkPagarConDolares.Checked Then + ImporteMovimiento = ImporteMovimiento / gvr.DataKey("TCCompra").ToDecimal + End If If DdlMoneda.SelectedValue.ToEntero <> 1 Then IdCtaContable = CtaProveedorAnticiposExtranjera @@ -8101,7 +8109,13 @@ Partial Class Compras_Compras ImporteMovimiento = gvr.FCTextBox("TxtAnticipo").Text.ToDecimal importeMN = ImporteMovimiento * tipoCambioNC sumaAmortizacion += ImporteMovimiento - sumaAmortizacionCompleto += ImporteMovimiento + sumaAmortizacionCompleto += ImporteMovimiento + + If ChkPagarConPesos.Checked Then + ImporteMovimiento = ImporteMovimiento * GlobalTipoCambio(gvr.DataKey("Fecha").ToDate).ToDecimal + ElseIf ChkPagarConDolares.Checked Then + ImporteMovimiento = ImporteMovimiento / gvr.DataKey("TCCompra").ToDecimal + End If If DdlMoneda.SelectedValue.ToEntero <> 1 And UsuarioActual.CveEmpresa.Contiene(119) Then IdCtaContable = CtaProveedorExtranjera @@ -8138,15 +8152,24 @@ Partial Class Compras_Compras sumaAmortizacion += ImporteMovimiento sumaAmortizacionCompleto += ImporteMovimiento IdCtaContable = CtaProveedorAnticipos - CveCuenta = CveCuentaProveedorAnticipos - If ImporteMovimiento <> 0 Then - PorcentajePago = ImporteMovimiento / TxtTotal.Text.ToDecimal + CveCuenta = CveCuentaProveedorAnticipos + + PorcentajePago = ImporteMovimiento / TxtTotal.Text.ToDecimal + + If ChkPagarConPesos.Checked Then + ImporteMovimiento = ImporteMovimiento * GlobalTipoCambio(gvr.DataKey("Fecha").ToDate).ToDecimal + ElseIf ChkPagarConDolares.Checked Then + ImporteMovimiento = ImporteMovimiento / gvr.DataKey("TCCompra").ToDecimal + End If + + If ImporteMovimiento <> 0 Then + + Dim TipoCambioAnt = gvr.DataKey("TCCompra").ToDecimal - Dim TipoCambioAnt = gvr.DataKey("TCCompra").ToDecimal Dim usacomplementariaAnticipo As Boolean = False - usacomplementariaAnticipo = If(TipoCambioAnt > 1 AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119), True, False) - - + usacomplementariaAnticipo = If(TipoCambioAnt > 1 AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119), True, False) + + Dim ImporteAnt As Decimal = ImporteMovimiento Dim ImporteAntMN As Decimal = ImporteAnt * TipoCambioAnt If usacomplementariaAnticipo Then @@ -8166,10 +8189,16 @@ Partial Class Compras_Compras If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, ImporteAnt, "", ConceptoContable, ConceptoPartida, Fecha, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=ImporteAntMN, CvePrePolizaOriginal:=CvePrePolizaNueva, ImporteME:=If(tipoCambio = 1, 0, ImporteAnt), CveCompraAmortizacion:=CveCompraNC, CveCuenta:=CveCuenta) Then ErrorMovtosCxP = 1 + End If + + If ChkPagarConPesos.Checked Or ChkPagarConDolares.Checked Then + ImporteAnt = gvr.FCTextBox("TxtAnticipo").Text.ToDecimal + TipoCambioAnt = If(ChkPagarConPesos.Checked, GlobalTipoCambio(gvr.DataKey("Fecha").ToDate).ToDecimal, gvr.DataKey("TCCompra").ToDecimal) End If - If tipoCambio <> TipoCambioAnt Then - Dim importeFluctuacion = (ImporteAnt * tipoCambio) - (ImporteAnt * TipoCambioAnt) + Dim TipoCambioDiferencia = If(ChkPagarConDolares.Checked, GlobalTipoCambio(TxtFecha.Text.ToDate), TipoCambioCompra).ToDecimal + If TipoCambioDiferencia <> TipoCambioAnt Then + Dim importeFluctuacion = (ImporteAnt * TipoCambioDiferencia) - (ImporteAnt * TipoCambioAnt) If importeFluctuacion > 0 Then ConceptoContable = 64 @@ -8565,8 +8594,10 @@ Partial Class Compras_Compras If DdlMoneda.SelectedValue.ToEntero <> 1 Or gvr.DataKey("CveMoneda").ToEntero <> 1 Then IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria CveCuenta = UsuarioActual.Empresa.CveCuentaGananciaCambiaria - If TipoCambioCompra > tipoCambioNC Then - ImporteMovimiento = (sumaAmortizacion * TipoCambioCompra) - (sumaAmortizacion * tipoCambioNC) + Dim TipoCambioDiferenciaCambiaria = If(ChkPagarConPesos.Checked, GlobalTipoCambio(gvr.DataKey("Fecha").ToDate).ToDecimal, tipoCambioNC) + Dim TipoCambioDiferenciaCompra = If(ChkPagarConDolares.Checked, GlobalTipoCambio(TxtFecha.Text.ToDate), TipoCambioCompra).ToDecimal + If TipoCambioDiferenciaCompra > TipoCambioDiferenciaCambiaria Then + ImporteMovimiento = (sumaAmortizacion * TipoCambioDiferenciaCompra) - (sumaAmortizacion * TipoCambioDiferenciaCambiaria) ImporteMovimiento = ImporteMovimiento.RoundSQL() importeMN = ImporteMovimiento End If @@ -8586,8 +8617,10 @@ Partial Class Compras_Compras If DdlMoneda.SelectedValue.ToEntero <> 1 Or gvr.DataKey("CveMoneda").ToEntero <> 1 Then IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria CveCuenta = UsuarioActual.Empresa.CveCuentaPerdidaCambiaria - If tipoCambioNC > TipoCambioCompra Then - ImporteMovimiento = (sumaAmortizacion * tipoCambioNC) - (sumaAmortizacion * TipoCambioCompra) + Dim TipoCambioDiferenciaCambiaria = If(ChkPagarConPesos.Checked, GlobalTipoCambio(gvr.DataKey("Fecha").ToDate).ToDecimal, tipoCambioNC) + Dim TipoCambioDiferenciaCompra = If(ChkPagarConDolares.Checked, GlobalTipoCambio(TxtFecha.Text.ToDate), TipoCambioCompra).ToDecimal + If TipoCambioDiferenciaCambiaria > TipoCambioDiferenciaCompra Then + ImporteMovimiento = (sumaAmortizacion * TipoCambioDiferenciaCambiaria) - (sumaAmortizacion * TipoCambioDiferenciaCompra) ImporteMovimiento = ImporteMovimiento.RoundSQL() importeMN = ImporteMovimiento End If @@ -10064,8 +10097,8 @@ Partial Class Compras_Compras If e.Row.DBCampo("Saldo").ToDouble < 0 Then e.Row.Cells(3).ForeColor = Drawing.Color.Red If e.Row.DBCampo("Saldo").ToDouble = 0 Then e.Row.FCLiteral("LtlAnticipos").Text = "" - e.Row.FCCheckBox("Chk").Attributes.Add("onclick", String.Format("chkAnt(this,{0},{1},{2});", e.Row.FCTextBox("TxtAnticipo").ClientID, e.Row.DBCampo("Saldo"), If(CveCompra > 0, Saldo, If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, TmpDT.SUMD("ImporteConImpuestos"), TxtTotal.Text.ToDouble)))) 'SI ES UNA COMPRA NUEVA SE PONE EL TOTAL, SI NO EL SALDO - e.Row.FCTextBox("TxtAnticipo").Attributes.Add("onKeyUp", String.Format("FnCambiaAnt({0},this,{1},{2});", e.Row.FCCheckBox("Chk").ClientID, e.Row.DBCampo("Saldo"), If(CveCompra > 0, Saldo, If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, TmpDT.SUMD("ImporteConImpuestos"), TxtTotal.Text.ToDouble)))) 'SI ES UNA COMPRA NUEVA SE PONE EL TOTAL, SI NO EL SALDO + e.Row.FCCheckBox("Chk").Attributes.Add("onclick", String.Format("chkAnt(this,{0},{1},{2});", e.Row.FCTextBox("TxtAnticipo").ClientID, e.Row.DBCampo("Saldo"), If(CveCompra > 0, Saldo, If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, TmpDT.SUMD("ImporteConImpuestos"), TxtTotal.Text.ToDouble)), e.Row.DBCampo("CveMoneda").ToEntero, If(Not e.Row.DBCampo("TCCompra").ToDouble > 1, GlobalTipoCambio(e.Row.DBCampo("Fecha").ToDate), e.Row.DBCampo("TCCompra").ToDouble), DdlMoneda.SelectedValue.ToEntero)) 'SI ES UNA COMPRA NUEVA SE PONE EL TOTAL, SI NO EL SALDO + e.Row.FCTextBox("TxtAnticipo").Attributes.Add("onKeyUp", String.Format("FnCambiaAnt({0},this,{1},{2});", e.Row.FCCheckBox("Chk").ClientID, e.Row.DBCampo("Saldo"), If(CveCompra > 0, Saldo, If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, TmpDT.SUMD("ImporteConImpuestos"), TxtTotal.Text.ToDouble)), e.Row.DBCampo("CveMoneda").ToEntero, If(Not e.Row.DBCampo("TCCompra").ToDouble > 1, GlobalTipoCambio(e.Row.DBCampo("Fecha").ToDate), e.Row.DBCampo("TCCompra").ToDouble), DdlMoneda.SelectedValue.ToEntero)) 'SI ES UNA COMPRA NUEVA SE PONE EL TOTAL, SI NO EL SALDO If ChkNCInv.Checked Then e.Row.FCCheckBox("Chk").CssClass = "ChkAntNC" @@ -19017,4 +19050,16 @@ Partial Class Compras_Compras End If End If End Sub + +#Region "PAGAR CON DIFERENTE MONEDA" + Protected Sub ChkPagarConPesos_CheckedChanged(sender As Object, e As EventArgs) + CargaAnticipos(CveProveedor) + UpAnticipos.Update() + End Sub + Protected Sub ChkPagarConDolares_CheckedChanged(sender As Object, e As EventArgs) + CargaAnticipos(CveProveedor) + UpAnticipos.Update() + End Sub +#End Region + End Class \ No newline at end of file diff --git a/OS/Asignaciones.aspx.vb b/OS/Asignaciones.aspx.vb index ddec422b5..6b1b23c3a 100644 --- a/OS/Asignaciones.aspx.vb +++ b/OS/Asignaciones.aspx.vb @@ -167,10 +167,13 @@ Partial Class OS_Asignaciones End If For Each SubProyecto As DataRow In DtOSSubProyectos.Rows - Dim EstatusDeTipoProcesoMenor As Integer = TecnicosSubProyectos.FiltraParametros(String.Format("SubProyecto = '{0}'", SubProyecto.Item("SubProyecto"))).Rows(0).Item("CveEstatusOrdenServicio").ToString.ToEntero - Dim dtAuxiliar As New DataTable - dtAuxiliar = TecnicosSubProyectos.FiltraParametros(String.Format("SubProyecto = '{0}' AND CveEstatusOrdenServicio = {1}", SubProyecto.Item("SubProyecto"), EstatusDeTipoProcesoMenor), "", {"CveUsuario", "Nombre"}) - TecnicosResultado.Merge(dtAuxiliar) + Dim TecnicosSubProyectoAux As DataTable = TecnicosSubProyectos.FiltraParametros(String.Format("SubProyecto = '{0}'", SubProyecto.Item("SubProyecto"))) + If TecnicosSubProyectoAux.Rows.Count > 0 Then + Dim EstatusDeTipoProcesoMenor As Integer = TecnicosSubProyectoAux.Rows(0).Item("CveEstatusOrdenServicio").ToString.ToEntero + Dim dtAuxiliar As New DataTable + dtAuxiliar = TecnicosSubProyectos.FiltraParametros(String.Format("SubProyecto = '{0}' AND CveEstatusOrdenServicio = {1}", SubProyecto.Item("SubProyecto"), EstatusDeTipoProcesoMenor), "", {"CveUsuario", "Nombre"}) + TecnicosResultado.Merge(dtAuxiliar) + End If Next DtTecnicosSubProyectos = TecnicosResultado DdlTecnico.DataSource = TecnicosResultado @@ -186,6 +189,7 @@ Partial Class OS_Asignaciones Dim TieneError = False Dim CveEstatusOS = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveEstatusOrdenServicio", "TipoEstatus = 2", "CveEstatusOrdenServicio ASC") Dim time As DateTime + Dim contadorOrdenesAsignadas As Integer = 0 For Each row As GridViewRow In GvNA.Rows If row.RowType = DataControlRowType.DataRow Then @@ -194,6 +198,7 @@ Partial Class OS_Asignaciones If row.FCCheckBox("ChbxAsignar").Checked Then time = DateTime.Parse(String.Format("{0} {1}:{2} {3}", row.FCTextBox("FechaOS").Text, picker.Hour, picker.Minute, picker.AmPm)) + contadorOrdenesAsignadas += 1 If ObjOS.GetSubProyectosEstatusInicial(DdlTecnico.SelectedValue.ToEntero, 3, UsuarioActual.CveEmpresa) Then Dim subProyectoDelTecnico As DataTable @@ -217,11 +222,14 @@ Partial Class OS_Asignaciones End If End If Next - - If Not TieneError Then - Alert("Se asignaron las ordenes de servicio correctamente", TipoMensaje.MsgInformacion) - CargaOrdenesServiciosAsignadasXPersona() - CargaOrdenesServiciosNoAsignadas() + If contadorOrdenesAsignadas > 0 Then + If Not TieneError Then + Alert("Se asignaron las ordenes de servicio correctamente", TipoMensaje.MsgInformacion) + CargaOrdenesServiciosAsignadasXPersona() + CargaOrdenesServiciosNoAsignadas() + End If + Else + Alert("No se han seleccionado ordenes de servicio para asignar", TipoMensaje.MsgAdvertencia) End If diff --git a/OS/OrdenesServicios.aspx.vb b/OS/OrdenesServicios.aspx.vb index 115a6f2cf..9737cf675 100644 --- a/OS/OrdenesServicios.aspx.vb +++ b/OS/OrdenesServicios.aspx.vb @@ -1016,13 +1016,13 @@ Partial Class OS_OrdenesServicios MensajeAlert = New StringBuilder Dim Errores As Boolean = False - Dim EstatusOrdenServicio As Integer = DdlEstatusOS.SelectedValue.ToEntero + Dim EstatusOrdenServicio As Integer = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveEstatusOrdenServicio", "TipoEstatus = 1").ToEntero Dim DirectorioEmpresa = UsuarioActual.Empresa.Ruta If Not CveOS > 0 Then Dim bandera As Integer = DdlEstatusOS.SelectedValue.ToEntero - If Not ObjOrdenServicio.AddOrdenesServicios(CveCliente, DdlSubProyecto.SelectedValue.ToEntero, TxtSolicito.Text, TxtFechaRecibido.Text.ToDateTime, TxtDescripcion.Text, UsuarioActual.CveUsuario, DdlEstatusOS.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCotizacion, -1, -1, DdlTipoOrdenOS.SelectedValue.ToEntero, CveClienteSucursal:=DdlSucursalCliente.SelectedValue.ToEntero) Then + If Not ObjOrdenServicio.AddOrdenesServicios(CveCliente, DdlSubProyecto.SelectedValue.ToEntero, TxtSolicito.Text, TxtFechaRecibido.Text.ToDateTime, TxtDescripcion.Text, UsuarioActual.CveUsuario, EstatusOrdenServicio, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCotizacion, -1, -1, DdlTipoOrdenOS.SelectedValue.ToEntero, CveClienteSucursal:=DdlSucursalCliente.SelectedValue.ToEntero) Then Errores = True End If CargaCliente(CveCliente) @@ -1303,7 +1303,6 @@ Partial Class OS_OrdenesServicios TmpDT.Rows(Row.RowIndex)("Estatus") = "False" Row.FCLinkButton("imgEstatus").CssClass = "btn btn-circle btn-sm red" End If - UpDetalleOS.Update() End Sub Private Sub BtnAddGvDetalle_Click(sender As Object, e As EventArgs) Handles BtnAddGvDetalle.Click Dim ObjOS As New ClsOS @@ -1547,7 +1546,7 @@ Partial Class OS_OrdenesServicios Dim DetallesPendientes As Integer = TmpDT.COUNT("Estatus", "Estatus = 'False'").ToEntero - Dim TipoEstatusSeleccionado As Integer = EstatusOSDelUsuario.FiltroPrimeroValor("TipoEstatus", String.Format("CveEstatusOrdenServicio = {}", DdlEstatusOS.SelectedValue), "Orden ASC").ToEntero + Dim TipoEstatusSeleccionado As Integer = EstatusOSDelUsuario.FiltroPrimeroValor("TipoEstatus", String.Format("CveEstatusOrdenServicio = {0}", DdlEstatusOS.SelectedValue), "Orden ASC").ToEntero If DetallesPendientes = 0 AndAlso TipoEstatusSeleccionado = 2 Then 'Se estatus de OS a TERMINADO diff --git a/Planeacion/CatSubProyectos.aspx b/Planeacion/CatSubProyectos.aspx index 80674a796..839b2b060 100644 --- a/Planeacion/CatSubProyectos.aspx +++ b/Planeacion/CatSubProyectos.aspx @@ -83,7 +83,7 @@
@@ -182,96 +182,120 @@ -
- - - -
+
+ <%--
+
+ + + +
-
- - - -
+
+ + + +
+
--%> +
+ + + +
+
+ + + +
-
- - - -
+
+ + + +
-
-
-
- - - +
+
+
+ + + +
+
+ +
+
+ + <%-- --%> + +
-
-
- - <%-- --%> - -
+
+ + +
-
-
- - - -
+
+ + + +
-
- - - -
+
+ + + +
-
- - - -
+
+ + + +
-
- - - -
+
+ + + +
-
- - - -
+
+ + + +
-
- - - -
+
+ + +
-
- - -
+
+ + +
-
- - -
+
+ + +
-
- - -
+
+ + +
-
- - +
+ + +
+ +
+ + +
diff --git a/Planeacion/CatSubProyectos.aspx.vb b/Planeacion/CatSubProyectos.aspx.vb index 586249d7d..22121f394 100644 --- a/Planeacion/CatSubProyectos.aspx.vb +++ b/Planeacion/CatSubProyectos.aspx.vb @@ -284,7 +284,8 @@ Partial Class CatSubProyectos DdlPrecioLista.SelectedValueExist(GvRow.DataKey("CvePrecioLista")) TxtCorreo.Text = (GvRow.DataKey("Correo")) TxtTelefono.Text = (GvRow.DataKey("Telefono")) - + TxtHorarioVerano.Text = (GvRow.DataKey("HorarioVerano")) + TxtHorarioInvierno.Text = (GvRow.DataKey("HorarioInvierno")) 'COMERCIO EXTERIOR ChkAplicaComercioExterior.Checked = If(GvRow.DataKey("AplicaComercioExterior").ToString = "True", True, False) DdlPais.SelectedValueExist(GvRow.DataKey("CvePais")) @@ -350,6 +351,8 @@ Partial Class CatSubProyectos Dim TieneError = False Dim TipoSucursal As Integer Dim EsSucursal As Integer + Dim HorarioVerano As Integer = TxtHorarioVerano.Text.ToEntero + Dim HorarioInvierno As Integer = TxtHorarioInvierno.Text.ToEntero If ChkEsMatriz.Checked = True Then TipoSucursal = 1 Else TipoSucursal = 0 If ChkEsSucursal.Checked = True Then EsSucursal = 1 Else EsSucursal = 0 'GlobalDTProyectos(-1) = ObjSubproyectos.DtResultados @@ -368,16 +371,22 @@ Partial Class CatSubProyectos CveSubProyecto = ObjSubproyectos.CveSubProyecto End If Else - If Not ObjSubproyectos.UpdateCentroCosto(CveCentroCosto, TxtCentroCosto.Text.Trim, IdSeg, If(ChkEstatus.Checked = True, 1, 0), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlProyecto.SelectedValue.ToEntero, Serie:=TxtSerie.Text.Trim, IVA:=TxtIVA.Text.ToDecimal, Calle:=TxtCalle.Text.Trim, NoExt:=TxtNoExt.Text.Trim, - NoInt:=TxtNoInt.Text.Trim, Colonia:=TxtColonia.Text.Trim, Localidad:=TxtLocalidad.Text.Trim, Municipio:=TxtMunicipio.Text.Trim, Estado:=TxtEstado.Text.Trim, Pais:=TxtPais.Text.Trim, CP:=TxtCP.Text.Trim, TipoSucursal:=TipoSucursal, EsSucursal:=EsSucursal, - CvePais:=DdlPais.SelectedValue.ToEntero, CveEstado:=DdlEstado.SelectedValue.ToEntero, CveMunicipio:=DdlMunicipio.SelectedValue.ToEntero, CveColonia:=DdlColonia.SelectedValue.ToEntero, AplicaComercioExterior:=ChkAplicaComercioExterior.Checked, Correo:=TxtCorreo.Text, CvePrecioLista:=DdlPrecioLista.SelectedValue.ToEntero, - Telefono:=TxtTelefono.Text) Then + If (HorarioVerano > -13 And HorarioVerano < 13) And (HorarioInvierno > -13 And HorarioInvierno < 13) Then + If Not ObjSubproyectos.UpdateCentroCosto(CveCentroCosto, TxtCentroCosto.Text.Trim, IdSeg, If(ChkEstatus.Checked = True, 1, 0), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlProyecto.SelectedValue.ToEntero, Serie:=TxtSerie.Text.Trim, IVA:=TxtIVA.Text.ToDecimal, Calle:=TxtCalle.Text.Trim, NoExt:=TxtNoExt.Text.Trim, + NoInt:=TxtNoInt.Text.Trim, Colonia:=TxtColonia.Text.Trim, Localidad:=TxtLocalidad.Text.Trim, Municipio:=TxtMunicipio.Text.Trim, Estado:=TxtEstado.Text.Trim, Pais:=TxtPais.Text.Trim, CP:=TxtCP.Text.Trim, TipoSucursal:=TipoSucursal, EsSucursal:=EsSucursal, + CvePais:=DdlPais.SelectedValue.ToEntero, CveEstado:=DdlEstado.SelectedValue.ToEntero, CveMunicipio:=DdlMunicipio.SelectedValue.ToEntero, CveColonia:=DdlColonia.SelectedValue.ToEntero, AplicaComercioExterior:=ChkAplicaComercioExterior.Checked, Correo:=TxtCorreo.Text, CvePrecioLista:=DdlPrecioLista.SelectedValue.ToEntero, + Telefono:=TxtTelefono.Text, HorarioVerano:=TxtHorarioVerano.Text.ToEntero, HorarioInvierno:=TxtHorarioInvierno.Text.ToEntero) Then + TieneError = True + End If + Else + Alert("Los valores de horario no deben ser superiores a '12' o menor a '-12'", TipoMensaje.MsgAdvertencia) TieneError = True End If End If + If Not TieneError Then ObjSubproyectos.Commit() If HdnModalidad.Value = "I" Then diff --git a/Ventas/Promociones.aspx b/Ventas/Promociones.aspx index 854e965d3..8981c5be1 100644 --- a/Ventas/Promociones.aspx +++ b/Ventas/Promociones.aspx @@ -81,15 +81,15 @@
- <%-- + <%-- --%> - +
-
+
@@ -153,7 +153,7 @@
- + <%----%> @@ -227,10 +227,11 @@
- + + @@ -243,6 +244,19 @@
+ +
+ +
+ + + + + + +
+
+
@@ -310,8 +324,8 @@
-
+