Skip to content

Commit

Permalink
Resolve conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
lomamech committed Feb 14, 2022
1 parent 46314af commit 769f6be
Show file tree
Hide file tree
Showing 23 changed files with 257 additions and 54 deletions.
6 changes: 6 additions & 0 deletions client/src/i18n/en/form.json
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,8 @@
"LOSS_ACCOUNT": "Loss Account",
"LOT": "Lot",
"MALE": "Male",
"MANUFACTURER_BRAND": "Manufacturer brand",
"MANUFACTURER_MODEL": "Manufacturer model",
"MARGIN" : "Margin",
"MARITAL_STATUS": "Marital Status",
"MAX_CREDIT_INFO": "The maximum credit value this debtor group can collect before being warned. A value of 0 means no maximum limit.",
Expand Down Expand Up @@ -698,6 +700,7 @@
"RECORD": "Record",
"RECORDS": "Records (Rows)",
"REFERENCE_GROUP": "Reference Group",
"REFERENCE_NUMBER": "Reference number",
"REFERENCE_PATIENT": "Patient Reference",
"REFERENCE_VOUCHER" : "Voucher Reference",
"REFERENCE": "Reference",
Expand Down Expand Up @@ -932,6 +935,8 @@
"LOT":"Enter Batch Number",
"LONGITUDE": "Enter the longitude",
"LATITUDE": "Enter the latitude",
"MANUFACTURER_BRAND": "Enter Manufacturer brand",
"MANUFACTURER_MODEL": "Enter Manufacturer model",
"MAX_CREDIT": "Enter max credit",
"NAME": "Enter a name",
"NOTES": "Enter any additional information",
Expand All @@ -941,6 +946,7 @@
"PICK_ONE": "Pick one",
"PRICE": "Enter a price",
"PROVINCE": "Enter province",
"REFERENCE_NUMBER": "Enter reference number",
"SECTOR": "Enter sector",
"UNIT_WEIGHT": "Enter weight",
"UNIT_VOLUME": "Enter volume",
Expand Down
1 change: 1 addition & 0 deletions client/src/i18n/en/inventory.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"EDIT_TYPE": "Edit inventory type",
"EDIT_UNIT": "Edit inventory unit form",
"ELEMENT": "Element",
"IS_IT_ASSET": "Is it an asset",
"PRICE_LIST_REPORT": "Inventory Prices Report",
"PRICES": "Inventory Prices",
"LIST": "Inventory Data List",
Expand Down
12 changes: 9 additions & 3 deletions client/src/i18n/fr/form.json
Original file line number Diff line number Diff line change
Expand Up @@ -417,9 +417,9 @@
"DEBTOR_ACCOUNT": "Comptes de tiers",
"DEBTOR_BALANCE_REMAINING": "Solde Restant du Débiteur",
"DEBTOR_CREDITOR": "Débiteur/Créditeur",
"DEBTOR_GROUP_FORM": "Formulaire d'enregistrement de Groupe Débiteur",
"DEBTOR_GROUP": "Groupe débiteur",
"DEBTOR_GROUP_OPTIONAL": "Groupe débiteur (optionnel)",
"DEBTOR_GROUP_OPTIONAL": "Groupe débiteur (optionel)",
"DEBTOR_GROUP_FORM": "Formulaire d'enregistrement de Groupe Débiteur",
"DECREASE" : "Dimunition",
"DEDUCTION" : "Contribution ou retenue",
"DEFAULT_QUANTITY": "Quantité par Défaut",
Expand Down Expand Up @@ -573,6 +573,8 @@
"LOSS_ACCOUNT": "Compte perte",
"LOT": "Lot",
"MALE": "Homme",
"MANUFACTURER_BRAND": "Marque",
"MANUFACTURER_MODEL": "Modèle",
"MARGIN" : "Marge",
"MARITAL_STATUS": "État Civil",
"MAX_CREDIT": "Crédit Max",
Expand Down Expand Up @@ -698,6 +700,7 @@
"RECORD": "Enregistrement",
"RECORDS": "Enregistrements (Lignes)",
"REFERENCE_GROUP": "Groupe de référence",
"REFERENCE_NUMBER": "Numéro de référence",
"REFERENCE_PATIENT": "Référence Patient",
"REFERENCE_VOUCHER": "Référence Bordereau",
"REFERENCE": "Référence",
Expand Down Expand Up @@ -931,6 +934,8 @@
"LOT":"Entrer le lot",
"LONGITUDE": "Entrer la longitude",
"LATITUDE": "Entrer la latitude",
"MANUFACTURER_BRAND": "Entrer la marque",
"MANUFACTURER_MODEL": "Entrer le modèle",
"MAX_CREDIT": "Entrer le crédit maximale",
"NAME": "Entrer le nom",
"NOTES": "Commentaire",
Expand All @@ -941,7 +946,8 @@
"PHONE": "Entrer le téléphone",
"PICK_ONE": "Choisissez-en un",
"PRICE": "Entrer le prix",
"PROVINCE": "Enter la province",
"PROVINCE": "Entrer la province",
"REFERENCE_NUMBER": "Entrer le numéro de référence",
"SECTOR": "Entrer le secteur",
"SUPPLIER": "Entrer le fournisseur",
"TYPE": "Entrer le type",
Expand Down
1 change: 1 addition & 0 deletions client/src/i18n/fr/inventory.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"EDIT_TYPE": "Modifier Types d'inventaires",
"EDIT_UNIT": "Modifier Forme d'inventaires",
"ELEMENT": "Élément",
"IS_IT_ASSET": "Est ce un actif",
"PRICE_LIST_REPORT": "Rapport des prix des articles et services",
"PRICES": "Tarification",
"LIST": "Liste des données d'inventaire",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
angular.module('bhima.controllers')
.controller('InventoryTypeActionsModalController', InventoryTypeActionsModalController);
.controller('InventoryTypeActionsModalController', InventoryTypeActionsModalController);

