|
17 | 17 | # along with this program. If not, see <https://www.gnu.org/licenses/>. |
18 | 18 | # |
19 | 19 |
|
20 | | -import os.path |
21 | 20 | import uuid |
22 | 21 |
|
23 | 22 | import requests |
|
28 | 27 | from django.core.exceptions import ValidationError |
29 | 28 | from django.core.serializers.json import DjangoJSONEncoder |
30 | 29 | from django.db import models, transaction |
31 | | -from django.utils.functional import cached_property |
32 | 30 | from django.utils.translation import get_language, gettext_lazy, pgettext_lazy |
33 | 31 | from django_countries.fields import CountryField |
34 | 32 | from vies.models import VATINField |
@@ -257,34 +255,6 @@ class Meta: |
257 | 255 | def __str__(self): |
258 | 256 | return f"payment:{self.pk}" |
259 | 257 |
|
260 | | - @cached_property |
261 | | - def is_legacy(self): |
262 | | - return self.invoice.startswith("P") or len(self.invoice) == 6 |
263 | | - |
264 | | - @cached_property |
265 | | - def invoice_filename(self): |
266 | | - if self.is_legacy: |
267 | | - return f"{self.invoice}.pdf" |
268 | | - return f"Weblate_Invoice_{self.invoice}.pdf" |
269 | | - |
270 | | - @cached_property |
271 | | - def invoice_full_filename(self): |
272 | | - if self.is_legacy: |
273 | | - subdir = ("proforma" if self.state == self.PENDING else "pdf",) |
274 | | - invoice_path = settings.PAYMENT_FAKTURACE_LECACY / subdir |
275 | | - else: |
276 | | - invoice_path = ( |
277 | | - settings.PAYMENT_FAKTURACE |
278 | | - / f"{self.created.year}" |
279 | | - / f"{self.created.month:02d}" |
280 | | - ) |
281 | | - full_path = invoice_path / self.invoice_filename |
282 | | - return full_path.as_posix() |
283 | | - |
284 | | - @cached_property |
285 | | - def invoice_filename_valid(self): |
286 | | - return os.path.exists(self.invoice_full_filename) |
287 | | - |
288 | 258 | @property |
289 | 259 | def vat_amount(self): |
290 | 260 | if self.customer.needs_vat and not self.amount_fixed: |
|
0 commit comments