Commit 20c595bf by François C.

Merge branch '4612-cb-dej-issuer' into 'dev_cooperatic'

add db dej issuer in sales export

See merge request !224
parents 66fc8c7c e2f17a91
Pipeline #2741 passed with stage
in 1 minute 29 seconds
...@@ -29,7 +29,7 @@ class CagetteSales(models.Model): ...@@ -29,7 +29,7 @@ class CagetteSales(models.Model):
statements_orders[s] = o["name"] statements_orders[s] = o["name"]
# Get payment lines # Get payment lines
cond = [['id', 'in', statements]] cond = [['id', 'in', statements]]
fields = ["amount", "journal_id", "create_date"] fields = ["amount", "journal_id", "create_date", "meal_voucher_issuer"]
payments = self.o_api.search_read('account.bank.statement.line', cond, fields, order="create_date ASC", limit=50000) payments = self.o_api.search_read('account.bank.statement.line', cond, fields, order="create_date ASC", limit=50000)
try: try:
for payment in payments: for payment in payments:
...@@ -41,7 +41,8 @@ class CagetteSales(models.Model): ...@@ -41,7 +41,8 @@ class CagetteSales(models.Model):
"payments": [ "payments": [
{ {
"amount": round(float(payment["amount"]), 2), "amount": round(float(payment["amount"]), 2),
"journal_id": payment["journal_id"] "journal_id": payment["journal_id"],
"meal_voucher_issuer": payment["meal_voucher_issuer"]
} }
] ]
}) })
......
...@@ -49,13 +49,11 @@ function display_orders(orders) { ...@@ -49,13 +49,11 @@ function display_orders(orders) {
{ {
data:"partner", data:"partner",
title:"Membre", title:"Membre"
width: "40%"
}, },
{ {
data:"total_amount", data:"total_amount",
title: "Montant dû", title: "Montant dû",
className:"dt-body-center",
render: function (data) { render: function (data) {
return parseFloat(data).toFixed(2) + ' €'; return parseFloat(data).toFixed(2) + ' €';
} }
...@@ -74,7 +72,14 @@ function display_orders(orders) { ...@@ -74,7 +72,14 @@ function display_orders(orders) {
return res; return res;
} }
},
{
data:"payments[0].meal_voucher_issuer",
title: "Émetteur CB Déj",
render: function (data) {
return data === 'false' || data == false ? '' : data;
} }
},
], ],
order: [ order: [
[ [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment