Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -293,19 +293,28 @@ Public Class ClsPaginas
|
||||
Application("Directorio") = value
|
||||
End Set
|
||||
End Property
|
||||
Property GlobalDTPSATPS() As DataTable
|
||||
Public Shared ReadOnly Property GlobalDTPSATPS(SATClaveProductoServicio As String) As DataTable
|
||||
Get
|
||||
If Application("GlobalDTPSATPS") Is Nothing Then
|
||||
Dim ObjGrales As New ClsGenerales
|
||||
If ObjGrales.GetSATProductosServicios Then Application("GlobalDTPSATPS") = ObjGrales.DtResultados.AsEnumerable() Else Application("GlobalDTPSATPS") = Nothing
|
||||
ObjGrales.Dispose()
|
||||
'If Application("GlobalDTPSATPS") Is Nothing Then
|
||||
' Dim ObjGrales As New ClsGenerales
|
||||
' If ObjGrales.GetSATProductosServicios Then Application("GlobalDTPSATPS") = ObjGrales.DtResultados.AsEnumerable() Else Application("GlobalDTPSATPS") = Nothing
|
||||
' ObjGrales.Dispose()
|
||||
'End If
|
||||
|
||||
'GlobalDTPSATPS = DirectCast(Application("GlobalDTPSATPS"), EnumerableRowCollection(Of DataRow)).CopyToDataTable
|
||||
|
||||
Dim ObjGrales As New ClsGenerales
|
||||
If ObjGrales.GetSATProductosServicios(SATClaveProductoServicio) Then
|
||||
GlobalDTPSATPS = ObjGrales.DtResultados
|
||||
Else
|
||||
GlobalDTPSATPS = Nothing
|
||||
End If
|
||||
ObjGrales.Dispose()
|
||||
|
||||
GlobalDTPSATPS = DirectCast(Application("GlobalDTPSATPS"), EnumerableRowCollection(Of DataRow)).CopyToDataTable
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
Application("GlobalDTPSATPS") = value
|
||||
End Set
|
||||
'Set(value As DataTable)
|
||||
' Application("GlobalDTPSATPS") = value
|
||||
'End Set
|
||||
End Property
|
||||
|
||||
#Region "GLOBALES DE SAT COMERCIO EXTERIOR"
|
||||
|
||||
@@ -701,7 +701,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
||||
'verifica existencias
|
||||
If Pagina.Contiene("ventas/ventas", "oc/oc", "inv/traspaso") AndAlso CveEmpresa.Contiene(72, 80, 119, 140, 141, 152, 153, 159, 160, 161, 162, 163) Then
|
||||
UsaGlobal = False
|
||||
|
||||
|
||||
Dim objInv As New ClsInventarios
|
||||
If objInv.GetExistenciasProductosLike(Name, CveClasificacion, CveSubProyecto, Estatus.ToEntero, AplicaParaVenta, CveEmpresa, CveMarca) Then
|
||||
|
||||
@@ -933,20 +933,25 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
||||
Private Function GETPSSAT(ByVal context As HttpContext) As String
|
||||
Dim retorno As String = ""
|
||||
|
||||
Dim DTPS = DirectCast(context.Application("GlobalDTPSATPS"), EnumerableRowCollection(Of DataRow))
|
||||
'Dim DTPS = DirectCast(context.Application("GlobalDTPSATPS"), EnumerableRowCollection(Of DataRow))
|
||||
Dim DtPSRetorno As DataTable
|
||||
|
||||
Dim Name = IfNull(context.Request("Name"), "-1").ToString
|
||||
|
||||
If Name <> "-1" Then
|
||||
DTPS = DTPS.Where((Function(a) a!SATClaveProductoServicio.ToString.ToLower Like ($"*{Name.ToLower}*")))
|
||||
End If
|
||||
|
||||
DtPSRetorno = New DataView(DTPS.OrderBy(Function(a) a!SATClavePS).CopyToDataTable).ToTable(True, {"CveSATPS", "SATClaveProductoServicio"})
|
||||
'If Name <> "-1" Then
|
||||
' DTPS = DTPS.Where((Function(a) a!SATClaveProductoServicio.ToString.ToLower Like ($"*{Name.ToLower}*")))
|
||||
'End If
|
||||
|
||||
'DtPSRetorno = New DataView(DTPS.OrderBy(Function(a) a!SATClavePS).CopyToDataTable).ToTable(True, {"CveSATPS", "SATClaveProductoServicio"})
|
||||
DtPSRetorno = ClsPaginas.GlobalDTPSATPS(Name.ToLower)
|
||||
If DtPSRetorno IsNot Nothing AndAlso DtPSRetorno.Rows.Count > 0 Then
|
||||
DtPSRetorno.Columns("CveSATPS").ColumnName = "id"
|
||||
DtPSRetorno.Columns("SATClaveProductoServicio").ColumnName = "text"
|
||||
'limpia las columnas
|
||||
For Each dc As DataColumn In DtPSRetorno.Clone.Columns
|
||||
If Not dc.ColumnName.Contiene("id", "text") Then DtPSRetorno.Columns.Remove(dc.ColumnName)
|
||||
Next
|
||||
|
||||
retorno = JsonConvert.SerializeObject(DtPSRetorno).ToString
|
||||
context.Response.Write(retorno)
|
||||
Else
|
||||
|
||||
@@ -6011,6 +6011,16 @@ Partial Class Bancos_IE
|
||||
Dim Str As New StringBuilder
|
||||
|
||||
Dim Banco As New ClsBancos
|
||||
|
||||
If Banco.GetComplementoPagosRep(-1, Now.AddYears(-2), Now, CveIE, -1, 2, UsuarioActual.CveEmpresa, -1) Then
|
||||
If Not Banco.DtResultados.Rows.Count > 0 Then
|
||||
Banco.Dispose()
|
||||
Alert("No se generaron complementos de pago porque no hay facturas con método de pago PPD", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
Banco.IniciaTransacSQL()
|
||||
|
||||
|
||||
|
||||
@@ -1139,17 +1139,12 @@
|
||||
|
||||
<asp:UpdatePanel runat="server" ID="UpConsignaciones" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet solid grey-cascade portlet-filter" style="" id="DivConsignaciones" runat="server">
|
||||
|
||||
<div class="portlet solid grey-cascade portlet-filter" style="display:none" id="DivConsignaciones" runat="server">
|
||||
<div class="portlet-title portlet-filterT" style="">
|
||||
<div class="titlefiltros caption ">
|
||||
<ul class="list-inline" style="font-size: 14px;">
|
||||
<li>Aplica consignación:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>Aplica consignación:
|
||||
|
||||
<asp:CheckBox Text="" ID="ChkConsignacion" OnCheckedChanged="ChkConsignacion_CheckedChanged" AutoPostBack="true" Enabled="false" runat="server" />
|
||||
</li>
|
||||
@@ -1160,27 +1155,16 @@
|
||||
<asp:ListItem Value="2" Text="Recepción a Almacén"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</li>
|
||||
<li runat="server" id="LiConsignacion" visible="false">Consignación:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li runat="server" id="LiConsignacion" visible="false">Consignación:
|
||||
|
||||
<asp:DropDownList runat="server" ID="DdlConsignacion" DataValueField="CveConsignacion" DataTextField="SerieFolioFecha" Width="180px"></asp:DropDownList>
|
||||
</li>
|
||||
<%--<li>Folio Consignación:
|
||||
<asp:TextBox ID="TxtConsignacion" Width="70px" runat="server" ValidationGroup="GrpGetConsignacion" />
|
||||
<asp:RequiredFieldValidator ID="RFVConsignacion" runat="server" ControlToValidate="TxtFecha" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Folio Consignación''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGetConsignacion"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEConsignacion" runat="server" HighlightCssClass="vco" TargetControlID="RFVConsignacion" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<asp:HiddenField runat="server" ID="HdnCveConsignacion" />
|
||||
</li>--%>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnVinculaConsignacion" OnClick="BtnVinculaConsignacion_Click1" Visible="false" CssClass="btn btn-primary" runat="server" Text="Vincular Consignación" />
|
||||
<%--<asp:Button ID="BtnVinculaConsignacion" runat="server" Text="Asignar" OnClick="BtnVinculaConsignacion_Click" class="btn btn-primary" ValidationGroup="GrpGetConsignacion" />--%>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -2417,12 +2401,17 @@
|
||||
<ajax:CalendarExtender ID="Calendario" runat="server" TargetControlID="TxtFechaPago" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="RFVFechaC" runat="server" ControlToValidate="TxtFechaPago" Display="None" ErrorMessage="El campo <b>''Fecha de Pago''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<asp:CompareValidator ID="CVFechaC" runat="server" ControlToValidate="TxtFechaPago" Display="None" ErrorMessage="El campo <b>''Fecha de Pago''</b> no tiene 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="VCERFVFC" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaC" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
<ajax:ValidatorCalloutExtender ID="VCERFVFC" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaC" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="VCECVFC" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaC" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
<asp:CompareValidator ID="CVFechaPago" runat="server" ControlToCompare="TxtFecha" ControlToValidate="TxtFechaPago" Display="None" Operator="GreaterThanEqual" Type="Date" ValidationGroup="GrpGuardar" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Pago''</b>tiene que ser mayor o igual a la fecha del documento."></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEFechaPago" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaPago" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
<asp:CustomValidator runat="server" id="CBTxtFechaPago" ControlToValidate="TxtFechaPago" ClientValidationFunction="ValidaRangoDeFechas" ValidationGroup="GrpGuardar" ErrorMessage="La fecha de pago no debe de exeder de 5 años en relaciión a la fecha de la compra." Display="None" />
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender8" runat="server" HighlightCssClass="vco" TargetControlID="CBTxtFechaPago" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
|
||||
</div>
|
||||
</td>
|
||||
<td align="left">
|
||||
@@ -6660,6 +6649,28 @@
|
||||
|
||||
}
|
||||
|
||||
|
||||
function ValidaRangoDeFechas(sender, args) {
|
||||
|
||||
if ($("#TxtFecha").val().length == 10 && $("#TxtFechaPago").val().length == 10) {
|
||||
|
||||
let Finicio = parseInt($("#TxtFecha").val().substring(6,10));
|
||||
let FFin = parseInt($("#TxtFechaPago").val().substring(6, 10));
|
||||
|
||||
|
||||
if ((FFin - Finicio) > 5) {
|
||||
args.IsValid = false;
|
||||
} else {
|
||||
args.IsValid = true;
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
args.IsValid = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
</asp:Content>
|
||||
|
||||
@@ -3955,6 +3955,10 @@ Partial Class Compras_Compras
|
||||
'End If
|
||||
|
||||
'------------------ INICIA VALIDACIONES ------------------
|
||||
|
||||
|
||||
|
||||
|
||||
Dim EstatusCredito As Integer = 0
|
||||
Dim CveSubProyecto As Integer = 0
|
||||
'Credito Multiple
|
||||
@@ -18674,17 +18678,15 @@ Partial Class Compras_Compras
|
||||
TmpDT.Rows(HdnAliasInd.Value.ToEntero)("Obs") = TxtPSAlias.Text.Trim
|
||||
|
||||
'busco si el producto está en otros renglones QUE NO LO TENGAN ASIGNADO, LO VINCULE
|
||||
If UsuarioActual.CveEmpresa <> 141 Then
|
||||
For Each drt As DataRow In TmpDT.Select($"PS ='{TxtPSAlias.Text.Trim}' and ISNULL(CvePS,0) = 0")
|
||||
drt("CvePS") = CvePS
|
||||
drt("PS") = tPS
|
||||
drt("CveUM") = DdlUnidadAlias.SelectedValue.ToEntero
|
||||
drt("UM") = DdlUnidadAlias.SelectedItem.Text
|
||||
drt("CveClasificacion") = HdnPSAliasCveClasificacion.Value.ToEntero
|
||||
drt("Clasificacion") = HdnPSAliasClasificacion.Value
|
||||
drt("Obs") = TxtPSAlias.Text.Trim
|
||||
Next
|
||||
End If
|
||||
For Each drt As DataRow In TmpDT.Select($"PS ='{TxtPSAlias.Text.Trim}' and ISNULL(CvePS,0) = 0")
|
||||
drt("CvePS") = CvePS
|
||||
drt("PS") = tPS
|
||||
drt("CveUM") = DdlUnidadAlias.SelectedValue.ToEntero
|
||||
drt("UM") = DdlUnidadAlias.SelectedItem.Text
|
||||
drt("CveClasificacion") = HdnPSAliasCveClasificacion.Value.ToEntero
|
||||
drt("Clasificacion") = HdnPSAliasClasificacion.Value
|
||||
drt("Obs") = TxtPSAlias.Text.Trim
|
||||
Next
|
||||
|
||||
TmpDT.AcceptChanges()
|
||||
|
||||
|
||||
@@ -952,7 +952,9 @@ Partial Class ContabilidadC_RegPrePolizaS
|
||||
End If
|
||||
Else
|
||||
Alert("No se puede contabilizar la Prepoliza debido a que una o mas cuentas son inválidas")
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
MensajeAlert.AppendFormat("<br/><br/>Folio: <b><a href = ""/Contabilidad/RegPrepolizaS.aspx?CvePrePoliza={0}"" class=""texto"" target=""_blank"" >{1}</a></b>", CvePrePoliza, ObjMov.ContaFolio)
|
||||
End If
|
||||
|
||||
Else
|
||||
@@ -1946,14 +1948,22 @@ Partial Class ContabilidadC_RegPrePolizaS
|
||||
Dim CveSubProyecto As Integer = -1
|
||||
Dim TipoMovto As Boolean = If(Row("Cargo").ToString.ToDecimal <> 0, False, True)
|
||||
Dim CveConceptoContable As Integer = GlobalDTContaConceptosContables(-1).FiltroPrimeroValor("CveConceptoContable", String.Format("ConceptoContable ='{0}'", Row("ConceptoAdministrativo"))).ToEntero ' Row("CveConceptoContable").ToString.ToEntero
|
||||
Dim IdCtaContable As Integer = Row("IdCtaContable").ToString.ToEntero
|
||||
'Dim IdCtaContable As Integer = Row("IdCtaContable").ToString.ToEntero
|
||||
Dim CveClasificacion As Integer = -1
|
||||
Dim CveCuenta As Integer = -1
|
||||
Dim ObjConta2 As New ClsContabilidad
|
||||
If ObjConta2.GetCuentas(-1, Row("Cuenta").ToString, 1, UsuarioActual.CveEmpresa) Then
|
||||
If ObjConta2.GetCuentas(-1, Row("Cuenta").ToString.Replace("-", ""), 1, UsuarioActual.CveEmpresa) Then
|
||||
CveCuenta = ObjConta2.DtResultados.FiltroPrimeroValor("CveCuenta", "").ToEntero
|
||||
NombreCuenta = ObjConta2.DtResultados.FiltroPrimeroValor("CtaCodigo", "")
|
||||
End If
|
||||
ObjConta2.Dispose()
|
||||
|
||||
If CveCuenta <= 0 Then
|
||||
Alert(String.Format("La cuenta <b>{0}</b> no se reconoció, favor de verificar el archivo.", Row("Cuenta").ToString))
|
||||
DtMovimientos.Clear()
|
||||
Exit For
|
||||
End If
|
||||
|
||||
'sino viene el cveconcepto, busca por le nombre del concepto
|
||||
If CveConceptoContable = 0 Then
|
||||
Alert(String.Format("El concepto <b>{0}</b> no se reconoció, favor de verificar el archivo.", Row("ConceptoAdministrativo")))
|
||||
|
||||
@@ -504,7 +504,7 @@ Partial Class Contabilidad2_CatCuentas
|
||||
End If
|
||||
|
||||
If IdPadre > 0 Then
|
||||
Dim idnew2 As Integer = ObjConta2.AddCuenta(TxtCuenta.Text.Replace("-", ""), Tnombre.Text, DTcuenta.SelectedValue.ToString, DcuentaMayor.SelectedValue.ToString.ToEntero, CuentaEfectivo, DdlMoneda.SelectedValue.ToEntero, TxtDigAgrup.Text.ToEntero, TxtNomIngles.Text.Trim, Afectable, IdPadre, IdAgrupador)
|
||||
Dim idnew2 As Integer = ObjConta2.AddCuenta(TxtCuenta.Text.Replace("-", ""), Tnombre.Text, DTcuenta.SelectedValue.ToString, DcuentaMayor.SelectedValue.ToString.ToEntero, CuentaEfectivo, DdlMoneda.SelectedValue.ToEntero, TxtDigAgrup.Text.ToEntero, TxtNomIngles.Text.Trim, 1, IdPadre, IdAgrupador)
|
||||
|
||||
If idnew2 > 0 Then
|
||||
If Not ObjConta.UpdateCuentaCompaq(idnew, idnew2, UsuarioActual.CveEmpresa) Then
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -4444,6 +4444,13 @@ Partial Class Inventarios_EntradasSalidas
|
||||
TrSerieEntrada.Visible = AplicaSerie
|
||||
TxtnSerie.Visible = AplicaSerie
|
||||
|
||||
Dim CveSubProyectoAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacenInventarioFisico.SelectedValue.ToEntero).FiltroPrimeroValor("CveSubProyecto").ToString.ToEntero
|
||||
|
||||
If UsuarioActual.CveEmpresa = 119 AndAlso Not CveSubProyectoAlmacen.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347)) Then
|
||||
AplicaLote = False
|
||||
AplicaCaducidad = False
|
||||
End If
|
||||
|
||||
'activa seccion
|
||||
ThSeccionEntrada.Visible = AplicaSeccion
|
||||
TrSeccionEntrada.Visible = AplicaSeccion
|
||||
@@ -4468,6 +4475,7 @@ Partial Class Inventarios_EntradasSalidas
|
||||
If DdlPSSalida.SelectedValue.ToEntero > 0 Then
|
||||
Dim drp As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPSSalida.SelectedValue.ToEntero).FiltroPrimero("")
|
||||
|
||||
|
||||
If drp IsNot Nothing Then
|
||||
Dim AplicaSerie As Boolean = CBool(drp("AplicaSerie"))
|
||||
Dim AplicaSeccion As Boolean = CBool(drp("AplicaSeccion"))
|
||||
@@ -4478,6 +4486,12 @@ Partial Class Inventarios_EntradasSalidas
|
||||
TrSerieSalida.Visible = AplicaSerie
|
||||
TxtnSerie.Visible = AplicaSerie
|
||||
|
||||
Dim CveSubProyectoAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacenInventarioFisico.SelectedValue.ToEntero).FiltroPrimeroValor("CveSubProyecto").ToString.ToEntero
|
||||
|
||||
If UsuarioActual.CveEmpresa = 119 AndAlso Not CveSubProyectoAlmacen.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347)) Then
|
||||
AplicaLote = False
|
||||
AplicaCaducidad = False
|
||||
End If
|
||||
'activa seccion
|
||||
ThSeccionSalida.Visible = AplicaSeccion
|
||||
TrSeccionSalida.Visible = AplicaSeccion
|
||||
|
||||
@@ -646,7 +646,8 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
|
||||
If UsuarioActual.CveEmpresa = 119 Then
|
||||
Dim CveSubProyectoAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=CveAlmacen).FiltroPrimeroValor("CveSubProyecto", "").ToEntero
|
||||
If CveSubProyectoAlmacen = 10276 Then
|
||||
|
||||
If CveSubProyectoAlmacen.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347)) Then
|
||||
ValidaLoteCaducidad = True
|
||||
Else
|
||||
ValidaLoteCaducidad = False
|
||||
@@ -974,16 +975,29 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
e.Row.FCLinkButton("LnkCaducidad").Visible = True
|
||||
e.Row.FCTextBox("TxtCaducidad").ReadOnly = True
|
||||
CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = False
|
||||
' e.Row.FCTextBox("TxtCaducidad").enabled = True
|
||||
|
||||
'si aplica caducidad y viene vacía (posible por venta anterior), que se active su registro
|
||||
If e.Row.FCTextBox("TxtCaducidad").Text = "" OrElse e.Row.FCTextBox("TxtCaducidad").Text.ToDate <= MinFecha Then
|
||||
e.Row.FCTextBox("TxtCaducidad").ReadOnly = False
|
||||
CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = True
|
||||
e.Row.FCTextBox("TxtCaducidad").Enabled = True
|
||||
End If
|
||||
Else
|
||||
e.Row.FCTextBox("TxtCaducidad").Visible = False
|
||||
e.Row.FCLinkButton("LnkCaducidad").Visible = False
|
||||
e.Row.FCTextBox("TxtCaducidad").Enabled = True
|
||||
End If
|
||||
|
||||
If CBool(e.Row.DBCampo("AplicaLote")) Then
|
||||
e.Row.FCTextBox("TxtLote").Visible = True
|
||||
e.Row.FCTextBox("TxtLote").ReadOnly = True
|
||||
'e.Row.FCTextBox("TxtLote").enabled = True
|
||||
'si aplica caducidad y viene vacía (posible por venta anterior), que se active su registro
|
||||
If e.Row.FCTextBox("TxtLote").Text = "" Then
|
||||
e.Row.FCTextBox("TxtLote").ReadOnly = False
|
||||
e.Row.FCTextBox("TxtLote").Enabled = True
|
||||
Else
|
||||
e.Row.FCTextBox("TxtLote").ReadOnly = True
|
||||
End If
|
||||
|
||||
Else
|
||||
e.Row.FCTextBox("TxtLote").Visible = False
|
||||
End If
|
||||
@@ -2573,10 +2587,10 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
'DEVOLUCION APARTADOS
|
||||
End If
|
||||
|
||||
|
||||
'DEVOLUCION APARTADOS
|
||||
If Not ErrorMovInv Then
|
||||
If TipoMovimiento = 2 Then
|
||||
If ObjInventario.VentasAlmacenApartadosGet(CveVentaSurtir) Then
|
||||
@@ -2594,107 +2608,113 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
For Each Dr As DataRow In DtTempApartados.Rows
|
||||
|
||||
If CveMovimientoSalidaApartado = -1 Or CveAlmacenApartado <> Dr("CveAlmacen").ToString().ToEntero() Then
|
||||
CveMovimientoSalidaApartado = ObjInventario.AddMovimiento(CveAlmacenOrigen, 8, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1,
|
||||
Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveVendedor:=CveVendedor, CveCliente:=CveCliente,
|
||||
CveAlmacenDestino:=Dr("CveAlmacen").ToString().ToEntero(), Modulo:="RE/G9")
|
||||
FolioSalida = ObjInventario.Folio
|
||||
CveAlmacenApartado = Dr("CveAlmacen").ToString().ToEntero()
|
||||
|
||||
Dim DrMovto = DtTraspasos.NewRow
|
||||
DrMovto("Almacen") = Dr("Almacen").ToString().ToEntero()
|
||||
DrMovto("CveAlmacen") = Dr("CveAlmacen").ToString().ToEntero()
|
||||
DrMovto("CveMovimientoSalida") = CveMovimientoSalidaApartado
|
||||
DrMovto("FolioSalida") = FolioSalida
|
||||
DtTraspasos.Rows.Add(DrMovto)
|
||||
End If
|
||||
CveMovimientoSalidaApartado = ObjInventario.AddMovimiento(CveAlmacenOrigen, 8, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1,
|
||||
Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveVendedor:=CveVendedor, CveCliente:=CveCliente,
|
||||
CveAlmacenDestino:=Dr("CveAlmacen").ToString().ToEntero(), Modulo:="RE/G9")
|
||||
FolioSalida = ObjInventario.Folio
|
||||
CveAlmacenApartado = Dr("CveAlmacen").ToString().ToEntero()
|
||||
|
||||
Dim DrMovto = DtTraspasos.NewRow
|
||||
DrMovto("Almacen") = Dr("Almacen").ToString().ToEntero()
|
||||
DrMovto("CveAlmacen") = Dr("CveAlmacen").ToString().ToEntero()
|
||||
DrMovto("CveMovimientoSalida") = CveMovimientoSalidaApartado
|
||||
DrMovto("FolioSalida") = FolioSalida
|
||||
DtTraspasos.Rows.Add(DrMovto)
|
||||
End If
|
||||
|
||||
If Not CveMovimientoSalidaApartado > 0 Then
|
||||
ErrorMovInv = True
|
||||
TextoError.AppendFormat("Ocurrió un error al guardar los movimientos de control de apartados")
|
||||
Exit For
|
||||
End If
|
||||
'If CBool(Dr("AplicaSeccion")) Then
|
||||
' CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacenOrigen, Dr("CvePS").ToString().ToEntero()).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero()
|
||||
' Dim a As String = String.Format("CveAlmacen={0}-CvePS:{1}-CveseccionAlmacen={2}", CveAlmacenOrigen, Dr("CvePS"), CveSeccionAlmacen)
|
||||
'Else
|
||||
' CveSeccionAlmacen = -1
|
||||
'End If
|
||||
CveSeccionAlmacen = -3
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaApartado, Dr("Cantidad").ToString().ToDecimal, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal, CveAF:=Dr("CveAF").ToString().ToEntero(), Serie:=Dr("Serie").ToString(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero(), Lote:=Dr("Lote").ToString(), CveSeccionAlmacen:=CveSeccionAlmacen) Then
|
||||
ErrorMovInv = True
|
||||
TextoError.AppendFormat("Ocurrió un error al guardar los movimientos de control de apartados")
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
If Not ErrorMovInv Then
|
||||
|
||||
Dim CvePrePolizaTraspaso As Integer = ObjConta.AddPrePolizas("EA/Apart", 53, 0, 0, 1, TxtFecha.Text.ToDate, "Traspaso Apartado", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
If CvePrePolizaTraspaso > 0 Then
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaTraspaso, True, ValorTraspaso, TxtObservaciones.Text, 68, TxtObservaciones.Text, TxtFecha.Text.ToDate, -1, -1, CveMovimientoAlmacen:=CveMovimientoSalidaApartado, Contabilizable:=False, ImporteMX:=ValorTraspaso) Then
|
||||
ErrorMovInv = True
|
||||
TextoError.AppendFormat("Ocurrió un error al guardar los movimientos de control de apartados")
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
If Not ErrorMovInv Then
|
||||
|
||||
Dim CvePrePolizaTraspaso As Integer = ObjConta.AddPrePolizas("EA/Apart", 53, 0, 0, 1, TxtFecha.Text.ToDate, "Traspaso Apartado", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
If CvePrePolizaTraspaso > 0 Then
|
||||
|
||||
For Each Dr1 As DataRow In DtTraspasos.Rows
|
||||
CveMovimientoSalida = Dr1("CveMovimientoSalida").ToString().ToEntero()
|
||||
For Each Dr1 As DataRow In DtTraspasos.Rows
|
||||
CveMovimientoSalida = Dr1("CveMovimientoSalida").ToString().ToEntero()
|
||||
|
||||
CveMovimientoEntradaApartado = ObjInventario.AddMovimiento(Dr1("CveAlmacen").ToString().ToEntero(), 9, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,
|
||||
-1, CveVentaSurtir, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, CveAlmacenDestino:=DdlAlmacen.SelectedValue.ToEntero(),
|
||||
CveMovimientoRelacionado:=CveMovimientoSalida, Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveVendedor:=CveVendedor,
|
||||
CveCliente:=CveCliente, Modulo:="RE/G10")
|
||||
FolioEntrada = ObjInventario.Folio
|
||||
|
||||
If Not CveMovimientoEntradaApartado > 0 Then
|
||||
If Not CveMovimientoEntradaApartado > 0 Then
|
||||
ErrorMovInv = True
|
||||
TextoError.AppendFormat("Ocurrió un error al procesar los movimientos de traspaso de apartado. Por favor vuelva a intentar.")
|
||||
Exit For
|
||||
End If
|
||||
TextoError.AppendFormat("Ocurrió un error al procesar los movimientos de traspaso de apartado. Por favor vuelva a intentar.")
|
||||
Exit For
|
||||
End If
|
||||
|
||||
Dr1("CveMovimientoEntrada") = CveMovimientoEntradaApartado
|
||||
Dr1("FolioEntrada") = FolioEntrada
|
||||
Dr1("CveMovimientoEntrada") = CveMovimientoEntradaApartado
|
||||
Dr1("FolioEntrada") = FolioEntrada
|
||||
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
||||
ValorTraspaso = ObjInventario.DtResultados.SUMD("Total").RoundSQL
|
||||
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
||||
ValorTraspaso = ObjInventario.DtResultados.SUMD("Total").RoundSQL
|
||||
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
||||
|
||||
CveSeccionAlmacen = -3
|
||||
CveSeccionAlmacen = -3
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaApartado, Dr("Cantidad").ToString().ToDecimal, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal, CveAF:=Dr("CveAF").ToString().ToEntero(), Serie:=Dr("Serie").ToString(), CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString().ToEntero(), Lote:=Dr("Lote").ToString(), CveSeccionAlmacen:=CveSeccionAlmacen) Then
|
||||
ErrorMovInv = True
|
||||
TextoError.AppendFormat("Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar.")
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaApartado, Dr("Cantidad").ToString().ToDecimal, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal, CveAF:=Dr("CveAF").ToString().ToEntero(), Serie:=Dr("Serie").ToString(), CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString().ToEntero(), Lote:=Dr("Lote").ToString(), CveSeccionAlmacen:=CveSeccionAlmacen) Then
|
||||
ErrorMovInv = True
|
||||
TextoError.AppendFormat("Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar.")
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
If ErrorMovInv Then Exit For
|
||||
If ErrorMovInv Then Exit For
|
||||
|
||||
If Not ErrorMovInv AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePolizaTraspaso, False, ValorTraspaso, TxtObservaciones.Text, 68, TxtObservaciones.Text, TxtFecha.Text.ToDate, -1, -1, CveMovimientoAlmacen:=CveMovimientoEntradaApartado, Contabilizable:=False, ImporteMX:=ValorTraspaso) Then
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
Next
|
||||
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaTraspaso, True, ValorTraspaso, TxtObservaciones.Text, 68, TxtObservaciones.Text, TxtFecha.Text.ToDate, -1, -1, CveMovimientoAlmacen:=CveMovimientoSalida, Contabilizable:=False, ImporteMX:=ValorTraspaso) Then
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
|
||||
If Not ErrorMovInv AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePolizaTraspaso, False, ValorTraspaso, TxtObservaciones.Text, 68, TxtObservaciones.Text, TxtFecha.Text.ToDate, -1, -1, CveMovimientoAlmacen:=CveMovimientoEntradaApartado, Contabilizable:=False, ImporteMX:=ValorTraspaso) Then
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
Next
|
||||
|
||||
|
||||
Else
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
Else
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
'QUEMAR REMISIONES
|
||||
If Not ErrorMovInv And EsDevolucionVenta = 1 And TipoDocto = "Ing" Then
|
||||
Dim DtDevRem As New DataTable
|
||||
|
||||
'CARGA REMISIONES DE LA VENTA DEVUELTA
|
||||
If ObjInventario.GetDevolucionRemisionesFacturadas(CveVentaSurtir) Then
|
||||
DtDevRem = ObjInventario.DtResultados.FiltraParametros("CantidadAlmacen = 0")
|
||||
Else
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
|
||||
If Not ErrorMovInv Then
|
||||
End If
|
||||
|
||||
'QUEMAR REMISIONES
|
||||
|
||||
'CARGA REMISIONES DE LA VENTA DEVUELTA
|
||||
|
||||
'CARGA REMISIONES DE LA VENTA DEVUELTA
|
||||
If ObjInventario.GetDevolucionRemisionesFacturadas(CveVentaSurtir) Then
|
||||
DtDevRem = ObjInventario.DtResultados.FiltraParametros("CantidadAlmacen = 0")
|
||||
Else
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
|
||||
If Not ErrorMovInv Then
|
||||
If DtDevRem.Rows.Count > 0 Then
|
||||
For Each DrMovtos As DataRow In DtDevRem.FiltraParametros("", "CveRem", {"CveRem"}).Rows
|
||||
If Not ObjInventario.ActualizarEsDevolucionVenta(DrMovtos("CveRem").ToString().ToEntero(), 2) Then
|
||||
|
||||
@@ -5304,14 +5304,38 @@ Partial Class RH_Personal
|
||||
|
||||
Dim Cantidad As Double = TxtCantidadResguardo.Text.ToDouble()
|
||||
Dim Serie As String = TxtLiberarSerie.Text.Trim
|
||||
Dim MsgError As String = ""
|
||||
|
||||
Dim CveResultadoSalida As Integer = ObjInventario.AddMovimiento(CveAlmacenUniforme, 3, 1, Date.Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CveAlmacenDestino:=DdlAlmacenDestinoLiberarUniforme.SelectedValue.ToEntero, CvePersonal:=CvePersonal, Observaciones:=DescripcionUniforme)
|
||||
Dim ResultadoDetalleSalida As Boolean = ObjInventario.AddMovimientoDetalle(CveResultadoSalida, Cantidad, CveUM, CvePS, PU, CveSeccionAlmacen:=CveSeccionAlmacenUniforme, Serie:=Serie, CveMovimientoDetalleEntrada:=CveMovimientoDetalleUniforme)
|
||||
Dim CveSeccionAlmacen As Integer = DdlSeccionAlmacen.SelectedValue.ToEntero
|
||||
Dim CveResultadoEntrada As Integer = ObjInventario.AddMovimiento(DdlAlmacenDestinoLiberarUniforme.SelectedValue.ToEntero, 2, 1, Date.Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CvePersonal:=CvePersonal, Observaciones:=DescripcionUniforme, CveMovimientoRelacionado:=CveMovimientoUniforme)
|
||||
Dim ResultadoDetalleEntrada As Boolean = ObjInventario.AddMovimientoDetalle(CveResultadoEntrada, Cantidad, CveUM, CvePS, PU, CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie)
|
||||
If CveResultadoSalida > 0 Then
|
||||
If CveSeccionAlmacenUniforme = 0 Then CveSeccionAlmacenUniforme = -3 'que lo tome por default
|
||||
Dim ResultadoDetalleSalida As Boolean = ObjInventario.AddMovimientoDetalle(CveResultadoSalida, Cantidad, CveUM, CvePS, PU, CveSeccionAlmacen:=CveSeccionAlmacenUniforme, Serie:=Serie, CveMovimientoDetalleEntrada:=CveMovimientoDetalleUniforme)
|
||||
Dim CveSeccionAlmacen As Integer = DdlSeccionAlmacen.SelectedValue.ToEntero
|
||||
If ResultadoDetalleSalida Then
|
||||
|
||||
If ResultadoDetalleSalida And ResultadoDetalleEntrada Then
|
||||
Dim CveResultadoEntrada As Integer = ObjInventario.AddMovimiento(DdlAlmacenDestinoLiberarUniforme.SelectedValue.ToEntero, 2, 1, Date.Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CvePersonal:=CvePersonal, Observaciones:=DescripcionUniforme, CveMovimientoRelacionado:=CveMovimientoUniforme)
|
||||
If CveResultadoEntrada > 0 Then
|
||||
Dim ResultadoDetalleEntrada As Boolean = ObjInventario.AddMovimientoDetalle(CveResultadoEntrada, Cantidad, CveUM, CvePS, PU, CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie)
|
||||
If ResultadoDetalleSalida And ResultadoDetalleEntrada Then
|
||||
MsgError = ""
|
||||
Else
|
||||
Alert("No se pudo registrar la liberación.", TipoMensaje.MsgError)
|
||||
MsgError = "Error1"
|
||||
End If
|
||||
Else
|
||||
MsgError = "Error1"
|
||||
End If
|
||||
|
||||
Else
|
||||
MsgError = "Error1"
|
||||
End If
|
||||
Else
|
||||
MsgError = "Error"
|
||||
|
||||
End If
|
||||
|
||||
|
||||
If MsgError = "" Then
|
||||
ObjInventario.Commit()
|
||||
Alert("El resguardo se liberó correctamente")
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "ModalUniforme"))
|
||||
@@ -5320,6 +5344,7 @@ Partial Class RH_Personal
|
||||
Alert("No se pudo registrar la liberación.", TipoMensaje.MsgError)
|
||||
ObjInventario.RollBack()
|
||||
End If
|
||||
|
||||
ObjInventario.Dispose()
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -397,12 +397,12 @@ public class TareasJam : IHttpHandler
|
||||
|
||||
|
||||
this.GuardaLog($"EjecutaThalamus: Cargando archivo excel productos a FTP. ");
|
||||
CargaProductos = CargarArchivos(FInfoProductos, FTPServer, TFPUsr, FTPPass);
|
||||
CargaProductos = CargarArchivos(FInfoProductos, $"{FTPServer}/Productos", TFPUsr, FTPPass);
|
||||
|
||||
if (CargaProductos)
|
||||
{
|
||||
this.GuardaLog($"EjecutaThalamus: Verificando archivo productos. ");
|
||||
CargaProductos = VerificarArchivo(FInfoProductos, FInfoProductos.Length, FTPServer, TFPUsr, FTPPass);
|
||||
CargaProductos = VerificarArchivo(FInfoProductos, FInfoProductos.Length, $"{FTPServer}/Productos", TFPUsr, FTPPass);
|
||||
}
|
||||
|
||||
if (CargaProductos)
|
||||
|
||||
@@ -36,7 +36,7 @@ Partial Class Ventas_RepPS
|
||||
'DdlMarca.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End If
|
||||
|
||||
If UsuarioActual.TienePermisoProceso(320) Then
|
||||
If UsuarioActual.TienePermisoProceso(320) OrElse UsuarioActual.CveRol = 1 Then
|
||||
LnkRepDiario.Visible = True
|
||||
End If
|
||||
|
||||
@@ -242,9 +242,11 @@ Partial Class Ventas_RepPS
|
||||
Dim TC As Integer = 1
|
||||
Dim TCEspecifico As Decimal = -1
|
||||
|
||||
Dim FechaConsulta As DateTime = Now
|
||||
|
||||
Dim DataSet As DataSet = New DataSet
|
||||
Dim ObjVentas As New ClsVentas()
|
||||
If ObjVentas.GetRepPSDiario(-1, -1, Now, UsuarioActual.CveEmpresa, CveUsuarioConsulta:=UsuarioActual.CveUsuario, GPO:=-1, CveMoneda:=CveMoneda, TipoCambio:=TC, TCEspecifico:=TCEspecifico) Then
|
||||
If ObjVentas.GetRepPSDiario(-1, -1, FechaConsulta, UsuarioActual.CveEmpresa, CveUsuarioConsulta:=UsuarioActual.CveUsuario, GPO:=-1, CveMoneda:=CveMoneda, TipoCambio:=TC, TCEspecifico:=TCEspecifico) Then
|
||||
DataSet = ObjVentas.DataSetResultados.Copy()
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
@@ -254,7 +256,7 @@ Partial Class Ventas_RepPS
|
||||
|
||||
Dim FileExcel As New ExcelFile()
|
||||
|
||||
Dim worksheetName As String = $"{ToShortMonthName(Now).ToUpper()}{Now.Day}"
|
||||
Dim worksheetName As String = $"{ToShortMonthName(FechaConsulta).ToUpper()}{FechaConsulta.Day}"
|
||||
Const invalidCharsRegex As String = "[/\\*'?[\]:]+"
|
||||
Const maxLength As Integer = 31
|
||||
Dim safeName As String = Regex.Replace(worksheetName, invalidCharsRegex, " ").Replace(" ", " ").Trim()
|
||||
@@ -269,7 +271,7 @@ Partial Class Ventas_RepPS
|
||||
|
||||
Dim CellRangeTitulo = worksheet.Cells.GetSubrangeAbsolute(0, 0, 0, 12)
|
||||
CellRangeTitulo.Merged = True
|
||||
CellRangeTitulo.Value = $"{UsuarioActual.Empresa.Empresa}. VENTA DEL DIA {Now.Day} DE {ToMonthName(Now).ToUpper()} DEL {Now.Year}."
|
||||
CellRangeTitulo.Value = $"{UsuarioActual.Empresa.Empresa}. VENTA DEL DIA {FechaConsulta.Day} DE {ToMonthName(FechaConsulta).ToUpper()} DEL {FechaConsulta.Year}."
|
||||
CellRangeTitulo.Style.VerticalAlignment = VerticalAlignmentStyle.Center
|
||||
CellRangeTitulo.Style.HorizontalAlignment = HorizontalAlignmentStyle.Center
|
||||
|
||||
@@ -552,8 +554,8 @@ Partial Class Ventas_RepPS
|
||||
Dim IdxRefAnioAnteriorLlantas As Integer = IdxPorcentajes + 3
|
||||
|
||||
worksheet.Cells(IdxRefAnioAnteriorLlantas, 0).Value = "Sucursal"
|
||||
worksheet.Cells(IdxRefAnioAnteriorLlantas, 1).Value = (Now.Year - 1).ToString()
|
||||
worksheet.Cells(IdxRefAnioAnteriorLlantas, 2).Value = Now.Year.ToString()
|
||||
worksheet.Cells(IdxRefAnioAnteriorLlantas, 1).Value = (FechaConsulta.Year - 1).ToString()
|
||||
worksheet.Cells(IdxRefAnioAnteriorLlantas, 2).Value = FechaConsulta.Year.ToString()
|
||||
worksheet.Cells(IdxRefAnioAnteriorLlantas, 3).Value = "Dif"
|
||||
|
||||
Dim StyleTitleTable4 = worksheet.Cells.GetSubrangeAbsolute(IdxRefAnioAnteriorLlantas, 0, IdxRefAnioAnteriorLlantas, 3).Style
|
||||
@@ -614,13 +616,117 @@ Partial Class Ventas_RepPS
|
||||
DtAnioAnteriorLLantas.Dispose()
|
||||
#End Region
|
||||
|
||||
#Region "L L A N T A S M E S A Ñ O A N T E R I O R"
|
||||
Dim IdxRefMesAnioAnteriorLlantas As Integer = IdxAnioAnteriorLlantas + 3
|
||||
|
||||
worksheet.Cells.GetSubrangeAbsolute(IdxRefMesAnioAnteriorLlantas - 1, 1, IdxRefMesAnioAnteriorLlantas - 1, 3).Merged = True
|
||||
worksheet.Cells.GetSubrangeAbsolute(IdxRefMesAnioAnteriorLlantas - 1, 4, IdxRefMesAnioAnteriorLlantas - 1, 6).Merged = True
|
||||
worksheet.Cells(IdxRefMesAnioAnteriorLlantas - 1, 1).Value = "LLANTAS"
|
||||
worksheet.Cells(IdxRefMesAnioAnteriorLlantas - 1, 4).Value = "%"
|
||||
|
||||
worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 0).Value = "Sucursal"
|
||||
worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 1).Value = String.Format("{0} {1}", ToShortMonthName(FechaConsulta).ToUpper(), (FechaConsulta.Year - 1))
|
||||
worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 2).Value = String.Format("{0} {1}", ToShortMonthName(FechaConsulta).ToUpper(), (FechaConsulta.Year))
|
||||
worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 3).Value = "DIF %"
|
||||
worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 4).Value = String.Format("{0} - %", (FechaConsulta.Year - 1))
|
||||
worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 5).Value = String.Format("{0} - %", (FechaConsulta.Year))
|
||||
worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 6).Value = "DIF %"
|
||||
|
||||
Dim StyleTitleTable5 = worksheet.Cells.GetSubrangeAbsolute(IdxRefMesAnioAnteriorLlantas - 1, 0, IdxRefMesAnioAnteriorLlantas - 1, 6).Style
|
||||
StyleTitleTable5.Font.Weight = ExcelFont.BoldWeight
|
||||
StyleTitleTable5.Font.Name = "Calibri"
|
||||
StyleTitleTable5.Font.Size = 8 * 20
|
||||
StyleTitleTable5.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin)
|
||||
StyleTitleTable5.VerticalAlignment = VerticalAlignmentStyle.Center
|
||||
StyleTitleTable5.HorizontalAlignment = HorizontalAlignmentStyle.Center
|
||||
|
||||
Dim StyleSubTitleTable5 = worksheet.Cells.GetSubrangeAbsolute(IdxRefMesAnioAnteriorLlantas, 0, IdxRefMesAnioAnteriorLlantas, 6).Style
|
||||
StyleSubTitleTable5.Font.Weight = ExcelFont.BoldWeight
|
||||
StyleSubTitleTable5.Font.Name = "Calibri"
|
||||
StyleSubTitleTable5.Font.Size = 8 * 20
|
||||
StyleSubTitleTable5.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin)
|
||||
StyleSubTitleTable5.VerticalAlignment = VerticalAlignmentStyle.Center
|
||||
StyleSubTitleTable5.HorizontalAlignment = HorizontalAlignmentStyle.Center
|
||||
|
||||
Dim DtMesAnioAnteriorLLantas As DataTable = DataSet.Tables(4)
|
||||
'INICIA DESDE LA CUARTA FILA
|
||||
Dim IdxMesAnioAnteriorLlantas As Integer = IdxRefMesAnioAnteriorLlantas + 1
|
||||
|
||||
For Each Row As DataRow In DtMesAnioAnteriorLLantas.Rows
|
||||
worksheet.Cells(IdxMesAnioAnteriorLlantas, 0).Value = Row("Sucursal")
|
||||
worksheet.Cells(IdxMesAnioAnteriorLlantas, 1).Value = Row("LLantasAnioAnterior")
|
||||
worksheet.Cells(IdxMesAnioAnteriorLlantas, 2).Value = Row("LLantas")
|
||||
worksheet.Cells(IdxMesAnioAnteriorLlantas, 3).Formula = $"=({worksheet.Cells(IdxMesAnioAnteriorLlantas, 2).Name} - {worksheet.Cells(IdxMesAnioAnteriorLlantas, 1).Name})"
|
||||
worksheet.Cells(IdxMesAnioAnteriorLlantas, 4).Formula = $"=+(({worksheet.Cells(IdxMesAnioAnteriorLlantas, 1).Name} * 1.07) - {worksheet.Cells(IdxMesAnioAnteriorLlantas, 2).Name}) /12"
|
||||
worksheet.Cells(IdxMesAnioAnteriorLlantas, 5).Formula = $"=+(({worksheet.Cells(IdxMesAnioAnteriorLlantas, 1).Name} * 1) - {worksheet.Cells(IdxMesAnioAnteriorLlantas, 2).Name}) /12"
|
||||
worksheet.Cells(IdxMesAnioAnteriorLlantas, 6).Formula = $"=+({worksheet.Cells(IdxMesAnioAnteriorLlantas, 2).Name} / {worksheet.Cells(IdxMesAnioAnteriorLlantas, 1).Name}) - 1"
|
||||
|
||||
Dim StyleData = worksheet.Cells.GetSubrangeAbsolute(IdxMesAnioAnteriorLlantas, 0, IdxMesAnioAnteriorLlantas, 6).Style
|
||||
StyleData.Font.Weight = ExcelFont.NormalWeight
|
||||
StyleData.Font.Name = "Calibri"
|
||||
StyleData.Font.Size = 8 * 20
|
||||
StyleData.VerticalAlignment = VerticalAlignmentStyle.Center
|
||||
StyleData.HorizontalAlignment = HorizontalAlignmentStyle.Center
|
||||
StyleData.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin)
|
||||
StyleData.NumberFormat = "_-* #,##0.00_-;-* #,##0.00_-;_-* ""-""??_-;_-@_-"
|
||||
|
||||
IdxMesAnioAnteriorLlantas += 1
|
||||
Next
|
||||
|
||||
DtMesAnioAnteriorLLantas.Dispose()
|
||||
#End Region
|
||||
|
||||
#Region "L L A N T A S M E S A Ñ O A N T E R I O R"
|
||||
Dim IdxRefMesAnioAnteriorLlantasResumen As Integer = IdxMesAnioAnteriorLlantas + 2
|
||||
|
||||
worksheet.Cells(IdxRefMesAnioAnteriorLlantasResumen, 0).Value = "Mes"
|
||||
worksheet.Cells(IdxRefMesAnioAnteriorLlantasResumen, 1).Value = String.Format("{0}", (FechaConsulta.Year - 1))
|
||||
worksheet.Cells(IdxRefMesAnioAnteriorLlantasResumen, 2).Value = String.Format("{0}", (FechaConsulta.Year))
|
||||
worksheet.Cells(IdxRefMesAnioAnteriorLlantasResumen, 3).Value = "DIF UDS"
|
||||
worksheet.Cells(IdxRefMesAnioAnteriorLlantasResumen, 4).Value = "DIF %"
|
||||
|
||||
Dim StyleTitleTable6 = worksheet.Cells.GetSubrangeAbsolute(IdxRefMesAnioAnteriorLlantasResumen, 0, IdxRefMesAnioAnteriorLlantasResumen, 4).Style
|
||||
StyleTitleTable6.Font.Weight = ExcelFont.BoldWeight
|
||||
StyleTitleTable6.Font.Name = "Calibri"
|
||||
StyleTitleTable6.Font.Size = 8 * 20
|
||||
StyleTitleTable6.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin)
|
||||
StyleTitleTable6.VerticalAlignment = VerticalAlignmentStyle.Center
|
||||
StyleTitleTable6.HorizontalAlignment = HorizontalAlignmentStyle.Center
|
||||
|
||||
|
||||
Dim DtMesAnioAnteriorLLantasResumen As DataTable = DataSet.Tables(5)
|
||||
'INICIA DESDE LA CUARTA FILA
|
||||
Dim IdxMesAnioAnteriorLlantasResumen As Integer = IdxRefMesAnioAnteriorLlantasResumen + 1
|
||||
|
||||
For Each Row As DataRow In DtMesAnioAnteriorLLantasResumen.Rows
|
||||
worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 0).Value = ToMonthName(FechaConsulta).ToUpper()
|
||||
worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 1).Value = Row("LLantasAnioAnterior")
|
||||
worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 2).Value = Row("LLantas")
|
||||
worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 3).Formula = $"=({worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 1).Name} - {worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 2).Name})"
|
||||
worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 4).Formula = $"=+({worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 2).Name} / {worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 1).Name})"
|
||||
|
||||
Dim StyleData = worksheet.Cells.GetSubrangeAbsolute(IdxMesAnioAnteriorLlantasResumen, 0, IdxMesAnioAnteriorLlantasResumen, 4).Style
|
||||
StyleData.Font.Weight = ExcelFont.NormalWeight
|
||||
StyleData.Font.Name = "Calibri"
|
||||
StyleData.Font.Size = 8 * 20
|
||||
StyleData.VerticalAlignment = VerticalAlignmentStyle.Center
|
||||
StyleData.HorizontalAlignment = HorizontalAlignmentStyle.Center
|
||||
StyleData.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin)
|
||||
StyleData.NumberFormat = "_-* #,##0.00_-;-* #,##0.00_-;_-* ""-""??_-;_-@_-"
|
||||
|
||||
IdxMesAnioAnteriorLlantasResumen += 1
|
||||
Next
|
||||
|
||||
DtMesAnioAnteriorLLantasResumen.Dispose()
|
||||
#End Region
|
||||
|
||||
Dim columnCount = worksheet.CalculateMaxUsedColumns()
|
||||
|
||||
For i = 0 To columnCount
|
||||
worksheet.Columns(i).AutoFit(1, worksheet.Rows(0), worksheet.Rows(worksheet.Rows.Count - 1))
|
||||
Next
|
||||
|
||||
FileExcel.Save(Response, $"DIARIO_{Now.ToString("dd_MM_yyyy")}.xlsx", SaveOptions.XlsxDefault)
|
||||
FileExcel.Save(Response, $"DIARIO_{FechaConsulta.ToString("dd_MM_yyyy")}.xlsx", SaveOptions.XlsxDefault)
|
||||
|
||||
End If
|
||||
|
||||
|
||||
Reference in New Issue
Block a user