Ajusrtes AF, Porcentaje OC

This commit is contained in:
rakcsle
2022-04-04 10:52:22 -07:00
parent 2b6daa08cd
commit a150e56d70
11 changed files with 836 additions and 181 deletions

View File

@@ -267,11 +267,11 @@
<ajax:MaskedEditExtender ID="METxtFechaBaja" runat="server" TargetControlID="TxtFechaBaja" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left" BehaviorID="_content_MEEFecha" Century="2000" CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" CultureThousandsPlaceholder="" CultureTimePlaceholder=""></ajax:MaskedEditExtender> <ajax:MaskedEditExtender ID="METxtFechaBaja" runat="server" TargetControlID="TxtFechaBaja" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left" BehaviorID="_content_MEEFecha" Century="2000" CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" CultureThousandsPlaceholder="" CultureTimePlaceholder=""></ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="CETxtFechaBaja" runat="server" TargetControlID="TxtFechaBaja" PopupButtonID="LnkTxtFechaBaja" PopupPosition="BottomRight" BehaviorID="_content_Calendario"></ajax:CalendarExtender> <ajax:CalendarExtender ID="CETxtFechaBaja" runat="server" TargetControlID="TxtFechaBaja" PopupButtonID="LnkTxtFechaBaja" PopupPosition="BottomRight" BehaviorID="_content_Calendario"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RfvTxtFechaBaja" runat="server" ControlToValidate="TxtFechaBaja" Display="None" ErrorMessage="El campo <b>''Fecha''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator> <%-- <asp:RequiredFieldValidator ID="RfvTxtFechaBaja" runat="server" ControlToValidate="TxtFechaBaja" Display="None" ErrorMessage="El campo <b>''Fecha''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CVTxtFechaBaja" runat="server" ControlToValidate="TxtFechaBaja" Display="None" ErrorMessage="El campo <b>''Fecha''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator> <asp:CompareValidator ID="CVTxtFechaBaja" runat="server" ControlToValidate="TxtFechaBaja" Display="None" ErrorMessage="El campo <b>''Fecha''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender32" runat="server" HighlightCssClass="vco" TargetControlID="RfvTxtFechaBaja" Width="350px" BehaviorID="_content_VCOFechaCompra1"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender32" runat="server" HighlightCssClass="vco" TargetControlID="RfvTxtFechaBaja" Width="350px" BehaviorID="_content_VCOFechaCompra1"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender33" runat="server" HighlightCssClass="vco" TargetControlID="CVTxtFechaBaja" Width="350px" BehaviorID="_content_VCOFechaCompra2"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender33" runat="server" HighlightCssClass="vco" TargetControlID="CVTxtFechaBaja" Width="350px" BehaviorID="_content_VCOFechaCompra2"></ajax:ValidatorCalloutExtender>--%>
<i></i> <i></i>
</div> </div>
</div> </div>

View File

