Fixed Some Defects, has been tracked in Defects file

This commit is contained in:
Akash Shah 2018-12-31 22:27:41 -05:00
parent 669b5a3c6d
commit 3e92f719f6
10 changed files with 333 additions and 323 deletions

View File

@ -22,6 +22,7 @@ export class AppBoxComponent implements OnInit {
return this.color; return this.color;
} else { } else {
const clr = this.padStart(Math.floor((Math.random() * 16777215)).toString(16), 6, '0'); const clr = this.padStart(Math.floor((Math.random() * 16777215)).toString(16), 6, '0');
console.log (clr);
return '#' + clr; return '#' + clr;
} }
} }

View File

@ -11,6 +11,7 @@ import {LoginComponent} from './login/login.component';
const routes: Routes = [ const routes: Routes = [
{ path: '', redirectTo: 'login', pathMatch: 'full'}, { path: '', redirectTo: 'login', pathMatch: 'full'},
{ path: 'home', redirectTo: 'homepage', 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 },

View File

@ -125,7 +125,7 @@
<tr> <tr>
<td style="width: 1%"> <td style="width: 1%">
<span class="input-group-text">Fax</span> <span class="input-group-text">Fax*</span>
</td> </td>
<td colspan="7"> <td colspan="7">
<input type="tel" class="form-control" placeholder="(123) 456-7890" [value]="''" [textMask]="{mask: usPhoneMask, guide: false}" #inFax> <input type="tel" class="form-control" placeholder="(123) 456-7890" [value]="''" [textMask]="{mask: usPhoneMask, guide: false}" #inFax>
@ -137,7 +137,7 @@
<div class="modal-footer"> <div class="modal-footer">
<button class="btn btn-success" type="button" <button class="btn btn-success" type="button"
[disabled]="!(inId.value && inName.value && inBillToDept.value && inAdd1.value && inCity.value && inState.value && inZIP.value && inEmail.value && inPhone.value)" [disabled]="!(inId.value && inName.value && inBillToDept.value && inAdd1.value && inCity.value && inState.value && inZIP.value && inEmail.value && inPhone.value && inFax.value)"
(click)="addCustomer(inId.value, inName.value, inBillToDept.value, inAdd1.value, inAdd2.value, inCity.value, inState.value, inZIP.value, inZIP4.value, inEmail.value, inPhone.value, inFax.value, new)"> (click)="addCustomer(inId.value, inName.value, inBillToDept.value, inAdd1.value, inAdd2.value, inCity.value, inState.value, inZIP.value, inZIP4.value, inEmail.value, inPhone.value, inFax.value, new)">
+ +
</button> </button>

View File

@ -9,7 +9,7 @@
class="ag-theme-balham" class="ag-theme-balham"
[enableSorting]="true" [enableSorting]="true"
[enableFilter]="true" [enableFilter]="true"
[rowData]="rowData | async" [rowData]="rowData"
[columnDefs]="columnDefs" [columnDefs]="columnDefs"
rowSelection="single" rowSelection="single"
></ag-grid-angular> ></ag-grid-angular>
@ -27,6 +27,7 @@
<!--MODAL: new Invoice Payment--> <!--MODAL: new Invoice Payment-->
<app-modal-form [title]="'New Invoice Payment'" #new> <app-modal-form [title]="'New Invoice Payment'" #new>
<form>
<div class="modal-body"> <div class="modal-body">
<table class="table table-borderless table-sm"> <table class="table table-borderless table-sm">
<tbody> <tbody>
@ -87,8 +88,10 @@
(click)="addInvoicePayment(chosenInv, null, chosenPaymentType, null, inDateReceived.value, inPaymentReceived.value, new)"> (click)="addInvoicePayment(chosenInv, null, chosenPaymentType, null, inDateReceived.value, inPaymentReceived.value, new)">
+ +
</button> </button>
<button type="button" class="btn btn-danger" (click)="close(new)">Cancel</button> <!--<input type="reset" (click)="close(new)">Cancel-->
<button type="reset" class="btn btn-danger" (click)="close(new)">Cancel</button>
</div> </div>
</form>
</app-modal-form> </app-modal-form>
<!--MODAL: edit invoice payment--> <!--MODAL: edit invoice payment-->
@ -126,7 +129,6 @@
</tbody> </tbody>
</table> </table>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button class="btn btn-warning" type="button" <button class="btn btn-warning" type="button"
[disabled]="!(invoiceSelect.value && inPaymentReceived.value && inDateReceived.value)" [disabled]="!(invoiceSelect.value && inPaymentReceived.value && inDateReceived.value)"
@ -138,7 +140,7 @@
</div> </div>
<div *ngIf="!selected"> <div *ngIf="!selected">
<div class="modal-body"> <div class="modal-body">
Choose an Invoice First! Choose an Invoice Payment First!
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button class="btn btn-warning" type="button" <button class="btn btn-warning" type="button"

View File

@ -19,7 +19,7 @@ export class InvoicePaymentComponent implements OnInit {
columnDefs = [ columnDefs = [
{headerName: 'Invoice Payment Id', field: 'invoicePaymentId'}, {headerName: 'Invoice Payment Id', field: 'invoicePaymentId'},
{headerName: 'Invoice Number', field: 'invoiceNum'}, {headerName: 'Invoice Number', field: 'invoiceNum'},
{headerName: 'payment Received', field: 'invoiceAmount'}, {headerName: 'Payment Received', field: 'invoiceAmount'},
{headerName: 'Date Received', field: 'paymentDate'}, {headerName: 'Date Received', field: 'paymentDate'},
{headerName: 'Payment Type', field: 'paymentType'} {headerName: 'Payment Type', field: 'paymentType'}
@ -108,9 +108,13 @@ export class InvoicePaymentComponent implements OnInit {
this.paymentTypes = data; this.paymentTypes = data;
}); });
this.rowData = this.astuteClientService.getInvoicePayments(); this.astuteClientService.getInvoicePayments().then ((data) => {
if (data) {
this.rowData = data;
this.rowData.forEach((row) => { this.rowData.forEach((row) => {
row.invoiceAmount = formatCurrency(row.invoiceAmount, 'en-US', '$', "USD"); row.invoiceAmount = formatCurrency(row.invoiceAmount, 'en-US', '$', 'USD');
});
}
}); });
this.astuteClientService.getInvoicePayments().then((data) => { this.astuteClientService.getInvoicePayments().then((data) => {
this.invoicePaymentData = data; this.invoicePaymentData = data;

View File

@ -183,7 +183,7 @@
<td class="p-0 m-0"><input type="text" class="form-control cell" [value]="inDet.lineItemNum" disabled> <td class="p-0 m-0"><input type="text" class="form-control cell" [value]="inDet.lineItemNum" disabled>
</td> </td>
<td class="p-0 m-0"><textarea style="height: 36px" class="form-control text cell" [value]="inDet.desc" <td class="p-0 m-0"><textarea style="height: 36px" class="form-control text cell" [value]="inDet.desc"
(change)="onSelectedCellChange(i, 'desc', desc.value)" #desc></textarea> (change)="onSelectedCellChange(i, 'desc', desc.value)" #desc [disabled]="chosenInv.invoiceStatus !== 1"></textarea>
<!--<input type="text" class="form-control cell" [value]="inDet.desc"--> <!--<input type="text" class="form-control cell" [value]="inDet.desc"-->
<!--(change)="onSelectedCellChange(i, 'desc', desc.value)" #desc>--> <!--(change)="onSelectedCellChange(i, 'desc', desc.value)" #desc>-->
</td> </td>
@ -194,7 +194,7 @@
</td> </td>
<td class="p-0 m-0"><input type="number" class="form-control cell" [value]="inDet.qty" <td class="p-0 m-0"><input type="number" class="form-control cell" [value]="inDet.qty"
[step]="inDet.remainingQty / 100" [step]="inDet.remainingQty / 100"
(change)="onSelectedCellChange(i, 'qty', qty.value); updateSelectedBillAmt()" #qty> (change)="onSelectedCellChange(i, 'qty', qty.value); updateSelectedBillAmt()" #qty [disabled]="chosenInv.invoiceStatus !== 1">
</td> </td>
</tr> </tr>
<tr class="p-0 m-0" *ngIf="inDet.poLineItemNum != -1"> <tr class="p-0 m-0" *ngIf="inDet.poLineItemNum != -1">
@ -254,7 +254,7 @@
(change)="pushOntoSelectedDetail(inNumIn.value, newInDetails.length + 1, selectedPODetails[poDetSelec.value].lineItemNo, (change)="pushOntoSelectedDetail(inNumIn.value, newInDetails.length + 1, selectedPODetails[poDetSelec.value].lineItemNo,
selectedPODetails[poDetSelec.value].feeTypeId, selectedPODetails[poDetSelec.value].serviceTypeId, selectedPODetails[poDetSelec.value].feeTypeId, selectedPODetails[poDetSelec.value].serviceTypeId,
selectedPODetails[poDetSelec.value].serviceDesc, 1, 0, selectedPODetails[poDetSelec.value].remainingQty)" selectedPODetails[poDetSelec.value].serviceDesc, 1, 0, selectedPODetails[poDetSelec.value].remainingQty)"
[disabled]="!selectedPODetails.length" [disabled]="!selectedPODetails.length && chosenInv.invoiceStatus !== 1"
#poDetSelec> #poDetSelec>
<option>Choose PO Detail...</option> <option>Choose PO Detail...</option>
<option *ngFor="let po of selectedPODetails; let i = index;" [value]="i">{{po.serviceDesc}} <option *ngFor="let po of selectedPODetails; let i = index;" [value]="i">{{po.serviceDesc}}
@ -369,6 +369,7 @@
<!--MODAL: new invoice--> <!--MODAL: new invoice-->
<app-modal-form [title]="'New Invoice'" #new> <app-modal-form [title]="'New Invoice'" #new>
<!--<form>-->
<!--General--> <!--General-->
<div class="modal-body"> <div class="modal-body">
<p class="h4 text-right">General</p> <p class="h4 text-right">General</p>
@ -466,10 +467,8 @@
<tbody *ngFor="let inDet of newInDetails; let i = index"> <tbody *ngFor="let inDet of newInDetails; let i = index">
<tr class="p-0 m-0"> <tr class="p-0 m-0">
<!--INV Detail Items: invoiceNum, lineItemNum, poLineItemNum, serviceTypeId, desc, qty, fee--> <!--INV Detail Items: invoiceNum, lineItemNum, poLineItemNum, serviceTypeId, desc, qty, fee-->
<td> <td class="p-0 m-0">
<button class="btn btn-outline-danger m-0 p-0" (click)="newInDetails.splice(0, 1)"> <button class="btn btn-outline-danger w-100" (click)="newInDetails.splice(0, 1)">-</button>
-
</button>
</td> </td>
<td class="p-0 m-0"><input type="text" class="form-control cell" [value]="inDet.lineItemNum" disabled> <td class="p-0 m-0"><input type="text" class="form-control cell" [value]="inDet.lineItemNum" disabled>
</td> </td>
@ -508,7 +507,7 @@
</tbody> </tbody>
<tbody> <tbody>
<tr> <tr>
<td colspan="5"> <td colspan="6">
<select class="custom-select" <select class="custom-select"
(change)="pushOntoNewDetail(inNumIn.value, newInDetails.length + 1, poDetails[poDetSelec.value].lineItemNo, (change)="pushOntoNewDetail(inNumIn.value, newInDetails.length + 1, poDetails[poDetSelec.value].lineItemNo,
poDetails[poDetSelec.value].feeTypeId, poDetails[poDetSelec.value].serviceTypeId, poDetails[poDetSelec.value].feeTypeId, poDetails[poDetSelec.value].serviceTypeId,
@ -610,6 +609,7 @@
[disabled]="!(inNumIn.value && poNumIn.value && pmtStatusIn.value && newBillAmt && notesIn.value && certIn.value)"> [disabled]="!(inNumIn.value && poNumIn.value && pmtStatusIn.value && newBillAmt && notesIn.value && certIn.value)">
Confirm Confirm
</button> </button>
<button type="button" class="btn btn-danger" (click)="close(new)">Cancel</button> <button type="reset" class="btn btn-danger" (click)="close(new)">Cancel</button>
</div> </div>
<!--</form>-->
</app-modal-form> </app-modal-form>

View File

@ -49,7 +49,7 @@ export class InvoiceComponent implements OnInit {
// EVENTS - add event callback handlers // EVENTS - add event callback handlers
onRowClicked: (event) => { onRowClicked: (event) => {
this.getSelectedRows() this.getSelectedRows();
}, },
onColumnResized: function (event) { onColumnResized: function (event) {
console.log('a column was resized'); console.log('a column was resized');
@ -221,7 +221,6 @@ export class InvoiceComponent implements OnInit {
this.selectedBillAmt = tot; this.selectedBillAmt = tot;
} }
assignActity(): void { assignActity(): void {
window.open('/invoice-gen'); window.open('/invoice-gen');
} }
@ -288,6 +287,7 @@ export class InvoiceComponent implements OnInit {
close(content) { close(content) {
content.close(); content.close();
// this.newInDetails = [];
} }
getCurrDate() { getCurrDate() {

View File

@ -86,8 +86,8 @@
<th scope="col">Description</th> <th scope="col">Description</th>
<th scope="col">Rate Type</th> <th scope="col">Rate Type</th>
<th scope="col">Service Type</th> <th scope="col">Service Type</th>
<th scope="col" style="width: 75px">Qty</th> <th scope="col" style="width: 75px">Qty(#)</th>
<th scope="col" style="width: 100px">Rate</th> <th scope="col" style="width: 100px">Rate($)</th>
</tr> </tr>
</thead> </thead>
@ -282,8 +282,8 @@
<th scope="col">Description</th> <th scope="col">Description</th>
<th scope="col">Rate Type</th> <th scope="col">Rate Type</th>
<th scope="col">Service Type</th> <th scope="col">Service Type</th>
<th scope="col" style="width: 75px">Qty</th> <th scope="col" style="width: 75px">Qty(#)</th>
<th scope="col" style="width: 100px">Rate</th> <th scope="col" style="width: 100px">Rate($)</th>
<!--<th scope="col">Remaining Quantity</th>--> <!--<th scope="col">Remaining Quantity</th>-->
</tr> </tr>
</thead> </thead>
@ -358,7 +358,7 @@
<div class="modal-footer"> <div class="modal-footer">
<button class="btn btn-success" type="button" <button class="btn btn-success" type="button"
[disabled]="!(ponum.value && podate.value && contractnum.value && contractamt.value)" [disabled]="!(ponum.value && podate.value && contractnum.value && contractamt.value)"
(click)="editPo(projNum.value, ponum.value, podate.value, contractnum.value.repalce(',', '').replace('$', ''), contractamt.value, title.value, edit)" (click)="editPo(projNum.value, ponum.value, podate.value, contractnum.value, contractamt.value.replace(',', '').replace('$', ''), title.value, edit)"
> >
Update Update
</button> </button>

View File

@ -41,7 +41,7 @@ export class SalesOrderComponent implements OnInit {
} else { } else {
alert ('get service types failed'); alert ('get service types failed');
} }
}) });
} }
printValue(val) { printValue(val) {
@ -119,7 +119,7 @@ export class SalesOrderComponent implements OnInit {
details.splice(0, 1); details.splice(0, 1);
this.editPODetail(details); this.editPODetail(details);
} else { } else {
alert("add detail failed") alert('add detail failed');
} }
}); });
} else { } else {
@ -214,13 +214,15 @@ export class SalesOrderComponent implements OnInit {
const selectedNodes = this.agGrid.api.getSelectedNodes(); const selectedNodes = this.agGrid.api.getSelectedNodes();
if (selectedNodes.length) { if (selectedNodes.length) {
this.selected = selectedNodes.map(node => node.data)[0]; this.selected = selectedNodes.map(node => node.data)[0];
this.editContractAmount = +this.selected.contractAmt; // this.editContractAmount = +this.selected.contractAmt;
console.log(this.selected.contractNum);
this.astuteClientService.getPODetail(this.selected.ponum).then((data) => { this.astuteClientService.getPODetail(this.selected.ponum).then((data) => {
if (data) { if (data) {
this.selectedPODetail = data; this.selectedPODetail = data;
console.log(this.selectedPODetail); // console.log(this.selectedPODetail);
this.updateEditContractAmt();
} else { } else {
alert("get PO detail failed!") alert('get PO detail failed!');
} }
}); });
} else { } else {
@ -244,14 +246,14 @@ export class SalesOrderComponent implements OnInit {
} }
}); });
} else { } else {
alert("get Customers Failed!"); alert('get Customers Failed!');
} }
}); });
// this.rowData = this.astuteClientService.getPOs(); // this.rowData = this.astuteClientService.getPOs();
} }
getCustomerName(customerId) { getCustomerName(customerId) {
let name = ""; let name = '';
this.customers.forEach((customer) => { this.customers.forEach((customer) => {
if (customer.customerId === customerId) { if (customer.customerId === customerId) {
name = customer.customerName; name = customer.customerName;