/* eslint-disable */ /* © 2026 K2B NETWORK SOLUTIONS LLC. All rights reserved. Proprietary and confidential. Unauthorized copying, distribution, or use of this file, via any medium, is strictly prohibited. Original work product. */ // K2B DMS — RC37 (lane forms37): THE DEALERSHIP'S OWN FORMS as DMS print templates — the 15 forms of the deal packet, in the packet's order. // Loaded right after printables.jsx (it uses K2BPrint, PrintKit.jsx.txt). Every form: // - fills from the deal on screen (the Buyer's Order on file + the selected deal + the unit + the trade + the lender) - or prints BLANK; // - prints the ACTIVE STORE's identity ONLY (K2BPrint.brand(): name, legal name, address, phone, dealer number, logo when one is set); // no store's name, address or number is ever written in this file; // - uses the store's own policy wording (store options.forms - Owner Panel > Stores > Options > Form wording; server lib/store-forms.js); // - never prints a Social Security number or a date of birth (those boxes always print EMPTY - the customer writes them). // Regulated wording (FTC Buyers Guide 16 CFR 455, the odometer statements 49 CFR 580, the Missouri DOR secure Power of Attorney) is kept // word for word. The DOR form is a SECURE form the State issues: the DMS prints only the DATA onto it (moOverlay, with this store's alignment // nudge) and a plain-paper copy marked "REFERENCE COPY - NOT VALID"; it never prints plain paper as if it were the form. // // K2BForms.print(key, { blank, data, deal, norm, extra }) one form (K2BPrint.doc - the store's colors, the Layout editor's settings) // K2BForms.packet(keys, { blank, ... }) several forms as ONE document, one form after the other // K2BForms.moOverlay({ guides }) the data for the DOR secure Power of Attorney (Form 5086) // K2BForms.entries() / owns(key) / printKeys() / packetKeys(ctx) / settings() / data(o) // Where the DMS already had the form (buyersOrder, billOfSale, odometer, buyerGuide, creditApp, weOweYouOwe, tradeAck, asIs, the MO POA / Buyers // Guide) the dealer's version is that form under the SAME key: the Forms list and the deal packet (Forms Sequencing printKey) print it. // The screens' own quick-print buttons (window.k2bPrintBuyersOrder / BillOfSale / Odometer / AsIs - the Buyer's Order screen, the desk's // Print menu) keep the K2B itemized layouts (cash-deal payments received, down payment assistance, lease lines, e-signature); the Forms // list shows them as "K2B classic". const K2BForms = (() => { const E = (s) => String(s == null ? "" : s).replace(/&/g, "&").replace(//g, ">").replace(/"/g, """).replace(/'/g, "'"); const up = (s) => String(s == null ? "" : s).trim().toUpperCase(); const has = (v) => v !== undefined && v !== null && String(v).trim() !== ""; const num = (v) => { if (!has(v)) return null; const n = parseFloat(String(v).replace(/[^0-9.\-]/g, "")); return isNaN(n) ? null : Math.round(n * 100) / 100; }; const pick = (...vals) => { for (const v of vals) if (has(v)) return v; return ""; }; const pickN = (...vals) => { for (const v of vals) { const n = num(v); if (n !== null) return n; } return null; }; const amt = (n) => n === null || n === undefined || n === "" ? "" : (n < 0 ? "(" : "") + Math.abs(+n).toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 }) + (n < 0 ? ")" : ""); const miles = (v) => { const n = num(v); return n === null ? "" : Math.round(n).toLocaleString("en-US"); }; const pad2 = (x) => String(x).padStart(2, "0"); const dashDate = (d) => pad2(d.getMonth() + 1) + "-" + pad2(d.getDate()) + "-" + d.getFullYear(); const slashDate = (d) => pad2(d.getMonth() + 1) + "/" + pad2(d.getDate()) + "/" + d.getFullYear(); const LONG_MONTHS = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; const STATE_NAMES = { AL: "Alabama", AK: "Alaska", AZ: "Arizona", AR: "Arkansas", CA: "California", CO: "Colorado", CT: "Connecticut", DE: "Delaware", DC: "District of Columbia", FL: "Florida", GA: "Georgia", HI: "Hawaii", ID: "Idaho", IL: "Illinois", IN: "Indiana", IA: "Iowa", KS: "Kansas", KY: "Kentucky", LA: "Louisiana", ME: "Maine", MD: "Maryland", MA: "Massachusetts", MI: "Michigan", MN: "Minnesota", MS: "Mississippi", MO: "Missouri", MT: "Montana", NE: "Nebraska", NV: "Nevada", NH: "New Hampshire", NJ: "New Jersey", NM: "New Mexico", NY: "New York", NC: "North Carolina", ND: "North Dakota", OH: "Ohio", OK: "Oklahoma", OR: "Oregon", PA: "Pennsylvania", RI: "Rhode Island", SC: "South Carolina", SD: "South Dakota", TN: "Tennessee", TX: "Texas", UT: "Utah", VT: "Vermont", VA: "Virginia", WA: "Washington", WV: "West Virginia", WI: "Wisconsin", WY: "Wyoming" }; /* ═══════════ the store's form settings (options.forms; defaults = the dealer's original wording) ═══════════ */ const TEXT_KEYS = ["fundingNotice", "weOwe", "damageAck", "insurance"]; const DEFAULT_TEXTS = { fundingNotice: "I guarantee all the information I provided to {name} is true and exact to my knowledge. I realize that it may take 1-4 weeks for funding to occur. I know that if my contract is not funded by the finance company I will have to surrender the vehicle back to {name}. A representative of {name} will notify me when the vehicle and title are to be taken to the license bureau to pay the sales tax. I will hold {name} with no responsibility of paying taxes or refunds unless otherwise specified in the contract. If vehicle is returned for any reason, there will be a {restock}% restocking fee.", weOwe: "The Buyer, By Signing Below accepts this We Owe with the Understanding that it is valid for (30) Thirty Days From Date of Issuance, and that the buyer must make an advanced appointment with the service department before the above can be performed.", damageAck: "I, the undersigned, hereby acknowledge that {legal}'s representative has disclosed to me before I agreed to purchase said vehicle that it has been damaged as follows:\n{damage}\n_____Vehicle has been inspected and is being purchased AS IS with all defects known and unknown.\nI further acknowledge that said damage has been repaired to my satisfaction.", insurance: "To provide protection against serious financial loss should an accident occur, I have arranged for insurance through the company shown below and have requested that the policy include a loss payee/mortgage endorsement in favor of {lender}. A $500 deductible or less is required.", }; const TEXT_LABELS = { fundingNotice: "Funding Notice (restocking fee)", weOwe: "We Owe (the 30-day line)", damageAck: "Damage acknowledgement", insurance: "Agreement to Provide Insurance" }; const clampMm = (v) => { const n = Number(v); return Number.isFinite(n) && n >= -20 && n <= 20 ? Math.round(n * 10) / 10 : 0; }; /** a store's options -> its form settings (stored = what the owner typed; texts = what prints) */ function settingsFrom(options) { const f = options && typeof options === "object" && options.forms && typeof options.forms === "object" ? options.forms : {}; const t = f.texts && typeof f.texts === "object" ? f.texts : {}; const pct = Number(f.restockPct); const stored = {}; const texts = {}; TEXT_KEYS.forEach((k) => { stored[k] = typeof t[k] === "string" ? t[k] : ""; texts[k] = stored[k].trim() ? stored[k] : DEFAULT_TEXTS[k]; }); return { restockPct: Number.isFinite(pct) && pct >= 0 && pct <= 100 ? pct : 15, dealerNoLabel: typeof f.dealerNoLabel === "string" ? f.dealerNoLabel.trim() : "", moNudge: { x: clampMm(f.moNudge && f.moNudge.x), y: clampMm(f.moNudge && f.moNudge.y) }, texts, stored }; } const settings = () => settingsFrom((window.K2BStore && window.K2BStore.options && window.K2BStore.options()) || {}); /* ═══════════ the active store's identity (K2BPrint - never typed here) ═══════════ */ function logoOf(b) { const st = window.K2BStore; if (!st || !b || !b.logo || typeof b.logo !== "object") return ""; // no logo set: the name only (never a stand-in picture) if (b.logo.kind === "asset") return st.logoUrl ? (st.logoUrl("large") || "") : ""; if (b.logo.kind === "upload") return (st.logoDataUrlNow && st.logoDataUrlNow()) || ""; // a print window cannot fetch it: the data: URL return ""; } function ident() { const b = window.K2BPrint ? window.K2BPrint.brand() : { dba: "", printName: "", legalName: "", colors: { primary: "#0E1430" } }; const S = settings(); const st = up(b.state); const label = S.dealerNoLabel || ((st ? st + " " : "") + "DEALER NO"); const csz = [b.city, [st, b.zip].filter(Boolean).join(" ")].filter(Boolean).join(", "); return { name: b.dba || b.printName || "", print: b.printName || b.dba || "", legal: b.legalName || b.dba || b.printName || "", addr1: b.addr1 || b.street || "", addr2: b.addr2 || csz, street: b.street || b.addr1 || "", city: b.city || "", state: st, zip: b.zip || "", csz: csz || b.addr2 || "", phone: b.phone || "", dealerNo: b.licenseNo || "", dealerNoLine: b.licenseNo ? label + " " + b.licenseNo : "", stateName: STATE_NAMES[st] || st, color: (b.colors && b.colors.primary) || "#0E1430", logo: logoOf(b), }; } /* ═══════════ the deal's data (one shape for every form) ═══════════ */ const party = () => ({ first: "", middle: "", last: "", name: "", street: "", city: "", state: "", zip: "", csz: "", phone: "", email: "" }); const vehicle = () => ({ stock: "", year: "", make: "", model: "", body: "", color: "", vin: "", miles: "", newUsed: "" }); function emptyData() { return { blank: true, dealId: "", date: "", dateSlash: "", day: "", month: "", year2: "", salesman: "", dealType: "", newUsed: "", buyer: party(), cobuyer: party(), veh: vehicle(), trades: [], m: {}, lender: { name: "", addr: "" }, weOwe: [], damage: [], dmgAsIs: false, ins: {}, odo: { exceeds: false, notActual: false, reason: "" }, poa: { titleNo: "" }, guide: {}, esign: null, disclosure: [] }; } const splitYMM = (s) => { const p = String(s || "").trim().split(/\s+/).filter(Boolean); const y = /^(19|20)\d\d$/.test(p[0] || "") ? p.shift() : ""; return { year: y, make: p.shift() || "", model: p.join(" ") }; }; const fullName = (p) => [p.first, p.middle, p.last].filter(has).join(" "); function finishParty(p) { const o = Object.assign(party(), p || {}); if (!o.name) o.name = fullName(o); if (!o.csz) o.csz = [o.city, [o.state, o.zip].filter(has).join(" ")].filter(has).join(", "); return o; } /** the date pieces of today (or of a given date) */ function stamp(d, when) { const t = when instanceof Date ? when : new Date(); d.date = dashDate(t); d.dateSlash = slashDate(t); d.day = String(t.getDate()); d.month = LONG_MONTHS[t.getMonth()]; d.year2 = String(t.getFullYear()).slice(2); return d; } /** the money lines every form uses, from the base figures (sale price, fees, tax, products, down, trade, rebate, finance terms) */ function money(m0, dealType, trades) { const m = Object.assign({}, m0); const z = (v) => (v === null || v === undefined || v === "" ? 0 : +v); const t1 = trades[0] || {}; if (m.tradeAllow === undefined || m.tradeAllow === null) m.tradeAllow = trades.reduce((s, t) => s + z(t.allowance), 0) || (t1.allowance === undefined ? null : z(t1.allowance)); if (m.tradePayoff === undefined || m.tradePayoff === null) m.tradePayoff = trades.reduce((s, t) => s + z(t.payoff), 0) || null; m.otherCharges = z(m.filing) + z(m.licTitle) + z(m.salesTax) + z(m.serviceContracts); m.totalDue = z(m.cashPrice) + m.otherCharges; m.netTrade = z(m.tradeAllow) - z(m.tradePayoff); m.totalDown = z(m.cashDown) + z(m.rebate) + m.netTrade; m.unpaid = Math.round((m.totalDue - m.totalDown) * 100) / 100; m.tradeDiff = z(m.cashPrice) - z(m.tradeAllow); m.netPrice = m.tradeDiff - z(m.rebate); if (dealType === "Retail") { m.amtFinanced = Math.round((m.unpaid + z(m.gap)) * 100) / 100; if (m.monthly !== null && m.monthly !== undefined && z(m.term) > 0) { m.totalPayments = Math.round(z(m.monthly) * z(m.term) * 100) / 100; m.financeCharge = Math.max(0, Math.round((m.totalPayments - m.amtFinanced) * 100) / 100); } } else { m.amtFinanced = null; } return m; } /** a ready data set (a test, the owner's preview, a fill dialog) in the shape above */ function fromNorm(n) { const d = stamp(Object.assign(emptyData(), JSON.parse(JSON.stringify(n || {}))), n && n.when ? new Date(n.when) : null); d.blank = false; d.buyer = finishParty(n.buyer); d.cobuyer = finishParty(n.cobuyer); d.veh = Object.assign(vehicle(), n.veh || {}); d.trades = (Array.isArray(n.trades) ? n.trades : []).slice(0, 2).map((t) => Object.assign(vehicle(), t)); d.lender = Object.assign({ name: "", addr: "" }, n.lender || {}); d.dealType = n.dealType || (/lease/i.test(n.dealType || "") ? "Lease" : d.lender.name ? "Retail" : "Cash"); d.newUsed = n.newUsed || d.veh.newUsed || ""; d.m = money(n.m || {}, d.dealType, d.trades); if (!Array.isArray(d.disclosure) || !d.disclosure.length) d.disclosure = defaultDisclosure(d.newUsed); return d; } const defaultDisclosure = (nu) => /used/i.test(nu || "") ? ["ALL SALES ARE FINAL", "INSPECTED AND PURCHASED AS IS"] : ["ALL SALES ARE FINAL"]; /** the data of the deal on screen: the Buyer's Order on file + the selected deal (+ its customer, unit, trade, lender) */ function fromSources(o) { const D = window.DMS; let deal = o.deal || null; if (!deal && !o.noDeal) { try { const id = localStorage.getItem("jb_fw_deal"); deal = id && D && D.deals ? ((D.deals() || []).find((x) => x && x.id === id) || null) : null; } catch (e) { deal = null; } } const boAll = (window.loadJbForm && window.loadJbForm("buyersOrder")) || {}; const boStock = up(boAll.stockNum || boAll.stock), dealStock = deal ? up(deal.stock) : ""; const bo = Object.assign({}, (!deal || !boStock || !dealStock || boStock === dealStock) ? boAll : {}, o.data || {}); // the order on file is this deal's only when it names the same unit const dl = deal || {}; const stock = String(pick(bo.stockNum, bo.stock, dl.stock)).trim(); const inv = (() => { try { if (!stock || !D) return {}; const u = D._unit ? D._unit(stock) : null; return u || ((D.inventory && D.inventory()) || []).find((v) => v && up(v.stock) === up(stock)) || {}; } catch (e) { return {}; } })(); const cust = (() => { try { return dl.custNum && D && D.customers ? (D.customers()[dl.custNum] || {}) : {}; } catch (e) { return {}; } })(); const d = stamp(emptyData()); d.blank = false; // purchaser (the deal's "LAST, FIRST" when the order has no name) const nm = String(dl.buyer || "").split(",").map((s) => s.trim()); d.buyer = finishParty({ first: pick(bo.firstName, nm[1]), middle: pick(bo.middle), last: pick(bo.lastName, nm[0]), street: pick(bo.street, cust.street, dl.street), city: pick(bo.city, cust.city, dl.city), state: pick(bo.state, cust.state, dl.state), zip: pick(bo.zip, cust.postal, cust.zip, dl.zip, dl.postal), phone: pick(bo.phone, cust.phone, cust.cell, dl.phone), email: pick(bo.email, cust.email, dl.email) }); const co = bo.coBuyer || dl.coBuyer || null; d.cobuyer = finishParty(typeof co === "string" ? { name: co } : co && typeof co === "object" ? { first: co.first || co.firstName, last: co.last || co.lastName, name: co.name, street: co.street, city: co.city, state: co.state, zip: co.zip, phone: co.phone } : {}); // the unit sold const ymm = splitYMM(pick(bo.yrMkMdl, dl.vehicle)); d.veh = { stock, year: pick(inv.yr, ymm.year), make: pick(inv.mk, ymm.make), model: pick(inv.mdl, ymm.model), body: pick(bo.body, inv.body, inv.type), color: pick(bo.color, inv.color, dl.color), vin: up(pick(bo.vin, inv.vin, dl.vin)), miles: pick(bo.odometer, inv.miles, dl.odometer), newUsed: pick(bo.newUsed, inv.newUsed, dl.type) }; d.newUsed = /used/i.test(d.veh.newUsed) ? "Used" : /new/i.test(d.veh.newUsed) ? "New" : String(d.veh.newUsed || ""); // the trade(s) const tymm = splitYMM(pick(bo.tradeYrMkMdl, dl.tradeVeh)); const t1 = { year: tymm.year, make: tymm.make, model: tymm.model, body: pick(bo.tradeBody, dl.tradeBody), color: pick(bo.tradeColor, dl.tradeColor), vin: up(pick(bo.tradeVin, dl.tradeVin)), miles: pick(bo.tradeMiles, dl.tradeMiles), lienholder: pick(bo.tradeLender, bo.tradeLien, dl.tradeLender), acct: pick(bo.tradeAcct, dl.tradeAcct), allowance: pickN(bo.tradeAllow, dl.tradeAllow), payoff: pickN(bo.tradePayoff, dl.tradePayoff) }; if (has(t1.vin) || has(t1.make) || (t1.allowance || 0) > 0) d.trades.push(Object.assign(vehicle(), t1)); // money const plans = [num(bo.serviceContract), num(bo.plan2Price), num(bo.plan3Price), num(bo.plan4Price), num(bo.plan5Price)].filter((x) => x !== null); const lender = pick(bo.lender, dl.lender); d.dealType = /lease/i.test(String(bo.dealType || dl.dealType || "")) ? "Lease" : has(lender) && !/^cash$/i.test(String(lender)) ? "Retail" : "Cash"; const m0 = { cashPrice: pickN(bo.salePrice, bo.price, dl.salePrice), filing: pickN(bo.docFee, dl.docFee), licTitle: (pickN(bo.license, dl.titleFee) || 0) + (num(bo.lenderFeeCust) || 0), salesTax: pickN(bo.salesTax, dl.tax), serviceContracts: plans.length ? plans.reduce((s, x) => s + x, 0) : pickN(dl.vscSale), gap: pickN(bo.gapIns, dl.gapSale), cashDown: pickN(bo.cashDown, dl.cashDown), rebate: pickN(bo.rebate, dl.rebate), tradeAllow: pickN(bo.tradeAllow, dl.tradeAllow), tradePayoff: pickN(bo.tradePayoff, dl.tradePayoff), apr: pick(bo.apr, dl.apr, dl.rate), term: pickN(bo.term, dl.term), monthly: d.dealType === "Lease" ? null : pickN(bo.payment, dl.payment), firstDue: pick(bo.firstDue, dl.firstDue, dl.firstPayment), leaseDue: pickN(bo.dueAtSigning), leaseMonthly: pickN(bo.monthlyPayment, d.dealType === "Lease" ? dl.payment : null), leaseTerm: pick(bo.leaseTerm, d.dealType === "Lease" ? dl.term : "") }; d.m = money(m0, d.dealType, d.trades); const lh = bo.lienholder && typeof bo.lienholder === "object" ? bo.lienholder : null; d.lender = { name: d.dealType === "Cash" ? "" : String(lender || (lh && lh.name) || ""), addr: lh ? [lh.address, [lh.city, lh.state].filter(has).join(", "), lh.zip].filter(has).join(", ") : "" }; d.dealId = String(pick(dl.id, bo.dealId, bo.orderNum)); d.salesman = String(pick(bo.salesperson, dl.salesperson)); d.weOwe = (Array.isArray(dl.costAdds) ? dl.costAdds : []).filter((l) => l && (l.type === "weOwe" || l.weOwe === true) && l.type !== "dpa" && l.type !== "lenderFee").map((l) => String(l.desc || "")).filter(has); if (!d.weOwe.length && has(bo.weOwe)) d.weOwe = String(bo.weOwe).split(/\n+/).map((s) => s.trim()).filter(Boolean); d.esign = /^data:image\/(png|jpeg);base64,[A-Za-z0-9+/=]+$/.test(String(bo.esignSignature || "")) ? { img: bo.esignSignature, name: String(bo.esignName || ""), at: String(bo.esignAt || "") } : null; d.disclosure = has(bo.disclosure) ? String(bo.disclosure).split(/\n+/) : defaultDisclosure(d.newUsed); return d; } /** the fill dialog's extra answers (damage lines, insurance, title number, odometer boxes) */ function withExtra(d, x) { if (!x || typeof x !== "object" || d.blank) return d; const dmg = [x.damage1, x.damage2, x.damage3].filter(has).map(String); if (dmg.length) d.damage = dmg; if (x.dmgAsIs !== undefined) d.dmgAsIs = !!x.dmgAsIs; const ins = {}; ["agentName", "agentAddr", "agentCsz", "agentPhone", "company", "policy", "effective", "deductible"].forEach((k) => { if (has(x[k])) ins[k] = String(x[k]); }); if (x.comp !== undefined) ins.comp = !!x.comp; if (x.coll !== undefined) ins.coll = !!x.coll; d.ins = Object.assign({}, d.ins, ins); if (has(x.titleNo)) d.poa = Object.assign({}, d.poa, { titleNo: String(x.titleNo) }); if (x.odoExceeds !== undefined) d.odo.exceeds = !!x.odoExceeds; if (x.odoNotActual !== undefined) d.odo.notActual = !!x.odoNotActual; if (has(x.odoReason)) d.odo.reason = String(x.odoReason); return d; } function data(o) { o = o || {}; if (o.blank) return emptyData(); // nothing of any customer: every box empty, the store's header only const d = o.norm ? fromNorm(o.norm) : fromSources(o); return withExtra(d, o.extra); } /* ═══════════ print pieces ═══════════ */ const css = (I) => ``; /** the store header: logo (only when the store has one), name, address, phone, dealer number - every value from the store's branding. o.compact: one band (small logo, name, one line) for the long forms that must stay on one page */ const head = (I, o) => (o && o.compact) ? `
${I.logo ? `` : ""}
${E(I.print)}
${E([[I.addr1, I.addr2].filter(has).join(", "), I.phone, I.dealerNoLine].filter(has).join(" · "))}
` : `
${I.logo && !(o && o.noLogo) ? `` : ""}
${E(I.print)}
${E([I.addr1, I.addr2].filter(has).join(", "))}
${I.phone ? `
${E(I.phone)}
` : ""}${I.dealerNoLine ? `
${E(I.dealerNoLine)}
` : ""}
`; const V = (d, x) => (d.blank ? "" : E(x)); const M = (d, n) => (d.blank ? "" : E(amt(n))); const U = (d, x, w) => `${d.blank ? "" : `${E(x)}`}`; const mrow = (label, val, b) => `
${label}$${val}
`; const xsig = (label, date) => `
X${date !== undefined ? `${E(date)}` : ""}
${label}
`; const line = (k, v, w) => `
${k}${v}
`; const chk = (on) => `${on ? "X" : ""}`; /** the store's wording with its placeholders filled ({name} {legal} {restock} {lender}; {damage} = the damage lines) */ function wording(raw, I, S, d, extra) { const rep = { name: I.name, legal: I.legal, restock: String(S.restockPct).replace(/\.0+$/, ""), lender: d.blank ? "" : d.lender.name }; return String(raw || "").split(/\n+/).filter((l) => l.trim()).map((l) => { if (l.trim() === "{damage}") return (extra && extra.damage) || ""; const h = E(l).replace(/\{(name|legal|restock|lender)\}/g, (m0, k) => k === "lender" ? (rep.lender ? `${E(rep.lender)}` : ``) : E(rep[k])); return `

