Merge lp:~odossmann/unifield-wm/UFTP_312 into lp:unifield-wm
- UFTP_312
- Merge into trunk
Status: | Merged |
---|---|
Merged at revision: | 2345 |
Proposed branch: | lp:~odossmann/unifield-wm/UFTP_312 |
Merge into: | lp:unifield-wm |
Diff against target: |
2064 lines (+820/-772) 23 files modified
account_journal/account_journal.py (+9/-2) account_override/account.py (+7/-3) account_override/invoice.py (+1/-0) analytic_distribution/report/funding_pool.py (+16/-1) analytic_distribution/report/funding_pool.rml (+23/-41) analytic_override/analytic_account.py (+1/-1) finance/__openerp__.py (+2/-1) finance/account_view.xml (+1/-2) finance/report.xml (+15/-0) finance/report/account_partner_balance_tree.py (+1/-2) finance/report/account_partner_balance_tree_xls.mako (+12/-53) finance/wizard/account_report_partner_balance_tree.py (+25/-4) finance/wizard/account_report_partner_balance_tree_view.xml (+1/-0) financing_contract/report/project_expenses_xls.mako (+636/-630) financing_contract/report/report_project_expenses.py (+6/-3) msf_budget/report/report_local_expenses.py (+4/-5) msf_chart_of_account/data/journal_data.xml (+2/-0) msf_instance/wizard/account_analytic_chart.py (+11/-11) register_accounting/account_bank_statement.py (+5/-4) register_accounting/account_invoice_view.xml (+4/-2) register_accounting/account_view.xml (+3/-3) register_accounting/invoice.py (+35/-1) register_accounting/report/fully_report_xls.mako (+0/-3) |
To merge this branch: | bzr merge lp:~odossmann/unifield-wm/UFTP_312 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
UniField Reviewer Team | Pending | ||
Review via email:
|
Commit message
Description of the change
- 2318. By Olivier DOSSMANN
-
UFTP-312 [DEL] Point 10 and 11 - Reports on analytic accounts: Delete useless links to reports
- 2319. By Olivier DOSSMANN
-
UFTP-312 [FIX] Add some missing link to bank journal for cheque ones in data.
- 2320. By Olivier DOSSMANN
-
UFTP-312 [FIX] Point 10 and 11 - Analytic accounts reports: do not display reports after a database initial creation
- 2321. By Olivier DOSSMANN
-
UFTP-312 [FIX] Point 12 - Funding pool export (pdf): Change date so date it use the user format
- 2322. By Olivier DOSSMANN
-
UFTP-312 [FIX] Point 12 - Funding pool export (pdf): Change Destination code name regarding database
- 2323. By Olivier DOSSMANN
-
UFTP-312 [FIX] Point 15 - Balance by analytic account: Make instance_ids field to work (have an impact on the report)
- 2324. By Olivier DOSSMANN
-
UFTP-312 [FIX] Point 15 - Balance by account: Make instance_ids field to work on the wizard regarding the result
- 2325. By Olivier DOSSMANN
-
UFTP-312 [ADD] Point 18 - Partner balance (xls): Filter lines regarding tax or not. If "tax not included" is checked, so don't display them
- 2326. By Olivier DOSSMANN
-
UFTP-312 [ADD] Point 18 - Partner balance (Tree view): Display result regarding tax exclusion criteria
- 2327. By Olivier DOSSMANN
-
UFTP-312 [IMP] Point 13 - Register lines limit: Set to 20 instead of 50 default one
- 2328. By Olivier DOSSMANN
-
UFTP-312 [FIX] Point 20 - Local expenses: Fix the problem of double/triple/etc amounts from "by account"/"by expense" account in "by month" views
- 2329. By Olivier DOSSMANN
-
UFTP-312 [IMP] Point 21 - Partner balance: Change the way it works: group lines per account
- 2330. By Olivier DOSSMANN
-
UFTP-312 [FIX] Point 18 - Partner balance: Bug from UF-1715, wrong module selected for a given view
- 2331. By Olivier DOSSMANN
-
UFTP-312 [FIX] Point 12 - Funding pool report (pdf): Delete colWidths to avoid problem of conditional destination columns that break the behaviour
- 2332. By Olivier DOSSMANN
-
UFTP-312 [FIX] Point 8 - Direct invoice: permit to hard post direct invoice that was modified
Preview Diff
1 | === modified file 'account_journal/account_journal.py' |
2 | --- account_journal/account_journal.py 2014-09-10 13:42:40 +0000 |
3 | +++ account_journal/account_journal.py 2014-11-07 10:49:09 +0000 |
4 | @@ -100,14 +100,21 @@ |
5 | return periods[0] |
6 | return False |
7 | |
8 | - def name_get(self, cr, user, ids, context=None): |
9 | + def name_get(self, cr, uid, ids, context=None): |
10 | """ |
11 | Get code for journals |
12 | """ |
13 | - result = self.read(cr, user, ids, ['code']) |
14 | + result = self.read(cr, uid, ids, ['code', 'instance_id']) |
15 | res = [] |
16 | + is_manual_view = context.get('from_manual_entry', False) |
17 | for rs in result: |
18 | txt = rs.get('code', '') |
19 | + if is_manual_view: |
20 | + if rs.get('instance_id', False): |
21 | + instance = self.pool.get('msf.instance').read(cr, uid, [rs.get('instance_id')[0]], ['code']) |
22 | + if instance and instance[0] and instance[0].get('code', False): |
23 | + instance_code = instance[0].get('code') |
24 | + txt += ' - ' + str(instance_code) |
25 | res += [(rs.get('id'), txt)] |
26 | return res |
27 | |
28 | |
29 | === modified file 'account_override/account.py' |
30 | --- account_override/account.py 2014-10-03 12:31:11 +0000 |
31 | +++ account_override/account.py 2014-11-07 10:49:09 +0000 |
32 | @@ -102,13 +102,14 @@ |
33 | #compute for each account the balance/debit/credit from the move lines |
34 | accounts = {} |
35 | sums = {} |
36 | + query_params = [] |
37 | # Add some query/query_params regarding context |
38 | link = " " |
39 | if context.get('currency_id', False): |
40 | if query: |
41 | link = " AND " |
42 | query += link + 'currency_id = %s' |
43 | - query_params += tuple([context.get('currency_id')]) |
44 | + query_params.append(tuple([context.get('currency_id')])) |
45 | link = " " |
46 | if context.get('instance_ids', False): |
47 | if query: |
48 | @@ -120,7 +121,7 @@ |
49 | query += link + 'l.instance_id = %s' |
50 | else: |
51 | query += link + 'l.instance_id in %s' |
52 | - query_params += tuple(instance_ids) |
53 | + query_params.append(tuple(instance_ids)) |
54 | # Do normal process |
55 | if children_and_consolidated: |
56 | aml_query = self.pool.get('account.move.line')._query_get(cr, uid, context=context) |
57 | @@ -154,7 +155,10 @@ |
58 | " WHERE l.account_id IN %s " \ |
59 | + prefilters + filters + |
60 | " GROUP BY l.account_id") |
61 | - params = (tuple(children_and_consolidated),) + query_params |
62 | + params = [tuple(children_and_consolidated)] |
63 | + if query_params: |
64 | + for qp in query_params: |
65 | + params.append(qp) |
66 | cr.execute(request, params) |
67 | self.logger.notifyChannel('account_override.'+self._name, netsvc.LOG_DEBUG, |
68 | 'Status: %s'%cr.statusmessage) |
69 | |
70 | === modified file 'account_override/invoice.py' |
71 | --- account_override/invoice.py 2014-10-20 12:05:32 +0000 |
72 | +++ account_override/invoice.py 2014-11-07 10:49:09 +0000 |
73 | @@ -218,6 +218,7 @@ |
74 | states={'draft':[('readonly',False)]}), |
75 | 'register_posting_date': fields.date(string="Register posting date for Direct Invoice", required=False), |
76 | 'vat_ok': fields.function(_get_vat_ok, method=True, type='boolean', string='VAT OK', store=False, readonly=True), |
77 | + 'st_lines': fields.one2many('account.bank.statement.line', 'invoice_id', string="Register lines", readonly=True, help="Register lines that have a link to this invoice."), |
78 | } |
79 | |
80 | _defaults = { |
81 | |
82 | === modified file 'analytic_distribution/report/funding_pool.py' |
83 | --- analytic_distribution/report/funding_pool.py 2014-03-07 10:40:22 +0000 |
84 | +++ analytic_distribution/report/funding_pool.py 2014-11-07 10:49:09 +0000 |
85 | @@ -29,12 +29,27 @@ |
86 | super(funding, self).__init__(cr, uid, name, context=context) |
87 | self.localcontext.update({ |
88 | 'locale': locale, |
89 | + 'getDest': self.getDestinations, |
90 | 'getBoolDest': self.getBoolDest, |
91 | 'today': self.today, |
92 | }) |
93 | |
94 | def today(self): |
95 | - return time.strftime('%Y/%m/%d',time.localtime()) |
96 | + return time.strftime('%Y-%m-%d',time.localtime()) |
97 | + |
98 | + def getDestinations(self): |
99 | + """ |
100 | + Fetch destination analytic account: |
101 | + * ID |
102 | + * code |
103 | + Then sort by code |
104 | + """ |
105 | + res = [('Code', False), ('Name', False)] # We need the 2 first column header name |
106 | + pool = pooler.get_pool(self.cr.dbname) |
107 | + destination_ids = pool.get('account.analytic.account').search(self.cr, self.uid, [('category', '=', 'DEST'), ('type', '!=', 'view')], order='id') |
108 | + data = pool.get('account.analytic.account').read(self.cr, self.uid, destination_ids, ['code']) |
109 | + res += [(x.get('code'), x.get('id')) for x in data] |
110 | + return res |
111 | |
112 | def getBoolDest(self, line, o): |
113 | pool = pooler.get_pool(self.cr.dbname) |
114 | |
115 | === modified file 'analytic_distribution/report/funding_pool.rml' |
116 | --- analytic_distribution/report/funding_pool.rml 2014-05-21 12:53:11 +0000 |
117 | +++ analytic_distribution/report/funding_pool.rml 2014-11-07 10:49:09 +0000 |
118 | @@ -168,7 +168,7 @@ |
119 | <para style="P4"> |
120 | <font color="white"> </font> |
121 | </para> |
122 | - <para style="P6">Report edition date: [[ today() ]]</para> |
123 | + <para style="P6">Report edition date: [[ formatLang(today(), date=True) ]]</para> |
124 | <para> |
125 | <br /> |
126 | </para> |
127 | @@ -186,10 +186,10 @@ |
128 | <blockTable colWidths="266.0,269.0" style="Table3"> |
129 | <tr> |
130 | <td> |
131 | - <para style="P13" alignment="LEFT">[[ formatLang(o.date_start, date=True) ]] </para> |
132 | + <para style="P13" alignment="LEFT">[[ formatLang(o.date_start, date=True) ]]</para> |
133 | </td> |
134 | <td> |
135 | - <para style="P13" alignment="LEFT">[[ o.date != 'False' and formatLang(o.date, date=True) or '' ]] </para> |
136 | + <para style="P13" alignment="LEFT">[[ o.date != 'False' and formatLang(o.date, date=True) or '' ]]</para> |
137 | </td> |
138 | </tr> |
139 | </blockTable> |
140 | @@ -232,50 +232,32 @@ |
141 | </para> |
142 | <para style="P6">Accounts:</para> |
143 | |
144 | - <blockTable colWidths="40.0,260.0,55.0,55.0,55.0,55.0" repeatRows="1" style="Table4"> |
145 | + <!-- Seems that its not possible to change colWidths regarding a condition. |
146 | + Cf. https://www.odoo.com/forum/help-1/question/reportlab-conditional-table-header-15143 |
147 | + Previous colWidths: colWidths="40.0,260.0,55.0,55.0,55.0,55.0" |
148 | + --> |
149 | + <blockTable repeatRows="1" style="Table4"> |
150 | <tr> |
151 | <td> |
152 | - <para style="P14" alignment="LEFT">Code</para> |
153 | - </td> |
154 | - <td> |
155 | - <para style="P15" alignment="LEFT">Name</para> |
156 | - </td> |
157 | - <td> |
158 | - <para style="P25" alignment="CENTER">EXP</para> |
159 | - </td> |
160 | - <td> |
161 | - <para style="P24" alignment="CENTER">NST</para> |
162 | - </td> |
163 | - <td> |
164 | - <para style="P24" alignment="CENTER">OPS</para> |
165 | - </td> |
166 | - <td> |
167 | - <para style="P24" alignment="CENTER">SUP</para> |
168 | + [[repeatIn(getDest(),'dest_data','td')]] |
169 | + <para style="P24" alignment="CENTER">[[ dest_data[0] ]]</para> |
170 | </td> |
171 | </tr> |
172 | |
173 | - <tr> |
174 | + <tr> |
175 | [[repeatIn(o.tuple_destination_summary,'line')]] |
176 | - <td> |
177 | - <para style="P16" alignment="LEFT">[[ line.account_id and line.account_id.code ]]</para> |
178 | - </td> |
179 | - <td> |
180 | - <para style="P11" alignment="LEFT">[[ line.account_id and line.account_id.name ]]</para> |
181 | - </td> |
182 | - <td> |
183 | - <para style="P29" alignment="CENTER">[[ getBoolDest(line,'dest_11') ]]</para> |
184 | - </td> |
185 | - <td> |
186 | - <para style="P28" alignment="CENTER">[[ getBoolDest(line,'dest_10') ]]</para> |
187 | - </td> |
188 | - <td> |
189 | - <para style="P28" alignment="CENTER">[[ getBoolDest(line,'dest_8') ]]</para> |
190 | - </td> |
191 | - <td> |
192 | - <para style="P28" alignment="CENTER">[[ getBoolDest(line,'dest_9') ]]</para> |
193 | - </td> |
194 | - </tr> |
195 | - </blockTable> |
196 | + <td> |
197 | + <para style="P16" alignment="LEFT">[[ line.account_id and line.account_id.code ]]</para> |
198 | + </td> |
199 | + <td> |
200 | + <para style="P11" alignment="LEFT">[[ line.account_id and line.account_id.name ]]</para> |
201 | + </td> |
202 | + <td> |
203 | + [[repeatIn(getDest()[2:],'dest_data','td')]] |
204 | + <para style="P28" alignment="CENTER">[[ getBoolDest(line,'dest_'+ str(dest_data[1])) ]]</para> |
205 | + </td> |
206 | + </tr> |
207 | + </blockTable> |
208 | |
209 | <para style="P5"> |
210 | <font color="white"> </font> |
211 | |
212 | === modified file 'analytic_override/analytic_account.py' |
213 | --- analytic_override/analytic_account.py 2014-06-19 13:41:39 +0000 |
214 | +++ analytic_override/analytic_account.py 2014-11-07 10:49:09 +0000 |
215 | @@ -134,7 +134,7 @@ |
216 | where_date += " AND l.instance_id = %s" |
217 | else: |
218 | where_date += " AND l.instance_id in %s" |
219 | - where_clause_args += tuple(instance_ids) |
220 | + where_clause_args.append(tuple(instance_ids)) |
221 | # UF-1713: Add currency arg |
222 | if context.get('currency_id', False): |
223 | where_date += " AND l.currency_id = %s" |
224 | |
225 | === modified file 'finance/__openerp__.py' |
226 | --- finance/__openerp__.py 2014-03-19 10:26:27 +0000 |
227 | +++ finance/__openerp__.py 2014-11-07 10:49:09 +0000 |
228 | @@ -40,7 +40,8 @@ |
229 | 'account_invoice_view.xml', |
230 | 'account_analytic_line_view.xml', |
231 | 'account_sequence.xml', |
232 | - 'wizard/account_report_partner_balance_tree_view.xml' # uf-1715 |
233 | + 'wizard/account_report_partner_balance_tree_view.xml', # uf-1715 |
234 | + 'report.xml', # UFTP-312 about link deletions |
235 | ], |
236 | 'test': [], |
237 | 'installable': True, |
238 | |
239 | === modified file 'finance/account_view.xml' |
240 | --- finance/account_view.xml 2014-09-22 14:54:53 +0000 |
241 | +++ finance/account_view.xml 2014-11-07 10:49:09 +0000 |
242 | @@ -21,7 +21,6 @@ |
243 | </field> |
244 | </record> |
245 | |
246 | - |
247 | <record id="inherit_view_account_search_pma" model="ir.ui.view"> |
248 | <field name="name">inherit.view.account.search.pma</field> |
249 | <field name="model">account.account</field> |
250 | @@ -70,7 +69,7 @@ |
251 | <form string="Journal Entries" position="replace"> |
252 | <form string="Journal Entries" hide_delete_button="1"> |
253 | <group colspan="4" col="6"> |
254 | - <field name="journal_id" on_change="onchange_journal_id(journal_id)" attrs="{'readonly': ['|', ('status', '=', 'sys'), ('state', '=', 'posted')]}"/> |
255 | + <field name="journal_id" on_change="onchange_journal_id(journal_id)" attrs="{'readonly': ['|', ('status', '=', 'sys'), ('state', '=', 'posted')]}" context="{'from_manual_entry': True}"/> |
256 | <field name="name" readonly="1"/> |
257 | <field name="period_id" on_change="onchange_period_id(period_id, date)" attrs="{'readonly': ['|', ('status', '=', 'sys'), ('state', '=', 'posted')]}"/> |
258 | <field name="document_date" attrs="{'readonly': ['|', ('status', '=', 'sys'), ('state', '=', 'posted')]}"/> |
259 | |
260 | === added file 'finance/report.xml' |
261 | --- finance/report.xml 1970-01-01 00:00:00 +0000 |
262 | +++ finance/report.xml 2014-11-07 10:49:09 +0000 |
263 | @@ -0,0 +1,15 @@ |
264 | +<?xml version="1.0" encoding="utf-8" ?> |
265 | +<openerp> |
266 | + <data> |
267 | + |
268 | + <!-- UFTP-312: Delete links on analytic account view about Analytic Balance, Cost Ledger, Inverted Analytic Balance and Cost Ledger (only quantities) --> |
269 | + <delete model="ir.actions.act_window" id="account.action_account_analytic_balance"/> |
270 | + |
271 | + <delete model="ir.actions.act_window" id="account.action_account_analytic_invert_balance"/> |
272 | + |
273 | + <delete model="ir.actions.act_window" id="account.action_account_analytic_cost"/> |
274 | + |
275 | + <delete model="ir.actions.act_window" id="account.action_account_analytic_cost_ledger_journal"/> |
276 | + |
277 | + </data> |
278 | +</openerp> |
279 | |
280 | === modified file 'finance/report/account_partner_balance_tree.py' |
281 | --- finance/report/account_partner_balance_tree.py 2014-04-16 10:42:33 +0000 |
282 | +++ finance/report/account_partner_balance_tree.py 2014-11-07 10:49:09 +0000 |
283 | @@ -202,7 +202,6 @@ |
284 | self.output_currency_id, |
285 | date) |
286 | |
287 | - |
288 | class account_partner_balance_tree_xls(SpreadsheetReport): |
289 | def __init__(self, name, table, rml=False, parser=report_sxw.rml_parse, header='external', store=False): |
290 | super(account_partner_balance_tree_xls, self).__init__(name, table, rml=rml, parser=parser, header=header, store=store) |
291 | @@ -210,6 +209,6 @@ |
292 | def create(self, cr, uid, ids, data, context=None): |
293 | a = super(account_partner_balance_tree_xls, self).create(cr, uid, ids, data, context) |
294 | return (a[0], 'xls') |
295 | + |
296 | account_partner_balance_tree_xls('report.account.partner.balance.tree_xls', 'account.partner.balance.tree', 'finance/report/account_partner_balance_tree_xls.mako', parser=account_partner_balance_tree, header='internal') |
297 | - |
298 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
299 | |
300 | === modified file 'finance/report/account_partner_balance_tree_xls.mako' |
301 | --- finance/report/account_partner_balance_tree_xls.mako 2014-03-14 15:47:48 +0000 |
302 | +++ finance/report/account_partner_balance_tree_xls.mako 2014-11-07 10:49:09 +0000 |
303 | @@ -292,18 +292,6 @@ |
304 | <Cell ss:StyleID="ssHeader"> |
305 | <Data ss:Type="String">Partner</Data> |
306 | </Cell> |
307 | -<Cell ss:StyleID="ssHeader"> |
308 | - <Data ss:Type="String">Journal</Data> |
309 | -</Cell> |
310 | -<Cell ss:StyleID="ssHeader"> |
311 | - <Data ss:Type="String">Code</Data> |
312 | -</Cell> |
313 | -<Cell ss:StyleID="ssHeader"> |
314 | - <Data ss:Type="String">Move</Data> |
315 | -</Cell> |
316 | -<Cell ss:StyleID="ssHeader"> |
317 | - <Data ss:Type="String">Posting Date</Data> |
318 | -</Cell> |
319 | <Cell ss:StyleID="ssHeaderRight"> |
320 | <Data ss:Type="String">Account</Data> |
321 | </Cell> |
322 | @@ -329,18 +317,6 @@ |
323 | <Cell ss:StyleID="ssPartner"> |
324 | <Data ss:Type="String"></Data> |
325 | </Cell> |
326 | -<Cell ss:StyleID="ssPartner"> |
327 | - <Data ss:Type="String"></Data> |
328 | -</Cell> |
329 | -<Cell ss:StyleID="ssPartner"> |
330 | - <Data ss:Type="String"></Data> |
331 | -</Cell> |
332 | -<Cell ss:StyleID="ssPartner"> |
333 | - <Data ss:Type="String"></Data> |
334 | -</Cell> |
335 | -<Cell ss:StyleID="ssPartner"> |
336 | - <Data ss:Type="String"></Data> |
337 | -</Cell> |
338 | <Cell ss:StyleID="ssPartnerNumber"> |
339 | <Data ss:Type="Number">${p_obj.debit or 0.}</Data> |
340 | </Cell> |
341 | @@ -353,38 +329,21 @@ |
342 | </Row> |
343 | ## account move line row |
344 | % for aml in get_partner_account_move_lines(p_entries[0].account_type, p_obj.partner_id.id, data): |
345 | -<% |
346 | -debit = currency_conv(aml.debit, aml.date) |
347 | -credit = currency_conv(aml.credit, aml.date) |
348 | -balance = debit - credit |
349 | -%> |
350 | <Row> |
351 | <Cell ss:StyleID="ssAccountLine"> |
352 | - <Data ss:Type="String">${partner_name|x}</Data> |
353 | -</Cell> |
354 | -<Cell ss:StyleID="ssAccountLine"> |
355 | - <Data ss:Type="String">${((aml.journal_id and aml.journal_id.code) or '')|x}</Data> |
356 | -</Cell> |
357 | -<Cell ss:StyleID="ssAccountLine"> |
358 | - <Data ss:Type="String">${((aml.move_id and aml.move_id.name) or '')|x}</Data> |
359 | -</Cell> |
360 | -<Cell ss:StyleID="ssAccountLine"> |
361 | - <Data ss:Type="String">${formatLang(aml.date, date=True)}</Data> |
362 | -</Cell> |
363 | -<Cell ss:StyleID="ssAccountLineWrap"> |
364 | - <Data ss:Type="String">${((aml.period_id and aml.period_id.name) or '')|x}</Data> |
365 | + <Data ss:Type="String"></Data> |
366 | </Cell> |
367 | <Cell ss:StyleID="ssAccountLineAccountCode"> |
368 | - <Data ss:Type="Number">${((aml.account_id and aml.account_id.code) or '')|x}</Data> |
369 | -</Cell> |
370 | -<Cell ss:StyleID="ssAccountLineNumber"> |
371 | - <Data ss:Type="Number">${debit}</Data> |
372 | -</Cell> |
373 | -<Cell ss:StyleID="ssAccountLineNumber"> |
374 | - <Data ss:Type="Number">${credit}</Data> |
375 | -</Cell> |
376 | -<Cell ss:StyleID="ssAccountLineNumber"> |
377 | - <Data ss:Type="Number">${balance}</Data> |
378 | + <Data ss:Type="Number">${aml.get('account', '')|x}</Data> |
379 | +</Cell> |
380 | +<Cell ss:StyleID="ssAccountLineNumber"> |
381 | + <Data ss:Type="Number">${aml.get('deb', 0.0)}</Data> |
382 | +</Cell> |
383 | +<Cell ss:StyleID="ssAccountLineNumber"> |
384 | + <Data ss:Type="Number">${aml.get('cred', 0.0)}</Data> |
385 | +</Cell> |
386 | +<Cell ss:StyleID="ssAccountLineNumber"> |
387 | + <Data ss:Type="Number">${aml.get('total', 0.0)}</Data> |
388 | </Cell> |
389 | </Row> |
390 | % endfor |
391 | @@ -397,7 +356,7 @@ |
392 | credit = currency_conv(credit, False) |
393 | balance = currency_conv(balance, False) |
394 | %> |
395 | -<Cell ss:StyleID="ssCell" ss:MergeAcross="4"> |
396 | +<Cell ss:StyleID="ssCell"> |
397 | <Data ss:Type="String"></Data> |
398 | </Cell> |
399 | <Cell ss:StyleID="ssCellRightBold"> |
400 | |
401 | === modified file 'finance/wizard/account_report_partner_balance_tree.py' |
402 | --- finance/wizard/account_report_partner_balance_tree.py 2014-04-28 10:29:20 +0000 |
403 | +++ finance/wizard/account_report_partner_balance_tree.py 2014-11-07 10:49:09 +0000 |
404 | @@ -73,6 +73,11 @@ |
405 | where += " AND " |
406 | where += "l.instance_id in(%s)" % (",".join(map(str, instance_ids))) |
407 | |
408 | + # UFTP-312: take tax exclusion in account if user asked for it |
409 | + TAX_REQUEST = ' ' |
410 | + if data['form'].get('tax', False): |
411 | + TAX_REQUEST = "AND at.code != 'tax'" |
412 | + |
413 | # inspired from account_report_balance.py report query |
414 | # but group only per 'account type'/'partner' |
415 | query = "SELECT ac.type as account_type," \ |
416 | @@ -83,9 +88,11 @@ |
417 | " FROM account_move_line l LEFT JOIN res_partner p ON (l.partner_id=p.id)" \ |
418 | " JOIN account_account ac ON (l.account_id = ac.id)" \ |
419 | " JOIN account_move am ON (am.id = l.move_id)" \ |
420 | + " JOIN account_account_type at ON (ac.user_type = at.id)" \ |
421 | " WHERE ac.type IN " + account_type + "" \ |
422 | " AND am.state IN " + move_state + "" \ |
423 | " AND " + where + "" \ |
424 | + " " + TAX_REQUEST + " " \ |
425 | " GROUP BY ac.type,p.id,p.ref,p.name" \ |
426 | " ORDER BY ac.type,p.name" |
427 | cr.execute(query) |
428 | @@ -106,7 +113,8 @@ |
429 | |
430 | query = "SELECT l.id FROM account_move_line l" \ |
431 | " JOIN account_account ac ON (l.account_id = ac.id)" \ |
432 | - " JOIN account_move am ON (am.id = l.move_id) WHERE " |
433 | + " JOIN account_move am ON (am.id = l.move_id)" \ |
434 | + " JOIN account_account_type at ON (ac.user_type = at.id) WHERE " |
435 | if partner_id: |
436 | query += "l.partner_id = " + str(partner_id) + "" \ |
437 | " AND ac.type = '" + account_type + "'" \ |
438 | @@ -114,8 +122,13 @@ |
439 | else: |
440 | query += "ac.type = '" + account_type + "'" \ |
441 | " AND am.state IN " + move_state + "" |
442 | + # UFTP-312: Filtering regarding tax account (if user asked it) |
443 | + if data['form'].get('tax', False): |
444 | + query += " AND at.code != 'tax' " |
445 | + |
446 | if where: |
447 | query += " AND " + where + "" |
448 | + |
449 | cr.execute(query) |
450 | res = cr.fetchall() |
451 | if res: |
452 | @@ -214,7 +227,7 @@ |
453 | # output currency in action context |
454 | new_context['output_currency_id'] = output_currency_id |
455 | view_id = self.pool.get('ir.model.data').get_object_reference( |
456 | - cr, uid, 'account_override', |
457 | + cr, uid, 'finance', |
458 | 'view_account_partner_balance_tree_move_line_tree')[1] |
459 | res = { |
460 | 'name': 'Journal Items', |
461 | @@ -284,7 +297,13 @@ |
462 | if ids: |
463 | if isinstance(ids, (int, long)): |
464 | ids = [ids] |
465 | - res = self.pool.get('account.move.line').browse(cr, uid, ids, context=context) |
466 | + sql = """SELECT a.code as account, SUM(aml.debit) as deb, SUM(aml.credit) as cred, ABS(SUM(debit) - SUM(credit)) as total |
467 | + FROM account_move_line as aml, account_account as a |
468 | + WHERE aml.id in %s |
469 | + AND aml.account_id = a.id |
470 | + GROUP BY a.code""" |
471 | + cr.execute(sql, (tuple(ids), )) |
472 | + res = cr.dictfetchall() |
473 | return res |
474 | return [] |
475 | |
476 | @@ -319,6 +338,7 @@ |
477 | ,'Display Partners'), |
478 | 'output_currency': fields.many2one('res.currency', 'Output Currency', required=True), |
479 | 'instance_ids': fields.many2many('msf.instance', 'account_report_general_ledger_instance_rel', 'instance_id', 'argl_id', 'Proprietary Instances'), |
480 | + 'tax': fields.boolean('Exclude tax', help="Exclude tax accounts from process"), |
481 | } |
482 | |
483 | def _get_journals(self, cr, uid, context=None): |
484 | @@ -330,6 +350,7 @@ |
485 | 'display_partner': 'non-zero_balance', |
486 | 'result_selection': 'supplier', |
487 | 'journal_ids': _get_journals, |
488 | + 'tax': False, |
489 | } |
490 | |
491 | def default_get(self, cr, uid, fields, context=None): |
492 | @@ -349,7 +370,7 @@ |
493 | data['ids'] = context.get('active_ids', []) |
494 | data['model'] = context.get('active_model', 'ir.ui.menu') |
495 | data['build_ts'] = datetime.datetime.now().strftime(self.pool.get('date.tools').get_db_datetime_format(cr, uid, context=context)) |
496 | - data['form'] = self.read(cr, uid, ids, ['date_from', 'date_to', 'fiscalyear_id', 'journal_ids', 'period_from', 'period_to', 'filter', 'chart_account_id', 'target_move', 'display_partner', 'output_currency', 'instance_ids'])[0] |
497 | + data['form'] = self.read(cr, uid, ids, ['date_from', 'date_to', 'fiscalyear_id', 'journal_ids', 'period_from', 'period_to', 'filter', 'chart_account_id', 'target_move', 'display_partner', 'output_currency', 'instance_ids', 'tax'])[0] |
498 | if data['form']['journal_ids']: |
499 | default_journals = self._get_journals(cr, uid, context=context) |
500 | if default_journals: |
501 | |
502 | === modified file 'finance/wizard/account_report_partner_balance_tree_view.xml' |
503 | --- finance/wizard/account_report_partner_balance_tree_view.xml 2014-05-13 14:44:16 +0000 |
504 | +++ finance/wizard/account_report_partner_balance_tree_view.xml 2014-11-07 10:49:09 +0000 |
505 | @@ -106,6 +106,7 @@ |
506 | </tree> |
507 | </field> |
508 | <newline/> |
509 | + <field name="tax"/> |
510 | </xpath> |
511 | |
512 | <xpath expr="//group[1]" position="replace"> |
513 | |
514 | === modified file 'financing_contract/report/project_expenses_xls.mako' |
515 | --- financing_contract/report/project_expenses_xls.mako 2014-05-26 14:41:01 +0000 |
516 | +++ financing_contract/report/project_expenses_xls.mako 2014-11-07 10:49:09 +0000 |
517 | @@ -1,644 +1,650 @@ |
518 | <?xml version="1.0"?> |
519 | <?mso-application progid="Excel.Sheet"?> |
520 | <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" |
521 | - xmlns:o="urn:schemas-microsoft-com:office:office" |
522 | - xmlns:x="urn:schemas-microsoft-com:office:excel" |
523 | - xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" |
524 | - xmlns:html="http://www.w3.org/TR/REC-html40"> |
525 | - <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office"> |
526 | - <Author>MSFUser</Author> |
527 | - <LastAuthor>MSFUser</LastAuthor> |
528 | - <Created>2012-06-18T15:46:09Z</Created> |
529 | - <Company>Medecins Sans Frontieres</Company> |
530 | - <Version>11.9999</Version> |
531 | - </DocumentProperties> |
532 | - <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel"> |
533 | - <WindowHeight>13170</WindowHeight> |
534 | - <WindowWidth>19020</WindowWidth> |
535 | - <WindowTopX>120</WindowTopX> |
536 | - <WindowTopY>60</WindowTopY> |
537 | - <ProtectStructure>False</ProtectStructure> |
538 | - <ProtectWindows>False</ProtectWindows> |
539 | - </ExcelWorkbook> |
540 | - |
541 | - |
542 | -<Styles> |
543 | -<Style ss:ID="Default" ss:Name="Normal"> |
544 | -<Alignment ss:Vertical="Bottom"/> |
545 | -<Borders/> |
546 | -<Font/> |
547 | -<Interior/> |
548 | -<NumberFormat/> |
549 | -<Protection/> |
550 | -</Style> |
551 | - |
552 | -<Style ss:ID="s21"> |
553 | -<Borders> |
554 | -<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
555 | -<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
556 | -<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
557 | -<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
558 | -</Borders> |
559 | -</Style> |
560 | - |
561 | -<Style ss:ID="s21a"> |
562 | -<Borders> |
563 | -<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
564 | -<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1" /> |
565 | -<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1" /> |
566 | -<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
567 | -</Borders> |
568 | -<Font ss:Bold="1"/> |
569 | -</Style> |
570 | - |
571 | -<Style ss:ID="s22"> |
572 | -<Borders> |
573 | -<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
574 | -<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
575 | -<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
576 | -<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
577 | -</Borders> |
578 | -<Interior ss:Pattern="Solid"/> |
579 | -</Style> |
580 | -<Style ss:ID="s23"> |
581 | -<Borders> |
582 | -<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
583 | -<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
584 | -<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
585 | -<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
586 | -</Borders> |
587 | -<NumberFormat ss:Format="General Date"/> |
588 | -</Style> |
589 | -<Style ss:ID="s24"> |
590 | -<Borders> |
591 | -<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
592 | -<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
593 | -<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
594 | -<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
595 | -</Borders> |
596 | -<Interior ss:Pattern="Solid"/> |
597 | -<NumberFormat ss:Format="#,##0"/> |
598 | -</Style> |
599 | -<Style ss:ID="s25"> |
600 | -<Borders> |
601 | -<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
602 | -<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
603 | -<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
604 | -<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
605 | -</Borders> |
606 | -<NumberFormat ss:Format="Short Date"/> |
607 | -</Style> |
608 | -<Style ss:ID="s26"> |
609 | -<Borders> |
610 | -<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
611 | -<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
612 | -<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
613 | -<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
614 | -</Borders> |
615 | -<Interior ss:Pattern="Solid"/> |
616 | -</Style> |
617 | -<Style ss:ID="s27"> |
618 | -<Interior ss:Pattern="Solid"/> |
619 | -<NumberFormat ss:Format="Short Date"/> |
620 | -</Style> |
621 | -<Style ss:ID="s29"> |
622 | -<Alignment ss:Vertical="Center" ss:WrapText="1"/> |
623 | -</Style> |
624 | -<Style ss:ID="s30"> |
625 | -<Alignment ss:Vertical="Center" ss:WrapText="1"/> |
626 | -<Borders> |
627 | -<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="2"/> |
628 | -<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="2"/> |
629 | -<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
630 | -<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="2"/> |
631 | -</Borders> |
632 | -<Font x:Family="Swiss" ss:Color="#FFFFFF" ss:Bold="1"/> |
633 | -<Interior ss:Color="#FF0000" ss:Pattern="Solid"/> |
634 | -</Style> |
635 | -<Style ss:ID="s31"> |
636 | -<Alignment ss:Vertical="Center" ss:WrapText="1"/> |
637 | -<Borders> |
638 | -<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="2"/> |
639 | -<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
640 | -<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
641 | -<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="2"/> |
642 | -</Borders> |
643 | -<Font x:Family="Swiss" ss:Color="#FFFFFF" ss:Bold="1"/> |
644 | -<Interior ss:Color="#FF0000" ss:Pattern="Solid"/> |
645 | -</Style> |
646 | -<Style ss:ID="s32"> |
647 | -<Alignment ss:Vertical="Center" ss:WrapText="1"/> |
648 | -<Borders> |
649 | -<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="2"/> |
650 | -<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
651 | -<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
652 | -<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="2"/> |
653 | -</Borders> |
654 | -<Font x:Family="Swiss" ss:Bold="1"/> |
655 | -<Interior ss:Pattern="Solid"/> |
656 | -</Style> |
657 | -<Style ss:ID="s33"> |
658 | -<Alignment ss:Vertical="Center" ss:WrapText="1"/> |
659 | -<Borders> |
660 | -<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="2"/> |
661 | -<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
662 | -<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="2"/> |
663 | -<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="2"/> |
664 | -</Borders> |
665 | -<Font x:Family="Swiss" ss:Color="#FFFFFF" ss:Bold="1"/> |
666 | -<Interior ss:Color="#FF0000" ss:Pattern="Solid"/> |
667 | -</Style> |
668 | -<Style ss:ID="s34"> |
669 | -<Alignment ss:Vertical="Center" ss:WrapText="1"/> |
670 | -<Interior ss:Color="#FF0000" ss:Pattern="Solid"/> |
671 | -</Style> |
672 | -<Style ss:ID="s35"> |
673 | -<Borders> |
674 | -<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
675 | -<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="2"/> |
676 | -<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
677 | -</Borders> |
678 | -<NumberFormat ss:Format="Short Date"/> |
679 | -</Style> |
680 | -<Style ss:ID="s36"> |
681 | -<Borders> |
682 | -<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
683 | -<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
684 | -<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
685 | -</Borders> |
686 | -</Style> |
687 | -<Style ss:ID="s37"> |
688 | -<Borders> |
689 | -<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
690 | -<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
691 | -<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
692 | -</Borders> |
693 | -<Interior ss:Pattern="Solid"/> |
694 | -</Style> |
695 | -<Style ss:ID="s38"> |
696 | -<Borders> |
697 | -<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
698 | -<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
699 | -<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
700 | -</Borders> |
701 | -<NumberFormat ss:Format="Standard"/> |
702 | -</Style> |
703 | -<Style ss:ID="s39"> |
704 | -<Borders> |
705 | -<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
706 | -<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
707 | -<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="2"/> |
708 | -</Borders> |
709 | -</Style> |
710 | -<Style ss:ID="s40"> |
711 | -<Interior ss:Color="#FF0000" ss:Pattern="Solid"/> |
712 | -</Style> |
713 | -<Style ss:ID="s41"> |
714 | -<Borders> |
715 | -<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
716 | -<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="2"/> |
717 | -<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
718 | -<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
719 | -</Borders> |
720 | -<NumberFormat ss:Format="Short Date"/> |
721 | -</Style> |
722 | -<Style ss:ID="s42"> |
723 | -<Borders> |
724 | -<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
725 | -<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
726 | -<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
727 | -<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
728 | -</Borders> |
729 | -<NumberFormat ss:Format="Standard"/> |
730 | -</Style> |
731 | -<Style ss:ID="s43"> |
732 | -<Borders> |
733 | -<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
734 | -<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
735 | -<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="2"/> |
736 | -<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
737 | -</Borders> |
738 | -</Style> |
739 | -<Style ss:ID="s44"> |
740 | -<Borders> |
741 | -<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="2"/> |
742 | -<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="2"/> |
743 | -<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
744 | -<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
745 | -</Borders> |
746 | -<NumberFormat ss:Format="Short Date"/> |
747 | -</Style> |
748 | -<Style ss:ID="s45"> |
749 | -<Borders> |
750 | -<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="2"/> |
751 | -<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
752 | -<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
753 | -<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
754 | -</Borders> |
755 | -</Style> |
756 | -<Style ss:ID="s46"> |
757 | -<Borders> |
758 | -<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="2"/> |
759 | -<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
760 | -<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
761 | -<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
762 | -</Borders> |
763 | -<Interior ss:Pattern="Solid"/> |
764 | -</Style> |
765 | -<Style ss:ID="s47"> |
766 | -<Borders> |
767 | -<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="2"/> |
768 | -<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
769 | -<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
770 | -<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
771 | -</Borders> |
772 | -<NumberFormat ss:Format="Standard"/> |
773 | -</Style> |
774 | -<Style ss:ID="s48"> |
775 | -<Borders> |
776 | -<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="2"/> |
777 | -<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
778 | -<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="2"/> |
779 | -<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
780 | -</Borders> |
781 | -</Style> |
782 | - |
783 | -<Style ss:ID="s49"> |
784 | -<Borders> |
785 | -<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="2"/> |
786 | -</Borders> |
787 | -<Font x:Family="Swiss" ss:Bold="1"/> |
788 | -<NumberFormat ss:Format="Standard"/> |
789 | -</Style> |
790 | - |
791 | -<Style ss:ID="s49a"> |
792 | -<Borders> |
793 | -<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
794 | -</Borders> |
795 | -<Font x:Family="Swiss" ss:Bold="1"/> |
796 | -<NumberFormat ss:Format="Standard"/> |
797 | -</Style> |
798 | - |
799 | -<Style ss:ID="s50"> |
800 | -<Font x:Family="Swiss" ss:Bold="1"/> |
801 | -</Style> |
802 | -<Style ss:ID="s51"> |
803 | -<Font x:Family="Swiss" ss:Color="#FF0000" ss:Italic="1"/> |
804 | -</Style> |
805 | -<Style ss:ID="s52"> |
806 | -<NumberFormat ss:Format="Short Date"/> |
807 | -</Style> |
808 | -<Style ss:ID="s53"> |
809 | -<Font ss:Color="#FF0000"/> |
810 | -<Interior ss:Pattern="Solid"/> |
811 | -</Style> |
812 | - |
813 | -<Style ss:ID="short_date2"> |
814 | -<Alignment ss:Horizontal="Center" ss:Vertical="Center" ss:WrapText="1"/> |
815 | -<NumberFormat ss:Format="Short Date"/> |
816 | -</Style> |
817 | - |
818 | -<Style ss:ID="short_date_head"> |
819 | -<Borders> |
820 | -<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
821 | -<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
822 | -<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
823 | -<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
824 | -</Borders> |
825 | -<Alignment ss:Horizontal="Center" ss:Vertical="Center" ss:WrapText="1"/> |
826 | -<NumberFormat ss:Format="Short Date"/> |
827 | -</Style> |
828 | - |
829 | -<Style ss:ID="short_date_color"> |
830 | -<Alignment ss:Horizontal="Center" ss:Vertical="Center" ss:WrapText="1"/> |
831 | -<NumberFormat ss:Format="Short Date"/> |
832 | -<Interior ss:Pattern="Solid"/> |
833 | -<Borders> |
834 | -<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
835 | -<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
836 | -<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
837 | -<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
838 | -</Borders> |
839 | -</Style> |
840 | -</Styles> |
841 | - |
842 | -% for o in objects: |
843 | -<Worksheet ss:Name="${"%s"%( o.code and o.code.replace('/', '_') +'_'+str(o.id) or 'Sheet1')|x}"> |
844 | - |
845 | -<Table x:FullColumns="1" x:FullRows="1"> |
846 | -<Column ss:AutoFitWidth="0" ss:Width="102.75"/> |
847 | -<Column ss:AutoFitWidth="0" ss:Width="92.25"/> |
848 | -<Column ss:AutoFitWidth="0" ss:Width="87.75"/> |
849 | -<Column ss:AutoFitWidth="0" ss:Width="239.25"/> |
850 | -<Column ss:AutoFitWidth="0" ss:Width="186.75" ss:Span="1"/> |
851 | -<Column ss:Index="7" ss:AutoFitWidth="0" ss:Width="121.5"/> |
852 | -<Column ss:AutoFitWidth="0" ss:Width="66.75"/> |
853 | -<Column ss:AutoFitWidth="0" ss:Width="103.5"/> |
854 | -<Column ss:AutoFitWidth="0" ss:Width="137.25"/> |
855 | -<Column ss:Index="13" ss:AutoFitWidth="0" ss:Width="57.75"/> |
856 | -<Column ss:AutoFitWidth="0" ss:Width="62.25"/> |
857 | -<Row> |
858 | -<Cell ss:StyleID="s21a"> |
859 | -<Data ss:Type="String">${_('FINANCIAL REPORT for financing contract')}</Data> |
860 | -</Cell> |
861 | -<Cell ss:StyleID="s21"/> |
862 | -</Row> |
863 | -<Row> |
864 | -<Cell ss:StyleID="s22"> |
865 | -<Data ss:Type="String">${_('Report date:')}</Data> |
866 | -</Cell> |
867 | -<Cell ss:StyleID="short_date_head"> |
868 | -<Data ss:Type="DateTime">${time.strftime('%Y-%m-%d')|n}T00:00:00.000</Data> |
869 | -</Cell> |
870 | -</Row> |
871 | -<Row ss:Index="4"> |
872 | -<Cell ss:StyleID="s21"> |
873 | -<Data ss:Type="String">${_('Donor:')}</Data> |
874 | -</Cell> |
875 | -<Cell ss:StyleID="s21"> |
876 | -<Data ss:Type="String">${( o.donor_id and o.donor_id.name or '')|x}</Data> |
877 | -</Cell> |
878 | -</Row> |
879 | - |
880 | -<Row> |
881 | -<Cell ss:StyleID="s21"> |
882 | -<Data ss:Type="String">${_('Financing contract name:')}</Data> |
883 | -</Cell> |
884 | -<Cell ss:StyleID="s21"> |
885 | -<Data ss:Type="String">${( o.name or '')|x}</Data> |
886 | -</Cell> |
887 | -</Row> |
888 | -<Row> |
889 | -<Cell ss:StyleID="s21"> |
890 | -<Data ss:Type="String">${_('Financing contract code:')}</Data> |
891 | -</Cell> |
892 | -<Cell ss:StyleID="s21"> |
893 | -<Data ss:Type="String">${( o.code or '')|x}</Data> |
894 | -</Cell> |
895 | -</Row> |
896 | -<Row> |
897 | -<Cell ss:StyleID="s21"> |
898 | -<Data ss:Type="String">${_('Grant amount:')}</Data> |
899 | -</Cell> |
900 | -<Cell ss:StyleID="s24"> |
901 | -<Data ss:Type="Number">${( o.grant_amount or '')|x}</Data> |
902 | -</Cell> |
903 | -</Row> |
904 | - |
905 | -<Row> |
906 | -<Cell ss:StyleID="s21"> |
907 | -<Data ss:Type="String">${_('Reporting currency:')}</Data> |
908 | -</Cell> |
909 | -<Cell ss:StyleID="s21"> |
910 | -<Data ss:Type="String">${( o.reporting_currency and o.reporting_currency.name or '')|x}</Data> |
911 | -</Cell> |
912 | -</Row> |
913 | - |
914 | -<Row> |
915 | -<Cell ss:StyleID="s21"> |
916 | -<Data ss:Type="String">${_('Eligible from:')}</Data> |
917 | -</Cell> |
918 | -<Cell ss:StyleID="short_date_head"> |
919 | -<Data ss:Type="DateTime">${ o.eligibility_from_date or '' |n}T00:00:00.000</Data> |
920 | -</Cell> |
921 | -<Cell ss:StyleID="s26"> |
922 | -<Data ss:Type="String">${_('to:')}</Data> |
923 | -</Cell> |
924 | -<Cell ss:StyleID="short_date_color"> |
925 | -<Data ss:Type="DateTime">${ o.eligibility_to_date |n}T00:00:00.000</Data> |
926 | -</Cell> |
927 | -<Cell /> |
928 | -<Cell /> |
929 | -</Row> |
930 | - |
931 | -<Row ss:Index="11"> |
932 | -<Cell ss:StyleID="s21"> |
933 | -<Data ss:Type="String">${_('Reporting type:')}</Data> |
934 | -</Cell> |
935 | -<Cell ss:StyleID="s21"> |
936 | -<Data ss:Type="String">${( o.reporting_type and getSel(o, 'reporting_type') or '')|x}</Data> |
937 | - |
938 | -</Cell> |
939 | -</Row> |
940 | -<Row> |
941 | -<Cell ss:StyleID="s21"> |
942 | -<Data ss:Type="String">${_('Cost centers:')}</Data> |
943 | -</Cell> |
944 | -<Cell ss:StyleID="s21"> |
945 | -<Data ss:Type="String">${( getCostCenter(o) or '')|x}</Data> |
946 | -</Cell> |
947 | -</Row> |
948 | - |
949 | -<Row > |
950 | -</Row> |
951 | - |
952 | -<Row ss:AutoFitHeight="0" ss:Height="27.75" ss:StyleID="s29"> |
953 | -<Cell ss:StyleID="s30"> |
954 | -<Data ss:Type="String">${_('Date')}</Data> |
955 | -</Cell> |
956 | -<Cell ss:StyleID="s31"> |
957 | -<Data ss:Type="String">${_('Analytic Journal')}</Data> |
958 | -</Cell> |
959 | -<Cell ss:StyleID="s31"> |
960 | -<Data ss:Type="String">${_('Sequence number')}</Data> |
961 | -</Cell> |
962 | -<Cell ss:StyleID="s31"> |
963 | -<Data ss:Type="String">${_('Description')}</Data> |
964 | -</Cell> |
965 | -<Cell ss:StyleID="s31"> |
966 | -<Data ss:Type="String">${_('Reference')}</Data> |
967 | -</Cell> |
968 | -<Cell ss:StyleID="s31"> |
969 | -<Data ss:Type="String">${_('Financing contract line code')}</Data> |
970 | -</Cell> |
971 | -<Cell ss:StyleID="s31"> |
972 | -<Data ss:Type="String">${_('Financing contract line description')}</Data> |
973 | -</Cell> |
974 | -<Cell ss:StyleID="s31"> |
975 | -<Data ss:Type="String">${_('Third Party')}</Data> |
976 | -</Cell> |
977 | -<Cell ss:StyleID="s31"> |
978 | -<Data ss:Type="String">${_('General Account')}</Data> |
979 | -</Cell> |
980 | -<Cell ss:StyleID="s31"> |
981 | -<Data ss:Type="String">${_('Destination')}</Data> |
982 | -</Cell> |
983 | -<Cell ss:StyleID="s31"> |
984 | -<Data ss:Type="String">${_('Cost Center')}</Data> |
985 | -</Cell> |
986 | -<Cell ss:StyleID="s31"> |
987 | -<Data ss:Type="String">${_('Funding Pool')}</Data> |
988 | -</Cell> |
989 | -<Cell ss:StyleID="s31"> |
990 | -<Data ss:Type="String">${_('Booking Amount')}</Data> |
991 | -</Cell> |
992 | -<Cell ss:StyleID="s31"> |
993 | -<Data ss:Type="String">${_('Booking Currency')}</Data> |
994 | -</Cell> |
995 | -<Cell ss:StyleID="s31"> |
996 | -<Data ss:Type="String">${_('Reporting Amount')}</Data> |
997 | -</Cell> |
998 | -<Cell ss:StyleID="s33"> |
999 | -<Data ss:Type="String">${_('Reporting Currency')}</Data> |
1000 | -</Cell> |
1001 | -</Row> |
1002 | + xmlns:o="urn:schemas-microsoft-com:office:office" |
1003 | + xmlns:x="urn:schemas-microsoft-com:office:excel" |
1004 | + xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" |
1005 | + xmlns:html="http://www.w3.org/TR/REC-html40"> |
1006 | + <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office"> |
1007 | + <Author>MSFUser</Author> |
1008 | + <LastAuthor>MSFUser</LastAuthor> |
1009 | + <Created>2012-06-18T15:46:09Z</Created> |
1010 | + <Company>Medecins Sans Frontieres</Company> |
1011 | + <Version>11.9999</Version> |
1012 | + </DocumentProperties> |
1013 | + <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel"> |
1014 | + <WindowHeight>13170</WindowHeight> |
1015 | + <WindowWidth>19020</WindowWidth> |
1016 | + <WindowTopX>120</WindowTopX> |
1017 | + <WindowTopY>60</WindowTopY> |
1018 | + <ProtectStructure>False</ProtectStructure> |
1019 | + <ProtectWindows>False</ProtectWindows> |
1020 | + </ExcelWorkbook> |
1021 | + |
1022 | + |
1023 | + <Styles> |
1024 | + <Style ss:ID="Default" ss:Name="Normal"> |
1025 | + <Alignment ss:Vertical="Bottom"/> |
1026 | + <Borders/> |
1027 | + <Font/> |
1028 | + <Interior/> |
1029 | + <NumberFormat/> |
1030 | + <Protection/> |
1031 | + </Style> |
1032 | + |
1033 | + <Style ss:ID="s21"> |
1034 | + <Borders> |
1035 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
1036 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
1037 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
1038 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
1039 | + </Borders> |
1040 | + </Style> |
1041 | + |
1042 | + <Style ss:ID="s21a"> |
1043 | + <Borders> |
1044 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
1045 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1" /> |
1046 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1" /> |
1047 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
1048 | + </Borders> |
1049 | + <Font ss:Bold="1"/> |
1050 | + </Style> |
1051 | + |
1052 | + <Style ss:ID="s22"> |
1053 | + <Borders> |
1054 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
1055 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
1056 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
1057 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
1058 | + </Borders> |
1059 | + <Interior ss:Pattern="Solid"/> |
1060 | + </Style> |
1061 | + <Style ss:ID="s23"> |
1062 | + <Borders> |
1063 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
1064 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
1065 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
1066 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
1067 | + </Borders> |
1068 | + <NumberFormat ss:Format="General Date"/> |
1069 | + </Style> |
1070 | + <Style ss:ID="s24"> |
1071 | + <Borders> |
1072 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
1073 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
1074 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
1075 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
1076 | + </Borders> |
1077 | + <Interior ss:Pattern="Solid"/> |
1078 | + <NumberFormat ss:Format="#,##0"/> |
1079 | + </Style> |
1080 | + <Style ss:ID="s25"> |
1081 | + <Borders> |
1082 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
1083 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
1084 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
1085 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
1086 | + </Borders> |
1087 | + <NumberFormat ss:Format="Short Date"/> |
1088 | + </Style> |
1089 | + <Style ss:ID="s26"> |
1090 | + <Borders> |
1091 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
1092 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
1093 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
1094 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
1095 | + </Borders> |
1096 | + <Interior ss:Pattern="Solid"/> |
1097 | + </Style> |
1098 | + <Style ss:ID="s27"> |
1099 | + <Interior ss:Pattern="Solid"/> |
1100 | + <NumberFormat ss:Format="Short Date"/> |
1101 | + </Style> |
1102 | + <Style ss:ID="s29"> |
1103 | + <Alignment ss:Vertical="Center" ss:WrapText="1"/> |
1104 | + </Style> |
1105 | + <Style ss:ID="s30"> |
1106 | + <Alignment ss:Vertical="Center" ss:WrapText="1"/> |
1107 | + <Borders> |
1108 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="2"/> |
1109 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="2"/> |
1110 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
1111 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="2"/> |
1112 | + </Borders> |
1113 | + <Font x:Family="Swiss" ss:Color="#FFFFFF" ss:Bold="1"/> |
1114 | + <Interior ss:Color="#FF0000" ss:Pattern="Solid"/> |
1115 | + </Style> |
1116 | + <Style ss:ID="s31"> |
1117 | + <Alignment ss:Vertical="Center" ss:WrapText="1"/> |
1118 | + <Borders> |
1119 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="2"/> |
1120 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
1121 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
1122 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="2"/> |
1123 | + </Borders> |
1124 | + <Font x:Family="Swiss" ss:Color="#FFFFFF" ss:Bold="1"/> |
1125 | + <Interior ss:Color="#FF0000" ss:Pattern="Solid"/> |
1126 | + </Style> |
1127 | + <Style ss:ID="s32"> |
1128 | + <Alignment ss:Vertical="Center" ss:WrapText="1"/> |
1129 | + <Borders> |
1130 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="2"/> |
1131 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
1132 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
1133 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="2"/> |
1134 | + </Borders> |
1135 | + <Font x:Family="Swiss" ss:Bold="1"/> |
1136 | + <Interior ss:Pattern="Solid"/> |
1137 | + </Style> |
1138 | + <Style ss:ID="s33"> |
1139 | + <Alignment ss:Vertical="Center" ss:WrapText="1"/> |
1140 | + <Borders> |
1141 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="2"/> |
1142 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
1143 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="2"/> |
1144 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="2"/> |
1145 | + </Borders> |
1146 | + <Font x:Family="Swiss" ss:Color="#FFFFFF" ss:Bold="1"/> |
1147 | + <Interior ss:Color="#FF0000" ss:Pattern="Solid"/> |
1148 | + </Style> |
1149 | + <Style ss:ID="s34"> |
1150 | + <Alignment ss:Vertical="Center" ss:WrapText="1"/> |
1151 | + <Interior ss:Color="#FF0000" ss:Pattern="Solid"/> |
1152 | + </Style> |
1153 | + <Style ss:ID="s35"> |
1154 | + <Borders> |
1155 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
1156 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="2"/> |
1157 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
1158 | + </Borders> |
1159 | + <NumberFormat ss:Format="Short Date"/> |
1160 | + </Style> |
1161 | + <Style ss:ID="s36"> |
1162 | + <Borders> |
1163 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
1164 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
1165 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
1166 | + </Borders> |
1167 | + </Style> |
1168 | + <Style ss:ID="s36b"> |
1169 | + <Borders> |
1170 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
1171 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
1172 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="2"/> |
1173 | + </Borders> |
1174 | + </Style> |
1175 | + <Style ss:ID="s37"> |
1176 | + <Borders> |
1177 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
1178 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
1179 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
1180 | + </Borders> |
1181 | + <Interior ss:Pattern="Solid"/> |
1182 | + </Style> |
1183 | + <Style ss:ID="s38"> |
1184 | + <Borders> |
1185 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
1186 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
1187 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
1188 | + </Borders> |
1189 | + <NumberFormat ss:Format="Standard"/> |
1190 | + </Style> |
1191 | + <Style ss:ID="s39"> |
1192 | + <Borders> |
1193 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
1194 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
1195 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
1196 | + </Borders> |
1197 | + <NumberFormat ss:Format="Standard"/> |
1198 | + </Style> |
1199 | + <Style ss:ID="s39b"> |
1200 | + <Borders> |
1201 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
1202 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
1203 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="2"/> |
1204 | + </Borders> |
1205 | + </Style> |
1206 | + <Style ss:ID="s40"> |
1207 | + <Interior ss:Color="#FF0000" ss:Pattern="Solid"/> |
1208 | + </Style> |
1209 | + <Style ss:ID="s41"> |
1210 | + <Borders> |
1211 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
1212 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="2"/> |
1213 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
1214 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
1215 | + </Borders> |
1216 | + <NumberFormat ss:Format="Short Date"/> |
1217 | + </Style> |
1218 | + <Style ss:ID="s42"> |
1219 | + <Borders> |
1220 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
1221 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
1222 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
1223 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
1224 | + </Borders> |
1225 | + <NumberFormat ss:Format="Standard"/> |
1226 | + </Style> |
1227 | + <Style ss:ID="s43"> |
1228 | + <Borders> |
1229 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
1230 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
1231 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="2"/> |
1232 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
1233 | + </Borders> |
1234 | + </Style> |
1235 | + <Style ss:ID="s44"> |
1236 | + <Borders> |
1237 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="2"/> |
1238 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="2"/> |
1239 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
1240 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
1241 | + </Borders> |
1242 | + <NumberFormat ss:Format="Short Date"/> |
1243 | + </Style> |
1244 | + <Style ss:ID="s45"> |
1245 | + <Borders> |
1246 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="2"/> |
1247 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
1248 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
1249 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
1250 | + </Borders> |
1251 | + </Style> |
1252 | + <Style ss:ID="s46"> |
1253 | + <Borders> |
1254 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="2"/> |
1255 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
1256 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
1257 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
1258 | + </Borders> |
1259 | + <Interior ss:Pattern="Solid"/> |
1260 | + </Style> |
1261 | + <Style ss:ID="s47"> |
1262 | + <Borders> |
1263 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="2"/> |
1264 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
1265 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
1266 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
1267 | + </Borders> |
1268 | + <NumberFormat ss:Format="Standard"/> |
1269 | + </Style> |
1270 | + <Style ss:ID="s48"> |
1271 | + <Borders> |
1272 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="2"/> |
1273 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
1274 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="2"/> |
1275 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
1276 | + </Borders> |
1277 | + </Style> |
1278 | + |
1279 | + <Style ss:ID="s49"> |
1280 | + <Borders> |
1281 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="2"/> |
1282 | + </Borders> |
1283 | + <Font x:Family="Swiss" ss:Bold="1"/> |
1284 | + <NumberFormat ss:Format="Standard"/> |
1285 | + </Style> |
1286 | + |
1287 | + <Style ss:ID="s49a"> |
1288 | + <Borders> |
1289 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
1290 | + </Borders> |
1291 | + <Font x:Family="Swiss" ss:Bold="1"/> |
1292 | + <NumberFormat ss:Format="Standard"/> |
1293 | + </Style> |
1294 | + |
1295 | + <Style ss:ID="s50"> |
1296 | + <Font x:Family="Swiss" ss:Bold="1"/> |
1297 | + </Style> |
1298 | + <Style ss:ID="s51"> |
1299 | + <Font x:Family="Swiss" ss:Color="#FF0000" ss:Italic="1"/> |
1300 | + </Style> |
1301 | + <Style ss:ID="s52"> |
1302 | + <NumberFormat ss:Format="Short Date"/> |
1303 | + </Style> |
1304 | + <Style ss:ID="s53"> |
1305 | + <Font ss:Color="#FF0000"/> |
1306 | + <Interior ss:Pattern="Solid"/> |
1307 | + </Style> |
1308 | + |
1309 | + <Style ss:ID="short_date2"> |
1310 | + <Alignment ss:Horizontal="Center" ss:Vertical="Center" ss:WrapText="1"/> |
1311 | + <NumberFormat ss:Format="Short Date"/> |
1312 | + </Style> |
1313 | + |
1314 | + <Style ss:ID="short_date_head"> |
1315 | + <Borders> |
1316 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
1317 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
1318 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
1319 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
1320 | + </Borders> |
1321 | + <Alignment ss:Horizontal="Center" ss:Vertical="Center" ss:WrapText="1"/> |
1322 | + <NumberFormat ss:Format="Short Date"/> |
1323 | + </Style> |
1324 | + |
1325 | + <Style ss:ID="short_date_color"> |
1326 | + <Alignment ss:Horizontal="Center" ss:Vertical="Center" ss:WrapText="1"/> |
1327 | + <NumberFormat ss:Format="Short Date"/> |
1328 | + <Interior ss:Pattern="Solid"/> |
1329 | + <Borders> |
1330 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
1331 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
1332 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
1333 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
1334 | + </Borders> |
1335 | + </Style> |
1336 | + </Styles> |
1337 | + |
1338 | + % for o in objects: |
1339 | + <Worksheet ss:Name="${"%s"%( o.code and o.code.replace('/', '_') +'_'+str(o.id) or 'Sheet1')|x}"> |
1340 | + |
1341 | + <Table x:FullColumns="1" x:FullRows="1"> |
1342 | + <Column ss:AutoFitWidth="0" ss:Width="102.75"/> |
1343 | + <Column ss:AutoFitWidth="0" ss:Width="92.25"/> |
1344 | + <Column ss:AutoFitWidth="0" ss:Width="87.75"/> |
1345 | + <Column ss:AutoFitWidth="0" ss:Width="239.25"/> |
1346 | + <Column ss:AutoFitWidth="0" ss:Width="186.75" ss:Span="1"/> |
1347 | + <Column ss:Index="7" ss:AutoFitWidth="0" ss:Width="121.5"/> |
1348 | + <Column ss:AutoFitWidth="0" ss:Width="66.75"/> |
1349 | + <Column ss:AutoFitWidth="0" ss:Width="103.5"/> |
1350 | + <Column ss:AutoFitWidth="0" ss:Width="137.25"/> |
1351 | + <Column ss:Index="13" ss:AutoFitWidth="0" ss:Width="57.75"/> |
1352 | + <Column ss:AutoFitWidth="0" ss:Width="62.25"/> |
1353 | + <Row> |
1354 | + <Cell ss:StyleID="s21a"> |
1355 | + <Data ss:Type="String">${_('FINANCIAL REPORT for financing contract')}</Data> |
1356 | + </Cell> |
1357 | + <Cell ss:StyleID="s21"/> |
1358 | + </Row> |
1359 | + <Row> |
1360 | + <Cell ss:StyleID="s22"> |
1361 | + <Data ss:Type="String">${_('Report date:')}</Data> |
1362 | + </Cell> |
1363 | + <Cell ss:StyleID="short_date_head"> |
1364 | + <Data ss:Type="DateTime">${time.strftime('%Y-%m-%d')|n}T00:00:00.000</Data> |
1365 | + </Cell> |
1366 | + </Row> |
1367 | + <Row ss:Index="4"> |
1368 | + <Cell ss:StyleID="s21"> |
1369 | + <Data ss:Type="String">${_('Donor:')}</Data> |
1370 | + </Cell> |
1371 | + <Cell ss:StyleID="s21"> |
1372 | + <Data ss:Type="String">${( o.donor_id and o.donor_id.name or '')|x}</Data> |
1373 | + </Cell> |
1374 | + </Row> |
1375 | + |
1376 | + <Row> |
1377 | + <Cell ss:StyleID="s21"> |
1378 | + <Data ss:Type="String">${_('Financing contract name:')}</Data> |
1379 | + </Cell> |
1380 | + <Cell ss:StyleID="s21"> |
1381 | + <Data ss:Type="String">${( o.name or '')|x}</Data> |
1382 | + </Cell> |
1383 | + </Row> |
1384 | + <Row> |
1385 | + <Cell ss:StyleID="s21"> |
1386 | + <Data ss:Type="String">${_('Financing contract code:')}</Data> |
1387 | + </Cell> |
1388 | + <Cell ss:StyleID="s21"> |
1389 | + <Data ss:Type="String">${( o.code or '')|x}</Data> |
1390 | + </Cell> |
1391 | + </Row> |
1392 | + <Row> |
1393 | + <Cell ss:StyleID="s21"> |
1394 | + <Data ss:Type="String">${_('Grant amount:')}</Data> |
1395 | + </Cell> |
1396 | + <Cell ss:StyleID="s24"> |
1397 | + <Data ss:Type="Number">${( o.grant_amount or '')|x}</Data> |
1398 | + </Cell> |
1399 | + </Row> |
1400 | + |
1401 | + <Row> |
1402 | + <Cell ss:StyleID="s21"> |
1403 | + <Data ss:Type="String">${_('Reporting currency:')}</Data> |
1404 | + </Cell> |
1405 | + <Cell ss:StyleID="s21"> |
1406 | + <Data ss:Type="String">${( o.reporting_currency and o.reporting_currency.name or '')|x}</Data> |
1407 | + </Cell> |
1408 | + </Row> |
1409 | + |
1410 | + <Row> |
1411 | + <Cell ss:StyleID="s21"> |
1412 | + <Data ss:Type="String">${_('Eligible from:')}</Data> |
1413 | + </Cell> |
1414 | + <Cell ss:StyleID="short_date_head"> |
1415 | + <Data ss:Type="DateTime">${ o.eligibility_from_date or '' |n}T00:00:00.000</Data> |
1416 | + </Cell> |
1417 | + <Cell ss:StyleID="s26"> |
1418 | + <Data ss:Type="String">${_('to:')}</Data> |
1419 | + </Cell> |
1420 | + <Cell ss:StyleID="short_date_color"> |
1421 | + <Data ss:Type="DateTime">${ o.eligibility_to_date |n}T00:00:00.000</Data> |
1422 | + </Cell> |
1423 | + <Cell /> |
1424 | + <Cell /> |
1425 | + </Row> |
1426 | + |
1427 | + <Row ss:Index="11"> |
1428 | + <Cell ss:StyleID="s21"> |
1429 | + <Data ss:Type="String">${_('Reporting type:')}</Data> |
1430 | + </Cell> |
1431 | + <Cell ss:StyleID="s21"> |
1432 | + <Data ss:Type="String">${( o.reporting_type and getSel(o, 'reporting_type') or '')|x}</Data> |
1433 | + |
1434 | + </Cell> |
1435 | + </Row> |
1436 | + <Row> |
1437 | + <Cell ss:StyleID="s21"> |
1438 | + <Data ss:Type="String">${_('Cost centers:')}</Data> |
1439 | + </Cell> |
1440 | + <Cell ss:StyleID="s21"> |
1441 | + <Data ss:Type="String">${( getCostCenter(o) or '')|x}</Data> |
1442 | + </Cell> |
1443 | + </Row> |
1444 | + |
1445 | + <Row> |
1446 | + </Row> |
1447 | + |
1448 | + <Row ss:AutoFitHeight="0" ss:Height="27.75" ss:StyleID="s29"> |
1449 | + <Cell ss:StyleID="s30"> |
1450 | + <Data ss:Type="String">${_('Date')}</Data> |
1451 | + </Cell> |
1452 | + <Cell ss:StyleID="s31"> |
1453 | + <Data ss:Type="String">${_('Analytic Journal')}</Data> |
1454 | + </Cell> |
1455 | + <Cell ss:StyleID="s31"> |
1456 | + <Data ss:Type="String">${_('Sequence number')}</Data> |
1457 | + </Cell> |
1458 | + <Cell ss:StyleID="s31"> |
1459 | + <Data ss:Type="String">${_('Description')}</Data> |
1460 | + </Cell> |
1461 | + <Cell ss:StyleID="s31"> |
1462 | + <Data ss:Type="String">${_('Reference')}</Data> |
1463 | + </Cell> |
1464 | + <Cell ss:StyleID="s31"> |
1465 | + <Data ss:Type="String">${_('Financing contract line code')}</Data> |
1466 | + </Cell> |
1467 | + <Cell ss:StyleID="s31"> |
1468 | + <Data ss:Type="String">${_('Financing contract line description')}</Data> |
1469 | + </Cell> |
1470 | + <Cell ss:StyleID="s31"> |
1471 | + <Data ss:Type="String">${_('Third Party')}</Data> |
1472 | + </Cell> |
1473 | + <Cell ss:StyleID="s31"> |
1474 | + <Data ss:Type="String">${_('General Account')}</Data> |
1475 | + </Cell> |
1476 | + <Cell ss:StyleID="s31"> |
1477 | + <Data ss:Type="String">${_('Destination')}</Data> |
1478 | + </Cell> |
1479 | + <Cell ss:StyleID="s31"> |
1480 | + <Data ss:Type="String">${_('Cost Center')}</Data> |
1481 | + </Cell> |
1482 | + <Cell ss:StyleID="s31"> |
1483 | + <Data ss:Type="String">${_('Funding Pool')}</Data> |
1484 | + </Cell> |
1485 | + <Cell ss:StyleID="s31"> |
1486 | + <Data ss:Type="String">${_('Booking Amount')}</Data> |
1487 | + </Cell> |
1488 | + <Cell ss:StyleID="s31"> |
1489 | + <Data ss:Type="String">${_('Booking Currency')}</Data> |
1490 | + </Cell> |
1491 | + <Cell ss:StyleID="s31"> |
1492 | + <Data ss:Type="String">${_('Reporting Amount')}</Data> |
1493 | + </Cell> |
1494 | + <Cell ss:StyleID="s33"> |
1495 | + <Data ss:Type="String">${_('Reporting Currency')}</Data> |
1496 | + </Cell> |
1497 | + </Row> |
1498 | |
1499 | <!-- UF-2150: Sort lines by code --> |
1500 | % for code in sorted(getLines(o)): |
1501 | % for line in getLines2()[code]: |
1502 | |
1503 | <Row> |
1504 | -<Cell ss:StyleID="s35"> |
1505 | -<Data ss:Type="DateTime">${ line[0] and line[0].date |n}T00:00:00.000</Data> |
1506 | -</Cell> |
1507 | -<Cell ss:StyleID="s36"> |
1508 | -<Data ss:Type="String">${( line[0] and line[0].journal_id and line[0].journal_id.name or '')|x}</Data> |
1509 | -</Cell> |
1510 | -<Cell ss:StyleID="s36"> |
1511 | -<Data ss:Type="String">${( line[0] and line[0].move_id and line[0].move_id.move_id and line[0].move_id.move_id.name or '')|x}</Data> |
1512 | -</Cell> |
1513 | -<Cell ss:StyleID="s36"> |
1514 | -<Data ss:Type="String">${( line[0] and line[0].name or '')|x}</Data> |
1515 | -</Cell> |
1516 | -<Cell ss:StyleID="s36"> |
1517 | -<Data ss:Type="String">${( line[0] and line[0].ref or '')|x}</Data> |
1518 | -</Cell> |
1519 | -<Cell ss:StyleID="s36"> |
1520 | -<Data ss:Type="String">${( line[1] or '')|x}</Data> |
1521 | -</Cell> |
1522 | -<Cell ss:StyleID="s36"> |
1523 | -<Data ss:Type="String">${( line[2] or '')|x}</Data> |
1524 | -</Cell> |
1525 | -<Cell ss:StyleID="s36"> |
1526 | -<Data ss:Type="String">${( line[0] and line[0].partner_txt or '')|x}</Data> |
1527 | -</Cell> |
1528 | -<Cell ss:StyleID="s36"> |
1529 | -<Data ss:Type="String">${( getAccountName(line[0]) or '')|x}</Data> |
1530 | -</Cell> |
1531 | -<Cell ss:StyleID="s36"> |
1532 | -<Data ss:Type="String">${( line[0] and line[0].destination_id and line[0].destination_id.name or '')|x}</Data> |
1533 | -</Cell> |
1534 | -<Cell ss:StyleID="s36"> |
1535 | -<Data ss:Type="String">${( line[0] and line[0].cost_center_id and line[0].cost_center_id.name or '')|x}</Data> |
1536 | -</Cell> |
1537 | -<Cell ss:StyleID="s36"> |
1538 | -<Data ss:Type="String">${( line[0] and line[0].account_id and line[0].account_id.name or '')|x}</Data> |
1539 | -</Cell> |
1540 | -<Cell ss:StyleID="s38"> |
1541 | -<Data ss:Type="Number">${( line[0] and line[0].amount_currency or '')|x}</Data> |
1542 | -</Cell> |
1543 | -<Cell ss:StyleID="s36"> |
1544 | -<Data ss:Type="String">${( line[0] and line[0].currency_id and line[0].currency_id.name or '')|x}</Data> |
1545 | -</Cell> |
1546 | -<Cell ss:StyleID="s38"> |
1547 | -<Data ss:Type="Number">${( getBookAm(o,line[0]) or '')|x}</Data> |
1548 | -</Cell> |
1549 | -<Cell ss:StyleID="s39"> |
1550 | -<Data ss:Type="String">${( o.reporting_currency and o.reporting_currency.name or '')|x}</Data> |
1551 | -</Cell> |
1552 | -</Row> |
1553 | -% endfor |
1554 | - |
1555 | -<Row> |
1556 | -<Cell ss:StyleID="s35"><Data ss:Type="String"></Data></Cell> |
1557 | -<Cell ss:StyleID="s36"><Data ss:Type="String"></Data></Cell> |
1558 | -<Cell ss:StyleID="s36"><Data ss:Type="String"></Data></Cell> |
1559 | -<Cell ss:StyleID="s36"><Data ss:Type="String"></Data></Cell> |
1560 | -<Cell ss:StyleID="s36"><Data ss:Type="String"></Data></Cell> |
1561 | -<Cell ss:StyleID="s36"><Data ss:Type="String"></Data></Cell> |
1562 | -<Cell ss:StyleID="s36"><Data ss:Type="String"></Data></Cell> |
1563 | -<Cell ss:StyleID="s36"><Data ss:Type="String"></Data></Cell> |
1564 | -<Cell ss:StyleID="s36"><Data ss:Type="String"></Data></Cell> |
1565 | -<Cell ss:StyleID="s36"><Data ss:Type="String"></Data></Cell> |
1566 | -<Cell ss:StyleID="s36"><Data ss:Type="String"></Data></Cell> |
1567 | -<Cell ss:StyleID="s36"><Data ss:Type="String"></Data></Cell> |
1568 | -<Cell ss:StyleID="s49a"><Data ss:Type="String">${_('Sub-total')}</Data></Cell> |
1569 | -<Cell ss:StyleID="s49a" ss:Formula="=SUM(R[-${getSub2()}]C:R[-1]C)"> |
1570 | -<Data ss:Type="Number"></Data> |
1571 | -</Cell> |
1572 | - |
1573 | -<Cell ss:StyleID="s39"><Data ss:Type="String"></Data></Cell> |
1574 | -</Row> |
1575 | - |
1576 | -% endfor |
1577 | - |
1578 | -<Row> |
1579 | -<Cell ss:StyleID="s49"></Cell> |
1580 | -<Cell ss:StyleID="s49"></Cell> |
1581 | -<Cell ss:StyleID="s49"></Cell> |
1582 | -<Cell ss:StyleID="s49"></Cell> |
1583 | -<Cell ss:StyleID="s49"></Cell> |
1584 | -<Cell ss:StyleID="s49"></Cell> |
1585 | -<Cell ss:StyleID="s49"></Cell> |
1586 | -<Cell ss:StyleID="s49"></Cell> |
1587 | -<Cell ss:StyleID="s49"></Cell> |
1588 | -<Cell ss:StyleID="s49"></Cell> |
1589 | -<Cell ss:StyleID="s49"> |
1590 | -<Data ss:Type="String">${_('Total')}</Data> |
1591 | -</Cell> |
1592 | -<Cell ss:StyleID="s49"> |
1593 | -</Cell> |
1594 | -<Cell ss:StyleID="s49"></Cell> |
1595 | -<Cell ss:StyleID="s49"> |
1596 | -<Data ss:Type="Number">${getTotalRptCurrency()}</Data> |
1597 | -</Cell> |
1598 | -<Cell ss:StyleID="s49"></Cell> |
1599 | -</Row> |
1600 | -<Row> |
1601 | -<Cell ss:Index="5" ss:StyleID="s51"> |
1602 | -<Data ss:Type="String"></Data> |
1603 | -</Cell> |
1604 | -</Row> |
1605 | -<Row> |
1606 | -<Cell> |
1607 | - |
1608 | -<Data ss:Type="String">${_('Open date:')}</Data> |
1609 | -</Cell> |
1610 | -% if isDate(o.open_date): |
1611 | - <Cell ss:StyleID="short_date2"> |
1612 | - <Data ss:Type="DateTime">${ o.open_date or '' |n}T00:00:00.000</Data> |
1613 | - </Cell> |
1614 | -% else: |
1615 | - <Cell > |
1616 | - <Data ss:Type="String"></Data> |
1617 | - </Cell> |
1618 | -% endif |
1619 | -</Row> |
1620 | - |
1621 | -<Row> |
1622 | -<Cell> |
1623 | -<Data ss:Type="String">${_('Soft-closed date:')}</Data> |
1624 | -</Cell> |
1625 | - |
1626 | -% if isDate(o.soft_closed_date): |
1627 | - <Cell ss:StyleID="short_date2"> |
1628 | - <Data ss:Type="DateTime">${ o.soft_closed_date or '' |n}T00:00:00.000</Data> |
1629 | - </Cell> |
1630 | -% endif |
1631 | -</Row> |
1632 | - |
1633 | -<Row> |
1634 | -<Cell> |
1635 | -<Data ss:Type="String">${_('Hard-closed date:')}</Data> |
1636 | -</Cell> |
1637 | - |
1638 | -% if isDate(o.hard_closed_date): |
1639 | - <Cell ss:StyleID="short_date2"> |
1640 | - <Data ss:Type="DateTime">${ o.hard_closed_date or '' |n}T00:00:00.000</Data> |
1641 | - </Cell> |
1642 | -% endif |
1643 | - |
1644 | -</Row> |
1645 | -<Row> |
1646 | -<Cell> |
1647 | -<Data ss:Type="String">${_('State:')}</Data> |
1648 | -</Cell> |
1649 | -<Cell> |
1650 | -<Data ss:Type="String">${( o.state and getSel(o, 'state') or '')|x}</Data> |
1651 | -</Cell> |
1652 | + <Cell ss:StyleID="s35"> |
1653 | + <Data ss:Type="DateTime">${ line[0] and line[0].date |n}T00:00:00.000</Data> |
1654 | + </Cell> |
1655 | + <Cell ss:StyleID="s36"> |
1656 | + <Data ss:Type="String">${( line[0] and line[0].journal_id and line[0].journal_id.name or '')|x}</Data> |
1657 | + </Cell> |
1658 | + <Cell ss:StyleID="s36"> |
1659 | + <Data ss:Type="String">${( line[0] and line[0].move_id and line[0].move_id.move_id and line[0].move_id.move_id.name or '')|x}</Data> |
1660 | + </Cell> |
1661 | + <Cell ss:StyleID="s36"> |
1662 | + <Data ss:Type="String">${( line[0] and line[0].name or '')|x}</Data> |
1663 | + </Cell> |
1664 | + <Cell ss:StyleID="s36"> |
1665 | + <Data ss:Type="String">${( line[0] and line[0].ref or '')|x}</Data> |
1666 | + </Cell> |
1667 | + <Cell ss:StyleID="s36"> |
1668 | + <Data ss:Type="String">${( line[1] or '')|x}</Data> |
1669 | + </Cell> |
1670 | + <Cell ss:StyleID="s36"> |
1671 | + <Data ss:Type="String">${( line[2] or '')|x}</Data> |
1672 | + </Cell> |
1673 | + <Cell ss:StyleID="s36"> |
1674 | + <Data ss:Type="String">${( line[0] and line[0].partner_txt or '')|x}</Data> |
1675 | + </Cell> |
1676 | + <Cell ss:StyleID="s36"> |
1677 | + <Data ss:Type="String">${( getAccountName(line[0]) or '')|x}</Data> |
1678 | + </Cell> |
1679 | + <Cell ss:StyleID="s36"> |
1680 | + <Data ss:Type="String">${( line[0] and line[0].destination_id and line[0].destination_id.name or '')|x}</Data> |
1681 | + </Cell> |
1682 | + <Cell ss:StyleID="s36"> |
1683 | + <Data ss:Type="String">${( line[0] and line[0].cost_center_id and line[0].cost_center_id.name or '')|x}</Data> |
1684 | + </Cell> |
1685 | + <Cell ss:StyleID="s36"> |
1686 | + <Data ss:Type="String">${( line[0] and line[0].account_id and line[0].account_id.name or '')|x}</Data> |
1687 | + </Cell> |
1688 | + <Cell ss:StyleID="s38"> |
1689 | + <Data ss:Type="Number">${( line[0] and line[0].amount_currency or '')|x}</Data> |
1690 | + </Cell> |
1691 | + <Cell ss:StyleID="s36"> |
1692 | + <Data ss:Type="String">${( line[0] and line[0].currency_id and line[0].currency_id.name or '')|x}</Data> |
1693 | + </Cell> |
1694 | + <Cell ss:StyleID="s38"> |
1695 | + <Data ss:Type="Number">${( getBookAm(o,line[0]) or '')|x}</Data> |
1696 | + </Cell> |
1697 | + <Cell ss:StyleID="s36b"> |
1698 | + <Data ss:Type="String">${( o.reporting_currency and o.reporting_currency.name or '')|x}</Data> |
1699 | + </Cell> |
1700 | +</Row> |
1701 | +% endfor |
1702 | +<Row> |
1703 | + <Cell ss:StyleID="s35"><Data ss:Type="String"></Data></Cell> |
1704 | + <Cell ss:StyleID="s36"><Data ss:Type="String"></Data></Cell> |
1705 | + <Cell ss:StyleID="s36"><Data ss:Type="String"></Data></Cell> |
1706 | + <Cell ss:StyleID="s36"><Data ss:Type="String"></Data></Cell> |
1707 | + <Cell ss:StyleID="s36"><Data ss:Type="String"></Data></Cell> |
1708 | + <Cell ss:StyleID="s36"><Data ss:Type="String"></Data></Cell> |
1709 | + <Cell ss:StyleID="s36"><Data ss:Type="String"></Data></Cell> |
1710 | + <Cell ss:StyleID="s36"><Data ss:Type="String"></Data></Cell> |
1711 | + <Cell ss:StyleID="s36"><Data ss:Type="String"></Data></Cell> |
1712 | + <Cell ss:StyleID="s36"><Data ss:Type="String"></Data></Cell> |
1713 | + <Cell ss:StyleID="s36"><Data ss:Type="String"></Data></Cell> |
1714 | + <Cell ss:StyleID="s36"><Data ss:Type="String"></Data></Cell> |
1715 | + <Cell ss:StyleID="s36"><Data ss:Type="String"></Data></Cell> |
1716 | + <Cell ss:StyleID="s36"><Data ss:Type="String">${_('Sub-total')}</Data></Cell> |
1717 | + <Cell ss:StyleID="s39" ss:Formula="=SUM(R[-${getSub2()}]C:R[-1]C)"><Data ss:Type="Number"></Data></Cell> |
1718 | + <Cell ss:StyleID="s39b"><Data ss:Type="String"></Data></Cell> |
1719 | +</Row> |
1720 | +% endfor |
1721 | +<Row> |
1722 | + <Cell ss:StyleID="s49"></Cell> |
1723 | + <Cell ss:StyleID="s49"></Cell> |
1724 | + <Cell ss:StyleID="s49"></Cell> |
1725 | + <Cell ss:StyleID="s49"></Cell> |
1726 | + <Cell ss:StyleID="s49"></Cell> |
1727 | + <Cell ss:StyleID="s49"></Cell> |
1728 | + <Cell ss:StyleID="s49"></Cell> |
1729 | + <Cell ss:StyleID="s49"></Cell> |
1730 | + <Cell ss:StyleID="s49"></Cell> |
1731 | + <Cell ss:StyleID="s49"></Cell> |
1732 | + <Cell ss:StyleID="s49"></Cell> |
1733 | + <Cell ss:StyleID="s49"> |
1734 | + <Data ss:Type="String">${_('Total')}</Data> |
1735 | + </Cell> |
1736 | + <Cell ss:StyleID="s49"> |
1737 | + </Cell> |
1738 | + <Cell ss:StyleID="s49"></Cell> |
1739 | + <Cell ss:StyleID="s49"> |
1740 | + <Data ss:Type="Number">${getTotalRptCurrency()}</Data> |
1741 | + </Cell> |
1742 | + <Cell ss:StyleID="s49"></Cell> |
1743 | +</Row> |
1744 | +<Row> |
1745 | + <Cell ss:Index="5" ss:StyleID="s51"> |
1746 | + <Data ss:Type="String"></Data> |
1747 | + </Cell> |
1748 | +</Row> |
1749 | +<Row> |
1750 | + <Cell> |
1751 | + <Data ss:Type="String">${_('Open date:')}</Data> |
1752 | + </Cell> |
1753 | + % if isDate(o.open_date): |
1754 | + <Cell ss:StyleID="short_date2"> |
1755 | + <Data ss:Type="DateTime">${ o.open_date or '' |n}T00:00:00.000</Data> |
1756 | + </Cell> |
1757 | + % else: |
1758 | + <Cell > |
1759 | + <Data ss:Type="String"></Data> |
1760 | + </Cell> |
1761 | + % endif |
1762 | +</Row> |
1763 | +<Row> |
1764 | + <Cell> |
1765 | + <Data ss:Type="String">${_('Soft-closed date:')}</Data> |
1766 | + </Cell> |
1767 | + |
1768 | + % if isDate(o.soft_closed_date): |
1769 | + <Cell ss:StyleID="short_date2"> |
1770 | + <Data ss:Type="DateTime">${ o.soft_closed_date or '' |n}T00:00:00.000</Data> |
1771 | + </Cell> |
1772 | + % endif |
1773 | +</Row> |
1774 | +<Row> |
1775 | + <Cell> |
1776 | + <Data ss:Type="String">${_('Hard-closed date:')}</Data> |
1777 | + </Cell> |
1778 | + |
1779 | + % if isDate(o.hard_closed_date): |
1780 | + <Cell ss:StyleID="short_date2"> |
1781 | + <Data ss:Type="DateTime">${ o.hard_closed_date or '' |n}T00:00:00.000</Data> |
1782 | + </Cell> |
1783 | + % endif |
1784 | +</Row> |
1785 | +<Row> |
1786 | + <Cell> |
1787 | + <Data ss:Type="String">${_('State:')}</Data> |
1788 | + </Cell> |
1789 | + <Cell> |
1790 | + <Data ss:Type="String">${( o.state and getSel(o, 'state') or '')|x}</Data> |
1791 | + </Cell> |
1792 | </Row> |
1793 | </Table> |
1794 | </Worksheet> |
1795 | % endfor |
1796 | - |
1797 | </Workbook> |
1798 | |
1799 | === modified file 'financing_contract/report/report_project_expenses.py' |
1800 | --- financing_contract/report/report_project_expenses.py 2014-09-11 07:40:34 +0000 |
1801 | +++ financing_contract/report/report_project_expenses.py 2014-11-07 10:49:09 +0000 |
1802 | @@ -95,10 +95,13 @@ |
1803 | return temp |
1804 | |
1805 | def getSub2(self,): |
1806 | - temp = self.len2 |
1807 | + """ |
1808 | + len2 gives the number of previous line for a given CC. |
1809 | + Return number of lines then intialize to 0 |
1810 | + """ |
1811 | + res = self.len2 |
1812 | self.len2 = 0 |
1813 | - return temp |
1814 | - |
1815 | + return res |
1816 | |
1817 | def getBookAm(self,contract,analytic_line): |
1818 | date_context = {'date': analytic_line.document_date,'currency_table_id': contract.currency_table_id and contract.currency_table_id.id or None} |
1819 | |
1820 | === modified file 'msf_budget/report/report_local_expenses.py' |
1821 | --- msf_budget/report/report_local_expenses.py 2014-03-31 10:15:07 +0000 |
1822 | +++ msf_budget/report/report_local_expenses.py 2014-11-07 10:49:09 +0000 |
1823 | @@ -116,8 +116,11 @@ |
1824 | parent_view_id = pool.get('account.account').search(cr, uid, [('parent_id', '=', False)]) |
1825 | for expense_account in pool.get('account.account').browse(cr, uid, expenses.keys(), context=context): |
1826 | expense_values = expenses[expense_account.id][month_start - 1:month_stop] |
1827 | + if expense_account.type != 'view': |
1828 | + total_amount += sum(expense_values) |
1829 | + total_line = [sum(pair) for pair in zip(expense_values, total_line)] |
1830 | # add line to result (code, name)... |
1831 | - if expense_account.type == 'view' or data['form']['granularity'] == 'all': |
1832 | + if expense_account.type == 'view' or data['form']['granularity'] == 'all': # Add all view lines and only expenses one if user asked for it (granularity == 'by account' |
1833 | # search if this account have a parent view that is not "parent_view_id" |
1834 | is_under_the_big_one = False |
1835 | if expense_account.parent_id and expense_account.parent_id.id in parent_view_id: |
1836 | @@ -132,10 +135,6 @@ |
1837 | line += [int(round(sum(expense_values)))] |
1838 | # append to result |
1839 | result_data.append(line) |
1840 | - if expense_account.type != 'view' or data['form']['granularity'] != 'all': |
1841 | - # add to the total |
1842 | - total_line = [sum(pair) for pair in zip(expense_values, total_line)] |
1843 | - total_amount += sum(expense_values) |
1844 | # Format total |
1845 | total_line = [_('Total'), ''] + map(int, map(round, total_line)) + [int(round(total_amount))] |
1846 | |
1847 | |
1848 | === modified file 'msf_chart_of_account/data/journal_data.xml' |
1849 | --- msf_chart_of_account/data/journal_data.xml 2013-12-16 16:30:03 +0000 |
1850 | +++ msf_chart_of_account/data/journal_data.xml 2014-11-07 10:49:09 +0000 |
1851 | @@ -166,6 +166,7 @@ |
1852 | <field name="default_debit_account_id" ref="msf_chart_of_account.3001" /> |
1853 | <field name="default_credit_account_id" ref="msf_chart_of_account.3001" /> |
1854 | <field name="analytic_journal_id" ref="cheque_analytic_journal"/> |
1855 | + <field name="bank_journal_id" ref="bank_chf_journal"/> |
1856 | </record> |
1857 | |
1858 | <record id="cheque_euro_journal" model="account.journal"> |
1859 | @@ -176,6 +177,7 @@ |
1860 | <field name="default_debit_account_id" ref="msf_chart_of_account.3001" /> |
1861 | <field name="default_credit_account_id" ref="msf_chart_of_account.3001" /> |
1862 | <field name="analytic_journal_id" ref="cheque_analytic_journal"/> |
1863 | + <field name="bank_journal_id" ref="bank_euro_journal"/> |
1864 | </record> |
1865 | |
1866 | <record id="account_journal.engagement_journal" model="account.analytic.journal"> |
1867 | |
1868 | === modified file 'msf_instance/wizard/account_analytic_chart.py' |
1869 | --- msf_instance/wizard/account_analytic_chart.py 2013-10-07 07:13:44 +0000 |
1870 | +++ msf_instance/wizard/account_analytic_chart.py 2014-11-07 10:49:09 +0000 |
1871 | @@ -30,17 +30,17 @@ |
1872 | 'instance_ids': fields.many2many('msf.instance', 'account_chart_instance_rel', 'wizard_id', 'instance_id', 'Instance'), |
1873 | } |
1874 | |
1875 | -def account_chart_open_window(self, cr, uid, ids, context=None): |
1876 | - """ |
1877 | - Add instance_ids information to only display analytic journal items linked to the given instance |
1878 | - """ |
1879 | - result = super(account_analytic_chart, self).account_chart_open_window(cr, uid, ids, context=context) |
1880 | - data = self.read(cr, uid, ids, ['instance_ids'], context=context)[0] |
1881 | - if data['instance_ids']: |
1882 | - context = eval(result['context']) |
1883 | - context.update({'instance_ids': data['instance_ids']}) |
1884 | - result['context'] = unicode(context) |
1885 | - return result |
1886 | + def analytic_account_chart_open_window(self, cr, uid, ids, context=None): |
1887 | + """ |
1888 | + Add instance_ids information to only display analytic journal items linked to the given instance |
1889 | + """ |
1890 | + result = super(account_analytic_chart, self).analytic_account_chart_open_window(cr, uid, ids, context=context) |
1891 | + data = self.read(cr, uid, ids, ['instance_ids'], context=context)[0] |
1892 | + if data['instance_ids']: |
1893 | + context = eval(result['context']) |
1894 | + context.update({'instance_ids': data['instance_ids']}) |
1895 | + result['context'] = unicode(context) |
1896 | + return result |
1897 | |
1898 | account_analytic_chart() |
1899 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
1900 | |
1901 | === modified file 'register_accounting/account_bank_statement.py' |
1902 | --- register_accounting/account_bank_statement.py 2014-10-20 12:05:32 +0000 |
1903 | +++ register_accounting/account_bank_statement.py 2014-11-07 10:49:09 +0000 |
1904 | @@ -663,7 +663,7 @@ |
1905 | _name = "account.bank.statement.line" |
1906 | _inherit = "account.bank.statement.line" |
1907 | |
1908 | - _order = 'sequence_for_reference desc, document_date asc' |
1909 | + _order = 'sequence_for_reference desc, document_date desc' |
1910 | |
1911 | def _get_state(self, cr, uid, ids, field_name=None, arg=None, context=None): |
1912 | """ |
1913 | @@ -984,7 +984,7 @@ |
1914 | aml_obj = self.pool.get('account.move.line') |
1915 | for absl in self.browse(cr, uid, ids, context=context): |
1916 | # UTP-1055: In case of Cash Advance register line, we don't need to see all other advance lines allocation (analytic lines). So we keep only analytic lines with the same "name" than register line |
1917 | - aal_ids = self.pool.get('account.analytic.line').search(cr, uid, [('move_id.move_id', 'in', self._get_move_ids(cr, uid, [absl.id], context=context)), ('account_id.category', '=', 'FUNDING'), ('name', 'ilike', '%%%s' % absl.name)]) |
1918 | + aal_ids = self.pool.get('account.analytic.line').search(cr, uid, [('move_id.move_id', 'in', self._get_move_ids(cr, uid, [absl.id], context=context)), ('account_id.category', '=', 'FUNDING'), ('name', '=ilike', '%%%s' % absl.name)]) |
1919 | # Then retrieve all corrections/reversals from them |
1920 | res[absl.id] = aal_obj.get_corrections_history(cr, uid, aal_ids, context=context) |
1921 | return res |
1922 | @@ -1088,7 +1088,7 @@ |
1923 | if name_len > 1: |
1924 | domain += ['|' for x in range(0,name_len - 1)] |
1925 | for name in advance_names: |
1926 | - domain.append(('name', 'ilike', '%%%s' % name)) |
1927 | + domain.append(('name', '=ilike', '%%%s' % name)) |
1928 | context.update({'display_fp': True}) # to display "Funding Pool" column name instead of "Analytic account" |
1929 | return { |
1930 | 'name': _('Analytic Journal Items'), |
1931 | @@ -2074,7 +2074,8 @@ |
1932 | # statement line |
1933 | # Optimization on write() for this field |
1934 | self.write(cr, uid, [absl.id], {'direct_state': 'hard'}, context=context) |
1935 | - # invoice |
1936 | + # invoice. UFTP-312: in case we develop some changes next, we update context to inform we come from hard post |
1937 | + context.update({'from_hard_post': True}) |
1938 | self.pool.get('account.invoice').write(cr, uid, [absl.invoice_id.id], {'state':'paid'}, context=context) |
1939 | # reconcile lines |
1940 | self.pool.get('account.invoice').action_reconcile_direct_invoice(cr, uid, absl.invoice_id, context=context) |
1941 | |
1942 | === modified file 'register_accounting/account_invoice_view.xml' |
1943 | --- register_accounting/account_invoice_view.xml 2014-09-03 08:21:43 +0000 |
1944 | +++ register_accounting/account_invoice_view.xml 2014-11-07 10:49:09 +0000 |
1945 | @@ -311,8 +311,9 @@ |
1946 | <button name="invoice_open" states="draft,proforma2" type="object" string="Validate" icon="gtk-go-forward"/> |
1947 | </button> |
1948 | |
1949 | + <!-- Take care of attrs redefinition that omit the "states" one. So we need to add readonly with state to avoid this bug --> |
1950 | <xpath expr="/form//button[@name='button_reset_taxes']" position="attributes"> |
1951 | - <attribute name="attrs">{'invisible': [('vat_ok', '=', False)]}</attribute> |
1952 | + <attribute name="attrs">{'invisible': [('vat_ok', '=', False)], 'readonly': [('state', '!=', 'draft')]}</attribute> |
1953 | </xpath> |
1954 | </data> |
1955 | </field> |
1956 | @@ -367,8 +368,9 @@ |
1957 | <attribute name="attrs">{'invisible': [('vat_ok', '=', False)]}</attribute> |
1958 | </xpath> |
1959 | |
1960 | + <!-- Take care of attrs redefinition that omit the "states" one. So we need to add readonly with state to avoid this bug --> |
1961 | <xpath expr="/form//button[@name='button_reset_taxes']" position="attributes"> |
1962 | - <attribute name="attrs">{'invisible': [('vat_ok', '=', False)]}</attribute> |
1963 | + <attribute name="attrs">{'invisible': [('vat_ok', '=', False)], 'readonly': [('state', '!=', 'draft')]}</attribute> |
1964 | </xpath> |
1965 | </data> |
1966 | </field> |
1967 | |
1968 | === modified file 'register_accounting/account_view.xml' |
1969 | --- register_accounting/account_view.xml 2014-11-03 10:52:51 +0000 |
1970 | +++ register_accounting/account_view.xml 2014-11-07 10:49:09 +0000 |
1971 | @@ -52,7 +52,7 @@ |
1972 | <notebook colspan="4"> |
1973 | <page string="Transaction" name="statement_line_ids"> |
1974 | <field colspan="4" name="line_ids" nolabel="1"> |
1975 | - <tree editable="bottom" string="Statement lines" noteditable="state=='hard' or direct_invoice is True" colors="red:(display_analytic_button and (not analytic_distribution_id or analytic_distribution_state == 'invalid')) or (type_for_register == 'transfer' and transfer_amount == 0.0 and state in ('draft', 'temp')) or red_on_supplier == True"> |
1976 | + <tree editable="bottom" string="Statement lines" noteditable="state=='hard' or direct_invoice is True" colors="red:(display_analytic_button and (not analytic_distribution_id or analytic_distribution_state == 'invalid')) or (type_for_register == 'transfer' and transfer_amount == 0.0 and state in ('draft', 'temp')) or red_on_supplier == True" limit="20"> |
1977 | <field name="transfer_amount" invisible="1"/> |
1978 | <field name="red_on_supplier" invisible="1"/> |
1979 | <button name="button_duplicate" string="Duplicate" type="object" icon="gtk-copy" /> |
1980 | @@ -195,7 +195,7 @@ |
1981 | <notebook colspan="4"> |
1982 | <page string="Cash Transactions" attrs="{'invisible': [('state','=','draft')]}"> |
1983 | <field colspan="4" name="line_ids" nolabel="1"> |
1984 | - <tree editable="bottom" string="Statement lines" noteditable="state=='hard' or direct_invoice is True" colors="red:(display_analytic_button and (not analytic_distribution_id or analytic_distribution_state == 'invalid')) or (type_for_register == 'transfer' and transfer_amount == 0.0 and state in ('draft', 'temp')) or red_on_supplier == True"> |
1985 | + <tree editable="bottom" string="Statement lines" noteditable="state=='hard' or direct_invoice is True" colors="red:(display_analytic_button and (not analytic_distribution_id or analytic_distribution_state == 'invalid')) or (type_for_register == 'transfer' and transfer_amount == 0.0 and state in ('draft', 'temp')) or red_on_supplier == True" limit="20"> |
1986 | <field name="transfer_amount" invisible="1"/> |
1987 | <button name="button_duplicate" string="Duplicate" type="object" icon="gtk-copy" /> |
1988 | <button name="button_analytic_lines" string="Analytic lines" type="object" icon="terp-stock_zoom" /> |
1989 | @@ -688,7 +688,7 @@ |
1990 | <page string="Transaction" name="statement_line_ids"> |
1991 | <field colspan="4" name="line_ids" nolabel="1"> |
1992 | <!-- WARNING: because of UTP-331, in cheque register direct invoice lines should be editable but ONLY for cheque_number FIELD. That's why ALL field must be not editable when "direct_invoice" is True. --> |
1993 | - <tree editable="bottom" string="Statement lines" noteditable="state=='hard'" colors="red:(display_analytic_button and (not analytic_distribution_id or analytic_distribution_state == 'invalid')) or (type_for_register == 'transfer' and transfer_amount == 0.0 and state in ('draft', 'temp')) or red_on_supplier == True"> |
1994 | + <tree editable="bottom" string="Statement lines" noteditable="state=='hard'" colors="red:(display_analytic_button and (not analytic_distribution_id or analytic_distribution_state == 'invalid')) or (type_for_register == 'transfer' and transfer_amount == 0.0 and state in ('draft', 'temp')) or red_on_supplier == True" limit="20"> |
1995 | <field name="transfer_amount" invisible="1"/> |
1996 | <button name="button_duplicate" string="Duplicate" type="object" icon="gtk-copy" /> |
1997 | <button name="button_analytic_lines" string="Analytic lines" type="object" icon="terp-stock_zoom" /> |
1998 | |
1999 | === modified file 'register_accounting/invoice.py' |
2000 | --- register_accounting/invoice.py 2014-10-20 14:20:28 +0000 |
2001 | +++ register_accounting/invoice.py 2014-11-07 10:49:09 +0000 |
2002 | @@ -337,7 +337,7 @@ |
2003 | aml_obj.write(cr, uid, move_line.id, {'reference': reference}, context=context) |
2004 | aal_ids = aal_obj.search(cr, uid, [('move_id','=',move_line.id)], context=context) |
2005 | aal_obj.write(cr, uid, aal_ids, {'reference': reference}, context=context) |
2006 | - |
2007 | + return True |
2008 | |
2009 | def action_open_invoice(self, cr, uid, ids, context=None, *args): |
2010 | """ |
2011 | @@ -375,5 +375,39 @@ |
2012 | return {'type': 'ir.actions.act_window_close'} |
2013 | return True |
2014 | |
2015 | + def write(self, cr, uid, ids, vals, context=None): |
2016 | + """ |
2017 | + Check that all register lines are updated if this invoice is a direct invoice. |
2018 | + """ |
2019 | + if not context: |
2020 | + context = {} |
2021 | + if isinstance(ids, (int, long)): |
2022 | + ids = [ids] |
2023 | + res = super(account_invoice, self).write(cr, uid, ids, vals, context=context) |
2024 | + # UFTP-312: Update register line after any changes on the direct invoice |
2025 | + authorized_list_for_update = ['ref', 'account_id', 'partner_id', 'document_date', 'amount_out'] |
2026 | + do_changes = False |
2027 | + for field in authorized_list_for_update: |
2028 | + if field in vals and vals.get(field, False): |
2029 | + do_changes = True |
2030 | + break |
2031 | + if do_changes: |
2032 | + absl_obj = self.pool.get('account.bank.statement.line') |
2033 | + for inv in self.read(cr, uid, ids, ['is_direct_invoice', 'reference', 'account_id', 'partner_id', 'document_date', 'invoice_amount', 'check_total', 'st_lines'], context=context): |
2034 | + if inv.get('is_direct_invoice', False): |
2035 | + # search the statement line |
2036 | + if inv.get('st_lines', False): |
2037 | + # update it with some values: reference, document date, account and partner |
2038 | + vals = { |
2039 | + 'ref': inv.get('reference', ''), |
2040 | + 'account_id': inv.get('account_id', False) and inv.get('account_id')[0] or False, |
2041 | + 'partner_id': inv.get('partner_id', False) and inv.get('partner_id')[0] or False, |
2042 | + 'document_date': inv.get('document_date', False), |
2043 | + 'amount_out': inv.get('check_total', False), |
2044 | + } |
2045 | + # add specific context to avoid problem from |
2046 | + absl_obj.write(cr, uid, inv.get('st_lines'), vals, context=context) |
2047 | + return res |
2048 | + |
2049 | account_invoice() |
2050 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
2051 | |
2052 | === modified file 'register_accounting/report/fully_report_xls.mako' |
2053 | --- register_accounting/report/fully_report_xls.mako 2014-10-02 11:42:20 +0000 |
2054 | +++ register_accounting/report/fully_report_xls.mako 2014-11-07 10:49:09 +0000 |
2055 | @@ -564,9 +564,6 @@ |
2056 | <Data ss:Type="String">${hasattr(inv_line, 'line_number') and inv_line.line_number or ''|x}</Data> |
2057 | </Cell> |
2058 | <Cell ss:StyleID="left"> |
2059 | - <Data ss:Type="String">${hasattr(inv_line, 'product_id') and inv_line.product_id.name or ''|x}</Data> |
2060 | - </Cell> |
2061 | - <Cell ss:StyleID="left"> |
2062 | <Data ss:Type="String">${inv_line.name or ''|x}</Data> |
2063 | </Cell> |
2064 | <Cell ss:StyleID="left"> |