Skip to content

Commit

Permalink
feat: add edited flag to client
Browse files Browse the repository at this point in the history
This commit adds the edited flag at the top of the record dropdowns for
cash, vouchers, and invoices.  The icon and text denote that the record
has been modified at the Journal and the receipt is likely out of date.

Closes #2047.
  • Loading branch information
jniles committed Nov 17, 2017
1 parent 3b1feda commit debc432
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 43 deletions.
41 changes: 21 additions & 20 deletions client/src/i18n/en/form.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,66 +106,67 @@
"INFO": {
"BY": "by",
"CANCEL_CASH": "Cancellation of payment",
"CLOSE_FISCAL_YEAR": "Close fiscal year",
"CLEAR_FILTERS": "Remove Filters",
"CLOSED": "Closed",
"CLOSE_FISCAL_YEAR": "Close fiscal year",
"CREATED": "Created",
"CREATE_SUCCESS": "Successfully created a new record",
"CURRENT": "Current",
"CLEAR_FILTERS": "Remove Filters",
"CREDIT_NOTE": "Credit Note",
"CREDIT_NOTE_INVOICE": "Credit Note reversing invoice {{ invoiceReference }} of debtor {{ debtorName }} ({{ debtorIdentifier }}). {{ description }}",
"CURRENT": "Current",
"DANGER_ZONE": "Danger Zone",
"DELETE_RECORD_SUCCESS": "Successfully deleted the record.",
"DELETE_SUCCESS": "Successfully deleted a record",
"DISABLED_CURRENCY": "This currency is unusable since there is no account set for it. Use the Cashbox Management module to set an account for this currency and cashbox.",
"EDITED" : "Edited",
"ENTITY_NOT_FOUND": "Entity (Debtor/Creditor) Not Found",
"EXPORT_SUCCESS": "Successfully exported",
"FINANCIAL_DETAIL": "Financial details",
"FOUND": "Found",
"GRID_STATE_SUCCESS": "Grid settings saved",
"GROUPS_DEBTOR": "Assign a new debtor group from the options below. Press 'confirm' to permanently update the patient's debtor group",
"GROUPS_PATIENT": "Assign the patient to patient groups from the options below. Press 'confirm' to permanently update the patient's subscribed groups.",
"ITEMS_FULL": "There are no additional inventory items that be assigned to this invoice.",
"INVOICES": "Invoices",
"IMPORT_SUCCESS": "Successfully Imported",
"GRID_STATE_SUCCESS": "Grid settings saved",
"INVOICES": "Invoices",
"ITEMS_FULL": "There are no additional inventory items that be assigned to this invoice.",
"LOADING": "Loading",
"MANY_TRYS": "Many tries",
"MAX_LOT_REACHED": "Max lot reached",
"NOT_CONFIGURED": "The accounts for this currency have not been configured yet.",
"NOTE": "Note",
"NO_SOURCE": "No source defined",
"NOT_CONFIGURED": "The accounts for this currency have not been configured yet.",
"NO_DESTINATION": "No destination defined",
"NO_FILTERS_APPLIED": "No filters applied",
"NO_INVOICES_SELECTED": "No invoices selected",
"NO_INVENTORY_PO" : "No product in Stock requires purchase order",
"NO_INVOICES_SELECTED": "No invoices selected",
"NO_RECIPIENT": "An invoice must have a recipient before assigning items.",
"NO_SUPPLIER": "A purchase order must have a supplier before specifying items.",
"NO_RECORDS_DATABASE": "There are no records in the database for this query",
"OPERATION_SUCCESS": "Operation performed successfully",
"NO_SOURCE": "No source defined",
"NO_SUPPLIER": "A purchase order must have a supplier before specifying items.",
"NUM_TRANSACTION": "Number of transactions",
"OF": "of",
"OPERATION_SUCCESS": "Operation performed successfully",
"OTHER_ACTIONS": "Other Actions",
"NUM_TRANSACTION": "Number of transactions",
"PATIENTS": "Patients",
"PATIENT_FOUND": "Patient Found",
"PATIENT_NOT_FOUND": "Patient Not Found",
"ENTITY_NOT_FOUND": "Entity (Debtor/Creditor) Not Found",
"PATIENT_SUCC_TRANSFERRED": "The patient's image was successfully uploaded.",
"PAYMENT": "Cash Payment",
"PREVIOUS": "Previous",
"ROWS": "rows",
"SALE_DETAILS": "Sale Details",
"SAVE_SUCCESS": "Save success",
"EXPORT_SUCCESS": "Successfully exported",
"SEARCH": "Search",
"SHOWING": "Showing",
"TRANSACTIONS": "Transactions",
"TRANSACTION_REVER_SUCCESS": "This transaction was reversed with success",
"UNAUTHORIZED": "Unauthorized",
"UNPOSTED_TRANSACTION": "Non-posted transaction(s) not shown",
"ROWS": "rows",
"TRANSACTIONS": "Transactions",
"UPDATE_SUCCESS": "Updated successfully",
"UPLOAD_PICTURE_FAILED": "The selected file is not an picture",
"VIEW_BEGINNING_BALANCE": "View Beginning Balance",
"VIEW_CLOSING_BALANCE": "View Closing Balance",
"DELETE_RECORD_SUCCESS": "Successfully deleted the record.",
"USER_CASHBOX": "These are the cashboxes that you have permission for manage",
"USER_DEPOT": "These are the depots that you have permission for manage",
"USER_CASHBOX": "These are the cashboxes that you have permission for manage"
"VIEW_BEGINNING_BALANCE": "View Beginning Balance",
"VIEW_CLOSING_BALANCE": "View Closing Balance"
},
"LABELS": {
"ABBREVIATION": "Abbreviation",
Expand Down
31 changes: 16 additions & 15 deletions client/src/i18n/fr/form.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,65 +107,66 @@
"BY": "Par",
"CANCEL_CASH": "Annulation de paiement",
"CLEAR_FILTERS": "Supprimer les filtres",
"CLOSE_FISCAL_YEAR": "Clôturer l'année fiscale",
"CLOSED": "Fermée",
"CLOSE_FISCAL_YEAR": "Clôturer l'année fiscale",
"CREATED": "Crée",
"CREATE_SUCCESS": "Crée avec succès",
"CREDIT_NOTE": "Note de crédit",
"CREDIT_NOTE_INVOICE": "Note de credit concernant la facture {{ invoiceReference }} de debiteur {{ debtorName }} ({{ debtorIdentifier }}). {{ description }}",
"CURRENT": "Actuel",
"DANGER_ZONE": "Zone Dangereuse",
"DELETE_RECORD_SUCCESS": "Suppression de la transaction avec succès.",
"DELETE_SUCCESS": "Suppression avec succès",
"DISABLED_CURRENCY": "Cette monnaie est inutilisable car il n'y a pas de compte fixée pour elle. Utilisez le module Box Cash Management pour définir un compte pour cette monnaie et caisse.",
"ENTITY_NOT_FOUND": "Entité (Debiteur/Crediteur) Non Trouvé",
"EXPORT_SUCCESS": "Exportation avec succes",
"EDITED" : "Édité",
"FINANCIAL_DETAIL": "Détails financieres",
"FOUND": "Trouvée",
"GRID_STATE_SUCCESS": "Enregistrement avec succès",
"GROUPS_DEBTOR": "Attribuez un nouveau groupe de débiteur parmi les options ci-dessous. Appuyez sur 'confirmer' pour une mise à jour permanente du groupe de débiteur du patient",
"GROUPS_PATIENT": "Attribuer le patient à des groupes parmi les options ci-dessous. Appuyez sur 'confirmer' pour une mise à jour permanente des groupes souscrites du patient.",
"IMPORT_SUCCESS": "Importation avec succes",
"GRID_STATE_SUCCESS": "Enregistrement avec succès",
"INVOICES": "Factures",
"ITEMS_FULL": "Il n'y a pas d'articles supplémentaires qui seront affectés à cette facture.",
"LOADING": "Chargement en cours",
"MANY_TRYS": "Plusieurs tentatives",
"MAX_LOT_REACHED": "Lot maximal atteint",
"NOT_CONFIGURED": "Les comptes ne sont pas configuree.",
"NOTE": "Note",
"NO_SOURCE": "Aucune source definie",
"NOT_CONFIGURED": "Les comptes ne sont pas configuree.",
"NO_DESTINATION": "Aucune destination definie",
"NO_FILTERS_APPLIED": "Aucun filtrage des données",
"NO_INVENTORY_PO" : "Aucun Article en Stock nécessite une commande d'achat",
"NO_INVOICES_SELECTED": "Aucune facture sélectionnée",
"NO_RECIPIENT": "Une facture doit appartenir à une personne avant d'assigner les éléments.",
"NO_RECORDS_DATABASE": "Il n'y a pas d'enregistrements dans la base de données correspondant à cette requête",
"NO_INVENTORY_PO" : "Aucun Article en Stock nécessite une commande d'achat",
"NO_SOURCE": "Aucune source definie",
"NO_SUPPLIER": "Un ordre d'achat doit avoir un fournisseur avant de préciser les éléments.",
"NUM_TRANSACTION": "Nombres des transactions",
"OPERATION_SUCCESS": "Opération effectuée avec succès",
"OF": "de",
"OPERATION_SUCCESS": "Opération effectuée avec succès",
"OTHER_ACTIONS": "Autres actions",
"PATIENTS": "Patients",
"PATIENT_FOUND": "Patient Trouvé",
"PATIENT_NOT_FOUND": "Patient Non Trouvé",
"ENTITY_NOT_FOUND": "Entité (Debiteur/Crediteur) Non Trouvé",
"PATIENT_SUCC_TRANSFERRED": "L'image du patient a été transféré avec succès",
"PAYMENT": "Référence du Paiement",
"PREVIOUS": "Précédent",
"ROWS": "enregistrements",
"SALE_DETAILS": "Détaille de la Facture",
"SAVE_SUCCESS": "Enregistrement avec succès",
"EXPORT_SUCCESS": "Exportation avec succes",
"SEARCH": "Recherche",
"SHOWING": "Aperçue",
"TRANSACTIONS": "Transactions",
"TRANSACTION_REVER_SUCCESS": "Cette transaction a été Annulée avec succès",
"UNAUTHORIZED": "Non autorisée",
"UNPOSTED_TRANSACTION": "Transactions non-posté ne sont pas affichées",
"UPDATE_SUCCESS": "Mise à jour avec succès",
"UPLOAD_PICTURE_FAILED": "Le fichier selectionné n'est pas une image",
"VIEW_BEGINNING_BALANCE": "Aperçue de la balance d'ouverture",
"VIEW_CLOSING_BALANCE": "Aperçue de la balance de cloture",
"UNPOSTED_TRANSACTION": "Transactions non-posté ne sont pas affichées",
"TRANSACTIONS": "Transactions",
"ROWS": "enregistrements",
"DELETE_RECORD_SUCCESS": "Suppression de la transaction avec succès.",
"USER_CASHBOX": "Voici les caisses dont vous avez la permission de gérer",
"USER_DEPOT": "Voici les dépôts dont vous avez la permission de gérer",
"USER_CASHBOX": "Voici les caisses dont vous avez la permission de gérer"
"VIEW_BEGINNING_BALANCE": "Aperçue de la balance d'ouverture",
"VIEW_CLOSING_BALANCE": "Aperçue de la balance de cloture"
},
"LABELS": {
"ABBREVIATION": "Abbreviation",
Expand Down
10 changes: 8 additions & 2 deletions client/src/modules/cash/payments/templates/action.cell.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@
<span class="caret"></span>
</a>

<ul data-row-menu="{{ row.entity.reference }}"class="dropdown-menu-right" bh-dropdown-menu-auto-dropup uib-dropdown-menu>
<li class="dropdown-header">{{row.entity.reference}}</li>
<ul data-row-menu="{{ row.entity.reference }}" class="dropdown-menu-right" bh-dropdown-menu-auto-dropup uib-dropdown-menu>
<li class="dropdown-header">
{{row.entity.reference}}
<span ng-show="row.entity.edited" class="text-primary">
<i class="fa fa-pencil"></i>
<span translate>FORM.INFO.EDITED</span>
</span>
</li>
<li>
<a href data-method="receipt" ng-click="grid.appScope.openReceiptModal(row.entity.uuid)">
<i class="fa fa-file-pdf-o"></i> <span translate>TABLE.COLUMNS.RECEIPT</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@
</a>

<ul data-row-menu="{{ row.entity.reference }}" class="dropdown-menu-right" bh-dropdown-menu-auto-dropup uib-dropdown-menu>
<li class="dropdown-header">{{row.entity.reference}}</li>
<li class="dropdown-header">
{{row.entity.reference}}
<span ng-show="row.entity.edited" class="text-primary">
<i class="fa fa-pencil"></i>
<span translate>FORM.INFO.EDITED</span>
</span>
</li>
<li>
<a data-method="receipt" href ng-click="grid.appScope.Receipts.invoice(row.entity.uuid)">
<i class="fa fa-file-pdf-o"></i> <span translate>REPORT.VIEW_RECEIPT</span>
Expand Down
8 changes: 7 additions & 1 deletion client/src/modules/vouchers/templates/action.cell.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@
</a>

<ul data-row-menu="{{ row.entity.reference }}" class="dropdown-menu-right" bh-dropdown-menu-auto-dropup uib-dropdown-menu>
<li class="dropdown-header">{{row.entity.reference}}</li>
<li class="dropdown-header">
{{row.entity.reference}}
<span ng-show="row.entity.edited" class="text-primary">
<i class="fa fa-pencil"></i>
<span translate>FORM.INFO.EDITED</span>
</span>
</li>
<li>
<a data-method="receipt" href ng-click="grid.appScope.showReceipt(row.entity.uuid)">
<i class="fa fa-file-pdf-o"></i> <span translate>TABLE.COLUMNS.RECEIPT</span>
Expand Down
9 changes: 5 additions & 4 deletions server/controllers/finance/journal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const identifiers = require('../../../config/identifiers');

const hrRecordToTableMap = {};
_.forEach(identifiers, v => {
hrRecordToTableMap[v.key] = hrRecordToTableMap[v.table];
hrRecordToTableMap[v.key] = v.table;
});

// Fiscal Service
Expand Down Expand Up @@ -265,13 +265,14 @@ function editTransaction(req, res, next) {
// @FIXME(sfount) this logic needs to be updated when allowing super user editing
lookupTransaction(recordUuid)
.then((transactionToEdit) => {
const { posted, trans_id } = transactionToEdit[0];
const { posted, trans_id, hrRecord } = transactionToEdit[0];

// bind the current transaction under edit as "transactionToEdit"
_transactionToEdit = transactionToEdit;

// _recordTableToEdit is now either voucher, invoice, or cash
_recordTableToEdit = hrRecordToTableMap[transactionToEdit.hrRecord];
const [prefix] = hrRecord.split('.');
_recordTableToEdit = hrRecordToTableMap[prefix];

// check the source (posted vs. non-posted) of the first transaction row
if (posted) {
Expand Down Expand Up @@ -332,7 +333,7 @@ function editTransaction(req, res, next) {
};

transaction
.addQuery(UPDATE_RECORD_EDITED_FLAG, [_recordTableToEdit, db.bid(row.recordUuid)])
.addQuery(UPDATE_RECORD_EDITED_FLAG, [_recordTableToEdit, db.bid(row.record_uuid)])
.addQuery(UPDATE_TRANSACTION_HISTORY, [transactionHistory]);

return transaction.execute();
Expand Down

0 comments on commit debc432

Please sign in to comment.