Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Maria Agustina
/
tpv_correcciones
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
1
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit ab054a67
authored
2024-07-12 16:49:11 -0300
by
Juan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Busca comprobantes ya
1 parent
9775b698
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
4 deletions
models/conciliaciones.py
views/conciliaciones.xml
models/conciliaciones.py
View file @
ab054a6
...
...
@@ -35,7 +35,7 @@ class tpv_conciliacion(models.Model):
facturas
=
fields
.
Many2many
(
comodel_name
=
'asw.comprobante'
,
string
=
'Duedas de cliete y resivos propios'
,
relation
=
'tpv_correcciones_conciliaciones_facturas'
,
relation
=
'tpv_correcciones_conciliaciones_facturas
2
'
,
column1
=
'conciliacion_id'
,
column2
=
'factura_id'
)
...
...
@@ -43,26 +43,71 @@ class tpv_conciliacion(models.Model):
resivos
=
fields
.
Many2many
(
comodel_name
=
'asw.comprobante'
,
string
=
'Resivos de cliente y facturas de proveedor'
,
relation
=
'tpv_correcciones_conciliaciones_resivos'
,
relation
=
'tpv_correcciones_conciliaciones_resivos
2
'
,
column1
=
'conciliacion_id'
,
column2
=
'resivos_id'
)
def
Reinicio
(
self
):
for
Id
in
self
.
facturas
.
ids
:
self
.
facturas
=
[
3
,
Id
]
self
.
resivos
=
[]
def
TraerConfiguracion
(
self
):
if
self
.
cuit
.
id
==
False
:
raise
Warning
(
"Debe seleccionar un cuit antes de proseguir"
)
config
=
self
.
env
[
"tpv_c.conciliacion_config"
]
.
search
([])
if
len
(
config
)
!=
1
:
raise
Warning
(
"Debe haber exactamente una configuracion de conciliacion borre la que no corresponda si hay mas de una o creela si no hay, si no puede hacerlo contacte a soporte"
)
return
config
def
BuscarComprobantes
(
self
):
self
.
BusquedaDeuda
()
self
.
BusquedaResivos
()
def
BusquedaDeuda
(
self
):
config
=
self
.
TraerConfiguracion
()
estado
=
[
"comp_estado"
,
"in"
,[
"a"
,
"r"
,
"p"
]]
domain_deuda
=
[
"&"
,
"&"
,
[
"comp_talonario"
,
"in"
,
config
.
facturas
.
ids
],
[
"comp_cliente"
,
"="
,
self
.
cuit
.
id
],
estado
]
deudas
=
self
.
env
[
"asw.comprobante"
]
.
search
(
domain_deuda
)
DeudaIds
=
[]
for
deuda
in
deudas
:
if
deuda
.
comp_adeudado
!=
0
:
DeudaIds
.
append
(
deuda
.
id
)
if
len
(
DeudaIds
)
!=
0
:
self
.
write
({
'facturas'
:
[(
6
,
0
,
DeudaIds
)]})
else
:
self
.
write
({
'facturas'
:
[(
6
,
0
,
[])]})
def
BusquedaResivos
(
self
):
config
=
self
.
TraerConfiguracion
()
pass
estado
=
[
"comp_estado"
,
"in"
,[
"a"
,
"r"
,
"p"
]]
domain_deuda
=
[
"&"
,
"&"
,
[
"comp_talonario"
,
"in"
,
config
.
resivos
.
ids
],
[
"comp_cliente"
,
"="
,
self
.
cuit
.
id
],
estado
]
deudas
=
self
.
env
[
"asw.comprobante"
]
.
search
(
domain_deuda
)
DeudaIds
=
[]
for
deuda
in
deudas
:
if
deuda
.
comp_adeudado
!=
0
:
DeudaIds
.
append
(
deuda
.
id
)
if
len
(
DeudaIds
)
!=
0
:
self
.
write
({
'resivos'
:
[(
6
,
0
,
DeudaIds
)]})
else
:
self
.
write
({
'resivos'
:
[(
6
,
0
,
[])]})
def
Conciliar
(
self
):
config
=
self
.
TraerConfiguracion
()
pass
if
(
self
.
resivos
.
ids
==
[])
or
(
self
.
facturas
.
ids
==
[]):
raise
Warning
(
"O no hay comprobante o no hay resivos para conciliar"
)
...
...
views/conciliaciones.xml
View file @
ab054a6
...
...
@@ -7,6 +7,7 @@
<form>
<header>
<button
name=
"BuscarComprobantes"
class=
"btn btn-success"
string=
"Buscar Comprobante"
type=
"object"
attrs=
"{ 'invisible':[('estado', '!=', 'b')]}"
/>
<button
name=
"Reinicio"
class=
"btn btn-success"
string=
"Reinicio"
type=
"object"
attrs=
"{ 'invisible':[('estado', '!=', 'b')]}"
/>
<field
name=
"estado"
widget=
"statusbar"
readnoly=
"1"
/>
</header>
<br></br>
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment