E13. Cambios en generacion de carta porte
This commit is contained in:
@@ -231,7 +231,7 @@
|
|||||||
<br />
|
<br />
|
||||||
<div class="form-group form-md-line-input input-iconright" runat="server" id="DivPSAdicionalVigencia" visible="false">
|
<div class="form-group form-md-line-input input-iconright" runat="server" id="DivPSAdicionalVigencia" visible="false">
|
||||||
<ADS:Dropdownlost runat="server" ID="DdlPSAdicionalVigencia" CssStyle="width: 46%;" CssClass="form-control input-sm select2me" DataTextField="PSCodigo" DataValueField="CvePS" />
|
<ADS:Dropdownlost runat="server" ID="DdlPSAdicionalVigencia" CssStyle="width: 46%;" CssClass="form-control input-sm select2me" DataTextField="PSCodigo" DataValueField="CvePS" />
|
||||||
<label for="<%= DdlPSAdicionalVigencia.ClientID.ToString()%>">Producto de vigencia:</label>
|
<label for="<%= DdlPSAdicionalVigencia.ClientID.ToString()%>"><asp:Literal runat="server" Text="Producto de vigencia:" ID="LtlPSAdicionalVigencia"></asp:Literal> </label>
|
||||||
<i></i>
|
<i></i>
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
|
|||||||
@@ -330,6 +330,12 @@ Partial Class ProductosyServicios
|
|||||||
CargaPSAdicionalesVigencias()
|
CargaPSAdicionalesVigencias()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If UsuarioActual.CveEmpresa = 13 Then
|
||||||
|
DivPSAdicionalVigencia.Visible = True
|
||||||
|
LtlPSAdicionalVigencia.Text = "Producto Relacionado:"
|
||||||
|
CargaPSAdicionalesVigencias()
|
||||||
|
End If
|
||||||
|
|
||||||
'Nuevo R: 26/09/2017
|
'Nuevo R: 26/09/2017
|
||||||
CargaProveedores()
|
CargaProveedores()
|
||||||
|
|
||||||
|
|||||||
1156
Ventas/Ventas.aspx
1156
Ventas/Ventas.aspx
File diff suppressed because it is too large
Load Diff
@@ -2351,7 +2351,7 @@ Partial Class Ventas
|
|||||||
UpFacturar.Update()
|
UpFacturar.Update()
|
||||||
'CargaTiposDocumentos()
|
'CargaTiposDocumentos()
|
||||||
TrEmitir.Visible = False
|
TrEmitir.Visible = False
|
||||||
If UsuarioActual.CveRol = 1 AndAlso UsuarioActual.CveEmpresa = 13 Then
|
If UsuarioActual.CveRol = 1 OrElse UsuarioActual.CveEmpresa.Contiene(13, 83) Then
|
||||||
DivCartaPorte.Visible = True
|
DivCartaPorte.Visible = True
|
||||||
End If
|
End If
|
||||||
ViewState("EstablecioFolio") = False
|
ViewState("EstablecioFolio") = False
|
||||||
@@ -5818,10 +5818,11 @@ Partial Class Ventas
|
|||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub CargaFormaPago(CveMetodoPago As Integer)
|
Private Sub CargaFormaPago(CveMetodoPago As Integer)
|
||||||
'FACTURACION 3.3
|
'EN LA VERSION 4.0 NO PERMITE DESBLOEQUEAR RELACION METODO Y FOMA DE PAGO
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(350) <> "1" Then
|
||||||
'permiso para desbloquear la relación entre Método de pago y forma de pago
|
'permiso para desbloquear la relación entre Método de pago y forma de pago
|
||||||
If UsuarioActual.TienePermisoProceso(282) Then CveMetodoPago = -1
|
If UsuarioActual.TienePermisoProceso(282) Then CveMetodoPago = -1
|
||||||
|
End If
|
||||||
|
|
||||||
Dim dtt As DataTable = Nothing
|
Dim dtt As DataTable = Nothing
|
||||||
If CveMetodoPago > 0 Then
|
If CveMetodoPago > 0 Then
|
||||||
@@ -7290,7 +7291,7 @@ Partial Class Ventas
|
|||||||
If Not UsuarioActual.Empresa.Funcionalidad(141).ToString() = "1" Then
|
If Not UsuarioActual.Empresa.Funcionalidad(141).ToString() = "1" Then
|
||||||
Objeto.ddl.Items.Clear()
|
Objeto.ddl.Items.Clear()
|
||||||
'Objeto.ddl.DataSource = GlobalDTProductosServicios(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacion, AplicaParaVenta:=1, Estatus:=1)
|
'Objeto.ddl.DataSource = GlobalDTProductosServicios(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacion, AplicaParaVenta:=1, Estatus:=1)
|
||||||
Objeto.ddl.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacion, Estatus:=1, AplicaParaVenta:=1)
|
Objeto.ddl.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacion, Estatus:=1, AplicaParaVenta:=If(AplicaParaVenta, 1, -1))
|
||||||
Objeto.ddl.DataBind()
|
Objeto.ddl.DataBind()
|
||||||
Objeto.ddl.Items.Insert(0, New ListItem("*** Actualizar listado de Productos o Servicios ***", "-2"))
|
Objeto.ddl.Items.Insert(0, New ListItem("*** Actualizar listado de Productos o Servicios ***", "-2"))
|
||||||
Objeto.ddl.Items.Insert(0, New ListItem("Seleccione el Producto", "-1"))
|
Objeto.ddl.Items.Insert(0, New ListItem("Seleccione el Producto", "-1"))
|
||||||
@@ -7307,9 +7308,9 @@ Partial Class Ventas
|
|||||||
|
|
||||||
Objeto.Attributes.Add("data-cvesubproyecto", cvesubproyecto)
|
Objeto.Attributes.Add("data-cvesubproyecto", cvesubproyecto)
|
||||||
Objeto.ddlWS.Attributes.Add("data-cveclasificacion", CveClasificacion.ToString())
|
Objeto.ddlWS.Attributes.Add("data-cveclasificacion", CveClasificacion.ToString())
|
||||||
Objeto.ddlWS.Attributes.Add("data-pagina", "ventas/ventas")
|
|
||||||
Objeto.ddlWS.Attributes.Add("data-Estatus", "1")
|
Objeto.ddlWS.Attributes.Add("data-Estatus", "1")
|
||||||
If AplicaParaVenta Then
|
If AplicaParaVenta Then
|
||||||
|
Objeto.ddlWS.Attributes.Add("data-pagina", "ventas/ventas")
|
||||||
Objeto.ddlWS.Attributes.Add("data-AplicaparaVenta", "1")
|
Objeto.ddlWS.Attributes.Add("data-AplicaparaVenta", "1")
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -14855,47 +14856,54 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
Select Case ConversionRemision
|
Select Case ConversionRemision
|
||||||
Case "*"
|
Case "*"
|
||||||
For Each Row As DataRow In TmpDT.Rows
|
For Each Row As DataRow In TmpDT.Rows
|
||||||
Row("PU") = Math.Round(Row("PU").ToString().ToDouble * TipoCambioRemision, NumeroDecimales)
|
Row("PU") = Math.Round(Row("PU").ToString().ToDouble * TipoCambioRemision, NumeroDecimales)
|
||||||
Row("Total") = Math.Round(Row("Cantidad").ToString().ToDouble * Row("PU").ToString().ToDouble, NumeroDecimales)
|
Row("Total") = Math.Round(Row("Cantidad").ToString().ToDouble * Row("PU").ToString().ToDouble, NumeroDecimales)
|
||||||
Row("TotalImporte") = Math.Round(Row("Cantidad").ToString().ToDouble * Row("PU").ToString().ToDouble, NumeroDecimales)
|
Row("TotalImporte") = Math.Round(Row("Cantidad").ToString().ToDouble * Row("PU").ToString().ToDouble, NumeroDecimales)
|
||||||
Row("Descuento") = Math.Round(Row("Descuento").ToString().ToDouble * TipoCambioRemision, NumeroDecimales)
|
Row("Descuento") = Math.Round(Row("Descuento").ToString().ToDouble * TipoCambioRemision, NumeroDecimales)
|
||||||
Row("ImporteIVA") = Math.Round(Row("ImporteIVA").ToString().ToDouble * TipoCambioRemision, NumeroDecimales)
|
Row("ImporteIVA") = Math.Round(Row("ImporteIVA").ToString().ToDouble * TipoCambioRemision, NumeroDecimales)
|
||||||
Row("ImporteIEPS") = Math.Round(Row("ImporteIEPS").ToString().ToDouble * TipoCambioRemision, NumeroDecimales)
|
Row("ImporteIEPS") = Math.Round(Row("ImporteIEPS").ToString().ToDouble * TipoCambioRemision, NumeroDecimales)
|
||||||
Row("ImporteRetIVA") = Math.Round(Row("ImporteRetIVA").ToString().ToDouble * TipoCambioRemision, NumeroDecimales)
|
Row("ImporteRetIVA") = Math.Round(Row("ImporteRetIVA").ToString().ToDouble * TipoCambioRemision, NumeroDecimales)
|
||||||
Row("ImporteRetISR") = Math.Round(Row("ImporteRetISR").ToString().ToDouble * TipoCambioRemision, NumeroDecimales)
|
Row("ImporteRetISR") = Math.Round(Row("ImporteRetISR").ToString().ToDouble * TipoCambioRemision, NumeroDecimales)
|
||||||
Next
|
Next
|
||||||
|
|
||||||
For Each gvr As GridViewRow In GvImpuestosLocales2.Rows
|
For Each gvr As GridViewRow In GvImpuestosLocales2.Rows
|
||||||
If gvr.RowType = DataControlRowType.DataRow Then
|
If gvr.RowType = DataControlRowType.DataRow Then
|
||||||
gvr.FCTextBox("TxtImpuestoLocalPS").Text = (Math.Round(gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble * TipoCambioRemision, NumeroDecimales)).FormatoNumero
|
gvr.FCTextBox("TxtImpuestoLocalPS").Text = (Math.Round(gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble * TipoCambioRemision, NumeroDecimales)).FormatoNumero
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
Case "/"
|
Case "/"
|
||||||
For Each Row As DataRow In TmpDT.Rows
|
For Each Row As DataRow In TmpDT.Rows
|
||||||
Row("PU") = Math.Round(Row("PU").ToString().ToDouble / TipoCambioRemision, NumeroDecimales)
|
Row("PU") = Math.Round(Row("PU").ToString().ToDouble / TipoCambioRemision, NumeroDecimales)
|
||||||
Row("Total") = Math.Round(Row("Cantidad").ToString().ToDouble * Row("PU").ToString().ToDouble, NumeroDecimales)
|
Row("Total") = Math.Round(Row("Cantidad").ToString().ToDouble * Row("PU").ToString().ToDouble, NumeroDecimales)
|
||||||
Row("TotalImporte") = Math.Round(Row("Cantidad").ToString().ToDouble * Row("PU").ToString().ToDouble, NumeroDecimales)
|
Row("TotalImporte") = Math.Round(Row("Cantidad").ToString().ToDouble * Row("PU").ToString().ToDouble, NumeroDecimales)
|
||||||
Row("Descuento") = Math.Round(Row("Descuento").ToString().ToDouble / TipoCambioRemision, NumeroDecimales)
|
Row("Descuento") = Math.Round(Row("Descuento").ToString().ToDouble / TipoCambioRemision, NumeroDecimales)
|
||||||
Row("ImporteIEPS") = Math.Round(Row("ImporteIEPS").ToString().ToDouble / TipoCambioRemision, NumeroDecimales)
|
Row("ImporteIEPS") = Math.Round(Row("ImporteIEPS").ToString().ToDouble / TipoCambioRemision, NumeroDecimales)
|
||||||
Row("ImporteIVA") = Math.Round(Row("ImporteIVA").ToString().ToDouble / TipoCambioRemision, NumeroDecimales)
|
Row("ImporteIVA") = Math.Round(Row("ImporteIVA").ToString().ToDouble / TipoCambioRemision, NumeroDecimales)
|
||||||
Row("ImporteRetIVA") = Math.Round(Row("ImporteRetIVA").ToString().ToDouble / TipoCambioRemision, NumeroDecimales)
|
Row("ImporteRetIVA") = Math.Round(Row("ImporteRetIVA").ToString().ToDouble / TipoCambioRemision, NumeroDecimales)
|
||||||
Row("ImporteRetISR") = Math.Round(Row("ImporteRetISR").ToString().ToDouble / TipoCambioRemision, NumeroDecimales)
|
Row("ImporteRetISR") = Math.Round(Row("ImporteRetISR").ToString().ToDouble / TipoCambioRemision, NumeroDecimales)
|
||||||
Next
|
Next
|
||||||
|
|
||||||
For Each gvr As GridViewRow In GvImpuestosLocales2.Rows
|
For Each gvr As GridViewRow In GvImpuestosLocales2.Rows
|
||||||
If gvr.RowType = DataControlRowType.DataRow Then
|
If gvr.RowType = DataControlRowType.DataRow Then
|
||||||
gvr.FCTextBox("TxtImpuestoLocalPS").Text = (Math.Round(gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble / TipoCambioRemision, NumeroDecimales)).FormatoNumero
|
gvr.FCTextBox("TxtImpuestoLocalPS").Text = (Math.Round(gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble / TipoCambioRemision, NumeroDecimales)).FormatoNumero
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
Case Else
|
Case Else
|
||||||
|
|
||||||
End Select
|
End Select
|
||||||
|
|
||||||
ImprimirbytesPDF(PdfFactura(ObjFactura, Guardar:=False), "Factura", "PDF")
|
Dim CartaPorte As Modelos.MSubReportData = Nothing
|
||||||
|
|
||||||
Select Case ConversionRemision
|
If UsuarioActual.CveEmpresa = 13 Then
|
||||||
|
CartaPorte = New Modelos.MSubReportData()
|
||||||
|
CartaPorte.Parametros.Add(New ReportParameter($"TieneCartaPorte", "False"))
|
||||||
|
End If
|
||||||
|
|
||||||
|
ImprimirbytesPDF(PdfFactura(ObjFactura, Guardar:=False, SubReportData:=CartaPorte), "Factura", "PDF")
|
||||||
|
|
||||||
|
Select Case ConversionRemision
|
||||||
Case "*"
|
Case "*"
|
||||||
For Each Row As DataRow In TmpDT.Rows
|
For Each Row As DataRow In TmpDT.Rows
|
||||||
Row("PU") = Math.Round(Row("PU").ToString().ToDouble * TipoCambioRemision, NumeroDecimales)
|
Row("PU") = Math.Round(Row("PU").ToString().ToDouble * TipoCambioRemision, NumeroDecimales)
|
||||||
@@ -34203,8 +34211,8 @@ Partial Class Ventas
|
|||||||
|
|
||||||
Public Sub CargarCamiones()
|
Public Sub CargarCamiones()
|
||||||
|
|
||||||
TxtFechaEntregaCP.Text = Now.ToString("dd/MM/yyyy")
|
TxtFechaEntregaCP.Text = Now.Date.ToString("dd/MM/yyyy HH:mm")
|
||||||
TxtFechaLlegadaCP.Text = Now.ToString("dd/MM/yyyy")
|
TxtFechaLlegadaCP.Text = Now.Date.ToString("dd/MM/yyyy HH:mm") 'Now.Date.AddDays(1).AddMinutes(-1).ToString("dd/MM/yyyy HH:mm")
|
||||||
|
|
||||||
DdlConfigAuto.Items.Clear()
|
DdlConfigAuto.Items.Clear()
|
||||||
DdlUnidadCamion.Items.Clear()
|
DdlUnidadCamion.Items.Clear()
|
||||||
@@ -34273,6 +34281,10 @@ Partial Class Ventas
|
|||||||
TxtFechaEntregaCP.Enabled = False
|
TxtFechaEntregaCP.Enabled = False
|
||||||
TxtFechaLlegadaCP.Enabled = False
|
TxtFechaLlegadaCP.Enabled = False
|
||||||
|
|
||||||
|
Dim CveEntregaAlmacen As Integer = -1
|
||||||
|
Dim CveDireccionOrigen As Integer = -1
|
||||||
|
Dim CveDireccionDestino As Integer = -1
|
||||||
|
|
||||||
Using ObjGral As New ClsGenerales
|
Using ObjGral As New ClsGenerales
|
||||||
If ObjGral.GetGralTimbre(-1, "Ing", MinFecha, MaxFecha, 0, UsuarioActual.CveEmpresa, -1, CveVenta:=CveVenta) AndAlso ObjGral.DtResultados.Rows.Count > 0 Then
|
If ObjGral.GetGralTimbre(-1, "Ing", MinFecha, MaxFecha, 0, UsuarioActual.CveEmpresa, -1, CveVenta:=CveVenta) AndAlso ObjGral.DtResultados.Rows.Count > 0 Then
|
||||||
Dim RowCP As DataRow = ObjGral.DtResultados.Rows(0)
|
Dim RowCP As DataRow = ObjGral.DtResultados.Rows(0)
|
||||||
@@ -34281,19 +34293,58 @@ Partial Class Ventas
|
|||||||
If CveTimbreCartaPorteVenta > 0 Then
|
If CveTimbreCartaPorteVenta > 0 Then
|
||||||
ChkEmitirCartaPorte.Checked = True
|
ChkEmitirCartaPorte.Checked = True
|
||||||
ChkEmitirCartaPorte.Enabled = False
|
ChkEmitirCartaPorte.Enabled = False
|
||||||
|
|
||||||
|
|
||||||
|
CveEntregaAlmacen = RowCP("CveEntregaAlmacen").ToString().ToEntero()
|
||||||
|
|
||||||
|
CveDireccionOrigen = RowCP("CveDireccionOrigen").ToString().ToEntero()
|
||||||
|
CveDireccionDestino = RowCP("CveDireccionDestino").ToString().ToEntero()
|
||||||
|
|
||||||
|
TxtFechaEntregaCP.Text = RowCP("FechaEntrega").ToString()
|
||||||
|
TxtFechaLlegadaCP.Text = RowCP("FechaLlegada").ToString()
|
||||||
|
TxtDistancia.Text = RowCP("Distancia").ToString()
|
||||||
|
|
||||||
|
DdlChofer.SelectedValueExist(RowCP("CveChofer").ToString())
|
||||||
|
DdlUnidadCamion.SelectedValueExist(RowCP("CveCamion").ToString())
|
||||||
End If
|
End If
|
||||||
|
|
||||||
TxtFechaEntregaCP.Text = RowCP("FechaEntrega").ToString()
|
|
||||||
TxtFechaLlegadaCP.Text = RowCP("FechaLlegada").ToString()
|
|
||||||
TxtDistancia.Text = RowCP("Distancia").ToString()
|
|
||||||
|
|
||||||
DdlChofer.SelectedValueExist(RowCP("CveChofer").ToString())
|
|
||||||
DdlUnidadCamion.SelectedValueExist(RowCP("CveCamion").ToString())
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If ChkEmitirCartaPorte.Checked AndAlso CveEntregaAlmacen > 0 AndAlso ObjGral.GetEntregaAlmacenRutaDetalle(CveEntregaAlmacen) Then
|
||||||
|
DtMercancias = ObjGral.DtResultados
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
End Using
|
End Using
|
||||||
|
|
||||||
|
If ChkEmitirCartaPorte.Checked AndAlso CveCliente > 0 Then
|
||||||
|
Dim ObjClientes As New ClsClientes
|
||||||
|
If ObjClientes.DireccionEnvioGet(-1, CveCliente, -1) Then
|
||||||
|
TmpDTDireccionCP = ObjClientes.DtResultados.FiltraParametros(String.Format("Estatus = 1"))
|
||||||
|
End If
|
||||||
|
ObjClientes.Dispose()
|
||||||
|
|
||||||
|
DdlDireccionOrigen.DataSource = TmpDTDireccionCP
|
||||||
|
DdlDireccionOrigen.DataBind()
|
||||||
|
|
||||||
|
DdlDireccionDestino.DataSource = TmpDTDireccionCP
|
||||||
|
DdlDireccionDestino.DataBind()
|
||||||
|
|
||||||
|
DdlDireccionOrigen.SelectedValueExist(CveDireccionOrigen.ToString())
|
||||||
|
DdlDireccionDestino.SelectedValueExist(CveDireccionDestino.ToString())
|
||||||
|
|
||||||
|
GvMercanciasCP.DataSource = DtMercancias
|
||||||
|
GvMercanciasCP.DataBind()
|
||||||
|
Else
|
||||||
|
TmpDTDireccionCP = Nothing
|
||||||
|
End If
|
||||||
|
|
||||||
DdlChofer.Enabled = False
|
DdlChofer.Enabled = False
|
||||||
DdlUnidadCamion.Enabled = False
|
DdlUnidadCamion.Enabled = False
|
||||||
|
DdlDireccionOrigen.Enabled = False
|
||||||
|
DdlDireccionDestino.Enabled = False
|
||||||
|
|
||||||
|
UpEmitirTransitorio.Update()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub ValidaConfiguracionVehiculo()
|
Private Sub ValidaConfiguracionVehiculo()
|
||||||
@@ -34371,16 +34422,16 @@ Partial Class Ventas
|
|||||||
Dim CveTimbre As Integer = -1
|
Dim CveTimbre As Integer = -1
|
||||||
Try
|
Try
|
||||||
|
|
||||||
Dim CveDireccionOrigen As Integer = -1
|
Dim CveDireccionOrigen As Integer = DdlDireccionOrigen.SelectedValue.ToEntero
|
||||||
Dim CveDireccionDestino As Integer = -1
|
Dim CveDireccionDestino As Integer = DdlDireccionDestino.SelectedValue.ToEntero
|
||||||
|
|
||||||
If SucursalOrigenCP IsNot Nothing Then
|
'If SucursalOrigenCP IsNot Nothing Then
|
||||||
CveDireccionOrigen = ObjClientes.DireccionEnvioAdd(-1, SucursalOrigenCP.Direccion, SucursalOrigenCP.NoExt, SucursalOrigenCP.NoInt, SucursalOrigenCP.Colonia, SucursalOrigenCP.Municipio, SucursalOrigenCP.Estado, SucursalOrigenCP.CP.ToEntero(), "", UsuarioActual.CveUsuario, 1, -1, "", CveEstado:=SucursalOrigenCP.CveEstado, CvePais:=SucursalOrigenCP.CvePais, CveEmpresa:=UsuarioActual.CveEmpresa)
|
' CveDireccionOrigen = ObjClientes.DireccionEnvioAdd(-1, SucursalOrigenCP.Direccion, SucursalOrigenCP.NoExt, SucursalOrigenCP.NoInt, SucursalOrigenCP.Colonia, SucursalOrigenCP.Municipio, SucursalOrigenCP.Estado, SucursalOrigenCP.CP.ToEntero(), "", UsuarioActual.CveUsuario, 1, -1, "", CveEstado:=SucursalOrigenCP.CveEstado, CvePais:=SucursalOrigenCP.CvePais, CveEmpresa:=UsuarioActual.CveEmpresa)
|
||||||
End If
|
'End If
|
||||||
|
|
||||||
If SucursalDestinoCP IsNot Nothing Then
|
'If SucursalDestinoCP IsNot Nothing Then
|
||||||
CveDireccionDestino = ObjClientes.DireccionEnvioAdd(-1, SucursalDestinoCP.Direccion, SucursalDestinoCP.NoExt, SucursalDestinoCP.NoInt, SucursalDestinoCP.Colonia, SucursalDestinoCP.Municipio, SucursalDestinoCP.Estado, SucursalDestinoCP.CP.ToEntero(), "", UsuarioActual.CveUsuario, 1, -1, "", CveEstado:=SucursalDestinoCP.CveEstado, CvePais:=SucursalDestinoCP.CvePais, CveEmpresa:=UsuarioActual.CveEmpresa)
|
' CveDireccionDestino = ObjClientes.DireccionEnvioAdd(-1, SucursalDestinoCP.Direccion, SucursalDestinoCP.NoExt, SucursalDestinoCP.NoInt, SucursalDestinoCP.Colonia, SucursalDestinoCP.Municipio, SucursalDestinoCP.Estado, SucursalDestinoCP.CP.ToEntero(), "", UsuarioActual.CveUsuario, 1, -1, "", CveEstado:=SucursalDestinoCP.CveEstado, CvePais:=SucursalDestinoCP.CvePais, CveEmpresa:=UsuarioActual.CveEmpresa)
|
||||||
End If
|
'End If
|
||||||
|
|
||||||
If Not (CveDireccionOrigen > 0 And CveDireccionDestino > 0) Then
|
If Not (CveDireccionOrigen > 0 And CveDireccionDestino > 0) Then
|
||||||
ErrorProceso = True
|
ErrorProceso = True
|
||||||
@@ -34398,7 +34449,7 @@ Partial Class Ventas
|
|||||||
If CveEntregaAlmacen > 0 Then
|
If CveEntregaAlmacen > 0 Then
|
||||||
|
|
||||||
For Each RowPS As DataRow In ObjFactura.DtMercancias.Rows
|
For Each RowPS As DataRow In ObjFactura.DtMercancias.Rows
|
||||||
If Not ObjGral.AddEntregaAlmacenRutaDetalle(CveEntregaAlmacen, RowPS("CvePS").ToString().ToEntero, RowPS("Cantidad").ToString().ToDecimal, RowPS("CveUM").ToString().ToEntero, UsuarioActual.CveUsuario) Then
|
If Not ObjGral.AddEntregaAlmacenRutaDetalle(CveEntregaAlmacen, RowPS("CvePS").ToString().ToEntero, RowPS("Cantidad").ToString().ToDecimal, RowPS("CveUnidadMedida").ToString().ToEntero, UsuarioActual.CveUsuario) Then
|
||||||
ErrorProceso = True
|
ErrorProceso = True
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
@@ -34650,20 +34701,24 @@ Partial Class Ventas
|
|||||||
UpAgregarMercancia.Update()
|
UpAgregarMercancia.Update()
|
||||||
RegistraScript("$('#DivAddMercancia').modal('show');", "M1")
|
RegistraScript("$('#DivAddMercancia').modal('show');", "M1")
|
||||||
End Sub
|
End Sub
|
||||||
|
Private Sub CreaDTMercancias()
|
||||||
|
DtMercancias = New DataTable()
|
||||||
|
DtMercancias.Columns.Add(New DataColumn("Consec", GetType(Integer)))
|
||||||
|
DtMercancias.Columns.Add(New DataColumn("Cantidad", GetType(Integer)))
|
||||||
|
DtMercancias.Columns.Add(New DataColumn("CvePS", GetType(Integer)))
|
||||||
|
DtMercancias.Columns.Add(New DataColumn("CveUnidadMedida", GetType(Integer)))
|
||||||
|
DtMercancias.Columns.Add(New DataColumn("CodigoPS", GetType(String)))
|
||||||
|
End Sub
|
||||||
Protected Sub LnkAddPSMercancia_Click(sender As Object, e As EventArgs)
|
Protected Sub LnkAddPSMercancia_Click(sender As Object, e As EventArgs)
|
||||||
If DtMercancias Is Nothing Then
|
If DtMercancias Is Nothing Then
|
||||||
DtMercancias = New DataTable()
|
CreaDTMercancias()
|
||||||
DtMercancias.Columns.Add(New DataColumn("Consec", GetType(Integer)))
|
|
||||||
DtMercancias.Columns.Add(New DataColumn("Cantidad", GetType(Integer)))
|
|
||||||
DtMercancias.Columns.Add(New DataColumn("CvePS", GetType(Integer)))
|
|
||||||
DtMercancias.Columns.Add(New DataColumn("CveUM", GetType(Integer)))
|
|
||||||
DtMercancias.Columns.Add(New DataColumn("CodigoPS", GetType(String)))
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim CvePS As Integer = DdlPSMercancia.SelectedValue.ToEntero()
|
Dim CvePS As Integer = DdlPSMercancia.SelectedValue.ToEntero()
|
||||||
|
|
||||||
Dim DrPS As DataRow = GlobalDTPSSimplificado(CveEmpresa:=UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
|
Dim DrPS As DataRow = GlobalDTPSSimplificado(CveEmpresa:=UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
|
||||||
If DrPS Is Nothing Then
|
If DrPS Is Nothing Then
|
||||||
Alert("No se encontró el producto/servicio", TipoMensaje.MsgAdvertencia)
|
Alert("No se encontró la mercancía", TipoMensaje.MsgAdvertencia)
|
||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -34671,7 +34726,7 @@ Partial Class Ventas
|
|||||||
NewRow("Consec") = DtMercancias.MAX("Consec").ToEntero() + 1
|
NewRow("Consec") = DtMercancias.MAX("Consec").ToEntero() + 1
|
||||||
NewRow("Cantidad") = TxtCantidadMercancia.Text.ToDecimal()
|
NewRow("Cantidad") = TxtCantidadMercancia.Text.ToDecimal()
|
||||||
NewRow("CvePS") = DrPS("CvePS")
|
NewRow("CvePS") = DrPS("CvePS")
|
||||||
NewRow("CveUM") = DrPS("CveUnidadMedida")
|
NewRow("CveUnidadMedida") = DrPS("CveUnidadMedida")
|
||||||
NewRow("CodigoPS") = DrPS("PSCodigo")
|
NewRow("CodigoPS") = DrPS("PSCodigo")
|
||||||
|
|
||||||
DtMercancias.Rows.Add(NewRow)
|
DtMercancias.Rows.Add(NewRow)
|
||||||
@@ -34679,46 +34734,50 @@ Partial Class Ventas
|
|||||||
GvMercanciasCP.DataSource = DtMercancias
|
GvMercanciasCP.DataSource = DtMercancias
|
||||||
GvMercanciasCP.DataBind()
|
GvMercanciasCP.DataBind()
|
||||||
|
|
||||||
If ChkAgregarFlete.Checked Then
|
If ChkLimpiarPS.Checked Then
|
||||||
Dim CvePSServicio As Integer = DdlPSFlete.SelectedValue.ToEntero()
|
If TmpDT IsNot Nothing Then
|
||||||
If CvePSServicio > 0 Then
|
TmpDT.Rows.Clear()
|
||||||
Dim Cantidad As Decimal = TxtCantidadMercancia.Text.ToDecimal
|
End If
|
||||||
Dim PU As Decimal = TxtPrecioMercancia.Text.Trim.ToDecimal
|
End If
|
||||||
Dim Descuento As Decimal = 0
|
|
||||||
Dim CveUM As Integer = -1
|
|
||||||
Dim UnidadMedida As String = ""
|
|
||||||
Dim CveClasificacion As Integer = -1
|
|
||||||
Dim Clasificacion As String = ""
|
|
||||||
|
|
||||||
Dim drPSFlete As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSServicio).FiltroPrimero("")
|
Dim CvePSServicio As Integer = DdlPSFlete.SelectedValue.ToEntero()
|
||||||
If DrPS IsNot Nothing Then
|
If CvePSServicio > 0 Then
|
||||||
CveUM = drPSFlete("CveUnidadMedida").ToString().ToEntero()
|
Dim Cantidad As Decimal = TxtCantidadMercancia.Text.ToDecimal
|
||||||
CveClasificacion = drPSFlete("CveClasificacion").ToString().ToEntero()
|
Dim PU As Decimal = TxtPrecioMercancia.Text.Trim.ToDecimal
|
||||||
End If
|
Dim Descuento As Decimal = 0
|
||||||
|
Dim CveUM As Integer = -1
|
||||||
|
Dim UnidadMedida As String = ""
|
||||||
|
Dim CveClasificacion As Integer = -1
|
||||||
|
Dim Clasificacion As String = ""
|
||||||
|
|
||||||
Dim CveSubProyecto As Integer = DdlSubProyectoDatos.SelectedValue.ToEntero()
|
Dim drPSFlete As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSServicio).FiltroPrimero("")
|
||||||
Dim CveProyecto = GlobalDTSubProyectos(-1, CveSubProyecto:=CveSubProyecto, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveProyecto", "").ToEntero()
|
If DrPS IsNot Nothing Then
|
||||||
|
CveUM = drPSFlete("CveUnidadMedida").ToString().ToEntero()
|
||||||
|
CveClasificacion = drPSFlete("CveClasificacion").ToString().ToEntero()
|
||||||
|
End If
|
||||||
|
|
||||||
Dim Proyecto As String = GlobalDTProyectosUsuarios(UsuarioActual.CveUsuario, CveProyecto, UsuarioActual.CveEmpresa, -1).FiltroPrimeroValor("Proyecto", "").ToString()
|
Dim CveSubProyecto As Integer = DdlSubProyectoDatos.SelectedValue.ToEntero()
|
||||||
|
Dim CveProyecto = GlobalDTSubProyectos(-1, CveSubProyecto:=CveSubProyecto, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveProyecto", "").ToEntero()
|
||||||
|
|
||||||
AgregarProductoServicio(Cantidad, CveUM, UnidadMedida, CveClasificacion, Clasificacion,
|
Dim Proyecto As String = GlobalDTProyectosUsuarios(UsuarioActual.CveUsuario, CveProyecto, UsuarioActual.CveEmpresa, -1).FiltroPrimeroValor("Proyecto", "").ToString()
|
||||||
|
|
||||||
|
AgregarProductoServicio(Cantidad, CveUM, UnidadMedida, CveClasificacion, Clasificacion,
|
||||||
CvePSServicio, "", TxtObservacionesMercancia.Text.Trim, PU, Descuento,
|
CvePSServicio, "", TxtObservacionesMercancia.Text.Trim, PU, Descuento,
|
||||||
CveProyecto, Proyecto, CveSubProyecto, DdlSubProyectoDatos.SelectedItem.Text,
|
CveProyecto, Proyecto, CveSubProyecto, DdlSubProyectoDatos.SelectedItem.Text,
|
||||||
Serie:="", TiempoEntrega:="", CuentaPredial:="", RegeneraIEPS:=ClienteDesglosaIEPS, CvePromocionDetalle:=-1,
|
Serie:="", TiempoEntrega:="", CuentaPredial:="", RegeneraIEPS:=ClienteDesglosaIEPS, CvePromocionDetalle:=-1,
|
||||||
ImporteProntoPago:=0)
|
ImporteProntoPago:=0)
|
||||||
|
|
||||||
CalculaUsados()
|
CalculaTotalesVenta()
|
||||||
|
Alert("Se agregó la mercancía correctamente")
|
||||||
CalculaTotalesVenta()
|
Else
|
||||||
Else
|
Alert("No se agregó el servicio", TipoMensaje.MsgAdvertencia)
|
||||||
Alert("No se agrego el servicio del flete", TipoMensaje.MsgAdvertencia)
|
|
||||||
End If
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
TxtCantidadMercancia.Text = ""
|
TxtCantidadMercancia.Text = ""
|
||||||
TxtObservacionesMercancia.Text = ""
|
TxtObservacionesMercancia.Text = ""
|
||||||
|
TxtPrecioMercancia.Text = ""
|
||||||
|
|
||||||
|
RegistraScript("$('#DivAddMercancia').modal('hide');", "A2")
|
||||||
UpAgregarMercancia.Update()
|
UpAgregarMercancia.Update()
|
||||||
UpEmitirTransitorio.Update()
|
UpEmitirTransitorio.Update()
|
||||||
End Sub
|
End Sub
|
||||||
@@ -34797,19 +34856,31 @@ Partial Class Ventas
|
|||||||
DdlDireccionDestino.DataSource = TmpDTDireccionCP
|
DdlDireccionDestino.DataSource = TmpDTDireccionCP
|
||||||
DdlDireccionDestino.DataBind()
|
DdlDireccionDestino.DataBind()
|
||||||
End Sub
|
End Sub
|
||||||
Protected Sub ChkAgregarFlete_CheckedChanged(sender As Object, e As EventArgs)
|
'Protected Sub ChkAgregarFlete_CheckedChanged(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
DivServicioFlete.Visible = ChkAgregarFlete.Checked
|
' DivServicioFlete.Visible = ChkAgregarFlete.Checked
|
||||||
|
|
||||||
UpAgregarMercancia.Update()
|
' UpAgregarMercancia.Update()
|
||||||
End Sub
|
'End Sub
|
||||||
Protected Sub DdlPSMercancia_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DdlPSMercancia.selectedindexchange
|
Protected Sub DdlPSFlete_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DdlPSFlete.selectedindexchange
|
||||||
Dim CvePSParametro As Integer = DdlPSMercancia.SelectedValue.ToEntero()
|
Dim CvePSParametro As Integer = DdlPSFlete.SelectedValue.ToEntero()
|
||||||
If CvePSParametro > 0 Then
|
If CvePSParametro > 0 Then
|
||||||
|
|
||||||
Dim drPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPSMercancia.SelectedValue.ToEntero()).FiltroPrimero("")
|
Dim drPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSParametro).FiltroPrimero("")
|
||||||
If drPS IsNot Nothing Then
|
If drPS IsNot Nothing Then
|
||||||
|
Dim CvePSMercancia As Integer = drPS("CvePSAdicionalVigencia").ToString().ToEntero()
|
||||||
Dim CveClasificacion As Integer = drPS("CveClasificacion").ToString().ToEntero()
|
Dim CveClasificacion As Integer = drPS("CveClasificacion").ToString().ToEntero()
|
||||||
|
|
||||||
|
If CvePSMercancia > 0 Then
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(141).ToString() = "1" Then
|
||||||
|
DdlPSMercancia.SelectedValue = CvePSMercancia.ToString()
|
||||||
|
'DdlPSMercancia.SelectedText = TxtPS.Text.Trim
|
||||||
|
Else
|
||||||
|
'DdlPSMercancia.ddl.Items.Insert(2, New ListItem(TxtPS.Text.Trim, ObjProductosServicios.CvePS.ToString()))
|
||||||
|
DdlPSMercancia.ddl.SelectedValueExist(CvePSMercancia.ToString())
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
'SUGIERE PRECIO
|
'SUGIERE PRECIO
|
||||||
Dim PrecioSugerido As Decimal = 0
|
Dim PrecioSugerido As Decimal = 0
|
||||||
Dim tPrecioSugerido As Decimal = 0
|
Dim tPrecioSugerido As Decimal = 0
|
||||||
@@ -34883,6 +34954,8 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
UpAgregarMercancia.Update()
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user