Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
774a40b
add firebase setup
vinothentrayn Dec 14, 2018
1e6fffd
update all packages and add collection list page
vinothentrayn Dec 14, 2018
f101ba6
add route for collectionlist
vinothentrayn Dec 14, 2018
38d777b
update month amount is complement
vinothMcc Dec 17, 2018
196619f
add component and service
vinothMcc Dec 18, 2018
e0f27df
add config service
vinothMcc Dec 19, 2018
0de35fc
add config and try to use mobv
vinothMcc Dec 20, 2018
187b0eb
set values of edit invoice complete
vinothMcc Dec 21, 2018
995a533
edit http call only is pending
vinothMcc Dec 21, 2018
2583a8a
work on edit html part
vinothMcc Dec 26, 2018
babb6ea
addd new components
vinothMcc Dec 27, 2018
a4c7359
working on supplier name
vinothMcc Dec 27, 2018
bb18285
work on supplier and line number
vinothMcc Dec 29, 2018
32fd81e
complete invoice page
vinothMcc Jan 9, 2019
acd8249
use map pipe for getting invoice array
vinothMcc Jan 13, 2019
8eec30a
add disable for dropdown
vinothMcc Feb 2, 2019
450fb95
add config file
vinothMcc Apr 20, 2019
1ea268d
complete invoice list
vinothMcc Apr 23, 2019
c52c3e4
add firebase prod json
vinothMcc Apr 23, 2019
8d5958e
Merge pull request #1 from vinothMcc/connect-new-BE
vinothMcc Apr 23, 2019
98b4ee2
fixed header
vinothMcc Apr 23, 2019
3363b5e
adding bootstrap
vinothMcc Apr 23, 2019
e0ad8bd
working on update invoice
vinothMcc Apr 24, 2019
d8223a1
fix header issue
vinothentrayn Apr 24, 2019
614e4e6
package json update
vinothMcc Apr 24, 2019
b3a3861
fix update invoice issue
vinothMcc Apr 24, 2019
149462f
create getInvoice function invoice list
vinothMcc Apr 24, 2019
703d688
complete invoice update
vinothMcc Apr 25, 2019
7aad722
Merge pull request #2 from vinothMcc/connect-new-BE
vinothMcc Apr 25, 2019
ac03b3f
complete filter paid customers only
vinothMcc Apr 25, 2019
5cffedc
PWA completed
vinothMcc May 8, 2019
2dd30ca
add netlify file
vinothentrayn May 9, 2019
bfa4d75
Fix paid customer filter
vinothMcc May 11, 2019
310a1f7
Merge branch 'master' of https://github.com/vinothMcc/firebase-authen…
vinothMcc May 11, 2019
fd9f053
view invoice customer detailes
vinothMcc May 12, 2019
7a97c6a
create and update customer completed with BE
vinothMcc May 14, 2019
938ab56
update app name and short name
vinothMcc May 14, 2019
a7b2428
fix payment issue
vinothMcc May 16, 2019
a8d5b0c
update additional fields customer
vinothMcc May 17, 2019
d7d4793
Fix payment issue
vinothMcc May 18, 2019
fb65c3e
extra and minus
vinothMcc May 23, 2019
b44dc75
Fix update issue
vinothMcc May 24, 2019
7d342b3
Fix clear textbox after saving extra minus value
vinothMcc May 25, 2019
6b46a48
display extra and minus milk details
vinothMcc May 26, 2019
f3884d8
update extra milk design and change variable names
vinothMcc May 27, 2019
5918fbc
add 100 page length for table
vinothMcc Jul 3, 2019
57d7c82
modify table design
vinothentrayn Oct 5, 2019
12ec3f2
Merge pull request #3 from vinothMcc/uptodate-master
vinothMcc Oct 9, 2019
b950b8a
Merge pull request #4 from vinothMcc/mms-version-1
vinothMcc Oct 9, 2019
29618ed
Add font-size for label
vinothMcc Oct 9, 2019
eea3b05
add check box for manual payment
vinothentrayn Oct 15, 2019
6b6c480
add modal for manual update invoice amount
vinothentrayn Oct 16, 2019
c39353c
add manual update invoice popup
vinothentrayn Oct 17, 2019
4b29d1c
Fix manual dialog box close
vinothentrayn Oct 20, 2019
a35ea5c
fix calling again BE for update list
vinothentrayn Dec 12, 2019
c0e263a
add tab component
vinothentrayn Dec 31, 2019
b304e8f
npm update done
vinothentrayn Jan 1, 2020
7ed0af6
add statistic component and tab component
vinothentrayn Jan 4, 2020
6aad75a
statistics component design update
vinothentrayn Jan 4, 2020
2b02703
update statistics design
vinothentrayn Jan 12, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix update issue
  • Loading branch information