@@ -265,6 +265,19 @@ Partial Class AF_AF
End Set End Set
End Property End Property
Private Property IndexProduccion As Integer
Get
If ViewState("IndexProduccion") Is Nothing Then
ViewState("IndexProduccion") = -1
End If
Return ViewState("IndexProduccion").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("IndexProduccion") = value
End Set
End Property
Private Property CveMantenimiento As Integer Private Property CveMantenimiento As Integer
Get Get
If ViewState("CveMantenimiento") Is Nothing Then If ViewState("CveMantenimiento") Is Nothing Then
@@ -278,6 +291,18 @@ Partial Class AF_AF
End Property End Property
Private Property IndexMantenimiento As Integer
Get
If ViewState("IndexMantenimiento") Is Nothing Then
ViewState("IndexMantenimiento") = -1
End If
Return ViewState("IndexMantenimiento").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("IndexMantenimiento") = value
End Set
End Property
Private Property CvePlagaEnfermedad As Integer Private Property CvePlagaEnfermedad As Integer
Get Get
If ViewState("CvePlagaEnfermedad") Is Nothing Then If ViewState("CvePlagaEnfermedad") Is Nothing Then
@@ -290,8 +315,62 @@ Partial Class AF_AF
End Set End Set
End Property End Property
Private Property IndexPlagaEnfermedad As Integer
Get
If ViewState("IndexPlagaEnfermedad") Is Nothing Then
ViewState("IndexPlagaEnfermedad") = -1
End If
Return ViewState("IndexPlagaEnfermedad").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("IndexPlagaEnfermedad") = value
End Set
End Property
#End Region #End Region
Private Property DT_Produccion As DataTable
Get
If ViewState("DT_Produccion") Is Nothing Then
ViewState("DT_Produccion") = CreaDTProduccion()
End If
Return DirectCast(ViewState("DT_Produccion"), DataTable)
End Get
Set(value As DataTable)
ViewState("DT_Produccion") = value
End Set
End Property
Private Property DT_PlgaEfermedad As DataTable
Get
If ViewState("DT_PlgaEfermedad") Is Nothing Then
ViewState("DT_PlgaEfermedad") = CreaDTPlagaEngermedad()
End If
Return DirectCast(ViewState("DT_PlgaEfermedad"), DataTable)
End Get
Set(value As DataTable)
ViewState("DT_PlgaEfermedad") = value
End Set
End Property
Private Property DT_Mantenimiento As DataTable
Get
If ViewState("DT_Mantenimiento") Is Nothing Then
ViewState("DT_Mantenimiento") = CreaDTMantenimiento()
End If
Return DirectCast(ViewState("DT_Mantenimiento"), DataTable)
End Get
Set(value As DataTable)
ViewState("DT_Mantenimiento") = value
End Set
End Property
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then If Not IsPostBack Then
@@ -311,6 +390,7 @@ Partial Class AF_AF
CargaProduccion() CargaProduccion()
CargaMantenimento() CargaMantenimento()
CargaPlagaEnfermedad() CargaPlagaEnfermedad()
ModalidadesPaginaAF()
'Configuración de Modalidad Update 'Configuración de Modalidad Update
BtnGuardar.Text = "Guardar Cambios" BtnGuardar.Text = "Guardar Cambios"
@@ -343,9 +423,11 @@ Partial Class AF_AF
If Request("Op") IsNot Nothing Then If Request("Op") IsNot Nothing Then
ModalidadesPaginaAF(Request("Op").ToString) ModalidadesPaginaAFInicial(Request("Op").ToString)
End If End If
End If End If
End Sub End Sub
Private Sub cargaOrdenesdeservicio() Private Sub cargaOrdenesdeservicio()
@@ -431,7 +513,9 @@ Partial Class AF_AF
CveEmpresaActual = UsuarioActual.CveEmpresa CveEmpresaActual = UsuarioActual.CveEmpresa
End Sub End Sub
Private Sub ModalidadesPaginaAF(Optional Op As String = "")
Private Sub ModalidadesPaginaAFInicial(Optional Op As String = "")
TabProduccion.Visible = False TabProduccion.Visible = False
TabPlagaEnfermedad.Visible = False TabPlagaEnfermedad.Visible = False
@@ -440,28 +524,113 @@ Partial Class AF_AF
LblFechaCompra.Text = "Fecha de Compra:" LblFechaCompra.Text = "Fecha de Compra:"
LblFechaBaja.Text = "Fecha de Baja:" LblFechaBaja.Text = "Fecha de Baja:"
If Op.Length > 0 Then
'Arbol Frutal 'Arbol Frutal
If DdlTipoActivoFijo.SelectedValue.ToEntero = 150 And DdlSubTipoActivoFijo.SelectedValue.ToEntero = 1936 And CveActivoFijo > 0 Then If Op = "AR" Then
Dim CveTipoActivoFijoTmp As Integer = GlobalDTTipoActivoFijo(UsuarioActual.CveEmpresa).FiltraParametros("", "TipoActivoFijo").FiltroPrimeroValor("CveTipoActivoFijo", $"TipoActivoFijo = 'ARBOLES FRUTALES'").ToEntero
DdlTipoActivoFijo.SelectedValueExist(CveTipoActivoFijoTmp)
DdlTipoActivoFijo_SelectedIndexChanged(Nothing, Nothing)
Dim CveSubTipoActivoFijoTemp As Integer = GlobalDTSubTipoActivoFijo(CveEmpresaActual).FiltraParametros(String.Format(" CveTipoActivoFijo = {0}", DdlTipoActivoFijo.SelectedValue), "SubTipoActivoFijo").FiltroPrimeroValor("CveSubTipoActivoFijo", $"SubTipoActivoFijo = 'ARBOLES FRUTALES'").ToEntero
DdlSubTipoActivoFijo.SelectedValueExist(CveSubTipoActivoFijoTemp)
DdlSubTipoActivoFijo_SelectedIndexChanged(Nothing, Nothing)
LblFechaCompra.Text = "Fecha de Nacimiento"
LblFechaBaja.Text = "Fecha de Muerte"
TabProduccion.Visible = True
End If
'Arbol Apicola
If Op = "AP" Then
Dim CveTipoActivoFijoTmp As Integer = GlobalDTTipoActivoFijo(UsuarioActual.CveEmpresa).FiltraParametros("", "TipoActivoFijo").FiltroPrimeroValor("CveTipoActivoFijo", $"TipoActivoFijo = 'APICOLAS'").ToEntero
DdlTipoActivoFijo.SelectedValueExist(CveTipoActivoFijoTmp)
DdlTipoActivoFijo_SelectedIndexChanged(Nothing, Nothing)
Dim CveSubTipoActivoFijoTemp As Integer = GlobalDTSubTipoActivoFijo(CveEmpresaActual).FiltraParametros(String.Format(" CveTipoActivoFijo = {0}", DdlTipoActivoFijo.SelectedValue), "SubTipoActivoFijo").FiltroPrimeroValor("CveSubTipoActivoFijo", $"SubTipoActivoFijo = 'APICOLAS'").ToEntero
DdlSubTipoActivoFijo.SelectedValueExist(CveSubTipoActivoFijoTemp)
DdlSubTipoActivoFijo_SelectedIndexChanged(Nothing, Nothing)
TabPlagaEnfermedad.Visible = True
End If
'Pozos
If Op = "PO" Then
Dim CveTipoActivoFijoTmp As Integer = GlobalDTTipoActivoFijo(UsuarioActual.CveEmpresa).FiltraParametros("", "TipoActivoFijo").FiltroPrimeroValor("CveTipoActivoFijo", $"TipoActivoFijo = 'POZOS'").ToEntero
DdlTipoActivoFijo.SelectedValueExist(CveTipoActivoFijoTmp)
DdlTipoActivoFijo_SelectedIndexChanged(Nothing, Nothing)
Dim CveSubTipoActivoFijoTemp As Integer = GlobalDTSubTipoActivoFijo(CveEmpresaActual).FiltraParametros(String.Format(" CveTipoActivoFijo = {0}", DdlTipoActivoFijo.SelectedValue), "SubTipoActivoFijo").FiltroPrimeroValor("CveSubTipoActivoFijo", $"SubTipoActivoFijo = 'POZOS'").ToEntero
DdlSubTipoActivoFijo.SelectedValueExist(CveSubTipoActivoFijoTemp)
DdlSubTipoActivoFijo_SelectedIndexChanged(Nothing, Nothing)
TabServyMant.Visible = True
End If
'Inmuebles
If Op = "IN" Then
Dim CveTipoActivoFijoTmp As Integer = GlobalDTTipoActivoFijo(UsuarioActual.CveEmpresa).FiltraParametros("", "TipoActivoFijo").FiltroPrimeroValor("CveTipoActivoFijo", $"TipoActivoFijo = 'INMUEBLES'").ToEntero
DdlTipoActivoFijo.SelectedValueExist(CveTipoActivoFijoTmp)
DdlTipoActivoFijo_SelectedIndexChanged(Nothing, Nothing)
Dim CveSubTipoActivoFijoTemp As Integer = GlobalDTSubTipoActivoFijo(CveEmpresaActual).FiltraParametros(String.Format(" CveTipoActivoFijo = {0}", DdlTipoActivoFijo.SelectedValue), "SubTipoActivoFijo").FiltroPrimeroValor("CveSubTipoActivoFijo", $"SubTipoActivoFijo = 'INMUEBLES'").ToEntero
DdlSubTipoActivoFijo.SelectedValueExist(CveSubTipoActivoFijoTemp)
DdlSubTipoActivoFijo_SelectedIndexChanged(Nothing, Nothing)
End If
UpDatos.Update()
End If
End Sub
Private Sub ModalidadesPaginaAF()
TabProduccion.Visible = False
TabPlagaEnfermedad.Visible = False
TabServyMant.Visible = False
LblFechaCompra.Text = "Fecha de Compra:"
LblFechaBaja.Text = "Fecha de Baja:"
If DdlTipoActivoFijo.SelectedItem.Text = "ARBOLES FRUTALES" And DdlSubTipoActivoFijo.SelectedItem.Text = "ARBOLES FRUTALES" Then
LblFechaCompra.Text = "Fecha de Nacimiento" LblFechaCompra.Text = "Fecha de Nacimiento"
LblFechaBaja.Text = "Fecha de Muerte" LblFechaBaja.Text = "Fecha de Muerte"
TabProduccion.Visible = True TabProduccion.Visible = True
End If End If
'Arbol Apicola 'Arbol Apicola
If DdlTipoActivoFijo.SelectedValue.ToEntero = 151 And DdlSubTipoActivoFijo.SelectedValue.ToEntero = 1937 And CveActivoFijo > 0 Then If DdlTipoActivoFijo.SelectedItem.Text = "APICOLAS" And DdlSubTipoActivoFijo.SelectedItem.Text = "APICOLAS" Then
TabPlagaEnfermedad.Visible = True TabPlagaEnfermedad.Visible = True
End If End If
'Pozos 'Pozos
If DdlTipoActivoFijo.SelectedValue.ToEntero = 152 And DdlSubTipoActivoFijo.SelectedValue.ToEntero = 1938 And CveActivoFijo > 0 Then If DdlTipoActivoFijo.SelectedItem.Text = "POZOS" And DdlSubTipoActivoFijo.SelectedItem.Text = "POZOS" Then
TabServyMant.Visible = True TabServyMant.Visible = True
End If End If
'Inmuebles 'Inmuebles
If DdlTipoActivoFijo.SelectedValue.ToEntero = 153 And DdlSubTipoActivoFijo.SelectedValue.ToEntero = 1939 And CveActivoFijo > 0 Then If DdlTipoActivoFijo.SelectedItem.Text = "INMUEBLES" And DdlSubTipoActivoFijo.SelectedItem.Text = "INMUEBLES" Then
End If End If
UpDatos.Update() UpDatos.Update()
End Sub End Sub
@@ -580,12 +749,84 @@ Partial Class AF_AF
DdlModalCultivosCuadro.DataBind() DdlModalCultivosCuadro.DataBind()
DdlModalCultivosCuadro.Items.Insert(0, New ListItem("Seleccione uno", "-1")) DdlModalCultivosCuadro.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
End Sub End Sub
Private Function CreaDTProduccion() As DataTable
'CveProduccion, CveActivoFijo, CveCultivoCuadroDetalle, Cantidad, Fecha, CveUsuario, FechaIng, Codigo, Descripcion, Usuario, Cuadro
Dim DTProduccion As New DataTable
DTProduccion.Columns.Add("CveProduccion", GetType(Integer))
DTProduccion.Columns.Add("CveActivoFijo", GetType(Integer))
DTProduccion.Columns.Add("CveCultivoCuadroDetalle", GetType(Integer))
DTProduccion.Columns.Add("Cantidad", GetType(Decimal))
DTProduccion.Columns.Add("Fecha", GetType(Date))
DTProduccion.Columns.Add("Cuadro", GetType(String))
DTProduccion.Columns.Add("CveUsuario", GetType(Integer))
DTProduccion.Columns.Add("FechaIng", GetType(Date))
DTProduccion.Columns.Add("Codigo", GetType(String))
DTProduccion.Columns.Add("Descripcion", GetType(String))
DTProduccion.Columns.Add("Usuario", GetType(String))
Return DTProduccion
End Function
Private Function CreaDTPlagaEngermedad() As DataTable
'CvePlagaEnfermedad,CveActivoFijo,Observaciones,Fecha,CveUsuario,FechaIng
Dim DTPlgaEfermedad As New DataTable
DTPlgaEfermedad.Columns.Add("CvePlagaEnfermedad", GetType(Integer))
DTPlgaEfermedad.Columns.Add("CveActivoFijo", GetType(Integer))
DTPlgaEfermedad.Columns.Add("Observaciones", GetType(String))
DTPlgaEfermedad.Columns.Add("Fecha", GetType(Date))
DTPlgaEfermedad.Columns.Add("CveUsuario", GetType(Integer))
DTPlgaEfermedad.Columns.Add("FechaIng", GetType(Date))
DTPlgaEfermedad.Columns.Add("Usuario", GetType(String))
Return DTPlgaEfermedad
End Function
Private Function CreaDTMantenimiento() As DataTable
'CveMantenimiento, CveActivoFijo, Mantenimiento, Observaciones, Fecha, FechaIng, CveUsuario, Codigo, Descripcion,Usuario,Archivo
Dim DTMantenimiento As New DataTable
DTMantenimiento.Columns.Add("CveMantenimiento", GetType(Integer))
DTMantenimiento.Columns.Add("CveActivoFijo", GetType(Integer))
DTMantenimiento.Columns.Add("Mantenimiento", GetType(String))
DTMantenimiento.Columns.Add("Observaciones", GetType(String))
DTMantenimiento.Columns.Add("Fecha", GetType(Date))
DTMantenimiento.Columns.Add("FechaIng", GetType(Date))
DTMantenimiento.Columns.Add("CveUsuario", GetType(Integer))
DTMantenimiento.Columns.Add("Codigo", GetType(String))
DTMantenimiento.Columns.Add("Descripcion", GetType(String))
DTMantenimiento.Columns.Add("Usuario", GetType(String))
DTMantenimiento.Columns.Add("Archivo", GetType(String))
Return DTMantenimiento
End Function
Protected Sub DdlProyecto_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlProyecto.SelectedIndexChanged Protected Sub DdlProyecto_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlProyecto.SelectedIndexChanged
CargaSubProyecto() CargaSubProyecto()
End Sub End Sub
Private Sub DdlSubProyecto_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlSubProyecto.SelectedIndexChanged Private Sub DdlSubProyecto_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlSubProyecto.SelectedIndexChanged
CargaFolios() CargaFolios()
CargaCultivos()
End Sub End Sub
Protected Sub DdlTipoActivoFijo_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlTipoActivoFijo.SelectedIndexChanged Protected Sub DdlTipoActivoFijo_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlTipoActivoFijo.SelectedIndexChanged
@@ -2247,6 +2488,83 @@ Partial Class AF_AF
Else Else
ErrorGuardar = True ErrorGuardar = True
End If End If
If Not ErrorGuardar Then
For Each GvRowProduccion As GridViewRow In GvProduccion.Rows
If Not ObjAF.AddProduccion(ObjAF.CveActivoFijo, GvRowProduccion.DataKey("CveCultivoCuadroDetalle").ToEntero, GvRowProduccion.DataKey("Cantidad").ToDecimal, GvRowProduccion.DataKey("Fecha").ToDate, UsuarioActual.CveUsuario) Then
ErrorGuardar = True
Exit For
End If
Next
If Not ErrorGuardar Then
For Each GvRowPlagaEnfermedad As GridViewRow In GvPlagaEnfermedad.Rows
If Not ObjAF.AddPlagaEnfermedad(ObjAF.CveActivoFijo, GvRowPlagaEnfermedad.DataKey("Observaciones"), GvRowPlagaEnfermedad.DataKey("Fecha").ToDate, UsuarioActual.CveUsuario) Then
ErrorGuardar = True
Exit For
End If
Next
End If
If Not ErrorGuardar Then
For Each GvRowMantenimiento As GridViewRow In GvMantenimientos.Rows
Dim CveMantenimientoTemp As Integer = ObjAF.AddMantenimientos(ObjAF.CveActivoFijo, GvRowMantenimiento.DataKey("Mantenimiento"), GvRowMantenimiento.DataKey("Observaciones"), GvRowMantenimiento.DataKey("Fecha").ToDate, UsuarioActual.CveUsuario, "")
If CveMantenimientoTemp > 0 Then
If GvRowMantenimiento.DataKey("Archivo").Trim.Length > 0 Then
Dim fi As New FileInfo(GvRowMantenimiento.DataKey("Archivo").Trim)
If fi.Exists Then
Dim Filename As String = fi.Name
Dim FileExtension As String = IO.Path.GetExtension(fi.FullName)
Dim Archivo As New System.IO.FileInfo(String.Format("{0}AF\Mantenimientos\{1}", UsuarioActual.Empresa.Ruta, $"{CveMantenimientoTemp}.{FileExtension}"))
If Archivo.Exists() Then
Archivo.Delete()
End If
If Not Filename.FilesMove(String.Format("{0}", CveMantenimientoTemp.ToString), String.Format("{0}AF\Mantenimientos", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) Then
ErrorGuardar = True
Alert("Error al mover Archivo", TipoMensaje.MsgError)
End If
If Not ErrorGuardar Then
If Not ObjAF.UpdateMantenimientos(CveMantenimientoTemp, ObjAF.CveActivoFijo, GvRowMantenimiento.DataKey("Mantenimiento"), GvRowMantenimiento.DataKey("Observaciones"), GvRowMantenimiento.DataKey("Fecha").ToDate, UsuarioActual.CveUsuario, $"{CveMantenimientoTemp}{FileExtension}") Then
ErrorGuardar = True
End If
End If
End If
End If
Else
ErrorGuardar = True
Exit For
End If
Next
End If
End If
End If End If
'PREPOLIZA DE IMPORTACION DESDE ALMACEN 'PREPOLIZA DE IMPORTACION DESDE ALMACEN
@@ -2780,6 +3098,7 @@ Partial Class AF_AF
CargaCaracteristicas() CargaCaracteristicas()
CargaDispositivos() CargaDispositivos()
ModalidadesPaginaAF() ModalidadesPaginaAF()
End Sub End Sub
#Region "CARGAR CUENTA CONTABLE" #Region "CARGAR CUENTA CONTABLE"
@@ -3853,6 +4172,10 @@ Partial Class AF_AF
Private Sub CargaProduccion() Private Sub CargaProduccion()
If CveActivoFijo > 0 Then
Dim ObjAF As New ClsAF Dim ObjAF As New ClsAF
If ObjAF.GetProduccion(CveActivoFijo, UsuarioActual.CveEmpresa) Then If ObjAF.GetProduccion(CveActivoFijo, UsuarioActual.CveEmpresa) Then
@@ -3862,6 +4185,13 @@ Partial Class AF_AF
End If End If
ObjAF.Dispose() ObjAF.Dispose()
Else
GvProduccion.DataSource = DT_Produccion
End If
GvProduccion.DataBind() GvProduccion.DataBind()
UpProduccion.Update() UpProduccion.Update()
@@ -3871,9 +4201,13 @@ Partial Class AF_AF
Protected Sub LnkAgregarProduccion_Click(sender As Object, e As EventArgs) Protected Sub LnkAgregarProduccion_Click(sender As Object, e As EventArgs)
CveProduccion = -1
IndexProduccion = -1
LblModaProduccionTitulo.Text = "Agregar Producción" LblModaProduccionTitulo.Text = "Agregar Producción"
LnkModalAgregarProduccion.Text = "Agregar" LnkModalAgregarProduccion.Text = "Agregar"
CveProduccion = -1
DdlModalCultivosCuadro.SelectedValueExist(-1) DdlModalCultivosCuadro.SelectedValueExist(-1)
TxtModalProduccionCantidad.Text = "" TxtModalProduccionCantidad.Text = ""
@@ -3888,7 +4222,15 @@ Partial Class AF_AF
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
If CveActivoFijo > 0 Then
CveProduccion = GvRow.DataKey("CveProduccion").ToEntero CveProduccion = GvRow.DataKey("CveProduccion").ToEntero
Else
IndexProduccion = GvRow.RowIndex
End If
Dim CveCultivoCuadroDetalle As Integer = GvRow.DataKey("CveCultivoCuadroDetalle").ToEntero Dim CveCultivoCuadroDetalle As Integer = GvRow.DataKey("CveCultivoCuadroDetalle").ToEntero
Dim Cantidad As Decimal = GvRow.DataKey("Cantidad").ToDecimal Dim Cantidad As Decimal = GvRow.DataKey("Cantidad").ToDecimal
Dim Fecha As Date = GvRow.DataKey("Fecha").ToDate Dim Fecha As Date = GvRow.DataKey("Fecha").ToDate
@@ -3910,20 +4252,28 @@ Partial Class AF_AF
Protected Sub LnkGvProduccionRemove_Click(sender As Object, e As EventArgs) Protected Sub LnkGvProduccionRemove_Click(sender As Object, e As EventArgs)
Dim ErrorProceso As Boolean = False Dim ErrorProceso As Boolean = False
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
If CveActivoFijo > 0 Then
Dim CveProduccionEliminar As Integer = GvRow.DataKey("CveProduccion").ToEntero Dim CveProduccionEliminar As Integer = GvRow.DataKey("CveProduccion").ToEntero
Dim ObjAF As New ClsAF Dim ObjAF As New ClsAF
If ObjAF.RemoveProduccion(CveProduccionEliminar, UsuarioActual.CveEmpresa) Then If ObjAF.RemoveProduccion(CveProduccionEliminar, UsuarioActual.CveEmpresa) Then
ErrorProceso = False ErrorProceso = False
Else Else
ErrorProceso = True ErrorProceso = True
End If End If
ObjAF.Dispose() ObjAF.Dispose()
Else
Dim IndexProduccionEliminar As Integer = GvRow.RowIndex
DT_Produccion.Rows(IndexProduccionEliminar).Delete()
DT_Produccion.AcceptChanges()
ErrorProceso = False
End If
If Not ErrorProceso Then If Not ErrorProceso Then
Alert("Producción Eliminada Correctamente.") Alert("Producción Eliminada Correctamente.")
@@ -3936,6 +4286,13 @@ Partial Class AF_AF
Protected Sub LnkModalAgregarProduccion_Click(sender As Object, e As EventArgs) Protected Sub LnkModalAgregarProduccion_Click(sender As Object, e As EventArgs)
Dim ErrorProceso As Boolean = False Dim ErrorProceso As Boolean = False
If CveActivoFijo > 0 Then
Dim ObjAF As New ClsAF Dim ObjAF As New ClsAF
If CveProduccion > 0 Then If CveProduccion > 0 Then
@@ -3952,12 +4309,37 @@ Partial Class AF_AF
End If End If
End If End If
ObjAF.Dispose() ObjAF.Dispose()
Else
If IndexProduccion >= 0 Then
DT_Produccion.Rows(IndexProduccion)("Cuadro") = DdlModalCultivosCuadro.SelectedItem.Text
DT_Produccion.Rows(IndexProduccion)("CveCultivoCuadroDetalle") = DdlModalCultivosCuadro.SelectedValue.ToEntero
DT_Produccion.Rows(IndexProduccion)("Fecha") = TxtModalProduccionFecha.Text.ToDate
DT_Produccion.Rows(IndexProduccion)("Cantidad") = TxtModalProduccionCantidad.Text.ToDecimal
Else
Dim nRow As DataRow = DT_Produccion.NewRow
nRow("Cuadro") = DdlModalCultivosCuadro.SelectedItem.Text
nRow("CveCultivoCuadroDetalle") = DdlModalCultivosCuadro.SelectedValue.ToEntero
nRow("Fecha") = TxtModalProduccionFecha.Text.ToDate
nRow("Cantidad") = TxtModalProduccionCantidad.Text.ToDecimal
DT_Produccion.Rows.Add(nRow)
ErrorProceso = False
End If
DT_Produccion.AcceptChanges()
End If
If Not ErrorProceso Then If Not ErrorProceso Then
RegistraScript("$('#DVModalMantenimiento').modal('hide');") RegistraScript("$('#DVModalProduccion').modal('hide');")
Alert("Producción Agregada Correctamente.") Alert("Producción Agregada Correctamente.")
CargaProduccion() CargaProduccion()
End If End If
@@ -3973,15 +4355,21 @@ Partial Class AF_AF
Private Sub CargaMantenimento() Private Sub CargaMantenimento()
Dim ObjAF As New ClsAF If CveActivoFijo > 0 Then
Dim ObjAF As New ClsAF
If ObjAF.GetMantenimientos(CveActivoFijo, UsuarioActual.CveEmpresa) Then If ObjAF.GetMantenimientos(CveActivoFijo, UsuarioActual.CveEmpresa) Then
GvMantenimientos.DataSource = ObjAF.DtResultados GvMantenimientos.DataSource = ObjAF.DtResultados
Else Else
GvMantenimientos.DataSource = Nothing GvMantenimientos.DataSource = Nothing
End If End If
ObjAF.Dispose() ObjAF.Dispose()
Else
GvMantenimientos.DataSource = DT_Mantenimiento
End If
GvMantenimientos.DataBind() GvMantenimientos.DataBind()
UpMantenimientos.Update() UpMantenimientos.Update()
@@ -3991,10 +4379,14 @@ Partial Class AF_AF
Protected Sub LnkAgregarMantenimiento_Click(sender As Object, e As EventArgs) Protected Sub LnkAgregarMantenimiento_Click(sender As Object, e As EventArgs)
CveMantenimiento = -1
IndexMantenimiento = -1
LblModaMantenimientoTitulo.Text = "Agregar Mantenimiento" LblModaMantenimientoTitulo.Text = "Agregar Mantenimiento"
LnkModalAgregarMantenimiento.Text = "Agregar" LnkModalAgregarMantenimiento.Text = "Agregar"
CveMantenimiento = -1
TxtModalMantenimiento.Text = "" TxtModalMantenimiento.Text = ""
TxtModalMantenimientoObservaciones.Text = "" TxtModalMantenimientoObservaciones.Text = ""
@@ -4011,7 +4403,13 @@ Partial Class AF_AF
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
'CveMantenimiento, CveActivoFijo, Mantenimiento, Observaciones, Fecha, FechaIng, CveUsuario, Codigo, Descripcion, Usuario 'CveMantenimiento, CveActivoFijo, Mantenimiento, Observaciones, Fecha, FechaIng, CveUsuario, Codigo, Descripcion, Usuario
If CveActivoFijo > 0 Then
CveMantenimiento = GvRow.DataKey("CveMantenimiento").ToEntero CveMantenimiento = GvRow.DataKey("CveMantenimiento").ToEntero
Else
IndexMantenimiento = GvRow.RowIndex
End If
Dim Mantenimiento As String = GvRow.DataKey("Mantenimiento") Dim Mantenimiento As String = GvRow.DataKey("Mantenimiento")
Dim Observaciones As String = GvRow.DataKey("Observaciones") Dim Observaciones As String = GvRow.DataKey("Observaciones")
@@ -4036,19 +4434,27 @@ Partial Class AF_AF
Dim ErrorProceso As Boolean = False Dim ErrorProceso As Boolean = False
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Dim IndexMantenimientoEliminar As Integer = GvRow.RowIndex
If CveActivoFijo > 0 Then
Dim CveMantenimientoEliminar As Integer = GvRow.DataKey("CveMantenimiento").ToEntero Dim CveMantenimientoEliminar As Integer = GvRow.DataKey("CveMantenimiento").ToEntero
Dim ObjAF As New ClsAF Dim ObjAF As New ClsAF
If ObjAF.RemoveMantenimientos(CveMantenimientoEliminar, UsuarioActual.CveEmpresa) Then If ObjAF.RemoveMantenimientos(CveMantenimientoEliminar, UsuarioActual.CveEmpresa) Then
ErrorProceso = False ErrorProceso = False
Else Else
ErrorProceso = True ErrorProceso = True
End If End If
ObjAF.Dispose() ObjAF.Dispose()
Else
DT_Mantenimiento.Rows(IndexMantenimientoEliminar).Delete()
DT_Mantenimiento.AcceptChanges()
End If
If Not ErrorProceso Then If Not ErrorProceso Then
Alert("Mantenimiento Eliminado Correctamente.") Alert("Mantenimiento Eliminado Correctamente.")
@@ -4065,6 +4471,8 @@ Partial Class AF_AF
ObjAF.IniciaTransacSQL() ObjAF.IniciaTransacSQL()
If CveActivoFijo > 0 Then
If CveMantenimiento > 0 Then If CveMantenimiento > 0 Then
Dim FileExtension As String = "" Dim FileExtension As String = ""
@@ -4097,14 +4505,10 @@ Partial Class AF_AF
ErrorProceso = True ErrorProceso = True
End If End If
End If End If
Else Else
Dim CveMantenimientoTemp As Integer = -1 Dim CveMantenimientoTemp As Integer = -1
CveMantenimientoTemp = ObjAF.AddMantenimientos(CveActivoFijo, TxtModalMantenimiento.Text, TxtModalMantenimientoObservaciones.Text, TxtModalMantenimientoFecha.Text.ToDate, UsuarioActual.CveUsuario, "-1") CveMantenimientoTemp = ObjAF.AddMantenimientos(CveActivoFijo, TxtModalMantenimiento.Text, TxtModalMantenimientoObservaciones.Text, TxtModalMantenimientoFecha.Text.ToDate, UsuarioActual.CveUsuario, "-1")
If CveMantenimientoTemp > 0 Then If CveMantenimientoTemp > 0 Then
ErrorProceso = False ErrorProceso = False
@@ -4142,41 +4546,114 @@ Partial Class AF_AF
ErrorProceso = True ErrorProceso = True
End If End If
End If End If
End If End If
End If End If
End If End If
If Not ErrorProceso Then
TxtArchivoMantenimiento.Text = ""
UpModalMantenimiento.Update()
End If
If Not ErrorProceso Then If Not ErrorProceso Then
ObjAF.Commit() ObjAF.Commit()
ObjAF.Dispose() ObjAF.Dispose()
RegistraScript("$('#DVModalMantenimiento').modal('hide');") 'RegistraScript("$('#DVModalMantenimiento').modal('hide');")
Alert("Mantenimiento Guardado Correctamente.") 'Alert("Mantenimiento Guardado Correctamente.")
CargaMantenimento() 'CargaMantenimento()
Else Else
ObjAF.RollBack() ObjAF.RollBack()
ObjAF.Dispose() ObjAF.Dispose()
End If End If
Else
Dim Filesgral As List(Of Archivo) = TxtArchivoMantenimiento.getfiles().Archivos
If IndexMantenimiento >= 0 Then
DT_Mantenimiento.Rows(IndexMantenimiento)("Mantenimiento") = TxtModalMantenimiento.Text
DT_Mantenimiento.Rows(IndexMantenimiento)("Observaciones") = TxtModalMantenimientoObservaciones.Text
DT_Mantenimiento.Rows(IndexMantenimiento)("Fecha") = TxtModalMantenimientoFecha.Text.ToDate
If Filesgral.Count > 0 Then
For Each fileItem As Archivo In Filesgral
Dim fi As New FileInfo(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename))
If fi.Exists Then
DT_Mantenimiento.Rows(IndexMantenimiento)("Archivo") = fi.FullName
End If
Exit For
Next
End If
DT_Mantenimiento.AcceptChanges()
Else
Dim nRow As DataRow = DT_Mantenimiento.NewRow
nRow("Mantenimiento") = TxtModalMantenimiento.Text
nRow("Observaciones") = TxtModalMantenimientoObservaciones.Text
nRow("Fecha") = TxtModalMantenimientoFecha.Text.ToDate
If Filesgral.Count > 0 Then
For Each fileItem As Archivo In Filesgral
Dim fi As New FileInfo(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename))
If fi.Exists Then
nRow("Archivo") = fi.FullName
End If
Exit For
Next
End If
DT_Mantenimiento.Rows.Add(nRow)
DT_Mantenimiento.AcceptChanges()
End If
TxtArchivoMantenimiento.Text = ""
End If
If Not ErrorProceso Then
RegistraScript("$('#DVModalMantenimiento').modal('hide');")
Alert("Mantenimiento Guardado Correctamente.")
CargaMantenimento()
End If
End Sub End Sub
Protected Sub LnkDescargaArcgivo_Click(sender As Object, e As EventArgs) Protected Sub LnkDescargaArcgivo_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Dim Archivo As String = GvRow.DataKey("Archivo") Dim Archivo As String = GvRow.DataKey("Archivo")
Dim InfArchivo As New FileInfo($"{UsuarioActual.Empresa.Ruta}\AF\Mantenimientos\{Archivo}")
Dim InfArchivo As FileInfo
If CveActivoFijo > 0 Then
InfArchivo = New FileInfo($"{UsuarioActual.Empresa.Ruta}\AF\Mantenimientos\{Archivo}")
Else
InfArchivo = New FileInfo(Archivo)
End If
If InfArchivo.Exists Then If InfArchivo.Exists Then
Response.Clear() Response.Clear()
Response.AppendHeader("Content-Disposition", "attachment; filename=" + InfArchivo.Name) Response.AppendHeader("Content-Disposition", "attachment; filename=" + InfArchivo.Name)
Response.AppendHeader("Content-Length", InfArchivo.Length.ToString()) Response.AppendHeader("Content-Length", InfArchivo.Length.ToString())
@@ -4184,6 +4661,7 @@ Partial Class AF_AF
Response.WriteFile(InfArchivo.FullName) Response.WriteFile(InfArchivo.FullName)
Response.End() Response.End()
End If End If
@@ -4195,13 +4673,27 @@ Partial Class AF_AF
If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.RowType = DataControlRowType.DataRow Then
Dim Archivo As String = e.Row.DataKey("Archivo") Dim Archivo As String = e.Row.DataKey("Archivo")
Dim InfArchivo As New FileInfo($"{UsuarioActual.Empresa.Ruta}\AF\Mantenimientos\{Archivo}")
If Archivo.Length > 0 Then
Dim InfArchivo As FileInfo
If CveActivoFijo > 0 Then
InfArchivo = New FileInfo($"{UsuarioActual.Empresa.Ruta}\AF\Mantenimientos\{Archivo}")
Else
InfArchivo = New FileInfo(Archivo)
End If
If InfArchivo.Exists Then If InfArchivo.Exists Then
e.Row.FCLinkButton("LnkDescargaArcgivo").Visible = True e.Row.FCLinkButton("LnkDescargaArcgivo").Visible = True
ScriptManager.GetCurrent(Me).RegisterPostBackControl(e.Row.FCLinkButton("LnkDescargaArcgivo")) ScriptManager.GetCurrent(Me).RegisterPostBackControl(e.Row.FCLinkButton("LnkDescargaArcgivo"))
End If End If
End If
End If End If
End Sub End Sub
@@ -4215,8 +4707,10 @@ Partial Class AF_AF
Private Sub CargaPlagaEnfermedad() Private Sub CargaPlagaEnfermedad()
Dim ObjAF As New ClsAF
If CveActivoFijo > 0 Then
Dim ObjAF As New ClsAF
If ObjAF.GetPlagaEnfermedad(CveActivoFijo, UsuarioActual.CveEmpresa) Then If ObjAF.GetPlagaEnfermedad(CveActivoFijo, UsuarioActual.CveEmpresa) Then
GvPlagaEnfermedad.DataSource = ObjAF.DtResultados GvPlagaEnfermedad.DataSource = ObjAF.DtResultados
Else Else
@@ -4224,6 +4718,11 @@ Partial Class AF_AF
End If End If
ObjAF.Dispose() ObjAF.Dispose()
Else
GvPlagaEnfermedad.DataSource = DT_PlgaEfermedad
End If
GvPlagaEnfermedad.DataBind() GvPlagaEnfermedad.DataBind()
UpPlagaEnfermedad.Update() UpPlagaEnfermedad.Update()
@@ -4233,10 +4732,18 @@ Partial Class AF_AF
Protected Sub LnkAgregarPlagaEnfermedad_Click(sender As Object, e As EventArgs) Protected Sub LnkAgregarPlagaEnfermedad_Click(sender As Object, e As EventArgs)
If CveActivoFijo > 0 Then
CvePlagaEnfermedad = -1
Else
IndexProduccion = -1
End If
LblModalTituloPlagaEnfermedad.Text = "Agregar Plaga Enfermedad" LblModalTituloPlagaEnfermedad.Text = "Agregar Plaga Enfermedad"
LnkModalAgregarProduccion.Text = "Agregar" LnkModalAgregarProduccion.Text = "Agregar"
CvePlagaEnfermedad = -1
TxtModalPlagaEnfermedadObservaciones.Text = "" TxtModalPlagaEnfermedadObservaciones.Text = ""
TxtModalPlagaEnfermedadFecha.Text = "" TxtModalPlagaEnfermedadFecha.Text = ""
@@ -4250,7 +4757,11 @@ Partial Class AF_AF
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
If CveActivoFijo > 0 Then
CvePlagaEnfermedad = GvRow.DataKey("CvePlagaEnfermedad").ToEntero CvePlagaEnfermedad = GvRow.DataKey("CvePlagaEnfermedad").ToEntero
Else
IndexPlagaEnfermedad = GvRow.RowIndex
End If
Dim Observaciones As String = GvRow.DataKey("Observaciones") Dim Observaciones As String = GvRow.DataKey("Observaciones")
Dim Fecha As Date = GvRow.DataKey("Fecha").ToDate Dim Fecha As Date = GvRow.DataKey("Fecha").ToDate
@@ -4271,10 +4782,12 @@ Partial Class AF_AF
Protected Sub LnkGvPlagaEnfermedadRemove_Click(sender As Object, e As EventArgs) Protected Sub LnkGvPlagaEnfermedadRemove_Click(sender As Object, e As EventArgs)
Dim ErrorProceso As Boolean = False
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Dim CvePlagaEnfermedadEliminar As Integer = GvRow.DataKey("CvePlagaEnfermedad").ToEntero
Dim ErrorProceso As Boolean = False
If CveActivoFijo > 0 Then
Dim CvePlagaEnfermedadEliminar As Integer = GvRow.DataKey("CvePlagaEnfermedad").ToEntero
Dim ObjAF As New ClsAF Dim ObjAF As New ClsAF
If ObjAF.RemovePlagaEnfermedad(CvePlagaEnfermedadEliminar, UsuarioActual.CveEmpresa) Then If ObjAF.RemovePlagaEnfermedad(CvePlagaEnfermedadEliminar, UsuarioActual.CveEmpresa) Then
@@ -4283,8 +4796,15 @@ Partial Class AF_AF
ErrorProceso = True ErrorProceso = True
End If End If
ObjAF.Dispose() ObjAF.Dispose()
Else
Dim IndexPlagaEnfermedadEliminar As Integer = GvRow.RowIndex
DT_PlgaEfermedad.Rows(IndexPlagaEnfermedadEliminar).Delete()
DT_PlgaEfermedad.AcceptChanges()
ErrorProceso = False
End If
If Not ErrorProceso Then If Not ErrorProceso Then
@@ -4298,8 +4818,11 @@ Partial Class AF_AF
Protected Sub LnkModalAgregarPlagaEnfermedad_Click(sender As Object, e As EventArgs) Protected Sub LnkModalAgregarPlagaEnfermedad_Click(sender As Object, e As EventArgs)
Dim ErrorProceso As Boolean = False Dim ErrorProceso As Boolean = False
Dim ObjAF As New ClsAF
If CveActivoFijo > 0 Then
Dim ObjAF As New ClsAF
If CvePlagaEnfermedad > 0 Then If CvePlagaEnfermedad > 0 Then
If ObjAF.UpdatePlagaEnfermedad(CvePlagaEnfermedad, CveActivoFijo, TxtModalPlagaEnfermedadObservaciones.Text, TxtModalPlagaEnfermedadFecha.Text.ToDate, UsuarioActual.CveUsuario) Then If ObjAF.UpdatePlagaEnfermedad(CvePlagaEnfermedad, CveActivoFijo, TxtModalPlagaEnfermedadObservaciones.Text, TxtModalPlagaEnfermedadFecha.Text.ToDate, UsuarioActual.CveUsuario) Then
ErrorProceso = False ErrorProceso = False
@@ -4313,11 +4836,37 @@ Partial Class AF_AF
ErrorProceso = True ErrorProceso = True
End If End If
End If End If
ObjAF.Dispose() ObjAF.Dispose()
Else
If IndexPlagaEnfermedad >= 0 Then
DT_PlgaEfermedad.Rows(IndexPlagaEnfermedad)("Observaciones") = TxtModalPlagaEnfermedadObservaciones.Text
DT_PlgaEfermedad.Rows(IndexPlagaEnfermedad)("Fecha") = TxtModalPlagaEnfermedadFecha.Text.ToDate
DT_PlgaEfermedad.Rows(IndexPlagaEnfermedad)("Usuario") = UsuarioActual.Usuario
Else
Dim nRow As DataRow = DT_PlgaEfermedad.NewRow
nRow("Observaciones") = TxtModalPlagaEnfermedadObservaciones.Text
nRow("Fecha") = TxtModalPlagaEnfermedadFecha.Text.ToDate
nRow("Usuario") = UsuarioActual.Usuario
DT_PlgaEfermedad.Rows.Add(nRow)
DT_PlgaEfermedad.AcceptChanges()
End If
ErrorProceso = False
End If
If Not ErrorProceso Then If Not ErrorProceso Then
RegistraScript("$('#DVModalPlagaEnfermedad').modal('hide');") RegistraScript("$('#DVModalPlagaEnfermedad').modal('hide');")
Alert("Plaga Enfermedad guardada Correctamente.") Alert("Plaga Enfermedad guardada Correctamente.")

