Merge branch 'master' of http://agonzalez@192.168.10.111:8383/SIG.git
This commit is contained in:
@@ -302,7 +302,8 @@ Public Class ClsContratos
|
|||||||
Geom As String, CveContratoPadre As Integer, CveUsuario As Integer, CveEmpresa As Integer, EsPresupuestal As Boolean, Minimo As Double, Maximo As Double, Importe As Double, CveMoneda As Integer, ModalidadDetalle As Integer,
|
Geom As String, CveContratoPadre As Integer, CveUsuario As Integer, CveEmpresa As Integer, EsPresupuestal As Boolean, Minimo As Double, Maximo As Double, Importe As Double, CveMoneda As Integer, ModalidadDetalle As Integer,
|
||||||
Optional CveContratosEstatus As Integer = -1, Optional CveContratoTipo As Integer = -1, Optional TipoCambio As Double = 1, Optional CveSucursalCliente As Integer = -1, Optional CveAlmacenOrigen As Integer = -1, Optional CveAlmacenDestino As Integer = -1, Optional PorcentajeComision As Integer = -1,
|
Optional CveContratosEstatus As Integer = -1, Optional CveContratoTipo As Integer = -1, Optional TipoCambio As Double = 1, Optional CveSucursalCliente As Integer = -1, Optional CveAlmacenOrigen As Integer = -1, Optional CveAlmacenDestino As Integer = -1, Optional PorcentajeComision As Integer = -1,
|
||||||
Optional TipoGarantia As Integer = -1, Optional Folio As Integer = -1, Optional FechaVenc As Date = Nothing, Optional EstatusFianza As Integer = -1, Optional CvePeriodo As Integer = -1, Optional CveContratoPlantilla As Integer = -1, Optional CveCuentaEquipo As Integer = -1,
|
Optional TipoGarantia As Integer = -1, Optional Folio As Integer = -1, Optional FechaVenc As Date = Nothing, Optional EstatusFianza As Integer = -1, Optional CvePeriodo As Integer = -1, Optional CveContratoPlantilla As Integer = -1, Optional CveCuentaEquipo As Integer = -1,
|
||||||
Optional CveVendedor As Integer = -1, Optional Observaciones As String = "", Optional CveDireccionEnvio As Integer = -1, Optional AplicaImpuestosLocales As Boolean = False, Optional CorreoNotificacionPedDev As String = "") As Integer
|
Optional CveVendedor As Integer = -1, Optional Observaciones As String = "", Optional CveDireccionEnvio As Integer = -1, Optional AplicaImpuestosLocales As Boolean = False, Optional CorreoNotificacionPedDev As String = "",
|
||||||
|
Optional FacturacionCicilica As Boolean = False, Optional FacturacionCiclicaAutomatico As Boolean = False, Optional DiaMesFacturacion As Integer = 1) As Integer
|
||||||
|
|
||||||
Dim Retorno As Integer = -1
|
Dim Retorno As Integer = -1
|
||||||
DataAdapter("PA_Con_ContratosAdd")
|
DataAdapter("PA_Con_ContratosAdd")
|
||||||
@@ -354,6 +355,9 @@ Public Class ClsContratos
|
|||||||
.Add("@CveDireccionEnvio", SqlDbType.Int).Value = CveDireccionEnvio
|
.Add("@CveDireccionEnvio", SqlDbType.Int).Value = CveDireccionEnvio
|
||||||
.Add("@AplicaImpuestosLocales", SqlDbType.Bit).Value = If(AplicaImpuestosLocales, 1, 0)
|
.Add("@AplicaImpuestosLocales", SqlDbType.Bit).Value = If(AplicaImpuestosLocales, 1, 0)
|
||||||
.Add("@CorreoNotificacionPedDev", SqlDbType.VarChar).Value = CorreoNotificacionPedDev
|
.Add("@CorreoNotificacionPedDev", SqlDbType.VarChar).Value = CorreoNotificacionPedDev
|
||||||
|
.Add("@FacturacionCicilica", SqlDbType.Bit).Value = FacturacionCicilica
|
||||||
|
.Add("@FacturacionCiclicaAutomatico", SqlDbType.Bit).Value = FacturacionCiclicaAutomatico
|
||||||
|
.Add("@DiaMesFacturacion", SqlDbType.TinyInt).Value = DiaMesFacturacion
|
||||||
|
|
||||||
End With
|
End With
|
||||||
|
|
||||||
@@ -378,7 +382,8 @@ Public Class ClsContratos
|
|||||||
CveContratoPadre As Integer, CveUsuario As Integer, CveEmpresa As Integer, EsPresupuestal As Boolean, Minimo As Double, Maximo As Double, Importe As Double, CveMoneda As Integer, ModalidadDetalle As Integer,
|
CveContratoPadre As Integer, CveUsuario As Integer, CveEmpresa As Integer, EsPresupuestal As Boolean, Minimo As Double, Maximo As Double, Importe As Double, CveMoneda As Integer, ModalidadDetalle As Integer,
|
||||||
Optional CveContratosEstatus As Integer = -1, Optional CveContratoTipo As Integer = -1, Optional TipoCambio As Double = 1.0, Optional CveSucursalCliente As Integer = -1, Optional CveAlmacenOrigen As Integer = -1, Optional CveAlmacenDestino As Integer = -1, Optional PorcentajeComision As Integer = -1,
|
Optional CveContratosEstatus As Integer = -1, Optional CveContratoTipo As Integer = -1, Optional TipoCambio As Double = 1.0, Optional CveSucursalCliente As Integer = -1, Optional CveAlmacenOrigen As Integer = -1, Optional CveAlmacenDestino As Integer = -1, Optional PorcentajeComision As Integer = -1,
|
||||||
Optional TipoGarantia As Integer = -1, Optional Folio As Integer = -1, Optional FechaVenc As Date = Nothing, Optional EstatusFianza As Integer = -1, Optional CveContratoPlantilla As Integer = -1, Optional CveCuentaEquipo As Integer = -1,
|
Optional TipoGarantia As Integer = -1, Optional Folio As Integer = -1, Optional FechaVenc As Date = Nothing, Optional EstatusFianza As Integer = -1, Optional CveContratoPlantilla As Integer = -1, Optional CveCuentaEquipo As Integer = -1,
|
||||||
Optional CveVendedor As Integer = -1, Optional Observaciones As String = "", Optional CveDireccionEnvio As Integer = -1, Optional AplicaImpuestosLocales As Boolean = False, Optional CorreoNotificacionPedDev As String = "") As Boolean
|
Optional CveVendedor As Integer = -1, Optional Observaciones As String = "", Optional CveDireccionEnvio As Integer = -1, Optional AplicaImpuestosLocales As Boolean = False, Optional CorreoNotificacionPedDev As String = "", Optional FacturacionCicilica As Boolean = False, Optional FacturacionCiclicaAutomatico As Boolean = False,
|
||||||
|
Optional DiaMesFacturacion As Integer = 1) As Boolean
|
||||||
Dim Retorno = False
|
Dim Retorno = False
|
||||||
|
|
||||||
DataAdapter("PA_Con_ContratosUpdate")
|
DataAdapter("PA_Con_ContratosUpdate")
|
||||||
@@ -429,7 +434,9 @@ Public Class ClsContratos
|
|||||||
.Add("@CveDireccionEnvio", SqlDbType.Int).Value = CveDireccionEnvio
|
.Add("@CveDireccionEnvio", SqlDbType.Int).Value = CveDireccionEnvio
|
||||||
.Add("@AplicaImpuestosLocales", SqlDbType.Bit).Value = If(AplicaImpuestosLocales, 1, 0)
|
.Add("@AplicaImpuestosLocales", SqlDbType.Bit).Value = If(AplicaImpuestosLocales, 1, 0)
|
||||||
.Add("@CorreoNotificacionPedDev", SqlDbType.VarChar).Value = CorreoNotificacionPedDev
|
.Add("@CorreoNotificacionPedDev", SqlDbType.VarChar).Value = CorreoNotificacionPedDev
|
||||||
|
.Add("@FacturacionCicilica", SqlDbType.Bit).Value = FacturacionCicilica
|
||||||
|
.Add("@FacturacionCiclicaAutomatico", SqlDbType.Bit).Value = FacturacionCiclicaAutomatico
|
||||||
|
.Add("@DiaMesFacturacion", SqlDbType.TinyInt).Value = DiaMesFacturacion
|
||||||
End With
|
End With
|
||||||
|
|
||||||
Try
|
Try
|
||||||
|
|||||||
@@ -106,7 +106,7 @@
|
|||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<asp:UpdatePanel ID="UpDatos" UpdateMode="Conditional" runat="server">
|
<asp:UpdatePanel ID="UpDatos" UpdateMode="Conditional" runat="server">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
<asp:GridView ID="GvDatos" runat="server" data-sort="true" AutoGenerateColumns="False" DataKeyNames="CvePS,Serie,CveCliente,CveVendedor" EmptyDataText="No se encontraron datos con los filtros seleccionados" ToolTip="Listado de Movimientos" CssClass="Widthall table table-striped table-hover ScrollAD" GridLines="None">
|
<asp:GridView ID="GvDatos" runat="server" data-sort="true" AutoGenerateColumns="False" DataKeyNames="CvePS,Serie,CveCliente,CveVendedor,CveMovimientoDetalleEntrada" EmptyDataText="No se encontraron datos con los filtros seleccionados" ToolTip="Listado de Movimientos" CssClass="Widthall table table-striped table-hover ScrollAD" GridLines="None">
|
||||||
<Columns>
|
<Columns>
|
||||||
<asp:BoundField HeaderText="Producto" DataField="GPO" />
|
<asp:BoundField HeaderText="Producto" DataField="GPO" />
|
||||||
<asp:BoundField HeaderText="Fecha" DataField="FechaMovto" DataFormatString="{0:d}" />
|
<asp:BoundField HeaderText="Fecha" DataField="FechaMovto" DataFormatString="{0:d}" />
|
||||||
@@ -175,5 +175,29 @@
|
|||||||
</div>
|
</div>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||||
|
<script type="text/javascript">
|
||||||
|
function LimitaCantidad(TxtCantidad, CantidadMaxima) {
|
||||||
|
var Cantidad = 0;
|
||||||
|
|
||||||
|
if (TxtCantidad.value.includes('.')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (TxtCantidad.value.includes(',')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var regex = new RegExp("^[-+]?[0-9]+\.[0-9]+$");
|
||||||
|
|
||||||
|
if (TxtCantidad.value != '') {
|
||||||
|
Cantidad = parseInt(TxtCantidad.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Cantidad > CantidadMaxima) {
|
||||||
|
TxtCantidad.value = FormatoNumero(CantidadMaxima, 0);
|
||||||
|
} else {
|
||||||
|
TxtCantidad.value = FormatoNumero(Cantidad, 0);;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
|
|
||||||
|
|||||||
@@ -200,9 +200,10 @@ Partial Class Inventarios_RepApartados
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If e.Row.DBCampo("IDGPO").ToString.ToEntero = 3 Then
|
If e.Row.DBCampo("IDGPO").ToString.ToEntero = 3 Then
|
||||||
If e.Row.DBCampo("CveVendedor").ToEntero() = UsuarioActual.CveVendedor Then
|
If DdlSubProyectos.SelectedValue.ToEntero() > 0 AndAlso e.Row.DBCampo("CveVendedor").ToEntero() = UsuarioActual.CveVendedor Then
|
||||||
e.Row.FCTextBox("TxtCantidad").Visible = True
|
e.Row.FCTextBox("TxtCantidad").Visible = True
|
||||||
e.Row.FCRangeValidator("RVCantidad").Visible = True
|
e.Row.FCRangeValidator("RVCantidad").Visible = True
|
||||||
|
e.Row.FCTextBox("TxtCantidad").Attributes.Add("onkeyup", $"LimitaCantidad({e.Row.FCTextBox("TxtCantidad").ClientID},{e.Row.DBCampo("Cantidad").ToEntero});")
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -271,7 +272,7 @@ Partial Class Inventarios_RepApartados
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If Not GvDatos.Rows.Cast(Of GridViewRow).Any(Function(gvr) gvr.FCTextBox("TxtCantidad").Text.ToEntero() > 0) Then
|
If Not GvDatos.Rows.Cast(Of GridViewRow).Any(Function(gvr) gvr.FCTextBox("TxtCantidad").Text.ToEntero() > 0) Then
|
||||||
Alert("No se ha seleccionado ningun cliente", TipoMensaje.MsgAdvertencia)
|
Alert("No se ha seleccionado ningun producto para realizar el traspaso", TipoMensaje.MsgAdvertencia)
|
||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -298,6 +299,10 @@ Partial Class Inventarios_RepApartados
|
|||||||
'CUADRA LOS LOS PRODUCTOS CON LO QUE SE PUEDE DESAPARTAR
|
'CUADRA LOS LOS PRODUCTOS CON LO QUE SE PUEDE DESAPARTAR
|
||||||
Dim DtDetalleTraspasar As DataTable = CuadrarMovimientosApartado(CveAlmacenApartado, Row("CveCliente").ToString().ToEntero(), Row("CveVendedor").ToString().ToEntero(), DtPSTraspasar, ObjInventario)
|
Dim DtDetalleTraspasar As DataTable = CuadrarMovimientosApartado(CveAlmacenApartado, Row("CveCliente").ToString().ToEntero(), Row("CveVendedor").ToString().ToEntero(), DtPSTraspasar, ObjInventario)
|
||||||
|
|
||||||
|
If DtDetalleTraspasar.Rows.Count = 0 Then
|
||||||
|
ErrorMovInv = True
|
||||||
|
Mensaje.Append("No se encontraron productos para realizar el traspaso.")
|
||||||
|
End If
|
||||||
DtPSTraspasar.Dispose()
|
DtPSTraspasar.Dispose()
|
||||||
|
|
||||||
Dim MovSalida = GenerarMovimientoAlmacen(CveAlmacenApartado, 8, Row("CveVendedor").ToString().ToEntero(), Row("CveCliente").ToString().ToEntero(), -1, TxtObs.Text.Trim(), DtDetalleTraspasar, ObjInventario, "RepApar/1")
|
Dim MovSalida = GenerarMovimientoAlmacen(CveAlmacenApartado, 8, Row("CveVendedor").ToString().ToEntero(), Row("CveCliente").ToString().ToEntero(), -1, TxtObs.Text.Trim(), DtDetalleTraspasar, ObjInventario, "RepApar/1")
|
||||||
@@ -316,8 +321,12 @@ Partial Class Inventarios_RepApartados
|
|||||||
|
|
||||||
If Not ErrorMovInv Then
|
If Not ErrorMovInv Then
|
||||||
EntradasAlmacen.Add(MovEntrada)
|
EntradasAlmacen.Add(MovEntrada)
|
||||||
|
Else
|
||||||
|
Mensaje.Append("No se pudo generar el movimiento de apartado.")
|
||||||
End If
|
End If
|
||||||
|
Else
|
||||||
|
Mensaje.Append("No se pudo generar el movimiento de desapartado.")
|
||||||
|
Exit For
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Next
|
Next
|
||||||
@@ -367,19 +376,24 @@ Partial Class Inventarios_RepApartados
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If DtRetorno IsNot Nothing Then
|
If DtRetorno IsNot Nothing Then
|
||||||
For Each RowCantidad As DataRow In DtPSTraspasar.Rows
|
For Each RowTraspasar As DataRow In DtPSTraspasar.Rows
|
||||||
Dim Filtro As New StringBuilder
|
Dim Filtro As New StringBuilder
|
||||||
Filtro.AppendFormat("CvePS={0}", RowCantidad("CvePS"))
|
Filtro.AppendFormat("CvePS={0}", RowTraspasar("CvePS"))
|
||||||
|
|
||||||
'SI TIENE SERIE LA AGREGA AL FILTRO
|
'SI TIENE SERIE LA AGREGA AL FILTRO
|
||||||
If Not String.IsNullOrEmpty(RowCantidad("Serie").ToString()) Then
|
If Not String.IsNullOrEmpty(RowTraspasar("Serie").ToString()) Then
|
||||||
Filtro.AppendFormat("AND Serie='{0}'", RowCantidad("Serie"))
|
Filtro.AppendFormat(" AND Serie='{0}'", RowTraspasar("Serie"))
|
||||||
Else
|
Else
|
||||||
Filtro.AppendFormat("AND ISNULL(Serie,'') = ''")
|
Filtro.AppendFormat(" AND ISNULL(Serie,'') = ''")
|
||||||
|
End If
|
||||||
|
|
||||||
|
'FILTRA EL MOVIMIENTO DE APARTADO ORIGINAL
|
||||||
|
If Not String.IsNullOrEmpty(RowTraspasar("CveMovimientoDetalleEntrada").ToString()) Then
|
||||||
|
Filtro.AppendFormat(" AND CveMovimientoDetalle={0}", RowTraspasar("CveMovimientoDetalleEntrada"))
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim RowDesapartado As DataRow = DtDesapartado.Select(Filtro.ToString()).FirstOrDefault()
|
Dim RowDesapartado As DataRow = DtDesapartado.Select(Filtro.ToString()).FirstOrDefault()
|
||||||
RowDesapartado("Cantidad") = RowCantidad("Cantidad")
|
RowDesapartado("Cantidad") = RowTraspasar("Cantidad")
|
||||||
|
|
||||||
DtRetorno.Rows.Add(RowDesapartado.ItemArray)
|
DtRetorno.Rows.Add(RowDesapartado.ItemArray)
|
||||||
Next
|
Next
|
||||||
@@ -396,6 +410,7 @@ Partial Class Inventarios_RepApartados
|
|||||||
Dt.Columns.Add(New DataColumn("Serie", GetType(String)))
|
Dt.Columns.Add(New DataColumn("Serie", GetType(String)))
|
||||||
Dt.Columns.Add(New DataColumn("CveCliente", GetType(Integer)))
|
Dt.Columns.Add(New DataColumn("CveCliente", GetType(Integer)))
|
||||||
Dt.Columns.Add(New DataColumn("CveVendedor", GetType(Integer)))
|
Dt.Columns.Add(New DataColumn("CveVendedor", GetType(Integer)))
|
||||||
|
Dt.Columns.Add(New DataColumn("CveMovimientoDetalleEntrada", GetType(Integer)))
|
||||||
|
|
||||||
For Each GvRow As GridViewRow In GvDatos.Rows.Cast(Of GridViewRow).Where(Function(gvr) gvr.FCTextBox("TxtCantidad").Text.ToEntero() > 0)
|
For Each GvRow As GridViewRow In GvDatos.Rows.Cast(Of GridViewRow).Where(Function(gvr) gvr.FCTextBox("TxtCantidad").Text.ToEntero() > 0)
|
||||||
Dim Row As DataRow = Dt.NewRow
|
Dim Row As DataRow = Dt.NewRow
|
||||||
@@ -405,6 +420,7 @@ Partial Class Inventarios_RepApartados
|
|||||||
Row("Serie") = GvRow.DataKey("Serie")
|
Row("Serie") = GvRow.DataKey("Serie")
|
||||||
Row("CveCliente") = GvRow.DataKey("CveCliente").ToEntero()
|
Row("CveCliente") = GvRow.DataKey("CveCliente").ToEntero()
|
||||||
Row("CveVendedor") = GvRow.DataKey("CveVendedor").ToEntero()
|
Row("CveVendedor") = GvRow.DataKey("CveVendedor").ToEntero()
|
||||||
|
Row("CveMovimientoDetalleEntrada") = GvRow.DataKey("CveMovimientoDetalleEntrada").ToEntero()
|
||||||
|
|
||||||
Dt.Rows.Add(Row)
|
Dt.Rows.Add(Row)
|
||||||
Next
|
Next
|
||||||
|
|||||||
Reference in New Issue
Block a user