Skip to content

Commit

Permalink
Add Good Received Note for shipments
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcameron committed Aug 18, 2022
1 parent 9f65e3e commit 42e3c38
Show file tree
Hide file tree
Showing 26 changed files with 378 additions and 20 deletions.
18 changes: 18 additions & 0 deletions client/src/i18n/en/shipment.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"AUTHORIZED": "Authorized",
"ANTICIPATED_DELIVERY_DATE": "Anticipated delivery date",
"BARCODE": "Shipment Barcode",
"CHECKED_BY": "Checked by",
"COMPLETE_SHIPMENT" : "Mark shipment as complete",
"CONTAINER": "Container",
"CONTAINERS": "Containers",
Expand Down Expand Up @@ -43,6 +44,10 @@
"DATE_SENT": "Date sent",
"DELETE": "Delete",
"DELETED": "Shipment successfully deleted",
"DELIVERED_BY": "Delivered by",
"DELIVERER_IDENTIFICATION": "Deliverer identification document",
"DELIVERER_IDENTIFICATION_NOTE": "Number and type of document",
"DELIVERER_SIGNATURE": "Deliverer signature",
"DELIVERY_EXPECTED_ON": "Delivery expected on",
"DESTINATION_DEPOT": "Destination depot",
"DOCUMENT": "Document",
Expand All @@ -60,10 +65,15 @@
"EXISTING_ASSETS_IN_OTHER_SHIPMENT": "You have the following assets in ongoing shipments. Please send or cancel these shipments so that you can reassign those assets",
"EXISTING_SHIPMENT_AT_DEPOT": "Current shipment in the depot ({{number}})",
"EXIT_STOCK_FOR_SHIPMENT" : "Exit stock for this shipment",
"FREIGHT_DOCUMENT": "Freight Document Number",
"GOODS_RECEIVED_NOTE": "Goods Received Note",
"IMPORTANT_NOTES": "Important Notes",
"IS_IN_TRANSIT_TOOLTIP": "This inventory is in transit to the depot ({{depot}})",
"ITEMS": "Item(s)",
"LOCATION": "Location",
"LOSS": "Loss",
"LOT_CONDITION": "Condition",
"LOT_OR_SERIAL_NUMBER": "Lot ID / serial number",
"MANIFEST": "Manifest",

