mirror of
https://github.com/dyiop/astute.git
synced 2025-04-06 21:30:20 -04:00
Started the refacotoring Process:
- Adding ORM - *made customer and contact representation so far* - make constructor to fill data and any linked tables - Set any corresponding types - any related objected are added as feilds of the parent object (customer ← customer contact) - use object to get related objects whenever possible - Ex. Callinc customer.getContacts() instead of the get contacts service. - Add astute service calls to ORM's - Made grid row data to use same objects as the typescripts retreived data - before I was using the promise itself for the rowData, and then keeping a seperate feild to store the actual data returned from the promise. Now, they are both using the data returned from the promise instead. - have to take off the `|async` part from the grid options - AG - Grid clean up - Added whaterver column defiintions were missing - added default grid options
This commit is contained in:
parent
31a5f27a19
commit
33e86732f9
3871
AstuteClient2/package-lock.json
generated
3871
AstuteClient2/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
|
@ -11,45 +11,45 @@
|
||||||
},
|
},
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/animations": "^8.1.1",
|
"@angular/animations": "^8.2.14",
|
||||||
"@angular/common": "^8.1.1",
|
"@angular/common": "^8.2.14",
|
||||||
"@angular/compiler": "^8.1.1",
|
"@angular/compiler": "^8.2.14",
|
||||||
"@angular/core": "^8.1.1",
|
"@angular/core": "^8.2.14",
|
||||||
"@angular/forms": "^8.1.1",
|
"@angular/forms": "^8.2.14",
|
||||||
"@angular/http": "^7.2.15",
|
"@angular/http": "^7.2.16",
|
||||||
"@angular/platform-browser": "^8.1.1",
|
"@angular/platform-browser": "^8.2.14",
|
||||||
"@angular/platform-browser-dynamic": "^8.1.1",
|
"@angular/platform-browser-dynamic": "^8.2.14",
|
||||||
"@angular/router": "^8.1.1",
|
"@angular/router": "^8.2.14",
|
||||||
"@ng-bootstrap/ng-bootstrap": "^5.0.0",
|
"@ng-bootstrap/ng-bootstrap": "^5.3.1",
|
||||||
"ag-grid-angular": "^21.0.1",
|
"ag-grid-angular": "^21.2.2",
|
||||||
"ag-grid-community": "^21.0.1",
|
"ag-grid-community": "^21.2.2",
|
||||||
"angular2-text-mask": "^9.0.0",
|
"angular2-text-mask": "^9.0.0",
|
||||||
"bootstrap": "^4.3.1",
|
"bootstrap": "^4.5.2",
|
||||||
"core-js": "^3.1.4",
|
"core-js": "^3.6.5",
|
||||||
"jquery": "^3.4.1",
|
"jquery": "^3.5.1",
|
||||||
"popper.js": "^1.15.0",
|
"popper.js": "^1.16.1",
|
||||||
"rxjs": "^6.5.2",
|
"rxjs": "^6.6.3",
|
||||||
"zone.js": "^0.9.1"
|
"zone.js": "^0.9.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@angular-devkit/build-angular": "~0.801.1",
|
"@angular-devkit/build-angular": "^0.801.3",
|
||||||
"@angular/cli": "^8.1.1",
|
"@angular/cli": "^8.3.29",
|
||||||
"@angular/compiler-cli": "^8.1.1",
|
"@angular/compiler-cli": "^8.2.14",
|
||||||
"@angular/language-service": "^8.1.1",
|
"@angular/language-service": "^8.2.14",
|
||||||
"@types/jasmine": "^3.3.13",
|
"@types/jasmine": "^3.5.14",
|
||||||
"@types/jasminewd2": "^2.0.6",
|
"@types/jasminewd2": "^2.0.8",
|
||||||
"@types/node": "~12.6.2",
|
"@types/node": "^12.12.63",
|
||||||
"codelyzer": "~5.1.0",
|
"codelyzer": "^5.2.2",
|
||||||
"jasmine-core": "~3.4.0",
|
"jasmine-core": "~3.4.0",
|
||||||
"jasmine-spec-reporter": "~4.2.1",
|
"jasmine-spec-reporter": "~4.2.1",
|
||||||
"karma": "~4.1.0",
|
"karma": "~4.1.0",
|
||||||
"karma-chrome-launcher": "~2.2.0",
|
"karma-chrome-launcher": "~2.2.0",
|
||||||
"karma-coverage-istanbul-reporter": "~2.0.5",
|
"karma-coverage-istanbul-reporter": "^2.1.1",
|
||||||
"karma-jasmine": "~2.0.1",
|
"karma-jasmine": "~2.0.1",
|
||||||
"karma-jasmine-html-reporter": "^1.4.2",
|
"karma-jasmine-html-reporter": "^1.5.4",
|
||||||
"protractor": "~5.4.2",
|
"protractor": "^5.4.4",
|
||||||
"ts-node": "~8.3.0",
|
"ts-node": "~8.3.0",
|
||||||
"tslint": "~5.18.0",
|
"tslint": "~5.18.0",
|
||||||
"typescript": "^3.4.5"
|
"typescript": "^3.5.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
60
AstuteClient2/src/app/common/GlobalConstants.ts
Normal file
60
AstuteClient2/src/app/common/GlobalConstants.ts
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
export class GlobalConstants {
|
||||||
|
static US_PHONE_MASK: (string | RegExp)[] = ['(', /[1-9]/, /\d/, /\d/, ')', ' ', /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/];
|
||||||
|
static STATES: string[] = [
|
||||||
|
'AL',
|
||||||
|
'AK',
|
||||||
|
'AR',
|
||||||
|
'AZ',
|
||||||
|
'CA',
|
||||||
|
'CO',
|
||||||
|
'CT',
|
||||||
|
'DC',
|
||||||
|
'DE',
|
||||||
|
'FL',
|
||||||
|
'GA',
|
||||||
|
'HI',
|
||||||
|
'IA',
|
||||||
|
'ID',
|
||||||
|
'IL',
|
||||||
|
'IN',
|
||||||
|
'KS',
|
||||||
|
'KY',
|
||||||
|
'LA',
|
||||||
|
'MA',
|
||||||
|
'MD',
|
||||||
|
'ME',
|
||||||
|
'MI',
|
||||||
|
'MN',
|
||||||
|
'MO',
|
||||||
|
'MS',
|
||||||
|
'MT',
|
||||||
|
'NC',
|
||||||
|
'NE',
|
||||||
|
'NH',
|
||||||
|
'NJ',
|
||||||
|
'NM',
|
||||||
|
'NV',
|
||||||
|
'NY',
|
||||||
|
'ND',
|
||||||
|
'OH',
|
||||||
|
'OK',
|
||||||
|
'OR',
|
||||||
|
'PA',
|
||||||
|
'RI',
|
||||||
|
'SC',
|
||||||
|
'SD',
|
||||||
|
'TN',
|
||||||
|
'TX',
|
||||||
|
'UT',
|
||||||
|
'VT',
|
||||||
|
'VA',
|
||||||
|
'WA',
|
||||||
|
'WI',
|
||||||
|
'WV',
|
||||||
|
'WY'
|
||||||
|
];
|
||||||
|
static CUSTOMER_ID_MASK: RegExp[] = [/[^']/, /[^']/, /[^']/, /[^']/, /[^']/, /[^']/, /[^']/, /[^']/, /[^']/, /[^']/];
|
||||||
|
static EMAIL_MASK: RegExp = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
|
||||||
|
static STRING_DEFAULT = '';
|
||||||
|
static NUMBER_DEFAULT = 0;
|
||||||
|
}
|
|
@ -8,10 +8,8 @@
|
||||||
<ag-grid-angular
|
<ag-grid-angular
|
||||||
style="height: 500px;"
|
style="height: 500px;"
|
||||||
class="ag-theme-balham"
|
class="ag-theme-balham"
|
||||||
[enableColResize]="true"
|
[gridOptions]="gridOptions"
|
||||||
[enableSorting]="true"
|
[rowData]="customers"
|
||||||
[enableFilter]="true"
|
|
||||||
[rowData]="rowData | async"
|
|
||||||
[columnDefs]="columnDefs"
|
[columnDefs]="columnDefs"
|
||||||
[frameworkComponents]="frameworkComponents"
|
[frameworkComponents]="frameworkComponents"
|
||||||
(cellEditingStopped)="updateRow($event)"
|
(cellEditingStopped)="updateRow($event)"
|
||||||
|
@ -45,7 +43,7 @@
|
||||||
<span class="input-group-text">ID*</span>
|
<span class="input-group-text">ID*</span>
|
||||||
</td>
|
</td>
|
||||||
<td colspan="7">
|
<td colspan="7">
|
||||||
<input type="text" class="form-control" [textMask]="{mask: idMask, guide: false}" placeholder="johndoe" #inId>
|
<input type="text" class="form-control" [textMask]="{mask: customerIdMask, guide: false}" placeholder="johndoe" #inId>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
@ -304,10 +302,8 @@
|
||||||
<ag-grid-angular
|
<ag-grid-angular
|
||||||
style="height: 500px;"
|
style="height: 500px;"
|
||||||
class="ag-theme-balham"
|
class="ag-theme-balham"
|
||||||
[enableColResize]="true"
|
[gridOptions]="gridOptions"
|
||||||
[enableSorting]="true"
|
[rowData]="contactsData"
|
||||||
[enableFilter]="true"
|
|
||||||
[rowData]="contactsData | async"
|
|
||||||
[columnDefs]="contactsColDef"
|
[columnDefs]="contactsColDef"
|
||||||
[frameworkComponents]="frameworkComponents"
|
[frameworkComponents]="frameworkComponents"
|
||||||
(cellEditingStopped)="updateContactRow($event)"
|
(cellEditingStopped)="updateContactRow($event)"
|
||||||
|
|
|
@ -4,7 +4,10 @@ import {ToastManagerService} from '../services/toast-manager/toast-service.servi
|
||||||
import {PhoneFormatterComponent} from '../ag-grid-components/phone-formatter/phone-formatter.component';
|
import {PhoneFormatterComponent} from '../ag-grid-components/phone-formatter/phone-formatter.component';
|
||||||
import {PhoneEditorComponent} from '../ag-grid-components/phone-editor/phone-editor.component';
|
import {PhoneEditorComponent} from '../ag-grid-components/phone-editor/phone-editor.component';
|
||||||
import {EmptyErrorEditorComponent} from '../ag-grid-components/empty-error-editor/empty-error-editor.component';
|
import {EmptyErrorEditorComponent} from '../ag-grid-components/empty-error-editor/empty-error-editor.component';
|
||||||
import {NumericEditorComponent} from "../ag-grid-components/numeric-editor/numeric-editor.component";
|
import {NumericEditorComponent} from '../ag-grid-components/numeric-editor/numeric-editor.component';
|
||||||
|
import {Customer} from '../models/Customer.model';
|
||||||
|
import {CustomerContact} from '../models/CustomerContact.model';
|
||||||
|
import {GlobalConstants} from '../common/GlobalConstants';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-customer',
|
selector: 'app-customer',
|
||||||
|
@ -18,98 +21,58 @@ export class CustomerComponent implements OnInit {
|
||||||
gridColumnApi;
|
gridColumnApi;
|
||||||
contactGridApi;
|
contactGridApi;
|
||||||
contactColumnApi;
|
contactColumnApi;
|
||||||
selected = null;
|
|
||||||
customers;
|
selected: Customer;
|
||||||
|
|
||||||
|
customers: Customer[];
|
||||||
columnDefs = [
|
columnDefs = [
|
||||||
{headerName: 'ID', field: 'customerId'},
|
{headerName: 'ID', field: 'customerId', editable: false},
|
||||||
{headerName: 'Name ✎', field: 'customerName', editable: true, cellEditor: 'emptyErrorEditorComponent'},
|
{headerName: 'Name ✎', field: 'customerName', cellEditor: 'emptyErrorEditorComponent'},
|
||||||
{headerName: 'Bill To ✎', field: 'billToDept', editable: true, cellEditor: 'emptyErrorEditorComponent'},
|
{headerName: 'Bill To ✎', field: 'billToDept', cellEditor: 'emptyErrorEditorComponent'},
|
||||||
{headerName: 'Email ✎', field: 'email', editable: true, cellEditor: 'emptyErrorEditorComponent'},
|
{headerName: 'Email ✎', field: 'email', cellEditor: 'emptyErrorEditorComponent'},
|
||||||
{headerName: 'Fax ✎', field: 'fax', editable: true, cellEditor: 'phoneEditorComponent'},
|
{headerName: 'Fax ✎', field: 'fax', cellEditor: 'phoneEditorComponent'},
|
||||||
{headerName: 'Phone ✎', field: 'phone', editable: true, cellEditor: 'phoneEditorComponent'},
|
{headerName: 'Phone ✎', field: 'phone', cellEditor: 'phoneEditorComponent'},
|
||||||
{headerName: 'Ext. ✎', field: 'phExt', editable: true, cellEditor: 'numericEditorComponent'},
|
{headerName: 'Ext. ✎', field: 'phExt', cellEditor: 'numericEditorComponent'},
|
||||||
{headerName: 'Address 1 ✎', field: 'add1', editable: true, cellEditor: 'emptyErrorEditorComponent'},
|
{headerName: 'Address 1 ✎', field: 'add1', cellEditor: 'emptyErrorEditorComponent'},
|
||||||
{headerName: 'Address 2 ✎', field: 'add2', editable: true, cellEditor: 'emptyErrorEditorComponent'},
|
{headerName: 'Address 2 ✎', field: 'add2', cellEditor: 'emptyErrorEditorComponent'},
|
||||||
{headerName: 'City ✎', field: 'city', editable: true, cellEditor: 'emptyErrorEditorComponent'},
|
{headerName: 'City ✎', field: 'city', cellEditor: 'emptyErrorEditorComponent'},
|
||||||
{headerName: 'State ✎', field: 'state', editable: true, cellEditor: 'emptyErrorEditorComponent'},
|
{headerName: 'State ✎', field: 'state', cellEditor: 'emptyErrorEditorComponent'},
|
||||||
{headerName: 'ZIP ✎', field: 'zip', editable: true, cellEditor: 'numericEditorComponent'},
|
{headerName: 'ZIP ✎', field: 'zip', cellEditor: 'numericEditorComponent'},
|
||||||
{headerName: 'ZIP-4 ✎', field: 'ziplast4', editable: true, cellEditor: 'numericEditorComponent'}
|
{headerName: 'ZIP-4 ✎', field: 'ziplast4', cellEditor: 'numericEditorComponent'}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
|
contactsData: CustomerContact[];
|
||||||
|
contactsColDef = [
|
||||||
|
{headerName: 'Name ✎', field: 'name', cellEditor: 'emptyErrorEditorComponent'},
|
||||||
|
{headerName: 'Title ✎', field: 'title'},
|
||||||
|
{headerName: 'Email ✎', field: 'email'},
|
||||||
|
{headerName: 'Work ✎', field: 'workPhone', cellEditor: 'phoneEditorComponent'},
|
||||||
|
{headerName: 'Phone ✎', field: 'mobile', cellEditor: 'phoneEditorComponent'},
|
||||||
|
{headerName: 'Ext. ✎', field: 'phExt'},
|
||||||
|
{headerName: 'Fax ✎', field: 'fax', cellEditor: 'phoneEditorComponent'},
|
||||||
|
{headerName: 'Address ✎', field: 'address'}
|
||||||
|
];
|
||||||
|
|
||||||
|
gridOptions = {
|
||||||
|
defaultColDef: {
|
||||||
|
resizable: true,
|
||||||
|
filter: true,
|
||||||
|
sortable: true,
|
||||||
|
editable: true
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
customerIdMask = GlobalConstants.CUSTOMER_ID_MASK;
|
||||||
|
usPhoneMask = GlobalConstants.US_PHONE_MASK;
|
||||||
|
emailMask = GlobalConstants.EMAIL_MASK;
|
||||||
|
states = GlobalConstants.STATES;
|
||||||
frameworkComponents = {
|
frameworkComponents = {
|
||||||
phoneFormatterComponent: PhoneFormatterComponent,
|
phoneFormatterComponent: PhoneFormatterComponent,
|
||||||
phoneEditorComponent: PhoneEditorComponent,
|
phoneEditorComponent: PhoneEditorComponent,
|
||||||
emptyErrorEditorComponent: EmptyErrorEditorComponent,
|
emptyErrorEditorComponent: EmptyErrorEditorComponent,
|
||||||
numericEditorComponent: NumericEditorComponent
|
numericEditorComponent: NumericEditorComponent
|
||||||
};
|
};
|
||||||
rowData: any;
|
|
||||||
states = [
|
|
||||||
'AL',
|
|
||||||
'AK',
|
|
||||||
'AR',
|
|
||||||
'AZ',
|
|
||||||
'CA',
|
|
||||||
'CO',
|
|
||||||
'CT',
|
|
||||||
'DC',
|
|
||||||
'DE',
|
|
||||||
'FL',
|
|
||||||
'GA',
|
|
||||||
'HI',
|
|
||||||
'IA',
|
|
||||||
'ID',
|
|
||||||
'IL',
|
|
||||||
'IN',
|
|
||||||
'KS',
|
|
||||||
'KY',
|
|
||||||
'LA',
|
|
||||||
'MA',
|
|
||||||
'MD',
|
|
||||||
'ME',
|
|
||||||
'MI',
|
|
||||||
'MN',
|
|
||||||
'MO',
|
|
||||||
'MS',
|
|
||||||
'MT',
|
|
||||||
'NC',
|
|
||||||
'NE',
|
|
||||||
'NH',
|
|
||||||
'NJ',
|
|
||||||
'NM',
|
|
||||||
'NV',
|
|
||||||
'NY',
|
|
||||||
'ND',
|
|
||||||
'OH',
|
|
||||||
'OK',
|
|
||||||
'OR',
|
|
||||||
'PA',
|
|
||||||
'RI',
|
|
||||||
'SC',
|
|
||||||
'SD',
|
|
||||||
'TN',
|
|
||||||
'TX',
|
|
||||||
'UT',
|
|
||||||
'VT',
|
|
||||||
'VA',
|
|
||||||
'WA',
|
|
||||||
'WI',
|
|
||||||
'WV',
|
|
||||||
'WY'
|
|
||||||
];
|
|
||||||
usPhoneMask = ['(', /[1-9]/, /\d/, /\d/, ')', ' ', /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/];
|
|
||||||
|
|
||||||
contactsData: any;
|
|
||||||
contactsColDef = [
|
|
||||||
{headerName: 'Name ✎', field: 'name', editable: true, cellEditor: 'emptyErrorEditorComponent'},
|
|
||||||
{headerName: 'Title ✎', field: 'title', editable: true},
|
|
||||||
{headerName: 'Email ✎', field: 'email', editable: true},
|
|
||||||
{headerName: 'Work ✎', field: 'workPhone', editable: true, cellEditor: 'phoneEditorComponent'},
|
|
||||||
{headerName: 'Phone ✎', field: 'mobile', editable: true, cellEditor: 'phoneEditorComponent'},
|
|
||||||
{headerName: 'Ext. ✎', field: 'phExt', editable: true},
|
|
||||||
{headerName: 'Fax ✎', field: 'fax', editable: true, cellEditor: 'phoneEditorComponent'},
|
|
||||||
{headerName: 'Address ✎', field: 'address', editable: true}
|
|
||||||
];
|
|
||||||
|
|
||||||
idMask = [/[^']/, /[^']/, /[^']/, /[^']/, /[^']/, /[^']/, /[^']/, /[^']/, /[^']/, /[^']/];
|
|
||||||
|
|
||||||
// address: "123 Test Drive"
|
// address: "123 Test Drive"
|
||||||
// contactId: 1
|
// contactId: 1
|
||||||
|
@ -137,16 +100,17 @@ export class CustomerComponent implements OnInit {
|
||||||
// callback for grid selection
|
// callback for grid selection
|
||||||
setSelectedRow(event) {
|
setSelectedRow(event) {
|
||||||
this.selected = event.data;
|
this.selected = event.data;
|
||||||
this.contactsData = this.astuteClientService.getCustomerContacts(this.selected.customerId);
|
this.refreshContactData(this.selected.customerId);
|
||||||
|
// this.contactsData = this.astuteClientService.getCustomerContacts(this.selected.customerId);
|
||||||
}
|
}
|
||||||
|
|
||||||
// wrappers for customer service methods
|
// wrappers for customer service methods
|
||||||
addCustomer(customerId, name, billTo, add1, add2, city, state, zip, zip4, email, phone, phExt, fax, ref) {
|
addCustomer(customerId, name, billTo, add1, add2, city, state, zip, zip4, email, phone, phExt, fax, ref) {
|
||||||
if (fax.length > 0 && fax.length < 14) {
|
if (fax.length < 14) {
|
||||||
this.notif('Invalid fax.');
|
this.notif('Invalid fax.');
|
||||||
} else if (phone.length > 0 && phone.length < 14) {
|
} else if (phone.length < 14) {
|
||||||
this.notif('Invalid phone.');
|
this.notif('Invalid phone.');
|
||||||
} else if (email.length > 0 && /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email) === false) {
|
} else if (email.length !== 0 && this.emailMask.test(email) === false) {
|
||||||
this.notif('You have entered an invalid email address!');
|
this.notif('You have entered an invalid email address!');
|
||||||
} else {
|
} else {
|
||||||
const customerData = {
|
const customerData = {
|
||||||
|
@ -229,18 +193,18 @@ export class CustomerComponent implements OnInit {
|
||||||
|
|
||||||
// wrappers for contact service methods (only inline editing)
|
// wrappers for contact service methods (only inline editing)
|
||||||
createEmptyContact(name: string) {
|
createEmptyContact(name: string) {
|
||||||
const newContactData = {
|
// const newContactData = {
|
||||||
address: '',
|
// address: '',
|
||||||
customerId: this.selected.customerId,
|
// customerId: this.selected.customerId,
|
||||||
email: '',
|
// email: '',
|
||||||
fax: '',
|
// fax: '',
|
||||||
mobile: '',
|
// mobile: '',
|
||||||
name: name,
|
// name: name,
|
||||||
phExt: '',
|
// phExt: '',
|
||||||
title: '',
|
// title: '',
|
||||||
workPhone: ''
|
// workPhone: ''
|
||||||
};
|
// };
|
||||||
console.log(newContactData);
|
const newContactData = new CustomerContact({customerId: this.selected.customerId, name: name});
|
||||||
this.astuteClientService.createCustomerContact(newContactData).then ((data) => {
|
this.astuteClientService.createCustomerContact(newContactData).then ((data) => {
|
||||||
if (!data) {
|
if (!data) {
|
||||||
this.notif('Contact Creation Failed, Check Input Fields');
|
this.notif('Contact Creation Failed, Check Input Fields');
|
||||||
|
@ -307,12 +271,12 @@ export class CustomerComponent implements OnInit {
|
||||||
// this.notif('Invalid work phone.');
|
// this.notif('Invalid work phone.');
|
||||||
// } else
|
// } else
|
||||||
if (eventData.email.length > 0 && /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(eventData.email) === false) {
|
if (eventData.email.length > 0 && /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(eventData.email) === false) {
|
||||||
this.contactsData = this.astuteClientService.getCustomerContacts(eventData.customerId);
|
this.refreshContactData(eventData.customerId);
|
||||||
this.notif('You have entered an invalid email address!');
|
this.notif('You have entered an invalid email address!');
|
||||||
} else {
|
} else {
|
||||||
this.astuteClientService.updateCustomerContact(eventData.customerId, eventData).then((data) => {
|
this.astuteClientService.updateCustomerContact(eventData.customerId, eventData).then((data) => {
|
||||||
if (!data) {
|
if (!data) {
|
||||||
this.contactsData = this.astuteClientService.getCustomerContacts(eventData.customerId);
|
this.refreshContactData(eventData.customerId);
|
||||||
// this.notif('Customer Updating Failed, Check Input Fields');
|
// this.notif('Customer Updating Failed, Check Input Fields');
|
||||||
}
|
}
|
||||||
}, (reason) => {
|
}, (reason) => {
|
||||||
|
@ -338,15 +302,30 @@ export class CustomerComponent implements OnInit {
|
||||||
|
|
||||||
// refreshes corresponding data
|
// refreshes corresponding data
|
||||||
refreshData() {
|
refreshData() {
|
||||||
this.rowData = this.astuteClientService.getCustomers();
|
// this.rowData = this.astuteClientService.getCustomers();
|
||||||
this.selected = null;
|
this.selected = null;
|
||||||
|
|
||||||
this.astuteClientService.getCustomers().then((data) => {
|
this.astuteClientService.getCustomers().then((data) => {
|
||||||
this.customers = data;
|
const tempCustomer = data as Customer[];
|
||||||
|
this.customers = tempCustomer.map((customer) => new Customer(customer, this.astuteClientService));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// this.astuteClientService.getCustomers().then((data) => {
|
||||||
|
// this.customers = data;
|
||||||
|
// });
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
refreshContactData(customerId) {
|
refreshContactData(customerId) {
|
||||||
this.contactsData = this.astuteClientService.getCustomerContacts(customerId);
|
// this.contactsData = this.astuteClientService.getCustomerContacts(customerId);
|
||||||
this.contactColumnApi.autoSizeColumns();
|
this.selected.getCustomerContacts().then(() => {
|
||||||
|
if (this.selected.contacts) {
|
||||||
|
this.contactsData = this.selected.contacts;
|
||||||
|
} else {
|
||||||
|
this.contactsData = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// this.contactColumnApi.autoSizeColumns();
|
||||||
}
|
}
|
||||||
|
|
||||||
// on each grid ready: sets api's and enable auto-resizing
|
// on each grid ready: sets api's and enable auto-resizing
|
||||||
|
|
|
@ -387,7 +387,7 @@
|
||||||
<div class="modal-footer" >
|
<div class="modal-footer" >
|
||||||
<p *ngIf="chosenInv.invoiceStatus == 1">
|
<p *ngIf="chosenInv.invoiceStatus == 1">
|
||||||
<button type="button" class="btn btn-success"
|
<button type="button" class="btn btn-success"
|
||||||
(click)="editInvoice(inNumIn.value, poNumIn.value, coNumIn.value, pmtStatusIn.value, notesIn.value, certIn.value)">
|
(click)="editInvoice(inNumIn.value, poNumIn.value, coNumIn.value, pmtStatusIn.value, selectedBillAmt, notesIn.value, certIn.value)">
|
||||||
<!--[disabled]="(chosenInv.invoiceStatus !== 1)">-->
|
<!--[disabled]="(chosenInv.invoiceStatus !== 1)">-->
|
||||||
Confirm
|
Confirm
|
||||||
</button>
|
</button>
|
||||||
|
@ -692,15 +692,15 @@
|
||||||
<select class="custom-select"
|
<select class="custom-select"
|
||||||
[disabled]="!selectedPODetails.length || (chosenInv ? chosenInv.invoiceStatus === 2 || chosenInv.invoiceStatus === 3: false)"
|
[disabled]="!selectedPODetails.length || (chosenInv ? chosenInv.invoiceStatus === 2 || chosenInv.invoiceStatus === 3: false)"
|
||||||
#poDetailSelec>
|
#poDetailSelec>
|
||||||
<option value="" disabled selected>Choose Sales Order...</option>
|
<option value="" disabled selected>Choose Sales Order Detail...</option>
|
||||||
<option *ngFor="let po of selectedPODetails" [value]="po.lineItemNo">{{po.serviceDesc}}</option>
|
<option *ngFor="let po of filterRemainingQtyPoDetails(selectedPODetails)" [value]="po.lineItemNo">{{po.serviceDesc}}</option>
|
||||||
<hr>
|
<hr>
|
||||||
<option [value]="-1">Invoice Out of Pocket Expenses</option>
|
<option [value]="-1">Invoice Out of Pocket Expenses</option>
|
||||||
</select>
|
</select>
|
||||||
<div class="input-group-append w-25">
|
<div class="input-group-append w-25">
|
||||||
<button class="btn btn-success w-50" type="button"
|
<button class="btn btn-success w-50" type="button"
|
||||||
(click)="addEmptyDetail(poDetailSelec.value); poDetailSelec.selectedIndex = 0"
|
(click)="addEmptyDetail(poDetailSelec.value); poDetailSelec.selectedIndex = 0"
|
||||||
[disabled]="!poDetailSelec.value || (chosenInv ? chosenInv.invoiceStatus === 2 || chosenInv.invoiceStatus === 3: false)">
|
[disabled]="!poDetailSelec.value || (chosenInv ? chosenInv.invoiceStatus === 2 || chosenInv.invoiceStatus === 3: true)">
|
||||||
Add
|
Add
|
||||||
</button>
|
</button>
|
||||||
<button class="btn btn-danger w-50 input-group-sm" type="button"
|
<button class="btn btn-danger w-50 input-group-sm" type="button"
|
||||||
|
|
|
@ -108,7 +108,7 @@ export class InvoiceComponent implements OnInit {
|
||||||
if (po.ponum === ponum) {
|
if (po.ponum === ponum) {
|
||||||
this.chosenPo = po;
|
this.chosenPo = po;
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
// this.astuteClientService.getPODetail(ponum).then((data) => {
|
// this.astuteClientService.getPODetail(ponum).then((data) => {
|
||||||
// if (data) {
|
// if (data) {
|
||||||
// // lineItemNo, feeTypeId, serviceTypeId, serviceDesc, fee, remainingQty
|
// // lineItemNo, feeTypeId, serviceTypeId, serviceDesc, fee, remainingQty
|
||||||
|
@ -268,11 +268,11 @@ export class InvoiceComponent implements OnInit {
|
||||||
this.selectedInDetails = this.astuteClientService.getInvoiceDetail(this.chosenInv.invoiceNumber).then((data) => {
|
this.selectedInDetails = this.astuteClientService.getInvoiceDetail(this.chosenInv.invoiceNumber).then((data) => {
|
||||||
if (data) {
|
if (data) {
|
||||||
data.forEach((invDetail) => {
|
data.forEach((invDetail) => {
|
||||||
if (invDetail.poLineItemNum === -1) {
|
if (invDetail.poLineItemNum === -1) { // ad hoc out of pocket expenses
|
||||||
invDetail.remainingQty = '-';
|
invDetail.remainingQty = '-';
|
||||||
invDetail.poDetailName = 'Out of Pocket Expenses';
|
invDetail.poDetailName = 'Out of Pocket Expenses';
|
||||||
} else {
|
} else {
|
||||||
if (this.chosenInv.invoiceStatus === 1) {
|
if (this.chosenInv.invoiceStatus === 1) { // draft invoice
|
||||||
invDetail.remainingQty = invDetail.draftRemainingQty;
|
invDetail.remainingQty = invDetail.draftRemainingQty;
|
||||||
} else {
|
} else {
|
||||||
const tempPo = this.selectedPODetails[invDetail.poLineItemNum - 1];
|
const tempPo = this.selectedPODetails[invDetail.poLineItemNum - 1];
|
||||||
|
@ -307,6 +307,10 @@ export class InvoiceComponent implements OnInit {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
filterRemainingQtyPoDetails(poDetails: any[]): any[] {
|
||||||
|
return poDetails.filter((poDetail) => poDetail.remainingQty > 0);
|
||||||
|
}
|
||||||
|
|
||||||
onSelectedCellChange(row: number, col: string, value) {
|
onSelectedCellChange(row: number, col: string, value) {
|
||||||
// this.selectedInDetails[row][col] = value;
|
// this.selectedInDetails[row][col] = value;
|
||||||
// console.log(this.selectedInDetails);
|
// console.log(this.selectedInDetails);
|
||||||
|
@ -458,8 +462,8 @@ export class InvoiceComponent implements OnInit {
|
||||||
day = '' + d.getDate();
|
day = '' + d.getDate();
|
||||||
const year = d.getFullYear();
|
const year = d.getFullYear();
|
||||||
|
|
||||||
if (month.length < 2) month = '0' + month;
|
if (month.length < 2) { month = '0' + month; }
|
||||||
if (day.length < 2) day = '0' + day;
|
if (day.length < 2) { day = '0' + day; }
|
||||||
|
|
||||||
|
|
||||||
return [year, month, day].join('-');
|
return [year, month, day].join('-');
|
||||||
|
@ -503,22 +507,22 @@ export class InvoiceComponent implements OnInit {
|
||||||
// String certification;
|
// String certification;
|
||||||
// Date pmtReceivedDate;
|
// Date pmtReceivedDate;
|
||||||
const invData = {
|
const invData = {
|
||||||
"invoiceNumber": invoiceNumber,
|
'invoiceNumber': invoiceNumber,
|
||||||
"invoiceDate": this.formatDate(new Date()),
|
'invoiceDate': this.formatDate(new Date()),
|
||||||
"poNum": poNum,
|
'poNum': poNum,
|
||||||
"changeOrderNum": changeOrderNum,
|
'changeOrderNum': changeOrderNum,
|
||||||
"pmtStatus": +pmtStatus,
|
'pmtStatus': +pmtStatus,
|
||||||
"billAmt": +billAmt,
|
'billAmt': +billAmt,
|
||||||
"specialNotes": specialNotes,
|
'specialNotes': specialNotes,
|
||||||
"certification": certification,
|
'certification': certification,
|
||||||
"pmtReceivedDate": this.formatDate(new Date()),
|
'pmtReceivedDate': this.formatDate(new Date()),
|
||||||
'invoiceStatus': status
|
'invoiceStatus': status
|
||||||
};
|
};
|
||||||
console.log(invData);
|
console.log(invData);
|
||||||
|
|
||||||
this.astuteClientService.createInvoice(invData)
|
this.astuteClientService.createInvoice(invData)
|
||||||
.catch((response) => {
|
.catch((response) => {
|
||||||
console.log("rejected: " + response);
|
console.log('rejected: ' + response);
|
||||||
})
|
})
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
if (data) {
|
if (data) {
|
||||||
|
@ -541,29 +545,29 @@ export class InvoiceComponent implements OnInit {
|
||||||
// String certification;
|
// String certification;
|
||||||
// Date pmtReceivedDate;
|
// Date pmtReceivedDate;
|
||||||
const invData = {
|
const invData = {
|
||||||
"invoiceNumber": invoiceNumber,
|
'invoiceNumber': invoiceNumber,
|
||||||
"invoiceDate": new Date(),
|
'invoiceDate': new Date(),
|
||||||
"poNum": poNum,
|
'poNum': poNum,
|
||||||
"changeOrderNum": changeOrderNum,
|
'changeOrderNum': changeOrderNum,
|
||||||
"pmtStatus": +pmtStatus,
|
'pmtStatus': +pmtStatus,
|
||||||
"billAmt": +billAmt,
|
'billAmt': +billAmt,
|
||||||
"specialNotes": specialNotes,
|
'specialNotes': specialNotes,
|
||||||
"certification": certification,
|
'certification': certification,
|
||||||
"pmtReceivedDate": new Date()
|
'pmtReceivedDate': new Date()
|
||||||
};
|
};
|
||||||
|
|
||||||
this.astuteClientService.updateInvoice(invoiceNumber, invData)
|
this.astuteClientService.updateInvoice(invoiceNumber, invData)
|
||||||
.catch((response) => {
|
.catch((response) => {
|
||||||
console.log("rejected: " + response);
|
console.log('rejected: ' + response);
|
||||||
})
|
})
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
if (data) {
|
if (data) {
|
||||||
this.notif("invoice " + invoiceNumber + " updated!");
|
this.notif('invoice ' + invoiceNumber + ' updated!');
|
||||||
console.log("fulfilled: " + data);
|
console.log('fulfilled: ' + data);
|
||||||
// this.source[this.chosenInv] = invData;
|
// this.source[this.chosenInv] = invData;
|
||||||
this.refreshData();
|
this.refreshData();
|
||||||
} else {
|
} else {
|
||||||
this.notif("Invoice Update Failed, Check Input Fields")
|
this.notif('Invoice Update Failed, Check Input Fields');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@ import {Component, OnInit, ViewEncapsulation} from '@angular/core';
|
||||||
import {NgForm} from '@angular/forms';
|
import {NgForm} from '@angular/forms';
|
||||||
import {Router} from '@angular/router';
|
import {Router} from '@angular/router';
|
||||||
import {AstuteClientService} from '../services/astute-client-service';
|
import {AstuteClientService} from '../services/astute-client-service';
|
||||||
import {ToastManagerService} from "../services/toast-manager/toast-service.service";
|
import {ToastManagerService} from '../services/toast-manager/toast-service.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-login',
|
selector: 'app-login',
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
import {Component, Input, OnInit, ViewChild} from '@angular/core';
|
import {Component, Input, OnInit, ViewChild} from '@angular/core';
|
||||||
import {NgbModal, ModalDismissReasons, NgbActiveModal} from '@ng-bootstrap/ng-bootstrap';
|
import {NgbModal, ModalDismissReasons, NgbActiveModal, NgbModalRef} from '@ng-bootstrap/ng-bootstrap';
|
||||||
|
import {FunctionCall} from '@angular/compiler';
|
||||||
|
import {AgGridComponentFunctionInput} from 'ag-grid-community/dist/lib/components/framework/userComponentRegistry';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-modal-form',
|
selector: 'app-modal-form',
|
||||||
|
@ -10,7 +12,7 @@ export class ModalFormComponent implements OnInit {
|
||||||
closeResult: string;
|
closeResult: string;
|
||||||
@Input() title: string;
|
@Input() title: string;
|
||||||
@ViewChild('content', {'static': false}) content;
|
@ViewChild('content', {'static': false}) content;
|
||||||
activeModal;
|
activeModal: NgbModalRef;
|
||||||
constructor(private modalService: NgbModal) {}
|
constructor(private modalService: NgbModal) {}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
48
AstuteClient2/src/app/models/Customer.model.ts
Normal file
48
AstuteClient2/src/app/models/Customer.model.ts
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
import {Injectable} from '@angular/core';
|
||||||
|
import {CustomerContact} from './CustomerContact.model';
|
||||||
|
import {AstuteClientService} from '../services/astute-client-service';
|
||||||
|
import {map} from 'rxjs/operators';
|
||||||
|
import {GlobalConstants} from '../common/GlobalConstants';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class Customer {
|
||||||
|
public customerId: string;
|
||||||
|
public customerName: string;
|
||||||
|
public billToDept: string;
|
||||||
|
public add1: string;
|
||||||
|
public add2: string;
|
||||||
|
public city: string;
|
||||||
|
public state: string;
|
||||||
|
public zip: number;
|
||||||
|
public ziplast4: number;
|
||||||
|
public email: string;
|
||||||
|
public phone: string;
|
||||||
|
public phExt: number;
|
||||||
|
public fax: string;
|
||||||
|
public contacts: CustomerContact[];
|
||||||
|
|
||||||
|
constructor (jsonFromApi: any, public astuteClientService?: AstuteClientService) {
|
||||||
|
this.customerId = jsonFromApi.customerId ? jsonFromApi.customerId : GlobalConstants.STRING_DEFAULT;
|
||||||
|
this.customerName = jsonFromApi.customerName ? jsonFromApi.customerName : GlobalConstants.STRING_DEFAULT;
|
||||||
|
this.billToDept = jsonFromApi.billToDept ? jsonFromApi.billToDept : GlobalConstants.STRING_DEFAULT;
|
||||||
|
this.add1 = jsonFromApi.add1 ? jsonFromApi.add1 : GlobalConstants.STRING_DEFAULT;
|
||||||
|
this.add2 = jsonFromApi.add2 ? jsonFromApi.add2 : GlobalConstants.STRING_DEFAULT;
|
||||||
|
this.city = jsonFromApi.city ? jsonFromApi.city : GlobalConstants.STRING_DEFAULT;
|
||||||
|
this.state = jsonFromApi.state ? jsonFromApi.state : GlobalConstants.STRING_DEFAULT;
|
||||||
|
this.zip = jsonFromApi.zip ? jsonFromApi.zip : GlobalConstants.NUMBER_DEFAULT;
|
||||||
|
this.ziplast4 = jsonFromApi.ziplast4 ? jsonFromApi.ziplast4 : GlobalConstants.NUMBER_DEFAULT;
|
||||||
|
this.email = jsonFromApi.email ? jsonFromApi.email : GlobalConstants.STRING_DEFAULT;
|
||||||
|
this.phone = jsonFromApi.phone ? jsonFromApi.phone : GlobalConstants.STRING_DEFAULT;
|
||||||
|
this.phExt = jsonFromApi.phExt ? jsonFromApi.phExt : GlobalConstants.NUMBER_DEFAULT;
|
||||||
|
this.fax = jsonFromApi.fax ? jsonFromApi.fax : GlobalConstants.STRING_DEFAULT;
|
||||||
|
|
||||||
|
this.getCustomerContacts();
|
||||||
|
}
|
||||||
|
|
||||||
|
public getCustomerContacts(): Promise<any> {
|
||||||
|
// todo: if contacts were not changed, just return contacts
|
||||||
|
return this.astuteClientService.getCustomerContacts(this.customerId).then((data) => {
|
||||||
|
this.contacts = data as CustomerContact[];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
29
AstuteClient2/src/app/models/CustomerContact.model.ts
Normal file
29
AstuteClient2/src/app/models/CustomerContact.model.ts
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
import {Injectable} from '@angular/core';
|
||||||
|
import {GlobalConstants} from '../common/GlobalConstants';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class CustomerContact {
|
||||||
|
public customerId: string;
|
||||||
|
public contactId: number;
|
||||||
|
public name: string;
|
||||||
|
public title: string;
|
||||||
|
public workPhone: string;
|
||||||
|
public phExt: number;
|
||||||
|
public mobile: string;
|
||||||
|
public fax: string;
|
||||||
|
public email: string;
|
||||||
|
public address: string;
|
||||||
|
|
||||||
|
constructor (jsonFromApi: any) {
|
||||||
|
this.customerId = jsonFromApi.customerId ? jsonFromApi.customerId : GlobalConstants.STRING_DEFAULT;
|
||||||
|
this.contactId = jsonFromApi.contactId ? jsonFromApi.contactId : GlobalConstants.NUMBER_DEFAULT;
|
||||||
|
this.name = jsonFromApi.name ? jsonFromApi.name : GlobalConstants.STRING_DEFAULT;
|
||||||
|
this.title = jsonFromApi.title ? jsonFromApi.title : GlobalConstants.STRING_DEFAULT;
|
||||||
|
this.workPhone = jsonFromApi.workPhone ? jsonFromApi.workPhone : GlobalConstants.STRING_DEFAULT;
|
||||||
|
this.phExt = jsonFromApi.phExt ? jsonFromApi.phExt : GlobalConstants.NUMBER_DEFAULT;
|
||||||
|
this.mobile = jsonFromApi.mobile ? jsonFromApi.mobile : GlobalConstants.STRING_DEFAULT;
|
||||||
|
this.fax = jsonFromApi.fax ? jsonFromApi.fax : GlobalConstants.STRING_DEFAULT;
|
||||||
|
this.email = jsonFromApi.email ? jsonFromApi.email : GlobalConstants.STRING_DEFAULT;
|
||||||
|
this.address = jsonFromApi.address ? jsonFromApi.address : GlobalConstants.STRING_DEFAULT;
|
||||||
|
}
|
||||||
|
}
|
|
@ -434,7 +434,7 @@
|
||||||
<div class="input-group-append w-25">
|
<div class="input-group-append w-25">
|
||||||
<button class="btn btn-success w-50 input-group-sm" type="button"
|
<button class="btn btn-success w-50 input-group-sm" type="button"
|
||||||
(click)="addEmptyDetail(poDescription.value); poDescription.value = '';"
|
(click)="addEmptyDetail(poDescription.value); poDescription.value = '';"
|
||||||
[disabled]="!poDescription.value || (selected ? selected.isFinal : false)">
|
[disabled]="!poDescription.value || (selected ? selected.isFinal : true)">
|
||||||
Add
|
Add
|
||||||
</button>
|
</button>
|
||||||
<button class="btn btn-danger w-50 input-group-sm" type="button"
|
<button class="btn btn-danger w-50 input-group-sm" type="button"
|
||||||
|
|
|
@ -3,9 +3,9 @@ import {AstuteClientService} from '../services/astute-client-service';
|
||||||
import {formatCurrency, formatNumber} from '@angular/common';
|
import {formatCurrency, formatNumber} from '@angular/common';
|
||||||
import {ToastManagerService} from '../services/toast-manager/toast-service.service';
|
import {ToastManagerService} from '../services/toast-manager/toast-service.service';
|
||||||
import {NumberFormatterComponent} from '../ag-grid-components/number-formatter/number-formatter.component';
|
import {NumberFormatterComponent} from '../ag-grid-components/number-formatter/number-formatter.component';
|
||||||
import {EmptyErrorEditorComponent} from "../ag-grid-components/empty-error-editor/empty-error-editor.component";
|
import {EmptyErrorEditorComponent} from '../ag-grid-components/empty-error-editor/empty-error-editor.component';
|
||||||
import {SoQtyEditorComponent} from "../ag-grid-components/so-qty-editor/so-qty-editor.component";
|
import {SoQtyEditorComponent} from '../ag-grid-components/so-qty-editor/so-qty-editor.component';
|
||||||
import {SoQtyFormatterComponent} from "../ag-grid-components/so-qty-formatter/so-qty-formatter.component";
|
import {SoQtyFormatterComponent} from '../ag-grid-components/so-qty-formatter/so-qty-formatter.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-sales-order',
|
selector: 'app-sales-order',
|
||||||
|
@ -31,11 +31,13 @@ export class SalesOrderComponent implements OnInit {
|
||||||
// data for SO grid
|
// data for SO grid
|
||||||
rowData: any;
|
rowData: any;
|
||||||
columnDefs = [
|
columnDefs = [
|
||||||
{headerName: 'Project Number ✎', field: 'astuteProjectNumber', editable: (node => !node.data.isFinal), cellEditor: 'emptyErrorEditorComponent'},
|
{headerName: 'Project Number ✎', field: 'astuteProjectNumber', editable: (node => !node.data.isFinal),
|
||||||
|
cellEditor: 'emptyErrorEditorComponent'},
|
||||||
{headerName: 'SO Number', field: 'ponum'},
|
{headerName: 'SO Number', field: 'ponum'},
|
||||||
// {headerName: 'Customer ID', field: 'customerId'},
|
// {headerName: 'Customer ID', field: 'customerId'},
|
||||||
{headerName: 'Customer Name', field: 'customerName'},
|
{headerName: 'Customer Name', field: 'customerName'},
|
||||||
{headerName: 'Contract Number ✎', field: 'contractNum', editable: (node => !node.data.isFinal), cellEditor: 'emptyErrorEditorComponent'},
|
{headerName: 'Contract Number ✎', field: 'contractNum', editable: (node => !node.data.isFinal),
|
||||||
|
cellEditor: 'emptyErrorEditorComponent'},
|
||||||
{headerName: 'SO Title ✎', field: 'title', editable: (node => !node.data.isFinal), cellEditor: 'emptyErrorEditorComponent'},
|
{headerName: 'SO Title ✎', field: 'title', editable: (node => !node.data.isFinal), cellEditor: 'emptyErrorEditorComponent'},
|
||||||
{headerName: 'Contract Amount', field: 'contractAmt', cellRenderer: 'numberFormatterComponent'},
|
{headerName: 'Contract Amount', field: 'contractAmt', cellRenderer: 'numberFormatterComponent'},
|
||||||
// {headerName: 'Contract Amount', field: 'contractAmt'},
|
// {headerName: 'Contract Amount', field: 'contractAmt'},
|
||||||
|
@ -79,6 +81,9 @@ export class SalesOrderComponent implements OnInit {
|
||||||
editable: (node => (node.data.feeTypeId === 2 && this.selected && !this.selected.isFinal)),
|
editable: (node => (node.data.feeTypeId === 2 && this.selected && !this.selected.isFinal)),
|
||||||
cellEditor: 'soQtyEditorComponent', cellEditorParams: (node => ({feeTypeId: node.data.feeTypeId})),
|
cellEditor: 'soQtyEditorComponent', cellEditorParams: (node => ({feeTypeId: node.data.feeTypeId})),
|
||||||
cellRenderer: 'soQtyFormatterComponent', cellRendererParams: (node => ({feeTypeId: node.data.feeTypeId}))},
|
cellRenderer: 'soQtyFormatterComponent', cellRendererParams: (node => ({feeTypeId: node.data.feeTypeId}))},
|
||||||
|
{headerName: 'Remaining Qty', field: 'remainingQty',
|
||||||
|
cellEditor: 'soQtyEditorComponent', cellEditorParams: (node => ({feeTypeId: node.data.feeTypeId})),
|
||||||
|
cellRenderer: 'soQtyFormatterComponent', cellRendererParams: (node => ({feeTypeId: node.data.feeTypeId}))},
|
||||||
{headerName: 'Rate ($) ✎', field: 'fee', editable: (_ => (this.selected && !this.selected.isFinal)),
|
{headerName: 'Rate ($) ✎', field: 'fee', editable: (_ => (this.selected && !this.selected.isFinal)),
|
||||||
cellRenderer: 'numberFormatterComponent'}
|
cellRenderer: 'numberFormatterComponent'}
|
||||||
];
|
];
|
||||||
|
|
|
@ -7,7 +7,7 @@ export class ToastManagerService {
|
||||||
toasts: any[] = [];
|
toasts: any[] = [];
|
||||||
show(textOrTpl: string, options: any = {}) {
|
show(textOrTpl: string, options: any = {}) {
|
||||||
const words = textOrTpl.split(' ').length;
|
const words = textOrTpl.split(' ').length;
|
||||||
this.toasts.push({ textOrTpl, delay: (words + 1) * 1000, ...options });
|
this.toasts.push({ textOrTpl, delay: (words + 1) * 250, ...options });
|
||||||
}
|
}
|
||||||
|
|
||||||
remove(toast) {
|
remove(toast) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user