vinothMcc committed May 24, 2019
commit b44dc7513cbbfb253c49afe005aff549ca5d8377
2 changes: 2 additions & 0 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { MatIconModule } from '@angular/material/icon';
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
import { MatSelectModule } from '@angular/material/select';
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
import { MatSnackBarModule } from '@angular/material/snack-bar';
import { MatToolbarModule } from '@angular/material/toolbar';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
Expand Down Expand Up @@ -77,6 +78,7 @@ import { UserResolver } from './user/user.resolver';
MatSelectModule,
MatIconModule,
MatSlideToggleModule,
MatSnackBarModule,
MobxAngularModule,
ServiceWorkerModule.register('ngsw-worker.js', {
enabled: environment.production
Expand Down
105 changes: 85 additions & 20 deletions src/app/pages/invoice-list/invoice-list.component.html
Original file line number Diff line number Diff line change
@@ -1,24 +1,33 @@
<div class="invoice-container">
<div class="row mb-2">

<div class="col">
<section class="example-section">
Extra/Minus
<mat-slide-toggle class="example-margin" (change)="findDailyMonthUpdate($event)">
<mat-slide-toggle
class="example-margin"
(change)="findDailyMonthUpdate($event)"
>
</mat-slide-toggle>
</section>
</div>
<div class="col">
<button class="btn bg-success text-white float-right" [routerLink]="['/edit-invoice',0]">New
Customer</button>
<button
class="btn bg-success text-white float-right"
[routerLink]="['/edit-invoice', 0]"
>
New Customer
</button>
</div>
</div>
<div class="row">
<div class="col">
<div class="form-group mb-0">
<p class="mb-0">Select supplier</p>
<mat-form-field class="col-12">
<mat-select (selectionChange)="changeSupplier($event)" [(value)]="supplierName">
<mat-select
(selectionChange)="changeSupplier($event)"
[(value)]="supplierName"
>
<mat-option *ngFor="let supplier of suppliers" [value]="supplier">
{{ supplier }}
</mat-option>
Expand All @@ -28,8 +37,15 @@
<div class="form-group mb-0">
<p class="mb-0">Select line number</p>
<mat-form-field class="col-12">
<mat-select (selectionChange)="changeLine($event)" [disabled]="disableLineNumber" [(value)]="lineNumber">
<mat-option *ngFor="let lineNumber of lineNumberList" [value]="lineNumber">
<mat-select
(selectionChange)="changeLine($event)"
[disabled]="disableLineNumber"
[(value)]="lineNumber"
>
<mat-option
*ngFor="let lineNumber of lineNumberList"
[value]="lineNumber"
>
{{ lineNumber }}
</mat-option>
</mat-select>
Expand All @@ -38,24 +54,42 @@

<div class="form-group mb-0">
<section class="example-section">
<mat-checkbox class="example-margin" (change)="filterNotPaidCustomer($event)">Show Paid Customer Only
<mat-checkbox
class="example-margin"
(change)="filterNotPaidCustomer($event)"
>Show Paid Customer Only
</mat-checkbox>
</section>
</div>

<div class="form-group mb-0">
<mat-form-field class="col-12">
<input matInput (keyup)="applyFilter($event.target.value)" placeholder="Search Customers" #input />
<input
matInput
(keyup)="applyFilter($event.target.value)"
placeholder="Search Customers"
#input
/>
</mat-form-field>
</div>

<div class="mat-elevation-z8 table-responsive mb-4">
<table mat-table [dataSource]="dataSource" matSort class="table-bordered">
<table
mat-table
[dataSource]="dataSource"
matSort
class="table-bordered"
>
<ng-container matColumnDef="customer_name">
<th mat-header-cell *matHeaderCellDef mat-sort-header class="col">
Name
</th>
<td mat-cell class="name col pl-2" *matCellDef="let invoice" [routerLink]="['/edit-invoice', invoice._id]">
<td
mat-cell
class="name col pl-2"
*matCellDef="let invoice"
[routerLink]="['/edit-invoice', invoice._id]"
>
<u>{{ invoice.customer_name }}</u>
</td>
</ng-container>
Expand All @@ -64,9 +98,18 @@
<th mat-header-cell *matHeaderCellDef class="col text-center">
Total
</th>
<td mat-cell class="total col" *matCellDef="let invoice" style="color: rgba(22, 188, 218, 0.699);">
<td
mat-cell
class="total col"
*matCellDef="let invoice"
style="color: rgba(22, 188, 218, 0.699);"
>
<p class="text-center" *ngIf="invoice.invoice">
{{ invoice.invoice.payment?invoice.invoice.payment[0].amount:0 }}
{{
invoice.invoice.payment
? invoice.invoice.payment[0].amount
: 0
}}
</p>
<p class="text-center" *ngIf="!invoice.invoice">
-
Expand All @@ -79,8 +122,13 @@
Pay
</th>
<td mat-cell class="pay col" *matCellDef="let invoice">
<input type="text" class="form-control form-control-sm"
(keyup.enter)="updateAmount($event.target.value, invoice, 'invoice_amount')" />
<input
type="text"
class="form-control form-control-sm"
(keyup.enter)="
updateAmount($event.target.value, invoice, 'invoice_amount')
"
/>
</td>
</ng-container>

Expand All @@ -89,8 +137,15 @@
Extra
</th>
<td mat-cell class="pay col" *matCellDef="let invoice">
<input type="text" class="form-control form-control-sm"
(keyup.enter)="updateAmount($event.target.value, invoice, 'extra_amount')" />
<input
type="text"
id="extra_milk"
class="extra_and_minus form-control form-control-sm"
[(value)]="extra_milk_value"
(keyup.enter)="
updateAmount($event.target.value, invoice, 'extra_amount')
"
/>
</td>
</ng-container>

Expand All @@ -99,15 +154,25 @@
Minus
</th>
<td mat-cell class="pay col" *matCellDef="let invoice">
<input type="text" class="form-control form-control-sm"
(keyup.enter)="updateAmount($event.target.value, invoice, 'minus_amount')" />
<input
type="text"
id="minus_milk"
[(value)]="minus_milk_value"
class="extra_and_minus form-control form-control-sm"
(keyup.enter)="
updateAmount($event.target.value, invoice, 'minus_amount')
"
/>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
</table>

<div *ngIf="isLoading" style="display: flex; justify-content: center; align-items: center">
<div
*ngIf="isLoading"
style="display: flex; justify-content: center; align-items: center"
>
<h2>Loading...</h2>
</div>
<mat-paginator [pageSizeOptions]="[25, 100]"></mat-paginator>
Expand Down
13 changes: 10 additions & 3 deletions src/app/pages/invoice-list/invoice-list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ export class InvoiceListComponent implements OnInit {
lineNumberList;
suppliers;
showMonthlyTextBox: boolean;
minus_milk_value = '';
extra_milk_value = '';

constructor(
private _http: HttpService,
Expand Down Expand Up @@ -87,6 +89,9 @@ export class InvoiceListComponent implements OnInit {
.updateExtraAndMinusAmount(customerInvoice)
.subscribe(res => {
console.log(res);
this._utils.openSnackBar('Update successfully!');
this.minus_milk_value = '';
this.extra_milk_value = '';
});
}
}
Expand Down Expand Up @@ -162,13 +167,15 @@ export class InvoiceListComponent implements OnInit {
}

findDailyMonthUpdate(event) {
this.showMonthlyTextBox = false;
localStorage.showMonthlyTextBox = false;
this.displayedColumns = ['customer_name', 'total', 'pay'];
if (event.checked) {
this.showMonthlyTextBox = true;
localStorage.showMonthlyTextBox = true;
this.displayedColumns = ['customer_name', 'total', 'extra', 'minus'];
} else {
this.showMonthlyTextBox = false;
localStorage.showMonthlyTextBox = false;
this.displayedColumns = ['customer_name', 'total', 'pay'];
}
return this.showMonthlyTextBox;
}
}
8 changes: 7 additions & 1 deletion src/app/services/utils.service.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
import { Injectable } from '@angular/core';
import { MatSnackBar } from '@angular/material';
import { UUID } from 'angular2-uuid';

@Injectable({
providedIn: 'root'
})
export class UtilsService {
constructor() {}
constructor(private snackBar: MatSnackBar) {}
generateUUID() {
return UUID.UUID();
}
openSnackBar(message) {
this.snackBar.open(message, 'undo', {
duration: 3000
});
}
}