${h}

`; }).join(""); } const sold = (d) => d.veh; const ymm = (v) => [v.year, v.make, v.model].filter(has).join(" "); const odoUnit = (d) => (d.trades[0] && (has(d.trades[0].vin) || has(d.trades[0].make)) ? { v: d.trades[0], trade: true } : { v: d.veh, trade: false }); /* ═══════════ the 15 forms (the order of the dealer's deal packet) ═══════════ */ // 1 BUYERS ORDER function buyersOrder(d, I, S) { const b = d.buyer, v = d.veh, m = d.m; const lease = d.dealType === "Lease"; const vr = (lab, x) => `${lab}${V(d, x.stock)}${V(d, x.year)}${V(d, x.make)}${V(d, x.model)}${V(d, x.color)}${V(d, x.vin)}${V(d, miles(x.miles))}`; const rows = [vr(d.blank ? "" : "SOLD", v)].concat(d.trades.map((t) => vr("TRADE", t))); while (rows.length < 3) rows.push(`${"".repeat(8)}`); const weOwe = d.blank ? "" : d.weOwe.length ? d.weOwe.map((w, i) => `${i + 1}. ${E(w)}`).join("
") : "Nothing owed and Nothing promised."; const apr = !d.blank && has(m.apr) ? E(m.apr) : ""; const fin = lease ? `${mrow("Lease - Due at Signing", M(d, m.leaseDue))}${mrow("Monthly Payment (incl. tax)", M(d, m.leaseMonthly))}
Term (months)${V(d, m.leaseTerm)}
` : `${mrow("Credit Insurance/GAP", M(d, m.gap))}${mrow("Amount Financed", d.dealType === "Cash" ? "" : M(d, m.amtFinanced))}${mrow(`Finance Charge @ ${apr}`, M(d, m.financeCharge))}${mrow("Total Of Payments", M(d, m.totalPayments))}`; return `
${head(I)}
BUYERS ORDER
SOLD TO:
${d.blank ? "" : [E(b.name), E(b.street), E(b.csz), E(b.phone), d.cobuyer.name ? E(d.cobuyer.name) : ""].filter(Boolean).join("
")}
DOB:
DOB:
DEAL: ${U(d, d.dealId, "1.2in")}
DATE: ${U(d, d.date, "1.2in")}
SALESMAN ${U(d, d.salesman, "1.2in")}
E-Mail: ${U(d, b.email, "2.6in")}
${rows.join("")}
Stock #YearMakeModelColorVINMiles
The information you see on Buyers Guide for this vehicle is part of this contract. Information on the Buyers Guide overrides any contrary provision in the contract of sale.
WE OWE: ${weOwe}
RECALL NOTICE: This vehicle may have or may not have recalls. Please contact the manufacturer of this vehicle to check for possible recalls.
${mrow("Cash Price", M(d, m.cashPrice), true)}
${mrow("Filing Fees", M(d, m.filing))}${mrow("Lic/Title/Reg/Other", M(d, m.licTitle))}${mrow("Sales Tax", M(d, m.salesTax))}${mrow("Service Contracts", M(d, m.serviceContracts))} ${mrow("Total Other Charges", M(d, m.otherCharges), true)}${mrow("Total Amount Due", M(d, m.totalDue), true)}
Disclosure
${d.blank ? "" : d.disclosure.map(E).join("
")}
${mrow("Cash Down", M(d, m.cashDown))}${mrow("Total Down Payment", M(d, m.totalDown))}${mrow("Unpaid Balance", M(d, m.unpaid), true)}
${fin}
Lien - ${lease ? "" : V(d, d.lender.name)}
${lease ? (d.blank ? "" : "LESSOR " + V(d, d.lender.name)) : `MONTHLY of ${d.blank || m.monthly === null || m.monthly === undefined ? "" : `$${E(amt(m.monthly))}`} begin ${V(d, m.firstDue)}`}
${d.esign ? `
signature
Signed electronically ${E(d.esign.name)} ${E(d.esign.at ? new Date(d.esign.at).toLocaleString() : "")}
` : ""} ${xsig("BUYER")}${xsig("BUYER")}${xsig("SELLER")}
`; } // 2 BILL OF SALE - STATEMENT OF CONSIDERATION PAID + ODOMETER DISCLOSURE STATEMENT function billOfSale(d, I, S) { const b = d.buyer, v = d.veh, m = d.m; const vr = (lab, x) => `${lab}${V(d, x.year)}${V(d, x.make)}${V(d, x.model)}${V(d, x.body)}${V(d, x.color)}${V(d, x.stock)}${V(d, x.vin)}${V(d, miles(x.miles))}`; const tr = [0, 1].map((i) => vr("TRADE", d.trades[i] || vehicle())); return `
${head(I)}
BILL OF SALE - STATEMENT OF CONSIDERATION PAID
SOLD TO:
${d.blank ? "" : [E(b.name), E(b.street), E(b.csz)].filter(Boolean).join("
")}
DEAL: ${U(d, d.dealId, "1.2in")}
DATE: ${U(d, d.date, "1.2in")}
SALESMAN ${U(d, d.salesman, "1.2in")}
${vr("SOLD", v)}${tr.join("")}
YearMakeModelBodyColorStock #VINMiles
${mrow("CASH PRICE", M(d, m.cashPrice))}${mrow("TRADE ALLOWANCE", M(d, m.tradeAllow))}${mrow("TRADE DIFFERENCE", M(d, m.tradeDiff))}${mrow("REBATE", M(d, m.rebate))}${mrow("NET PRICE", M(d, m.netPrice))}

WARNING: It is a FELONY for any taxpayer to willfully attempt to evade or to defeat the payment of any tax, penalty or interest due under state law; OR for any person to willfully assist a taxpayer in evading or defeating the payment of any tax, penalty or interest due under state law.

ODOMETER DISCLOSURE STATEMENT
YearMakeModelBodyColorVIN
${V(d, v.year)}${V(d, v.make)}${V(d, v.model)}${V(d, v.body)}${V(d, v.color)}${V(d, v.vin)}

FEDERAL AND STATE LAW REQUIRES THAT YOU STATE THE MILEAGE UPON TRANSFER OF OWNERSHIP
FAILURE TO COMPLETE OR PROVIDING A FALSE STATEMENT MAY RESULT IN FINES AND/OR IMPRISONMENT

I, ${E(I.print)} state that the odometer now reads ${U(d, miles(v.miles), "1in")} (no tenths) miles and to the best of my knowledge that it reflects the actual mileage of the SOLD vehicle described above. UNLESS one of the items below is checked:

(1)${d.odo.exceeds ? "X" : ""} I hereby certify that to the best of my knowledge the odometer reading reflects the amount of mileage in excess of its mechanical limits
(2)${d.odo.notActual ? "X" : ""} I hereby certify that the odometer reading is not the actual mileage.
WARNING - ODOMETER DISCREPANCY

Date of transfer: ${U(d, d.date, "1in")}   Transferor (seller): ${E(I.print)}, ${E([I.addr1, I.addr2].filter(has).join(", "))}   Transferee (buyer): ${U(d, [b.name, b.street, b.csz].filter(has).join(", "), "2.4in")}

${xsig("BUYER")}${xsig("BUYER")}
${xsig("SELLER")}
`; } // 3 ODOMETER MILEAGE STATEMENT (the trade-in when there is one: the customer is the transferor; else the unit sold) function odometer(d, I, S) { const u = odoUnit(d), v = u.v, b = d.buyer; const tor = d.blank ? party() : u.trade ? b : { name: I.legal, street: I.street, city: I.city, state: I.state, zip: I.zip }; const tee = d.blank ? party() : u.trade ? { name: I.legal, street: I.street, city: I.city, state: I.state, zip: I.zip } : b; const addr = (p) => `
${p.k}'s Address${V(d, p.p.street)}
(Street)
${V(d, p.p.city)}${V(d, p.p.state)}${V(d, p.p.zip)}
(City)(State)(Zip Code)
`; return `
${head(I)}
ODOMETER MILEAGE STATEMENT

Federal law (and State law, if applicable) requires that you state the mileage upon transfer of ownership. Failure to complete or the making of a false statement may result in fines and/or imprisonment.

I, ${V(d, tor.name)} state that the odometer now reads ${V(d, miles(v.miles))}
Transferor's Name — Printno tenths
miles and to the best of my knowledge that it reflects the actual mileage of the vehicle described below, unless one of the following statements is checked.

${chk(d.odo.exceeds)} (1) I hereby certify that to the best of my knowledge the odometer reading reflects the amount of mileage in excess of its mechanical limits.

${chk(d.odo.notActual)} (2) I hereby certify that the odometer reading is NOT the actual mileage.

WARNING — ODOMETER DISCREPANCY

${line("Make", `${V(d, v.make)}`)}${line("Model", `${V(d, v.model)}`)}${line("Body Type", `${V(d, v.body)}`)}${line("Vehicle Identification Number", `${V(d, v.vin)}`)}${line("Year", `${V(d, v.year)}`)} ${line("Transferor's Name", `${V(d, tor.name)}`)}${addr({ k: "Transferor", p: tor })}${line("Transferor's Signature", "")}${line("Date of Statement", `${V(d, d.date)}`)} ${line("Transferee's Name", `${V(d, tee.name)}`)}${addr({ k: "Transferee", p: tee })}${line("Transferee's Signature", "")}
`; } // 4 FTC BUYERS GUIDE (16 CFR 455 - the federal wording, front and back; the dealer's identity is on the back, as the rule places it) function buyerGuide(d, I, S) { const v = d.veh, g = d.guide || {}; const used = /used/i.test(d.newUsed); const asIs = d.blank ? false : g.asIs !== undefined ? !!g.asIs : used; const svc = d.blank ? false : g.svc !== undefined ? !!g.svc : true; const bx = (on, big) => `${on ? "X" : ""}`; const sysRows = Array.from({ length: 4 }).map(() => `
`).join(""); const DEFECTS = [ ["Frame & Body", ["Frame-cracks, corrective welds, or rusted through", "Dogtracks—bent or twisted frame"]], ["Engine", ["Oil leakage, excluding normal seepage", "Cracked block or head", "Belts missing or inoperable", "Knocks or misses related to camshaft lifters and push rods", "Abnormal exhaust discharge"]], ["Transmission & Drive Shaft", ["Improper fluid level or leakage, excluding normal seepage", "Cracked or damaged case which is visible", "Abnormal noise or vibration caused by faulty transmission or drive shaft", "Improper shifting or functioning in any gear", "Manual clutch slips or chatters"]], ["Differential", ["Improper fluid level or leakage, excluding normal seepage", "Cracked or damaged housing which is visible", "Abnormal noise or vibration caused by faulty differential"]], ["Cooling System", ["Leakage including radiator", "Improperly functioning water pump"]], ["Electrical System", ["Battery leakage", "Improperly functioning alternator"]], ["Fuel System", ["Visible leakage"]], ["Inoperable Accessories", ["Gauges or warning devices", "Air conditioner", "Heater & Defroster"]], ["Brake System", ["Failure warning light broken", "Pedal not firm under pressure (DOT spec.)", "Not enough pedal reserve (DOT spec.)", "Does not stop vehicle in straight line (DOT spec.)", "Hoses damaged", "Drum or rotor too thin (Mfgr. Specs)", "Lining or pad thickness less than 1/32 inch", "Power unit not operating or leaking", "Structural or mechanical parts damaged"]], ["Steering System", ["Too much free play at steering wheel (DOT specs.)", "Free play in linkage more than 1/4 inch", "Steering gear binds or jams", "Front wheels aligned incorrectly (DOT specs.)", "Power unit belts cracked or slipping", "Power unit fluid level improper"]], ["Suspension System", ["Ball joint seals damaged", "Structural parts bent or damaged", "Stabilizer bar disconnected", "Spring broken", "Shock absorber mounting loose", "Rubber bushings damaged or missing", "Radius rod damaged or missing", "Shock absorber leaking or functioning improperly"]], ["Tires", ["Tread depth less than 2/32 inch", "Sizes mismatched", "Visible damage"]], ["Wheels", ["Visible cracks, damage or repairs", "Mounting bolts loose or missing"]], ["Exhaust System", ["Leakage"]], ]; const half = (a) => a.map(([h, l]) => `
${E(h)}${l.map((x) => `
${E(x)}
`).join("")}
`).join(""); return `
BUYERS GUIDE
IMPORTANT: Spoken promises are difficult to enforce. Ask the dealer to put all promises in writing. Keep this form.
${V(d, v.make)}
${V(d, v.model)}
${V(d, v.year)}
${V(d, v.vin)}
VEHICLE MAKE
MODEL
YEAR
VEHICLE IDENTIFICATION NUMBER (VIN)
WARRANTIES FOR THIS VEHICLE:
${bx(asIs, true)} AS IS - NO DEALER WARRANTY
THE DEALER DOES NOT PROVIDE A WARRANTY FOR ANY REPAIRS AFTER SALE.
${bx(!!g.warranty && !d.blank, true)} DEALER WARRANTY
${bx(!!g.full && !d.blank)} FULL WARRANTY.
${bx(!!g.limited && !d.blank)}LIMITED WARRANTY. The dealer will pay  ${V(d, g.labor) || "   "} % of the labor and  ${V(d, g.parts) || "   "} % of the parts for the covered systems that fail during the warranty period. Ask the dealer for a copy of the warranty, and for any documents that explain warranty coverage, exclusions, and the dealer's repair obligations. Implied warranties under your state's laws may give you additional rights.
SYSTEMS COVERED:
DURATION:
${V(d, g.systems)}
${V(d, g.duration)}
${sysRows}
NON-DEALER WARRANTIES FOR THIS VEHICLE:
${bx(!!g.mfr && !d.blank)} MANUFACTURER'S WARRANTY STILL APPLIES. The manufacturer's original warranty has not expired on some components of the vehicle.
${bx(!!g.mfrUsed && !d.blank)} MANUFACTURER'S USED VEHICLE WARRANTY APPLIES.
${bx(!!g.otherUsed && !d.blank)} OTHER USED VEHICLE WARRANTY APPLIES.
Ask the dealer for a copy of the warranty document and an explanation of warranty coverage, exclusions, and repair obligations.
${bx(svc)} SERVICE CONTRACT. A service contract on this vehicle is available for an extra charge. Ask for details about coverage, deductible, price, and exclusions. If you buy a service contract within 90 days of your purchase of this vehicle, implied warranties under your state's laws may give you additional rights.
ASK THE DEALER IF YOUR MECHANIC CAN INSPECT THE VEHICLE ON OR OFF THE LOT.
OBTAIN A VEHICLE HISTORY REPORT AND CHECK FOR OPEN SAFETY RECALLS. For information on how to obtain a vehicle history report, visit ftc.gov/usedcars. To check for open safety recalls, visit safercar.gov. You will need the vehicle identification number (VIN) shown above to make the best use of the resources on these sites.
SEE OTHER SIDE for important additional information, including a list of major defects that may occur in used motor vehicles.
Si el concesionario gestiona la venta en español, pídale una copia de la Guía del Comprador en español.
Here is a list of some major defects that may occur in used vehicles.
${half(DEFECTS.slice(0, 7))}
${half(DEFECTS.slice(7))}
DEALER NAME${E(I.print)}
ADDRESS${E([I.addr1, I.addr2].filter(has).join(", "))}
FOR COMPLAINTS AFTER SALE, CONTACT:${E([I.print, I.phone].filter(has).join(" "))}
IMPORTANT: The information on this form is part of any contract to buy this vehicle. Removal of this label before consumer purchase (except for purpose of test-driving) violates federal law (16 C.F.R. 455).
`; } // 5 MISSOURI DOR SECURE POWER OF ATTORNEY (Form 5086) - the plain-paper REFERENCE COPY (the real one is the DOR's secure paper: moOverlay) function poaData(d, I) { const t = d.trades[0] || vehicle(), b = d.buyer; return { vin: t.vin, year: t.year, make: t.make, model: t.model, body: t.body, titleNo: d.poa.titleNo || "", appoint: I.legal, odometer: miles(t.miles), date: d.dateSlash, sellerStreet: b.street, sellerCsz: b.csz, purchStreet: I.street, purchCsz: I.csz, exceeds: d.odo.exceeds, notActual: d.odo.notActual, reason: d.odo.reason }; } function moSecurePoa(d, I, S) { const p = d.blank ? {} : poaData(d, I); const c = (lab, val, w) => `
${lab}
${E(val || "")}
`; return `
${head(I, { compact: true })}
REFERENCE COPY - NOT VALID
REFERENCE COPY - NOT VALID · The State's secure form (DOR Form 5086) must be used. This plain-paper copy only shows what the DMS prints onto it.
MISSOURI DEPARTMENT OF REVENUE
MOTOR VEHICLE BUREAU
SECURE POWER OF ATTORNEY
FORM
5086
(REV. 05-2013)
A Secure Power of Attorney may only be used with a conforming title if: 1) The purchaser is signing on behalf of the seller on the first assignment, and the seller is signing on behalf of the purchaser on the second assignment and Part B of the form is completed, and 2) The conforming title is a duplicate or the conforming title is being held by the lienholder.
PART A - POWER OF ATTORNEY TO DISCLOSE MILEAGE OR TRANSFER OWNERSHIP
${c("VEHICLE IDENTIFICATION NUMBER", p.vin, "45%")}${c("YEAR", p.year)}${c("MAKE", p.make)}${c("TITLE NUMBER", p.titleNo)}${c("MODEL", p.model)}${c("BODY STYLE", p.body)}
FEDERAL LAW REQUIRES THAT YOU STATE THE MILEAGE UPON TRANSFER OF OWNERSHIP. PROVIDING A FALSE STATEMENT MAY RESULT IN FINES AND/OR IMPRISONMENT.
I appoint ${E(p.appoint || "")} as my attorney-in-fact, to apply for a duplicate title if needed, and to sign the title on the above referenced vehicle for the purpose of transferring ownership and to disclose the mileage on the title for the vehicle described above exactly as stated in my following disclosure. I state that the odometer now reads as indicated below and to the best of my knowledge that it reflects the actual mileage unless one of the following statements is checked.
PURCHASER'S PRINTED NAME
${c("ODOMETER READING (NO TENTHS)", p.odometer, "28%")}${c("DATE OF STATEMENT (MM/DD/YYYY)", p.date)}${c("SELLER'S SIGNATURE", "")}${c("SELLER'S HAND PRINTED NAME", "")}${c("STREET ADDRESS", p.sellerStreet)}${c("CITY, STATE, ZIP CODE", p.sellerCsz)}${c("PURCHASER'S SIGNATURE", "")}${c("PURCHASER'S HAND PRINTED NAME", "")}${c("STREET ADDRESS", p.purchStreet)}${c("CITY, STATE, ZIP CODE", p.purchCsz)}
${chk(p.exceeds)} THE MILEAGE STATED IS IN EXCESS OF MECHANICAL LIMITS.
${chk(p.notActual)} THE ODOMETER READING IS NOT THE ACTUAL MILEAGE.
REASON REQUIRED: ${E(p.reason || "")}
ALL SELLERS MUST SIGN AND HAND PRINT THEIR NAMES IN THE SPACE PROVIDED.
IF MULTIPLE PURCHASERS ARE INVOLVED, ONLY ONE PURCHASER IS REQUIRED TO SIGN THE FORM AND HAND PRINT HIS/HER NAME.
Anytime a Secure Power of Attorney is used, the Missouri purchasing dealer must either: 1) Apply for title in the dealership's name, submitting the Secure Power of Attorney with their application for title; or 2) Give the subsequent purchaser a copy of the Secure Power of Attorney which must then accompany the certificate of title. (By submitting the power of attorney form along with a copy of the front and back of the corresponding Certificate of Title and the dealer's monthly sales reports, the dealer may avoid retitling the vehicle.) If the dealer's monthly sales reports are filed electronically, the power of attorney forms and title copies must be submitted to the Motor Vehicle Bureau by the fifteenth day of the month following the month in which the sales occurred. If you have any questions, please call the Motor Vehicle Bureau at (573) 526-3669.
PART B - REVIEW TITLE DOCUMENTS
To be completed only when the dealership is selling the vehicle before the title is received. Federal and state laws require you to state the mileage upon transfer of ownership. Failure to complete or providing a false statement may result in fines and/or imprisonment.
I , appoint as my attorney-in-fact, to sign the mileage disclosure on the title for the vehicle described above only if the disclosure is exactly as the disclosure completed below.
PURCHASER'S PRINTED NAMEDEALERSHIP'S PRINTED NAME
${c("PURCHASER'S SIGNATURE (NEW BUYER) / DATE", "")}${c("PURCHASER'S HAND PRINTED NAME (NEW BUYER)", "")}${c("PURCHASER'S STREET ADDRESS (NEW BUYER)", "")}${c("PURCHASER'S CITY, STATE, ZIP CODE (NEW BUYER)", "")}
I , state that the odometer reads (no tenths) miles and, to the best of my knowledge, that it reflects the actual mileage unless one of the following statements is checked.
DEALERSHIP'S PRINTED NAME AS SHOWN IN PART A ABOVE
${chk(false)} 1. The mileage stated is in excess of its mechanical limits.   ${chk(false)} 2. The odometer reading is NOT the actual mileage — WARNING Odometer Discrepancy
${c("SELLER'S (DEALERSHIP'S AGENT) SIGNATURE / DATE", "")}${c("SELLER'S (DEALERSHIP'S AGENT) HAND PRINTED NAME AS SHOWN IN PART A ABOVE", "")}${c("SELLER'S (DEALERSHIP'S) STREET ADDRESS", "")}${c("SELLER'S (DEALERSHIP'S) CITY, STATE, ZIP CODE", "")}
PART C - CERTIFICATION
CERTIFICATION (To be completed ONLY after Part A and Part B have been completed.) I, , hereby certify that the mileage I have disclosed on the title document is consistent with that provided to me in the above power of attorney. Further, upon examination of the title and any reassignment documents for the vehicle described above, the mileage disclosure I have made on the title pursuant to the power of attorney is greater than that previously stated on the title and reassignment documents. This certification is not intended to create, nor does it create any new or additional liability under Federal or State Law.
PRINTED NAME OF PERSON EXERCISING POWER OF ATTORNEY FOR DEALERSHIP
${c("SIGNATURE OF PERSON IN PART C EXERCISING POWER OF ATTORNEY", "")}${c("DEALERSHIP'S STREET ADDRESS", "")}${c("DEALERSHIP'S CITY, STATE, ZIP CODE", "")}
WEBSITE ADDRESS: http://dor.mo.gov/ · THE ORIGINAL SECURE DOCUMENT MUST BE SUBMITTED. It is recommended that you retain a copy for your records. · DOR-5086 (05-2013)
`; } // 6 ACKNOWLEDGEMENT OF DISCLOSURE BY DEALER OF DAMAGE TO MOTOR VEHICLE (the store's wording) function damageAck(d, I, S) { const v = d.veh; const lines = (d.blank || !d.damage.length ? ["", "", ""] : d.damage.concat(["", "", ""]).slice(0, Math.max(3, d.damage.length))).map((x) => `
${E(x)}
`).join(""); const body = wording(S.texts.damageAck, I, S, d, { damage: lines }).replace("

_____Vehicle", `

${!d.blank && d.dmgAsIs ? "X" : ""}Vehicle`); const hasDmg = /\{damage\}/.test(S.texts.damageAck); return `

${head(I)}
Acknowledgement of Disclosure by Dealer
Of Damage to Motor Vehicle

In connection with the purchase of the motor vehicle purchased from ${E(I.legal)}, as described below:

Year ${U(d, v.year, "1.3in")}
Make ${U(d, v.make, "1.5in")}
Type ${U(d, [v.model, v.body].filter(has).join(" "), "1.5in")}
VIN ${U(d, v.vin, "3in")}
Stock No. ${U(d, v.stock, "1.4in")}
${body}
${hasDmg ? "" : lines}
Date ${U(d, d.date, "2.4in")}
Signature of purchaser
Witness
`; } // 7 FUNDING NOTICE (the store's wording + its restocking percent) function fundingNotice(d, I, S) { const v = d.veh; const nm = (x) => x ? E(x) : ""; return `
${head(I)}
Funding Notice

I understand that the ${U(d, ymm(v), "2.2in")} vin ${U(d, v.vin, "2.4in")} I have purchased from ${nm(I.name)} on ${U(d, d.date, "1.4in")} is not a completed deal until the finance company ${U(d, d.lender.name, "2.6in")} has funded the deal.

${wording(S.texts.fundingNotice, I, S, d)}
Name
Date
Name
Date
Witness
Date
`; } // 8 TITLE RECEIVED CONFIRMATION (the store's logo large; no logo = the store's name) function titleReceived(d, I, S) { const big = I.logo ? `
${E(I.print)}
` : `
${E(I.print)}
`; return `
${big}
${E([I.addr1, I.addr2].filter(has).join(", "))}${I.phone ? " · " + E(I.phone) : ""}${I.dealerNoLine ? " · " + E(I.dealerNoLine) : ""}
TITLE RECEIVED CONFIRMATION

Date: ${U(d, d.date, "1.6in")}

Confirmation that you have received the title to the vehicle you are purchasing

Vin: ${U(d, d.veh.vin, "3.4in")}

From ${E(I.name)}, please sign below:

Customer:
Dealer:
`; } // 9 TITLE RECEIPT FORM function titleReceipt(d, I, S) { const v = d.veh, b = d.buyer; const L = (k, x, w) => `
${k}: ${U(d, x, w || "2.2in")}
`; return `
${head(I)}
Title Receipt Form

I, the undersigned, hereby acknowledge receipt of the vehicle title from ${E(I.name)} for the vehicle described below.

Vehicle Information:

${L("Make", v.make)}${L("Model", v.model)}${L("Year", v.year)}${L("VIN", v.vin, "3in")}

Customer Information:

${L("Name", b.name, "3in")}${L("Address", [b.street, b.csz].filter(has).join(", "), "3.6in")}${L("Phone Number", b.phone)}

I confirm that I have received the title for the above-mentioned vehicle.

Customer Signature:
Date: ${U(d, d.date, "2.2in")}

Dealer Representative:

${L("Name", "")}
`; } // 10 CREDIT AUTHORIZATION FORM - the SSN and date-of-birth boxes ALWAYS print EMPTY (the customer writes them; the DMS never prints an SSN) function creditAuth(d, I, S) { const b = d.buyer; const L = (k, x, w, attr) => `
${k}: ${U(d, x, w || "2.4in")}
`; return `
${head(I)}
Credit Authorization Form

I, the undersigned, hereby authorize ${E(I.name)} to obtain my credit report for the purpose of evaluating my creditworthiness in connection with my application for financing and/or purchasing a vehicle.

Customer Information:

${L("Name", b.name, "3in")}${L("Address", [b.street, b.csz].filter(has).join(", "), "3.6in")}${L("Phone Number", b.phone)}
Social Security Number:
Date of Birth:

I understand that this inquiry may appear on my credit report and that ${E(I.name)} may share my credit information with various financial institutions for the purpose of obtaining financing on my behalf.

Customer Signature:
Date: ${U(d, d.date, "2.2in")}

Dealer Representative:

${L("Name", "")}
Signature:
${L("Date", "")}
`; } // 11 AUTHORIZATION FOR TITLE AND LIEN TRANSFER (the trade-in) function titleLienAuth(d, I, S) { const b = d.buyer, t = d.trades[0] || vehicle(); const L = (k, x, w) => `
${k}: ${U(d, x, w || "2.4in")}
`; return `
${head(I)}
Authorization for Title and Lien Transfer

I, the undersigned, hereby authorize ${E(I.name)} to receive the title and lien for the trade-in vehicle listed below.

Vehicle Information:

${L("VIN", t.vin, "3in")}

I acknowledge that this authorization permits ${E(I.name)} to process all necessary paperwork to complete the title and lien transfer for the above-mentioned vehicle.

Customer Information:

${L("Name", b.name, "3in")}${L("Address", [b.street, b.csz].filter(has).join(", "), "3.6in")}${L("Phone Number", b.phone)}
Customer Signature:
Date: ${U(d, d.date, "2.2in")}

Dealer Representative:

${L("Name", "")}
Signature:
${L("Date", "")}
`; } // 12 SOLD AS-IS, NO WARRANTY AGREEMENT function asIs(d, I, S) { const b = d.buyer, v = d.veh; const P = (k, x) => `
${k}: ${U(d, x, "3.2in")}
`; const T = (n, h, t) => `
${n}.  ${h}
${t}
`; return `
${head(I, { compact: true })}
SOLD AS-IS, NO WARRANTY AGREEMENT

This Sold As-Is, No Warranty Agreement (the “Agreement”) is entered into on this ${U(d, d.day, ".4in")} day of ${U(d, d.month, "1in")}, 20${U(d, d.year2, ".35in")}, by and between:

Seller:
Name: ${E(I.legal)}
Address: ${E([I.addr1, I.addr2].filter(has).join(", "))}
Phone: ${E(I.phone)}
Buyer:
${P("Name", b.name)}${P("Address", [b.street, b.csz].filter(has).join(", "))}${P("Phone", b.phone)}
Item Being Sold:
${P("Description of Item", d.blank ? "" : ["Motor vehicle", v.body, v.color].filter(has).join(", "))}${P("Make/Model", [v.make, v.model].filter(has).join(" "))}${P("Year", v.year)}${P("VIN/Serial Number (if applicable)", v.vin)}
TERMS OF SALE:
${T(1, "As-Is Condition", "The Buyer acknowledges and agrees that the item is being sold in “as-is” condition with all faults, known or unknown. The Seller makes no warranties or representations, express or implied, about the condition, functionality, or suitability of the item for any particular purpose.")} ${T(2, "No Warranty", "The Buyer agrees that the Seller provides no warranty, express or implied, including but not limited to any implied warranties of merchantability or fitness for a particular purpose.")} ${T(3, "Inspection and Acceptance", "The Buyer acknowledges they have had the opportunity to inspect the item prior to signing this Agreement. The Buyer accepts the item in its current condition, without any guarantees or promises from the Seller.")} ${T(4, "Release of Liability", "Upon transfer of the item and payment in full, the Buyer agrees to release and hold harmless the Seller from any and all claims, liabilities, or damages arising from the use or ownership of the item.")} ${T(5, "Final Sale", "The Buyer and Seller agree that this is a final sale. No refunds, exchanges, or returns will be provided under any circumstances.")} ${T(6, "Entire Agreement", "This Agreement constitutes the entire understanding between the Seller and Buyer. Any modifications must be in writing and signed by both parties.")} ${T(7, "Governing Law", `This Agreement shall be governed by the laws of the State of ${E(I.stateName)}.`)}
SIGNATURES
Seller’s Signature:
Name:
Date: ${U(d, d.date, "2.6in")}
Buyer’s Signature:
Name: ${U(d, b.name, "2.6in")}
Date: ${U(d, d.date, "2.6in")}
`; } // 13 TRADE-IN AUTHORIZATION AND ASSIGNMENT FORM function tradeAuth(d, I, S) { const b = d.buyer, t = d.trades[0] || vehicle(); const B = (k, x, w) => `
•   ${k}: ${U(d, x, w || "2.2in")}
`; const T = (n, h, x) => `
${n}.   ${h}
${x}
`; const nm = E(I.name); return `
${head(I, { compact: true })}
Trade-In Authorization and Assignment Form

This Trade-In Authorization and Assignment Form (“Form”) is entered into on this ${U(d, d.day, ".4in")} day of ${U(d, d.month, "1in")}, 20${U(d, d.year2, ".35in")}, by and between:

Customer (“Seller”):
Name: ${U(d, b.name, "3in")}
Address: ${U(d, [b.street, b.csz].filter(has).join(", "), "3.4in")}
Phone: ${U(d, b.phone, "2.4in")}
Dealer (“Buyer”):
${nm}
${E([I.street || I.addr1, I.csz || I.addr2].filter(has).join(", "))}
Phone: ${E(I.phone)}
Vehicle Information
${B("Year", t.year)}${B("Make", t.make)}${B("Model", t.model)}${B("VIN", t.vin, "2.6in")}${B("Mileage", miles(t.miles))}
Terms and Authorization
${T(1, "Assignment of Ownership", `By signing this Form, the Seller agrees to transfer ownership of the above-described vehicle (“Trade-In Vehicle”) to ${nm}. The Seller certifies that they are the lawful owner of the Trade-In Vehicle and that there are no undisclosed liens, encumbrances, or claims against the vehicle other than the disclosed payoff amount.`)} ${T(2, "Authorization to Obtain Payoff Information", `The Seller authorizes ${nm} and its representatives to contact the lienholder(s) listed below to obtain payoff information and settle the remaining balance on the loan associated with the Trade-In Vehicle.`)} ${B("Lienholder Name", t.lienholder, "2.4in")}${B("Account Number", t.acct, "2.4in")}
•   Payoff Amount: ${U(d, t.payoff === null || t.payoff === undefined || t.payoff === "" ? "" : "$" + amt(t.payoff), "2.2in")} (if known)
${T(3, "Authorization to Receive Title", `The Seller authorizes ${nm} to receive the title for the Trade-In Vehicle from the lienholder upon payment of the loan balance.`)} ${T(4, "Warranty of Ownership", "The Seller represents and warrants that they have the legal right to trade in the vehicle, that the information provided is accurate, and that the vehicle has no undisclosed issues that would affect its title transfer or ownership.")} ${T(5, "Release of Liability", `Upon signing this Form and delivery of the Trade-In Vehicle to ${nm}, the Seller releases all liability associated with the vehicle, provided the transfer of ownership and payoff are successfully completed.`)}
Acknowledgment and Signature

By signing below, the Seller confirms that they have read, understand, and agree to the terms outlined above.

Seller Signature:
Printed Name:
Date: ${U(d, d.date, "2.4in")}
Co-Owner Signature (if applicable):
Printed Name:
Date:
${nm} Representative
Authorized Representative Signature:
Printed Name:
Date:
`; } // 14 AGREEMENT TO PROVIDE INSURANCE (the store's wording) function insurance(d, I, S) { const b = d.buyer, v = d.veh, ins = d.ins || {}; const R = (k, x) => `
${k} ${x}
`; return `
${head(I)}
AGREEMENT TO PROVIDE INSURANCE
${wording(S.texts.insurance, I, S, d)}
PURCHASER
${R("Name:", V(d, b.name))}${R("Address:", V(d, b.street))}
Telephone Number: ${V(d, b.phone)}
State: ${V(d, b.state)}
Zip: ${V(d, b.zip)}
COLLATERAL INSURED:
${d.blank ? "" : E([ymm(v), v.vin ? "VIN " + v.vin : ""].filter(has).join(" "))}
INSURANCE AGENT
${R("Name:", V(d, ins.agentName))}${R("Address:", V(d, ins.agentAddr))}${R("City, St. Zip:", V(d, ins.agentCsz))}${R("Telephone:", V(d, ins.agentPhone))}
INSURANCE COMPANY
${R("Name:", V(d, ins.company))}${R("Policy Number", V(d, ins.policy))}${R("Effective Date:", V(d, ins.effective))}
Coverage ${!d.blank && ins.comp ? "X" : ""}Comprehensive ${!d.blank && ins.coll ? "X" : ""}Collision ${V(d, ins.deductible)}deductible

I understand that my contract requires that the vehicle/collateral be continuously covered with insurance against the risks of fire, theft, collision and other perils. And that failure to provide such insurance gives the bank or financial institution the right to declare the entire unpaid balance immediately due and payable.

Purchaser Signature
Date
Witness
Date
`; } // 15 WE OWE (the deal's we-owe lines; the store's 30-day wording) function weOwe(d, I, S) { const b = d.buyer, v = d.veh; const items = d.blank ? "" : d.weOwe.map((w, i) => `
${i + 1}. ${E(w)}
`).join(""); return `
${head(I)}
WE OWE
SOLD TO:
${d.blank ? "" : [E(b.name), E(b.street), E(b.csz)].filter(Boolean).join("
")}
DEAL: ${U(d, d.dealId, "1.2in")}
DATE: ${U(d, d.date, "1.2in")}
SALESMAN ${U(d, d.salesman, "1.2in")}
YearMakeModelBodyColorStock #VINMiles
${d.blank ? "" : "SOLD"}${V(d, v.year)}${V(d, v.make)}${V(d, v.model)}${V(d, v.body)}${V(d, v.color)}${V(d, v.stock)}${V(d, v.vin)}${V(d, miles(v.miles))}
DEALER AGREES TO THE FOLLOWING
${items}
${wording(S.texts.weOwe, I, S, d)}
${xsig("BUYER", d.blank ? "" : d.date)}${xsig("BUYER", d.blank ? "" : d.date)}
${xsig("SELLER", d.blank ? "" : d.date)}
`; } /* ═══════════ the catalog (the dealer's packet order) ═══════════ */ const FORMS = [ { key: "buyersOrder", title: "Buyers Order", category: "Sales", pages: 1, build: buyersOrder, desc: "The dealership's Buyers Order: sold-to, unit, price, other charges, down payment, financing, we-owe line and the recall notice." }, { key: "billOfSale", title: "Bill of Sale - Statement of Consideration Paid", category: "Sales", pages: 1, build: billOfSale, regulated: true, desc: "Cash price, trade allowance, trade difference, rebate and net price, with the odometer disclosure of the unit sold (49 CFR 580)." }, { key: "odometer", title: "Odometer Mileage Statement", category: "Sales", pages: 1, build: odometer, regulated: true, desc: "Federal odometer statement (49 CFR 580): the trade-in when the deal has one (the customer is the transferor), else the unit sold." }, { key: "buyerGuide", title: "FTC Buyers Guide (As Is / Dealer Warranty)", category: "F&I", pages: 2, build: buyerGuide, regulated: true, desc: "The federal Buyers Guide (16 CFR 455): front and back. The store's name, address and complaint contact print on the back." }, { key: "moSecurePoa", title: "MO Secure Power of Attorney (DOR Form 5086)", category: "Title", pages: 1, build: moSecurePoa, regulated: true, desc: "Prints the trade-in's data ONTO the State's secure form (load one in the printer). Preview / Print = a plain-paper REFERENCE COPY - NOT VALID." }, { key: "damageAck", title: "Acknowledgement of Disclosure of Damage", category: "Sales", pages: 1, build: damageAck, desc: "The customer acknowledges the damage disclosed before the sale. The store's own wording (Owner Panel > Stores > Options > Form wording)." }, { key: "fundingNotice", title: "Funding Notice", category: "F&I", pages: 1, build: fundingNotice, desc: "Not a completed deal until the finance company funds it; the store's restocking fee (its percent is a store setting)." }, { key: "titleReceived", title: "Title Received Confirmation", category: "Title", pages: 1, build: titleReceived, desc: "The customer confirms receiving the title (the store's logo, or its name when no logo is set)." }, { key: "titleReceipt", title: "Title Receipt Form", category: "Title", pages: 1, build: titleReceipt, desc: "Receipt of the vehicle title from the dealership, with the vehicle and customer information." }, { key: "creditApp", title: "Credit Authorization Form", category: "F&I", pages: 1, build: creditAuth, desc: "Permission to pull the customer's credit. The Social Security number and date of birth boxes always print EMPTY (the customer writes them)." }, { key: "titleLienAuth", title: "Authorization for Title and Lien Transfer", category: "Title", pages: 1, build: titleLienAuth, desc: "The customer authorizes the dealership to receive the trade-in's title and lien and to do the paperwork." }, { key: "asIs", title: "Sold As-Is, No Warranty Agreement", category: "F&I", pages: 1, build: asIs, desc: "Seller / buyer / item, the seven terms of sale (as-is, no warranty, inspection, release, final sale, entire agreement, governing law)." }, { key: "tradeAck", title: "Trade-In Authorization and Assignment", category: "Sales", pages: 1, build: tradeAuth, desc: "Assignment of the trade-in, authority to get the payoff and the title, warranty of ownership, release of liability." }, { key: "insuranceAgreement", title: "Agreement to Provide Insurance", category: "F&I", pages: 1, build: insurance, desc: "The purchaser's insurance: loss payee in favor of the lender, agent, company and coverage. The store's own wording." }, { key: "weOweYouOwe", title: "We Owe", category: "Sales", pages: 1, build: weOwe, desc: "What the dealer agrees to do after the sale (the deal's we-owe lines), with the store's 30-day line." }, ]; const BY = {}; FORMS.forEach((f, i) => { f.n = i + 1; BY[f.key] = f; }); const owns = (k) => Object.prototype.hasOwnProperty.call(BY, String(k || "")); const keys = () => FORMS.map((f) => f.key); /** one form's body (with the forms' CSS) - a packet page / the MO packet / a test */ function bodyFor(key, o) { const f = BY[key]; if (!f) return ""; const d = data(o), I = ident(), S = settings(); return css(I) + `
${f.build(d, I, S)}
`; } function print(key, o) { const f = BY[key]; if (!f) return { ok: false, msg: "No form named " + key }; o = o || {}; if (!window.K2BPrint) return { ok: false, msg: "The print engine is not ready." }; (window.k2bPrint || window.K2BPrint.doc)(bodyFor(key, o), { title: f.title + (o.blank ? " (blank)" : ""), formKey: key }); return { ok: true }; } /** several forms as ONE document (a page break before each form) */ function packet(list, o) { o = o || {}; const ks = (Array.isArray(list) && list.length ? list : keys()).filter(owns); if (!ks.length || !window.K2BPrint) return { ok: false, msg: "No forms to print." }; const d = data(o), I = ident(), S = settings(); const html = css(I) + ks.map((k) => `
${BY[k].build(d, I, S)}
`).join(""); (window.k2bPrint || window.K2BPrint.doc)(html, { title: (o.blank ? "Blank forms" : "Deal forms") + " (" + ks.length + ")", formKey: "forms-packet" }); return { ok: true, keys: ks }; } /** the packet of a deal (Forms Sequencing: deal type, bank, state) - the forms of this file, in sequence order */ function packetKeys(ctx) { const seq = window.jbForms && window.jbForms.resolve ? window.jbForms.resolve(ctx || {}) : []; const out = []; seq.forEach((f) => { if (owns(f.printKey) && out.indexOf(f.printKey) === -1) out.push(f.printKey); }); return out; } /* ═══════════ the DOR secure form: the data ONLY, placed for the pre-printed Form 5086 (+ this store's nudge) ═══════════ */ // inches from the sheet's top-left corner (measured on the dealer's copy of Form 5086 REV. 05-2013); Owner Panel > Stores > Options > Form wording moves them (mm) const MO5086 = { vin: [0.62, 1.60], year: [3.27, 1.60], make: [5.02, 1.60], titleNo: [0.62, 1.93], model: [3.27, 1.93], body: [5.02, 1.93], appoint: [1.15, 2.33], odometer: [0.75, 3.25], exceeds: [1.94, 2.99], notActual: [1.94, 3.16], date: [3.85, 3.62], sellerStreet: [0.62, 4.26], sellerCsz: [4.25, 4.26], purchStreet: [0.62, 5.06], purchCsz: [4.25, 5.06] }; function openDoc(docHtml, title) { if (window.K2BPrint && window.K2BPrint._capture(docHtml)) return; // the print test reads it (K2BPrint.lastDoc) let w = null; try { w = window.open("", "_blank", "width=900,height=1100"); } catch (e) { w = null; } if (w && w.document) { w.document.write(docHtml.replace("", `