Skip to content

Commit

Permalink
Merge pull request #580 from iShafayet/sprint-0.1.8
Browse files Browse the repository at this point in the history
Sprint 0.1.8
  • Loading branch information
iShafayet authored Mar 29, 2019
2 parents 5e51961 + 01e0fd7 commit 67d455e
Show file tree
Hide file tree
Showing 48 changed files with 942 additions and 116 deletions.
4 changes: 2 additions & 2 deletions admin-client/src/torque-common-behavior.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
return (JSON.stringify(obj, null, 2));
}

checkPrivilege(privilege) {
hasPrivilege(privilege) {
if (!(privilege in this.app.organization.employment.privileges)) {
throw new Error(`No such privilege "${privilege}".`);
}
Expand All @@ -113,7 +113,7 @@
this.app.navigateTo('/select-organization');
return false;
}
if (!privilegeList.every(privilege => this.checkPrivilege(privilege))) {
if (!privilegeList.every(privilege => this.hasPrivilege(privilege))) {
this.app.navigateTo('/error403');
return false;
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@

<!-- Add to homescreen for Chrome on Android. Fallback for manifest.json -->
<meta name="mobile-web-app-capable" content="yes">
<meta name="application-name" content="Torque">
<meta name="application-name" content="Lipi">

<!-- Add to homescreen for Safari on iOS -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="apple-mobile-web-app-title" content="Torque">
<meta name="apple-mobile-web-app-title" content="Lipi">

<!-- Homescreen icons -->
<link rel="apple-touch-icon" sizes="192x192" href="images/manifest/icon-192x192.png">
Expand Down
24 changes: 20 additions & 4 deletions client/src/lang-bn-bd.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"thankYou": "ধন্যবাদ",
"listIsEmpty": "তালিকা খালি।",
"search": "খোঁজ",
"scan": "স্ক্যান",
"select": "বাছাই",
"remove": "সরান",
"selected": "বাছাইকৃত",
Expand Down Expand Up @@ -129,6 +130,7 @@
"nowAUserOfTorque": "আপনি এখন লিপির একটি ব্যবহারকারী। আপনি এখন লগ ইন করতে পারেন।"
},
"sidebar": {
"lipiName": "লিপি",
"home": "হোম",
"employees": "কর্মচারী",
"outlets": "দোকান",
Expand Down Expand Up @@ -279,6 +281,8 @@
"productBlueprintNameInputError": "একটি সঠিক নাম লিখুন",
"productBlueprintUnitInput": "একক নির্দিষ্ট করুন (যেমন কেজি, পিস্)",
"productBlueprintUnitInputError": "একটি সঠিক একক লিখুন",
"identifierCodeInput": "সনাক্তকরণ কোড",
"identifierCodeInputError": "একটি সঠিক সনাক্তকরণ কোড লিখুন",
"defaultPurchasePriceInput": "ক্রয় মূল্য",
"defaultPurchasePriceInputError": "একটি সঠিক অংক লিখুন",
"defaultVatInput": "ভ্যাট",
Expand Down Expand Up @@ -569,7 +573,8 @@
"productReturn": "পণ্য ফেরত",
"service": "সেবা",
"discardQuestion": "এই বিক্রি বাতিল?",
"discardMessage": "বাতিল করা হলে কোনো রিপোর্ট কিংবা হিসেবে এই বিক্রি ধরা হবে না। বিক্রয়কৃত সেবা সদস্যপদ (যদি থাকে) বাতিল হয়ে যাবে।"
"discardMessage": "বাতিল করা হলে কোনো রিপোর্ট কিংবা হিসেবে এই বিক্রি ধরা হবে না। বিক্রয়কৃত সেবা সদস্যপদ (যদি থাকে) বাতিল হয়ে যাবে।",
"dueAmount": "বাকি অর্থ"
},
"warehouse": {
"editPageTitle": "গুদাম আপডেট করুন",
Expand Down Expand Up @@ -714,8 +719,9 @@
"acquiredOn": "খরিদ হয়েছে",
"addedOn": "যুক্ত হয়েছে",
"noProductFoundInOutlet": "কোনো পণ্য পাওয়া যায়নি। পেছনে গিয়ে দোকানের প্রধান পণ্য তালিকায় পণ্য যোগ করুন।",
"searchForProductInput": "পণ্যের নাম দিয়ে অনুসন্ধান",
"searchForProductInputError": "পণ্যের সন্ধানে ত্রুটি"
"searchForProductInput": "পণ্যের নাম",
"searchForProductInputError": "পণ্যের সন্ধানে ত্রুটি",
"scanButtonHelp": "একটি স্ক্যানার ব্যবহার করে দ্রুত অনেক পণ্য বাছাই করুন"
},
"posSelectService": {
"posSelectServiceTitle": "সেবা নির্বাচন",
Expand Down Expand Up @@ -792,7 +798,8 @@
"instructionThree": "৩. পণ্য পরিকল্পনার একটি একক (Unit) দিন, যেমন: কেজি, পিস অথবা বাক্স;",
"instructionFour": "৪. পণ্য পরিকল্পনার কেনা দাম (Purchase Price), বিক্রি দাম (Sale Price) এবং ভ্যাট শতাংশ (VAT) দিন, এভাবে;",
"instructionFive": "৫. Returnable এর নিচে yes (হ্যা) দিন যদি পণ্য ফেরতযোগ্য হয়ে, no (না) দিন যদি নয়;",
"instructionSix": "৬. সকল স্থান পূরণ থাকতে হবে, নাহলে লিপি ফাইলটি গ্রহণ করবে না;",
"instructionSix": "৬. Barcode এর নিচে পণ্যের বারকোড নম্বর দিন (অথবা খালি রাখতে পারেন);",
"instructionLast": "৭. সকল স্থান পূরণ থাকতে হবে, নাহলে লিপি ফাইলটি গ্রহণ করবে না;",
"uploadSectionTip": "পণ্যের পরিকল্পনা ধারণকারী CSV ফাইলটি জমা করুন;",
"uploadButtonLabel": "ফাইল জমা করুন",
"successfullyImported": "ফাইল পড়তে সফল, মোট পণ্যের পরিকল্পনা তৈরি হয়েছে",
Expand Down Expand Up @@ -891,5 +898,14 @@
"paidAmountInput": "পরিশোধিত",
"changeAmount": "ফেরত",
"dueAmount": "বাকি অর্থ"
},
"scan": {
"pageTitle": "পণ্য স্ক্যান করুন",
"active": "স্ক্যানিং সক্রিয়",
"activeMessage": "সংযুক্ত বারকোড স্ক্যানিং ডিভাইস ব্যবহার করে পণ্য স্ক্যান শুরু করুন।",
"countMessagePart1": "মোট স্ক্যান করা হয়েছে: ",
"countMessagePart2": " টি পণ্য",
"noMatchingProductsError": "সর্বশেষ স্ক্যান করা পণ্য পাওয়া যায়নি",
"lastScanned": "সর্বশেষ স্ক্যান হয়েছে: "
}
}
24 changes: 20 additions & 4 deletions client/src/lang-en-us.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"thankYou": "Thank you.",
"listIsEmpty": "List is Empty.",
"search": "Search",
"scan": "Scan",
"select": "Select",
"remove": "Remove",
"selected": "Selected",
Expand Down Expand Up @@ -126,9 +127,10 @@
"tocLinkPart2": "The Terms and Conditions",
"tocLinkPart3": " before you register.",
"tocCheckbox": "I have read, understood and agree to the Terms and Conditions above.",
"nowAUserOfTorque": "You are now a user of Torque. You now may log in."
"nowAUserOfTorque": "You are now a user of Lipi. You now may log in."
},
"sidebar": {
"lipiName": "Lipi",
"home": "Home",
"employees": "Employees",
"outlets": "Outlets",
Expand Down Expand Up @@ -277,6 +279,8 @@
"productBlueprintNameInputError": "Enter a valid name",
"productBlueprintUnitInput": "Specify unit (i.e. kg, pcs etc)",
"productBlueprintUnitInputError": "Enter a valid name",
"identifierCodeInput": "Identifier Code",
"identifierCodeInputError": "Enter a valid identifier code.",
"defaultPurchasePriceInput": "Default Purchase Price",
"defaultPurchasePriceInputError": "Enter a valid amount",
"defaultVatInput": "Default VAT",
Expand Down Expand Up @@ -567,7 +571,8 @@
"productReturn": "Return Product",
"service": "Service",
"discardQuestion": "Discard this Sale?",
"discardMessage": "Once discarded, this sale will not be considered in any report or calculation. Service Membership(s) sold in this sale (if any) will also be discarded."
"discardMessage": "Once discarded, this sale will not be considered in any report or calculation. Service Membership(s) sold in this sale (if any) will also be discarded.",
"dueAmount": "Due amount"
},
"warehouse": {
"editPageTitle": "Edit Warehouse",
Expand Down Expand Up @@ -714,7 +719,8 @@
"addedOn": "Added On",
"noProductFoundInOutlet": "No products found. Go back and add products to the Outlet's default inventory.",
"searchForProductInput": "Product Name",
"searchForProductInputError": "Error in Search"
"searchForProductInputError": "Error in Search",
"scanButtonHelp": "Use code scanner to select multiple products quickly"
},
"posSelectService": {
"posSelectServiceTitle": "Select Services",
Expand Down Expand Up @@ -791,7 +797,8 @@
"instructionThree": "3. Enter a Unit of the product blueprint, example: kg, piece or box;",
"instructionFour": "4. Enter Purchase Price, Sale Price and VAT percentage of the product blueprint;",
"instructionFive": "5. Under Returnable enter 'yes' if customers can return this product blueprint, 'no' if not;",
"instructionSix": "6. All the fields must be entered, like below, or else Lipi will not accept this file;",
"instructionSix": "6. Under Barcode enter the product's barcode number (you can leave it empty);",
"instructionLast": "7. All the fields must be entered, like below, or else Lipi will not accept this file;",
"uploadSectionTip": "Upload the CSV file containing Product Blueprint data;",
"uploadButtonLabel": "Upload File",
"successfullyImported": "Import Successful, total product blueprints created",
Expand Down Expand Up @@ -890,5 +897,14 @@
"paidAmountInput": "Paid",
"changeAmount": "Change",
"dueAmount": "Due"
},
"scan": {
"pageTitle": "Scan Product(s)",
"active": "SCANNING ACTIVE",
"activeMessage": "Start scanning products using the attached barcode scanning device.",
"countMessagePart1": "Total Scanned so far: ",
"countMessagePart2": " product(s)",
"noMatchingProductsError": "Last scanned product not found",
"lastScanned": "Last scanned: "
}
}
27 changes: 22 additions & 5 deletions client/src/page-bulk-import-product-blueprints.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
<div class="card-text-container">
[[verses.bulkImportProductBlueprint.downloadSectionTip]]
</div>

