Purple and blue envelope details were getting mixed up on both the order form and the confirmation email. The purple screen no longer asks about blue envelopes at all; the blue screen now owns the provider question and always shows its permit questions (not just when buying from KCI), and the order-confirmation email keeps purple and blue answers in separate sections. Also drop the blue page's visibleIf tied to the purple envelope stock choice - it was hiding all blue questions for anyone using their own purple stock, which is unrelated to blue envelope needs. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>master
| @@ -26,7 +26,6 @@ Function ValidateOrderDetailsAnswers(answers) | |||||
| RequireBoolean errors, answers, "MailingNonprofitAuthCodeUnknown" | RequireBoolean errors, answers, "MailingNonprofitAuthCodeUnknown" | ||||
| RequireBoolean errors, answers, "PurpleWantsQuote" | RequireBoolean errors, answers, "PurpleWantsQuote" | ||||
| RequireBoolean errors, answers, "PurpleWantsBlueEnvelopes" | |||||
| RequireBoolean errors, answers, "PurpleTrackMIBallot" | RequireBoolean errors, answers, "PurpleTrackMIBallot" | ||||
| RequireBoolean errors, answers, "BlueWantsQuote" | RequireBoolean errors, answers, "BlueWantsQuote" | ||||
| RequireBoolean errors, answers, "BluePrintPermit" | RequireBoolean errors, answers, "BluePrintPermit" | ||||
| @@ -59,9 +58,6 @@ Sub MapOrderDetailsAnswers(ByRef model, answers) | |||||
| model.PurpleWantsQuote = DictValue(answers, "PurpleWantsQuote") | model.PurpleWantsQuote = DictValue(answers, "PurpleWantsQuote") | ||||
| model.PurpleEnvelopeStock = DictValue(answers, "PurpleEnvelopeStock") | model.PurpleEnvelopeStock = DictValue(answers, "PurpleEnvelopeStock") | ||||
| model.PurplePrintOption = DictValue(answers, "PurplePrintOption") | model.PurplePrintOption = DictValue(answers, "PurplePrintOption") | ||||
| model.PurpleWantsBlueEnvelopes = DictValue(answers, "PurpleWantsBlueEnvelopes") | |||||
| model.PurpleBlueProvider = DictValue(answers, "PurpleBlueProvider") | |||||
| model.PurpleBlueProviderOther = DictValue(answers, "PurpleBlueProviderOther") | |||||
| model.PurplePrintStyle = DictValue(answers, "PurplePrintStyle") | model.PurplePrintStyle = DictValue(answers, "PurplePrintStyle") | ||||
| model.PurpleColorCodingBy = DictValue(answers, "PurpleColorCodingBy") | model.PurpleColorCodingBy = DictValue(answers, "PurpleColorCodingBy") | ||||
| model.PurplePrecinctCount = DictValue(answers, "PurplePrecinctCount") | model.PurplePrecinctCount = DictValue(answers, "PurplePrecinctCount") | ||||
| @@ -72,6 +68,8 @@ Sub MapOrderDetailsAnswers(ByRef model, answers) | |||||
| ' Blue envelope | ' Blue envelope | ||||
| model.BlueWantsQuote = DictValue(answers, "BlueWantsQuote") | model.BlueWantsQuote = DictValue(answers, "BlueWantsQuote") | ||||
| model.PurpleBlueProvider = DictValue(answers, "PurpleBlueProvider") | |||||
| model.PurpleBlueProviderOther = DictValue(answers, "PurpleBlueProviderOther") | |||||
| model.BluePrintPermit = DictValue(answers, "BluePrintPermit") | model.BluePrintPermit = DictValue(answers, "BluePrintPermit") | ||||
| model.BluePermitOwnership = DictValue(answers, "BluePermitOwnership") | model.BluePermitOwnership = DictValue(answers, "BluePermitOwnership") | ||||
| model.BlueHasNonprofitStatus = DictValue(answers, "BlueHasNonprofitStatus") | model.BlueHasNonprofitStatus = DictValue(answers, "BlueHasNonprofitStatus") | ||||
| @@ -71,18 +71,10 @@ Class OrderMailer_Class | |||||
| EmailRow("Phone", model.Phone)) | EmailRow("Phone", model.Phone)) | ||||
| If IsTrue(model.PurpleWantsQuote) Then | If IsTrue(model.PurpleWantsQuote) Then | ||||
| Dim purpleBlueProviderLine | |||||
| purpleBlueProviderLine = LabelPurpleBlueProvider(model.PurpleBlueProvider) | |||||
| If purpleBlueProviderLine = "Other" And Len(Trim(model.PurpleBlueProviderOther & "")) > 0 Then | |||||
| purpleBlueProviderLine = model.PurpleBlueProviderOther | |||||
| End If | |||||
| html = html & EmailSection("Purple Ballot Envelopes", _ | html = html & EmailSection("Purple Ballot Envelopes", _ | ||||
| EmailRow("Permanent ballot list count", model.PurplePermanentBallotListCount) & _ | EmailRow("Permanent ballot list count", model.PurplePermanentBallotListCount) & _ | ||||
| EmailRow("Envelope stock", LabelEnvelopeStock(model.PurpleEnvelopeStock)) & _ | EmailRow("Envelope stock", LabelEnvelopeStock(model.PurpleEnvelopeStock)) & _ | ||||
| EmailRow("Print option", LabelPrintOption(model.PurplePrintOption)) & _ | EmailRow("Print option", LabelPrintOption(model.PurplePrintOption)) & _ | ||||
| EmailRow("Also wants KCI blue envelopes", EmailYesNo(model.PurpleWantsBlueEnvelopes)) & _ | |||||
| EmailRow("Blue envelope provider", purpleBlueProviderLine) & _ | |||||
| EmailRow("Print style", LabelPrintStyle(model.PurplePrintStyle)) & _ | EmailRow("Print style", LabelPrintStyle(model.PurplePrintStyle)) & _ | ||||
| EmailRow("Color coding by", LabelColorCodingBy(model.PurpleColorCodingBy)) & _ | EmailRow("Color coding by", LabelColorCodingBy(model.PurpleColorCodingBy)) & _ | ||||
| EmailRow("Number of precincts", model.PurplePrecinctCount) & _ | EmailRow("Number of precincts", model.PurplePrecinctCount) & _ | ||||
| @@ -91,7 +83,13 @@ Class OrderMailer_Class | |||||
| EmailRow("Extra envelopes requested", model.PurpleExtraEnvelopeQty)) | EmailRow("Extra envelopes requested", model.PurpleExtraEnvelopeQty)) | ||||
| End If | End If | ||||
| If IsTrue(model.BlueWantsQuote) Then | |||||
| If Not IsNull(model.BlueWantsQuote) Then | |||||
| Dim blueProviderLine | |||||
| blueProviderLine = LabelPurpleBlueProvider(model.PurpleBlueProvider) | |||||
| If blueProviderLine = "Other" And Len(Trim(model.PurpleBlueProviderOther & "")) > 0 Then | |||||
| blueProviderLine = model.PurpleBlueProviderOther | |||||
| End If | |||||
| ' City/permit number are collected for an own-organization permit - a permit | ' City/permit number are collected for an own-organization permit - a permit | ||||
| ' lookup can't be done from the nonprofit authorization code alone. | ' lookup can't be done from the nonprofit authorization code alone. | ||||
| Dim bluePermitLine | Dim bluePermitLine | ||||
| @@ -103,6 +101,8 @@ Class OrderMailer_Class | |||||
| End If | End If | ||||
| html = html & EmailSection("Blue AV Envelopes", _ | html = html & EmailSection("Blue AV Envelopes", _ | ||||
| EmailRow("Purchasing blue envelopes from KCI", EmailYesNo(model.BlueWantsQuote)) & _ | |||||
| EmailRow("Blue envelope provider", blueProviderLine) & _ | |||||
| EmailRow("Print permit", EmailYesNo(model.BluePrintPermit)) & _ | EmailRow("Print permit", EmailYesNo(model.BluePrintPermit)) & _ | ||||
| EmailRow("Permit ownership", LabelPermitOwnership(model.BluePermitOwnership)) & _ | EmailRow("Permit ownership", LabelPermitOwnership(model.BluePermitOwnership)) & _ | ||||
| EmailRow("Confirmed nonprofit status with USPS", LabelNonprofitStatus(model.BlueHasNonprofitStatus)) & _ | EmailRow("Confirmed nonprofit status with USPS", LabelNonprofitStatus(model.BlueHasNonprofitStatus)) & _ | ||||
| @@ -124,30 +124,6 @@ | |||||
| { value: "PermitOnly", text: "State of Michigan permit only" } | { value: "PermitOnly", text: "State of Michigan permit only" } | ||||
| ] | ] | ||||
| }, | }, | ||||
| { | |||||
| type: "boolean", name: "PurpleWantsBlueEnvelopes", labelTrue: "Yes", labelFalse: "No", | |||||
| title: "Are you planning to use KCI blue envelopes?", | |||||
| visibleIf: "{PurplePrintOption} = 'AddressesAndPermit'", | |||||
| isRequired: true | |||||
| }, | |||||
| { | |||||
| type: "radiogroup", name: "PurpleBlueProvider", | |||||
| title: "Who is your blue envelope provider?", | |||||
| visibleIf: "{PurpleWantsBlueEnvelopes} = false", | |||||
| isRequired: true, | |||||
| choices: [ | |||||
| { value: "ElectionSource", text: "ElectionSource" }, | |||||
| { value: "PSI", text: "PSI" }, | |||||
| { value: "Spectrum", text: "Spectrum" }, | |||||
| { value: "Other", text: "Other" } | |||||
| ] | |||||
| }, | |||||
| { | |||||
| type: "text", name: "PurpleBlueProviderOther", | |||||
| title: "Please specify your blue envelope provider", | |||||
| visibleIf: "{PurpleBlueProvider} = 'Other'", | |||||
| isRequired: true | |||||
| }, | |||||
| { | { | ||||
| type: "radiogroup", name: "PurplePrintStyle", | type: "radiogroup", name: "PurplePrintStyle", | ||||
| title: "Would you like your envelopes printed with color coding or black ink only?", | title: "Would you like your envelopes printed with color coding or black ink only?", | ||||
| @@ -209,17 +185,33 @@ | |||||
| { | { | ||||
| name: "blueEnvelope", | name: "blueEnvelope", | ||||
| title: "3. Blue AV Envelope Order Form", | title: "3. Blue AV Envelope Order Form", | ||||
| visibleIf: "{PurpleEnvelopeStock} <> 'OwnStock'", | |||||
| elements: [ | elements: [ | ||||
| { | { | ||||
| type: "boolean", name: "BlueWantsQuote", labelTrue: "Yes", labelFalse: "No", | type: "boolean", name: "BlueWantsQuote", labelTrue: "Yes", labelFalse: "No", | ||||
| title: "Would you like to purchase blue AV envelopes from KCI?", | title: "Would you like to purchase blue AV envelopes from KCI?", | ||||
| isRequired: true | isRequired: true | ||||
| }, | }, | ||||
| { | |||||
| type: "radiogroup", name: "PurpleBlueProvider", | |||||
| title: "Who is your blue envelope provider?", | |||||
| visibleIf: "{BlueWantsQuote} = false", | |||||
| isRequired: true, | |||||
| choices: [ | |||||
| { value: "ElectionSource", text: "ElectionSource" }, | |||||
| { value: "PSI", text: "PSI" }, | |||||
| { value: "Spectrum", text: "Spectrum" }, | |||||
| { value: "Other", text: "Other" } | |||||
| ] | |||||
| }, | |||||
| { | |||||
| type: "text", name: "PurpleBlueProviderOther", | |||||
| title: "Please specify your blue envelope provider", | |||||
| visibleIf: "{PurpleBlueProvider} = 'Other'", | |||||
| isRequired: true | |||||
| }, | |||||
| { | { | ||||
| type: "boolean", name: "BluePrintPermit", labelTrue: "Yes", labelFalse: "No", | type: "boolean", name: "BluePrintPermit", labelTrue: "Yes", labelFalse: "No", | ||||
| title: "Would you like KCI to print a permit on your blue envelope?", | title: "Would you like KCI to print a permit on your blue envelope?", | ||||
| visibleIf: "{BlueWantsQuote} = true", | |||||
| isRequired: true | isRequired: true | ||||
| }, | }, | ||||
| { | { | ||||
Powered by TurnKey Linux.