@@ -98,55 +98,45 @@ public function loadLeads()
98
98
99
99
$ workFlow = $ this ->workflowManager ->startWorkflow ('sales_lead ' , $ lead , 'qualify ' );
100
100
if ((bool )rand (0 , 1 )) {
101
- /** @var WorkflowItem $opportunityFlow */
102
- $ opportunityFlow = $ workFlow ->getResult ()->get ('workflowItem ' );
101
+ /** @var WorkflowItem $salesFlow */
102
+ $ salesFlow = $ workFlow ->getResult ()->get ('workflowItem ' );
103
103
$ this ->transit (
104
104
$ this ->workflowManager ,
105
- $ opportunityFlow ,
106
- 'develop ' ,
105
+ $ salesFlow ,
106
+ 'close ' ,
107
107
array (
108
108
'budget_amount ' => rand (10 , 10000 ),
109
- 'probability ' => round (rand (5 , 75 ) / 100.00 , 2 )
109
+ 'customer_need ' => rand (10 , 10000 ),
110
+ 'proposed_solution ' => rand (10 , 10000 ),
111
+ 'probability ' => round (rand (50 , 85 ) / 100.00 , 2 )
110
112
)
111
113
);
112
114
if ((bool )rand (0 , 1 )) {
115
+ $ reason = $ this ->em ->find ('OroCRMSalesBundle:OpportunityCloseReason ' , 'won ' );
113
116
$ this ->transit (
114
117
$ this ->workflowManager ,
115
- $ opportunityFlow ,
116
- 'close ' ,
118
+ $ salesFlow ,
119
+ 'close_as_won ' ,
117
120
array (
118
- 'customer_need ' => rand (10 , 10000 ),
119
- 'proposed_solution ' => rand (10 , 10000 ),
120
- 'probability ' => round (rand (50 , 85 ) / 100.00 , 2 )
121
+ 'close_reason ' => $ reason ,
122
+ 'close_revenue ' => rand (100 , 1000 ),
123
+ 'close_date ' => new \DateTime ('now ' ),
124
+ 'probability ' => 1
125
+ )
126
+ );
127
+ } elseif ((bool )rand (0 , 1 )) {
128
+ $ reason = $ this ->em ->find ('OroCRMSalesBundle:OpportunityCloseReason ' , 'cancelled ' );
129
+ $ this ->transit (
130
+ $ this ->workflowManager ,
131
+ $ salesFlow ,
132
+ 'close_as_lost ' ,
133
+ array (
134
+ 'close_reason ' => $ reason ,
135
+ 'close_revenue ' => rand (100 , 1000 ),
136
+ 'close_date ' => new \DateTime ('now ' ),
137
+ 'probability ' => 0.0
121
138
)
122
139
);
123
- if ((bool )rand (0 , 1 )) {
124
- $ reason = $ this ->em ->find ('OroCRMSalesBundle:OpportunityCloseReason ' , 'won ' );
125
- $ this ->transit (
126
- $ this ->workflowManager ,
127
- $ opportunityFlow ,
128
- 'close_as_won ' ,
129
- array (
130
- 'close_reason ' => $ reason ,
131
- 'close_revenue ' => rand (100 , 1000 ),
132
- 'close_date ' => new \DateTime ('now ' ),
133
- 'probability ' => 1
134
- )
135
- );
136
- } elseif ((bool )rand (0 , 1 )) {
137
- $ reason = $ this ->em ->find ('OroCRMSalesBundle:OpportunityCloseReason ' , 'cancelled ' );
138
- $ this ->transit (
139
- $ this ->workflowManager ,
140
- $ opportunityFlow ,
141
- 'close_as_lost ' ,
142
- array (
143
- 'close_reason ' => $ reason ,
144
- 'close_revenue ' => rand (100 , 1000 ),
145
- 'close_date ' => new \DateTime ('now ' ),
146
- 'probability ' => 0.0
147
- )
148
- );
149
- }
150
140
}
151
141
}
152
142
}
0 commit comments