diff --git a/public/assets/i18n/en/period.json b/public/assets/i18n/en/period.json index 7d68ab8..08baa94 100644 --- a/public/assets/i18n/en/period.json +++ b/public/assets/i18n/en/period.json @@ -1,7 +1,8 @@ { - "invoices": "Invoices have been or have to be invoices for a period from {{from}} to {{to}}.", - "text": "If a part of this period is over and related invoices have been billed, you can close the timeframe.", - "text-more": "This function can be useful for example when you want to close an accounting year.", + "invoices": "Invoices have been or need to be issued for the period from {{from}} to {{to}}.", + "no_invoices": "Invoices are issued or need to be issued for an unspecified period.", + "text": "If a portion of this period has elapsed and the related invoices have been issued, you may close the timeframe.", + "text-more": "This function can be useful, for instance, when you need to close an accounting year.", "close": "Close selected period", "alert": { "warning": "WARNING", diff --git a/src/pages/period/Period.tsx b/src/pages/period/Period.tsx index 5220b2a..fe76558 100644 --- a/src/pages/period/Period.tsx +++ b/src/pages/period/Period.tsx @@ -93,6 +93,24 @@ const Period: React.FC = () => { await initPeriod(); }; + const renderPeriod = () => { + if (period?.from === undefined && period?.to === undefined) { + return

{t('period:no_invoices')}

; + } + + return ( +

+ ); + }; + return ( @@ -106,15 +124,7 @@ const Period: React.FC = () => { -

+ {renderPeriod()}

{t('period:text')}