Skip to content
This repository has been archived by the owner on Jul 2, 2023. It is now read-only.

Commit

Permalink
Merge pull request #118 from AndresMorelos/1.30.2
Browse files Browse the repository at this point in the history
1.30.2
  • Loading branch information
AndresMorelos authored Jul 28, 2022
2 parents 6169130 + a03c13c commit 866de20
Show file tree
Hide file tree
Showing 23 changed files with 63 additions and 26 deletions.
22 changes: 18 additions & 4 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,7 @@ function setInitialValues() {
quitAtClose: false,
},
invoice: {
exportNamingFormat:
'{invoiceID}',
exportNamingFormat: '{invoiceID}',
exportDir: os.homedir(),
template: 'default',
dateFormat: 'MM/DD/YYYY',
Expand Down Expand Up @@ -533,11 +532,26 @@ function migrateData() {
...configs,
invoice: {
...configs.invoice,
exportNamingFormat:
'{invoiceID}',
exportNamingFormat: '{invoiceID}',
},
};
},
9: (configs) => {
// Return current configs if this is the first time install
const { defaultLanguage } = configs.general;
if (defaultLanguage !== undefined && defaultLanguage === 'esES') {
// Update current configs
return {
...configs,
general: {
...configs.general,
defaultLanguage: 'es-ES',
},
};
}

return configs;
},
};
// Get the current Config
const configs = appConfig.getSync();
Expand Down
2 changes: 1 addition & 1 deletion app/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { getSecretKey, getLoadEncryptedData } from './reducers/LoginReducer'
import Login from './containers/Login';

import windowStateKeeper from '../helpers/windowStateKeeper';
import resize from './helpers/resize'
import './helpers/resize'
import { Notify } from '../helpers/notify'
const ipc = require('electron').ipcRenderer;

