1 # -*- coding: utf-8 -*-
2 ##############################################################################
4 # OpenERP, Open Source Management Solution
5 # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
6 # Copyright (C) 2008-2009 B2CK, Cedric Krier, Bertrand Chenal (the methods "check_vat_[a-z]{2}"
8 # This program is free software: you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation, either version 3 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
21 ##############################################################################
24 from osv import osv, fields
25 from tools.func import partial
26 from tools.translate import _
29 'be': 'BE0477472701', 'at': 'ATU12345675',
30 'bg': 'BG1234567892', 'cy': 'CY12345678F',
31 'cz': 'CZ12345679', 'de': 'DE123456788',
32 'dk': 'DK12345674', 'ee': 'EE123456780',
33 'es': 'ESA12345674', 'fi': 'FI12345671',
34 'fr': 'FR32123456789', 'gb': 'GB123456782',
35 'gr': 'GR12345670', 'hu': 'HU12345676',
36 'ie': 'IE1234567T', 'it': 'IT12345670017',
37 'lt': 'LT123456715', 'lu': 'LU12345613',
38 'lv': 'LV41234567891', 'mt': 'MT12345634',
39 'nl': 'NL123456782B90', 'pl': 'PL1234567883',
40 'pt': 'PT123456789', 'ro': 'RO1234567897',
41 'se': 'SE123456789701', 'si': 'SI12345679',
42 'sk': 'SK0012345675', 'el': 'EL12345670'
46 """Sum each digits of the multiplication of i and j."""
47 return reduce(lambda x, y: x + int(y), str(i*j), 0)
49 class res_partner(osv.osv):
50 _inherit = 'res.partner'
52 def _split_vat(self, vat):
53 vat_country, vat_number = vat[:2].lower(), vat[2:].replace(' ', '')
54 return vat_country, vat_number
56 def check_vat(self, cr, uid, ids):
58 Check the VAT number depending of the country.
59 http://sima-pc.com/nif.php
61 for partner in self.browse(cr, uid, ids):
64 vat_country, vat_number = self._split_vat(partner.vat)
65 if not hasattr(self, 'check_vat_' + vat_country):
67 check = getattr(self, 'check_vat_' + vat_country)
68 if not check(vat_number):
72 def vat_change(self, cr, uid, ids, value, context=None):
73 return {'value': {'vat_subjected': bool(value)}}
76 'vat_subjected': fields.boolean('VAT Legal Statement', help="Check this box if the partner is subjected to the VAT. It will be used for the VAT legal statement.")
79 def _construct_constraint_msg(self, cr, uid, ids):
80 def default_vat_check(cn, vn):
81 # by default, a VAT number is valid if:
82 # it starts with 2 letters
83 # has more than 3 characters
84 return cn[0] in string.ascii_lowercase and cn[1] in string.ascii_lowercase
86 vat_country, vat_number = self._split_vat(self.browse(cr, uid, ids)[0].vat)
87 if default_vat_check(vat_country, vat_number):
88 vat_no = vat_country in _ref_vat and _ref_vat[vat_country] or 'Country Code + Vat Number'
89 return _('The Vat does not seems to be correct. You should have entered something like this %s'), (vat_no)
90 return _('The VAT is invalid, It should begin with the country code'), ()
92 _constraints = [(check_vat, _construct_constraint_msg, ["vat"])]
94 # code from the following methods come from Tryton (B2CK)
95 # http://www.tryton.org/hgwebdir.cgi/modules/relationship/file/544d1de586d9/party.py
96 def check_vat_at(self, vat):
98 Check Austria VAT number.
109 sum = int(num[0]) + mult_add(2, int(num[1])) + \
110 int(num[2]) + mult_add(2, int(num[3])) + \
111 int(num[4]) + mult_add(2, int(num[5])) + \
113 check = 10 - ((sum + 4) % 10)
116 if int(vat[-1:]) != check:
120 def check_vat_be(self, vat):
122 Check Belgium VAT number.
130 if int(vat[-2:]) != \
131 97 - (int(vat[:8]) % 97):
135 def check_vat_bg(self, vat):
137 Check Bulgaria VAT number.
139 if len(vat) not in [9,10]:
145 if int(vat[0]) in (2, 3) and \
148 sum = 4 * int(vat[0]) + 3 * int(vat[1]) + 2 * int(vat[2]) + \
149 7 * int(vat[3]) + 6 * int(vat[4]) + 5 * int(vat[5]) + \
150 4 * int(vat[6]) + 3 * int(vat[7]) + 2 * int(vat[8])
151 check = 11 - (sum % 11)
156 # if check != int(vat[9]):
160 def check_vat_cy(self, vat):
162 Check Cyprus VAT number.
206 sum = n0 + n1 + n2 + n3 + n4 + n5 + n6 + n7
207 check = chr(sum % 26 + 65)
212 def check_vat_cz(self, vat):
214 Check Czech Republic VAT number.
216 if len(vat) not in (8, 9, 10):
224 if int(vat[0]) not in (0, 1, 2, 3, 4, 5, 6, 7, 8):
226 sum = 8 * int(vat[0]) + 7 * int(vat[1]) + 6 * int(vat[2]) + \
227 5 * int(vat[3]) + 4 * int(vat[4]) + 3 * int(vat[5]) + \
229 check = 11 - (sum % 11)
234 if check != int(vat[7]):
236 elif len(vat) == 9 and int(vat[0]) == 6:
237 sum = 8 * int(vat[1]) + 7 * int(vat[2]) + 6 * int(vat[3]) + \
238 5 * int(vat[4]) + 4 * int(vat[5]) + 3 * int(vat[6]) + \
240 check = 9 - ((11 - (sum % 11)) % 10)
241 if check != int(vat[8]):
244 if int(vat[0:2]) > 53 and int(vat[0:2]) < 80:
246 if int(vat[2:4]) < 1:
248 if int(vat[2:4]) > 12 and int(vat[2:4]) < 51:
250 if int(vat[2:4]) > 62:
252 if int(vat[2:4]) in (2, 52) and int(vat[0:2]) % 4 > 0:
253 if int(vat[4:6]) < 1:
255 if int(vat[4:6]) > 28:
257 if int(vat[2:4]) in (2, 52) and int(vat[0:2]) % 4 == 0:
258 if int(vat[4:6]) < 1:
260 if int(vat[4:6]) > 29:
262 if int(vat[2:4]) in (4, 6, 9, 11, 54, 56, 59, 61):
263 if int(vat[4:6]) < 1:
265 if int(vat[4:6]) > 30:
267 if int(vat[2:4]) in (1, 3, 5, 7, 8, 10, 12, 51,
268 53, 55, 57, 58, 60, 62):
269 if int(vat[4:6]) < 1:
271 if int(vat[4:6]) > 31:
274 if int(vat[0:2]) < 54:
276 if int(vat[2:4]) < 1:
278 if int(vat[2:4]) > 12 and int(vat[2:4]) < 51:
280 if int(vat[2:4]) > 62:
282 if int(vat[2:4]) in (2, 52) and int(vat[0:2]) % 4 > 0:
283 if int(vat[4:6]) < 1:
285 if int(vat[4:6]) > 28:
287 if int(vat[2:4]) in (2, 52) and int(vat[0:2]) % 4 == 0:
288 if int(vat[4:6]) < 1:
290 if int(vat[4:6]) > 29:
292 if int(vat[2:4]) in (4, 6, 9, 11, 54, 56, 59, 61):
293 if int(vat[4:6]) < 1:
295 if int(vat[4:6]) > 30:
297 if int(vat[2:4]) in (1, 3, 5, 7, 8, 10, 12, 51,
298 53, 55, 57, 58, 60, 62):
299 if int(vat[4:6]) < 1:
301 if int(vat[4:6]) > 31:
303 if (int(vat[0:2]) + int(vat[2:4]) + int(vat[4:6]) + int(vat[6:8]) +
304 int(vat[8:10])) % 11 != 0:
306 if int(vat[0:10]) % 11 != 0:
310 def check_vat_de(self, vat):
312 Check Germany VAT number.
320 if int(vat[0:7]) <= 0:
324 sum = (2 * ((int(vat[i]) + sum + 9) % 10 + 1)) % 11
328 if int(vat[8]) != check:
332 def check_vat_dk(self, vat):
334 Check Denmark VAT number.
344 sum = 2 * int(vat[0]) + 7 * int(vat[1]) + 6 * int(vat[2]) + \
345 5 * int(vat[3]) + 4 * int(vat[4]) + 3 * int(vat[5]) + \
346 2 * int(vat[6]) + int(vat[7])
351 def check_vat_ee(self, vat):
353 Check Estonia VAT number.
361 sum = 3 * int(vat[0]) + 7 * int(vat[1]) + 1 * int(vat[2]) + \
362 3 * int(vat[3]) + 7 * int(vat[4]) + 1 * int(vat[5]) + \
363 3 * int(vat[6]) + 7 * int(vat[7])
364 check = 10 - (sum % 10)
367 if check != int(vat[8]):
371 def check_vat_es(self, vat):
373 Check Spain VAT number.
403 #Legal persons with profit aim
404 if vat[0] in ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'U', 'V'):
409 sum = mult_add(2, int(vat[1])) + int(vat[2]) + \
410 mult_add(2, int(vat[3])) + int(vat[4]) + \
411 mult_add(2, int(vat[5])) + int(vat[6]) + \
412 mult_add(2, int(vat[7]))
413 check = 10 - (sum % 10)
416 # if check != int(vat[8]):
419 #Legal persons with non-profit aim
420 elif vat[0] in ('N', 'P', 'Q', 'R', 'S', 'W'):
425 sum = mult_add(2, int(vat[1])) + int(vat[2]) + \
426 mult_add(2, int(vat[3])) + int(vat[4]) + \
427 mult_add(2, int(vat[5])) + int(vat[6]) + \
428 mult_add(2, int(vat[7]))
429 check = 10 - (sum % 10)
430 check = chr(check + 64)
434 #Foreign natural persons, under age 14 or non-residents
435 elif vat[0] in ('K', 'L', 'M', 'X', 'Y', 'Z'):
437 check_value = '1' + vat[1:8]
439 check_value = '2' + vat[1:8]
441 check_value = vat[1:8]
447 check = 1 + (int(check_value) % 23)
453 #Spanish natural persons
459 check = 1 + (int(vat[:8]) % 23)
466 def check_vat_fi(self, vat):
468 Check Finland VAT number.
476 sum = 7 * int(vat[0]) + 9 * int(vat[1]) + 10 * int(vat[2]) + \
477 5 * int(vat[3]) + 8 * int(vat[4]) + 4 * int(vat[5]) + \
479 check = 11 - (sum % 11)
484 if check != int(vat[7]):
488 def check_vat_fr(self, vat):
490 Check France VAT number.
508 check = ((int(vat[2:11]) * 100) + 12) % 97
509 if check != int(vat[0:2]):
513 conv = ['0', '1', '2', '3', '4', '5', '6', '7',
514 '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
515 'J', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T',
516 'U', 'V', 'W', 'X', 'Y', 'Z']
517 if vat[0] not in conv \
518 or vat[1] not in conv:
520 c1 = conv.index(vat[0])
521 c2 = conv.index(vat[1])
524 sum = c1 * 24 + c2 - 10
526 sum = c1 * 34 + c2 - 100
529 sum = (int(sum) / 11) + 1
530 y = (int(vat[2:11]) + sum) % 11
535 def check_vat_gb(self, vat):
537 Check United Kingdom VAT number.
547 if int(vat[2:5]) >= 500:
551 if int(vat[2:5]) < 500:
555 elif len(vat) in (9, 10):
561 if int(vat[0:7]) < 1:
563 if int(vat[0:7]) > 19999 and int(vat[0:7]) < 1000000:
565 if int(vat[7:9]) > 97:
567 if len(vat) == 10 and int(vat[9]) != 3:
570 sum = 8 * int(vat[0]) + 7 * int(vat[1]) + 6 * int(vat[2]) + \
571 5 * int(vat[3]) + 4 * int(vat[4]) + 3 * int(vat[5]) + \
572 2 * int(vat[6]) + 10 * int(vat[7]) + int(vat[8])
576 elif len(vat) in (12, 13):
582 if int(vat[0:3]) not in (0, 1):
585 if int(vat[3:10]) < 1:
587 if int(vat[3:10]) > 19999 and int(vat[3:10]) < 1000000:
589 if int(vat[10:12]) > 97:
591 if len(vat) == 13 and int(vat[12]) != 3:
594 sum = 8 * int(vat[3]) + 7 * int(vat[4]) + 6 * int(vat[5]) + \
595 5 * int(vat[6]) + 4 * int(vat[7]) + 3 * int(vat[8]) + \
596 2 * int(vat[9]) + 10 * int(vat[10]) + int(vat[11])
602 def check_vat_gr(self, vat):
604 Check Greece VAT number.
611 sum = 128 * int(vat[0]) + 64 * int(vat[1]) + 32 * int(vat[2]) + \
612 16 * int(vat[3]) + 8 * int(vat[4]) + 4 * int(vat[5]) + \
617 if check != int(vat[7]):
621 sum = 256 * int(vat[0]) + 128 * int(vat[1]) + 64 * int(vat[2]) + \
622 32 * int(vat[3]) + 16 * int(vat[4]) + 8 * int(vat[5]) + \
623 4 * int(vat[6]) + 2 * int(vat[7])
627 if check != int(vat[8]):
632 def check_vat_el(self, vat):
633 return self.check_vat_gr(vat)
635 def check_vat_hu(self, vat):
637 Check Hungary VAT number.
647 sum = 9 * int(vat[0]) + 7 * int(vat[1]) + 3 * int(vat[2]) + \
648 1 * int(vat[3]) + 9 * int(vat[4]) + 7 * int(vat[5]) + \
650 check = 10 - (sum % 10)
653 if check != int(vat[7]):
657 def check_vat_ie(self, vat):
659 Check Ireland VAT number.
663 if (ord(vat[1]) >= 65 and ord(vat[1]) <= 90) \
664 or vat[1] in ('+', '*'):
674 sum = 7 * int(vat[2]) + 6 * int(vat[3]) + 5 * int(vat[4]) + \
675 4 * int(vat[5]) + 3 * int(vat[6]) + 2 * int(vat[0])
680 check = chr(check + 64)
690 sum = 8 * int(vat[0]) + 7 * int(vat[1]) + 6 * int(vat[2]) + \
691 5 * int(vat[3]) + 4 * int(vat[4]) + 3 * int(vat[5]) + \
697 check = chr(check + 64)
702 def check_vat_it(self, vat):
704 Check Italy VAT number.
712 if int(vat[0:7]) <= 0:
714 if int(vat[7:10]) <= 0:
716 if int(vat[7:10]) > 100 and int(vat[7:10]) < 120:
718 if int(vat[7:10]) > 121:
721 sum = int(vat[0]) + mult_add(2, int(vat[1])) + int(vat[2]) + \
722 mult_add(2, int(vat[3])) + int(vat[4]) + \
723 mult_add(2, int(vat[5])) + int(vat[6]) + \
724 mult_add(2, int(vat[7])) + int(vat[8]) + \
725 mult_add(2, int(vat[9]))
726 check = 10 - (sum % 10)
729 if check != int(vat[10]):
733 def check_vat_lt(self, vat):
735 Check Lithuania VAT number.
745 sum = 1 * int(vat[0]) + 2 * int(vat[1]) + 3 * int(vat[2]) + \
746 4 * int(vat[3]) + 5 * int(vat[4]) + 6 * int(vat[5]) + \
747 7 * int(vat[6]) + 8 * int(vat[7])
749 sum = 3 * int(vat[0]) + 4 * int(vat[1]) + 5 * int(vat[2]) + \
750 6 * int(vat[3]) + 7 * int(vat[4]) + 8 * int(vat[5]) + \
751 9 * int(vat[6]) + 1 * int(vat[7])
755 if check != int(vat[8]):
759 if int(vat[10]) != 1:
761 sum = 1 * int(vat[0]) + 2 * int(vat[1]) + 3 * int(vat[2]) + \
762 4 * int(vat[3]) + 5 * int(vat[4]) + 6 * int(vat[5]) + \
763 7 * int(vat[6]) + 8 * int(vat[7]) + 9 * int(vat[8]) + \
764 1 * int(vat[9]) + 2 * int(vat[10])
766 sum = 3 * int(vat[0]) + 4 * int(vat[1]) + 5 * int(vat[2]) + \
767 6 * int(vat[3]) + 7 * int(vat[4]) + 8 * int(vat[5]) + \
768 9 * int(vat[6]) + 1 * int(vat[7]) + 2 * int(vat[8]) + \
769 3 * int(vat[9]) + 4 * int(vat[10])
773 if check != int(vat[11]):
778 def check_vat_lu(self, vat):
780 Check Luxembourg VAT number.
788 if int(vat[0:6]) <= 0:
790 check = int(vat[0:6]) % 89
791 if check != int(vat[6:8]):
795 def check_vat_lv(self, vat):
797 Check Latvia VAT number.
806 sum = 9 * int(vat[0]) + 1 * int(vat[1]) + 4 * int(vat[2]) + \
807 8 * int(vat[3]) + 3 * int(vat[4]) + 10 * int(vat[5]) + \
808 2 * int(vat[6]) + 5 * int(vat[7]) + 7 * int(vat[8]) + \
810 if sum % 11 == 4 and int(vat[0]) == 9:
813 check = 4 - (sum % 11)
815 check = 14 - (sum % 11)
817 check = 3 - (sum % 11)
818 if check != int(vat[10]):
822 if int(vat[2:4]) == 2 and int(vat[4:6]) % 4 > 0:
823 if int(vat[0:2]) < 1 or int(vat[0:2]) > 28:
825 if int(vat[2:4]) == 2 and int(vat[4:6]) % 4 == 0:
826 if int(vat[0:2]) < 1 or int(vat[0:2]) > 29:
828 if int(vat[2:4]) in (4, 6, 9, 11):
829 if int(vat[0:2]) < 1 or int(vat[0:2]) > 30:
831 if int(vat[2:4]) in (1, 3, 5, 7, 8, 10, 12):
832 if int(vat[0:2]) < 1 or int(vat[0:2]) > 31:
834 if int(vat[2:4]) < 1 or int(vat[2:4]) > 12:
838 def check_vat_mt(self, vat):
840 Check Malta VAT number.
849 if int(vat[0:6]) < 100000:
852 sum = 3 * int(vat[0]) + 4 * int(vat[1]) + 6 * int(vat[2]) + \
853 7 * int(vat[3]) + 8 * int(vat[4]) + 9 * int(vat[5])
854 check = 37 - (sum % 37)
855 if check != int(vat[6:8]):
859 def check_vat_nl(self, vat):
861 Check Netherlands VAT number.
870 if int(vat[0:8]) <= 0:
875 sum = 9 * int(vat[0]) + 8 * int(vat[1]) + 7 * int(vat[2]) + \
876 6 * int(vat[3]) + 5 * int(vat[4]) + 4 * int(vat[5]) + \
877 3 * int(vat[6]) + 2 * int(vat[7])
882 if check != int(vat[8]):
886 def check_vat_pl(self, vat):
888 Check Poland VAT number.
897 sum = 6 * int(vat[0]) + 5 * int(vat[1]) + 7 * int(vat[2]) + \
898 2 * int(vat[3]) + 3 * int(vat[4]) + 4 * int(vat[5]) + \
899 5 * int(vat[6]) + 6 * int(vat[7]) + 7 * int(vat[8])
903 if check != int(vat[9]):
907 def check_vat_pt(self, vat):
909 Check Portugal VAT number.
921 sum = 9 * int(vat[0]) + 8 * int(vat[1]) + 7 * int(vat[2]) + \
922 6 * int(vat[3]) + 5 * int(vat[4]) + 4 * int(vat[5]) + \
923 3 * int(vat[6]) + 2 * int(vat[7])
924 check = 11 - (sum % 11)
925 if check == 10 or check == 11:
927 # if check != int(vat[8]):
931 def check_vat_ro(self, vat):
933 Check Romania VAT number.
940 if len(vat) >= 2 and len(vat) <= 10:
941 vat = (10 - len(vat)) * '0' + vat
942 sum = 7 * int(vat[0]) + 5 * int(vat[1]) + 3 * int(vat[2]) + \
943 2 * int(vat[3]) + 1 * int(vat[4]) + 7 * int(vat[5]) + \
944 5 * int(vat[6]) + 3 * int(vat[7]) + 2 * int(vat[8])
945 check = (sum * 10) % 11
948 if check != int(vat[9]):
952 if int(vat[0]) not in (1, 2, 3, 4, 6):
954 if int(vat[3:5]) < 1 or int(vat[3:5]) > 12:
956 if int(vat[3:5]) == 2 and int(vat[1:3]) % 4 > 0:
957 if int(vat[5:7]) < 1 or int(vat[5:7]) > 28:
959 if int(vat[3:5]) == 2 and int(vat[1:3]) % 4 == 0:
960 if int(vat[5:7]) < 1 or int(vat[5:7]) > 29:
962 if int(vat[3:5]) in (4, 6, 9, 11):
963 if int(vat[5:7]) < 1 or int(vat[5:7]) > 30:
965 if int(vat[3:5]) in (1, 3, 5, 7, 8, 10, 12):
966 if int(vat[5:7]) < 1 or int(vat[5:7]) > 31:
969 sum = 2 * int(vat[0]) + 7 * int(vat[1]) + 9 * int(vat[2]) + \
970 1 * int(vat[3]) + 4 * int(vat[4]) + 6 * int(vat[5]) + \
971 3 * int(vat[6]) + 5 * int(vat[7]) + 8 * int(vat[8]) + \
972 2 * int(vat[9]) + 7 * int(vat[10]) + 9 * int(vat[11])
976 if check != int(vat[12]):
981 def check_vat_se(self, vat):
983 Check Sweden VAT number.
992 if int(vat[9:11]) < 0:
995 # if int(vat[-2:]) != 1:
998 sum = mult_add(2, int(vat[0])) + int(vat[1]) + \
999 mult_add(2, int(vat[2])) + int(vat[3]) + \
1000 mult_add(2, int(vat[4])) + int(vat[5]) + \
1001 mult_add(2, int(vat[6])) + int(vat[7]) + \
1002 mult_add(2, int(vat[8]))
1003 check = 10 - (sum % 10)
1006 if check != int(vat[9]):
1010 def check_vat_si(self, vat):
1012 Check Slovenia VAT number.
1020 if int(vat[0:7]) <= 999999:
1023 sum = 8 * int(vat[0]) + 7 * int(vat[1]) + 6 * int(vat[2]) + \
1024 5 * int(vat[3]) + 4 * int(vat[4]) + 3 * int(vat[5]) + \
1026 check = 11 - (sum % 11)
1031 if check != int(vat[7]):
1035 def check_vat_sk(self, vat):
1037 Check Slovakia VAT number.
1043 if len(vat) not in(9, 10):
1046 if int(vat[0:2]) == 0 and len(vat) == 10:
1050 if int(vat[0:2]) < 54 or int(vat[0:2]) > 99:
1054 if int(vat[0:2]) > 53 :
1057 if int(vat[2:4]) < 1:
1059 if int(vat[2:4]) > 12 and int(vat[2:4]) < 51:
1061 if int(vat[2:4]) > 62:
1063 if int(vat[2:4]) in (2, 52) and int(vat[0:2]) % 4 > 0:
1064 if int(vat[4:6]) < 1 or int(vat[4:6]) > 28:
1066 if int(vat[2:4]) in (2, 52) and int(vat[0:2]) % 4 == 0:
1067 if int(vat[4:6]) < 1 or int(vat[4:6]) > 29:
1069 if int(vat[2:4]) in (4, 6, 9, 11, 54, 56, 59, 61):
1070 if int(vat[4:6]) < 1 or int(vat[4:6]) > 30:
1072 if int(vat[2:4]) in (1, 3, 5, 7, 8, 10, 12,
1073 51, 53, 55, 57, 58, 60, 62):
1074 if int(vat[4:6]) < 1 or int(vat[4:6]) > 31:
1080 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: