vhp-mongo-models 1.6.0 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Pricing/pricing.js
CHANGED
|
@@ -5,5 +5,6 @@ module.exports={
|
|
|
5
5
|
PricingBEE:new Schema(...require('./schemas/pricingbee.js')),
|
|
6
6
|
Pricing300:new Schema(...require('./schemas/pricing300.js')),
|
|
7
7
|
Addition:new Schema(...require('./schemas/additions.js')),
|
|
8
|
-
Finance:new Schema(...require('./schemas/financing.js'))
|
|
8
|
+
Finance:new Schema(...require('./schemas/financing.js')),
|
|
9
|
+
Discount:new Schema(...require('./schemas/discounts.js'))
|
|
9
10
|
}
|
|
@@ -2,15 +2,24 @@ module.exports=[
|
|
|
2
2
|
{
|
|
3
3
|
name:{type:String,default:''}, // pricebook / collection name
|
|
4
4
|
notes:{type:String,default:''}, // versioned | table
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
type:{type:String,default:''}, // the quote type ex. hvac | envelope | window
|
|
6
|
+
cat:{type:String,default:''}, // department provided groupings
|
|
7
7
|
mfg:{type:String,default:''},
|
|
8
8
|
model:{type:String,default:''},
|
|
9
|
-
settings:{type:String,default:''},
|
|
10
|
-
location:{type:Array,default:[]},
|
|
11
9
|
labor:{type:Number,default:0},
|
|
12
10
|
laborpart:{type:Number,default:0},
|
|
13
|
-
|
|
14
|
-
pricededuct:{type:Number,default:0}
|
|
11
|
+
settings:{type:Object,default:{}},
|
|
12
|
+
pricededuct:{type:Number,default:0}, //price to take off
|
|
13
|
+
pricesale:{type:Number,default:0},
|
|
14
|
+
userCreated:{type:Boolean,default:false}, //may not need, is really for gui
|
|
15
|
+
tiers:{type:Array,default:[]} //may not need, is really for gui
|
|
15
16
|
}
|
|
16
17
|
]
|
|
18
|
+
|
|
19
|
+
/*
|
|
20
|
+
settings = {
|
|
21
|
+
|
|
22
|
+
location:{type:Array,default:[]},
|
|
23
|
+
swap:{type:Array,default:[]}
|
|
24
|
+
}
|
|
25
|
+
*/
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
|
|
2
|
+
module.exports=[
|
|
3
|
+
{
|
|
4
|
+
name:{type:String,default:''}, //unique
|
|
5
|
+
type:{type:String,default:'instant'}, // instant | postpurchase | credit
|
|
6
|
+
unit:{type:String,default:'dollar'}, // dollar | percent
|
|
7
|
+
level:{type:String,default:'tier'}, // tier | solution | project
|
|
8
|
+
amount:{type:Number,default:0},
|
|
9
|
+
source:{type:String,default:''}, //needs further explaining to id the purpose
|
|
10
|
+
notes:{type:String,default:''},
|
|
11
|
+
userCreated:{type:Boolean,default:false}, //may not need, is really for gui
|
|
12
|
+
tiers:{type:Array,default:[]} //may not need, is really for gui
|
|
13
|
+
}
|
|
14
|
+
]
|
|
@@ -10,7 +10,11 @@ const { aaddress, acontact } = require('../../core-models.js');
|
|
|
10
10
|
* photos:{type:Boolean},
|
|
11
11
|
* scheduled:{type:Boolean}
|
|
12
12
|
* }]
|
|
13
|
-
*/
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
14
18
|
let pvmaint = new Schema({
|
|
15
19
|
contractNum:{type:String,default:''},
|
|
16
20
|
rewardNum:{type:String,default:''},
|
|
@@ -82,3 +86,73 @@ module.exports=[
|
|
|
82
86
|
toObject: { virtuals: true }
|
|
83
87
|
}
|
|
84
88
|
]
|
|
89
|
+
|
|
90
|
+
/*
|
|
91
|
+
constracts = [{
|
|
92
|
+
contractid: contractid,
|
|
93
|
+
jobnum: project.jobnum || '',
|
|
94
|
+
jobname: project.name || '',
|
|
95
|
+
solname: solution.name || '',
|
|
96
|
+
name: solution.name || '',
|
|
97
|
+
version: false,
|
|
98
|
+
strtdate: null,
|
|
99
|
+
solddate: null,
|
|
100
|
+
sold: sold,
|
|
101
|
+
estimator: project.estimator || '',
|
|
102
|
+
dept: project.dept,
|
|
103
|
+
type: solution.type || '', // not editable; helps determine which templates to use [string]
|
|
104
|
+
path: path,
|
|
105
|
+
hhid: project.hhid || '', // not editable; not shown anywhere
|
|
106
|
+
custcode: project.custid || '', // not editable
|
|
107
|
+
projectid: project.id || '',
|
|
108
|
+
customer: { // all editable (besides longCity and fullName) [strings]
|
|
109
|
+
clientFirst: project.clientfirst,
|
|
110
|
+
clientLast: project.clientlast,
|
|
111
|
+
name: `${project.clientfirst} ${project.clientlast}` || project.clientfirst || project.clientlast,
|
|
112
|
+
street: project.street,
|
|
113
|
+
unit: project.unit,
|
|
114
|
+
city: project.city,
|
|
115
|
+
state: project.state,
|
|
116
|
+
zip: project.zip,
|
|
117
|
+
longCity: project.city + ', ' + project.state + ' ' + project.zip,
|
|
118
|
+
phone: project.phone,
|
|
119
|
+
email: project.email
|
|
120
|
+
},
|
|
121
|
+
general:{
|
|
122
|
+
net:0,
|
|
123
|
+
projid:'',
|
|
124
|
+
contractid:'',
|
|
125
|
+
dept:''
|
|
126
|
+
},
|
|
127
|
+
subs:[], //list
|
|
128
|
+
finance: {
|
|
129
|
+
billto: '', // editable (searchable?) [string]
|
|
130
|
+
|
|
131
|
+
net: 0, // editable [price]
|
|
132
|
+
|
|
133
|
+
downAmount: 0, // editable [price]
|
|
134
|
+
downDate: '', // editable [date]
|
|
135
|
+
downVia: '', // editable ( check number | card last 4 | cash ) [string]
|
|
136
|
+
|
|
137
|
+
financed: financed,
|
|
138
|
+
fincode: '', // editable [string]
|
|
139
|
+
finAmount: 0, // editable [price]
|
|
140
|
+
finTerm: 0, // referenced from fintable via finCode string [number]
|
|
141
|
+
finAPR: '', // referenced from fintable via finCode string [string]
|
|
142
|
+
|
|
143
|
+
dueComplete: 0 // calculation (net - downAmount- dueComplete) [price]
|
|
144
|
+
},
|
|
145
|
+
discounts: [],
|
|
146
|
+
additions: [],
|
|
147
|
+
notes: '',
|
|
148
|
+
terms: { // not editable; not shown on editor or preview, shown on print; gathered from table in settings [string]
|
|
149
|
+
financing: '',
|
|
150
|
+
collections: ''
|
|
151
|
+
},
|
|
152
|
+
solution: { // editablilty will depend on solution. will be blank if STANDARD contract
|
|
153
|
+
//windows:[]
|
|
154
|
+
//envelope:[]
|
|
155
|
+
//vhc:[]
|
|
156
|
+
}
|
|
157
|
+
}]
|
|
158
|
+
*/
|
|
@@ -8,7 +8,9 @@ const ticketFinal = require('./final.js')
|
|
|
8
8
|
name:{type:String,default:''},
|
|
9
9
|
assigned:{type:Array,default:[{
|
|
10
10
|
id:{type:String,default:''}, //the service item id
|
|
11
|
-
|
|
11
|
+
name:{type:String,default:''},
|
|
12
|
+
type:{type:String,default:''}, //describes the
|
|
13
|
+
done:{type:String,default:false} //WORKING | READY | COMPLETE
|
|
12
14
|
}]},
|
|
13
15
|
driveTime:{type:Date,default:''},
|
|
14
16
|
startTime:{type:Date,default:''},
|