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;
} else {
const clr = this.padStart(Math.floor((Math.random() * 16777215)).toString(16), 6, '0');
console.log (clr);
return '#' + clr;
}
}

View File

@ -11,6 +11,7 @@ import {LoginComponent} from './login/login.component';
const routes: Routes = [
{ path: '', redirectTo: 'login', pathMatch: 'full'},
{ path: 'home', redirectTo: 'homepage', pathMatch: 'full'},
{ path: 'homepage', component: HomepageComponent },
{ path: 'customer', component: CustomerComponent },
{ path: 'sales-order', component: SalesOrderComponent },

View File

@ -125,7 +125,7 @@
<tr>
<td style="width: 1%">
<span class="input-group-text">Fax</span>
<span class="input-group-text">Fax*</span>
</td>
<td colspan="7">
<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">
<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)">
+
</button>

View File

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

View File

@ -19,7 +19,7 @@ export class InvoicePaymentComponent implements OnInit {
columnDefs = [
{headerName: 'Invoice Payment Id', field: 'invoicePaymentId'},
{headerName: 'Invoice Number', field: 'invoiceNum'},
{headerName: 'payment Received', field: 'invoiceAmount'},
{headerName: 'Payment Received', field: 'invoiceAmount'},
{headerName: 'Date Received', field: 'paymentDate'},
{headerName: 'Payment Type', field: 'paymentType'}
@ -108,9 +108,13 @@ export class InvoicePaymentComponent implements OnInit {
this.paymentTypes = data;
});
this.rowData = this.astuteClientService.getInvoicePayments();
this.astuteClientService.getInvoicePayments().then ((data) => {
if (data) {
this.rowData = data;
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.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>
<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"-->
<!--(change)="onSelectedCellChange(i, 'desc', desc.value)" #desc>-->
</td>
@ -194,7 +194,7 @@
</td>
<td class="p-0 m-0"><input type="number" class="form-control cell" [value]="inDet.qty"
[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>
</tr>
<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,
selectedPODetails[poDetSelec.value].feeTypeId, selectedPODetails[poDetSelec.value].serviceTypeId,
selectedPODetails[poDetSelec.value].serviceDesc, 1, 0, selectedPODetails[poDetSelec.value].remainingQty)"
[disabled]="!selectedPODetails.length"
[disabled]="!selectedPODetails.length && chosenInv.invoiceStatus !== 1"
#poDetSelec>
<option>Choose PO Detail...</option>
<option *ngFor="let po of selectedPODetails; let i = index;" [value]="i">{{po.serviceDesc}}
@ -369,6 +369,7 @@
<!--MODAL: new invoice-->
<app-modal-form [title]="'New Invoice'" #new>
<!--<form>-->
<!--General-->
<div class="modal-body">
<p class="h4 text-right">General</p>
@ -466,10 +467,8 @@
<tbody *ngFor="let inDet of newInDetails; let i = index">
<tr class="p-0 m-0">
<!--INV Detail Items: invoiceNum, lineItemNum, poLineItemNum, serviceTypeId, desc, qty, fee-->
<td>
<button class="btn btn-outline-danger m-0 p-0" (click)="newInDetails.splice(0, 1)">
-
</button>
<td class="p-0 m-0">
<button class="btn btn-outline-danger w-100" (click)="newInDetails.splice(0, 1)">-</button>
</td>
<td class="p-0 m-0"><input type="text" class="form-control cell" [value]="inDet.lineItemNum" disabled>
</td>
@ -508,7 +507,7 @@
</tbody>
<tbody>
<tr>
<td colspan="5">
<td colspan="6">
<select class="custom-select"
(change)="pushOntoNewDetail(inNumIn.value, newInDetails.length + 1, poDetails[poDetSelec.value].lineItemNo,
poDetails[poDetSelec.value].feeTypeId, poDetails[poDetSelec.value].serviceTypeId,
@ -610,6 +609,7 @@
[disabled]="!(inNumIn.value && poNumIn.value && pmtStatusIn.value && newBillAmt && notesIn.value && certIn.value)">
Confirm
</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>
<!--</form>-->
</app-modal-form>

View File

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

View File

@ -86,8 +86,8 @@
<th scope="col">Description</th>
<th scope="col">Rate Type</th>
<th scope="col">Service Type</th>
<th scope="col" style="width: 75px">Qty</th>
<th scope="col" style="width: 100px">Rate</th>
<th scope="col" style="width: 75px">Qty(#)</th>
<th scope="col" style="width: 100px">Rate($)</th>
</tr>
</thead>
@ -282,8 +282,8 @@
<th scope="col">Description</th>
<th scope="col">Rate Type</th>
<th scope="col">Service Type</th>
<th scope="col" style="width: 75px">Qty</th>
<th scope="col" style="width: 100px">Rate</th>
<th scope="col" style="width: 75px">Qty(#)</th>
<th scope="col" style="width: 100px">Rate($)</th>
<!--<th scope="col">Remaining Quantity</th>-->
</tr>
</thead>
@ -358,7 +358,7 @@
<div class="modal-footer">
<button class="btn btn-success" type="button"
[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
</button>

View File

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