<paper-button raised class="primary" style="width: 100%; margin-top: 12px;" on-tap="downloadCsvTapped">
<iron-icon class="button-icon" icon="icons:file-download"></iron-icon>
[[verses.bulkImportProductBlueprint.downloadButtonLabel]]
Expand Down Expand Up @@ -132,6 +132,13 @@
</div>
</li>

<li>
[[verses.bulkImportProductBlueprint.instructionLast]]
<div class="instruction-image-container">
<img class="instruction-image" src="../images/bulk-product-blueprint-instruction/instruction-last.png">
</div>
</li>

</ul>
</div>
</div>
Expand All @@ -158,9 +165,9 @@
<div class="success-message">
[[verses.bulkImportProductBlueprint.successfullyImported]]: [[results.successfulCount]]
</div>

<template is="dom-if" if="[[results.ignoredRowList.length]]">
[[verses.bulkImportProductBlueprint.rowsIgnored]]:
[[verses.bulkImportProductBlueprint.rowsIgnored]]:
<ul class="ignored-row-list">
<template is="dom-repeat" items="[[results.ignoredRowList]]">
<li>[[verses.bulkImportProductBlueprint.row]] #[[item.rowNumber]]
Expand Down Expand Up @@ -209,7 +216,8 @@
"Purchase Price",
"Sale Price",
"VAT",
"Returnable"
"Returnable",
"Barcode"
]
}
};
Expand Down Expand Up @@ -312,10 +320,19 @@
let rowIndex = 1;
for (let rawRow of rawRowList) {
if (!isArray(rawRow) || rawRow.length !== this.headerList.length) {
return cbfn(makeError(rowIndex + " " + this.app.verses.bulkImportProductBlueprint.missingCellsInRow ));
return cbfn(makeError(rowIndex + " " + this.app.verses.bulkImportProductBlueprint.missingCellsInRow));
}
rowIndex += 1;
}
// since null is not acceptable for identifierCode
rawRowList.forEach(rawRow => {
if (rawRow[6] === null) {
rawRow[6] = '';
}
if (typeof (rawRow[6]) !== 'string') {
rawRow[6] = String(rawRow[6]);
}
})
cbfn(null, rawRowList);
}

