Merge lp:~vauxoo/openerp-venezuela-localization/ovl70-fb-rev3-kty into lp:openerp-venezuela-localization
- ovl70-fb-rev3-kty
- Merge into trunk
Proposed by
Katherine Zaoral (Vauxoo)
Status: | Merged |
---|---|
Merged at revision: | 855 |
Proposed branch: | lp:~vauxoo/openerp-venezuela-localization/ovl70-fb-rev3-kty |
Merge into: | lp:openerp-venezuela-localization |
Diff against target: |
736 lines (+194/-202) 4 files modified
l10n_ve_fiscal_book/model/fiscal_book.py (+182/-192) l10n_ve_fiscal_book/model/invoice.py (+8/-7) l10n_ve_fiscal_book/wizard/fiscal_book_wizard.py (+2/-2) l10n_ve_fiscal_book/workflow/fb_workflow.xml (+2/-1) |
To merge this branch: | bzr merge lp:~vauxoo/openerp-venezuela-localization/ovl70-fb-rev3-kty |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
hbto [Vauxoo] http://www.vauxoo.com | Approve | ||
Review via email: mp+167392@code.launchpad.net |
Commit message
Description of the change
[MERGE] module fiscal book fixes and improvements.
[IMP] Add an exception when trying to delete a fiscal book that is not in cancel state.
[FIX] bad condition in the raise of an exception.
[IMP] when cancel a fiscal book it would clear the book lines and associated data (invoices, taxes, summary, taxes, book amount fields).
[FIX] duplicate fiscal book taxes entries. Delete no needed the update_book_taxes() method and related inner methods.
Now the book taxes are only added one, with all the correct information at the link_book_
To post a comment you must log in.
Revision history for this message
hbto [Vauxoo] http://www.vauxoo.com (humbertoarocha) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'l10n_ve_fiscal_book/model/fiscal_book.py' | |||
2 | --- l10n_ve_fiscal_book/model/fiscal_book.py 2013-05-30 21:21:57 +0000 | |||
3 | +++ l10n_ve_fiscal_book/model/fiscal_book.py 2013-06-04 20:15:34 +0000 | |||
4 | @@ -200,8 +200,8 @@ | |||
5 | 200 | string='Status', required=True), | 200 | string='Status', required=True), |
6 | 201 | 'type': fields.selection([('sale', 'Sale Book'), | 201 | 'type': fields.selection([('sale', 'Sale Book'), |
7 | 202 | ('purchase', 'Purchase Book')], | 202 | ('purchase', 'Purchase Book')], |
10 | 203 | help='Select Sale for Customers and Purchase \ | 203 | help="Select Sale for Customers and" \ |
11 | 204 | for Suppliers', | 204 | " Purchase for Suppliers", |
12 | 205 | string='Book Type', required=True), | 205 | string='Book Type', required=True), |
13 | 206 | 'base_amount': fields.float('Taxable Amount', | 206 | 'base_amount': fields.float('Taxable Amount', |
14 | 207 | help='Amount used as Taxing Base'), | 207 | help='Amount used as Taxing Base'), |
15 | @@ -214,20 +214,20 @@ | |||
16 | 214 | 'fbts_ids': fields.one2many('fiscal.book.taxes.summary', 'fb_id', | 214 | 'fbts_ids': fields.one2many('fiscal.book.taxes.summary', 'fb_id', |
17 | 215 | 'Tax Summary'), | 215 | 'Tax Summary'), |
18 | 216 | 'invoice_ids': fields.one2many('account.invoice', 'fb_id', 'Invoices', | 216 | 'invoice_ids': fields.one2many('account.invoice', 'fb_id', 'Invoices', |
21 | 217 | help='Invoices being recorded in a \ | 217 | help="Invoices being recorded in a" \ |
22 | 218 | Fiscal Book'), | 218 | " Fiscal Book"), |
23 | 219 | 'issue_invoice_ids': fields.one2many('account.invoice', 'issue_fb_id', | 219 | 'issue_invoice_ids': fields.one2many('account.invoice', 'issue_fb_id', |
24 | 220 | 'Issue Invoices', | 220 | 'Issue Invoices', |
27 | 221 | help='Invoices that are in \ | 221 | help="Invoices that are in" \ |
28 | 222 | pending state. Cancel or Draft'), | 222 | " pending state cancel or draft"), |
29 | 223 | 'iwdl_ids': fields.one2many('account.wh.iva.line', 'fb_id', | 223 | 'iwdl_ids': fields.one2many('account.wh.iva.line', 'fb_id', |
30 | 224 | 'Vat Withholdings', | 224 | 'Vat Withholdings', |
33 | 225 | help='Vat Withholdings being recorded in \ | 225 | help="Vat Withholdings being recorded" \ |
34 | 226 | a Fiscal Book'), | 226 | " in a Fiscal Book"), |
35 | 227 | 'abl_ids': fields.one2many('adjustment.book.line', 'fb_id', | 227 | 'abl_ids': fields.one2many('adjustment.book.line', 'fb_id', |
36 | 228 | 'Adjustment Lines', | 228 | 'Adjustment Lines', |
39 | 229 | help='Adjustment Lines being recorded in \ | 229 | help="Adjustment Lines being recorded in " \ |
40 | 230 | a Fiscal Book'), | 230 | " a Fiscal Book"), |
41 | 231 | 'note': fields.text('Note'), | 231 | 'note': fields.text('Note'), |
42 | 232 | 'article_number': fields.selection( | 232 | 'article_number': fields.selection( |
43 | 233 | _get_article_number_types, | 233 | _get_article_number_types, |
44 | @@ -235,13 +235,13 @@ | |||
45 | 235 | required=True, | 235 | required=True, |
46 | 236 | help="Article number describing the fiscal book special features" \ | 236 | help="Article number describing the fiscal book special features" \ |
47 | 237 | " according to the Venezuelan RLIVA statement for fiscal" \ | 237 | " according to the Venezuelan RLIVA statement for fiscal" \ |
55 | 238 | " accounting books. Options:" | 238 | " accounting books. Options:" \ |
56 | 239 | " - Art. 75: Pruchase Book." | 239 | " - Art. 75: Pruchase Book." \ |
57 | 240 | " - Art. 76: Sale Book. Reflects every individual operation datail." | 240 | " - Art. 76: Sale Book. Reflects every individual operation datail." \ |
58 | 241 | " - Art. 77: Sale Book. Groups no tax payer operations in one " | 241 | " - Art. 77: Sale Book. Groups no tax payer operations in one " \ |
59 | 242 | " consolidated line. Only fiscal billing." | 242 | " consolidated line. Only fiscal billing." \ |
60 | 243 | " - Art. 78: Sale Book. Hybrid for 76 and 77 article. Show" | 243 | " - Art. 78: Sale Book. Hybrid for 76 and 77 article. Show" \ |
61 | 244 | " automatic and mechanized operations in individual way, and " | 244 | " automatic and mechanized operations in individual way, and " \ |
62 | 245 | " groups fiscal billing operationss in one consolidated line." ), | 245 | " groups fiscal billing operationss in one consolidated line." ), |
63 | 246 | 246 | ||
64 | 247 | #~ Withholding fields | 247 | #~ Withholding fields |
65 | @@ -249,10 +249,10 @@ | |||
66 | 249 | _get_wh, | 249 | _get_wh, |
67 | 250 | type="float", method=True, store=True, multi="get_wh", | 250 | type="float", method=True, store=True, multi="get_wh", |
68 | 251 | string="Current Period Withholding", | 251 | string="Current Period Withholding", |
73 | 252 | help="Used at \ | 252 | help="Used at" \ |
74 | 253 | 1. Totalization row in Fiscal Book Line block at Withholding VAT \ | 253 | " 1. Totalization row in Fiscal Book Line block at Withholding" \ |
75 | 254 | Column \ | 254 | " VAT Column" \ |
76 | 255 | 2. Second row at the Withholding Summary block"), | 255 | " 2. Second row at the Withholding Summary block"), |
77 | 256 | 'get_previous_wh_sum': fields.function( | 256 | 'get_previous_wh_sum': fields.function( |
78 | 257 | _get_wh, | 257 | _get_wh, |
79 | 258 | type="float", method=True, store=True, multi="get_wh", | 258 | type="float", method=True, store=True, multi="get_wh", |
80 | @@ -267,8 +267,8 @@ | |||
81 | 267 | _get_wh, | 267 | _get_wh, |
82 | 268 | type="float", method=True, store=True, multi="get_wh", | 268 | type="float", method=True, store=True, multi="get_wh", |
83 | 269 | string="Based Tax Debit Sum", | 269 | string="Based Tax Debit Sum", |
86 | 270 | help="Totalization row in Fiscal Book Line block at \ | 270 | help="Totalization row in Fiscal Book Line block at" \ |
87 | 271 | Based Tax Debit Column"), | 271 | " Based Tax Debit Column"), |
88 | 272 | 272 | ||
89 | 273 | #~ Printable report data | 273 | #~ Printable report data |
90 | 274 | 'get_partner_addr': fields.function( | 274 | 'get_partner_addr': fields.function( |
91 | @@ -286,22 +286,22 @@ | |||
92 | 286 | type="float", method=True, store=True, | 286 | type="float", method=True, store=True, |
93 | 287 | multi="get_total_with_iva", | 287 | multi="get_total_with_iva", |
94 | 288 | string='Total amount with VAT', | 288 | string='Total amount with VAT', |
97 | 289 | help="Total with VAT Sum (Import/Export, Domestic, Tax Payer and \ | 289 | help="Total with VAT Sum (Import/Export, Domestic, Tax Payer and" \ |
98 | 290 | No Tax Payer"), | 290 | " No Tax Payer"), |
99 | 291 | 'get_vat_sdcf_sum': fields.function( | 291 | 'get_vat_sdcf_sum': fields.function( |
100 | 292 | _get_vat_sdcf_sum, | 292 | _get_vat_sdcf_sum, |
101 | 293 | type="float", method=True, store=True, | 293 | type="float", method=True, store=True, |
102 | 294 | string="Exempt and SDCF Tax Sum", | 294 | string="Exempt and SDCF Tax Sum", |
105 | 295 | help="Exempt and Non entitled to tax credit totalization. Sum of SDCF and Exempt Tax Totalization columns for all \ | 295 | help="Exempt and Non entitled to tax credit totalization. Sum of" \ |
106 | 296 | transaction types"), | 296 | " SDCF and Exempt Tax Totalization columns for all transaction" \ |
107 | 297 | " types"), | ||
108 | 297 | 'get_total_tax_credit_debit_base_sum': fields.function( | 298 | 'get_total_tax_credit_debit_base_sum': fields.function( |
109 | 298 | _get_total_tax_credit_debit, | 299 | _get_total_tax_credit_debit, |
110 | 299 | type="float", method=True, store=True, | 300 | type="float", method=True, store=True, |
111 | 300 | multi="get_total_tax_credit_debit", | 301 | multi="get_total_tax_credit_debit", |
112 | 301 | string="Tax Credit Total Base Amount", | 302 | string="Tax Credit Total Base Amount", |
116 | 302 | help="Uses at \ | 303 | help="Uses at 1. purchase: total row at summary taxes." \ |
117 | 303 | 1. purchase: total row at summary taxes.\ | 304 | " 2. sales: row at summary taxes."), |
115 | 304 | 2. sales: row at summary taxes."), | ||
118 | 305 | 'get_total_tax_credit_debit_tax_sum': fields.function( | 305 | 'get_total_tax_credit_debit_tax_sum': fields.function( |
119 | 306 | _get_total_tax_credit_debit, | 306 | _get_total_tax_credit_debit, |
120 | 307 | type="float", method=True, store=True, | 307 | type="float", method=True, store=True, |
121 | @@ -310,9 +310,9 @@ | |||
122 | 310 | 'do_sdcf_and_exempt_sum': fields.float( | 310 | 'do_sdcf_and_exempt_sum': fields.float( |
123 | 311 | digits_compute=dp.get_precision('Account'), | 311 | digits_compute=dp.get_precision('Account'), |
124 | 312 | string="Domestic Untaxed VAT Sum", | 312 | string="Domestic Untaxed VAT Sum", |
128 | 313 | help="SDCF and Exempt sum for domestict transanctions. " | 313 | help="SDCF and Exempt sum for domestict transanctions." \ |
129 | 314 | "At Sale book represent the sum of Tax Payer and No Tax payer" | 314 | " At Sale book represent the sum of Tax Payer and No Tax payer" \ |
130 | 315 | "transactions."), | 315 | " transactions."), |
131 | 316 | 316 | ||
132 | 317 | #~ Totalization fields for international transactions | 317 | #~ Totalization fields for international transactions |
133 | 318 | 'get_total_with_iva_imex_sum': fields.function( | 318 | 'get_total_with_iva_imex_sum': fields.function( |
134 | @@ -324,48 +324,49 @@ | |||
135 | 324 | 'imex_vat_base_sum': fields.float( | 324 | 'imex_vat_base_sum': fields.float( |
136 | 325 | digits_compute=dp.get_precision('Account'), | 325 | digits_compute=dp.get_precision('Account'), |
137 | 326 | string="International Taxable Amount", | 326 | string="International Taxable Amount", |
141 | 327 | help="Sum of International Tax Base Amounts (reduced, general and" | 327 | help="Sum of International Tax Base Amounts (reduced, general" \ |
142 | 328 | " additional). Used at 2nd row in thw Sale book's summary with " | 328 | " and additional). Used at 2nd row in thw Sale book's summary" \ |
143 | 329 | "Exportation Sales title"), | 329 | " with Exportation Sales title"), |
144 | 330 | 'imex_exempt_vat_sum': fields.float( | 330 | 'imex_exempt_vat_sum': fields.float( |
145 | 331 | digits_compute=dp.get_precision('Account'), | 331 | digits_compute=dp.get_precision('Account'), |
146 | 332 | string="Exempt Tax", | 332 | string="Exempt Tax", |
148 | 333 | help="Import/Export Exempt Tax Totalization: Sum of Exempt column for international transactions"), | 333 | help="Import/Export Exempt Tax Totalization: Sum of Exempt" \ |
149 | 334 | " column for international transactions"), | ||
150 | 334 | 'imex_sdcf_vat_sum': fields.float( | 335 | 'imex_sdcf_vat_sum': fields.float( |
151 | 335 | digits_compute=dp.get_precision('Account'), | 336 | digits_compute=dp.get_precision('Account'), |
152 | 336 | string="SDCF Tax", | 337 | string="SDCF Tax", |
155 | 337 | help="Import/Export SDCF Tax Totalization: Sum of SDCF column for \ | 338 | help="Import/Export SDCF Tax Totalization: Sum of SDCF column" \ |
156 | 338 | international transactions"), | 339 | " for international transactions"), |
157 | 339 | 'imex_general_vat_base_sum': fields.float( | 340 | 'imex_general_vat_base_sum': fields.float( |
158 | 340 | digits_compute=dp.get_precision('Account'), | 341 | digits_compute=dp.get_precision('Account'), |
159 | 341 | string="General VAT Taxable Amount", | 342 | string="General VAT Taxable Amount", |
162 | 342 | help="General VAT Taxed Imports/Exports Base Amount. Sum of \ | 343 | help="General VAT Taxed Imports/Exports Base Amount. Sum of" \ |
163 | 343 | General VAT Base column for international transactions"), | 344 | " General VAT Base column for international transactions"), |
164 | 344 | 'imex_general_vat_tax_sum': fields.float( | 345 | 'imex_general_vat_tax_sum': fields.float( |
165 | 345 | digits_compute=dp.get_precision('Account'), | 346 | digits_compute=dp.get_precision('Account'), |
166 | 346 | string="General VAT Taxed Amount", | 347 | string="General VAT Taxed Amount", |
169 | 347 | help="General VAT Taxed Imports/Exports Tax Amount. Sum of \ | 348 | help="General VAT Taxed Imports/Exports Tax Amount. Sum of" \ |
170 | 348 | General VAT Tax column for international transactions"), | 349 | " General VAT Tax column for international transactions"), |
171 | 349 | 'imex_additional_vat_base_sum': fields.float( | 350 | 'imex_additional_vat_base_sum': fields.float( |
172 | 350 | digits_compute=dp.get_precision('Account'), | 351 | digits_compute=dp.get_precision('Account'), |
173 | 351 | string="Additional VAT Taxable Amount", | 352 | string="Additional VAT Taxable Amount", |
176 | 352 | help="Additional VAT Taxed Imports/Exports Base Amount. Sum of \ | 353 | help="Additional VAT Taxed Imports/Exports Base Amount. Sum of" \ |
177 | 353 | Additional VAT Base column for international transactions"), | 354 | " Additional VAT Base column for international transactions"), |
178 | 354 | 'imex_additional_vat_tax_sum': fields.float( | 355 | 'imex_additional_vat_tax_sum': fields.float( |
179 | 355 | digits_compute=dp.get_precision('Account'), | 356 | digits_compute=dp.get_precision('Account'), |
180 | 356 | string="Additional VAT Taxed Amount", | 357 | string="Additional VAT Taxed Amount", |
183 | 357 | help="Additional VAT Taxed Imports/Exports Tax Amount. Sum of \ | 358 | help="Additional VAT Taxed Imports/Exports Tax Amount. Sum of " \ |
184 | 358 | Additional VAT Tax column for international transactions"), | 359 | " Additional VAT Tax column for international transactions"), |
185 | 359 | 'imex_reduced_vat_base_sum': fields.float( | 360 | 'imex_reduced_vat_base_sum': fields.float( |
186 | 360 | digits_compute=dp.get_precision('Account'), | 361 | digits_compute=dp.get_precision('Account'), |
187 | 361 | string="Reduced VAT Taxable Amount", | 362 | string="Reduced VAT Taxable Amount", |
190 | 362 | help="Reduced VAT Taxed Imports/Exports Base Amount. Sum of \ | 363 | help="Reduced VAT Taxed Imports/Exports Base Amount. Sum of " \ |
191 | 363 | Reduced VAT Base column for international transactions"), | 364 | " Reduced VAT Base column for international transactions"), |
192 | 364 | 'imex_reduced_vat_tax_sum': fields.float( | 365 | 'imex_reduced_vat_tax_sum': fields.float( |
193 | 365 | digits_compute=dp.get_precision('Account'), | 366 | digits_compute=dp.get_precision('Account'), |
194 | 366 | string="Reduced VAT Taxed Amount", | 367 | string="Reduced VAT Taxed Amount", |
197 | 367 | help="Reduced VAT Taxed Imports/Exports Tax Amount. Sum of \ | 368 | help="Reduced VAT Taxed Imports/Exports Tax Amount. Sum of " \ |
198 | 368 | Reduced VAT Tax column for international transactions"), | 369 | " Reduced VAT Tax column for international transactions"), |
199 | 369 | 370 | ||
200 | 370 | #~ Totalization fields for domestic transactions | 371 | #~ Totalization fields for domestic transactions |
201 | 371 | 'get_total_with_iva_do_sum': fields.function( | 372 | 'get_total_with_iva_do_sum': fields.function( |
202 | @@ -377,71 +378,71 @@ | |||
203 | 377 | 'do_vat_base_sum': fields.float( | 378 | 'do_vat_base_sum': fields.float( |
204 | 378 | digits_compute=dp.get_precision('Account'), | 379 | digits_compute=dp.get_precision('Account'), |
205 | 379 | string="Domestic Taxable Amount", | 380 | string="Domestic Taxable Amount", |
208 | 380 | help="Sum of all domestic transaction base amounts (reduced, \ | 381 | help="Sum of all domestic transaction base amounts (reduced," \ |
209 | 381 | general and additional)"), | 382 | " general and additional)"), |
210 | 382 | 'do_exempt_vat_sum': fields.float( | 383 | 'do_exempt_vat_sum': fields.float( |
211 | 383 | digits_compute=dp.get_precision('Account'), | 384 | digits_compute=dp.get_precision('Account'), |
212 | 384 | string="Exempt Tax", | 385 | string="Exempt Tax", |
216 | 385 | help="Domestic Exempt Tax Totalization. For Purchase Book it sums" | 386 | help="Domestic Exempt Tax Totalization. For Purchase Book it" \ |
217 | 386 | " Exempt column for domestic transactions. For Sale Book it sums" | 387 | " sums Exempt column for domestic transactions. For Sale Book it" \ |
218 | 387 | " Tax Payer and No Tax Payer Exempt columns"), | 388 | " sums Tax Payer and No Tax Payer Exempt columns"), |
219 | 388 | 'do_sdcf_vat_sum': fields.float( | 389 | 'do_sdcf_vat_sum': fields.float( |
220 | 389 | digits_compute=dp.get_precision('Account'), | 390 | digits_compute=dp.get_precision('Account'), |
221 | 390 | string="SDCF Tax", | 391 | string="SDCF Tax", |
224 | 391 | help="Domestic SDCF Tax Totalization. For Purchase Book it sums" | 392 | help="Domestic SDCF Tax Totalization. For Purchase Book it sums" \ |
225 | 392 | " SDCF column for domestic transactions. For Sale Book it sums" | 393 | " SDCF column for domestic transactions. For Sale Book it sums" \ |
226 | 393 | " Tax Payer and No Tax Payer SDCF columns"), | 394 | " Tax Payer and No Tax Payer SDCF columns"), |
227 | 394 | 'do_general_vat_base_sum': fields.float( | 395 | 'do_general_vat_base_sum': fields.float( |
228 | 395 | digits_compute=dp.get_precision('Account'), | 396 | digits_compute=dp.get_precision('Account'), |
229 | 396 | string="General VAT Taxable Amount", | 397 | string="General VAT Taxable Amount", |
233 | 397 | help="General VAT Taxed Domestic Base Amount Totalization. " \ | 398 | help="General VAT Taxed Domestic Base Amount Totalization." \ |
234 | 398 | "For Purchase Book it sums General VAT Base column for domestic" | 399 | " For Purchase Book it sums General VAT Base column for domestic" \ |
235 | 399 | " transactions. For Sale Book it sums Tax Payer and No Tax Payer" | 400 | " transactions. For Sale Book it sums Tax Payer and No Tax Payer" \ |
236 | 400 | " General VAT Base columns"), | 401 | " General VAT Base columns"), |
237 | 401 | 'do_general_vat_tax_sum': fields.float( | 402 | 'do_general_vat_tax_sum': fields.float( |
238 | 402 | digits_compute=dp.get_precision('Account'), | 403 | digits_compute=dp.get_precision('Account'), |
239 | 403 | string="General VAT Taxed Amount", | 404 | string="General VAT Taxed Amount", |
243 | 404 | help="General VAT Taxed Domestic Tax Amount Totalization. " \ | 405 | help="General VAT Taxed Domestic Tax Amount Totalization." \ |
244 | 405 | "For Purchase Book it sums General VAT Tax column for domestic" | 406 | " For Purchase Book it sums General VAT Tax column for domestic" \ |
245 | 406 | " transactions. For Sale Book it sums Tax Payer and No Tax Payer" | 407 | " transactions. For Sale Book it sums Tax Payer and No Tax Payer" \ |
246 | 407 | " General VAT Tax columns"), | 408 | " General VAT Tax columns"), |
247 | 408 | 'do_additional_vat_base_sum': fields.float( | 409 | 'do_additional_vat_base_sum': fields.float( |
248 | 409 | digits_compute=dp.get_precision('Account'), | 410 | digits_compute=dp.get_precision('Account'), |
249 | 410 | string="Additional VAT Taxable Amount", | 411 | string="Additional VAT Taxable Amount", |
254 | 411 | help="Additional VAT Taxed Domestic Base Amount Totalization." | 412 | help="Additional VAT Taxed Domestic Base Amount Totalization." \ |
255 | 412 | "For Purchase Book it sums Additional VAT Base column for domestic" | 413 | " For Purchase Book it sums Additional VAT Base column for" \ |
256 | 413 | " transactions. For Sale Book it sums Tax Payer and No Tax Payer" | 414 | " domestic transactions. For Sale Book it sums Tax Payer and No" \ |
257 | 414 | " Additional VAT Base columns"), | 415 | " Tax Payer Additional VAT Base columns"), |
258 | 415 | 'do_additional_vat_tax_sum': fields.float( | 416 | 'do_additional_vat_tax_sum': fields.float( |
259 | 416 | digits_compute=dp.get_precision('Account'), | 417 | digits_compute=dp.get_precision('Account'), |
260 | 417 | string="Additional VAT Taxed Amount", | 418 | string="Additional VAT Taxed Amount", |
265 | 418 | help="Additional VAT Taxed Domestic Tax Amount Totalization. " | 419 | help="Additional VAT Taxed Domestic Tax Amount Totalization." \ |
266 | 419 | "For Purchase Book it sums Additional VAT Tax column for domestic" | 420 | " For Purchase Book it sums Additional VAT Tax column for" \ |
267 | 420 | " transactions. For Sale Book it sums Tax Payer and No Tax Payer" | 421 | " domestic transactions. For Sale Book it sums Tax Payer and No" \ |
268 | 421 | " Additional VAT Tax columns"), | 422 | " Tax Payer Additional VAT Tax columns"), |
269 | 422 | 'do_reduced_vat_base_sum': fields.float( | 423 | 'do_reduced_vat_base_sum': fields.float( |
270 | 423 | digits_compute=dp.get_precision('Account'), | 424 | digits_compute=dp.get_precision('Account'), |
271 | 424 | string="Reduced VAT Taxable Amount", | 425 | string="Reduced VAT Taxable Amount", |
275 | 425 | help="Reduced VAT Taxed Domestic Base Amount Totalization. " | 426 | help="Reduced VAT Taxed Domestic Base Amount Totalization." \ |
276 | 426 | "For Purchase Book it sums Reduced VAT Base column for domestic" | 427 | " For Purchase Book it sums Reduced VAT Base column for domestic" \ |
277 | 427 | " transactions. For Sale Book it sums Tax Payer and No Tax Payer" | 428 | " transactions. For Sale Book it sums Tax Payer and No Tax Payer" \ |
278 | 428 | " Reduced VAT Base columns"), | 429 | " Reduced VAT Base columns"), |
279 | 429 | 'do_reduced_vat_tax_sum': fields.float( | 430 | 'do_reduced_vat_tax_sum': fields.float( |
280 | 430 | digits_compute=dp.get_precision('Account'), | 431 | digits_compute=dp.get_precision('Account'), |
281 | 431 | string="Reduced VAT Taxed Amount", | 432 | string="Reduced VAT Taxed Amount", |
285 | 432 | help="Reduced VAT Taxed Domestic Tax Amount Totalization. " | 433 | help="Reduced VAT Taxed Domestic Tax Amount Totalization." \ |
286 | 433 | "For Purchase Book it sums Reduced VAT Tax column for domestic" | 434 | " For Purchase Book it sums Reduced VAT Tax column for domestic" \ |
287 | 434 | " transactions. For Sale Book it sums Tax Payer and No Tax Payer" | 435 | " transactions. For Sale Book it sums Tax Payer and No Tax Payer" \ |
288 | 435 | " Reduced VAT Tax columns"), | 436 | " Reduced VAT Tax columns"), |
289 | 436 | 437 | ||
290 | 437 | #~ Apply only for sale book | 438 | #~ Apply only for sale book |
291 | 438 | #~ Totalization fields for tax payer and no tax payer transactions | 439 | #~ Totalization fields for tax payer and no tax payer transactions |
292 | 439 | 'ntp_fbl_ids': fields.one2many("fiscal.book.line", "ntp_fb_id", | 440 | 'ntp_fbl_ids': fields.one2many("fiscal.book.line", "ntp_fb_id", |
293 | 440 | string = "No Tax Payer Detail Lines", | 441 | string = "No Tax Payer Detail Lines", |
298 | 441 | help="No Tax Payer Lines that are" | 442 | help="No Tax Payer Lines that are" \ |
299 | 442 | " grouped by the statement law that" | 443 | " grouped by the statement law that" \ |
300 | 443 | " represent the data of are consolidate" | 444 | " represent the data of are" \ |
301 | 444 | "book lines"), | 445 | " consolidate book lines"), |
302 | 445 | 'get_total_with_iva_tp_sum': fields.function( | 446 | 'get_total_with_iva_tp_sum': fields.function( |
303 | 446 | _get_total_with_iva_sum, | 447 | _get_total_with_iva_sum, |
304 | 447 | type="float", method=True, store=True, | 448 | type="float", method=True, store=True, |
305 | @@ -451,48 +452,48 @@ | |||
306 | 451 | 'tp_vat_base_sum': fields.float( | 452 | 'tp_vat_base_sum': fields.float( |
307 | 452 | digits_compute=dp.get_precision('Account'), | 453 | digits_compute=dp.get_precision('Account'), |
308 | 453 | string="Tax Payer Taxable Amount", | 454 | string="Tax Payer Taxable Amount", |
311 | 454 | help="Sum of all Tax Payer Grand Base Sum (reduced, general and " \ | 455 | help="Sum of all Tax Payer Grand Base Sum (reduced, general and" \ |
312 | 455 | "additional taxes)"), | 456 | " additional taxes)"), |
313 | 456 | 'tp_exempt_vat_sum': fields.float( | 457 | 'tp_exempt_vat_sum': fields.float( |
314 | 457 | digits_compute=dp.get_precision('Account'), | 458 | digits_compute=dp.get_precision('Account'), |
315 | 458 | string="Exempt Tax", | 459 | string="Exempt Tax", |
318 | 459 | help="Tax Payer Exempt Tax Totalization. Sum of Exempt column " \ | 460 | help="Tax Payer Exempt Tax Totalization. Sum of Exempt column" \ |
319 | 460 | "for tax payer transactions"), | 461 | " for tax payer transactions"), |
320 | 461 | 'tp_sdcf_vat_sum': fields.float( | 462 | 'tp_sdcf_vat_sum': fields.float( |
321 | 462 | digits_compute=dp.get_precision('Account'), | 463 | digits_compute=dp.get_precision('Account'), |
322 | 463 | string="SDCF Tax", | 464 | string="SDCF Tax", |
325 | 464 | help="Tax Payer SDCF Tax Totalization. Sum of SDCF column for " \ | 465 | help="Tax Payer SDCF Tax Totalization. Sum of SDCF column for" \ |
326 | 465 | "tax payer transactions"), | 466 | " tax payer transactions"), |
327 | 466 | 'tp_general_vat_base_sum': fields.float( | 467 | 'tp_general_vat_base_sum': fields.float( |
328 | 467 | digits_compute=dp.get_precision('Account'), | 468 | digits_compute=dp.get_precision('Account'), |
329 | 468 | string="General VAT Taxable Amount", | 469 | string="General VAT Taxable Amount", |
332 | 469 | help="General VAT Taxed Tax Payer Base Amount Totalization. " \ | 470 | help="General VAT Taxed Tax Payer Base Amount Totalization." \ |
333 | 470 | "Sum of General VAT Base column for taxy payer transactions"), | 471 | " Sum of General VAT Base column for taxy payer transactions"), |
334 | 471 | 'tp_general_vat_tax_sum': fields.float( | 472 | 'tp_general_vat_tax_sum': fields.float( |
335 | 472 | digits_compute=dp.get_precision('Account'), | 473 | digits_compute=dp.get_precision('Account'), |
336 | 473 | string="General VAT Taxed Amount", | 474 | string="General VAT Taxed Amount", |
339 | 474 | help="General VAT Taxed Tax Payer Tax Amount Totalization. " \ | 475 | help="General VAT Taxed Tax Payer Tax Amount Totalization." \ |
340 | 475 | "Sum of General VAT Tax column for tax payer transactions"), | 476 | " Sum of General VAT Tax column for tax payer transactions"), |
341 | 476 | 'tp_additional_vat_base_sum': fields.float( | 477 | 'tp_additional_vat_base_sum': fields.float( |
342 | 477 | digits_compute=dp.get_precision('Account'), | 478 | digits_compute=dp.get_precision('Account'), |
343 | 478 | string="Additional VAT Taxable Amount", | 479 | string="Additional VAT Taxable Amount", |
346 | 479 | help="Additional VAT Taxed Tax Payer Base Amount Totalization. " \ | 480 | help="Additional VAT Taxed Tax Payer Base Amount Totalization." \ |
347 | 480 | "Sum of Additional VAT Base column for tax payer transactions"), | 481 | " Sum of Additional VAT Base column for tax payer transactions"), |
348 | 481 | 'tp_additional_vat_tax_sum': fields.float( | 482 | 'tp_additional_vat_tax_sum': fields.float( |
349 | 482 | digits_compute=dp.get_precision('Account'), | 483 | digits_compute=dp.get_precision('Account'), |
350 | 483 | string="Additional VAT Taxed Amount", | 484 | string="Additional VAT Taxed Amount", |
353 | 484 | help="Additional VAT Taxed Tax Payer Tax Amount Totalization. " \ | 485 | help="Additional VAT Taxed Tax Payer Tax Amount Totalization." \ |
354 | 485 | "Sum of Additional VAT Tax column for tax payer transactions"), | 486 | " Sum of Additional VAT Tax column for tax payer transactions"), |
355 | 486 | 'tp_reduced_vat_base_sum': fields.float( | 487 | 'tp_reduced_vat_base_sum': fields.float( |
356 | 487 | digits_compute=dp.get_precision('Account'), | 488 | digits_compute=dp.get_precision('Account'), |
357 | 488 | string="Reduced VAT Taxable Amount", | 489 | string="Reduced VAT Taxable Amount", |
360 | 489 | help="Reduced VAT Taxed Tax Payer Base Amount Totalization. " \ | 490 | help="Reduced VAT Taxed Tax Payer Base Amount Totalization." \ |
361 | 490 | "Sum of Reduced VAT Base column for tax payer transactions"), | 491 | " Sum of Reduced VAT Base column for tax payer transactions"), |
362 | 491 | 'tp_reduced_vat_tax_sum': fields.float( | 492 | 'tp_reduced_vat_tax_sum': fields.float( |
363 | 492 | digits_compute=dp.get_precision('Account'), | 493 | digits_compute=dp.get_precision('Account'), |
364 | 493 | string="Reduced VAT Taxed Amount", | 494 | string="Reduced VAT Taxed Amount", |
367 | 494 | help="Reduced VAT Taxed Tax Payer Tax Amount Totalization. " \ | 495 | help="Reduced VAT Taxed Tax Payer Tax Amount Totalization." \ |
368 | 495 | "Sum of Reduced VAT Tax column for tax payer transactions"), | 496 | " Sum of Reduced VAT Tax column for tax payer transactions"), |
369 | 496 | 497 | ||
370 | 497 | 'get_total_with_iva_ntp_sum': fields.function( | 498 | 'get_total_with_iva_ntp_sum': fields.function( |
371 | 498 | _get_total_with_iva_sum, | 499 | _get_total_with_iva_sum, |
372 | @@ -503,48 +504,48 @@ | |||
373 | 503 | 'ntp_vat_base_sum': fields.float( | 504 | 'ntp_vat_base_sum': fields.float( |
374 | 504 | digits_compute=dp.get_precision('Account'), | 505 | digits_compute=dp.get_precision('Account'), |
375 | 505 | string="No Tax Payer Taxable Amount", | 506 | string="No Tax Payer Taxable Amount", |
378 | 506 | help="No Tax Payer Grand Base Totalization. Sum of all no tax " \ | 507 | help="No Tax Payer Grand Base Totalization. Sum of all no tax" \ |
379 | 507 | "payer tax bases (reduced, general and additional)"), | 508 | " payer tax bases (reduced, general and additional)"), |
380 | 508 | 'ntp_exempt_vat_sum': fields.float( | 509 | 'ntp_exempt_vat_sum': fields.float( |
381 | 509 | digits_compute=dp.get_precision('Account'), | 510 | digits_compute=dp.get_precision('Account'), |
382 | 510 | string="Exempt Tax", | 511 | string="Exempt Tax", |
385 | 511 | help="No Tax Payer Exempt Tax Totalization. Sum of Exempt " \ | 512 | help="No Tax Payer Exempt Tax Totalization. Sum of Exempt" \ |
386 | 512 | "column for no tax payer transactions"), | 513 | " column for no tax payer transactions"), |
387 | 513 | 'ntp_sdcf_vat_sum': fields.float( | 514 | 'ntp_sdcf_vat_sum': fields.float( |
388 | 514 | digits_compute=dp.get_precision('Account'), | 515 | digits_compute=dp.get_precision('Account'), |
389 | 515 | string="SDCF Tax", | 516 | string="SDCF Tax", |
392 | 516 | help="No Tax Payer SDCF Tax Totalization. Sum of SDCF column " \ | 517 | help="No Tax Payer SDCF Tax Totalization. Sum of SDCF column" \ |
393 | 517 | "for no tax payer transactions"), | 518 | " for no tax payer transactions"), |
394 | 518 | 'ntp_general_vat_base_sum': fields.float( | 519 | 'ntp_general_vat_base_sum': fields.float( |
395 | 519 | digits_compute=dp.get_precision('Account'), | 520 | digits_compute=dp.get_precision('Account'), |
396 | 520 | string="General VAT Taxable Amount", | 521 | string="General VAT Taxable Amount", |
399 | 521 | help="General VAT Taxed No Tax Payer Base Amount Totalization. " \ | 522 | help="General VAT Taxed No Tax Payer Base Amount Totalization." \ |
400 | 522 | "Sum of General VAT Base column for taxy payer transactions"), | 523 | " Sum of General VAT Base column for taxy payer transactions"), |
401 | 523 | 'ntp_general_vat_tax_sum': fields.float( | 524 | 'ntp_general_vat_tax_sum': fields.float( |
402 | 524 | digits_compute=dp.get_precision('Account'), | 525 | digits_compute=dp.get_precision('Account'), |
403 | 525 | string="General VAT Taxed Amount", | 526 | string="General VAT Taxed Amount", |
406 | 526 | help="General VAT Taxed No Tax Payer Tax Amount Totalization. " \ | 527 | help="General VAT Taxed No Tax Payer Tax Amount Totalization." \ |
407 | 527 | "Sum of General VAT Tax column for no tax payer transactions"), | 528 | " Sum of General VAT Tax column for no tax payer transactions"), |
408 | 528 | 'ntp_additional_vat_base_sum': fields.float( | 529 | 'ntp_additional_vat_base_sum': fields.float( |
409 | 529 | digits_compute=dp.get_precision('Account'), | 530 | digits_compute=dp.get_precision('Account'), |
410 | 530 | string="Additional VAT Taxable Amount", | 531 | string="Additional VAT Taxable Amount", |
413 | 531 | help="Additional VAT Taxed No Tax Payer Base Amount Totalization. " \ | 532 | help="Additional VAT Taxed No Tax Payer Base Amount Totalization." \ |
414 | 532 | "Sum of Additional VAT Base column for no tax payer transactions"), | 533 | " Sum of Additional VAT Base column for no tax payer transactions"), |
415 | 533 | 'ntp_additional_vat_tax_sum': fields.float( | 534 | 'ntp_additional_vat_tax_sum': fields.float( |
416 | 534 | digits_compute=dp.get_precision('Account'), | 535 | digits_compute=dp.get_precision('Account'), |
417 | 535 | string="Additional VAT Taxed Amount", | 536 | string="Additional VAT Taxed Amount", |
420 | 536 | help="Additional VAT Taxed No Tax Payer Tax Amount Totalization. " \ | 537 | help="Additional VAT Taxed No Tax Payer Tax Amount Totalization." \ |
421 | 537 | "Sum of Additional VAT Tax column for no tax payer transactions"), | 538 | " Sum of Additional VAT Tax column for no tax payer transactions"), |
422 | 538 | 'ntp_reduced_vat_base_sum': fields.float( | 539 | 'ntp_reduced_vat_base_sum': fields.float( |
423 | 539 | digits_compute=dp.get_precision('Account'), | 540 | digits_compute=dp.get_precision('Account'), |
424 | 540 | string="Reduced VAT Taxable Amount", | 541 | string="Reduced VAT Taxable Amount", |
427 | 541 | help="Reduced VAT Taxed No Tax Payer Base Amount Totalization. " \ | 542 | help="Reduced VAT Taxed No Tax Payer Base Amount Totalization." \ |
428 | 542 | "Sum of Reduced VAT Base column for no tax payer transactions"), | 543 | " Sum of Reduced VAT Base column for no tax payer transactions"), |
429 | 543 | 'ntp_reduced_vat_tax_sum': fields.float( | 544 | 'ntp_reduced_vat_tax_sum': fields.float( |
430 | 544 | digits_compute=dp.get_precision('Account'), | 545 | digits_compute=dp.get_precision('Account'), |
431 | 545 | string="Reduced VAT Taxed Amount", | 546 | string="Reduced VAT Taxed Amount", |
434 | 546 | help="Reduced VAT Taxed No Tax Payer Tax Amount Totalization. " \ | 547 | help="Reduced VAT Taxed No Tax Payer Tax Amount Totalization." \ |
435 | 547 | "Sum of Reduced VAT Tax column for no tax payer transactions"), | 548 | " Sum of Reduced VAT Tax column for no tax payer transactions"), |
436 | 548 | } | 549 | } |
437 | 549 | 550 | ||
438 | 550 | _defaults = { | 551 | _defaults = { |
439 | @@ -612,8 +613,6 @@ | |||
440 | 612 | #~ Relate invoices | 613 | #~ Relate invoices |
441 | 613 | inv_ids = self._get_invoice_ids(cr, uid, fb_id, context=context) | 614 | inv_ids = self._get_invoice_ids(cr, uid, fb_id, context=context) |
442 | 614 | inv_obj.write(cr, uid, inv_ids, {'fb_id': fb_id}, context=context) | 615 | inv_obj.write(cr, uid, inv_ids, {'fb_id': fb_id}, context=context) |
443 | 615 | #~ update book taxes | ||
444 | 616 | self.update_book_taxes(cr, uid, fb_id, context=context) | ||
445 | 617 | 616 | ||
446 | 618 | #~ TODO: move this process to the cancel process of the invoice | 617 | #~ TODO: move this process to the cancel process of the invoice |
447 | 619 | #~ Unrelate invoices (period book change, invoice now cancel/draft or | 618 | #~ Unrelate invoices (period book change, invoice now cancel/draft or |
448 | @@ -699,8 +698,8 @@ | |||
449 | 699 | #~ Relate wh iva lines | 698 | #~ Relate wh iva lines |
450 | 700 | iwdl_ids = self._get_wh_iva_line_ids(cr, uid, fb_id, context=context) | 699 | iwdl_ids = self._get_wh_iva_line_ids(cr, uid, fb_id, context=context) |
451 | 701 | 700 | ||
454 | 702 | if fb_brw.type == "sale" \ | 701 | if fb_brw.type == "sale" and iwdl_ids \ |
455 | 703 | and fb_brw.company_id.partner_id.wh_iva_agent and iwdl_ids: | 702 | and not fb_brw.company_id.partner_id.wh_iva_agent: |
456 | 704 | raise osv.except_osv(_("Error!"), | 703 | raise osv.except_osv(_("Error!"), |
457 | 705 | _("You have withholdings registred but you are not a withholding agent")) | 704 | _("You have withholdings registred but you are not a withholding agent")) |
458 | 706 | 705 | ||
459 | @@ -715,28 +714,6 @@ | |||
460 | 715 | context=context) | 714 | context=context) |
461 | 716 | return True | 715 | return True |
462 | 717 | 716 | ||
463 | 718 | def _get_book_taxes_ids(self, cr, uid, fb_id, context=None): | ||
464 | 719 | """ It returns account invoice taxes IDs from the fiscal book | ||
465 | 720 | invoices. | ||
466 | 721 | @param fb_id: fiscal book id | ||
467 | 722 | """ | ||
468 | 723 | context = context or {} | ||
469 | 724 | ait_ids = [] | ||
470 | 725 | for inv_brw in self.browse(cr, uid, fb_id, | ||
471 | 726 | context=context).invoice_ids: | ||
472 | 727 | ait_ids += [ait.id for ait in inv_brw.tax_line] | ||
473 | 728 | return ait_ids | ||
474 | 729 | |||
475 | 730 | def update_book_taxes(self, cr, uid, fb_id, context=None): | ||
476 | 731 | """ It relate the invoices taxes from the period to the book. | ||
477 | 732 | @param fb_id: fiscal book id | ||
478 | 733 | """ | ||
479 | 734 | context = context or {} | ||
480 | 735 | ait_ids = self._get_book_taxes_ids(cr, uid, fb_id, context=context) | ||
481 | 736 | data = map(lambda x: (0, 0, {'ait_id': x}), ait_ids) | ||
482 | 737 | self.write(cr, uid, fb_id, {'fbt_ids': data}, context=context) | ||
483 | 738 | return True | ||
484 | 739 | |||
485 | 740 | def _get_invoice_iwdl_id(self, cr, uid, fb_id, inv_id, context=None): | 717 | def _get_invoice_iwdl_id(self, cr, uid, fb_id, inv_id, context=None): |
486 | 741 | """ It check if the invoice have wh iva lines asociated and if its | 718 | """ It check if the invoice have wh iva lines asociated and if its |
487 | 742 | check if it is at the same period. Return the wh iva line ID or False | 719 | check if it is at the same period. Return the wh iva line ID or False |
488 | @@ -1594,6 +1571,19 @@ | |||
489 | 1594 | or (fb_brw.type == 'purchase' and 'do' \ | 1571 | or (fb_brw.type == 'purchase' and 'do' \ |
490 | 1595 | or (inv_brw.partner_id.vat_subjected and 'tp' or 'ntp' )) | 1572 | or (inv_brw.partner_id.vat_subjected and 'tp' or 'ntp' )) |
491 | 1596 | 1573 | ||
492 | 1574 | def unlink(self, cr, uid, ids, context=None): | ||
493 | 1575 | """ Overwrite the unlink method to throw an exception if the book is | ||
494 | 1576 | not in cancel state.""" | ||
495 | 1577 | context = context or {} | ||
496 | 1578 | for fb_brw in self.browse(cr, uid, ids, context=context): | ||
497 | 1579 | if fb_brw.state != 'cancel': | ||
498 | 1580 | raise osv.except_osv("Invalid Procedure!!", | ||
499 | 1581 | "Youre book needs to be in cancel state to be deleted.") | ||
500 | 1582 | else: | ||
501 | 1583 | super(fiscal_book,self).unlink(cr, uid, ids, context=context) | ||
502 | 1584 | return True | ||
503 | 1585 | |||
504 | 1586 | |||
505 | 1597 | class fiscal_book_lines(orm.Model): | 1587 | class fiscal_book_lines(orm.Model): |
506 | 1598 | 1588 | ||
507 | 1599 | def _get_wh_vat(self, cr, uid, ids, field_name, arg, context=None): | 1589 | def _get_wh_vat(self, cr, uid, ids, field_name, arg, context=None): |
508 | @@ -1633,23 +1623,23 @@ | |||
509 | 1633 | 'fb_id': fields.many2one('fiscal.book', 'Fiscal Book', | 1623 | 'fb_id': fields.many2one('fiscal.book', 'Fiscal Book', |
510 | 1634 | help='Fiscal Book that owns this book line'), | 1624 | help='Fiscal Book that owns this book line'), |
511 | 1635 | 'ntp_fb_id': fields.many2one("fiscal.book", "No Tax Payer Detail", | 1625 | 'ntp_fb_id': fields.many2one("fiscal.book", "No Tax Payer Detail", |
514 | 1636 | help="Fiscal Book that owns this book line" | 1626 | help="Fiscal Book that owns this book line" \ |
515 | 1637 | "This Book is only for no tax payer lines"), | 1627 | " This Book is only for no tax payer lines"), |
516 | 1638 | 'fbt_ids': fields.one2many('fiscal.book.taxes', 'fbl_id', | 1628 | 'fbt_ids': fields.one2many('fiscal.book.taxes', 'fbl_id', |
519 | 1639 | string='Tax Lines', help='Tax Lines being \ | 1629 | string='Tax Lines', help="Tax Lines being" \ |
520 | 1640 | recorded in a Fiscal Book'), | 1630 | " recorded in a Fiscal Book"), |
521 | 1641 | 'invoice_id': fields.many2one('account.invoice', 'Invoice', | 1631 | 'invoice_id': fields.many2one('account.invoice', 'Invoice', |
524 | 1642 | help='Invoice related to this book \ | 1632 | help="Invoice related to this book" \ |
525 | 1643 | line'), | 1633 | " line"), |
526 | 1644 | 'iwdl_id': fields.many2one('account.wh.iva.line', 'Vat Withholding', | 1634 | 'iwdl_id': fields.many2one('account.wh.iva.line', 'Vat Withholding', |
529 | 1645 | help='Withholding iva line related to this \ | 1635 | help="Withholding iva line related to" \ |
530 | 1646 | book line'), | 1636 | " this book line"), |
531 | 1647 | 'parent_id': fields.many2one( | 1637 | 'parent_id': fields.many2one( |
532 | 1648 | "fiscal.book.line", | 1638 | "fiscal.book.line", |
533 | 1649 | string="Consolidated Line", | 1639 | string="Consolidated Line", |
534 | 1650 | ondelete='cascade', | 1640 | ondelete='cascade', |
537 | 1651 | help="No Tax Payer Consolidated Line. Indicate the id of the " | 1641 | help="No Tax Payer Consolidated Line. Indicate the id of the" \ |
538 | 1652 | "consolidated line where this no tax payer line belongs"), | 1642 | " consolidated line where this no tax payer line belongs"), |
539 | 1653 | 'parent_left': fields.integer('Left Parent', select=1), | 1643 | 'parent_left': fields.integer('Left Parent', select=1), |
540 | 1654 | 'parent_right': fields.integer('Right Parent', select=1), | 1644 | 'parent_right': fields.integer('Right Parent', select=1), |
541 | 1655 | 'child_ids': fields.one2many( | 1645 | 'child_ids': fields.one2many( |
542 | @@ -1665,16 +1655,16 @@ | |||
543 | 1665 | help='Invoice Document Date / Wh IVA Line Voucher Date'), | 1655 | help='Invoice Document Date / Wh IVA Line Voucher Date'), |
544 | 1666 | 'accounting_date': fields.date( | 1656 | 'accounting_date': fields.date( |
545 | 1667 | string='Accounting Date', | 1657 | string='Accounting Date', |
548 | 1668 | help='The day of the accounting record [(invoice, date_invoice), \ | 1658 | help="The day of the accounting record [(invoice, date_invoice)," \ |
549 | 1669 | (wh iva line, date_ret)]'), | 1659 | " (wh iva line, date_ret)]"), |
550 | 1670 | 'doc_type': fields.char('Doc. Type', size=8, help='Document Type'), | 1660 | 'doc_type': fields.char('Doc. Type', size=8, help='Document Type'), |
551 | 1671 | 'partner_name': fields.char(size=128, string='Partner Name', help=''), | 1661 | 'partner_name': fields.char(size=128, string='Partner Name', help=''), |
552 | 1672 | 'partner_vat': fields.char(size=128, string='Partner TIN', help=''), | 1662 | 'partner_vat': fields.char(size=128, string='Partner TIN', help=''), |
553 | 1673 | 'affected_invoice': fields.char( | 1663 | 'affected_invoice': fields.char( |
554 | 1674 | string='Affected Invoice', | 1664 | string='Affected Invoice', |
555 | 1675 | size=64, | 1665 | size=64, |
558 | 1676 | help="For an invoice line type means parent invoice for a Debit " | 1666 | help="For an invoice line type means parent invoice for a Debit" \ |
559 | 1677 | " or Credit Note. For an withholding line type means the invoice" | 1667 | " or Credit Note. For an withholding line type means the invoice" \ |
560 | 1678 | " number related to the withholding"), | 1668 | " number related to the withholding"), |
561 | 1679 | #~ Apply for wh iva lines | 1669 | #~ Apply for wh iva lines |
562 | 1680 | 'get_wh_vat': fields.function(_get_wh_vat, | 1670 | 'get_wh_vat': fields.function(_get_wh_vat, |
563 | @@ -1682,7 +1672,7 @@ | |||
564 | 1682 | string="Withholding VAT", | 1672 | string="Withholding VAT", |
565 | 1683 | help="Withholding VAT"), | 1673 | help="Withholding VAT"), |
566 | 1684 | 'wh_number': fields.char(string='Withholding number', size=64, | 1674 | 'wh_number': fields.char(string='Withholding number', size=64, |
568 | 1685 | help=''), | 1675 | help=""), |
569 | 1686 | 'affected_invoice_date': fields.date(string="Affected Invoice Date", | 1676 | 'affected_invoice_date': fields.date(string="Affected Invoice Date", |
570 | 1687 | help=""), | 1677 | help=""), |
571 | 1688 | 'wh_rate': fields.float(string="Withholding percentage", | 1678 | 'wh_rate': fields.float(string="Withholding percentage", |
572 | @@ -1691,16 +1681,16 @@ | |||
573 | 1691 | _get_based_tax_debit, | 1681 | _get_based_tax_debit, |
574 | 1692 | type="float", method=True, store=True, | 1682 | type="float", method=True, store=True, |
575 | 1693 | string="Based Tax Debit", | 1683 | string="Based Tax Debit", |
578 | 1694 | help="Sum of all tax amount for the taxes realeted to the \ | 1684 | help="Sum of all tax amount for the taxes realeted to the wh iva" \ |
579 | 1695 | wh iva line."), | 1685 | " line."), |
580 | 1696 | 1686 | ||
581 | 1697 | #~ Apply for invoice lines | 1687 | #~ Apply for invoice lines |
582 | 1698 | 'ctrl_number': fields.char(string='Invoice Control number', size=64, | 1688 | 'ctrl_number': fields.char(string='Invoice Control number', size=64, |
583 | 1699 | help=''), | 1689 | help=''), |
584 | 1700 | 'invoice_number': fields.char(string='Invoice number', size=64, | 1690 | 'invoice_number': fields.char(string='Invoice number', size=64, |
588 | 1701 | help="Invoice Number. In case of use" | 1691 | help="Invoice Number. In case of use" \ |
589 | 1702 | " of fiscal printer this field will " | 1692 | " of fiscal printer this field will" \ |
590 | 1703 | " store the invoice number generate" | 1693 | " store the invoice number generate" \ |
591 | 1704 | " by the fiscal printer machine"), | 1694 | " by the fiscal printer machine"), |
592 | 1705 | 'imex_date': fields.date(string='Imex Date', | 1695 | 'imex_date': fields.date(string='Imex Date', |
593 | 1706 | help='Invoice Importation/Exportation Date'), | 1696 | help='Invoice Importation/Exportation Date'), |
594 | @@ -1717,9 +1707,9 @@ | |||
595 | 1717 | ('tp', 'Tax Payer'), | 1707 | ('tp', 'Tax Payer'), |
596 | 1718 | ('ntp', 'No Tax Payer')], | 1708 | ('ntp', 'No Tax Payer')], |
597 | 1719 | string = 'Transaction Type', required=True, | 1709 | string = 'Transaction Type', required=True, |
601 | 1720 | help="Book line transtaction type: \ | 1710 | help="Book line transtaction type:" \ |
602 | 1721 | - Purchase: Import or Domestic. \ | 1711 | " - Purchase: Import or Domestic." \ |
603 | 1722 | - Sales: Expertation, Tax Payer, No Tax Payer."), | 1712 | " - Sales: Expertation, Tax Payer, No Tax Payer."), |
604 | 1723 | 'void_form': fields.char(string='Transaction type', size=192, | 1713 | 'void_form': fields.char(string='Transaction type', size=192, |
605 | 1724 | help="Operation Type"), | 1714 | help="Operation Type"), |
606 | 1725 | 'fiscal_printer': fields.char(string='Fiscal machine number', | 1715 | 'fiscal_printer': fields.char(string='Fiscal machine number', |
607 | @@ -1728,26 +1718,26 @@ | |||
608 | 1728 | 'custom_statement': fields.char(string="Custom Statement", | 1718 | 'custom_statement': fields.char(string="Custom Statement", |
609 | 1729 | size=192, help=""), | 1719 | size=192, help=""), |
610 | 1730 | #~ -- taxes fields | 1720 | #~ -- taxes fields |
631 | 1731 | 'total_with_iva': fields.float('Total with IVA', help="Sub Total \ | 1721 | 'total_with_iva': fields.float('Total with IVA', help="Sub Total of" \ |
632 | 1732 | of the invoice (untaxed amount) plus \ | 1722 | " the invoice (untaxed amount) plus" \ |
633 | 1733 | all tax amount of the related taxes"), | 1723 | " all tax amount of the related taxes"), |
634 | 1734 | 'vat_sdcf': fields.float("SDCF", help="Not entitled to tax credit \ | 1724 | 'vat_sdcf': fields.float("SDCF", help="Not entitled to tax credit" \ |
635 | 1735 | (The field name correspond to the spanih \ | 1725 | " (The field name correspond to the spanih" \ |
636 | 1736 | acronym for 'Sin Derecho a Credito Fiscal')"), | 1726 | " acronym for 'Sin Derecho a Credito Fiscal')"), |
637 | 1737 | 'vat_exempt': fields.float("Exempt", help="Exempt is a Tax with 0 \ | 1727 | 'vat_exempt': fields.float("Exempt", help="Exempt is a Tax with 0" \ |
638 | 1738 | tax percentage"), | 1728 | " tax percentage"), |
639 | 1739 | 'vat_reduced_base': fields.float("RED BASE", help="Vat Reduced Base \ | 1729 | 'vat_reduced_base': fields.float("RED BASE", help="Vat Reduced Base" \ |
640 | 1740 | Amount"), | 1730 | " Amount"), |
641 | 1741 | 'vat_reduced_tax': fields.float("RED TAX", help="Vat Reduced Tax \ | 1731 | 'vat_reduced_tax': fields.float("RED TAX", help="Vat Reduced Tax" \ |
642 | 1742 | Amount"), | 1732 | " Amount"), |
643 | 1743 | 'vat_general_base': fields.float("GRAL BASE",help="Vat General Base \ | 1733 | 'vat_general_base': fields.float("GRAL BASE",help="Vat General Base" \ |
644 | 1744 | Amount"), | 1734 | " Amount"), |
645 | 1745 | 'vat_general_tax': fields.float("GRAL TAX", help="Vat General Tax \ | 1735 | 'vat_general_tax': fields.float("GRAL TAX", help="Vat General Tax" \ |
646 | 1746 | Amount"), | 1736 | " Amount"), |
647 | 1747 | 'vat_additional_base': fields.float("ADD BASE", help="Vat Generald \ | 1737 | 'vat_additional_base': fields.float("ADD BASE", help="Vat Generald" \ |
648 | 1748 | plus Additional Base Amount"), | 1738 | " plus Additional Base Amount"), |
649 | 1749 | 'vat_additional_tax': fields.float("ADD TAX", help="Vat General plus \ | 1739 | 'vat_additional_tax': fields.float("ADD TAX", help="Vat General plus" \ |
650 | 1750 | Additional Tax Amount"), | 1740 | " Additional Tax Amount"), |
651 | 1751 | } | 1741 | } |
652 | 1752 | 1742 | ||
653 | 1753 | 1743 | ||
654 | @@ -1803,9 +1793,9 @@ | |||
655 | 1803 | ('tp', 'Tax Payer'), | 1793 | ('tp', 'Tax Payer'), |
656 | 1804 | ('ntp', 'No Tax Payer')], | 1794 | ('ntp', 'No Tax Payer')], |
657 | 1805 | string = 'Operation Type', | 1795 | string = 'Operation Type', |
661 | 1806 | help="Operation Type: \ | 1796 | help="Operation Type:" \ |
662 | 1807 | - Purchase: Import or Domestic. \ | 1797 | " - Purchase: Import or Domestic." \ |
663 | 1808 | - Sales: Expertation, Tax Payer, No Tax Payer."), | 1798 | " - Sales: Expertation, Tax Payer, No Tax Payer."), |
664 | 1809 | 'base_amount_sum': fields.float('Taxable Amount Sum'), | 1799 | 'base_amount_sum': fields.float('Taxable Amount Sum'), |
665 | 1810 | 'tax_amount_sum': fields.float('Taxed Amount Sum'), | 1800 | 'tax_amount_sum': fields.float('Taxed Amount Sum'), |
666 | 1811 | } | 1801 | } |
667 | @@ -1839,8 +1829,8 @@ | |||
668 | 1839 | 'type_doc': fields.selection([ | 1829 | 'type_doc': fields.selection([ |
669 | 1840 | ('F', 'Invoice'), ('ND', 'Debit Note'), ('NC', 'Credit Note'), ], | 1830 | ('F', 'Invoice'), ('ND', 'Debit Note'), ('NC', 'Credit Note'), ], |
670 | 1841 | 'Document Type', select=True, required=True, | 1831 | 'Document Type', select=True, required=True, |
673 | 1842 | help="Type of Document for adjustment book: \ | 1832 | help="Type of Document for adjustment book:" |
674 | 1843 | -Invoice(F),-Debit Note(dn),-Credit Note(cn)"), | 1833 | " -Invoice(F),-Debit Note(dn),-Credit Note(cn)"), |
675 | 1844 | 'doc_affected': fields.char( | 1834 | 'doc_affected': fields.char( |
676 | 1845 | 'Affected Document', size=256, required=True, | 1835 | 'Affected Document', size=256, required=True, |
677 | 1846 | help="Affected Document for adjustment book"), | 1836 | help="Affected Document for adjustment book"), |
678 | 1847 | 1837 | ||
679 | === modified file 'l10n_ve_fiscal_book/model/invoice.py' | |||
680 | --- l10n_ve_fiscal_book/model/invoice.py 2013-04-25 16:22:59 +0000 | |||
681 | +++ l10n_ve_fiscal_book/model/invoice.py 2013-06-04 20:15:34 +0000 | |||
682 | @@ -31,17 +31,18 @@ | |||
683 | 31 | 31 | ||
684 | 32 | _columns = { | 32 | _columns = { |
685 | 33 | 'fb_id': fields.many2one('fiscal.book', 'Fiscal Book', | 33 | 'fb_id': fields.many2one('fiscal.book', 'Fiscal Book', |
688 | 34 | help='Fiscal Book where this line is \ | 34 | help="Fiscal Book where this line is" \ |
689 | 35 | related to'), | 35 | " related to"), |
690 | 36 | 'issue_fb_id': fields.many2one('fiscal.book', 'Fiscal Book', | 36 | 'issue_fb_id': fields.many2one('fiscal.book', 'Fiscal Book', |
693 | 37 | help='Fiscal Book where this invoice \ | 37 | help="Fiscal Book where this invoice" \ |
694 | 38 | needs to be add'), | 38 | " needs to be add"), |
695 | 39 | # TODO: THIS FIELD TO BE CHANGED TO A STORABLE FUNCTIONAL FIELD | 39 | # TODO: THIS FIELD TO BE CHANGED TO A STORABLE FUNCTIONAL FIELD |
696 | 40 | # CHANGE EVEN FROM boolean to selection | 40 | # CHANGE EVEN FROM boolean to selection |
697 | 41 | 'fb_submitted': fields.boolean('Fiscal Book Submitted?', | 41 | 'fb_submitted': fields.boolean('Fiscal Book Submitted?', |
701 | 42 | help='Indicates if this invoice is in \ | 42 | help="Indicates if this invoice is in" \ |
702 | 43 | a Fiscal Book which has being already \ | 43 | " a Fiscal Book which has being" \ |
703 | 44 | submitted to the statutory institute'), | 44 | " already submitted to the statutory" \ |
704 | 45 | " institute"), | ||
705 | 45 | } | 46 | } |
706 | 46 | 47 | ||
707 | 47 | inherited_invoice() | 48 | inherited_invoice() |
708 | 48 | 49 | ||
709 | === modified file 'l10n_ve_fiscal_book/wizard/fiscal_book_wizard.py' | |||
710 | --- l10n_ve_fiscal_book/wizard/fiscal_book_wizard.py 2013-04-16 16:53:35 +0000 | |||
711 | +++ l10n_ve_fiscal_book/wizard/fiscal_book_wizard.py 2013-06-04 20:15:34 +0000 | |||
712 | @@ -44,8 +44,8 @@ | |||
713 | 44 | ids = self.pool.get('account.period').search( | 44 | ids = self.pool.get('account.period').search( |
714 | 45 | cr, uid, [('date_start', '<=', dt), ('date_stop', '>=', dt)]) | 45 | cr, uid, [('date_start', '<=', dt), ('date_stop', '>=', dt)]) |
715 | 46 | if not ids: | 46 | if not ids: |
718 | 47 | raise osv.except_osv(_('Error !'), _('No period defined for this \ | 47 | raise osv.except_osv(_('Error !'), _('No period defined for this' \ |
719 | 48 | date !\nPlease create a fiscal year.')) | 48 | ' date !\nPlease create a fiscal year.')) |
720 | 49 | return ids | 49 | return ids |
721 | 50 | 50 | ||
722 | 51 | def _same_account_period(self, cr, uid, admin_date, account_date, context=None): | 51 | def _same_account_period(self, cr, uid, admin_date, account_date, context=None): |
723 | 52 | 52 | ||
724 | === modified file 'l10n_ve_fiscal_book/workflow/fb_workflow.xml' | |||
725 | --- l10n_ve_fiscal_book/workflow/fb_workflow.xml 2013-05-27 16:36:56 +0000 | |||
726 | +++ l10n_ve_fiscal_book/workflow/fb_workflow.xml 2013-06-04 20:15:34 +0000 | |||
727 | @@ -39,7 +39,8 @@ | |||
728 | 39 | <field name="wkf_id" ref="fb_wkf"/> | 39 | <field name="wkf_id" ref="fb_wkf"/> |
729 | 40 | <field name="name">cancel</field> | 40 | <field name="name">cancel</field> |
730 | 41 | <field name="kind">function</field> | 41 | <field name="kind">function</field> |
732 | 42 | <field name="action">write({'state':'cancel'})</field> | 42 | <field name="action">clear_book() |
733 | 43 | write({'state':'cancel'})</field> | ||
734 | 43 | </record> | 44 | </record> |
735 | 44 | 45 | ||
736 | 45 | <!-- | 46 | <!-- |