Skip to content

Commit

Permalink
Additional information on purchase order
Browse files Browse the repository at this point in the history
  • Loading branch information
mbayopanda committed Oct 10, 2022
1 parent 9315413 commit 8e31cc9
Show file tree
Hide file tree
Showing 13 changed files with 174 additions and 106 deletions.
4 changes: 4 additions & 0 deletions client/src/css/documents.css
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,7 @@
width: 100%;
}
/* ========================== End Upload thumbnail ========================== */

@media print {
footer {page-break-after: always;}
}
71 changes: 45 additions & 26 deletions client/src/i18n/en/purchases.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,49 @@
{
"PURCHASES" : {
"ORDER" : "Purchase order",
"PAGE_TITLE" : "Purchases",
"PAYMENT_METHOD" : "Payment Method",
"PAYMENT_METHOD_EXPLANATION" : "This field provides the agreed payment conditions of the purchase order. A purchase can either be paid up front, at delivery, or in some other combination of payments.",
"ERRORS" : {
"INVALID_ITEMS" : "Some of the purchase order items have errors. Please correct these mistakes and resubmit the purchase order.",
"INVALID_ACCOUNTS" : "Some of the items selected for purchase are missing critical accounts. Please confirm that all inventory items have a COGS account and a stock account."
"PURCHASES": {
"ORDER": "Purchase order",
"PAGE_TITLE": "Purchases",
"PAYMENT_METHOD": "Payment Method",
"PAYMENT_METHOD_EXPLANATION": "This field provides the agreed payment conditions of the purchase order. A purchase can either be paid up front, at delivery, or in some other combination of payments.",
"ERRORS": {
"INVALID_ITEMS": "Some of the purchase order items have errors. Please correct these mistakes and resubmit the purchase order.",
"INVALID_ACCOUNTS": "Some of the items selected for purchase are missing critical accounts. Please confirm that all inventory items have a COGS account and a stock account."
},
"RECEIPT" : {
"TITLE" : "Purchase Order Receipt",
"SUCCESS" : "Purchase Order created."
"RECEIPT": {
"TITLE": "Purchase Order Receipt",
"SUCCESS": "Purchase Order created."
},
"STATUS" : {
"CANCELLED" : "Cancelled",
"CANCELLED_DESC" : "The purchase order has been cancelled",
"CONFIRMED" : "Confirmed",
"CONFIRMED_DESC" : "The purchase order has been confirmed by the supplier that it can be delivered",
"EXCESSIVE_RECEIVED_QUANTITY" : "The purchase order has been received but with excessive quantity",
"NOT_RECEIVED" : "Not Received",
"NOT_RECEIVED_DESC" : "The purchase order products are not yet in stock",
"PARTIALLY_RECEIVED" : "Partially Received",
"RECEIVED" : "Received in Stock",
"RECEIVED_DESC" : "The purchase order has been completed and products are in stock",
"WAITING_CONFIRMATION" : "Waiting confirmation",
"WAITING_CONFIRMATION_DESC" : "The supplier has not confirmed that the purchase order can be delivered"
}
"STATUS": {
"CANCELLED": "Cancelled",
"CANCELLED_DESC": "The purchase order has been cancelled",
"CONFIRMED": "Confirmed",
"CONFIRMED_DESC": "The purchase order has been confirmed by the supplier that it can be delivered",
"EXCESSIVE_RECEIVED_QUANTITY": "The purchase order has been received but with excessive quantity",
"NOT_RECEIVED": "Not Received",
"NOT_RECEIVED_DESC": "The purchase order products are not yet in stock",
"PARTIALLY_RECEIVED": "Partially Received",
"RECEIVED": "Received in Stock",
"RECEIVED_DESC": "The purchase order has been completed and products are in stock",
"WAITING_CONFIRMATION": "Waiting confirmation",
"WAITING_CONFIRMATION_DESC": "The supplier has not confirmed that the purchase order can be delivered"
},
"INFO": {
"PURCHASE_NUMBER": "Purchase Number",
"PRF_NUMBER": "PRF Number",
"CONTACT_NAME": "Contact",
"CONTACT_PHONE": "Phone",
"CONTACT_TITLE": "Title",
"DELIVERY_LOCATION": "Delivery Location",
"DELIVERY_DATE": "Delivery Date",
"DELIVERY_CONDITION": "Delivery Condition",
"PAYMENT_CONDITION": "Payment Condition",
"SPECIAL_INSTRUCTION": "Special Instruction",
"REQUESTED_BY": "Requested by",
"APPROVED_BY": "Approved by",
"APPROVED_TWO_BY": "Second Approval",
"SIGNATURE": "Signature",
"DATE": "Date",
"TITLE": "Title",
"SUPPLIER_OBLIGATION": "The supplier is required to sign and return a copy of this purchase order:"
}
}
}
}
1 change: 1 addition & 0 deletions client/src/i18n/en/tree.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
"PURCHASE_ORDER" : "Purchase Orders",
"PURCHASE" : "Purchase",
"PURCHASE_REGISTRY" : "Purchase Registry",
"PURCHASE_SETTINGS":"Purchase Settings",
"PURCHASING" : "Purchasing",
"REALIZED_PROFIT_REPORT": "Collection on invoices",
"RECOVERY_CAPACITY_REPORT": "Recovery Capacity",
Expand Down
4 changes: 3 additions & 1 deletion client/src/i18n/fr/enterprise.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
"ENABLE_REQUIRE_COST_CENTER_FOR_POSTING_HELP_TEXT" : "Exiger les centres de cout pour les comptes d'exploitation (6 et 7) avant de poster les ecritures dans le grand livre",
"ENABLE_INDEX_PAYMENT_SYSTEM" : "Activer le systeme de payement par indice",
"HELPDESK_TEXT" : "Coordonnées du service d'assistance",
"HELPDESK_TEXT_HELP" : "Si défini, affichez ces informations sur la façon de contacter le service d'assistance en bas de la page de connexion"
"HELPDESK_TEXT_HELP" : "Si défini, affichez ces informations sur la façon de contacter le service d'assistance en bas de la page de connexion",
"ENABLE_PRF_DETAILS": "Activer les informations supplementaires pour les achats",
"ENABLE_PRF_DETAILS_HELP_TEXT": "En activant cette option, les informations des PRF seront ajoutées pour les achats et les conditions générales d'achats"
}
}
}
1 change: 1 addition & 0 deletions client/src/i18n/fr/tree.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@
"PURCHASE_ORDER":"Achats",
"PURCHASE_ORDER_ANALYSIS": "Analyse de commande d'achat",
"PURCHASE_REGISTRY":"Registre des achats",
"PURCHASE_SETTINGS":"Paramètres des achats",
"PURCHASING":"Achat",
"REALIZED_PROFIT_REPORT": "Recouvrement de factures",
"RECOVERY_CAPACITY_REPORT": "Capacité de recouvrement",
Expand Down
17 changes: 17 additions & 0 deletions client/src/modules/enterprises/enterprises.html
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,23 @@
help-text="ENTERPRISE.SETTINGS.ENABLE_REQUIRE_COST_CENTER_FOR_POSTING_HELP_TEXT"
on-change-callback="EnterpriseCtrl.enableRequireCostCenterForPostingSetting(value)">
</bh-yes-no-radios>