Expand Down
26 changes: 15 additions & 11 deletions client/src/page-edit-product-blueprint.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
<div slot="suffix">[[app.settings.monetaryUnit]]</div>
</paper-input>

<paper-input class="editProductBlueprintForm--identifierCode" value="{{editProductBlueprintForm.identifierCode}}" minlength="0" maxlength="64" error-message=[[verses.productBlueprint.identifierCodeInputError]] label="[[verses.productBlueprint.identifierCodeInput]] [[verses.general.optional]]"></paper-input>

<paper-checkbox checked="{{editProductBlueprintForm.isReturnable}}">[[verses.productBlueprint.isProductReturnable]]</paper-checkbox>

<div class="horizontal layout button-row end">
Expand Down Expand Up @@ -88,6 +90,7 @@
return {
name: "Bottoms",
unit: "pcs",
identifierCode: '',
defaultPurchasePrice: 400,
defaultVat: 15,
defaultSalePrice: 500,
Expand All @@ -97,6 +100,7 @@
return {
name: "",
unit: "",
identifierCode: '',
defaultPurchasePrice: 0,
defaultVat: 0,
defaultSalePrice: 0,
Expand Down Expand Up @@ -173,13 +177,13 @@
return productBlueprint.id === parseInt(this.params['product-blueprint']);
});
this.editingProductBlueprint = productBlueprint;
let { name, unit, defaultPurchasePrice, defaultVat, defaultSalePrice, isReturnable } = productBlueprint;
this.editProductBlueprintForm = { name, unit, defaultPurchasePrice, defaultVat, defaultSalePrice, isReturnable };
let { name, unit, identifierCode, defaultPurchasePrice, defaultVat, defaultSalePrice, isReturnable } = productBlueprint;
this.editProductBlueprintForm = { name, unit, identifierCode, defaultPurchasePrice, defaultVat, defaultSalePrice, isReturnable };
}