InventoryTypeActionsModalController.$inject = [
'InventoryTypeService', 'NotifyService', '$uibModalInstance', 'data'
'InventoryTypeService', 'NotifyService', '$uibModalInstance', 'data',
];

function InventoryTypeActionsModalController(InventoryType, Notify, Instance, Data) {
var vm = this, session = vm.session = {};
const vm = this;
vm.session = {};

// map for actions
var map = { 'add' : addType, 'edit' : editType };
const map = {
add : addType,
edit : editType,
};

// expose to the view
vm.submit = submit;
Expand All @@ -22,9 +26,10 @@ function InventoryTypeActionsModalController(InventoryType, Notify, Instance, Da
function submit(form) {
if (form.$invalid) { return; }

var record = cleanForSubmit(vm.session);
const record = cleanForSubmit(vm.session);

map[vm.action](record, vm.identifier)
.then(function (res) {
.then((res) => {
Instance.close(res);
});
}
Expand All @@ -47,9 +52,10 @@ function InventoryTypeActionsModalController(InventoryType, Notify, Instance, Da
}

/** format data to data structure in the db */
function cleanForSubmit(session) {
function cleanForSubmit(data) {
return {
text : session.text
text : data.text,
description : data.description,
};
}

Expand All @@ -60,12 +66,10 @@ function InventoryTypeActionsModalController(InventoryType, Notify, Instance, Da

if (vm.identifier) {
InventoryType.read(vm.identifier)
.then(function (type) {
vm.session = type[0];
})
.catch(Notify.handleError);
.then((type) => {
[vm.session] = type;
})
.catch(Notify.handleError);
}

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
<div ng-messages-include="modules/templates/messages.tmpl.html"></div>
</div>
</div>

<div class="form-group">
<label class="control-label" translate>FORM.LABELS.DESCRIPTION</label>
<textarea class="form-control" name="description" ng-model="$ctrl.session.description">
</textarea>
</div>
</div>

<div class="modal-footer">
Expand Down
9 changes: 6 additions & 3 deletions client/src/modules/inventory/configuration/types/types.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,19 @@
<tbody>
<tr ng-repeat="type in TypesCtrl.typeList | filter: TypesCtrl.searchValue | orderBy: 'text'">
<td>{{ $index + 1 }}</td>
<td>{{ type.text }}</td>
<td>
<a style="cursor:pointer; text-decoration:none;"
<span ng-if="type.is_predefined"><strong>{{ type.text }}</strong></span>
<span ng-if="!type.is_predefined">{{ type.text }}</span>
</td>
<td>
<a ng-if="!type.is_predefined" style="cursor:pointer; text-decoration:none;"
ng-click="TypesCtrl.editInventoryType(type.id)"
data-edit-type="{{ type.text }}">
<i class="fa fa-edit"></i> <span translate>FORM.BUTTONS.EDIT</span>
</a>
</td>
<td>
<a style="cursor:pointer; text-decoration:none;"
<a ng-if="!type.is_predefined" style="cursor:pointer; text-decoration:none;"
ng-click="TypesCtrl.deleteInventoryType(type.id)"
class="text-danger"
data-delete-type="{{ type.text }}">
Expand Down
10 changes: 8 additions & 2 deletions client/src/modules/inventory/configuration/types/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ angular.module('bhima.controllers')

// dependencies injection
InventoryTypesController.$inject = [
'InventoryTypeService', 'NotifyService', 'ModalService',
'InventoryTypeService', 'NotifyService', 'ModalService', '$translate',
];

/**
* Inventory Type Controller
* This controller is responsible for handling inventory type module
*/
function InventoryTypesController(InventoryType, Notify, Modal) {
function InventoryTypesController(InventoryType, Notify, Modal, $translate) {
const vm = this;

// expose to the view
Expand Down Expand Up @@ -73,6 +73,12 @@ function InventoryTypesController(InventoryType, Notify, Modal) {
// get inventory types
InventoryType.read()
.then((list) => {
list.forEach(item => {
if (item.is_predefined) {
item.text = $translate.instant(item.text);
}
});

vm.typeList = list;
})
.catch(Notify.handleError);
Expand Down
36 changes: 20 additions & 16 deletions client/src/modules/inventory/inventory.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,39 +121,43 @@ function InventoryService(
inventoryFilters.registerCustomFilters([{
key : 'group_uuid',
label : 'FORM.LABELS.GROUP',
},
{
}, {
key : 'code',
label : 'FORM.LABELS.CODE',
},
{
}, {
key : 'consumable',
label : 'FORM.LABELS.CONSUMABLE',
valueFilter : 'boolean',
},
{
}, {
key : 'locked',
label : 'FORM.LABELS.LOCKED',
},
{
}, {
key : 'uuid',
label : 'FORM.LABELS.LABEL',
},
{
}, {
key : 'text',
label : 'FORM.LABELS.LABEL',
},
{
}, {
key : 'type_id',
label : 'FORM.LABELS.TYPE',
},
{
}, {
key : 'price',
label : 'FORM.LABELS.PRICE',
},
{
}, {
key : 'tags',
label : 'TAG.TAGS',
}, {
key : 'is_asset',
label : 'FORM.LABELS.ASSET',
}, {
key : 'external_reference_number',
label : 'FORM.LABELS.REFERENCE_NUMBER',
}, {
key : 'manufacturer_brand',
label : 'FORM.LABELS.MANUFACTURER_BRAND',
}, {
key : 'manufacturer_model',
label : 'FORM.LABELS.MANUFACTURER_MODEL',
},
]);

Expand Down
2 changes: 2 additions & 0 deletions client/src/modules/inventory/list/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@
ui-grid-save-state
ui-grid-exporter
ui-grid-auto-resize
ui-grid-resize-columns
ui-grid-move-columns
ui-grid-resize-columns>

<bh-grid-loading-indicator
Expand Down
25 changes: 25 additions & 0 deletions client/src/modules/inventory/list/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,31 @@ function InventoryListController(
displayName : 'FORM.LABELS.LABEL',
headerCellFilter : 'translate',
cellTemplate : '/modules/inventory/list/templates/inventory.cell.html',
}, {
field : 'is_asset',
displayName : 'FORM.LABELS.ASSET',
headerCellFilter : 'translate',
visible : false,
cellTemplate : '/modules/inventory/list/templates/asset.cell.tmpl.html',
}, {
field : 'external_reference_number',
displayName : 'FORM.LABELS.REFERENCE_NUMBER',
headerCellFilter : 'translate',
visible : false,
width : 150,
cellTemplate : '/modules/inventory/list/templates/reference_number.cell.html',
}, {
field : 'manufacturer_brand',
displayName : 'FORM.LABELS.MANUFACTURER_BRAND',
headerCellFilter : 'translate',
visible : false,
width : 150,
}, {
field : 'manufacturer_model',
displayName : 'FORM.LABELS.MANUFACTURER_MODEL',
headerCellFilter : 'translate',
visible : false,
width : 150,
}, {
field : 'price',
displayName : 'FORM.LABELS.UNIT_PRICE',
Expand Down
4 changes: 2 additions & 2 deletions client/src/modules/inventory/list/modals/actions.modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ angular.module('bhima.controllers')
.controller('InventoryListActionsModalController', InventoryListActionsModalController);

InventoryListActionsModalController.$inject = [
'AccountService', 'InventoryService', 'NotifyService', '$uibModalInstance',
'InventoryService', 'NotifyService', '$uibModalInstance',
'$state', 'util', 'appcache', 'SessionService', '$rootScope', 'params',
];

function InventoryListActionsModalController(
Account, Inventory, Notify, Instance, $state,
Inventory, Notify, Instance, $state,
util, AppCache, SessionService, $rootScope, params,
) {
const vm = this;
Expand Down
Loading

0 comments on commit 769f6be

Please sign in to comment.