Skip to content

Commit

Permalink
feat(transaction type): Adding new transaction type and in the data b…
Browse files Browse the repository at this point in the history
…ase and at the client side
  • Loading branch information
DedrickEnc committed Sep 21, 2017
1 parent 38a4fbb commit 32a0d75
Show file tree
Hide file tree
Showing 6 changed files with 121 additions and 118 deletions.
93 changes: 47 additions & 46 deletions client/src/i18n/en/vouchers.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
{
"VOUCHERS" : {
"COMPLEX":{
"ADD_ITEMS":"Add item(s)",
"CASH_PAYMENT":"Cash Payment",
"CREATE_SUCCESS":"Successfully posted",
"CREATE_ERROR":"An error occurred when post",
"CREDITOR":"Creditor (C)",
"DEBTOR":"Debtor (D)",
"DEB_CRED":"Debtor/Creditor",
"DESCRIPTION":"This module allows you to make advanced journal transactions manually",
"ENTITY":"Entity (Debtor/Creditor)",
"ERROR_ACCOUNT":"Selected accounts are invalid",
"ERROR_AMOUNT":"Amount's values are invalid",
"ERROR_TOTALS":"The totals are not balanced",
"ERROR_PRECISION":"The amounts entered cannot have more than 4 decimal places in precision",
"INVALID_VALUES":"There are invalid values detected",
"PATIENT_INVOICE":"Patient Invoice",
"REFERENCE":"Reference",
"ROWS":"Row(s)",
"SELECT_DOCUMENT_TYPE":"Please select the document type",
"TITLE":"Advanced Journal Vouchers",
"VALID_TOTALS":"Transactions are valid (balanced transaction)",
"VOUCHER":"Voucher"
"VOUCHERS": {
"COMPLEX": {
"ADD_ITEMS": "Add item(s)",
"CASH_PAYMENT": "Cash Payment",
"CREATE_SUCCESS": "Successfully posted",
"CREATE_ERROR": "An error occurred when post",
"CREDITOR": "Creditor (C)",
"DEBTOR": "Debtor (D)",
"DEB_CRED": "Debtor/Creditor",
"DESCRIPTION": "This module allows you to make advanced journal transactions manually",
"ENTITY": "Entity (Debtor/Creditor)",
"ERROR_ACCOUNT": "Selected accounts are invalid",
"ERROR_AMOUNT": "Amount's values are invalid",
"ERROR_TOTALS": "The totals are not balanced",
"ERROR_PRECISION": "The amounts entered cannot have more than 4 decimal places in precision",
"INVALID_VALUES": "There are invalid values detected",
"PATIENT_INVOICE": "Patient Invoice",
"REFERENCE": "Reference",
"ROWS": "Row(s)",
"SELECT_DOCUMENT_TYPE": "Please select the document type",
"TITLE": "Advanced Journal Vouchers",
"VALID_TOTALS": "Transactions are valid (balanced transaction)",
"VOUCHER": "Voucher"
},
"TYPES":{
"SUPPORT_PAYMENT_DESCRIPTION":"Debt transfer from {{ patientName }} ({{ patientReference}}) for invoice {{ invoiceReference }}."
"TYPES": {
"SUPPORT_PAYMENT_DESCRIPTION": "Debt transfer from {{ patientName }} ({{ patientReference}}) for invoice {{ invoiceReference }}."
},
"GLOBAL":{
"CASHFLOW_OPTION":"Cashflow Option",
"GLOBAL": {
"CASHFLOW_OPTION": "Cashflow Option",
"TRANSFER_DESCRIPTION": "Transfer: From {{ fromAccount }} to {{ toAccount }} for {{ amount }} {{ symbol }}",
"CONVENTION_PAYMENT_DESCRIPTION": "Convention Payment: Payment for {{ numInvoices }} invoice(s) by {{ debtorGroupName }}.",
"CONVENTION_INVOICES":"Convention - Invoices payment",
Expand All @@ -48,25 +48,26 @@
"RECEIPT":{
"SUCCESS":"Voucher Payment recorded successfully."
},
"ERROR_SAME_ACCOUNT":"You cannot use the same account twice to in this transaction. Please select two different accounts."
"ERROR_SAME_ACCOUNT": "You cannot use the same account twice to in this transaction. Please select two different accounts."
},
"SIMPLE":{
"CASH_PAYMENT":"Client Payment",
"CASH_RETURN":"Cash Return (Payback)",
"CONVENTION_PAYMENT":"Convention Payment",
"CREDIT_NOTE":"Credit Note",
"EXPENSE":"Expenses",
"INCOME":"Incomes",
"INVOICING":"Invoicing",
"SALARY_PAYMENT":"Salary Payment",
"GENERIC_EXPENSE":"Other Expenses",
"GENERIC_INCOME":"Other Incomes",
"PURCHASES":"Purchases",
"SUPPORT_INCOME":"Support Incomes",
"TITLE":"Simple Voucher",
"TRANSFER":"Money Transfer",
"TRANSFER_PATIENT_INVOICE_AMOUNT":"Patient Invoice Debt Transfer"
"SIMPLE": {
"CASH_PAYMENT": "Client Payment",
"CASH_RETURN": "Cash Return (Payback)",
"CONVENTION_PAYMENT": "Convention Payment",
"CREDIT_NOTE": "Credit Note",
"EXPENSE": "Expenses",
"INCOME": "Incomes",
"INVOICING": "Invoicing",
"SALARY_PAYMENT": "Salary Payment",
"GENERIC_EXPENSE": "Other Expenses",
"GENERIC_INCOME": "Other Incomes",
"PURCHASES": "Purchases",
"SUPPORT_INCOME": "Support Incomes",
"TITLE": "Simple Voucher",
"TRANSFER": "Money Transfer",
"TRANSFER_PATIENT_INVOICE_AMOUNT": "Patient Invoice Debt Transfer",
"STOCK_INTEGRATION" : "Stock Integration"
},
"REPORT":"Report"
"REPORT": "Report"
}
}
}
138 changes: 69 additions & 69 deletions client/src/i18n/fr/vouchers.json
Original file line number Diff line number Diff line change
@@ -1,71 +1,71 @@
{
"VOUCHERS":{
"COMPLEX":{
"ADD_ITEMS":"Ajouter item(s)",
"CASH_PAYMENT":"Paiement Caisse",
"CREATE_SUCCESS":"Transaction postée avec succes",
"CREATE_ERROR":"Une erreur s'est produite lors du post",
"CREDITOR":"Crediteur (C)",
"DEBTOR":"Debiteur (D)",
"DEB_CRED":"Debtor/Creditor",
"DESCRIPTION":"Ce module permet de passer des transactions avancees dans le journal",
"ENTITY":"Entité (Debiteur/Crediteur)",
"ERROR_ACCOUNT":"Les comptes selectionnés sont invalides",
"ERROR_AMOUNT":"Les montants sont invalides",
"ERROR_PRECISION":"Les quantités saisies ne peuvent pas avoir plus de 4 décimales dans la précision",
"ERROR_TOTALS":"Les totaux ne sont pas balancés",
"INVALID_VALUES":"Detection des valeurs invalides",
"PATIENT_INVOICE":"Facture Patient",
"REFERENCE":"Reference",
"ROWS":"Ligne(s)",
"SELECT_DOCUMENT_TYPE":"Veuillez selectionner le type de document",
"TITLE":"Ajout des transactions",
"VALID_TOTALS":"Les transactions sont valides (Transactions balancées)",
"VOUCHER":"Bordereau de Transfert"
},
"TYPES":{
"SUPPORT_PAYMENT_DESCRIPTION":"Prise en charge de {{ patientName }} ({{ patientReference}}) pour la facture {{ invoiceReference }}."
},
"GLOBAL":{
"CASHFLOW_OPTION":"Option pour le flux de trésorerie physique",
"CONVENTION_INVOICES":"Convention - Paiement factures",
"CONVENTION_PAYMENT_DESCRIPTION": "Convention Paiement Factures: Paiement pour {{ numInvoices }} factures(s) par {{ debtorGroupName }}.",
"SUPPORT_PAYMENT_DESCRIPTION":"Prise en charge de {{ patientName }} ({{ patientReference}}) pour {{ numInvoices }} facture(s) {{ invoiceReferences }}.",
"TRANSFER_DESCRIPTION": "Transfert: De {{ fromAccount }} à {{ toAccount }} pour {{ amount }} {{ symbol }}",
"SUPPORT_FORM":"Prise en Charge des patients",
"SUPPORT_TEXT":"Lorsque les deux champs ci-dessus sont remplis, Les dettes du patient apparaissent en vue qu'une \"Prise en Charge\" puissent être attribue à un Compte.",
"ERROR_SAME_ACCOUNT":"Vous ne pouvez pas utiliser le même compte deux fois dans cette transaction. Veuillez sélectionner deux comptes différents.",
"GENERIC_EXPENSE":"Depense Generique",
"GENERIC_INCOME":"Recette Generique",
"CASH_TRANSFER":"Transfert d'argent",
"ORIGIN_ACCOUNT":"Compte de provenance",
"DESTINATION_ACCOUNT":"Compte de destination",
"TRANSFER_ACCOUNT":"Compte de transfert",
"IMPORT_TRANSACTION":"Importer les transactions",
"RECEIPT":{
"SUCCESS":"Bon de paiement enregistré avec succès."
},
"REPORT":"Rapport des Quittances",
"TITLE":"Quittance",
"TRANSFER_TYPE_INFO":"Type de transaction selon qu'on a soit une recette ou une depense",
"USE_FINANCIAL_ACCOUNT":"Utilisation de compte de caisses ou banques dans cette transaction"
},
"SIMPLE":{"CASH_PAYMENT":"Paiement des clients",
"CASH_RETURN":"Remboursement",
"CONVENTION_PAYMENT":"Paiement des Conventions",
"CREDIT_NOTE":"Note de crédit",
"EXPENSE":"Dépenses",
"INCOME":"Récettes",
"INVOICING":"Facturation",
"SALARY_PAYMENT":"Paiement des Salaires",
"GENERIC_EXPENSE":"Autres Depenses",
"GENERIC_INCOME":"Autres Recettes",
"PURCHASES":"Achats",
"SUPPORT_INCOME":"Paiement Prise en charge",
"TITLE":"Bordereau de transfert",
"TRANSFER":"Transfert d'argent",
"TRANSFER_PATIENT_INVOICE_AMOUNT":"Prise en Charge de Facture de Patient"
},
"REPORT":"Rapport"
}
"VOUCHERS": {
"COMPLEX": {
"ADD_ITEMS": "Ajouter item(s)",
"CASH_PAYMENT": "Paiement Caisse",
"CREATE_SUCCESS": "Transaction postée avec succes",
"CREATE_ERROR": "Une erreur s'est produite lors du post",
"CREDITOR": "Crediteur (C)",
"DEBTOR": "Debiteur (D)",
"DEB_CRED": "Debtor/Creditor",
"DESCRIPTION": "Ce module permet de passer des transactions avancees dans le journal",
"ENTITY": "Entité (Debiteur/Crediteur)",
"ERROR_ACCOUNT": "Les comptes selectionnés sont invalides",
"ERROR_AMOUNT": "Les montants sont invalides",
"ERROR_PRECISION": "Les quantités saisies ne peuvent pas avoir plus de 4 décimales dans la précision",
"ERROR_TOTALS": "Les totaux ne sont pas balancés",
"INVALID_VALUES": "Detection des valeurs invalides",
"PATIENT_INVOICE": "Facture Patient",
"REFERENCE": "Reference",
"ROWS": "Ligne(s)",
"SELECT_DOCUMENT_TYPE": "Veuillez selectionner le type de document",
"TITLE": "Ajout des transactions",
"VALID_TOTALS": "Les transactions sont valides (Transactions balancées)",
"VOUCHER": "Bordereau de Transfert"
},
"TYPES": {
"SUPPORT_PAYMENT_DESCRIPTION": "Prise en charge de {{ patientName }} ({{ patientReference}}) pour la facture {{ invoiceReference }}."
},
"GLOBAL": {
"CASHFLOW_OPTION": "Option pour cashflow",
"CONVENTION_INVOICES": "Convention - Paiement factures",
"TRANSFER_DESCRIPTION": "Transfert: De {{ fromAccount }} à {{ toAccount }} pour {{ amount }} {{ symbol }}",
"SUPPORT_FORM": "Prise en Charge des patients",
"SUPPORT_TEXT": "Lorsque les deux champs ci-dessus sont remplis, Les dettes du patient apparaissent en vue qu'une \"Prise en Charge\" puissent être attribue à un Compte.",
"ERROR_SAME_ACCOUNT": "Vous ne pouvez pas utiliser le même compte deux fois dans cette transaction. Veuillez sélectionner deux comptes différents.",
"GENERIC_EXPENSE": "Depense Generique",
"GENERIC_INCOME": "Recette Generique",
"CASH_TRANSFER": "Transfert d'argent",
"ORIGIN_ACCOUNT": "Compte de provenance",
"DESTINATION_ACCOUNT": "Compte de destination",
"TRANSFER_ACCOUNT": "Compte de transfert",
"IMPORT_TRANSACTION": "Importer les transactions",
"RECEIPT": {
"SUCCESS": "Bon de paiement enregistré avec succès."
},
"REPORT": "Rapport des Quittances",
"TITLE": "Quittance",
"TRANSFER_TYPE_INFO": "Type de transaction selon qu'on a soit une recette ou une depense",
"USE_FINANCIAL_ACCOUNT": "Utilisation de compte de caisses ou banques dans cette transaction"
},
"SIMPLE": {
"CASH_PAYMENT": "Paiement des clients",
"CASH_RETURN": "Remboursement",
"CONVENTION_PAYMENT": "Paiement des Conventions",
"CREDIT_NOTE": "Note de crédit",
"EXPENSE": "Dépenses",
"INCOME": "Récettes",
"INVOICING": "Facturation",
"SALARY_PAYMENT": "Paiement des Salaires",
"GENERIC_EXPENSE": "Autres Depenses",
"GENERIC_INCOME": "Autres Recettes",
"PURCHASES": "Achats",
"SUPPORT_INCOME": "Paiement Prise en charge",
"TITLE": "Bordereau de transfert",
"TRANSFER": "Transfert d'argent",
"TRANSFER_PATIENT_INVOICE_AMOUNT": "Prise en Charge de Facture de Patient",
"STOCK_INTEGRATION" : "Integration Stock"
},
"REPORT": "Rapport"
}
}
1 change: 1 addition & 0 deletions client/src/js/constants/bhConstants.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ function constantConfig() {
PURCHASES : 9,
CREDIT_NOTE : 10,
INVOICING : 11,
STOCK_INTEGRATION : 12,
INCOME : 'income',
EXPENSE : 'expense',
OTHER : 'other',
Expand Down
2 changes: 1 addition & 1 deletion server/controllers/stock/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ function createIntegration(req, res, next) {
commonInfos = [ db.bid(documentUuid), new Date(params.movement.date), req.session.enterprise.id, req.session.project.id, req.session.enterprise.currency_id, req.session.user.id ];

// writting all records relative to the movement in the posting journal table
transaction.addQuery('CALL PostPurchase(?)', [commonInfos]);
transaction.addQuery('CALL PostStockEntry(?)', [commonInfos]);
});

// execute all operations as one transaction
Expand Down
3 changes: 2 additions & 1 deletion server/models/bhima.sql
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ INSERT INTO `transaction_type` (`id`, `text`, `type`, `prefix`, `fixed`) VALUES
(8, 'VOUCHERS.SIMPLE.CASH_RETURN', 'expense', 'PAYBACK', 1),
(9, 'VOUCHERS.SIMPLE.PURCHASES', 'expense', 'ACHAT', 1),
(10,'VOUCHERS.SIMPLE.CREDIT_NOTE', 'other', 'CREDIT NOTE', 1),
(11,'VOUCHERS.SIMPLE.INVOICING', 'income', 'INV', 1);
(11,'VOUCHERS.SIMPLE.INVOICING', 'income', 'INV', 1),
(12, 'VOUCHERS.SIMPLE.STOCK_INTEGRATION', 'stock integration', 'STOCK. INT', 1);

-- Stock Movement Flux
INSERT INTO `flux` VALUES
Expand Down
2 changes: 1 addition & 1 deletion server/models/procedures.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1350,7 +1350,7 @@ BEGIN
END $$

-- This processus inserts records relative to the stock movement in the posting journal
CREATE PROCEDURE PostPurchase (
CREATE PROCEDURE PostStockEntry (
IN document_uuid BINARY(16),
IN date DATETIME,
IN enterprise_id SMALLINT(5) UNSIGNED,
Expand Down

0 comments on commit 32a0d75

Please sign in to comment.