_processCreateProductBlueprint({ name, unit, defaultPurchasePrice, defaultVat, defaultSalePrice, isReturnable }) {
_processCreateProductBlueprint({ name, unit, identifierCode, defaultPurchasePrice, defaultVat, defaultSalePrice, isReturnable }) {
let data = {
name, unit, defaultPurchasePrice, defaultVat, defaultSalePrice, isReturnable,
name, unit, identifierCode, defaultPurchasePrice, defaultVat, defaultSalePrice, isReturnable,
organizationId: this.app.organization.id,
};
this.app.callAddProductBlueprintApi(data, (err, response) => {
Expand All @@ -192,9 +196,9 @@
});
}

_processUpdateProductBlueprint({ name, unit, defaultPurchasePrice, defaultVat, defaultSalePrice, isReturnable }) {
_processUpdateProductBlueprint({ name, unit, identifierCode, defaultPurchasePrice, defaultVat, defaultSalePrice, isReturnable }) {
let data = {
name, unit, defaultPurchasePrice, defaultVat, defaultSalePrice, isReturnable,
name, unit, identifierCode, defaultPurchasePrice, defaultVat, defaultSalePrice, isReturnable,
productBlueprintId: this.editingProductBlueprint.id
};

Expand All @@ -218,24 +222,24 @@
this.elemAll('#editProductBlueprintForm paper-input').forEach(el => el.autoValidate = true);
if (!this.elem('#editProductBlueprintForm').validate()) return;

let { name, unit, defaultPurchasePrice, defaultVat, defaultSalePrice, isReturnable } = this.editProductBlueprintForm;
this._processCreateProductBlueprint({ name, unit, defaultPurchasePrice, defaultVat, defaultSalePrice, isReturnable });
let { name, unit, identifierCode, defaultPurchasePrice, defaultVat, defaultSalePrice, isReturnable } = this.editProductBlueprintForm;
this._processCreateProductBlueprint({ name, unit, identifierCode, defaultPurchasePrice, defaultVat, defaultSalePrice, isReturnable });
}

updateProductBlueprintTapped(e = null) {
this.elemAll('#editProductBlueprintForm paper-input').forEach(el => el.autoValidate = true);
if (!this.elem('#editProductBlueprintForm').validate()) return;

let { name, unit, defaultPurchasePrice, defaultVat, defaultSalePrice, isReturnable } = this.editProductBlueprintForm;
this._processUpdateProductBlueprint({ name, unit, defaultPurchasePrice, defaultVat, defaultSalePrice, isReturnable });
let { name, unit, identifierCode, defaultPurchasePrice, defaultVat, defaultSalePrice, isReturnable } = this.editProductBlueprintForm;
this._processUpdateProductBlueprint({ name, unit, identifierCode, defaultPurchasePrice, defaultVat, defaultSalePrice, isReturnable });
}

genericDiscountValueInputChanged(e) {
this.enforceMinMaxOnPaperInput(e);
}

calculateSalePriceAfterVat() {
return (parseFloat(this.editProductBlueprintForm.defaultSalePrice) + parseFloat(this.editProductBlueprintForm.defaultSalePrice) * parseFloat(this.editProductBlueprintForm.defaultVat)/100);
return (parseFloat(this.editProductBlueprintForm.defaultSalePrice) + parseFloat(this.editProductBlueprintForm.defaultSalePrice) * parseFloat(this.editProductBlueprintForm.defaultVat) / 100);
}

// region: misc =================================
Expand Down
Loading

0 comments on commit 67d455e

Please sign in to comment.