Commits

Rafał Kos  committed 870c3a2

fixes in OPTIMA export

  • Participants
  • Parent commits 9fc41cc

Comments (0)

Files changed (1)

File pytis/lib/printer.py

 import codecs
 from xml.dom.minidom import Document
 from pytis.model.company import Company
+import datetime
 
 '''
 Klasa odpowiedzialna za wydruk dokumentów
             paymentElement.appendChild(self._add_element(document, 'KWOTA_PLN_PLAT', str(invoice.brutto_value * Decimal(repr(invoice.currencyValue or 1))), True))
             paymentElement.appendChild(self._add_element(document, 'KWOTA_PLAT', str(invoice.brutto_value), True))
             paymentElement.appendChild(self._add_element(document, 'KIERUNEK', u'przychód', True))
-            paymentElement.appendChild(self._add_element(document, 'WALUTA_PLAT', invoice.currencySymbol or '', True))
+            paymentElement.appendChild(self._add_element(document, 'WALUTA_PLAT', invoice.currencySymbol or 'PLN', True))
             paymentElement.appendChild(self._add_element(document, 'NOTOWANIE_WALUTY_ILE_PLAT', str(invoice.currencyValue), True))
-            paymentElement.appendChild(self._add_element(document, 'DATA_KURSU', str(invoice.currencyDate), True))
-            paymentElement.appendChild(self._add_element(document, 'DATA_KURSU_PLAT', str(invoice.currencyDate), True))
+            paymentElement.appendChild(self._add_element(document, 'DATA_KURSU', str(invoice.currencyDate or invoice.sellDate), True))
+            paymentElement.appendChild(self._add_element(document, 'DATA_KURSU_PLAT', str(invoice.currencyDate or invoice.sellDate), True))
             payment.appendChild(paymentElement)
         else:
             payment = document.createElement('PLATNOSCI')