Expand Down
18 changes: 17 additions & 1 deletion app/components/form/ItemRow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,25 @@ export class ItemRow extends Component {

uploadRowState() {
const { updateRow, subItems } = this.props;
const { subitems: stateSubItems } = this.state;

const subitemsToAdd = subItems.reduce((acc, item) => {
const subitem = stateSubItems.find((subitem) => subitem.id === item.id);
if (!subitem) {
acc.push(item);
}

if (subitem) {
const itemUpdated = Object.assign(subitem, item);
acc.push(itemUpdated);
}

return acc;
}, []);

updateRow({
...this.state,
subitems: [...subItems, ...this.state.subitems],
subitems: subitemsToAdd,
});
}

Expand Down
4 changes: 2 additions & 2 deletions app/components/settings/General.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ class General extends Component {
<option value="en">
{t('settings:fields:language:en', { lng: 'en' })}
</option>
<option value="esES">
{t('settings:fields:language:esES', { lng: 'esES' })}
<option value="es-ES">
{t('settings:fields:language:es-ES', { lng: 'es-ES' })}
</option>
<option value="fr">
{t('settings:fields:language:fr', { lng: 'fr' })}
Expand Down
2 changes: 1 addition & 1 deletion app/components/settings/_partials/invoice/Other.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const Other = function ({
</ExportDir>
<span style={{ color: '#757D75', fontSize: '13px' }}>
{
'{invoiceID} {createdAt.month} {createdAt.day} {createdAt.year} {date.month} {date.day} {date.year} {UUID}'
'{invoiceID} {createdAt.month} {createdAt.MMMMM} {createdAt.day} {createdAt.year} {date.month} {date.MMMMM} {date.day} {date.year} {UUID}'
}
</span>
</Field>
Expand Down
2 changes: 1 addition & 1 deletion i18n/de/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"de": "Deutsch",
"el": "Griechisch",
"en": "Englisch",
"esES": "Spanisch",
"es-ES": "Spanisch",
"fr": "Französisch",
"id": "Indonesisch",
"it": "Italienisch",
Expand Down
2 changes: 1 addition & 1 deletion i18n/en/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"de": "German",
"el": "Greek",
"en": "English",
"esES": "Spanish",
"es-ES": "Spanish",
"fr": "French",
"id": "Indonesian",
"it": "Italian",
Expand Down
2 changes: 1 addition & 1 deletion i18n/esES/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"de": "German",
"el": "Greek",
"en": "English",
"esES": "Español",
"es-ES": "Español",
"fr": "French",
"id": "Indonesian",
"it": "Italian",
Expand Down
2 changes: 1 addition & 1 deletion i18n/fr/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"de": "Allemand",
"el": "Grec",
"en": "Anglais",
"esES": "Espagnol",
"es-ES": "Espagnol",
"fr": "Français",
"id": "Indonésien",
"it": "Italien",
Expand Down
2 changes: 1 addition & 1 deletion i18n/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ i18n.use(initReactI18next).init({
id,
it,
sk,
esES,
'es-ES': esES,
'ur-PK': urPK,
vi,
'zh-CN': zhCN,
Expand Down
2 changes: 1 addition & 1 deletion i18n/id/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"de": "Jerman",
"el": "Yunani",
"en": "Inggris",
"esES": "Spanyol",
"es-ES": "Spanyol",
"fr": "Perancis",
"id": "Indonesia",
"it": "Italia",
Expand Down
2 changes: 1 addition & 1 deletion i18n/it/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"de": "Tedesco",
"el": "Greco",
"en": "Inglese",
"esES": "Spagnolo",
"es-ES": "Spagnolo",
"fr": "Francese",
"id": "Indonesiano",
"it": "Italiano",
Expand Down
2 changes: 1 addition & 1 deletion i18n/nl/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"de": "Duits",
"el": "Grieks",
"en": "Engels",
"esES": "Spaans",
"es-ES": "Spaans",
"fr": "Frans",
"id": "Indonesisch",
"it": "Italiaans",
Expand Down
2 changes: 1 addition & 1 deletion i18n/ro/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"de": "Germană",
"el": "Greacă",
"en": "Engleză",
"esES": "Spaniolă",
"es-ES": "Spaniolă",
"fr": "Franceză",
"id": "Indoneziană",
"it": "Italiană",
Expand Down
2 changes: 1 addition & 1 deletion i18n/sk/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"de": "Nemecký",
"el": "Grécky",
"en": "Anglický",
"esES": "Španielsky",
"es-ES": "Španielsky",
"fr": "Francúzsky",
"id": "Indonézsky",
"it": "Taliansky",
Expand Down
2 changes: 1 addition & 1 deletion i18n/sr-CS/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"de": "Nemački",
"el": "Grčki",
"en": "Engleski",
"esES": "Španski",
"es-ES": "Španski",
"fr": "Francuski",
"id": "Indonežanski",
"it": "Italijanski",
Expand Down
2 changes: 1 addition & 1 deletion i18n/sr/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"de": "Немачки",
"el": "Грчки",
"en": "Енглески",
"esES": "Шпански",
"es-ES": "Шпански",
"fr": "Француски",
"id": "Индонежански",
"it": "Италијански",
Expand Down
2 changes: 1 addition & 1 deletion i18n/ur-PK/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"de": "German",
"el": "Greek",
"en": "English",
"esES": "Español",
"es-ES": "Español",
"fr": "French",
"id": "Indonesian",
"it": "Italian",
Expand Down
2 changes: 1 addition & 1 deletion i18n/vi/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"de": "Tiếng Đức",
"el": "Tiếng Hy Lạp",
"en": "Tiếng Anh",
"esES": "Español",
"es-ES": "Español",
"fr": "Tiếng Pháp",
"id": "Tiếng Indonesia",
"it": "Tiếng Ý",
Expand Down
2 changes: 1 addition & 1 deletion i18n/zh-CN/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"de": "德语",
"el": "希腊文",
"en": "英语",
"esES": "西班牙文",
"es-ES": "西班牙文",
"fr": "法语",
"id": "印度尼西亚文",
"it": "意大利文",
Expand Down
7 changes: 7 additions & 0 deletions main/save-pdf.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ const fs = require('fs');
const { truncate } = require('lodash');
const { v4 } = require('uuid');



function createExportName(format, invoice) {
const defaultLanguage = appConfig.getSync('general.language');

const createdAt = new Date(invoice.created_at);
const currentDate = new Date();
format = format.replace(
Expand All @@ -18,10 +22,13 @@ function createExportName(format, invoice) {
omission: '',
})
);

format = format.replace(/{createdAt.month}/g, createdAt.getMonth() + 1);
format = format.replace(/{createdAt.MMMM}/g, createdAt.toLocaleString(defaultLanguage, { month: 'long' }));
format = format.replace(/{createdAt.day}/g, createdAt.getDate());
format = format.replace(/{createdAt.year}/g, createdAt.getFullYear());
format = format.replace(/{date.month}/g, currentDate.getMonth() + 1);
format = format.replace(/{date.MMMM}/g, currentDate.toLocaleString(defaultLanguage, { month: 'long' }));
format = format.replace(/{date.day}/g, currentDate.getDate());
format = format.replace(/{date.year}/g, currentDate.getFullYear());
format = format.replace(/{UUID}/g, v4());
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "invoncify",
"homepage": "https://invoncify.andresmorelos.me",
"productName": "Invoncify",
"version": "1.30.1",
"version": "1.30.2",
"license": "GPL-3.0",
"description": "Flexible invoicing desktop app with beautiful & customizable templates",
"author": {
Expand Down
2 changes: 1 addition & 1 deletion preview/components/sidebar/Language.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const Language = function({ t, language, handleInputChange, UILang }) {
<select name="language" value={language} onChange={handleInputChange}>
<option value="de">{t('settings:fields:language:de', { lng: 'de' })}</option>
<option value="en">{t('settings:fields:language:en', { lng: 'en' })}</option>
<option value="esES">{t('settings:fields:language:esES', { lng: 'esES' })}</option>
<option value="es-ES">{t('settings:fields:language:es-ES', { lng: 'es-ES' })}</option>
<option value="fr">{t('settings:fields:language:fr', { lng: 'fr' })}</option>
<option value="id">{t('settings:fields:language:id', { lng: 'id' })}</option>
<option value="it">{t('settings:fields:language:it', { lng: 'it' })}</option>
Expand Down

0 comments on commit 866de20

Please sign in to comment.