Skip to content

Commit

Permalink
fix(journal): render currency text
Browse files Browse the repository at this point in the history
This commit renders the currency text instead of currency_id in the
posting journal for a better UX.
  • Loading branch information
Jonathan Niles committed Oct 6, 2016
1 parent cbbd628 commit f4d64ff
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
7 changes: 1 addition & 6 deletions client/src/partials/journal/journal.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,8 @@ function JournalController(Journal, Sorting, Grouping, Filtering, Columns, Confi
enableCellEdit: false,
allowCellFocus: false
},

// @todo this should be formatted as a currency icon vs. an ID
{ field : 'currency_id', displayName : 'TABLE.COLUMNS.CURRENCY', headerCellFilter: 'translate', visible: false, enableCellEdit: false},

// @todo this should be formatted showing the debtor/creditor
{ field : 'currencyName', displayName : 'TABLE.COLUMNS.CURRENCY', headerCellFilter: 'translate', visible: false, enableCellEdit: false},
{ field : 'hrEntity', displayName : 'TABLE.COLUMNS.RECIPIENT', headerCellFilter: 'translate', visible: true},

{ field : 'hrReference', displayName : 'TABLE.COLUMNS.REFERENCE', headerCellFilter: 'translate', visible: true },
{ field : 'user', displayName : 'TABLE.COLUMNS.RESPONSIBLE', headerCellFilter: 'translate', visible: false, enableCellEdit: false },
{ field : 'actions', displayName : '', headerCellFilter: 'translate', visible: true, enableCellEdit: false, cellTemplate: '/partials/journal/templates/actions.cell.html', allowCellFocus: false }
Expand Down
8 changes: 2 additions & 6 deletions server/controllers/finance/journal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function list(req, res, next) {
SELECT BUID(p.uuid) AS uuid, p.project_id, p.fiscal_year_id, p.period_id,
p.trans_id, p.trans_date, BUID(p.record_uuid) AS record_uuid,
dm1.text AS hrRecord, p.description, p.account_id, p.debit, p.credit,
p.debit_equiv, p.credit_equiv, p.currency_id,
p.debit_equiv, p.credit_equiv, p.currency_id, c.name AS currencyName,
BUID(p.entity_uuid) AS entity_uuid, em.text AS hrEntity,
BUID(p.reference_uuid) AS reference_uuid, dm2.text AS hrReference,
p.comment, p.origin_id, p.user_id, p.cc_id, p.pc_id, pro.abbr,
Expand All @@ -83,6 +83,7 @@ function list(req, res, next) {
JOIN period per ON per.id = p.period_id
JOIN account a ON a.id = p.account_id
JOIN user u ON u.id = p.user_id
JOIN currency c ON c.id = p.currency_id
LEFT JOIN entity_map em ON em.uuid = p.entity_uuid
LEFT JOIN document_map dm1 ON dm1.uuid = p.record_uuid
LEFT JOIN document_map dm2 ON dm2.uuid = p.reference_uuid
Expand Down Expand Up @@ -119,11 +120,6 @@ function getTransaction (req, res, next){
* POST /journal/:uuid/reverse
*/
function reverse(req, res, next) {
<<<<<<< 3fa08c9a78e043908319ddaad1dc050257f02b0d
=======
const uid = db.bid(req.params.uuid);
const userId = req.session.user.id;
>>>>>>> feat(entities): introduce entity_map

const voucherUuid = uuid.v4();
const params = [
Expand Down
1 change: 1 addition & 0 deletions sh/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ mysql -h $DB_HOST -u root -e "FLUSH PRIVILEGES;"
mysql -h $DB_HOST -u root -e "DROP SCHEMA IF EXISTS $DB_NAME;"
mysql -h $DB_HOST -u $DB_USER -p$DB_PASS -e "CREATE SCHEMA $DB_NAME CHARACTER SET utf8 COLLATE utf8_unicode_ci;"
mysql -h $DB_HOST -u $DB_USER -p$DB_PASS $DB_NAME < server/models/schema.sql
mysql -h $DB_HOST -u $DB_USER -p$DB_PASS $DB_NAME < server/models/triggers.sql
mysql -u $DB_USER -u $DB_USER -p$DB_PASS $DB_NAME < server/models/functions.sql
mysql -u $DB_USER -u $DB_USER -p$DB_PASS $DB_NAME < server/models/procedures.sql
mysql -u $DB_USER -u $DB_USER -p$DB_PASS $DB_NAME < server/models/debug.sql
Expand Down

0 comments on commit f4d64ff

Please sign in to comment.