Add files via upload

This commit is contained in:
gopi17701 2018-09-29 21:21:20 -04:00 committed by GitHub
parent c02f0192eb
commit 5cf4f930bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 173 additions and 145 deletions

View File

@ -6,14 +6,18 @@ import {SalesOrderComponent} from './sales-order/sales-order.component';
import {InvoiceComponent} from './invoice/invoice.component'; import {InvoiceComponent} from './invoice/invoice.component';
import {HomepageComponent} from './homepage/homepage.component'; import {HomepageComponent} from './homepage/homepage.component';
import {InvoiceGenComponent} from './invoice-gen/invoice-gen.component'; import {InvoiceGenComponent} from './invoice-gen/invoice-gen.component';
import {InvoicePaymentComponent} from './invoice-payment/invoice-payment.component';
import {LoginComponent} from './login/login.component';
const routes: Routes = [ const routes: Routes = [
{ path: '', redirectTo: 'homepage', pathMatch: 'full'}, { path: '', redirectTo: 'login', pathMatch: 'full'},
{ path: 'homepage', component: HomepageComponent }, { path: 'homepage', component: HomepageComponent },
{ path: 'customer', component: CustomerComponent }, { path: 'customer', component: CustomerComponent },
{ path: 'sales-order', component: SalesOrderComponent }, { path: 'sales-order', component: SalesOrderComponent },
{ path: 'invoice', component: InvoiceComponent }, { path: 'invoice', component: InvoiceComponent },
{ path: 'invoice-gen', component: InvoiceGenComponent } { path: 'invoice-gen', component: InvoiceGenComponent },
{ path: 'invoice-payment', component: InvoicePaymentComponent },
{ path: 'login', component: LoginComponent }
]; ];
@NgModule({ @NgModule({

View File

@ -16,6 +16,11 @@ import { HomepageComponent } from './homepage/homepage.component';
import { AppBoxComponent } from './app-box/app-box.component'; import { AppBoxComponent } from './app-box/app-box.component';
import { InvoiceGenComponent } from './invoice-gen/invoice-gen.component'; import { InvoiceGenComponent } from './invoice-gen/invoice-gen.component';
import { TextMaskModule } from 'angular2-text-mask'; import { TextMaskModule } from 'angular2-text-mask';
import { LoginComponent } from './login/login.component';
import { InvoicePaymentComponent } from './invoice-payment/invoice-payment.component';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { ReactiveFormsModule } from '@angular/forms';
@NgModule({ @NgModule({
declarations: [ declarations: [
@ -27,7 +32,9 @@ import { TextMaskModule } from 'angular2-text-mask';
InvoiceComponent, InvoiceComponent,
HomepageComponent, HomepageComponent,
AppBoxComponent, AppBoxComponent,
InvoiceGenComponent InvoiceGenComponent,
LoginComponent,
InvoicePaymentComponent
], ],
imports: [ imports: [
BrowserModule, BrowserModule,
@ -35,7 +42,10 @@ import { TextMaskModule } from 'angular2-text-mask';
NgbModule.forRoot(), NgbModule.forRoot(),
HttpClientModule, HttpClientModule,
AppRoutingModule, AppRoutingModule,
TextMaskModule TextMaskModule,
CommonModule,
FormsModule,
ReactiveFormsModule
], ],
providers: [AstuteClientService], providers: [AstuteClientService],
bootstrap: [AppComponent] bootstrap: [AppComponent]

View File

@ -8,16 +8,6 @@
Welcome to the Astute Internal System, {{currentUser}}! Welcome to the Astute Internal System, {{currentUser}}!
</h1> </h1>
</div> </div>
<div class="col-lg-4">
<div class="input-group mb-3 float-right">
<input type="text" class="form-control" placeholder="Search...">
<div class="input-group-prepend">
<button class="btn btn-sm btn-info btn-round">
<i class="material-icons">search</i>
</button>
</div>
</div>
</div>
</div> </div>
<!--applications--> <!--applications-->

View File

@ -73,7 +73,7 @@
<span class="input-group-text">Payment Date*</span> <span class="input-group-text">Payment Date*</span>
</td> </td>
<td colspan="7"> <td colspan="7">
<input type="text" class="form-control" #inDateReceived> <input type="date" class="form-control" #inDateReceived>
</td> </td>
</tr> </tr>
@ -120,7 +120,7 @@
<span class="input-group-text">Date Received*</span> <span class="input-group-text">Date Received*</span>
</td> </td>
<td colspan="7"> <td colspan="7">
<input type="text" class="form-control" #inDateReceived [value]="selected.paymentDate"> <input type="date" class="form-control" #inDateReceived [value]="selected.paymentDate">
</td> </td>
</tr> </tr>
</tbody> </tbody>

View File

@ -1,6 +1,11 @@
<div class="page" style="width: 35%; margin: 20px auto auto;"> <div class="page" style="width: 35%; margin: 20px auto auto;">
<form class="form-signin" (ngSubmit)="login(f)" #f="ngForm" style="margin-bottom: 10px"> <form class="form-signin" (ngSubmit)="login(f)" #f="ngForm" style="margin-bottom: 10px">
<h2 class="form-signin-heading">Login</h2> <div class="row">
<div class="col-12">
<img src="assets/img/AstuteLogo.gif" height="100" width="230">
<h1 class="form-signin-heading text-right">Login</h1>
</div>
</div>
<label for="username" class="sr-only">Username</label> <label for="username" class="sr-only">Username</label>
<input class="form-control" type="text" id="username" name="username" ngModel placeholder="Username"> <input class="form-control" type="text" id="username" name="username" ngModel placeholder="Username">

View File

@ -25,7 +25,7 @@ export class LoginComponent implements OnInit {
this.astuteClientService.login(username, password).then((data) => { this.astuteClientService.login(username, password).then((data) => {
if (data) { if (data) {
this.router.navigate(['/home']); this.router.navigate(['/homepage']);
} else { } else {
alert('login failed, checked credentials'); alert('login failed, checked credentials');
} }

View File

@ -59,7 +59,7 @@
<td style="width: 20%"><span class="input-group-text">Contract Number</span></td> <td style="width: 20%"><span class="input-group-text">Contract Number</span></td>
<td style="width: 30%"><input type="text" class="form-control" placeholder="External Contract Number" #contractnum></td> <td style="width: 30%"><input type="text" class="form-control" placeholder="External Contract Number" #contractnum></td>
<td style="width: 20%"><span class="input-group-text">Contract Amount</span></td> <td style="width: 20%"><span class="input-group-text">Contract Amount</span></td>
<td style="width: 30%"><input type="number" class="form-control" placeholder="Derived From Details" [value]="newContractAmount" #contractamt disabled></td> <td style="width: 30%"><input type="text" class="form-control" placeholder="Derived From Details" [value]="newContractAmount | currency" #contractamt disabled></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View File

@ -15,7 +15,8 @@ export class AstuteClientService {
private invoiceDetailUrl = 'http://localhost:8080/astutesystem/invoice/detail'; private invoiceDetailUrl = 'http://localhost:8080/astutesystem/invoice/detail';
private invoiceGenUrl = 'http://localhost:8080/astutesystem/invoice/generatedInvoice'; private invoiceGenUrl = 'http://localhost:8080/astutesystem/invoice/generatedInvoice';
private invoicePaymentUrl = 'http://localhost:8080/astutesystem/invoicePayment'; private invoicePaymentUrl = 'http://localhost:8080/astutesystem/invoicePayment';
private sessionId; private sessionId=localStorage.getItem('');
private sessionString = `?sessionId=${this.sessionId}`;
constructor(private http: HttpClient) { } constructor(private http: HttpClient) { }
@ -28,13 +29,15 @@ export class AstuteClientService {
}; };
return this.http return this.http
.post(this.authUrl, data, this.headers) .post(this.authUrl, data)
.toPromise() .toPromise()
.then(response => { .then(response => {
console.log(response['entity']); console.log(response['entity']);
const sessionId = response['entity']; const name = response['entity'].name;
const sessionId = response['entity'].sessionId;
if (sessionId != null) { if (sessionId != null) {
localStorage.setItem('SESSION_ID', sessionId); localStorage.setItem('SESSION_ID', sessionId);
localStorage.setItem('SESSION_USER', name);
return sessionId; return sessionId;
} else { } else {
return null; return null;
@ -42,22 +45,37 @@ export class AstuteClientService {
}); });
} }
private getSessionId(): string { public logout() {
console.log(localStorage.getItem('SESSION_ID')); localStorage.removeItem('SESSION_ID');
return localStorage.getItem('SESSION_ID'); localStorage.removeItem('SESSION_USER');
} console.log(localStorage.getItem('SESSION_ID'));
}
public getSessionId(): string {
console.log(localStorage.getItem('SESSION_ID'));
return localStorage.getItem('SESSION_ID');
}
public getSessionUser(): string {
console.log(localStorage.getItem('SESSION_USER'));
return localStorage.getItem('SESSION_USER');
}
// **************************************** Customer Service methods // **************************************** Customer Service methods
public getCustomers(): Promise<any> { public getCustomers(): Promise<any> {
console.log("*** In getCustomers()"); console.log("*** In getCustomers()");
const url = `${this.customerUrl}`; const url = `${this.customerUrl}${this.sessionString}`;
return this.http.get(url) return this.http.get(url)
.toPromise() .toPromise()
.then(response => { .then(response => {
console.log(response['entity']); console.log(response['entity']);
return response['entity']; return response['entity'];
}); })
.catch( error => {
alert(error);
});
} }
public updateCustomer(customerId: number, data: any): Promise<any> { public updateCustomer(customerId: number, data: any): Promise<any> {
@ -137,6 +155,7 @@ export class AstuteClientService {
// Date deliverBy; // Date deliverBy;
public updatePODetail(ponum, lineItemNo, data) { public updatePODetail(ponum, lineItemNo, data) {
console.log("*** In updatePODetail()"); console.log("*** In updatePODetail()");
const sessionId = localStorage.getItem('sessionId');
const url = `${this.POUrl}/detail/${ponum}/${lineItemNo}`; //TODO send sessionId const url = `${this.POUrl}/detail/${ponum}/${lineItemNo}`; //TODO send sessionId
return this.http.put(url, data) return this.http.put(url, data)
.toPromise() .toPromise()