Prechádzať zdrojové kódy

added other tax to body

vnc-console 7 mesiacov pred
rodič
commit
2d97c85baa

+ 23 - 0
winmentor/dbread.py

@@ -656,6 +656,29 @@ class WinMentor(object):
             #     tt -= account.soldf('d')
         return round(tt)
 
+    def other_tax_payable(self, acc_list, accounts='446.08') -> int:
+        '''returns dividend TAX payable in current month
+        :param account_list is account from ncont.db'''
+        tt = 0
+        # acc_1, acc_2 = accounts
+        for acc in acc_list:
+            account = Account(clasa=acc[0],
+                              simbol=acc[1],
+                              denumire=acc[2],
+                              soldid=acc[3],
+                              soldic=acc[4],
+                              precedentd=acc[5],
+                              precedentc=acc[6],
+                              curentd=acc[7],
+                              curentc=acc[8])
+            payable = account.simbol == accounts
+            # deductible = account.simbol == acc_2
+            if payable:
+                tt += account.curentc
+            # elif deductible:
+            #     tt -= account.soldf('d')
+        return round(tt)
+
     def advance_final(self, acc_list, accounts='542') -> int:
         '''returns final dvances/year
         :param account_list is account from ncont.db'''

+ 4 - 1
winmentor/tax_mailer.py

@@ -82,6 +82,7 @@ class M_mailer(object):
                         cam = mentor.cam_payable(account)
                         tax_payable = mentor.tax_payable(account)
                         div_tax = mentor.div_tax_payable(account)
+                        other_tax = mentor.other_tax_payable(account)
                         an_inc = mentor.an_inc(account, 0, 6, 8)
                         result = mentor.result(account, 0, 6, 8)
                         vat_period = M_mailer.get_vat_period(company[10].split(sep=',')[0])
@@ -94,15 +95,17 @@ class M_mailer(object):
                                 'cam': cam,
                                 'tax_payable': tax_payable,
                                 'div_tax': div_tax,
+                                'other_tax': other_tax,
                                 'an_inc': an_inc,
                                 'result': result,
                                 'tax_type': tax_type,
                                 'vat_period': vat_period,
                                 'due_date': M_mailer.due_date()}
                         body = M_mailer.template.render(data)
+                        # print(body)
                         self._body = body
                         tax = Taxes(name=name, vat=vat, vat_final=vat_final, contribs=contr,
-                                    cam=cam, income_tax=tax_payable, dividend_tax=div_tax,
+                                    cam=cam, income_tax=tax_payable, dividend_tax=div_tax, other_tax=other_tax,
                                     return_=an_inc, result=result, tax_type=tax_type, period=M_mailer.mentor_date)
                         taxes.append(tax)
                         if send:

+ 3 - 0
winmentor/taxes.py

@@ -9,6 +9,7 @@ class Taxes(object):
                  cam: int=None,
                  income_tax: int=None,
                  dividend_tax: int=None,
+                 other_tax: int=None,
                  return_: int=None,
                  result: int=None,
                  tax_type: str=None,
@@ -21,6 +22,7 @@ class Taxes(object):
         self.cam = cam
         self.income_tax = income_tax
         self.dividend_tax = dividend_tax
+        self.other_tax = other_tax
         self.return_ = return_
         self.result = result
         self.tax_type = tax_type
@@ -35,6 +37,7 @@ class Taxes(object):
         s += 'CAM: *{}*\n'.format(self.cam)
         s += 'Impozit {}: *{}*\n'.format(self.tax_type, self.income_tax)
         s += 'Impozit dividende: *{}*\n'.format(self.dividend_tax)
+        s += 'Alte impozite: *{}*\n'.format(self.other_tax)
         s += 'Cont salarii/impozit micro/profit/dividende: *RO14TREZ2165503XXXXXXXXX*\n'
         s += 'Cont TVA: *RO32TREZ21620A100101XTVA*\n'
         s += 'Cont CAM: *RO54TREZ21620A470300XXXX*'

+ 3 - 1
winmentor/templates/body.html

@@ -7,12 +7,14 @@
 	<span style="color:Tomato">TVA:</span> <b>{{ vat }}</b>
 	<span style="color:Tomato">TVA final:</span> <b>{{ vat_final }}</b>
 	<span style="color:Tomato">Impozit pe {{ tax_type }}:</span> <b>{{ tax_payable }}</b>
+	<span style="color:Tomato">Impozit pe dividende:</span> <b>{{ div_tax }}</b>
+	<span style="color:Tomato">Alte impozite:</span> <b>{{ other_tax }}</b>
 	
 	<b>Salarii:</b>
 	<span style="color:Tomato">Contributii:</span> <b>{{ contr }}</b>
 	<span style="color:Tomato">CAM:</span> <b>{{ cam }}</b>
 	
-	<span style="color:Tomato">Total taxe:</span> <b>{{ vat + tax_payable + contr + cam }}</b>
+	<span style="color:Tomato">Total taxe:</span> <b>{{ vat + tax_payable + contr + cam + div_tax + other_tax}}</b>
 	<span style="color:Tomato">Perioada Tva:</span> {{ vat_period }}
 	<span style="color:Tomato">Scadenta platii:</span> {{ due_date }}