LineItem
Extends:
Represents line item data.
Constructor Summary
Public Constructor | ||
public |
constructor(entityData: object, bid: Bid) Creates an instance of LineItem. |
Member Summary
Public Members | ||
public |
|
|
public get |
Base Property |
|
public set |
|
|
public |
Reference to the bid that the line item belongs to. |
|
public get |
Burden Property |
|
public set |
|
|
public get |
Config Property |
|
public get |
Cost Property |
|
public set |
|
|
public get |
Cost per watt |
|
public set |
|
|
public get |
Cost With Markup |
|
public get |
Cost With Tax |
|
public get |
Gets the line item's definition id. |
|
public get |
Escalator Property |
|
public set |
|
|
public |
|
|
public get |
Is Included Property |
|
public set |
|
|
public get |
Is Weighted Property - determines whether or not the contribution weight should be applied to the cost |
|
public set |
|
|
public get |
Labor Hours Property |
|
public set |
|
|
public get |
Markup Property |
|
public set |
|
|
public get |
Markup Percent Property |
|
public set |
|
|
public |
|
|
public get |
|
|
public set |
|
|
public get |
OH&P Property (overhead and profit) |
|
public set |
|
|
public get |
this get was deprecated. Please use Scalar instead.
Per Quantity Property |
|
public set |
this set was deprecated. Please use Scalar instead.
|
|
public |
|
|
public get |
Price Property |
|
public set |
|
|
public get |
Price per watt |
|
public set |
|
|
public get |
Quantity Property |
|
public set |
|
|
public get |
Scalar Property |
|
public get |
Gets Subtotal aka Initial Results. |
|
public get |
Gets the line items tags array |
|
public get |
Tax Property |
|
public set |
|
|
public get |
Tax Percent Property |
|
public set |
|
|
public get |
When using predictive pricing, should the computed value be used if it's available? |
|
public set |
Overrides the bid variable for the line item |
|
public get |
Wage Property |
|
public set |
|
|
public get |
|
Method Summary
Public Methods | ||
public |
applyContributionWeight(weightedNormalValues: *, predictionType: string): * |
|
public |
Assess line item for changes. |
|
public |
|
|
public |
bind() Binds the "updated" event for all dependant bid entities. |
|
public |
calculateNormalError(range: *, model: *): float Calculates the normal inverse based on a distribution range, a model's standard_deviation_error_mean and error |
|
public |
calculateNormalValue(value: *, error: *): number Calculates the normal value from the normal error |
|
public |
calculateStdDevSumR2(): sumOfR2 | null Calculates the sum of the r2 values from each model's ['standard_deviation'] object |
|
public |
calculateWeightedLaborCost(weightedValue: *): number Calculates the weighted labor hours cost. |
|
public |
calculateWeightedNormalValue(currentModelNormalValue: *, currentModelSumR2: *, nextModelNormalValue: *, nextModelSumR2: *): number Calculates the weighted normal value from the current normal value and sumOfR2 and the next normal value and sumOfR2 |
|
public |
components(): Component[] Gets an array of components that the line item is under. |
|
public |
Deletes line item. |
|
public |
dependants(): BidEntity[] Gets dependant bid entities that rely on line item instance. |
|
public |
dependencies(): BidEntity[] Gets a list of bid entities that the line item instance relies on. |
|
public |
dirty() Flags the line item and corresponding bid as dirty and to be saved. |
|
public |
exportData(alwaysIncludeConfig: boolean): object Exports the line item's internal data structure. |
|
public |
getAssembly(): Assembly | undefined Get the line item's assembly if it has one |
|
public |
getPredictedCost(predictionType: string): number Evaluates the cost prediction models for the line item. |
|
public |
getPredictedCostExperimental(predictionType: string): * |
|
public |
getPredictedLaborHours(predictionType: string): number Evaluates the labor hours prediction models for the line item. |
|
public |
getPredictedLaborHoursExperimental(predictionType: string): * |
|
public |
getPredictedValue(predictionType: string): number Gets the predicted value for the line item based on type |
|
public |
Gets the prediction models for the current line item by type |
|
public |
Gets the line item's value. Either Cost or Labor Hours |
|
public |
getWeightedLaborHourCost(predictionType: string): [] Gets an array of the calculated weighted labor hour cost |
|
public |
getWeightedLaborHours(predictionType: string): [] Gets an array of the calculated weighted labor hours |
|
public |
getWeightedNormalValue(range: *): int | null Calculates the weighted normal value at x range |
|
public |
getWeightedNormalValues(predictionType: string): array Calculate the weighted normal value given a set of distribution ranges. |
|
public |
getWorkup(): * |
|
public |
hasNullDependency(field: string): boolean Determines if the field is dependent on null/undefined dependencies |
|
public |
Determines if the line item is has changed for it's original data. |
|
public |
Determines if the line item represents labor costs. |
|
public |
isOverridden(property: string): boolean Determine if the line item or one of its properties is overridden |
|
public |
isPredicted(property: string): boolean Determines if the line item or a property is predicted by recursively checking the properties calculation dependencies prediction status. |
|
public |
moveToComponent(component: Component) Moves line item to a new component and self removes from original component in the same ComponentGroup |
|
public |
|
|
public |
reset() Resets the line item, removing all user override inputs. |
|
public |
Resets the markup, removing user override inputs for markup and markup percent. |
|
public |
resetProperty(property: string) Resets a specific line item member, remove override value. |
|
public |
setAssembly(assembly: Assembly | string): Assembly Adds the line item to an assembly. |
|
public |
setPredictionService(serviceType: *) Sets the current prediction service being used as well as the distribution ranges. |
|
public |
setWorkupField(field: Field) Bind a field dependency to the workup |
|
public |
unsetAssembly(): void Removes any assembly reference from the line item. |
|
public |
|
Inherited Summary
From class AdvanceEventEmitter | ||
public |
Maximum number of events fired for the requester before events stop. |
|
public |
|
|
public |
|
|
public |
removeListenerByRequester(eventName: string, requesterId: string) Removes event listeners by event and requesterId. |
From class BidEntity | ||
public get |
Determine if the entity is in an assembly |
|
public get |
Gets the id of the bid entity. |
|
public get |
Gets the bid entity title. |
|
public set |
Sets the bid entity title. |
|
public get |
Gets the bid entity type. |
|
public abstract |
Assesses bid entity. |
|
public |
dependants(): BidEntity[] Gets an array of depndants that rely on the bid entity. |
|
public |
dependencies(): BidEntity[] Gets all the dependencies that the bid entity relies on. |
|
public |
dirty() Flags the bid entity as dirty and to be saved. |
|
public |
exportData(): object Exports the internal data for the bid entity. |
|
public |
hasNullDependency(field: string): boolean Determines if bid entity relies on a null or undefined dependency value |
|
public |
async initSaveChangeLog(originalValue: *, newValue: *, valueType: *, entityProperty: *, metaData: *): * |
|
public |
Determines of bid entity is dirty. |
|
public |
pristine() Marks the bid entity as clean. |
Public Constructors
Public Members
public accountStoplightIndicator: * source
public industryStoplightIndicator: * source
public get isWeighted: boolean source
Is Weighted Property - determines whether or not the contribution weight should be applied to the cost
public maxEvents: number source
Maximum number of events fired for the requester before events stop.
Override:
AdvanceEventEmitter#maxEventspublic get perQuantity: number source
Per Quantity Property
public predictionType: * source
public get useComputedValueWhenAvailable: boolean source
When using predictive pricing, should the computed value be used if it's available?
Public Methods
public applyContributionWeight(weightedNormalValues: *, predictionType: string): * source
Params:
Name | Type | Attribute | Description |
weightedNormalValues | * | ||
predictionType | string |
|
Return:
* |
public assess(dependency: BidEntity, forceUpdate: boolean) source
Assess line item for changes.
Override:
BidEntity#assessEmit:
assessing |
fires event before assessement. |
assessed |
|
updated |
public assessWorkup() source
public calculateNormalError(range: *, model: *): float source
Calculates the normal inverse based on a distribution range, a model's standard_deviation_error_mean and error
Params:
Name | Type | Attribute | Description |
range | * | ||
model | * |
Return:
float | The CDF - inverse normal distribution result |
public calculateNormalValue(value: *, error: *): number source
Calculates the normal value from the normal error
Params:
Name | Type | Attribute | Description |
value | * | ||
error | * |
public calculateStdDevSumR2(): sumOfR2 | null source
Calculates the sum of the r2 values from each model's ['standard_deviation'] object
public calculateWeightedLaborCost(weightedValue: *): number source
Calculates the weighted labor hours cost. If line item has a contribution weight, multiply the result by the contribution
Params:
Name | Type | Attribute | Description |
weightedValue | * |
public calculateWeightedNormalValue(currentModelNormalValue: *, currentModelSumR2: *, nextModelNormalValue: *, nextModelSumR2: *): number source
Calculates the weighted normal value from the current normal value and sumOfR2 and the next normal value and sumOfR2
Params:
Name | Type | Attribute | Description |
currentModelNormalValue | * | ||
currentModelSumR2 | * | ||
nextModelNormalValue | * | ||
nextModelSumR2 | * |
public components(): Component[] source
Gets an array of components that the line item is under. A line item is either uncategorized or under one Component per ComponentGroup
public dependants(): BidEntity[] source
Gets dependant bid entities that rely on line item instance.
Override:
BidEntity#dependantspublic dependencies(): BidEntity[] source
Gets a list of bid entities that the line item instance relies on.
Override:
BidEntity#dependenciespublic dirty() source
Flags the line item and corresponding bid as dirty and to be saved.
Override:
BidEntity#dirtypublic exportData(alwaysIncludeConfig: boolean): object source
Exports the line item's internal data structure.
Override:
BidEntity#exportDataParams:
Name | Type | Attribute | Description |
alwaysIncludeConfig | boolean |
|
Flag to include config object regardless of whether it has changed or not. The config is always included if it has been modified but is omitted by to improve save performance if there have been no changes by default to improve save performance. |
public getPredictedCost(predictionType: string): number source
Evaluates the cost prediction models for the line item.
Params:
Name | Type | Attribute | Description |
predictionType | string |
|
public getPredictedCostExperimental(predictionType: string): * source
Params:
Name | Type | Attribute | Description |
predictionType | string |
|
Return:
* |
public getPredictedLaborHours(predictionType: string): number source
Evaluates the labor hours prediction models for the line item.
Params:
Name | Type | Attribute | Description |
predictionType | string |
|
public getPredictedLaborHoursExperimental(predictionType: string): * source
Params:
Name | Type | Attribute | Description |
predictionType | string |
|
Return:
* |
public getPredictedValue(predictionType: string): number source
Gets the predicted value for the line item based on type
Params:
Name | Type | Attribute | Description |
predictionType | string |
|
public getPredictionModels(): Object[] source
Gets the prediction models for the current line item by type
public getWeightedLaborHourCost(predictionType: string): [] source
Gets an array of the calculated weighted labor hour cost
Params:
Name | Type | Attribute | Description |
predictionType | string |
|
Return:
[] |
public getWeightedLaborHours(predictionType: string): [] source
Gets an array of the calculated weighted labor hours
Params:
Name | Type | Attribute | Description |
predictionType | string |
|
Return:
[] |
public getWeightedNormalValue(range: *): int | null source
Calculates the weighted normal value at x range
Params:
Name | Type | Attribute | Description |
range | * |
public getWeightedNormalValues(predictionType: string): array source
Calculate the weighted normal value given a set of distribution ranges.
Params:
Name | Type | Attribute | Description |
predictionType | string |
|
Return:
array | Array of weighted normal values |
public hasNullDependency(field: string): boolean source
Determines if the field is dependent on null/undefined dependencies
Override:
BidEntity#hasNullDependencyParams:
Name | Type | Attribute | Description |
field | string | The field value in question |
public isDirty(): boolean source
Determines if the line item is has changed for it's original data.
Override:
BidEntity#isDirtypublic isOverridden(property: string): boolean source
Determine if the line item or one of its properties is overridden
Params:
Name | Type | Attribute | Description |
property | string |
|
public isPredicted(property: string): boolean source
Determines if the line item or a property is predicted by recursively checking the properties calculation dependencies prediction status.
Params:
Name | Type | Attribute | Description |
property | string |
|
snake case property name |
public moveToComponent(component: Component) source
Moves line item to a new component and self removes from original component in the same ComponentGroup
Params:
Name | Type | Attribute | Description |
component | Component |
public resetMarkup() source
Resets the markup, removing user override inputs for markup and markup percent.
public resetProperty(property: string) source
Resets a specific line item member, remove override value.
Params:
Name | Type | Attribute | Description |
property | string |
public setPredictionService(serviceType: *) source
Sets the current prediction service being used as well as the distribution ranges.
Params:
Name | Type | Attribute | Description |
serviceType | * |
public setWorkupField(field: Field) source
Bind a field dependency to the workup
Params:
Name | Type | Attribute | Description |
field | Field |
|
The field entity to bind to the workup. Must be a 'list' type field. |