"MARKED_DELIVERED": "Shipment marked delivered",
Expand All @@ -88,15 +98,19 @@
"NOT_DEFINED": "Not Defined",
"NUM_ITEMS": "Num. Items",
"ORIGIN_DEPOT": "Origin depot",
"OVERAGE": "Overage",
"OVERVIEW": "Overview",
"PACKING": "Packing",
"PACKING_LIST": "Packing List",
"PACKING_LIST_UPDATED": "Packing list updated",
"PARTIAL_MARKED_COMPLETE" : "Partial shipment marked complete",
"PLEASE_SHIP_EXISTING_SHIPMENT": "Please ship or cancel these existing shipments",
"QUANTITY_RECEIVED": "TOtal number of units received",
"READY_TO_SHIP": "Ready to ship",
"RECEIVER": "Receiver",
"RECEIVED_BY": "Received by",
"REFERENCE": "Reference",
"REFERENCE_DOCUMENT": "Reference Document",
"REQUISITION": "Requisition",
"SELECT_CONTAINER_TYPE" : "Select Container Type",
"SHIPMENTS": "Shipments",
Expand All @@ -121,12 +135,16 @@
"TRACKING_LOG": "Update Tracking Log",
"TRANSPORTER": "Transporter",
"TRANSPORT_MODE": "Mode of Transport",
"UNIT_DOCUMENTS": "REFERENCE DOCUMENT: Document accompanying the shipment (invoice / donation letter / packing list / delivery note / consignment note, etc.)",
"UNITS_LOST": "Missing or damaged units",
"UNITS_OVERAGE": "Additional units counted",
"UPDATED": "Shipment successfully updated",
"UPDATE_LOCATION": "Update Location",
"UPDATE_LOCATION_MESSAGE": "You are about to change the location of this shipment, this information will be saved in the history of this shipment",
"UPDATE_LOCATION_WARNING": "You cannot change the location because only shipments with an IN-TRANSIT status can allow the change of location",
"UPDATE_PACKING_LIST": "Update Packing List",
"UPDATE_STATUS": "Update Status",
"VEHICLE_REGISTRATION": "Vehicle Registration",
"STATUS" : {
"AT_DEPOT" : "At Origin Depot",
"COMPLETE" : "Complete",
Expand Down
1 change: 1 addition & 0 deletions client/src/i18n/en/stock.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
},
"AMOUNT" : "Amount",
"APPROVISIONING" : "Quantity to order",
"ARTICLE_DESCRIPTION": "Article Description",
"AT_LEAST_ONE_CHECKED" : "At least one option must be checked",
"BY_INVENTORY" : "By Products",
"BY_SERVICE" : "By Services",
Expand Down
1 change: 1 addition & 0 deletions client/src/i18n/en/table.json
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@
"TRANSACTION_PRICE": "Transaction Price",
"TYPE": "Type",
"UNIT": "Unit",
"UNIT_DEFINITION": "Unit Definition",
"UNIT_PRICE": "Unit Price",
"UNIT_WEIGHT": "Unit Weight",
"UNPAID_INVOICE_1": "This invoice has not been balanced in ",
Expand Down
2 changes: 1 addition & 1 deletion client/src/i18n/fr/form.json
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@
"PURCHASE_ORDER": "Commande d'achat",
"QUANTITY_DIFFERENCE": "Différence de quantitée",
"QUANTITY_ENTRY": "Quantité Entrée",
"QUANTITY_ORDERED": "Quantité Commandée",
"QUANTITY_ORDERED": "Quantité commandée",
"QUANTITY": "Quantité",
"RANK": "Rang",
"RATE": "TAUX",
Expand Down
20 changes: 19 additions & 1 deletion client/src/i18n/fr/shipment.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"AUTHORIZED": "Autorisé",
"ANTICIPATED_DELIVERY_DATE": "Date de livraison previsionnelle",
"BARCODE": "Code-barre de l'expédition",
"CHECKED_BY": "Vérifié par",
"COMPLETE_SHIPMENT" : "Marquez l'expédition comme complète",
"CONTAINER": "Conteneur",
"CONTAINERS": "Conteneurs",
Expand Down Expand Up @@ -43,6 +44,10 @@
"DATE_SENT": "Date d'envoi",
"DELETE": "Supprimer",
"DELETED": "Expédition supprimée avec succès",
"DELIVERED_BY": "Livré par",
"DELIVERER_IDENTIFICATION": "Liverer identification du document",
"DELIVERER_IDENTIFICATION_NOTE": "Le N° et type de document",
"DELIVERER_SIGNATURE": "Signature du liverer",
"DELIVERY_EXPECTED_ON": "Livraison attendue le",
"DESTINATION_DEPOT": "Dépôt de destination",
"DOCUMENT": "Document d'expédition",
Expand All @@ -60,11 +65,16 @@
"EXISTING_ASSETS_IN_OTHER_SHIPMENT": "Vous avez les actifs suivants dans des expéditions en cours. Veuillez envoyer ou annuler ces expéditions afin de pouvoir re-affecter ces actifs",
"EXISTING_SHIPMENT_AT_DEPOT": "Les expéditions en cours dans le dépôt ({{number}})",
"EXIT_STOCK_FOR_SHIPMENT" : "Sortir du stock pour cette expédition",
"FREIGHT_DOCUMENT": "Document de fret n°",
"GOODS_RECEIVED_NOTE": "Note de Marchandises Reçus",
"IMPORTANT_NOTES": "Remarques Importantes",
"IS_IN_TRANSIT_TOOLTIP": "Cet inventaire est en transit vers le depot ({{depot}})",
"ITEMS": "Article(s)",
"LOCATION": "Localisation",
"LOSS": "Perte",
"LOT_CONDITION": "Condition",
"MANIFEST": "Manifeste",
"LOT_OR_SERIAL_NUMBER": "Lot id. / numéro de série",
"MANIFEST": "Manifest",

