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 c1a7f4bb
authored
2022-02-11 12:54:04 -0300
by
Juan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
puasa
1 parent
bffba177
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
94 additions
and
11 deletions
__manifest__.py
models/__init__.py
models/cheque.py
models/pago_discriminado.py
models/valor.py
views/menu_compras.xml
views/pago_discriminado.xml
__manifest__.py
View file @
c1a7f4b
...
...
@@ -32,6 +32,7 @@
'asw_afipws_fe'
,
'asw_tpv_impuestos'
,
'asw_cajas'
,
'asw_tpv_cheques'
,
],
# always loaded
...
...
models/__init__.py
View file @
c1a7f4b
...
...
@@ -6,3 +6,5 @@ from . import referencia_compra
from
.
import
gastosmobil
from
.
import
currency
from
.
import
pago_discriminado
from
.
import
cheque
from
.
import
valor
\ No newline at end of file
models/cheque.py
0 → 100644
View file @
c1a7f4b
from
odoo
import
models
,
fields
,
api
,
_
from
odoo.exceptions
import
UserError
,
ValidationError
class
asw_cheque
(
models
.
Model
):
_inherit
=
'asw.cheque'
che_estado
=
fields
.
Selection
(
string
=
'Estado'
,
selection
=
[
(
'b'
,
'Borrador'
),
(
'en_mano'
,
'En mano'
),
(
'reservado'
,
'Reservado'
),
(
'entregado'
,
'Entregado'
),
(
'depositado'
,
'Depositado'
),
(
'devuelto'
,
'Devuelto'
),
(
'cambiado'
,
'Cambiado'
),
(
'r'
,
'Rechazado'
)
],
compute
=
'_compute_estado_cheque'
,
store
=
True
)
\ No newline at end of file
models/pago_discriminado.py
View file @
c1a7f4b
...
...
@@ -115,7 +115,7 @@ class hgt_cobro_multiple(models.Model):
)
# Total de pago
pcw_total
=
fields
.
Monetary
(
string
=
'Total
Recibido
'
,
string
=
'Total
a entregar
'
,
compute
=
'_calcular_total'
,
currency_field
=
'cli_moneda_empresa'
)
...
...
@@ -127,6 +127,17 @@ class hgt_cobro_multiple(models.Model):
comprobantes
=
fields
.
Many2many
(
comodel_name
=
'asw.comprobante'
,
string
=
'Comprobantes'
)
pcw_total_balance
=
fields
.
Monetary
(
string
=
'Diferencia'
,
compute
=
'_calcular_diferencia'
,
currency_field
=
'cli_moneda_empresa'
)
pcw_total_pagar
=
fields
.
Monetary
(
string
=
'Total deuda'
,
compute
=
'_calcular_pago'
,
currency_field
=
'cli_moneda_empresa'
)
###########################################Validaciones y calculos ######################################
@api.depends
(
'pcw_total'
)
...
...
@@ -198,6 +209,16 @@ class hgt_cobro_multiple(models.Model):
total
=
total
+
record
.
val_monto
self
.
pcw_total
=
total
+
self
.
pcw_efectivo
#+ self.pcw_retencion_recibida
@api.depends
(
'pcw_total'
)
def
_calcular_diferencia
(
self
):
total
=
self
.
pcw_total_pagar
-
self
.
pcw_total
#+ self.pcw_retencion_recibida
self
.
pcw_total_balance
=
total
@api.depends
(
'comprobantes'
)
def
_calcular_pago
(
self
):
total
=
0
for
fac
in
self
.
comprobantes
:
total
=
total
+
fac
.
comp_total
self
.
pcw_total_pagar
=
total
################################# LOGICA DE PAGO #################
...
...
@@ -331,6 +352,11 @@ class hgt_cobro_multiple(models.Model):
########################################LOGICA GESTION DE VALORES Y CAJAS ######################################################
#Buscar cheques y desvincular de la caja
def
ValoresEnCajas
(
self
,
resivo
):
#Clasifico el tipo de valor
efectivo
=
[]
...
...
@@ -407,3 +433,10 @@ class hgt_cobro_multiple(models.Model):
'type'
:
'ir.actions.act_window'
,
'target'
:
'new'
,
}
def
LimpiarChequesTerceros
(
self
):
cheques
=
self
.
pcw_chq_terceros
.
ids
cheques
.
pop
self
.
pcw_chq_terceros
=
False
self
.
env
.
cr
.
commit
()
\ No newline at end of file
models/valor.py
0 → 100644
View file @
c1a7f4b
# -*- coding: utf-8 -*-
###############################################################################
# License, author and contributors information in: #
# __manifest__.py file at the root folder of this module. #
###############################################################################
from
odoo
import
models
,
fields
,
api
,
_
from
odoo.exceptions
import
UserError
,
ValidationError
class
asw_valores
(
models
.
Model
):
_inherit
=
'asw.valores'
val_estado_cheque
=
fields
.
Selection
(
string
=
'Estado cheque'
,
selection
=
[
(
'b'
,
'Borrador'
),
(
'en_mano'
,
'En mano'
),
(
'reservado'
,
'Reservado'
),
(
'entregado'
,
'Entregado'
),
(
'depositado'
,
'Depositado'
),
(
'devuelto'
,
'Devuelto'
),
(
'cambiado'
,
'Cambiado'
),
(
'r'
,
'Rechazado'
)
],
related
=
'val_cheque.che_estado'
,
store
=
True
)
\ No newline at end of file
views/menu_compras.xml
View file @
c1a7f4b
...
...
@@ -2,7 +2,7 @@
<data>
<menuitem
name=
"Referencias"
sequence=
"90"
id=
"asw_tpv_compras_referencias"
parent=
"asw_tpv.asw_tpv_compras"
/>
<menuitem
name=
"Referencias de Compras"
id=
"asw_tpv_compras_referencias_refcompras"
parent=
"asw_tpv_compras_referencias"
action=
"hgt_refcompra_list_action"
/>
<menuitem
name=
"Pagos avanzados"
sequence=
"70"
id=
"hgt_pago_proveedor_avanzado_menu"
parent=
"asw_tpv.asw_tpv_compras"
action=
"hgt_pago_proveedor_avanzado_accion"
/>
/>
<menuitem
name=
"Pagos avanzados"
sequence=
"70"
id=
"hgt_pago_proveedor_avanzado_menu"
parent=
"asw_tpv.asw_tpv_compras
_compras
"
action=
"hgt_pago_proveedor_avanzado_accion"
/>
/>
<!-- <menuitem name="Configuracion Mobil" sequence="99" id="asw_tpv_gasto_mobil_config" parent="asw_tpv.asw_tpv_compras_gastos" action="hgt_gastos_mobil_list_action" groups="hgt_dispositivos.group_administrador_dispositivos"/> -->
</data>
</odoo>
views/pago_discriminado.xml
View file @
c1a7f4b
...
...
@@ -25,7 +25,6 @@
<notebook
colspan=
"4"
>
<page
string=
"Cheques Propios"
>
<group
col=
"4"
>
<field
name=
"caja_cheque"
colspan=
'4'
/>
<field
name=
"pcw_chq_emitidos"
colspan=
'4'
nolabel=
'1'
widget=
'one2many'
context=
"{'default_val_razon_social' : pcw_cli_razon_social}"
>
<tree
create=
"1"
delete=
"1"
edit=
"1"
editable=
"bottom"
>
...
...
@@ -34,8 +33,6 @@
<field
name=
"che_fecha_emision"
required=
'1'
/>
<field
name=
"che_fecha_cobro"
required=
'1'
/>
<field
name=
"che_fecha_vencimiento"
required=
'1'
/>
<field
name=
"che_razon_social_emisor"
/>
<field
name=
"che_cuit_emisor"
/>
<field
name=
"che_monto"
/>
</tree>
</field>
...
...
@@ -43,10 +40,10 @@
</page>
<page
string=
"Cheques Terceros"
>
<group
col=
"4"
>
<field
name=
"caja_cheque_terceros"
colspan=
'4'
/>
<field
name=
"buscador_cheque"
colspan=
'4'
/>
<field
name=
"buscador_cheque"
colspan=
'4'
domain=
"[('che_estado', '=','en_mano')]"
/>
<field
name=
"pcw_chq_terceros"
colspan=
'4'
nolabel=
'1'
options=
"{'create_edit': True, 'readonly': False}"
/>
<button
name=
"LimpiarChequesTerceros"
class=
"btn btn-danger"
string=
"Liberar Cheques"
type=
"object"
/>
</group>
</page>
<page
string=
"Transferencias Emitidas"
>
...
...
@@ -69,8 +66,6 @@
<tree
create=
"1"
delete=
"1"
edit=
"1"
editable=
"bottom"
>
<field
name=
"val_tipo"
domain=
"[('tv_tipo','=', 'ta' )]"
string=
'Tarjeta'
options=
"{'no_create': True, 'no_create_edit':True}"
/>
<field
name=
"val_nro_pago"
/>
<field
name=
"valor_caja_id"
/>
<field
name=
"val_monto"
required=
'1'
/>
</tree>
</field>
...
...
@@ -91,7 +86,7 @@
</page>
<page
string=
"Facturas"
>
<group
col=
"4"
>
<field
name=
"comprobantes"
colspan=
'4'
readonly=
"1"
>
<field
name=
"comprobantes"
colspan=
'4'
readonly=
"1"
nolabel=
"1"
>
</field>
</group>
...
...
@@ -101,7 +96,9 @@
</group>
<group
id=
'total'
col=
'6'
>
<field
name=
"pcw_total"
colspan=
'2'
/>
<field
name=
"pcw_total"
colspan=
'6'
/>
<field
name=
"pcw_total_pagar"
colspan=
'6'
/>
<field
name=
"pcw_total_balance"
colspan=
'6'
/>
</group>
<footer>
...
...
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