Open stb-kslater3 opened 3 years ago
Example Opportunity with Matching VINs: STE9060 and STE10138
There are some complications to be considered: The PO Lines should be checked against STEProjectc in case that is set to something different, but only if STEProjectc is not empty. Otherwise if it is empty then check against the Project.Name of that PO, but not the entire project name just the STE#### or LS#### part of it. In either case, compare that to the STE#### or LS#### part of the Opportunity Name. So if there ends up being more than 1 PO with a given Chassis VIN then perform these extra checks. Both sides require parsing the STE or LS #'s out.
Another thing that comes up is that you can't just check the starting letters to distinguish the LS from the STE because many Opportunities start out with 6T . . .
Another thing is that you may need to also factor in Used Units.
Oh boy, one Opportunity has all 3, so I will have to sort this out some how.
Another thing is there are LT as well.
Okay, well the Matching of the Last 6 of the VIN only really applies to the Chassis. So that does make things a little easier, now the question is does the Chassis always have an STE#### or can a Chassis have an LS#### or something else?
Although there are 6U Opportunities that involve Chassis's.
There may or may not be a Chassis on this, but the POs that are pulling to the Opportunity don't add up to very much and the Total Product cost for the unit is over 100k. The name of the Opportunity is 6u1406393.
In most cases, even the used unit cases, there will be an STE#### because we sell bodies, so I will just go off of the STE#### of there is more than one.
Right now if 2 Chassis's have a matching VIN, then I will pull the wrong PO, so I need to compare the STE#### of the PO's Project and STEProject__c (if not empty) to the STE#### of the Opportunity.