View File

@@ -92,9 +92,9 @@
<asp:HyperLinkField HeaderText="Fecha" DataTextField="Fecha" Target="_blank" ItemStyle-Width="10%" ItemStyle-CssClass="Texto" DataTextFormatString="{0:d}" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" /> <asp:HyperLinkField HeaderText="Fecha" DataTextField="Fecha" Target="_blank" ItemStyle-Width="10%" ItemStyle-CssClass="Texto" DataTextFormatString="{0:d}" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" />
<asp:HyperLinkField HeaderText="Sucursal" DataTextField="SubProyecto" Target="_blank" ItemStyle-Width="20%" ItemStyle-CssClass="Texto Izquierda" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" /> <asp:HyperLinkField HeaderText="Sucursal" DataTextField="SubProyecto" Target="_blank" ItemStyle-Width="20%" ItemStyle-CssClass="Texto Izquierda" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" />
<asp:TemplateField HeaderText="Cantidad"> <asp:TemplateField HeaderText="Cantidad" ItemStyle-HorizontalAlign="Right">
<ItemTemplate> <ItemTemplate>
<asp:LinkButton ID="LnkCantidad" CommandName="Mostrar" OnCommand="CargarVentasGrupo" Text='<%# Eval("Total", "{0:N0}") %>' runat="server" /> <asp:LinkButton ID="LnkCantidad" CommandName="Mostrar" OnCommand="CargarVentasGrupo" Text='<%# Eval("Total", "{0:#####}") %>' runat="server" />
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>

