From a794ef924475c09abe11b0ea4aa8b5fce83fb7a9 Mon Sep 17 00:00:00 2001 From: Chirag Bhatt Date: Tue, 12 Oct 2021 00:00:44 +0530 Subject: [PATCH 1/2] Added item wise discounts --- css/style.css | 2 +- index.html | 14 +++++++++----- js/main.js | 17 +++++++++-------- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/css/style.css b/css/style.css index f36dfe9..aa69a67 100644 --- a/css/style.css +++ b/css/style.css @@ -118,7 +118,7 @@ body{ } div.container{ - width: 800px; + width: 850px; } #imgInp{ diff --git a/index.html b/index.html index 2dc999d..3f1ed33 100644 --- a/index.html +++ b/index.html @@ -41,7 +41,7 @@
- +
@@ -55,16 +55,17 @@
 
-
Description
+
Description
Quantity
Cost {{currencySymbol}}
+
Discount {{currencySymbol}}
Total
[X]
-
+
@@ -73,8 +74,11 @@
+
+ +
- {{item.cost * item.qty | currency: currencySymbol}} + {{(item.cost - item.discount) * item.qty | currency: currencySymbol}}
@@ -103,7 +107,7 @@
-
+
Jasdeep Singh & Manpreet Singh Made with diff --git a/js/main.js b/js/main.js index d17b9af..592ae05 100644 --- a/js/main.js +++ b/js/main.js @@ -22,7 +22,7 @@ angular.module('invoicing', []) postal: 'M5S 1B6' }, items:[ - { qty: 10, description: 'Gadget', cost: 9.95 } + { qty: 0, description: '', cost: 0, discount: 0 } ] }) @@ -93,6 +93,10 @@ angular.module('invoicing', []) service.all = function() { return [ + { + name: 'Indian Rupee (₹)', + symbol: '₹' + }, { name: 'British Pound (£)', symbol: '£' @@ -105,10 +109,7 @@ angular.module('invoicing', []) name: 'Euro (€)', symbol: '€' }, - { - name: 'Indian Rupee (₹)', - symbol: '₹' - }, + { name: 'Norwegian krone (kr)', symbol: 'kr ' @@ -129,7 +130,7 @@ angular.module('invoicing', []) function($scope, $http, DEFAULT_INVOICE, DEFAULT_LOGO, LocalStorage, Currency) { // Set defaults - $scope.currencySymbol = '$'; + $scope.currencySymbol = '₹'; $scope.logoRemoved = false; $scope.printMode = false; @@ -151,7 +152,7 @@ angular.module('invoicing', []) })() // Adds an item to the invoice's items $scope.addItem = function() { - $scope.invoice.items.push({ qty:0, cost:0, description:"" }); + $scope.invoice.items.push({ qty:0, cost:0, description:"",discount:0 }); } // Toggle's the logo @@ -179,7 +180,7 @@ angular.module('invoicing', []) $scope.invoiceSubTotal = function() { var total = 0.00; angular.forEach($scope.invoice.items, function(item, key){ - total += (item.qty * item.cost); + total += (item.qty * (item.cost - item.discount)); }); return total; }; From 065c1ef47f272ebb435f95f5555524cc6563aeb8 Mon Sep 17 00:00:00 2001 From: Chirag Bhatt Date: Tue, 12 Oct 2021 00:49:42 +0530 Subject: [PATCH 2/2] fixed some design issue and added icon for add remove icons --- images/Add item.png | Bin 0 -> 387 bytes images/Trash item.png | Bin 0 -> 416 bytes index.html | 8 ++++---- 3 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 images/Add item.png create mode 100644 images/Trash item.png diff --git a/images/Add item.png b/images/Add item.png new file mode 100644 index 0000000000000000000000000000000000000000..4bbbfa85fddb977db8a22fee63052c404e087516 GIT binary patch literal 387 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjEX7WqAsj$Z!;#Vf2?- zjUdc;OxLp)$dD{?jVKAuPb(=;EJ|f4FE7{2%*!rLPAo{(%P&fw{mw>;fq{|1)5S5w zqx0=lU#>$20&eqN->ee7QzfgfuylKXzUJ5TrP8i3uXt~*>+SZ*SsOA*Nbm^%CXZQr zW~N-K3D9H_JHV#F`1FQXq_z09$;S@tW8Sj%ZOhLScMj+~Fu9!N(Gg(`eh|Vfq;x## z!D7A#%iIox&M`+BY9eZ|DtKv=H$zOp1#^CAd=d#Wzp$P!rE1VYq literal 0 HcmV?d00001 diff --git a/images/Trash item.png b/images/Trash item.png new file mode 100644 index 0000000000000000000000000000000000000000..9f26da1d0bb7ab310e5815ab7a12e6296819fb44 GIT binary patch literal 416 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjEX7WqAsj$Z!;#Vf2?- zjUdc;OxLp)$dD{?jVKAuPb(=;EJ|f4FE7{2%*!rLPAo{(%P&fw{mw>;fq_xh)5S5w zqx0?6yXh?d z#$Spb{hhG7hwq*5t$^$AHcVD8xWiDH<*xa%MrFgNxsRtMnEF51=-BALZl}hMj;(Dh zat2LdA~K1RyX{r>`<(oI!Ps_^f9S~h9ev~hFf
- [X] +
@@ -83,11 +83,11 @@
- [+] +
-
Sub Total
+
Sub Total
{{invoiceSubTotal() | currency: currencySymbol}}
@@ -95,7 +95,7 @@
{{calculateTax() | currency: currencySymbol}}
-
Grand Total:
+
Grand Total:
{{calculateGrandTotal() | currency: currencySymbol}}