Skip to content

Commit

Permalink
WIP: TPV payment
Browse files Browse the repository at this point in the history
  • Loading branch information
MarJene committed Sep 28, 2022
1 parent 1eb1c23 commit dd2b3f5
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 4 deletions.
13 changes: 9 additions & 4 deletions som_generationkwh/investment.py
Original file line number Diff line number Diff line change
Expand Up @@ -1327,10 +1327,14 @@ def create_initial_invoices(self,cursor,uid, investment_ids, context=None):
date_invoice = str(date.today())
tpv_payment = context.get('tpv_payment', False)

# The payment type TODO: change when tpv_payment?
payment_type_id = PaymentType.search(cursor, uid, [
('code', '=', 'RECIBO_CSB'),
])[0]
if tpv_payment:
payment_type_id = PaymentType.search(cursor, uid, [
('code', '=', 'TPV'),
])[0]
else:
payment_type_id = PaymentType.search(cursor, uid, [
('code', '=', 'RECIBO_CSB'),
])[0]

errors = []
def error(message):
Expand Down Expand Up @@ -1478,6 +1482,7 @@ def invoices_to_payment_order(self,cursor,uid,invoice_ids, payment_mode_name):
True)
Invoice.afegeix_a_remesa(cursor,uid,invoice_ids, order_id)


def investment_payment(self,cursor,uid,investment_ids):
"""
Creates the invoices, open them and add the current payment order.
Expand Down
27 changes: 27 additions & 0 deletions som_generationkwh/som_generationkwh_data.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2273,5 +2273,32 @@ ${text_legal}
Decimal definit amb punt. Exemple: "1.5"
</field>
</record>
<record id="payment_type_TPV" model="payment.type">
<field eval="&quot;&quot;&quot;TPV&quot;&quot;&quot;" name="code"/>
<field eval="&quot;&quot;&quot;Pago por TPV&quot;&quot;&quot;" name="name"/>
<field eval="[]" name="suitable_bank_types"/>
<field eval="&quot;&quot;&quot;Pagament per TPV&quot;&quot;&quot;" name="note"/>
<field eval="1" name="active"/>
</record>
<record id="socis_tpv_journal" model="account.journal">
<field name="code">TPVSOCI</field>
<field eval="[(6,0,[])]" name="account_control_ids"/>
<field name="user_id" ref="base.user_root"/>
<field eval="0" name="centralisation"/>
<field eval="0" name="group_invoice_lines"/>
<field name="type">cash</field>
<field eval="0" name="sii_to_send"/>
<!-- TODO: el compte haver ha de ser el 100(..)00 i el deure el 5720(..)00
<field name="default_credit_account_id" model="account.account" search="[('code','=','5720')]" />
<field name="default_debit_account_id" model="account.account" search="[('code','=','10000')]" /> -->
<field name="view_id" ref="account.account_journal_bank_view"/>
<field eval="[(6,0,[])]" name="type_control_ids"/>
<field name="sequence_id" ref="account.sequence_journal"/>
<field eval="1" name="active"/>
<field eval="1" name="update_posted"/>
<field name="name">Factures TPV Quota Soci</field>
<field eval="0" name="refund_journal"/>
<field eval="1" name="entry_posted"/>
</record>
</data>
</openerp>

0 comments on commit dd2b3f5

Please sign in to comment.