View File

@@ -69,6 +69,10 @@ Partial Class Acumuladores_RepEntradasUsadosClientes
e.Row.CssClass = "SubTotales2" e.Row.CssClass = "SubTotales2"
End If End If
If e.Row.DataKey("CvePS").ToString.ToEntero > 0 And e.Row.DataKey("CveVenta").ToString.ToEntero = 0 Then
e.Row.CssClass = "SubTotales"
End If
If e.Row.DataKey("CveVenta").ToString.ToEntero > 0 Then If e.Row.DataKey("CveVenta").ToString.ToEntero > 0 Then
e.Row.Cells(1).Text = $"<a class='Texto' href='/Ventas/Ventas.aspx?CveVenta={e.Row.DataKey("CveVenta")}' Target='_blank' >{e.Row.DataKey("SerieFolio")}</a>" e.Row.Cells(1).Text = $"<a class='Texto' href='/Ventas/Ventas.aspx?CveVenta={e.Row.DataKey("CveVenta")}' Target='_blank' >{e.Row.DataKey("SerieFolio")}</a>"
@@ -80,7 +84,7 @@ Partial Class Acumuladores_RepEntradasUsadosClientes
End If End If
If e.Row.DataKey("EsDistribuidor") <> "" Then If e.Row.DataKey("EsDistribuidor") <> "" Then
e.Row.Cells(5).Text = $"<a class='Texto' href='/Ventas/Ventas.aspx?CveVenta={e.Row.DataKey("CveVenta")}' Target='_blank' >{e.Row.DataKey("Total").ToDecimal.ToString("###,###,###.00")}</a>" e.Row.Cells(5).Text = $"<a class='Texto' href='/Ventas/Ventas.aspx?CveVenta={e.Row.DataKey("CveVenta")}' Target='_blank' >{e.Row.DataKey("Total").ToDecimal.ToString("#########")}</a>"
End If End If

View File

@@ -1665,7 +1665,7 @@ Public Class ClsClientes
End Function End Function
Public Function AgregarClienteNoFrecuente(Nombre As String, Direccion As String, NoExt As String, NoInt As String, Colonia As String, Localidad As String, Ciudad As String, CveEstado As Integer, Public Function AgregarClienteNoFrecuente(Nombre As String, Direccion As String, NoExt As String, NoInt As String, Colonia As String, Localidad As String, Ciudad As String, CveEstado As Integer,
RFC As String, CP As String, Telefono As String, Mail As String, CveSubProyecto As Integer, CveUsuario As Integer, CveEmpresa As Integer, RFC As String, CP As String, Telefono As String, Mail As String, CveSubProyecto As Integer, CveUsuario As Integer, CveEmpresa As Integer,
NumCuentaPago As String, CveMetodoPago33 As Integer, CveFormaPago33 As Integer, Optional CvePrecioLista As Integer = -1) As Boolean NumCuentaPago As String, CveMetodoPago33 As Integer, CveFormaPago33 As Integer, Optional CvePrecioLista As Integer = -1, Optional RegimenSociedad As String = "-1", Optional TipoPersona As Boolean = False) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_ClientesNoFrecuenteAdd") DataAdapter("PA_ClientesNoFrecuenteAdd")
@@ -1690,6 +1690,8 @@ Public Class ClsClientes
.Add("@CveFormaPago33", SqlDbType.Int).Value = CveFormaPago33 .Add("@CveFormaPago33", SqlDbType.Int).Value = CveFormaPago33
.Add("@NumCuentaPago", SqlDbType.VarChar).Value = NumCuentaPago .Add("@NumCuentaPago", SqlDbType.VarChar).Value = NumCuentaPago
.Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista .Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista
.Add("@CvePrecioLista", SqlDbType.VarChar).Value = RegimenSociedad
.Add("@TipoPersona", SqlDbType.Bit).Value = TipoPersona
End With End With