"MARKED_DELIVERED": "Expédition marquée livrée",
"MARK_DELIVERED": "Marquer comme livré",
Expand All @@ -88,15 +98,19 @@
"NOT_DEFINED": "Non-défini",
"NUM_ITEMS": "N. des items",
"ORIGIN_DEPOT": "Dépôt d'origine",
"OVERAGE": "Restant",
"OVERVIEW": "Aperçu",
"PACKING": "Colisage",
"PACKING_LIST": "Liste de colisage",
"PACKING_LIST_UPDATED": "Liste de colisage mise à jour",
"PARTIAL_MARKED_COMPLETE" : "Expédition partielle marquée complète",
"PLEASE_SHIP_EXISTING_SHIPMENT": "Veuillez envoyer ou annuler les expéditions existantes encore dans le dépôt",
"READY_TO_SHIP": "Prêt pour l'expédition",
"QUANTITY_RECEIVED": "Nombre total d'unités bien reçues",
"RECEIVER": "Récepteur",
"RECEIVED_BY": "Reçu par",
"REFERENCE": "Reférence",
"REFERENCE_DOCUMENT": "Document de référence",
"REQUISITION": "Requisition",
"SELECT_CONTAINER_TYPE" : "Sélectionner le type de conteneur",
"SHIPMENTS": "Expéditions",
Expand All @@ -121,12 +135,16 @@
"TRACKING_LOG": "Mettre à jour le journal de suivi",
"TRANSPORTER": "Transporteur",
"TRANSPORT_MODE": "Mode de transport",
"UNIT_DOCUMENTS": "DOCUMENT DE RÉFÉRENCE: Document accompagnant la cargaison (facture / lettre de don / liste de colisage / bon de livraison / lettre de voiture, etc.)",
"UNITS_LOST": "Unités endommagées ou manquantes",
"UNITS_OVERAGE": "Unités supplémentaires comptées",
"UPDATED": "Expédition mis à jour avec succès",
"UPDATE_LOCATION": "Mise à jour localisation",
"UPDATE_LOCATION_MESSAGE": "Vous êtes sur le point de changer la localisation de cette expédition, cette information sera enregistrée dans l'historique de cette expédition",
"UPDATE_LOCATION_WARNING": "Vous ne pouvez pas changer la localisation car seul les expéditions ayant un statut EN-TRANSIT peuvent bénéficier du changement de localisation",
"UPDATE_PACKING_LIST": "Mise à jour colisage",
"UPDATE_STATUS": "Mise à jour statut",
"VEHICLE_REGISTRATION": "Immatricule du véhicule",
"STATUS" : {
"AT_DEPOT" : "Au dépôt d'origine",
"COMPLETE" : "Complète",
Expand Down
1 change: 1 addition & 0 deletions client/src/i18n/fr/stock.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
},
"AMOUNT" : "Montant",
"APPROVISIONING" : "Quantité à commander",
"ARTICLE_DESCRIPTION": "Description de l'article",
"AT_LEAST_ONE_CHECKED" : "Au moins une option doit être coché",
"BY_INVENTORY" : "Par produits",
"BY_SERVICE" : "Par services",
Expand Down
1 change: 1 addition & 0 deletions client/src/i18n/fr/table.json
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@
"TRANSACTION_PRICE": "Coût de la Transaction",
"TYPE": "Type",
"UNIT": "Unité",
"UNIT_DEFINITION": "Définition et taille de l'unité",
"UNIT_PRICE": "Prix unitaire",
"UNIT_WEIGHT": "Poids unitaire",
"UNPAID_INVOICE_1": "Cette facture n'a pas été compensée en ",
Expand Down
8 changes: 8 additions & 0 deletions client/src/js/services/receipts/ReceiptService.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ function ReceiptService($http, util, Language, AppCache, Session) {
service.displayData = displayData;

service.shipmentDocument = shipmentDocument;
service.shipmentGoodsReceivedNote = shipmentGoodsReceivedNote;
service.shipmentManifest = shipmentManifest;
service.shipmentBarcode = shipmentBarcode;

Expand Down Expand Up @@ -179,6 +180,13 @@ function ReceiptService($http, util, Language, AppCache, Session) {
return fetch(route, options);
}

// shipment manifest
function shipmentGoodsReceivedNote(uuid, options) {
options.posReceipt = service.posReceipt;
const route = `/reports/shipments/${uuid}/document?goodsReceived=1`;
return fetch(route, options);
}

// shipment manifest
function shipmentManifest(uuid, options) {
options.posReceipt = service.posReceipt;
Expand Down
2 changes: 2 additions & 0 deletions client/src/modules/shipment/create-shipment.html
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ <h4 translate>STOCK.PRODUCT_NOT_AVAILABLE</h4>
<thead>
<tr>
<th translate>FORM.LABELS.LABEL</th>
<th translate>FORM.LABELS.DESCRIPTION</th>
<th translate>FORM.LABELS.TYPE</th>
<th translate>FORM.LABELS.WEIGHT</th>
<th></th>
Expand All @@ -256,6 +257,7 @@ <h4 translate>STOCK.PRODUCT_NOT_AVAILABLE</h4>
<tbody>
<tr ng-repeat="cont in CreateShipCtrl.containers">
<td>{{cont.label}}</td>
<td>{{cont.description}}</td>
<td>{{cont.container_type}}</td>
<td>{{cont.weight}}</td>
<td>
Expand Down
14 changes: 10 additions & 4 deletions client/src/modules/shipment/create-shipment.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,17 @@ function CreateShipmentController(
headerCellFilter : 'translate',
cellTemplate : 'modules/stock/exit/templates/lot.tmpl.html',
enableSorting : false,
footerCellTemplate : `<div class="ui-grid-cell-contents text-right" >
${$translate.instant('FORM.LABELS.TOTAL')}:
</div>`,
}, {
field : 'quantity',
width : 100,
displayName : 'TABLE.COLUMNS.QUANTITY',
headerCellFilter : 'translate',
cellTemplate : 'modules/shipment/templates/quantity.tmpl.html',
footerCellClass : 'text-right',
footerCellTemplate : `<div class="ui-grid-cell-contents" >
${$translate.instant('SHIPMENT.TOTAL_QUANTITY')}: {{ grid.appScope.totalQuantity }}
footerCellTemplate : `<div class="ui-grid-cell-contents text-right wrappingColHeader" >
{{ grid.appScope.totalQuantity }}
</div>`,
enableSorting : false,
}, {
Expand All @@ -103,7 +105,7 @@ function CreateShipmentController(
cellTemplate : 'modules/shipment/templates/unit_weight.tmpl.html',
footerCellClass : 'text-right',
footerCellTemplate : `<div class="ui-grid-cell-contents" >
${$translate.instant('SHIPMENT.TOTAL_WEIGHT')}: {{ grid.appScope.totalWeight }}
{{ grid.appScope.totalWeight }}
</div>'`,
enableSorting : false,
}, {
Expand Down Expand Up @@ -287,6 +289,7 @@ function CreateShipmentController(
const oldCont = vm.containers.find(cont => cont.uuid === container.uuid);
oldCont.label = result.label;
oldCont.weight = result.weight;
oldCont.description = result.description;
oldCont.container_type_id = result.container_type_id;
oldCont.container_type = result.container_type;
})
Expand Down Expand Up @@ -315,6 +318,7 @@ function CreateShipmentController(
Containers.delete(container.uuid);
}

updateTotals();
checkVisibility();
};

Expand All @@ -330,6 +334,8 @@ function CreateShipmentController(

vm.setContainerFromDropdown = function setContainerFromDropdown(row, container) {
row.container_label = container.label;
row.container_uuid = container.uuid;
updateTotals();
};

vm.setLotFromDropdown = function setLotFromDropdown(row, lot) {
Expand Down
9 changes: 9 additions & 0 deletions client/src/modules/shipment/modals/edit-container.modal.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@
</bh-input-text>
</div>

<div class="form-group">
<bh-input-text
key="description"
text-value="$ctrl.container.description"
label="FORM.LABELS.DESCRIPTION"
autocomplete="off">
</bh-input-text>
</div>

<div class="form-group">
<label class="control-label" for="containerType" translate>SHIPMENT.CONTAINER_TYPE</label>
<ui-select name="container_type_id" ng-model="$ctrl.container.container_type_id" ng-required="$ctrl.required">
Expand Down
1 change: 1 addition & 0 deletions client/src/modules/shipment/modals/edit-container.modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ function ContainerEditModalController(Data, Containers, Notify, Instance) {
const updates = { // These are the only fields that we can update
label : vm.container.label,
weight : vm.container.weight,
description : vm.container.description,
container_type_id : vm.container.container_type_id,
};
Containers.update(vm.container.uuid, updates)
Expand Down
5 changes: 5 additions & 0 deletions client/src/modules/shipment/shipment.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ function ShipmentRegistryController(
vm.onRemoveFilter = onRemoveFilter;
vm.search = search;
vm.shipmentDocument = shipmentDocument;
vm.shipmentGoodsReceivedNote = shipmentGoodsReceivedNote;
vm.shipmentManifest = shipmentManifest;
vm.getShipmentBarcode = getShipmentBarcode;
vm.gotoStockEntry = gotoStockEntry;
Expand Down Expand Up @@ -187,6 +188,10 @@ function ShipmentRegistryController(
return ShipmentModal.openShipmentDocument(uuid);
}

function shipmentGoodsReceivedNote(uuid) {
return ShipmentModal.openShipmentGoodsReceivedNote(uuid);
}

function shipmentManifest(uuid) {
return ShipmentModal.openShipmentManifest(uuid);
}
Expand Down
7 changes: 7 additions & 0 deletions client/src/modules/shipment/shipment.modal.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ function ShipmentModalService(Modal, Receipts) {

service.openSearchShipment = openSearchShipment;
service.openShipmentDocument = openShipmentDocument;
service.openShipmentGoodsReceivedNote = openShipmentGoodsReceivedNote;
service.openShipmentManifest = openShipmentManifest;
service.openShipmentBarcode = openShipmentBarcode;

Expand Down Expand Up @@ -96,6 +97,12 @@ function ShipmentModalService(Modal, Receipts) {
return ReceiptFactory(promise, opts);
}

function openShipmentGoodsReceivedNote(documentUuid, notifyCreated) {
const opts = { title : 'SHIPMENT.GOODS_RECEIVED_NOTE', notifyCreated, renderer : Receipts.renderer };
const promise = Receipts.shipmentGoodsReceivedNote(documentUuid, { renderer : opts.renderer });
return ReceiptFactory(promise, opts);
}

function openShipmentManifest(documentUuid, notifyCreated) {
const opts = { title : 'SHIPMENT.SHIPMENT_MANIFEST', notifyCreated, renderer : Receipts.renderer };
const promise = Receipts.shipmentManifest(documentUuid, { renderer : opts.renderer });
Expand Down
7 changes: 6 additions & 1 deletion client/src/modules/shipment/templates/action.tmpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,16 @@
<i class="fa fa-file-pdf-o"></i> <span translate>SHIPMENT.DOCUMENT</span>
</a>
</li>
<li>
<li ng-if="!row.entity.isAtDepot">
<a ng-click="grid.appScope.shipmentManifest(row.entity.uuid)" href>
<i class="fa fa-file-pdf-o"></i> <span translate>SHIPMENT.MANIFEST</span>
</a>
</li>
<li>
<a ng-click="grid.appScope.shipmentGoodsReceivedNote(row.entity.uuid)" href>
<i class="fa fa-file-pdf-o"></i> <span translate>SHIPMENT.GOODS_RECEIVED_NOTE</span>
</a>
</li>
<li class="divider" ng-if="row.entity.isAtDepot"></li>
<li ng-if="row.entity.isAtDepot">
<a ui-sref="shipments-edit({ uuid : row.entity.uuid })" href>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ <h4 translate>SHIPMENT.CONTAINERS</h4>
<thead>
<tr>
<th translate>FORM.LABELS.LABEL</th>
<th translate>FORM.LABELS.DESCRIPTION</th>
<th translate>FORM.LABELS.TYPE</th>
<th translate>SHIPMENT.NUM_ITEMS</th>
<th translate>SHIPMENT.CONTAINER_WEIGHT_EMPTY</th>
Expand All @@ -17,6 +18,7 @@ <h4 translate>SHIPMENT.CONTAINERS</h4>
<tbody>
<tr ng-repeat="cont in grid.appScope.containers">
<td>{{cont.label}}</td>
<td>{{cont.description}}</td>
<td>{{cont.container_type}}</td>
<td>{{cont.num_items}}</td>
<td>{{cont.weight}}</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const ShipmentContainer = require('../shipment_containers');
const BASE_URL = './server/controllers/asset_management/shipment';
const SHIPMENTS_REPORT_TEMPLATE = `${BASE_URL}/reports/shipments.handlebars`;
const SHIPMENT_DOCUMENT_TEMPLATE = `${BASE_URL}/reports/shipment-document.handlebars`;
const SHIPMENT_GOODS_RECEIVED_NOTE_TEMPLATE = `${BASE_URL}/reports/shipment-goods-received-note.handlebars`;
const SHIPMENT_MANIFEST_TEMPLATE = `${BASE_URL}/reports/shipment-manifest.handlebars`;
const SHIPMENT_BARCODE_TEMPLATE = `${BASE_URL}/reports/shipment-barcode.handlebars`;

Expand All @@ -29,6 +30,7 @@ module.exports = {
// export handlebars templates
SHIPMENTS_REPORT_TEMPLATE,
SHIPMENT_DOCUMENT_TEMPLATE,
SHIPMENT_GOODS_RECEIVED_NOTE_TEMPLATE,
SHIPMENT_MANIFEST_TEMPLATE,
SHIPMENT_BARCODE_TEMPLATE,
};
Loading

0 comments on commit 42e3c38

Please sign in to comment.