<bh-yes-no-radios
label="ENTERPRISE.SETTINGS.ENABLE_PRF_DETAILS"
value="EnterpriseCtrl.enterprise.settings.enable_prf_details"
name="enable_prf_details"
help-text="ENTERPRISE.SETTINGS.ENABLE_PRF_DETAILS_HELP_TEXT"
on-change-callback="EnterpriseCtrl.enablePRFDetails(value)">
</bh-yes-no-radios>

<div class="form-group"
ng-if="EnterpriseCtrl.enterprise.settings.enable_prf_details">
<textarea
class="form-control"
ng-model="EnterpriseCtrl.enterprise.settings.purchase_general_condition"
rows="5">
</textarea>
</div>
</div>
</div>

Expand Down
8 changes: 8 additions & 0 deletions client/src/modules/enterprises/enterprises.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ function EnterpriseController(Enterprises, util, Notify, Projects, Modal, Scroll
vm.onSelectGainAccount = onSelectGainAccount;
vm.onSelectLossAccount = onSelectLossAccount;
vm.setThumbnail = setThumbnail;
vm.enablePRFDetails = enablePRFDetails;

function enablePRFDetails(value) {
const key = 'enable_prf_details';
vm.enterprise.settings[key] = value;
$touched = true;
}

function uploadLogo(file) {
if (!vm.hasThumbnail) { return null; }
Expand Down Expand Up @@ -74,6 +81,7 @@ function EnterpriseController(Enterprises, util, Notify, Projects, Modal, Scroll
* this choice need the team point of view for to setting the default enterprise
*/
vm.enterprise = vm.hasEnterprise ? vm.enterprises[0] : {};
console.log(vm.enterprise);
return refreshProjects();
})
.catch(Notify.handleError);
Expand Down
148 changes: 74 additions & 74 deletions client/src/modules/purchases/create/createUpdate.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,39 +28,6 @@
on-select-callback="PurchaseCtrl.order.setSupplier(supplier)">
</bh-supplier-select>

<bh-input-text
key="info_contact_name"
text-value="PurchaseCtrl.order.details.info_contact_name"
label="PURCHASES.INFO.CONTACT_NAME">
</bh-input-text>

<bh-input-text
key="info_contact_title"
text-value="PurchaseCtrl.order.details.info_contact_title"
label="PURCHASES.INFO.CONTACT_TITLE">
</bh-input-text>

<bh-input-text
key="info_contact_phone"
text-value="PurchaseCtrl.order.details.info_contact_phone"
label="PURCHASES.INFO.CONTACT_PHONE">
</bh-input-text>

<hr>

<bh-input-text
key="info_purchase_number"
text-value="PurchaseCtrl.order.details.info_purchase_number"
label="PURCHASES.INFO.PURCHASE_NUMBER">
</bh-input-text>
<bh-input-text
key="info_prf_number"
text-value="PurchaseCtrl.order.details.info_prf_number"
label="PURCHASES.INFO.PRF_NUMBER">
</bh-input-text>

</div>
<div class="col-md-4">
<bh-date-editor
date-value="PurchaseCtrl.order.details.date"
on-change="PurchaseCtrl.order.onDateChange(date)">
Expand Down Expand Up @@ -153,19 +120,62 @@
</div>
</div>

<!-- note -->
<div
class="form-group">
<label class="control-label" translate>PURCHASES.INFO.PAYMENT_CONDITION</label>
class="form-group"
ng-class="{'has-error' : PurchaseOrderForm.$submitted && PurchaseOrderForm.notes.$invalid }">
<label class="control-label" translate>FORM.LABELS.NOTES </label>
<textarea
ng-model="PurchaseCtrl.order.details.info_payment_condition"
name="info_payment_condition"
ng-model="PurchaseCtrl.order.details.note"
name="notes"
class="form-control"
rows="3"
ng-maxlength="PurchaseCtrl.maxLength">
rows="2"
ng-maxlength="PurchaseCtrl.maxLength"
required>
</textarea>
<div class="help-block" ng-messages="PurchaseOrderForm.notes.$error" ng-show="PurchaseOrderForm.$submitted">
<div ng-messages-include="modules/templates/messages.tmpl.html"></div>
</div>
</div>

</div>
<div class="col-md-4">

<div ng-if="PurchaseCtrl.enterprise.settings.enable_prf_details">
<bh-input-text
key="info_contact_name"
text-value="PurchaseCtrl.order.details.info_contact_name"
label="PURCHASES.INFO.CONTACT_NAME">
</bh-input-text>

<bh-input-text
key="info_contact_title"
text-value="PurchaseCtrl.order.details.info_contact_title"
label="PURCHASES.INFO.CONTACT_TITLE">
</bh-input-text>

<bh-input-text
key="info_contact_phone"
text-value="PurchaseCtrl.order.details.info_contact_phone"
label="PURCHASES.INFO.CONTACT_PHONE">
</bh-input-text>

<hr>

<bh-input-text
key="info_purchase_number"
text-value="PurchaseCtrl.order.details.info_purchase_number"
label="PURCHASES.INFO.PURCHASE_NUMBER">
</bh-input-text>
<bh-input-text
key="info_prf_number"
text-value="PurchaseCtrl.order.details.info_prf_number"
label="PURCHASES.INFO.PRF_NUMBER">
</bh-input-text>
</div>

</div>
<div ng-if="PurchaseCtrl.enterprise.settings.enable_prf_details" class="col-md-4">

<bh-input-text
key="info_delivery_date"
Expand All @@ -186,48 +196,38 @@
ng-model="PurchaseCtrl.order.details.info_delivery_condition"
name="info_delivery_condition"
class="form-control"
rows="3"
rows="2"
ng-maxlength="PurchaseCtrl.maxLength">
</textarea>
</div>
</div>
</div>
</div>
</div>
</div>

<div class="row">
<div class="col-md-6">
<div
class="form-group"
ng-class="{'has-error' : PurchaseOrderForm.$submitted && PurchaseOrderForm.notes.$invalid }">
<label class="control-label" translate>FORM.LABELS.NOTES </label>
<textarea
ng-model="PurchaseCtrl.order.details.note"
name="notes"
class="form-control"
rows="2"
ng-maxlength="PurchaseCtrl.maxLength"
required>
</textarea>
<div class="help-block" ng-messages="PurchaseOrderForm.notes.$error" ng-show="PurchaseOrderForm.$submitted">
<div ng-messages-include="modules/templates/messages.tmpl.html"></div>
<div
class="form-group">
<label class="control-label" translate>PURCHASES.INFO.SPECIAL_INSTRUCTION</label>
<textarea
ng-model="PurchaseCtrl.order.details.info_special_instruction"
name="info_special_instruction"
class="form-control"
rows="2"
ng-maxlength="PurchaseCtrl.maxLength">
</textarea>
</div>

<div
class="form-group">
<label class="control-label" translate>PURCHASES.INFO.PAYMENT_CONDITION</label>
<textarea
ng-model="PurchaseCtrl.order.details.info_payment_condition"
name="info_payment_condition"
class="form-control"
rows="2"
ng-maxlength="PurchaseCtrl.maxLength">
</textarea>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div
class="form-group">
<label class="control-label" translate>PURCHASES.INFO.SPECIAL_INSTRUCTION</label>
<textarea
ng-model="PurchaseCtrl.order.details.info_special_instruction"
name="info_special_instruction"
class="form-control"
rows="2"
ng-maxlength="PurchaseCtrl.maxLength">
</textarea>
</div>
</div>
</div>

<div class="row" ng-if="PurchaseCtrl.order._hasGlobalError">
Expand Down
6 changes: 3 additions & 3 deletions client/src/modules/purchases/purchases.routes.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
angular.module('bhima.routes')
.config(['$stateProvider', function purchaseRoutes($stateProvider) {
$stateProvider
// purchases/create
// purchases/create
.state('purchasesCreate', {
url : '/purchases/create',
controller : 'PurchaseOrderController as PurchaseCtrl',
templateUrl : 'modules/purchases/create/createUpdate.html',
})

// purchases/:uuid/update
// purchases/:uuid/update
.state('purchasesUpdate', {
url : '/purchases/:uuid/update',
params : { uuid : { squash : true, value : null } },
controller : 'PurchaseOrderController as PurchaseCtrl',
templateUrl : 'modules/purchases/create/createUpdate.html',
})

// purchases
// purchases
.state('purchasesRegistry', {
url : '/purchases',
controller : 'PurchaseRegistryController as PurchaseRegistryCtrl',
Expand Down
5 changes: 4 additions & 1 deletion server/controllers/admin/enterprises.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ exports.list = function list(req, res, next) {
gain_account_id, loss_account_id, enable_price_lock, enable_prepayments,
enable_password_validation, enable_balance_on_invoice_receipt, enable_barcodes,
enable_auto_email_report, enable_index_payment_system, base_index_growth_rate,
posting_payroll_cost_center_mode, enable_require_cost_center_for_posting
posting_payroll_cost_center_mode, enable_require_cost_center_for_posting,
enable_prf_details, purchase_general_condition
FROM enterprise LEFT JOIN enterprise_setting
ON enterprise.id = enterprise_setting.enterprise_id
;`;
Expand All @@ -52,6 +53,8 @@ exports.list = function list(req, res, next) {
'base_index_growth_rate',
'posting_payroll_cost_center_mode',
'enable_require_cost_center_for_posting',
'enable_prf_details',
'purchase_general_condition',
];

row.settings = _.pick(row, settings);
Expand Down
Loading

0 comments on commit 8e31cc9

Please sign in to comment.