View File

@@ -33,6 +33,10 @@
<DataField>CveVenta</DataField> <DataField>CveVenta</DataField>
<rd:TypeName>System.Int</rd:TypeName> <rd:TypeName>System.Int</rd:TypeName>
</Field> </Field>
<Field Name="CvePS">
<DataField>CvePS</DataField>
<rd:TypeName>System.Int</rd:TypeName>
</Field>
<Field Name="Folio"> <Field Name="Folio">
<DataField>Folio</DataField> <DataField>Folio</DataField>
<rd:TypeName>System.String</rd:TypeName> <rd:TypeName>System.String</rd:TypeName>
@@ -125,10 +129,10 @@
<rd:DefaultName>Codigo</rd:DefaultName> <rd:DefaultName>Codigo</rd:DefaultName>
<Style> <Style>
<Border> <Border>
<Color>White</Color> <Color>=IIF(Fields!EsHeader.Value = "-1" or Fields!Codigo.Value = "" or (Fields!CvePS.Value &gt; 0 and IsNothing(Fields!CveVenta.Value) ),"LightGrey","White")</Color>
<Style>Solid</Style> <Style>Solid</Style>
</Border> </Border>
<BackgroundColor>=IIF(Fields!EsHeader.Value = "-1" or Fields!Codigo.Value = "","LightGrey","Transparent")</BackgroundColor> <BackgroundColor>=IIF(Fields!EsHeader.Value = "-1" or Fields!Codigo.Value = "" or (Fields!CvePS.Value &gt; 0 and IsNothing(Fields!CveVenta.Value) ),"LightGrey","Transparent")</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft> <PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight> <PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop> <PaddingTop>2pt</PaddingTop>
@@ -161,10 +165,10 @@
<rd:DefaultName>Codigo_Clientes</rd:DefaultName> <rd:DefaultName>Codigo_Clientes</rd:DefaultName>
<Style> <Style>
<Border> <Border>
<Color>White</Color> <Color>=IIF(Fields!EsHeader.Value = "-1" or Fields!Codigo.Value = "" or (Fields!CvePS.Value &gt; 0 and IsNothing(Fields!CveVenta.Value) ),"LightGrey","White")</Color>
<Style>Solid</Style> <Style>Solid</Style>
</Border> </Border>
<BackgroundColor>=IIF(Fields!EsHeader.Value = "-1" or Fields!Codigo.Value = "","LightGrey","Transparent")</BackgroundColor> <BackgroundColor>=IIF(Fields!EsHeader.Value = "-1" or Fields!Codigo.Value = "" or (Fields!CvePS.Value &gt; 0 and IsNothing(Fields!CveVenta.Value) ),"LightGrey","Transparent")</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft> <PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight> <PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop> <PaddingTop>2pt</PaddingTop>
@@ -197,10 +201,10 @@
<rd:DefaultName>Folio</rd:DefaultName> <rd:DefaultName>Folio</rd:DefaultName>
<Style> <Style>
<Border> <Border>
<Color>White</Color> <Color>=IIF(Fields!EsHeader.Value = "-1" or Fields!Codigo.Value = "" or (Fields!CvePS.Value &gt; 0 and IsNothing(Fields!CveVenta.Value) ),"LightGrey","White")</Color>
<Style>Solid</Style> <Style>Solid</Style>
</Border> </Border>
<BackgroundColor>=IIF(Fields!EsHeader.Value = "-1" or Fields!Codigo.Value = "","LightGrey","Transparent")</BackgroundColor> <BackgroundColor>=IIF(Fields!EsHeader.Value = "-1" or Fields!Codigo.Value = "" or (Fields!CvePS.Value &gt; 0 and IsNothing(Fields!CveVenta.Value) ),"LightGrey","Transparent")</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft> <PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight> <PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop> <PaddingTop>2pt</PaddingTop>
@@ -234,10 +238,10 @@
<rd:DefaultName>Fecha</rd:DefaultName> <rd:DefaultName>Fecha</rd:DefaultName>
<Style> <Style>
<Border> <Border>
<Color>White</Color> <Color>=IIF(Fields!EsHeader.Value = "-1" or Fields!Codigo.Value = "" or (Fields!CvePS.Value &gt; 0 and IsNothing(Fields!CveVenta.Value) ),"LightGrey","White")</Color>
<Style>Solid</Style> <Style>Solid</Style>
</Border> </Border>
<BackgroundColor>=IIF(Fields!EsHeader.Value = "-1" or Fields!Codigo.Value = "","LightGrey","Transparent")</BackgroundColor> <BackgroundColor>=IIF(Fields!EsHeader.Value = "-1" or Fields!Codigo.Value = "" or (Fields!CvePS.Value &gt; 0 and IsNothing(Fields!CveVenta.Value) ),"LightGrey","Transparent")</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft> <PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight> <PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop> <PaddingTop>2pt</PaddingTop>
@@ -270,10 +274,10 @@
<rd:DefaultName>SubProyecto</rd:DefaultName> <rd:DefaultName>SubProyecto</rd:DefaultName>
<Style> <Style>
<Border> <Border>
<Color>White</Color> <Color>=IIF(Fields!EsHeader.Value = "-1" or Fields!Codigo.Value = "" or (Fields!CvePS.Value &gt; 0 and IsNothing(Fields!CveVenta.Value) ),"LightGrey","White")</Color>
<Style>Solid</Style> <Style>Solid</Style>
</Border> </Border>
<BackgroundColor>=IIF(Fields!EsHeader.Value = "-1" or Fields!Codigo.Value = "","LightGrey","Transparent")</BackgroundColor> <BackgroundColor>=IIF(Fields!EsHeader.Value = "-1" or Fields!Codigo.Value = "" or (Fields!CvePS.Value &gt; 0 and IsNothing(Fields!CveVenta.Value) ),"LightGrey","Transparent")</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft> <PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight> <PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop> <PaddingTop>2pt</PaddingTop>
@@ -307,10 +311,10 @@
<rd:DefaultName>Cantidad</rd:DefaultName> <rd:DefaultName>Cantidad</rd:DefaultName>
<Style> <Style>
<Border> <Border>
<Color>White</Color> <Color>=IIF(Fields!EsHeader.Value = "-1" or Fields!Codigo.Value = "" or (Fields!CvePS.Value &gt; 0 and IsNothing(Fields!CveVenta.Value) ),"LightGrey","White")</Color>
<Style>Solid</Style> <Style>Solid</Style>
</Border> </Border>
<BackgroundColor>=IIF(Fields!EsHeader.Value = "-1" or Fields!Codigo.Value = "","LightGrey","Transparent")</BackgroundColor> <BackgroundColor>=IIF(Fields!EsHeader.Value = "-1" or Fields!Codigo.Value = "" or (Fields!CvePS.Value &gt; 0 and IsNothing(Fields!CveVenta.Value) ),"LightGrey","Transparent")</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft> <PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight> <PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop> <PaddingTop>2pt</PaddingTop>
@@ -344,10 +348,10 @@
<rd:DefaultName>TotalImporte</rd:DefaultName> <rd:DefaultName>TotalImporte</rd:DefaultName>
<Style> <Style>
<Border> <Border>
<Color>White</Color> <Color>=IIF(Fields!EsHeader.Value = "-1" or Fields!Codigo.Value = "" or (Fields!CvePS.Value &gt; 0 and IsNothing(Fields!CveVenta.Value) ),"LightGrey","White")</Color>
<Style>Solid</Style> <Style>Solid</Style>
</Border> </Border>
<BackgroundColor>=IIF(Fields!EsHeader.Value = "-1" or Fields!Codigo.Value = "","LightGrey","Transparent")</BackgroundColor> <BackgroundColor>=IIF(Fields!EsHeader.Value = "-1" or Fields!Codigo.Value = "" or (Fields!CvePS.Value &gt; 0 and IsNothing(Fields!CveVenta.Value) ),"LightGrey","Transparent")</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft> <PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight> <PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop> <PaddingTop>2pt</PaddingTop>

View File

