-- limpieza de código de mandar idcta de contpaq
This commit is contained in:
@@ -745,28 +745,9 @@ Partial Class Ventas_PortalCliente
|
||||
If DtPagos.Rows.Count > 0 Then
|
||||
|
||||
Dim MensajeAlert As New StringBuilder
|
||||
Dim ObjConta As New ClsContabilidad
|
||||
Dim ObjCliente As New ClsClientes(ObjConta.IniciaTransacSQL)
|
||||
Dim ObjConta As New ClsContabilidad
|
||||
|
||||
|
||||
Dim IdCuentaCliente = -1
|
||||
Dim IdCtaContMonedaExtranjera = -1
|
||||
Dim IdCtaContRetIVA = -1
|
||||
Dim IdCtaContRetISR = -1
|
||||
|
||||
|
||||
If ObjCliente.GetClientes(CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, -1) AndAlso ObjCliente.DtResultados.Rows.Count > 0 Then
|
||||
IdCuentaCliente = ObjCliente.IdCtaContClientes
|
||||
IdCtaContMonedaExtranjera = ObjCliente.IdCtaContMonedaExtranjera
|
||||
IdCtaContRetIVA = ObjCliente.IdCtaContRetIVA
|
||||
IdCtaContRetISR = ObjCliente.IdCtaContRetISR
|
||||
Else
|
||||
TieneError = True
|
||||
MensajeError.Append("Ocurrió un error al cargar la información contable del cliente. Por favor vuelva a intentar<br>")
|
||||
End If
|
||||
|
||||
|
||||
' PREPOLIZA
|
||||
' PREPOLIZA
|
||||
Dim CvePlantillaPoliza = 11
|
||||
Dim FechaMovimiento As Date = Now
|
||||
Dim Concepto = "Prosepago"
|
||||
@@ -851,10 +832,7 @@ Partial Class Ventas_PortalCliente
|
||||
importeMX = ImportePagoMX.RoundSQL()
|
||||
TCGeneral = TCVenta
|
||||
|
||||
If CveMonedaVenta = 1 Then
|
||||
IdCtaContable = IdCuentaCliente
|
||||
Else
|
||||
IdCtaContable = IdCtaContMonedaExtranjera
|
||||
If CveMonedaVenta > 1 Then
|
||||
ConceptoMovimiento += $" TC:{TCPago} ${ImporteMovimiento.FormatoNumero(2)}"
|
||||
|
||||
If ImporteMovimiento <> 0 AndAlso IdCtaContable > 0 Then
|
||||
@@ -864,8 +842,6 @@ Partial Class Ventas_PortalCliente
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
|
||||
IdCtaContable = IdCtaContMonedaExtranjera
|
||||
End If
|
||||
|
||||
Case 134 'PAGO INTERMEDIARIO
|
||||
@@ -920,16 +896,7 @@ Partial Class Ventas_PortalCliente
|
||||
importeMX = importeMX.RoundSQL()
|
||||
TCGeneral = TCVenta
|
||||
|
||||
If TCVenta > 1 Then ConceptoMovimiento += $" TC:{TCVenta} ${ImporteMovimiento.FormatoNumero(2)}"
|
||||
|
||||
'Conta ContPAQ
|
||||
If IdCtaContRetIVA <> 0 Then
|
||||
IdCtaContable = IdCtaContRetIVA
|
||||
Else
|
||||
If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then
|
||||
IdCtaContable = ObjConta.DtResultados.FiltroPrimeroValor("IdCuentaRetIVACirculacion").ToEntero
|
||||
End If
|
||||
End If
|
||||
If TCVenta > 1 Then ConceptoMovimiento += $" TC:{TCVenta} ${ImporteMovimiento.FormatoNumero(2)}"
|
||||
|
||||
Case 62 'RETIVA TRASLADADO
|
||||
If CveMonedaVenta = 1 Then
|
||||
@@ -945,17 +912,7 @@ Partial Class Ventas_PortalCliente
|
||||
importeMX = importeMX.RoundSQL()
|
||||
TCGeneral = TCFluctuacion
|
||||
|
||||
If TCFluctuacion > 1 Then ConceptoMovimiento += $" TC:{TCFluctuacion} ${ImporteMovimiento.FormatoNumero(2)}"
|
||||
|
||||
'Conta ContPAQ
|
||||
If IdCtaContRetIVA <> 0 Then
|
||||
IdCtaContable = IdCtaContRetIVA
|
||||
Else
|
||||
If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then
|
||||
IdCtaContable = ObjConta.DtResultados.FiltroPrimeroValor("IdCuentaRetIVACirculacion").ToEntero
|
||||
End If
|
||||
End If
|
||||
|
||||
If TCFluctuacion > 1 Then ConceptoMovimiento += $" TC:{TCFluctuacion} ${ImporteMovimiento.FormatoNumero(2)}"
|
||||
|
||||
Case 9 'RETISR X TRASLADAR
|
||||
If CveMonedaVenta = 1 Then
|
||||
@@ -972,16 +929,6 @@ Partial Class Ventas_PortalCliente
|
||||
TCGeneral = TCVenta
|
||||
|
||||
If TCVenta > 1 Then ConceptoMovimiento += $" TC:{TCVenta} ${ImporteMovimiento.FormatoNumero(2)}"
|
||||
|
||||
'Conta ContPAQ
|
||||
If IdCtaContRetISR <> 0 Then
|
||||
IdCtaContable = IdCtaContRetISR
|
||||
Else
|
||||
If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then
|
||||
IdCtaContable = ObjConta.DtResultados.FiltroPrimeroValor("IdCuentaRetISRCirculacion").ToEntero
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
Case 63 'RETISR TRASLADADO
|
||||
If CveMonedaVenta = 1 Then
|
||||
@@ -998,15 +945,6 @@ Partial Class Ventas_PortalCliente
|
||||
TCGeneral = TCFluctuacion
|
||||
|
||||
If TCFluctuacion > 1 Then ConceptoMovimiento += $" TC:{TCFluctuacion} ${ImporteMovimiento.FormatoNumero(2)}"
|
||||
|
||||
'Conta ContPAQ
|
||||
If IdCtaContRetISR <> 0 Then
|
||||
IdCtaContable = IdCtaContRetISR
|
||||
Else
|
||||
If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then
|
||||
IdCtaContable = ObjConta.DtResultados.FiltroPrimeroValor("IdCuentaRetISRCirculacion").ToEntero
|
||||
End If
|
||||
End If
|
||||
|
||||
Case 38 'IEPS X TRASLADAR
|
||||
If CveMonedaVenta = 1 Then
|
||||
@@ -1935,7 +1873,7 @@ Partial Class Ventas_PortalCliente
|
||||
End Select
|
||||
|
||||
If importeMovimiento <> 0 Then
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Concepto, ConceptoContable, Concepto, FechaMovimiento, If(ConceptoContable = 30, ObjFactura.Cliente.IdCtaContClientes, ObjFactura.Cliente.IdCtaContAnticipos), -1, CveIE:=CveIE, CveCompra:=-1, CveProveedor:=-1, CvePersonal:=-1, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=importeMovimiento, ImporteME:=tImporteMonedaExtranjera, TipoCambio:=TxtTipoCambio.Text.ToDecimal) Then
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Concepto, ConceptoContable, Concepto, FechaMovimiento, 0, -1, CveIE:=CveIE, CveCompra:=-1, CveProveedor:=-1, CvePersonal:=-1, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=importeMovimiento, ImporteME:=tImporteMonedaExtranjera, TipoCambio:=TxtTipoCambio.Text.ToDecimal) Then
|
||||
MsgError = "Ocurrió un error al registrar el asiento del ingreso."
|
||||
End If
|
||||
End If
|
||||
@@ -3185,9 +3123,6 @@ Partial Class Ventas_PortalCliente
|
||||
ObjFactura.CveMetodoPago = 1
|
||||
ObjFactura.MetodoPago = "Efectivo"
|
||||
End If
|
||||
|
||||
ViewState("IdCtaContRetIVA") = ObjCliente.IdCtaContRetIVA
|
||||
ViewState("IdCtaContRetISR") = ObjCliente.IdCtaContRetISR
|
||||
End If
|
||||
End If
|
||||
ObjCliente.Dispose()
|
||||
@@ -3461,21 +3396,8 @@ Partial Class Ventas_PortalCliente
|
||||
Alert("Ocurrió un error al procesar los datos de la Venta.", TipoMensaje.MsgError)
|
||||
ObjFactura = Nothing
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
'VALIDA CUENTAS CONTABLES DE AC
|
||||
If UsuarioActual.Empresa.UsaAC Then
|
||||
If ObjFactura.Cliente.IdCtaContClientes <= 0 Then
|
||||
Alert("El Cliente no tiene registrado la cuenta contable", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If ObjFactura.SubTotal <= 0 Then
|
||||
Alert("Es necesario especificar el importe en los conceptos. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
If ObjFactura.CveCliente > 0 Then
|
||||
If TmpDT.Rows.Count > 0 Then
|
||||
|
||||
|
||||
Reference in New Issue
Block a user