Skip to content

Commit

Permalink
fix(journal): right align edit modal footer
Browse files Browse the repository at this point in the history
This commit right-aligns the currencies in the edit modal footer.
  • Loading branch information
jniles committed Sep 25, 2017
1 parent a4a0c0e commit 413f5af
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ SESS_RESAVE=0
SESS_UNSET='destroy'

LOG_LEVEL='warn'
# LOG_LEVEL='debug'
UPLOAD_DIR='client/upload'
LOG_LEVEL='debug'
# UPLOAD_DIR='client/upload'

# this will toggle all MYSQL errors to be reflected to the client.
LOG_ALL_MYSQL_ERRORS=0
Expand Down
2 changes: 2 additions & 0 deletions client/src/modules/journal/modals/editTransaction.modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ function JournalEditTransactionController(
field : 'debit_equiv',
displayName : 'TABLE.COLUMNS.DEBIT',
cellClass : 'text-right',
footerCellClass : 'text-right',
headerCellFilter : 'translate',
type : 'number',
aggregationHideLabel : true,
Expand All @@ -64,6 +65,7 @@ function JournalEditTransactionController(
field : 'credit_equiv',
displayName : 'TABLE.COLUMNS.CREDIT',
cellClass : 'text-right',
footerCellClass : 'text-right',
headerCellFilter : 'translate',
enableFiltering : true,
type : 'number',
Expand Down
15 changes: 9 additions & 6 deletions server/controllers/finance/journal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -568,15 +568,18 @@ function getTransactionDate(changedRows = {}, oldRows) {
* @param {object} params - { uuids: [...], comment: '' }
*/
function commentPostingJournal(req, res, next) {
const { params } = req.body;
const uuids = params.uuids.map(db.bid);

const { uids, comment } = req.body.params;
const uuids = uids.map(db.bid);
const sql = 'UPDATE posting_journal SET comment = ? WHERE uuid IN ?';
db.exec(sql, [params.comment, [uuids]])

db.exec(sql, [comment, [uuids]])
.then((rows) => {
if (!rows.affectedRows || rows.affectedRows !== uuids.length) {
throw new BadRequest('Error on update posting journal comment');
const updatedWithSuccess = rows.affectedRows && rows.affectedRows === uuids.length;

if (!updatedWithSuccess) {
throw new BadRequest('Error on update posting journal comment.');
}

res.sendStatus(200);
})
.catch(next)
Expand Down

0 comments on commit 413f5af

Please sign in to comment.