@@ -763,6 +763,7 @@
<th runat="server" visible="false" id="CabeceraPOA" scope="col">POA</th> <th runat="server" visible="false" id="CabeceraPOA" scope="col">POA</th>
<th scope="col">P.U.</th> <th scope="col">P.U.</th>
<th scope="col" id="THDescuento" visible="false" runat="server">Desc.</th> <th scope="col" id="THDescuento" visible="false" runat="server">Desc.</th>
<th scope="col">IVA</th>
<th scope="col">Total</th> <th scope="col">Total</th>
<th scope="col">Comandos</th> <th scope="col">Comandos</th>
<th scope="col"> <th scope="col">
@@ -863,6 +864,9 @@
<asp:CustomValidator ID="CVDescuento" runat="server" ClientValidationFunction="ValidaDecimal6digitsEmpty" ControlToValidate="TxtDescuentoAdd" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Descuento''</b> no tiene el formato correcto, por favor corrija e intente de nuevo (Solo formato numérico con máximo seis decimales)." ValidateEmptyText="True" ValidationGroup="GrpDetalleGuardar"></asp:CustomValidator> <asp:CustomValidator ID="CVDescuento" runat="server" ClientValidationFunction="ValidaDecimal6digitsEmpty" ControlToValidate="TxtDescuentoAdd" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Descuento''</b> no tiene el formato correcto, por favor corrija e intente de nuevo (Solo formato numérico con máximo seis decimales)." ValidateEmptyText="True" ValidationGroup="GrpDetalleGuardar"></asp:CustomValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="CVDescuento" Width="300px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="CVDescuento" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td style="text-align: right; padding-right: 7px;">
<%-- IVA--%>
</td> </td>
<td style="text-align: right; padding-right: 7px;"> <td style="text-align: right; padding-right: 7px;">
<asp:TextBox runat="server" ID="Total" ClientIDMode="Static" CssClass="alineanum" Width="55px" Height="24px" Enabled="false"></asp:TextBox> <asp:TextBox runat="server" ID="Total" ClientIDMode="Static" CssClass="alineanum" Width="55px" Height="24px" Enabled="false"></asp:TextBox>
@@ -1015,6 +1019,16 @@
</EditItemTemplate> </EditItemTemplate>
<ItemStyle HorizontalAlign="Right" /> <ItemStyle HorizontalAlign="Right" />
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlIva" runat="server" Text='<%# If(Not IsDBNull(Eval("IVA")), If(Eval("IVA").ToString <> "0", String.Concat(Eval("IVA", "{0:#,##0.00####}"), "<br>", Eval("IVAPorcentaje", "{0:0.### %}")), ""), "") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField> <asp:TemplateField>
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="LtlTotal" runat="server" Text='<%# If(Not IsDBNull(Eval("Importe")) AndAlso CDbl(Eval("Importe").ToString) <> -1, Eval("Total", "{0:#,##0.00####}"), "") %>'></asp:Literal> <asp:Literal ID="LtlTotal" runat="server" Text='<%# If(Not IsDBNull(Eval("Importe")) AndAlso CDbl(Eval("Importe").ToString) <> -1, Eval("Total", "{0:#,##0.00####}"), "") %>'></asp:Literal>
@@ -1022,6 +1036,8 @@
<ItemStyle HorizontalAlign="Right" /> <ItemStyle HorizontalAlign="Right" />
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField> <asp:TemplateField>
<EditItemTemplate> <EditItemTemplate>
<%--<asp:ImageButton ID="ImgUpdate" runat="server" CausesValidation="True" CommandName="Update" ImageUrl="/Imagenes/Btn_Update.png" Text="Update" />&nbsp;<asp:ImageButton ID="ImgCancel" runat="server" CausesValidation="False" CommandName="Cancel" ImageUrl="/Imagenes/Btn_Cancel.png" Text="Cancel" />--%> <%--<asp:ImageButton ID="ImgUpdate" runat="server" CausesValidation="True" CommandName="Update" ImageUrl="/Imagenes/Btn_Update.png" Text="Update" />&nbsp;<asp:ImageButton ID="ImgCancel" runat="server" CausesValidation="False" CommandName="Cancel" ImageUrl="/Imagenes/Btn_Cancel.png" Text="Cancel" />--%>
<div> <div>

View File

@@ -10222,5 +10222,6 @@ Partial Class Clientes
UpDatos.Update() UpDatos.Update()
End Sub End Sub
End Class End Class

View File

@@ -2456,6 +2456,7 @@
<%--<legend><b>Descripción</b></legend>--%> <%--<legend><b>Descripción</b></legend>--%>
<table border="0" class="portlet light bordered"> <table border="0" class="portlet light bordered">
<tr> <tr>
<div class="portlet-title"> <div class="portlet-title">
<div class="caption font-green"> <div class="caption font-green">
<i class="fa fa-users font-green"></i> <i class="fa fa-users font-green"></i>
@@ -2466,8 +2467,12 @@
</div> </div>
</div> </div>
</div> </div>
</tr> </tr>
<tr> <tr>
<div class="row" style="padding-left: 16px;"> <div class="row" style="padding-left: 16px;">
<div class="form-group form-md-line-input input-iconright col-xs-9"> <div class="form-group form-md-line-input input-iconright col-xs-9">
<asp:TextBox ID="TxtRFCCliente" Text="XAXX010101000" Style="text-transform: uppercase;" placeholder="Ingrese el RFC para su validación" runat="server" CssClass="form-control" MaxLength="13" CausesValidation="true"></asp:TextBox> <asp:TextBox ID="TxtRFCCliente" Text="XAXX010101000" Style="text-transform: uppercase;" placeholder="Ingrese el RFC para su validación" runat="server" CssClass="form-control" MaxLength="13" CausesValidation="true"></asp:TextBox>
@@ -2478,11 +2483,59 @@
<asp:Button ID="BtnValidarRFC" runat="server" CssClass="btn btn-success" Text="Validar" /> <asp:Button ID="BtnValidarRFC" runat="server" CssClass="btn btn-success" Text="Validar" />
</div> </div>
</div> </div>
<div class="row">
<div class="col-md-12">
<div runat="server" id="DivTipoPersona" class="form-group form-md-line-input input-iconright">
<%-- <asp:RadioButtonList runat="server" ID="RdTipoPersona" RepeatDirection="Horizontal" OnSelectedIndexChanged="RdTipoPersona_SelectedIndexChanged" AutoPostBack="true" CssClass="form-control input-sm">
<asp:ListItem Value="0">Física</asp:ListItem>
<asp:ListItem Value="1">Moral</asp:ListItem>
</asp:RadioButtonList>--%>
<asp:DropDownList runat="server" ID="RdTipoPersona" OnSelectedIndexChanged="RdTipoPersona_SelectedIndexChanged" AutoPostBack="true" CssClass="form-control input-sm select2me">
<asp:ListItem Value="0">Física</asp:ListItem>
<asp:ListItem Value="1">Moral</asp:ListItem>
</asp:DropDownList>
<label for="<%= RdTipoPersona.ClientID.ToString()%>">Tipo Persona:</label>
<i></i>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12" runat="server" id="DivRazonSocial2">
<div id="DivNombreCliente" runat="server" visible="false" class="form-group form-md-line-input input-iconright"> <div id="DivNombreCliente" runat="server" visible="false" class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtNombreCliente" CssClass="form-control " runat="server" MaxLength="50" CausesValidation="true"></asp:TextBox> <asp:TextBox ID="TxtNombreCliente" CssClass="form-control " runat="server" MaxLength="50" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVNombreCliente" runat="server" ControlToValidate="TxtNombreCliente" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Nombre''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarCliente"></asp:RequiredFieldValidator> <asp:RequiredFieldValidator ID="RFVNombreCliente" runat="server" ControlToValidate="TxtNombreCliente" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Nombre''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarCliente"></asp:RequiredFieldValidator>
<label for="<%= TxtNombreCliente.ClientID.ToString()%>">Razón Social:</label> <label for="<%= TxtNombreCliente.ClientID.ToString()%>">Razón Social:</label>
</div> </div>
</div>
<div class="col-md-4" id="DVRegimenSociedad" runat="server" visible="false">
<div runat="server" class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtRegimenSociedad" CssClass="form-control " runat="server" MaxLength="50" onkeyup="fncTxt()" ClientIDMode="Static"></asp:TextBox>
<label for="<%= TxtRegimenSociedad.ClientID.ToString()%>">Regimen Sociedad:</label>
<i></i>
</div>
</div>
</div>
<div id="DivDireccionCliente" runat="server" visible="false" class="form-group form-md-line-input input-iconright"> <div id="DivDireccionCliente" runat="server" visible="false" class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtDireccionCliente" CssClass="form-control " runat="server" MaxLength="90" CausesValidation="true"></asp:TextBox> <asp:TextBox ID="TxtDireccionCliente" CssClass="form-control " runat="server" MaxLength="90" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVDireccionC" runat="server" ControlToValidate="TxtDireccionCliente" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Direccion''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarCliente"></asp:RequiredFieldValidator> <asp:RequiredFieldValidator ID="RFVDireccionC" runat="server" ControlToValidate="TxtDireccionCliente" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Direccion''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarCliente"></asp:RequiredFieldValidator>
@@ -2575,8 +2628,13 @@
</div> </div>
</tr> </tr>
</table> </table>
</fieldset> </fieldset>
<div id="DivBotonesAgregarCliente" runat="server" visible="false" class="modal-footer"> <div id="DivBotonesAgregarCliente" runat="server" visible="false" class="modal-footer">
<asp:Button ID="BtnAgregarCliente" runat="server" CssClass="btn btn-primary" Text="Agregar" ValidationGroup="GrpGuardarCliente" /> <asp:Button ID="BtnAgregarCliente" runat="server" CssClass="btn btn-primary" Text="Agregar" ValidationGroup="GrpGuardarCliente" />

View File

@@ -6344,6 +6344,8 @@ Partial Class PV
Private Sub BtnValidarRFC_Click(sender As Object, e As EventArgs) Handles BtnValidarRFC.Click Private Sub BtnValidarRFC_Click(sender As Object, e As EventArgs) Handles BtnValidarRFC.Click
If TxtRFCCliente.Text.ToUpper = "XAXX010101000" Then If TxtRFCCliente.Text.ToUpper = "XAXX010101000" Then
DivTipoPersona.Visible = True
DivNombreCliente.Visible = True DivNombreCliente.Visible = True
DivDireccionCliente.Visible = True DivDireccionCliente.Visible = True
DivNumeroCPCliente.Visible = True DivNumeroCPCliente.Visible = True
@@ -6383,6 +6385,7 @@ Partial Class PV
UpCliente.Update() UpCliente.Update()
Else Else
DivNombreCliente.Visible = True DivNombreCliente.Visible = True
DivTipoPersona.Visible = True
DivDireccionCliente.Visible = True DivDireccionCliente.Visible = True
DivNumeroCPCliente.Visible = True DivNumeroCPCliente.Visible = True
DivColoniaTelefonoCliente.Visible = True DivColoniaTelefonoCliente.Visible = True
@@ -6420,10 +6423,12 @@ Partial Class PV
Dim ObjCliente As New ClsClientes Dim ObjCliente As New ClsClientes
Dim TipoPersona As Boolean = If(RdTipoPersona.SelectedValue.ToEntero = 1, True, False)
If ObjCliente.AgregarClienteNoFrecuente(TxtNombreCliente.Text.Trim, TxtDireccionCliente.Text.Trim, TxtNumExtCliente.Text.Trim, TxtNumIntCliente.Text.Trim, TxtColoniaCliente.Text.Trim, If ObjCliente.AgregarClienteNoFrecuente(TxtNombreCliente.Text.Trim, TxtDireccionCliente.Text.Trim, TxtNumExtCliente.Text.Trim, TxtNumIntCliente.Text.Trim, TxtColoniaCliente.Text.Trim,
TxtLocalidadCliente.Text.Trim, TxtCiudadCliente.Text.Trim, DdlEstadoSAT.SelectedValue.ToEntero, TxtRFCCliente.Text.Trim, TxtLocalidadCliente.Text.Trim, TxtCiudadCliente.Text.Trim, DdlEstadoSAT.SelectedValue.ToEntero, TxtRFCCliente.Text.Trim,
TxtCPCliente.Text.Trim, TxtTelefonoCliente.Text.Trim, TxtCorreoCliente.Text.Trim, DdlSubProyectoDatos.SelectedValue.ToEntero, UsuarioActual.CveUsuario, TxtCPCliente.Text.Trim, TxtTelefonoCliente.Text.Trim, TxtCorreoCliente.Text.Trim, DdlSubProyectoDatos.SelectedValue.ToEntero, UsuarioActual.CveUsuario,
UsuarioActual.CveEmpresa, "", DdlMetodoCliente.SelectedValue.ToEntero, DdlFormaCliente.SelectedValue.ToEntero) Then UsuarioActual.CveEmpresa, "", DdlMetodoCliente.SelectedValue.ToEntero, DdlFormaCliente.SelectedValue.ToEntero, RegimenSociedad:=TxtRegimenSociedad.Text, TipoPersona:=TipoPersona) Then
If ObjCliente.DtResultados.Rows.Count > 0 Then If ObjCliente.DtResultados.Rows.Count > 0 Then
RegistraScript("hideDivEC();") RegistraScript("hideDivEC();")
ViewState("CveCliente") = ObjCliente.DtResultados(0)("CveCliente").ToString.ToEntero ViewState("CveCliente") = ObjCliente.DtResultados(0)("CveCliente").ToString.ToEntero
@@ -8284,4 +8289,20 @@ Partial Class PV
Return Retorno Return Retorno
End Function End Function
Protected Sub RdTipoPersona_SelectedIndexChanged(sender As Object, e As EventArgs)
DVRegimenSociedad.Visible = False
DivRazonSocial2.Attributes.Add("class", "col-md-12")
If RdTipoPersona.SelectedValue.ToEntero = 1 And UsuarioActual.Empresa.Funcionalidad(350) = "1" Then
DivRazonSocial2.Attributes.Add("class", "col-md-8")
DVRegimenSociedad.Visible = True
End If
UpAgregarCliente.Update()
End Sub
End Class End Class

View File

@@ -14291,7 +14291,7 @@ Partial Class Ventas
If TmpDTImpuestos IsNot Nothing AndAlso Factura.CvePrePoliza > 0 AndAlso Not DdlTipoComprobante.SelectedValue.Contiene("Cot", "Rem") Then If TmpDTImpuestos IsNot Nothing AndAlso Factura.CvePrePoliza > 0 AndAlso Not DdlTipoComprobante.SelectedValue.Contiene("Cot", "Rem") Then
Dim Importe As Decimal Dim Importe As Decimal
Dim IdCtaContable, CveCuenta As Integer Dim IdCtaContable As Integer
Dim Concepto As String Dim Concepto As String
Dim tipoCambio As Decimal Dim tipoCambio As Decimal
Dim CveSubProyectoContabilizar = DdlSubProyectoDatos.SelectedValue.ToEntero() Dim CveSubProyectoContabilizar = DdlSubProyectoDatos.SelectedValue.ToEntero()
@@ -14301,7 +14301,7 @@ Partial Class Ventas
Importe = RowIL("Importe").ToString().ToDecimal * ValorMultiplicador Importe = RowIL("Importe").ToString().ToDecimal * ValorMultiplicador
IdCtaContable = RowIL("IdCtaContable").ToString().ToEntero() IdCtaContable = RowIL("IdCtaContable").ToString().ToEntero()
CveCuenta = RowIL("IdCtaContable").ToString().ToEntero() 'CveCuenta = -1 'RowIL("IdCtaContable").ToString().ToEntero()
Concepto = ViewState("VentaFolio").ToString() Concepto = ViewState("VentaFolio").ToString()
If ObjFactura.CveMoneda = 2 AndAlso ObjFactura.TipoCambio > 0 Then If ObjFactura.CveMoneda = 2 AndAlso ObjFactura.TipoCambio > 0 Then
@@ -14314,20 +14314,20 @@ Partial Class Ventas
Select Case RowIL("TipoImpuesto").ToString() Select Case RowIL("TipoImpuesto").ToString()
Case "1" Case "1"
If Not ObjConta.AddPrePolizasDetalle(Factura.CvePrePoliza, False, Importe, Concepto, 27, Concepto, Factura.Fecha, IdCtaContable:=IdCtaContable, IdSegmentoNegocio:=-1, CveVenta:=Factura.CveVenta, CveCliente:=Factura.CveCliente, ImporteMX:=Importe * tipoCambio, CveCuenta:=CveCuenta, CveSubProyecto:=CveSubProyectoContabilizar) Then If Not ObjConta.AddPrePolizasDetalle(Factura.CvePrePoliza, False, Importe, Concepto, 27, Concepto, Factura.Fecha, IdCtaContable:=IdCtaContable, IdSegmentoNegocio:=-1, CveVenta:=Factura.CveVenta, CveCliente:=Factura.CveCliente, ImporteMX:=Importe * tipoCambio, CveSubProyecto:=CveSubProyectoContabilizar) Then
ErrorPrepoliza = True ErrorPrepoliza = True
End If End If
Case "3" Case "3"
If Not ObjConta.AddPrePolizasDetalle(Factura.CvePrePoliza, False, Importe, Concepto, 116, Concepto, Factura.Fecha, IdCtaContable:=IdCtaContable, IdSegmentoNegocio:=-1, CveVenta:=Factura.CveVenta, CveCliente:=Factura.CveCliente, ImporteMX:=Importe * tipoCambio, CveCuenta:=CveCuenta, CveSubProyecto:=CveSubProyectoContabilizar) Then If Not ObjConta.AddPrePolizasDetalle(Factura.CvePrePoliza, False, Importe, Concepto, 116, Concepto, Factura.Fecha, IdCtaContable:=IdCtaContable, IdSegmentoNegocio:=-1, CveVenta:=Factura.CveVenta, CveCliente:=Factura.CveCliente, ImporteMX:=Importe * tipoCambio, CveSubProyecto:=CveSubProyectoContabilizar) Then
ErrorPrepoliza = True ErrorPrepoliza = True
End If End If
Case "4" Case "4"
If Not ObjConta.AddPrePolizasDetalle(Factura.CvePrePoliza, False, Importe, Concepto, 58, Concepto, Factura.Fecha, IdCtaContable:=IdCtaContable, IdSegmentoNegocio:=-1, CveVenta:=Factura.CveVenta, CveCliente:=Factura.CveCliente, ImporteMX:=Importe * tipoCambio, CveCuenta:=CveCuenta, CveSubProyecto:=CveSubProyectoContabilizar) Then If Not ObjConta.AddPrePolizasDetalle(Factura.CvePrePoliza, False, Importe, Concepto, 58, Concepto, Factura.Fecha, IdCtaContable:=IdCtaContable, IdSegmentoNegocio:=-1, CveVenta:=Factura.CveVenta, CveCliente:=Factura.CveCliente, ImporteMX:=Importe * tipoCambio, CveSubProyecto:=CveSubProyectoContabilizar) Then
ErrorPrepoliza = True ErrorPrepoliza = True
End If End If
Case "5" Case "5"
If Not ObjConta.AddPrePolizasDetalle(Factura.CvePrePoliza, True, Importe, Concepto, 27, Concepto, Factura.Fecha, IdCtaContable:=IdCtaContable, IdSegmentoNegocio:=-1, CveVenta:=Factura.CveVenta, CveCliente:=Factura.CveCliente, ImporteMX:=Importe * tipoCambio, CveCuenta:=CveCuenta, CveSubProyecto:=CveSubProyectoContabilizar) Then If Not ObjConta.AddPrePolizasDetalle(Factura.CvePrePoliza, True, Importe, Concepto, 27, Concepto, Factura.Fecha, IdCtaContable:=IdCtaContable, IdSegmentoNegocio:=-1, CveVenta:=Factura.CveVenta, CveCliente:=Factura.CveCliente, ImporteMX:=Importe * tipoCambio, CveSubProyecto:=CveSubProyectoContabilizar) Then
ErrorPrepoliza = True ErrorPrepoliza = True
End If End If
End Select End Select