--- /dev/null
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * coup_de_pouce_velo
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-05-27 10:22+0000\n"
+"PO-Revision-Date: 2020-05-27 12:23+0200\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+"X-Generator: Poedit 2.3.1\n"
+"Last-Translator: Ludovic CHEVALIER <ludovic.chevalier@heureux-cyclage.org>\n"
+"Language: fr\n"
+
+#. module: coup_de_pouce_velo
+#: field:pos.order,is_cpv:0
+msgid "\"Coup de Pouce Velo\"?"
+msgstr "\"Coup de Pouce Vélo\"?"
+
+#. module: coup_de_pouce_velo
+#: model:ir.model,name:coup_de_pouce_velo.model_pos_order
+msgid "Point of Sale"
+msgstr "Atelier"
+
+#. module: coup_de_pouce_velo
+#: code:addons/coup_de_pouce_velo/point_of_sale.py:26
+#, python-format
+msgid "Warning"
+msgstr "Avertissement"
+
+#. module: coup_de_pouce_velo
+#: model:ir.model,name:coup_de_pouce_velo.model_pos_receipt
+msgid "Point of sale receipt"
+msgstr "Reçu de l'atelier"
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import time
+from openerp.report import report_sxw
+from openerp import pooler
+
+def titlize(journal_name):
+ words = journal_name.split()
+ while words.pop() != 'journal':
+ continue
+ return ' '.join(words)
+
+class order(report_sxw.rml_parse):
+
+ def __init__(self, cr, uid, name, context):
+ super(order, self).__init__(cr, uid, name, context=context)
+
+ user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid, context=context)
+ partner = user.company_id.partner_id
+
+ self.localcontext.update({
+ 'time': time,
+ 'disc': self.discount,
+ 'net': self.netamount,
+ 'get_journal_amt': self._get_journal_amt,
+ 'address': partner or False,
+ 'titlize': titlize
+ })
+
+ def netamount(self, order_line_id):
+ sql = 'select (qty*price_unit) as net_price from pos_order_line where id = %s'
+ self.cr.execute(sql, (order_line_id,))
+ res = self.cr.fetchone()
+ return res[0]
+
+ def discount(self, order_id):
+ sql = 'select discount, price_unit, qty from pos_order_line where order_id = %s '
+ self.cr.execute(sql, (order_id,))
+ res = self.cr.fetchall()
+ dsum = 0
+ for line in res:
+ if line[0] != 0:
+ dsum = dsum +(line[2] * (line[0]*line[1]/100))
+ return dsum
+
+ def _get_journal_amt(self, order_id):
+ data={}
+ sql = """ select aj.name,absl.amount as amt from account_bank_statement as abs
+ LEFT JOIN account_bank_statement_line as absl ON abs.id = absl.statement_id
+ LEFT JOIN account_journal as aj ON aj.id = abs.journal_id
+ WHERE absl.pos_statement_id =%d"""%(order_id)
+ self.cr.execute(sql)
+ data = self.cr.dictfetchall()
+ return data
+
+
+
+report_sxw.report_sxw('report.coup_de_pouce_velo.receipt', 'pos.order', 'addons/coup_de_pouce_velo/report/pos_receipt_coup_de_pouce_velo.rml', parser=order, header=False)
--- /dev/null
+<?xml version="1.0"?>
+<document filename="test.pdf">
+ <template pageSize="(204.0,842.0)" title="Receipt" author="OpenERP S.A. (sales@openerp.com)" allowSplitting="20">
+ <pageTemplate id="first">
+ <frame id="first" x1="0.0" y1="0.0" width="204" height="800"/>
+ </pageTemplate>
+ </template>
+ <stylesheet>
+ <blockTableStyle id="Standard_Outline">
+ <blockAlignment value="LEFT"/>
+ <blockValign value="TOP"/>
+ </blockTableStyle>
+ <blockTableStyle id="Table3">
+ <blockAlignment value="LEFT"/>
+ <blockValign value="TOP"/>
+ <lineStyle kind="LINEABOVE" colorName="#000000" start="0,1" stop="0,1"/>
+ <lineStyle kind="LINEABOVE" colorName="#000000" start="1,1" stop="1,1"/>
+ <lineStyle kind="LINEABOVE" colorName="#000000" start="2,1" stop="2,1"/>
+ </blockTableStyle>
+ <blockTableStyle id="Table2">
+ <blockAlignment value="LEFT"/>
+ <blockValign value="TOP"/>
+ <lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
+ </blockTableStyle>
+ <blockTableStyle id="Table4">
+ <blockAlignment value="LEFT"/>
+ <blockValign value="TOP"/>
+ </blockTableStyle>
+ <blockTableStyle id="Table10">
+ <blockAlignment value="LEFT"/>
+ <blockValign value="TOP"/>
+ <lineStyle kind="LINEABOVE" colorName="#000000" start="0,1" stop="0,1"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
+ <lineStyle kind="LINEABOVE" colorName="#000000" start="1,1" stop="1,1"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
+ <lineStyle kind="LINEABOVE" colorName="#000000" start="2,1" stop="2,1"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
+ </blockTableStyle>
+ <initialize>
+ <paraStyle name="all" alignment="justify"/>
+ </initialize>
+ <paraStyle name="P1" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT"/>
+ <paraStyle name="P2" fontName="Helvetica" fontSize="8.0" leading="10"/>
+ <paraStyle name="P3" fontName="Helvetica" fontSize="7.0" leading="9" alignment="LEFT"/>
+ <paraStyle name="P8" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT"/>
+ <paraStyle name="Standard" fontName="Helvetica"/>
+ <paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
+ <paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/>
+ <paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
+ <paraStyle name="Table Contents" fontName="Helvetica"/>
+ <paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER"/>
+ <paraStyle name="Caption" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/>
+ <paraStyle name="Index" fontName="Helvetica"/>
+ <paraStyle name="Frame contents" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
+ <paraStyle name="terp_default_Centre_9" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER"/>
+ <paraStyle name="terp_default_8" rightIndent="0.0" leftIndent="0.0" fontName="Courier" fontSize="10.0" leading="13" alignment="LEFT"/>
+ <paraStyle name="terp_header_Centre" fontName="Courier-Bold" fontSize="12.0" leading="15" alignment="CENTER"/>
+ <paraStyle name="terp_default_9b" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT"/>
+ <paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT"/>
+ <paraStyle name="terp_default_Bold_9_Right1" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT"/>
+ <paraStyle name="terp_default_Bold_9_Right2" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT"/>
+ <paraStyle name="P4" fontName="Courier-Bold" fontSize="10.0" leading="13" alignment="CENTER"/>
+ <paraStyle name="P5" fontName="Courier-Bold" fontSize="10.0" leading="13" alignment="LEFT"/>
+ <paraStyle name="P7" fontName="Courier-Bold" fontSize="10.0" leading="13" alignment="RIGHT"/>
+ <paraStyle name="P6a" fontName="Helvetica" fontSize="10.0" leading="13" alignment="RIGHT"/>
+ <paraStyle name="P7a" fontName="Courier" fontSize="10.0" leading="13" alignment="RIGHT"/>
+ <paraStyle name="P6" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="RIGHT"/>
+ <paraStyle name="P13" fontName="Courier-Bold" fontSize="10.0" leading="13" alignment="RIGHT"/>
+ <paraStyle name="Table" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/>
+ <images/>
+ </stylesheet>
+ <story>
+ <para style="terp_default_8">[[ repeatIn(objects,'o') ]]</para>
+ <para style="P5">Entretien vélo dans le cadre du"Coup de pouce Vélo - Réparation"</para>
+ <para style="P4">
+ <font color="white"> </font>
+ </para>
+ <para style="terp_header_Centre">[[o.user_id.company_id.name]]</para>
+ <para style="terp_default_Centre_9">[[ address and display_address(address)]]</para>
+ <para style="terp_default_Centre_9">Tél : [[ address and address.phone ]]</para>
+ <para style="terp_default_Centre_9">SIRET : [[o.user_id.company_id.siret]]</para>
+ <para style="terp_default_Centre_9">Atelier : [[ o.shop_id.name ]]</para>
+ <para style="terp_default_Centre_9">Date : [[ o.date_order ]]</para>
+ <para style="P4">
+ <font color="white"> </font>
+ </para>
+ <para style="terp_header_Centre">Bénéficiaire</para>
+ <para style="terp_default_Centre_9">[[ o.partner_id.name ]]</para>
+ <para style="terp_default_Centre_9">Portable: [[ o.partner_id.mobile ]]</para>
+ <para style="P4">
+ <font color="white"> </font>
+ </para>
+ <para style="P4">
+ <font color="white"> </font>
+ </para>
+ <para style="P4">
+ <font color="white"> </font>
+ </para>
+ <para style="P4">[[ o.name ]]</para>
+ <blockTable colWidths="68.0,68.0,68.0" style="Table3">
+ <tr>
+ <td>
+ <para style="P5">Description</para>
+ </td>
+ <td>
+ <para style="P7">Qté</para>
+ </td>
+ <td>
+ <para style="P7">Prix</para>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <para style="P1">[[ repeatIn(o.lines,'line') ]]</para>
+ <para style="terp_default_9b">[[ line.product_id.name ]]</para>
+ <para style="terp_default_Right_9">
+ <font face="Helvetica">With a [[ line and line.discount == 0.0 and removeParentNode('font') ]] ([[ '%.2f' % line.discount ]]) % discount.</font>
+ </para>
+ <para style="terp_default_9b">
+ <font color="white"> </font>
+ </para>
+ </td>
+ <td>
+ <para style="terp_default_Right_9">[[o.state=='cancel' and o.statement_ids and '-' or '']][['%.f' % line.qty ]]</para>
+ </td>
+ <td>
+ <para style="terp_default_Right_9">[[o.state=='cancel' and o.statement_ids and '-' or '']][[ formatLang(net(line.id), currency_obj=company.currency_id) ]] <font face="Helvetica">[[ line and line.discount == 0.0 and removeParentNode('font') ]] ([[ formatLang(line.discount, currency_obj=company.currency_id) ]])</font></para>
+ </td>
+ </tr>
+ </blockTable>
+ <blockTable colWidths="136.0,68.0" style="Table2">
+ <tr>
+ <td>
+ <para style="P6a">Taxes :</para>
+ </td>
+ <td>
+ <para style="terp_default_Right_9">[[o.state=='cancel' and o.statement_ids and '-' or '']][[formatLang(o.amount_tax, currency_obj=company.currency_id)]]</para>
+ </td>
+ </tr>
+ </blockTable>
+ <blockTable colWidths="136.0,68.0" style="Table4">
+ <tr>
+ <td>
+ <para style="P6">Total :</para>
+ </td>
+ <td>
+ <para style="terp_default_Bold_9_Right2">[[o.state=='cancel' and o.statement_ids and '-' or '']][[formatLang(o.amount_total, currency_obj=company.currency_id)]]</para>
+ </td>
+ </tr>
+ </blockTable>
+ <blockTable colWidths="102.0,34.0,68.0" style="Table10">
+ <tr>
+ <td>
+ <para style="P5">Moyen(s) de paiement</para>
+ </td>
+ <td>
+ <para style="P1">
+ <font color="white"> </font>
+ </para>
+ </td>
+ <td>
+ <para style="P13">Montant</para>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <para style="P1">[[ repeatIn(get_journal_amt(o),'d') ]]</para>
+ <para style="P2">[[ d['name'] ]]</para>
+ </td>
+ <td>
+ <para style="P1">
+ <font color="white"> </font>
+ </para>
+ </td>
+ <td>
+ <para style="P8">[[ formatLang(d['amt'] or 0, currency_obj=company.currency_id) ]]</para>
+ </td>
+ </tr>
+ </blockTable>
+ </story>
+</document>