cambiios merge

This commit is contained in:
2021-03-11 12:19:06 -07:00
54 changed files with 5274 additions and 4245 deletions

View File

@@ -157,15 +157,14 @@
}
.GastoIndirectoOpciones {
margin-left:auto;
margin-right:auto;
width:400px;
margin-left: auto;
margin-right: auto;
width: 400px;
}
.GastoIndirectoOpciones td
{
text-align:right /* Or any other value */
}
.GastoIndirectoOpciones td {
text-align: right; /* Or any other value */
}
/*IPP*/
</style>
</asp:Content>
@@ -3217,12 +3216,12 @@
</div>
</div>
</div>
<div class="row" style="align-items: center" id="divDevAuto" runat="server" visible="false">
<label class="col-md-4">Devolución automática:</label>
<div class="col-md-8">
<asp:CheckBox Text="" runat="server" ID="CheckDevAuto" Visible="True" />
</div>
</div>
<div class="row" style="align-items: center" id="divDevAuto" runat="server" visible="false">
<label class="col-md-4">Devolución automática:</label>
<div class="col-md-8">
<asp:CheckBox Text="" runat="server" ID="CheckDevAuto" Visible="True" />
</div>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="BtnCancelarCompra2" OnClick="BtnCancelarCompra2_Click" runat="server" CssClass="btn btn-success" Text="Cancelar Compra" ValidationGroup="GrpCancelarCompra" />
@@ -4788,7 +4787,14 @@
<ajax:TabPanel ID="TabNCAlmacen" runat="server" HeaderText="Almacen">
<ContentTemplate>
<div class="row">
<div class="col-md-12 h4 text-right">
<div class="col-md-6 text-left">
<asp:UpdatePanel ID="UpMostrarTodos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:CheckBox ID="ChkMostrarTodos" Text="Mostrar Todos" runat="server" OnCheckedChanged="ChkMostrarTodos_CheckedChanged" AutoPostBack="true" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="col-md-6 h4 text-right">
Saldo: $<asp:Label Text="0.00" ID="LbNCInvSaldoAlmacen" runat="server" />
</div>
</div>

View File

@@ -3988,9 +3988,11 @@ Partial Class Compras_Compras
Protected Sub BtnGuardar_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnGuardar.Click
AjustaCombustibles()
'If Not AjustaCombustibles() Then
' Exit Sub
'End If
'------------------INICIA VALIDACIONES------------------
'------------------ INICIA VALIDACIONES ------------------
Dim EstatusCredito As Integer = 0
Dim CveSubProyecto As Integer = 0
'Credito Multiple
@@ -4303,7 +4305,7 @@ Partial Class Compras_Compras
Next
If ErrorValidacion Then Exit Sub
'------------------TERMINA VALIDACIONES------------------
'RECORRO LOS PRODUCTOS O SERVICIOS PARA REGISTRARLOS LOS QUE NO EXISTEN EN EL CATÁLOGO
Dim tCve As Integer
@@ -4374,6 +4376,17 @@ Partial Class Compras_Compras
UM.Dispose()
PSS.Dispose()
'VALIDA IMPORTES
If Not ValidaTotalesGuardar() Then
Exit Sub
End If
If Not AjustaCombustibles() Then
Exit Sub
End If
'------------------TERMINA VALIDACIONES------------------
'si hay necesidad de actualizar el globaldtps
If RegeneraPS Then
'Dim Hilo As New System.Threading.Thread(AddressOf GeneraGlobalDT)
@@ -4423,10 +4436,7 @@ Partial Class Compras_Compras
TmpDT.AcceptChanges()
If Correcto Then
'VALIDA IMPORTES
If Not ValidaTotalesGuardar() Then
Exit Sub
End If
Dim ObjCompras As New ClsCompras()
@@ -4650,6 +4660,8 @@ Partial Class Compras_Compras
End If
Next
'Compra
If ObjCompras.AddCompra(DdlTipoComprobante.SelectedValue, TxtDescripcion.Text.Trim, TxtSerie.Text.Trim, TxtFolio.Text.Trim, TxtFolioSecundario.Text.Trim, CveProveedor, TxtSubTotal.Text.ToDouble, TxtDescuento.Text.ToDouble,
LblAmortizacion.Text.ToDouble, TxtIVA.Text.ToDouble, TxtRetIVA.Text.ToDouble, TxtRetISR.Text.ToDouble, TxtIEPS.Text.ToDouble, TxtOtrosImpuestos.Text.ToDouble,
@@ -6828,14 +6840,22 @@ Partial Class Compras_Compras
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then 'cuando es emp acumuladora
Dim Valor = (From dr1 In GlobalDTAcumTamaños().FiltraParametros("CveEmpresa = 140").AsEnumerable()
Join dr2 In TmpDT.AsEnumerable On dr1.Field(Of Integer)("CvePSCargo") Equals dr2.Field(Of Integer)("CvePS")
Select New With
{
.Total = dr2.Field(Of Double)("Total")
}).Sum(Function(item) item.Total)
Dim Valor As Decimal = 0
For Each RowAcum As DataRow In GlobalDTAcumTamaños().FiltraParametros("CveEmpresa = 140").Rows
Dim TotalTamanio = TmpDT.FiltroPrimeroValor("Total", $"CvePS={RowAcum("CvePSCargo")}").ToDecimal()
If TotalTamanio > 0 Then
Valor += TotalTamanio
End If
Next
importeMovimiento += Valor.ToDecimal
'Dim Valor = (From dr1 In GlobalDTAcumTamaños().FiltraParametros("CveEmpresa = 140").AsEnumerable()
' Join dr2 In TmpDT.AsEnumerable On dr1.Field(Of Integer)("CvePSCargo") Equals dr2.Field(Of Integer)("CvePS")
' Select New With
' {
' .Total = dr2.Field(Of Double)("Total")
' }).Sum(Function(item) item.Total)
importeMovimiento += Valor
importeMN = importeMovimiento * tipoCambioActual * Multiplicador
End If
@@ -8486,6 +8506,8 @@ Partial Class Compras_Compras
End If
Alert(Msg.ToString, TipoMensaje.MsgInformacion, MsgAccionAceptar)
BtnGuardar.Enabled = False
UpFacturar.Update()
End If
@@ -8530,7 +8552,12 @@ Partial Class Compras_Compras
End Sub
Private Sub AjustaCombustibles()
Private Function AjustaCombustibles() As Boolean
Dim Respuesta As Boolean = False
Dim IVADetalles As Decimal = TmpDT.SUM("IVA", " IVA > 0 ").ToDecimal
Dim DiferenciaIVas As Decimal = TxtIVA.Text.ToDecimal - IVADetalles
If Not TmpDT.Columns.Contains("AplicaIEPS") Then
@@ -8561,18 +8588,14 @@ Partial Class Compras_Compras
Dim IndiceUltimo As Integer = 0
For Each dRow As DataRow In TmpDT.Rows
If Boolean.Parse(dRow("AplicaIEPS").ToString) And Boolean.Parse(dRow("IEPSGrabaIVA").ToString) = False And dRow("IVA").ToString.ToDecimal > 0 Then
IndiceUltimo = IndiceContador
End If
IndiceContador = IndiceContador + 1
Next
Dim IVADetalles As Decimal = TmpDT.SUM("IVA", " IVA > 0 ").ToDecimal
Dim DiferenciaIVas As Decimal = TxtIVA.Text.ToDecimal - IVADetalles
IVADetalles = TmpDT.SUM("IVA", " IVA > 0 ").ToDecimal
DiferenciaIVas = TxtIVA.Text.ToDecimal - IVADetalles
If Math.Abs(DiferenciaIVas) > 0.01D Then
TmpDT.Rows(IndiceUltimo)("IVA") = TmpDT.Rows(IndiceUltimo)("IVA").ToString.ToDecimal + DiferenciaIVas
@@ -8582,7 +8605,36 @@ Partial Class Compras_Compras
End If
End Sub
'Revalidacion de ajuste
IVADetalles = TmpDT.SUM("IVA", " IVA > 0 ").ToDecimal
DiferenciaIVas = TxtIVA.Text.ToDecimal - IVADetalles
If Math.Abs(DiferenciaIVas) > 0.01D Then
If IVADetalles > 0 Then
For Each dRow As DataRow In TmpDT.Rows
If dRow("IVA").ToString.ToDecimal > 0 Then
dRow("IVA") = dRow("IVA").ToString.ToDecimal + DiferenciaIVas
TmpDT.AcceptChanges()
Respuesta = True
Exit For
End If
Next
Else
Alert("Los productos especificados en el lisado no tienen asigando impuesto IVA, favor de realizar la correción en el producto que aplique el impúesto.", TipoMensaje.MsgAdvertencia)
Respuesta = False
End If
Else
Respuesta = True
End If
Return Respuesta
End Function
Protected Sub TxtCodigo_TextChanged(sender As Object, e As System.EventArgs) Handles TxtCodigo.TextChanged
Dim ObjProveedores As New ClsCompProveedores()
@@ -12650,6 +12702,7 @@ Partial Class Compras_Compras
TmpDT.Rows(Indice)("PU") = TmpDT.Rows(Indice)("PU").ToString.ToDouble + tPU
TmpDT.Rows(Indice)("Total") = TmpDT.Rows(Indice)("Total").ToString.ToDouble + ImporteAjuste
TmpDT.Rows(Indice)("IEPSPS") = (TmpDT.Rows(Indice)("Total").ToString.ToDouble() * TmpDT.Rows(Indice)("IEPSPSPorcentaje").ToString.ToDouble()).RoundAD(2)
TmpDT.Rows(Indice)("IVA") = TmpDT.Rows(Indice)("PU").ToString.ToDecimal * TmpDT.Rows(Indice)("Cantidad").ToString.ToDecimal * TmpDT.Rows(Indice)("IVAPorcentaje").ToString.ToDecimal
'Row("IEPSPS") = Math.Round(IEPSPS, DecimalesPermitidos)
'Row("IEPSPSPorcentaje") = PorcentajeIEPS
TmpDT.AcceptChanges()
@@ -19063,21 +19116,24 @@ Partial Class Compras_Compras
CargaAnticipos(CveProveedor, If(ChkNCInv.Checked, "NC", "-1"))
UpAnticipos.Update()
End Sub
Private Sub CargaNCINV()
Private Sub CargaNCINV(Optional ShowAllPendientes As Boolean = False)
Dim SaldoAnticipo = 0.0
Dim CveCompras As String = ""
If ChkNCInvNC.Checked Then
For Each gvr As GridViewRow In GvFacturaNC.Rows
If gvr.FCCheckBox("ChkFacturaNC") IsNot Nothing AndAlso gvr.FCCheckBox("ChkFacturaNC").Checked Then
SaldoAnticipo += gvr.FCTextBox("TxtImporte").Text.ToDouble
If CveCompras <> "" Then
CveCompras = $"{CveCompras},{gvr.DataKey("CveCompra").ToString}"
Else
CveCompras = gvr.DataKey("CveCompra").ToString
If Not ShowAllPendientes Then
For Each gvr As GridViewRow In GvFacturaNC.Rows
If gvr.FCCheckBox("ChkFacturaNC") IsNot Nothing AndAlso gvr.FCCheckBox("ChkFacturaNC").Checked Then
SaldoAnticipo += gvr.FCTextBox("TxtImporte").Text.ToDouble
If CveCompras <> "" Then
CveCompras = $"{CveCompras},{gvr.DataKey("CveCompra").ToString}"
Else
CveCompras = gvr.DataKey("CveCompra").ToString
End If
End If
End If
Next
Next
End If
Else
For Each gvr As GridViewRow In GVAnticipos.Rows
If gvr.FCCheckBox("Chk") IsNot Nothing AndAlso gvr.FCCheckBox("Chk").Checked Then
@@ -19092,7 +19148,6 @@ Private Sub CargaNCINV()
End If
LbNCInvSaldo.Text = SaldoAnticipo.FormatoNumero()
LbNCInvSaldoAlmacen.Text = SaldoAnticipo.FormatoNumero()
@@ -19109,11 +19164,14 @@ Private Sub CargaNCINV()
GVNCInv.DataSource = DtPendientesAlmacen
GVNCInv.DataBind()
If Not String.IsNullOrEmpty(CveCompras) Then
DtPendientesAlmacen = DtPendientesAlmacen.FiltraParametros($"CveCompra IN ({CveCompras})")
End If
GVNCInvAlmacen.DataSource = DtPendientesAlmacen
GVNCInvAlmacen.DataBind()
End If
Else
If ChkNCInvNC.Checked Then
Alert("Niguna de las facturas seleccionadas cuenta con productos pendientes de darles entrada.", TipoMensaje.MsgAdvertencia)
@@ -20373,7 +20431,7 @@ Private Sub CargaNCINV()
Protected Sub BtnFacturaNC_Click(sender As Object, e As EventArgs)
If ChkNCInvNC.Checked Then
CargaNCINV()
CargaNCINV(ShowAllPendientes:=False)
TabModoNC.ActiveTabIndex = 1
TabModoNC_ActiveTabChanged(TabModoNC, EventArgs.Empty)
@@ -20720,9 +20778,11 @@ Private Sub CargaNCINV()
End Sub
Protected Sub ChkMostrarTodos_CheckedChanged(sender As Object, e As EventArgs)
CargaNCINV(ShowAllPendientes:=True)
UpFacturaNC.Update()
UpMostrarTodos.Update()
End Sub
End Class
Public Class MMensajeDevolucion

View File

@@ -1342,7 +1342,7 @@ Partial Class PopUpVerFactura
'VERIFICA SI TIENE MOVIMIENTO VIRTUAL RELACIONADO
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso ObjInventarios.DtResultados.Rows.Count > 0 Then
CveMovimientoRelacionado = ObjInventarios.DtResultados.Rows(0)("CveMtoRel").ToString().ToEntero()
If CveConcepto.Contiene(2, 3, 26, 27) AndAlso ObjInventarios.DtResultados.FiltroPrimeroValor("CveMovimientoVirtual").ToEntero() > 0 Then
If CveConcepto.Contiene(2, 3, 26, 27, 40, 41) AndAlso ObjInventarios.DtResultados.FiltroPrimeroValor("CveMovimientoVirtual").ToEntero() > 0 Then
FolioRelacionado = ObjInventarios.DtResultados.FiltroPrimeroValor("FolioVirtual")
CveConceptoMovtoRelacionado = 37
ElseIf CveConcepto.Contiene(36, 37) Then
@@ -1361,8 +1361,31 @@ Partial Class PopUpVerFactura
If CveConcepto = 3 Or CveConcepto = 18 Or CveConcepto = 30 Or CveConcepto = 34 Or CveConcepto = 35 Or CveConcepto = 16 Or CveConcepto = 7 Or CveConcepto = 40 Then 'SALIDA Y DEVOLUCION DEL CLIENTE
If ObjInventarios.GetMovimientosDetalleImpresion(CveMovimiento, UsuarioActual.CveEmpresa) Then
DtMovimientos = ObjInventarios.DtResultados
Alert("asdf")
DtMovimientos = ObjInventarios.DtResultados
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso CveMovimientoRelacionado > 0 Then
If ObjInventarios.GetMovimientosDetalleImpresion(CveMovimientoRelacionado, UsuarioActual.CveEmpresa) AndAlso ObjInventarios.DtResultados.Rows.Count > 0 Then
Dim CveAlmacenRelacionado As Integer = ObjInventarios.DtResultados.Rows(0)("CveAlmacen").ToString().ToEntero()
Dim CveTipoAlmacenRelacionado As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTipoAlmacen", $"CveAlmacen = {CveAlmacenRelacionado}").ToString.ToEntero
'SI TIENE RELACIONADO UN MOVIMIENTO VIRTUAL DEBE AGREGAR ESTE MOVIMIENTO A LA IMPRESION
If CveTipoAlmacenRelacionado.Contiene(24, 25) Then
If ObjInventarios.GetMovimientosDetalle(CveMovimientoRelacionado, UsuarioActual.CveEmpresa) Then
Dim DtUsados As DataTable = ObjInventarios.DtResultados.Copy()
CantidadUsados = DtUsados.SUM("Cantidad").ToDecimal()
Dim IndexInicialUsados As Integer = DtMovimientos.Rows.Count + 1
For Each Dr As DataRow In DtUsados.Rows
Dr("No") = IndexInicialUsados
IndexInicialUsados += 1
Next
DtMovimientos.Merge(DtUsados)
End If
End If
End If
End If
DtMovimientos.Columns("No").AutoIncrement = True
DtMovimientos.Columns("No").AutoIncrementSeed = DtMovimientos.Rows.Count + 1
DtMovimientos.Columns("No").AutoIncrementStep = 1
@@ -4638,18 +4661,28 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("TipoAuto", ModeloAuto))
'Informacion Consumidor
'Informacion Distribuidor
If (CveCliente > 0) Then
Dim DatosClienteSeleccionado As DataRow = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCliente = {0}", CveCliente))
Dim Nombre As String = DatosClienteSeleccionado.Item("Nombre").ToString
Dim Ciudad As String = DatosClienteSeleccionado.Item("Ciudad").ToString
Dim Estado As String = DatosClienteSeleccionado.Item("Estado").ToString
Dim Nombre As String = ""
Dim Ciudad As String = ""
Dim Estado As String = ""
Dim Direccion As String = ""
Dim Telefono As String = ""
If DatosClienteSeleccionado IsNot Nothing Then
Nombre = DatosClienteSeleccionado("Nombre").ToString
Ciudad = DatosClienteSeleccionado("Ciudad").ToString
Estado = DatosClienteSeleccionado("Estado").ToString
Direccion = DatosClienteSeleccionado("Direccion").ToString
Telefono = DatosClienteSeleccionado("Telefono").ToString
End If
params.Add(New ReportParameter("NombreCliente", Nombre))
params.Add(New ReportParameter("Direccion", String.Format("{0}, {1}", Ciudad.Trim, Estado)))
params.Add(New ReportParameter("CiudadEstadoConsumidor", String.Format("{0}, {1}", Ciudad.Trim, Estado)))
params.Add(New ReportParameter("TelConsumidor", DatosClienteSeleccionado.Item("Telefono").ToString))
params.Add(New ReportParameter("Direccion", Direccion))
params.Add(New ReportParameter("CiudadEstadoConsumidor", String.Format("{0}, {1}", Ciudad, Estado)))
params.Add(New ReportParameter("TelConsumidor", Telefono))
End If
params.Add(New ReportParameter("Anio", Año))

View File

@@ -105,7 +105,7 @@
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<div class="col-md-1">SubTipo Activo Fijo:</div>
<div class="col-md-1">SubTipo Fijo:</div>
<div class="col-md-2">
<asp:DropDownList ID="DdlSubTipoActivoFijo" CssClass="form-control input-sm select2me input-small" runat="server" AppendDataBoundItems="True" AutoPostBack="True" DataTextField="SubTipoActivoFijo" DataValueField="CveSubTipoActivoFijo" Width="95%">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>