mirror of
https://github.com/inventree/InvenTree.git
synced 2025-05-01 21:16:46 +00:00
commit
8301eb3be3
@ -703,7 +703,7 @@ class PriceBreak(models.Model):
|
|||||||
price = MoneyField(
|
price = MoneyField(
|
||||||
max_digits=19,
|
max_digits=19,
|
||||||
decimal_places=4,
|
decimal_places=4,
|
||||||
default_currency='USD',
|
default_currency=currency_code_default(),
|
||||||
null=True,
|
null=True,
|
||||||
verbose_name=_('Price'),
|
verbose_name=_('Price'),
|
||||||
help_text=_('Unit price at specified quantity'),
|
help_text=_('Unit price at specified quantity'),
|
||||||
|
@ -14,7 +14,7 @@ import django.forms
|
|||||||
import djmoney.settings
|
import djmoney.settings
|
||||||
from djmoney.forms.fields import MoneyField
|
from djmoney.forms.fields import MoneyField
|
||||||
|
|
||||||
import common.settings
|
from common.settings import currency_code_default
|
||||||
|
|
||||||
from .models import Company
|
from .models import Company
|
||||||
from .models import ManufacturerPart
|
from .models import ManufacturerPart
|
||||||
@ -38,7 +38,7 @@ class EditCompanyForm(HelperForm):
|
|||||||
label=_('Currency'),
|
label=_('Currency'),
|
||||||
help_text=_('Default currency used for this company'),
|
help_text=_('Default currency used for this company'),
|
||||||
choices=[('', '----------')] + djmoney.settings.CURRENCY_CHOICES,
|
choices=[('', '----------')] + djmoney.settings.CURRENCY_CHOICES,
|
||||||
initial=common.settings.currency_code_default,
|
initial=currency_code_default,
|
||||||
)
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
@ -116,7 +116,7 @@ class EditSupplierPartForm(HelperForm):
|
|||||||
|
|
||||||
single_pricing = MoneyField(
|
single_pricing = MoneyField(
|
||||||
label=_('Single Price'),
|
label=_('Single Price'),
|
||||||
default_currency='USD',
|
default_currency=currency_code_default(),
|
||||||
help_text=_('Single quantity price'),
|
help_text=_('Single quantity price'),
|
||||||
decimal_places=4,
|
decimal_places=4,
|
||||||
max_digits=19,
|
max_digits=19,
|
||||||
|
@ -17,6 +17,8 @@ from django.contrib.auth.models import User
|
|||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
|
from common.settings import currency_code_default
|
||||||
|
|
||||||
from markdownx.models import MarkdownxField
|
from markdownx.models import MarkdownxField
|
||||||
|
|
||||||
from djmoney.models.fields import MoneyField
|
from djmoney.models.fields import MoneyField
|
||||||
@ -664,7 +666,7 @@ class PurchaseOrderLineItem(OrderLineItem):
|
|||||||
purchase_price = MoneyField(
|
purchase_price = MoneyField(
|
||||||
max_digits=19,
|
max_digits=19,
|
||||||
decimal_places=4,
|
decimal_places=4,
|
||||||
default_currency='USD',
|
default_currency=currency_code_default(),
|
||||||
null=True, blank=True,
|
null=True, blank=True,
|
||||||
verbose_name=_('Purchase Price'),
|
verbose_name=_('Purchase Price'),
|
||||||
help_text=_('Unit purchase price'),
|
help_text=_('Unit purchase price'),
|
||||||
@ -693,7 +695,7 @@ class SalesOrderLineItem(OrderLineItem):
|
|||||||
sale_price = MoneyField(
|
sale_price = MoneyField(
|
||||||
max_digits=19,
|
max_digits=19,
|
||||||
decimal_places=4,
|
decimal_places=4,
|
||||||
default_currency='USD',
|
default_currency=currency_code_default(),
|
||||||
null=True, blank=True,
|
null=True, blank=True,
|
||||||
verbose_name=_('Sale Price'),
|
verbose_name=_('Sale Price'),
|
||||||
help_text=_('Unit sale price'),
|
help_text=_('Unit sale price'),
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block details %}
|
{% block details %}
|
||||||
{% settings_value "INVENTREE_DEFAULT_CURRENCY" as currency %}
|
{% default_currency as currency %}
|
||||||
|
|
||||||
{% crispy form %}
|
{% crispy form %}
|
||||||
|
|
||||||
@ -130,7 +130,7 @@ the part single price shown is the current price for that supplier part"></i></h
|
|||||||
{% block js_ready %}
|
{% block js_ready %}
|
||||||
{{ block.super }}
|
{{ block.super }}
|
||||||
|
|
||||||
{% settings_value "INVENTREE_DEFAULT_CURRENCY" as currency %}
|
{% default_currency as currency %}
|
||||||
{% if price_history %}
|
{% if price_history %}
|
||||||
var pricedata = {
|
var pricedata = {
|
||||||
labels: [
|
labels: [
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
{% extends "modal_form.html" %}
|
{% extends "modal_form.html" %}
|
||||||
|
|
||||||
{% load i18n %}
|
{% load i18n inventree_extras %}
|
||||||
|
|
||||||
{% block pre_form_content %}
|
{% block pre_form_content %}
|
||||||
|
{% default_currency as currency %}
|
||||||
<table class='table table-striped table-condensed table-price-two'>
|
<table class='table table-striped table-condensed table-price-two'>
|
||||||
<tr>
|
<tr>
|
||||||
<td><b>{% trans 'Part' %}</b></td>
|
<td><b>{% trans 'Part' %}</b></td>
|
||||||
|
@ -18,6 +18,7 @@ from InvenTree import version, settings
|
|||||||
import InvenTree.helpers
|
import InvenTree.helpers
|
||||||
|
|
||||||
from common.models import InvenTreeSetting, ColorTheme
|
from common.models import InvenTreeSetting, ColorTheme
|
||||||
|
from common.settings import currency_code_default
|
||||||
|
|
||||||
register = template.Library()
|
register = template.Library()
|
||||||
|
|
||||||
@ -161,6 +162,12 @@ def inventree_credits_url(*args, **kwargs):
|
|||||||
return "https://inventree.readthedocs.io/en/latest/credits/"
|
return "https://inventree.readthedocs.io/en/latest/credits/"
|
||||||
|
|
||||||
|
|
||||||
|
@register.simple_tag()
|
||||||
|
def default_currency(*args, **kwargs):
|
||||||
|
""" Returns the default currency code """
|
||||||
|
return currency_code_default()
|
||||||
|
|
||||||
|
|
||||||
@register.simple_tag()
|
@register.simple_tag()
|
||||||
def setting_object(key, *args, **kwargs):
|
def setting_object(key, *args, **kwargs):
|
||||||
"""
|
"""
|
||||||
|
@ -20,6 +20,8 @@ from django.contrib.auth.models import User
|
|||||||
from django.db.models.signals import pre_delete
|
from django.db.models.signals import pre_delete
|
||||||
from django.dispatch import receiver
|
from django.dispatch import receiver
|
||||||
|
|
||||||
|
from common.settings import currency_code_default
|
||||||
|
|
||||||
from markdownx.models import MarkdownxField
|
from markdownx.models import MarkdownxField
|
||||||
|
|
||||||
from mptt.models import MPTTModel, TreeForeignKey
|
from mptt.models import MPTTModel, TreeForeignKey
|
||||||
@ -534,7 +536,7 @@ class StockItem(MPTTModel):
|
|||||||
purchase_price = MoneyField(
|
purchase_price = MoneyField(
|
||||||
max_digits=19,
|
max_digits=19,
|
||||||
decimal_places=4,
|
decimal_places=4,
|
||||||
default_currency='USD',
|
default_currency=currency_code_default(),
|
||||||
blank=True,
|
blank=True,
|
||||||
null=True,
|
null=True,
|
||||||
verbose_name=_('Purchase Price'),
|
verbose_name=_('Purchase Price'),
|
||||||
|
@ -1 +1,2 @@
|
|||||||
{% if currency %}{{ currency.symbol }}{% endif %}{{ price }}{% if currency %} {{ currency.suffix }}{% endif %}
|
{% load djmoney %}
|
||||||
|
{% money_localize price currency %}
|
Loading…
x
Reference in New Issue
Block a user