Citrus - Comp Com Ext 2.0

Detalles:

--Tabla VentasDetalle (CantidadConversion DECIMAL(18,8))

--ACTUALIZAR CAMPO
UPDATE VentasDetalles SET CantidadConversion = Cantidad

Procedimientos:

--PA_Vta_ManifiestoForVtaGet
--PA_CGame_ManifiestoForVtaGet
--PA_VentasDetalleGet
--PA_VentasDetalleAdd

BD: SIG_Resp_RMF2
This commit is contained in:
2024-01-20 15:24:51 -07:00
parent 62d16fb2cb
commit 1081243291
3 changed files with 79 additions and 53 deletions

View File

@@ -2720,15 +2720,15 @@ Partial Class Ventas
If Request("CveManifiesto") IsNot Nothing AndAlso IsNumeric(Request("CveManifiesto")) AndAlso Request("CveManifiesto").ToEntero() > 0 Then
Using ObjVentas As New ClsCGame()
Using ObjCGame As New ClsCGame()
If ObjVentas.ManifiestoGet(Request("CveManifiesto").ToEntero(), -1, -1, -1, -1, -1, -1, -1, -1, UsuarioActual.CveEmpresa, "-1", "-1") Then
DdlSubProyectoDatos.SelectedValueExist(ObjVentas.DtResultados.Rows(0)("CveSubProyecto").ToString())
If ObjCGame.ManifiestoGet(Request("CveManifiesto").ToEntero(), -1, -1, -1, -1, -1, -1, -1, -1, UsuarioActual.CveEmpresa, "-1", "-1") Then
DdlSubProyectoDatos.SelectedValueExist(ObjCGame.DtResultados.Rows(0)("CveSubProyecto").ToString())
End If
If ObjVentas.ManifiestoForVtaGet(UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, Request("CveManifiesto").ToEntero()) Then
GvPS.DataSource = ObjVentas.DtResultados
TmpDT = ObjVentas.DtResultados
If ObjCGame.ManifiestoForVtaGet(UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, Request("CveManifiesto").ToEntero()) Then
GvPS.DataSource = ObjCGame.DtResultados
TmpDT = ObjCGame.DtResultados
GvPS.DataBind()
End If
@@ -13425,7 +13425,7 @@ Partial Class Ventas
CveContratoDetalle:=Row("CveContratoDetalle").ToString().ToEntero(), CvePromocionDetalle:=Row("CvePromocionDetalle").ToString().ToEntero(), IEPS:=Row("ImporteIEPS").ToString().ToDecimal, CveMovimientoDetallePedido:=Row("CveMovimientoDetallePedido").ToString().ToEntero(), ImporteRetIVA:=Row("ImporteRetIVA").ToString().ToDecimal, ImporteRetISR:=Row("ImporteRetISR").ToString().ToDecimal,
PorcentajeIVA:=Row("PorcentajeIVA").ToString().ToDecimal, PorcentajeIEPS:=Row("PorcentajeIEPS").ToString().ToDecimal, PorcentajeRetIVA:=Row("PorcentajeRetIVA").ToString().ToDecimal,
PorcentajeRetISR:=Row("PorcentajeRetISR").ToString().ToDecimal, CuentaPredial:=Row("CuentaPredial").ToString(), CvePrecioLista:=Row("CvePrecioLista").ToString().ToEntero(),
CveActivoFijo:=Row("CveActivoFijo").ToString().ToEntero(), NumTurnos:=Row("NumTurnos").ToString().ToDecimal(), EstatusAlmacen:=EsatusAlmacen) Then
CveActivoFijo:=Row("CveActivoFijo").ToString().ToEntero(), NumTurnos:=Row("NumTurnos").ToString().ToDecimal(), EstatusAlmacen:=EsatusAlmacen, CantidadConversion:=Row("CantidadConversion").ToString().ToDecimal()) Then
ErrorList.Add("Ocurrió un error al agregar un Producto o Servicio a la Factura.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
Exit For
Else
@@ -18204,7 +18204,7 @@ Partial Class Ventas
Optional CveOrdenCompraDetalle As Integer = 0, Optional CveVentaDetalleRemision As Integer = 0, Optional CveVentaDetalleCotizacion As Integer = 0, Optional CuentaPredial As String = "",
Optional RegeneraIEPS As Boolean = True, Optional CveVentaDetallePedido2 As Integer = 0, Optional SeActualiza As Boolean = False, Optional CvePromocionDetalle As Integer = -1, Optional EsCargo As Boolean = False,
Optional ImporteProntoPago As Decimal = 0, Optional ByRef ObjDescuento As Modelos.VentaDescuentos = Nothing, Optional CvePrecioLista As Integer = -1, Optional PrecioLista As String = "",
Optional CveActivoFijo As Integer = -1, Optional AFDepreciacion As Decimal = 0D, Optional AFValorInicial As Decimal = 0D, Optional NumTurnos As Decimal = 0D) As Boolean
Optional CveActivoFijo As Integer = -1, Optional AFDepreciacion As Decimal = 0D, Optional AFValorInicial As Decimal = 0D, Optional NumTurnos As Decimal = 0D, Optional CantidadConversion As Decimal = 0) As Boolean
Dim Retorno As Boolean = False
Try
@@ -18463,6 +18463,16 @@ Partial Class Ventas
Row("CodigoAlterno") = DrPS("CodigoAlterno")
Row("PSAlterno") = DrPS("PSAlterno")
'SI NO SE UTILIZA LA CONVERSION, UTILIZA LA CANTIDAD
If CantidadConversion = 0 Then
If DrPS("PesoKg").ToString().ToDecimal() > 0 Then
CantidadConversion = DrPS("PesoKg").ToString().ToDecimal()
Else
CantidadConversion = Cantidad
End If
End If
Row("CantidadConversion") = CantidadConversion
If UsuarioActual.CveEmpresa.Contiene(119, 13, 83) Then
If Not RemisionesLista.Count > 0 Then 'SI VIENE DE REMISION NO SE CONSIDERA
@@ -18709,7 +18719,9 @@ Partial Class Ventas
TmpDT.Columns.Add("CodigoAlterno", GetType(String))
TmpDT.Columns.Add("PSAlterno", GetType(String))
'USO PARA COMERCIO EXTERIOR
TmpDT.Columns.Add("CantidadConversion", GetType(Decimal))
TmpDT.Columns("CantidadConversion").DefaultValue = 0
End Sub
Private Sub CreaDTmpC()
DTmpC = New DataTable
@@ -29676,6 +29688,24 @@ Partial Class Ventas
Protected Sub GvComercioExterior_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
Dim CantidadConversion = CDbl(e.Row.DBCampo("CantidadConversion"))
Dim CantidadBase = CDbl(e.Row.DBCampo("Cantidad"))
Dim PUBase = CDbl(e.Row.DBCampo("PU"))
Dim TotalUSD = (CantidadBase * PUBase)
e.Row.FCLabel("LblTotalUSD").Text = TotalUSD.ToString("N2")
If CantidadConversion <> CantidadBase Then
If CantidadConversion > 0 Then
e.Row.FCTextBox("TxtValorUnitario").Text = (TotalUSD / CantidadConversion).ToString("N6")
Else
e.Row.FCTextBox("TxtValorUnitario").Text = PUBase.ToString("N2")
End If
Else
e.Row.FCTextBox("TxtValorUnitario").Text = PUBase.ToString("N2")
End If
e.Row.FCTextBox("TxtValorUnitario").Attributes.Add("onkeyup", $"CalculaTotalUSD({e.Row.FCLabel("LblTotalUSD").ClientID}, this,{e.Row.FCTextBox("TxtCantidad").ClientID});")
End If
End Sub