def _section_2(self):
     ps = extend_style(styles["section-main"],
                       alignment=TA_JUSTIFY,
                       underlineProportion=0.07)
     ps_center = extend_style(ps, alignment=TA_CENTER)
     elems = [
         Paragraph(
             "Upon accepting the defendant's above indicated plea or judgment by this court and after reviewing the defendant's criminal history record, it now appears to this Court that acceptance of the defendant's plea would be in the best interest of justice.",
             ps),
         Spacer(0, 0.5 * mm),
     ]
     period_text = self.underline_pad(
         22 * mm, "%s %s" %
         (self.data["sentence_length"], self.data["sentence_period"]), ps)
     elems.append(
         Paragraph(
             "Whereas, the above disposition has been made against the above named defendant, the defendant is hereby sentenced to confinement for a period of %s and ordered to pay a fine in the total amount stated above, of which includes all surcharges pursuant to the Official Code of Georgia Annotated."
             % period_text, ps), )
     period_text = (
         self.underline_pad(
             22 * mm, "%s %s" % (self.data["house_eligible_length"],
                                 self.data["house_eligible_period"]), ps),
         self.underline_pad(
             22 * mm, "%s %s" %
             (self.data["house_length"], self.data["house_period"]), ps),
     )
     elems.append(
         Paragraph(
             "Upon service of %s of the above sentence confined in jail, defendant will serve %s in confinement. Defendant shall receive no reduction of total sentence time based upon any credit for good time served if incarcerated."
             % period_text, ps), )
     elems.extend([
         Table([[
             Paragraph("The defendant is to report to the jail", ps),
             CustomXBox(8.2, self.data["jail_immediate"]),
             Paragraph("immediately <b>or</b>", ps),
             CustomXBox(8.2, True if self.data["jail_date"] else False),
             Paragraph("on", ps),
             Paragraph("%s" % self.data["jail_date"], ps_center),
             Paragraph("at", ps_center),
             Paragraph("%s" % self.data["jail_time"], ps_center),
             Paragraph("to begin service.", ps),
         ]],
               style=extend_table_style(styles["main-table"], [
                   ("LEFTPADDING", (8, 0), (8, 0), 1 * mm),
                   ("LINEBELOW", (5, 0), (5, 0), 0.6, "black"),
                   ("LINEBELOW", (7, 0), (7, 0), 0.6, "black"),
               ]),
               colWidths=[
                   55 * mm, 5 * mm, 25 * mm, 5 * mm, 5 * mm, None, 5 * mm,
                   None
               ]),
         Spacer(0, 2 * mm)
     ])
     return elems
 def _section_3(self):
     ps = styles["section-main"]
     elems = [
         Paragraph(
             "<b>GENERAL CONDITIONS OF PROBATION / SUSPENDED SENTENCE</b>: The defendant is hereby granted the privilege of serving all or part of the above stated sentence on probation, subject to the following general conditions:",
             ps),
     ]
     ps = extend_style(ps, alignment=TA_JUSTIFY)
     list_text = [
         "Do not violate the criminal laws of any governmental unit. Must report any arrest and / or citation to probation officer within 48 hours.",
         "Avoid persons or places of disreputable or harmful character.",
         "Report to a probation supervisor as directed and permit such supervisor to visit your home or elsewhere.",
         "Work faithfully at suitable employment insofar as may be possible.",
         "Do not change your present place of residence, move outside the jurisdiction of the Court, or leave the state for any period of time without prior permission of the probation supervisor.",
         "Support your legal dependents to the best of your ability.",
         "Pay a probation supervisor fee of $35.00 a month for probation services provided for the City by an independent corporation pursuant to the Official Code of Georgia  Annotated.",
         "Pay a monthly Crime Victims Compensation Program Fee of $9.00 and pay a $10.00 probation case initiation fee.",
         "Avoid injurious and vicious habits, especially alcoholic intoxication, narcotics, and other dangerous drugs unless prescribed lawfully.",
         "Behave in a truthful and respectful manner towards the probation supervisor.",
     ]
     table_data = list()
     for text in list_text:
         table_data.append(
             [Paragraph("<seq id=\"s3s4_l0\">.&nbsp;&nbsp;%s" % text, ps)])
     elems.append(
         Table(
             table_data,
             style=extend_table_style(styles["main-table"], [
                 ("VALIGN", (0, 0), (-1, -1), "TOP"),
                 ("LEFTPADDING", (0, 0), (0, -1), 14 * mm),
                 ("BOTTOMPADDING", (0, 0), (-1, -1), 1 * mm),
             ]),
         ))
     elems.append(Spacer(0, 1 * mm))
     return elems
 def _section_1(self):
     elems = list()
     dob_parts = self.data["defendant_dob"].split("/")
     ps = extend_style(styles["field-value"], alignment=TA_CENTER)
     t1 = Table([[
         self._create_field("First Name:", 22.9 * mm,
                            "%s" % self.data["defendant_firstname"],
                            84.8 * mm), None,
         self._create_field("Middle Name:", 27 * mm,
                            "%s" % self.data["defendant_middlename"],
                            47 * mm), None
     ]],
                style=styles["main-table"])
     t2 = Table(
         [[
             Paragraph("Date of Birth (MM/DD/YYYY):",
                       styles["field-label"]),
             Paragraph(dob_parts[0], ps),
             Paragraph("/", ps),
             Paragraph(dob_parts[1], ps),
             Paragraph("/", ps),
             Paragraph(dob_parts[2], ps)
         ]],
         style=extend_table_style(styles["main-table"], [
             ("LEFTPADDING", (1, 0), (1, 0), 0.5 * mm),
             ("LINEBELOW", (1, 0), (1, 0), 0.25 * mm, "black", "butt"),
             ("LINEBELOW", (3, 0), (3, 0), 0.25 * mm, "black", "butt"),
             ("LINEBELOW", (5, 0), (5, 0), 0.25 * mm, "black", "butt"),
         ]),
         colWidths=(57.6 * mm, 16.5 * mm, 3.5 * mm, 19 * mm, 3.5 * mm,
                    35.5 * mm),
         rowHeights=9.7 * mm,
     )
     t3 = Table([[
         self._create_field("Driver’s License  (state):", 45.5 * mm,
                            "%s" % self.data["defendant_license_state"],
                            21.3 * mm),
         self._create_field("(number):", 19 * mm, "%s" %
                            self.data["defendant_license_no"], 89.5 * mm),
     ]],
                style=styles["main-table"],
                colWidths=(69.1 * mm, None)),
     elems.append(
         Table(
             [
                 [
                     self._create_field(
                         "Defendant Information:  Last Name:", 66.9 * mm,
                         "%s" % self.data["defendant_lastname"], 117.8 * mm)
                 ],
                 [t1],
                 [t2],
                 [t3],
             ],
             style=styles["main-table"],
         ))
     return [self._create_section_table(elems)]
예제 #4
0
 def _section_doc_footer(self):
     elems = [
         Paragraph(_("text-024"), styles["doc-footer"]),
         Paragraph("2665 BUFORD HWY", styles["doc-footer"]),
         Paragraph("BROOKHAVEN, GA 30324", styles["doc-footer"]),
         Paragraph("%s: 404-637-0660" % _("text-025"),
                   styles["doc-footer"]),
         Paragraph("%s: 404 637-0665" % _("text-026"),
                   styles["doc-footer"]),
         Spacer(0, 7 * mm),
         Paragraph("REVISED MAR 2018",
                   extend_style(styles["doc-footer"], alignment=TA_LEFT)),
     ]
     return elems
 def _section_doc_footer(self):
     elems = [Spacer(0, 3 * mm)]
     elems.append(
         Table([[
             Paragraph("Copy 1 = Defendant Notice", styles["doc-footer"]),
             Paragraph("Copy 2 = Home Jurisdiction Copy",
                       styles["doc-footer"]),
         ]],
               style=extend_table_style(styles["main-table"], [
                   ("LEFTPADDING", (0, 0), (0, 0), 41.5 * mm),
                   ("LEFTPADDING", (1, 0), (1, 0), 3 * mm),
               ])))
     elems.append(Spacer(0, 12 * mm))
     elems.append(
         Paragraph(
             "%s<br />%s<br />%s<br />%s %s, %s" %
             (self.data["field-005"], self.data["field-044"],
              self.data["field-029"], self.data["field-030"],
              self.data["field-032"], self.data["field-032"]),
             extend_style(styles["doc-footer"], leftIndent=19 * mm)))
     return elems
 def _section_2(self):
     elems = list()
     elems.append(Spacer(0, 2.5 * mm))
     ts = extend_table_style(styles["main-table"], [
         ("VALIGN", (0, 0), (-1, -1), "MIDDLE"),
         ("LEFTPADDING", (0, 0), (0, -1), 1.9 * mm),
     ])
     t1 = Table(
         [
             [
                 CustomXBox(size=4.2 * mm, value=self.data["field-014"]),
                 Paragraph("YES", style=styles["field-label"])
             ],
             [
                 CustomXBox(size=4.2 * mm, value=self.data["field-015"]),
                 Paragraph("NO", style=styles["field-label"])
             ],
             [
                 CustomXBox(size=4.2 * mm, value=self.data["field-016"]),
                 Paragraph("UNKNOWN", style=styles["field-label"])
             ],
         ],
         style=ts,
         colWidths=(8.2 * mm, None),
         rowHeights=5.7 * mm,
     )
     t2 = Table([
         [
             CustomXBox(size=4.2 * mm, value=self.data["field-017"]),
             Paragraph("YES", style=styles["field-label"])
         ],
         [
             CustomXBox(size=4.2 * mm, value=self.data["field-018"]),
             Paragraph("NO", style=styles["field-label"])
         ],
     ],
                style=ts,
                colWidths=(8.2 * mm, None),
                rowHeights=6 * mm,
                spaceBefore=2 * mm)
     t3 = Table([
         [
             CustomXBox(size=4.2 * mm, value=self.data["field-019"]),
             Paragraph("YES", style=styles["field-label"])
         ],
         [
             CustomXBox(size=4.2 * mm, value=self.data["field-020"]),
             Paragraph("NO", style=styles["field-label"])
         ],
     ],
                style=ts,
                colWidths=(8.2 * mm, None),
                rowHeights=6 * mm,
                spaceBefore=2 * mm)
     elems.append(
         Table(
             [
                 [
                     [
                         Paragraph("<u>CITATION NO.</u>",
                                   styles["field-label"]),
                         Paragraph("%s" % self.data["field-005"],
                                   styles["field-value"]),
                     ],
                     None,
                     [
                         Paragraph("<u>CASE NO</u>", styles["field-label"]),
                         Paragraph("%s" % self.data["field-006"],
                                   styles["field-value"]),
                     ],
                     [
                         Paragraph("<u>CITATION DATE</u>",
                                   styles["field-label"]),
                         Paragraph("%s" % self.data["field-007"],
                                   styles["field-value"]),
                     ],
                     [
                         Paragraph(
                             "<u>TRIAL DATE</u>",
                             extend_style(styles["field-label"],
                                          alignment=TA_CENTER)),
                         Paragraph(
                             "%s" % self.data["field-008"],
                             extend_style(styles["field-value"],
                                          alignment=TA_CENTER)),
                     ],
                     None,
                     None,
                     [
                         Paragraph("<u>NATIVE CODE</u>",
                                   styles["field-label"]),
                         Paragraph("%s" % self.data["field-009"],
                                   styles["field-value"]),  # field
                     ],
                 ],
                 [
                     [
                         Paragraph("<u>DESCRIPTION OF VIOLATION/CHARGE</u>",
                                   styles["field-label"]),
                         Paragraph("%s" % self.data["field-010"],
                                   styles["field-value"]),  # field
                     ],
                     None,
                     None,
                     None,
                     None,
                     [
                         Paragraph(
                             "<u>LOCATION OF VIOLATION</u>",
                             extend_style(styles["field-label"],
                                          alignment=TA_CENTER)),
                         Paragraph(
                             "%s" % self.data["field-011"],
                             extend_style(styles["field-value"],
                                          alignment=TA_CENTER)),
                     ],
                     None,
                     [
                         Paragraph(
                             "<u>FINES AND COSTS</u>",
                             extend_style(styles["field-label"],
                                          alignment=TA_CENTER)),
                         Paragraph(
                             "%s" % self.data["field-012"],
                             extend_style(styles["field-value"],
                                          alignment=TA_CENTER)),
                     ],
                 ],
                 [
                     [
                         Paragraph(
                             "<u>JURISDICTION</u>",
                             extend_style(styles["field-label"],
                                          alignment=TA_CENTER)),
                         Paragraph(
                             "<b><u>%s</u></b>" % self.data["field-013"],
                             extend_style(styles["field-value"],
                                          alignment=TA_CENTER,
                                          spaceBefore=0.5 * mm)),
                     ],
                     [
                         Paragraph("<u>CDL HOLDER?</u>",
                                   styles["field-label"]), t1
                     ],
                     None,
                     [
                         Paragraph("<u>COMMERCIAL VEHICLE</u>",
                                   styles["field-label"]), t2
                     ],
                     None,
                     [
                         Paragraph("<u>HAZMAT</u>", styles["field-label"]),
                         t3
                     ],
                     [
                         Paragraph("<u>ACD CODE</u>",
                                   styles["field-label"]),
                         Paragraph(
                             "<b><u>%s</u></b>" % self.data["field-021"],
                             extend_style(styles["field-value"],
                                          spaceBefore=0.5 * mm,
                                          leftIndent=10 * mm)),
                     ],
                     None,
                 ],
                 [
                     [
                         Paragraph(
                             "<u>COURT TYPE</u>",
                             extend_style(styles["field-label"],
                                          alignment=TA_CENTER)),
                         Paragraph(
                             "%s" % self.data["field-022"],
                             extend_style(
                                 styles["field-value"],
                                 alignment=TA_CENTER,
                                 spaceBefore=1.5 * mm,
                                 fontSize=styles["field-value"].fontSize *
                                 0.8)),
                     ],
                     None,
                     None,
                     None,
                     None,
                     None,
                     [
                         Paragraph(
                             "<u>ACD DETAIL (FOR DDS USE ONLY)</u>",
                             extend_style(
                                 styles["field-label"],
                                 fontSize=styles["field-label"].fontSize *
                                 0.85)),
                         Paragraph(
                             "%s" % self.data["field-023"],
                             extend_style(
                                 styles["field-value"],
                                 fontSize=styles["field-value"].fontSize *
                                 0.85,
                                 spaceBefore=0.5 * mm)),
                     ],
                     None,
                 ],
             ],
             style=extend_table_style(styles["main-table"], [
                 ("GRID", (0, 0), (-1, -1), 0.3 * mm, "black"),
                 ("SPAN", (0, 0), (1, 0)),
                 ("SPAN", (4, 0), (6, 0)),
                 ("SPAN", (0, 1), (4, 1)),
                 ("SPAN", (5, 1), (6, 1)),
                 ("SPAN", (6, 2), (7, 2)),
                 ("SPAN", (6, 3), (7, 3)),
                 ("SPAN", (1, 2), (2, 3)),
                 ("SPAN", (3, 2), (4, 3)),
                 ("SPAN", (5, 2), (5, 3)),
                 ("VALIGN", (0, 0), (-1, -1), "TOP"),
                 ("TOPPADDING", (0, 0), (-1, -1), 1.7 * mm),
                 ("TOPPADDING", (0, 3), (0, 3), 0),
                 ("LEFTPADDING", (0, 0), (-1, -1), 2 * mm),
                 ("RIGHTPADDING", (0, 0), (-1, -1), 2 * mm),
             ]),
             colWidths=(29.4 * mm, 6.1 * mm, 29.6 * mm, 37.9 * mm, 4.3 * mm,
                        35.8 * mm, 8.4 * mm, None),
             rowHeights=(14.8 * mm, 14.8 * mm, 12.5 * mm, 10.5 * mm),
         ))
     return elems
 def _section_1(self):
     elems = list()
     elems.append(Spacer(0, 1.5 * mm))
     ps = extend_style(styles["main"], fontSize=8)
     t1 = Table(
         [[
             Paragraph(
                 "The conditions of this suspension have been met.",
                 extend_style(
                     ps, alignment=TA_JUSTIFY, justifyLastLine=True)),
             None,
         ],
          [
              Paragraph("Authorized Signature:", ps),
              SignatureRect(35 * mm, 6 * mm)
          ], [
              Paragraph("Date Settled: %s" % self.data["field-004"], ps),
          ]],
         style=extend_table_style(styles["main-table"], [
             ("OUTLINE", (0, 0), (-1, -1), 0.3 * mm, "black"),
             ("VALIGN", (0, 0), (-1, -1), "MIDDLE"),
             ("LEFTPADDING", (0, 0), (0, -1), 2.1 * mm),
             ("RIGHTPADDING", (0, 0), (-1, 0), 2.1 * mm),
             ("BOTTOMPADDING", (0, 2), (-1, 2), 1.5 * mm),
             ("SPAN", (0, 0), (1, 0)),
         ]),
         colWidths=(34 * mm, 43 * mm),
         rowHeights=(7 * mm, 6.5 * mm, 7.5 * mm),
     )
     elems.append(
         Table(
             [
                 [
                     None,
                     CustomXBox(value=self.data["field-001"]),
                     Paragraph("FAILURE TO APPEAR", styles["main"]), t1
                 ],
                 [
                     None,
                     CustomXBox(value=self.data["field-002"]),
                     Paragraph("D/L IN LIEU OF BAIL", styles["main"]), None
                 ],
                 [None],
                 [
                     [
                         Paragraph(
                             "GEORGIA",
                             extend_style(styles["main"],
                                          alignment=TA_CENTER,
                                          fontSize=14,
                                          leading=17)),
                         Paragraph(
                             "NONRESIDENT<br />VIOLATOR COMPACT",
                             extend_style(styles["main"],
                                          alignment=TA_CENTER,
                                          fontSize=9.75)),
                     ],
                     CustomXBox(value=self.data["field-003"]),
                     Paragraph("D/L AS COLLATERAL (MISDEMEANOR)",
                               styles["main"]),
                     None,
                 ],
             ],
             style=extend_table_style(styles["main-table"], [
                 ("VALIGN", (0, 0), (-1, -1), "TOP"),
                 ("LEFTPADDING", (1, 0), (1, -1), 1.2 * mm),
                 ("VALIGN", (3, 0), (3, 0), "MIDDLE"),
                 ("SPAN", (3, 0), (3, 1)),
             ]),
             colWidths=(43.5 * mm, 7.5 * mm, 59 * mm, None),
             rowHeights=(19.5 * mm, 19.5 * mm, 2 * mm, 19 * mm),
         ))
     return elems
    def _section_5(self):
        ps = styles["section-main"]
        elems = [
            Paragraph(
                "IT IS THE FURTHER ORDER of the Court, and the defendant is hereby advised that the Court may, at any time, upon violation of any of the general or special conditions of probation, revoke any conditions of the probation / suspension herein granted. If such probation / suspension is revoked, the Court may order the execution of the sentence which was originally imposed or any portion thereof in the manner provided by law, after deducting the amount of time the defendant has on probation or suspension.",
                ps,
            )
        ]
        elems.append(Spacer(0, 1 * mm))
        date_parts = self.data["order_date"].split("/")
        date_parts[1] = int(date_parts[0])
        date_suff = ["th", "st", "nd", "rd"]
        try:
            date_parts[1] = "%s%s" % (date_parts[1], date_suff[date_parts[1]])
        except IndexError:
            date_parts[1] = "%s%s" % (date_parts[1], date_suff[0])
        date_parts[0] = datetime.date(1900, int(date_parts[0]),
                                      1).strftime('%B')
        elems.append(
            Table([[
                None,
                Paragraph("<b>SO ORDERED</b> this", ps),
                Paragraph("%s" % date_parts[1],
                          extend_style(ps, alignment=TA_CENTER)),
                Paragraph("of", extend_style(ps, alignment=TA_CENTER)),
                Paragraph("%s" % date_parts[0],
                          extend_style(ps, alignment=TA_CENTER)),
                Paragraph(", %s." % date_parts[2], ps),
            ]],
                  style=extend_table_style(styles["main-table"], [
                      ("LINEBELOW", (2, 0), (2, 0), 0.5, "black"),
                      ("LINEBELOW", (4, 0), (4, 0), 0.5, "black"),
                  ]),
                  colWidths=(25 * mm, 30 * mm, 12.5 * mm, 4.5 * mm, 30 * mm,
                             12 * mm),
                  hAlign="LEFT"))
        elems.extend([
            Spacer(0, 1 * mm),
            Table(
                [
                    [
                        None,
                        SignatureRect(
                            88 * mm, 7 * mm, label="Judge", leftIndent=4 * mm)
                    ],
                    [
                        None,
                        Paragraph("Judge, MUNICIPAL COURT OF BROOKHAVEN", ps)
                    ],
                ],
                style=extend_table_style(styles["main-table"], [
                    ("LINEABOVE", (1, 1), (1, 1), 0.9, "black"),
                ]),
            )
        ])
        elems.extend([
            Spacer(0, 10 * mm),
            Table(
                [
                    [
                        None,
                        SignatureRect(65 * mm, 7 * mm, label="Defendant"),
                        None,
                        SignatureRect(
                            82 * mm, 7 * mm, label="Defendants Attorney"), None
                    ],
                    [
                        None,
                        Paragraph("Defendant", ps),
                        None,
                        Paragraph("Defendant's Attorney", ps),
                    ],
                ],
                style=extend_table_style(styles["main-table"], [
                    ("VALIGN", (0, 0), (-1, -1), "TOP"),
                    ("LINEBELOW", (1, 0), (1, 0), 0.9, "black"),
                    ("LINEBELOW", (3, 0), (3, 0), 0.9, "black"),
                ]),
                colWidths=(10 * mm, None, 10 * mm, None, 10 * mm),
            )
        ])

        return elems
 def _section_1(self):
     elems = list()
     ps = extend_style(styles["section-main"],
                       alignment=TA_LEFT,
                       fontSize=styles["section-main"].fontSize * 0.9,
                       leading=styles["section-main"].fontSize * 0.9)
     ps_right = extend_style(styles["section-main"], alignment=TA_RIGHT)
     ps_title = extend_style(styles["section-main"],
                             alignment=TA_CENTER,
                             leading=styles["section-main"].fontSize * 1.35)
     data = [[
         Paragraph("<b>Citation</b>", ps_title),
         Paragraph("<b>Offense</b>", ps_title),
         Paragraph("<b>Disposition</b>", ps_title),
         Paragraph("<b>Case Balance</b>", ps_title), None
     ]]
     for citation in self.data["citations"]:
         data.append([
             Paragraph(
                 "<font size=10><seq>.</font> <b>%s</b>" %
                 citation["citation_number"], ps),
             Table(
                 [[
                     Paragraph("%s" % citation["offense_number"], ps),
                     Paragraph("%s" % citation["offense_description"], ps),
                 ]],
                 style=extend_table_style(styles["main-table"], [
                     ("VALIGN", (0, 0), (-1, -1), "TOP"),
                 ]),
                 colWidths=[20 * mm, None],
             ),
             Paragraph("%s" % citation["disposition"], ps),
             Paragraph("$ %s" % citation["balance"], ps),
             Spacer(0, 6 * mm),
         ])
     elems.append(
         Table(
             data,
             style=extend_table_style(styles["main-table"], [
                 ("GRID", (0, 0), (-2, -1), 0.5, "black"),
                 ("LEFTPADDING", (0, 0), (-2, -1), 1.5 * mm),
                 ("RIGHTPADDING", (0, 0), (-2, -1), 1.5 * mm),
                 ("TOPPADDING", (0, 0), (-2, -1), 0.25 * mm),
                 ("BOTTOMPADDING", (0, 0), (-2, -1), 1 * mm),
                 ("ALIGN", (0, 0), (-1, 0), "CENTER"),
                 ("VALIGN", (0, 0), (-1, -1), "TOP"),
             ]),
             colWidths=[30 * mm, None, 25 * mm, 25 * mm, 0],
         ))
     elems.append(
         Table(
             [[
                 Paragraph("TOTAL AMOUNT OF FINE(S) / FEE(S)", ps_right),
                 Paragraph("$ %s" % self.data["total_amount"], ps), None
             ],
              [
                  Paragraph("CASH BONDS RECEIVED", ps_right),
                  Paragraph("$ %s" % self.data["bonds_received"], ps),
              ]],
             style=extend_table_style(styles["main-table"], [
                 ("LEFTPADDING", (0, 0), (-1, -1), 1.5 * mm),
                 ("RIGHTPADDING", (0, 0), (-1, -1), 1.5 * mm),
             ]),
             colWidths=[None, 25 * mm, 5],
         ))
     elems.append(Spacer(0, 2 * mm))
     return elems
 def _section_doc_header(self):
     elems = [
         Paragraph(
             "<b>IN THE MUNICIPAL COURT OF DEKALB COUNTY<br />STATE OF GEORGIA</b>",
             styles["doc-header"])
     ]
     ps = extend_style(styles["main"], fontSize=9)
     if len(self.data["citations"]):
         cit_str = ', '.join(
             [c["citation_number"] for c in self.data["citations"]])
         text_width = stringWidth(cit_str, ps.fontName, ps.fontSize)
         cit_lines = textwrap.wrap(
             cit_str, int(len(cit_str) / (text_width / int((95 * mm) + 1))))
         if len(cit_lines) < 2:
             cit_lines.append("")
     else:
         cit_lines = ["", ""]
     elems.append(
         Table(
             [[
                 Table(
                     [[Paragraph("<b>CITY OF BROOKHAVEN</b>", ps), None],
                      [None, None], [Paragraph("<b>vs.</b>", ps), None],
                      [
                          Paragraph("%s" % self.data["defendant_name"], ps),
                          Paragraph("<b>,</b>", ps)
                      ], [
                          Paragraph("<b>DEFENDANT.</b>", ps),
                      ]],
                     style=extend_table_style(styles["main-table"], [
                         ("LINEBELOW", (0, 3), (0, 3), 0.5, "black"),
                         ("VALIGN", (0, 2), (-1, 2), "BOTTOM"),
                     ]),
                     colWidths=[None, 2 * mm],
                     rowHeights=5 * mm,
                 ),
                 Table(
                     [
                         [
                             Paragraph(
                                 "<b>Citation No(s). and Violation(s):</b>",
                                 ps)
                         ],
                         [Paragraph("%s" % cit_lines[0], ps)],
                         [Paragraph("%s" % cit_lines[1], ps)],
                     ],
                     style=extend_table_style(styles["main-table"], [
                         ("LINEBELOW", (0, 1), (-1, -1), 0.6, "black"),
                     ]),
                     rowHeights=6 * mm,
                 )
             ], [Spacer(0, 5 * mm)]],
             style=extend_table_style(styles["main-table"], [
                 ("LINEAFTER", (0, 0), (0, -1), 0.5, "black"),
                 ("LEFTPADDING", (0, 0), (-1, -1), 5 * mm),
                 (
                     "RIGHTPADDING",
                     (0, 0),
                     (-1, -1),
                     5 * mm,
                 ),
             ]),
             colWidths=(75 * mm, None),
             spaceBefore=5 * mm,
             spaceAfter=2 * mm,
         ))
     elems.extend([
         Paragraph("<b><u>ORDER AND SENTENCE</u></b>",
                   extend_style(styles["doc-header"], fontSize=12)),
     ])
     return elems
 def _page_footer(canv, doc):
     dt = datetime.datetime.now().strftime("%m/%d/%Y %I:%M %p")
     p = Paragraph(dt,
                   style=extend_style(styles["main"], alignment=TA_RIGHT))
     p_height = p.wrapOn(canv, doc.width, doc.height)[1]
     p.drawOn(canv, doc.leftMargin, doc.bottomMargin - p_height)
예제 #12
0
    def _section_1(self):
        elems = list()
        elems.extend([
            Spacer(0, 0.5 * mm),
            Paragraph("<b><u>%s</u></b>" % _("text-005"),
                      styles["section-header"]),
            Spacer(0, 14 * mm),
        ])

        ps = styles["section-main"]
        ps_value = extend_style(styles["field-value"], alignment=TA_CENTER)
        first_col_text = _("text-006")
        second_col_text = _("text-007")

        col_widths = [
            stringWidth(first_col_text, ps.fontName, ps.fontSize) + 1 * mm,
            76.5 * mm
        ]
        col_widths.extend([188 * mm - col_widths[0] - col_widths[1], None])

        text_width = stringWidth(second_col_text, ps_value.fontName,
                                 ps_value.fontSize),
        num_chars = int(
            len(second_col_text) / (text_width[0] / int(col_widths[2] + 1)))
        lines = textwrap.wrap(second_col_text, num_chars - 2)

        table_data = [[
            Paragraph(first_col_text, ps),
            Paragraph(self.data["field-004"], ps_value),
            Paragraph(lines[0], ps),
            None,
        ]]
        elems.append(
            Table(table_data,
                  style=extend_table_style(styles["main-table"], [
                      ("LINEBELOW", (1, 0), (1, 0), 0.2 * mm, "black"),
                      (
                          "LEFTPADDING",
                          (2, 0),
                          (2, 0),
                          2 * mm,
                      ),
                      ("VALIGN", (0, 0), (-1, -1), "BOTTOM"),
                  ]),
                  colWidths=col_widths,
                  rowHeights=5 * mm,
                  spaceAfter=1 * mm))
        if len(lines) > 1:
            joined_lines = ', '.join(lines[1:])
            elems.append(Paragraph(joined_lines, ps))
        elems.append(
            Table(
                [[
                    Paragraph(
                        self.data["field-005"],
                        extend_style(styles["field-value"],
                                     firstLineIndent=5 * mm,
                                     leading=11)),
                    Spacer(0, 5 * mm)
                ]],
                style=styles["main-table"],
                colWidths=[None, 1 * mm],
            ))
        col_widths = [4 * mm, 2 * mm, 21 * mm, None]
        elems.append(
            Table(
                [
                    [
                        CustomXBox(2.7 * mm, value=self.data["field-006"]),
                        Paragraph(_("text-008"), ps), None, None
                    ],
                ],
                style=extend_table_style(styles["main-table"], [
                    ("VALIGN", (0, 0), (0, -1), "TOP"),
                    ("TOPPADDING", (0, 0), (0, -1), 0.7 * mm),
                    ("SPAN", (1, 0), (3, 0)),
                ]),
                colWidths=col_widths,
                spaceBefore=0.75 * mm,
            ))
        text = _("text-009")
        col_width = 162 * mm
        text_width = stringWidth(text, ps.fontName, ps.fontSize),
        num_chars = int(len(text) / (text_width[0] / int(col_width + 1)))
        lines = textwrap.wrap(text, num_chars)
        table_data = [
            [
                CustomXBox(2.7 * mm, value=self.data["field-007"]),
                Paragraph("$", ps),
                Paragraph(self.data["field-008"], ps_value),
                Paragraph(lines[0], ps),
            ],
        ]
        ts_items = [
            ("LINEBELOW", (2, 0), (2, 0), 0.2 * mm, "black"),
            ("VALIGN", (0, 0), (0, -1), "TOP"),
            ("TOPPADDING", (0, 0), (0, -1), 0.7 * mm),
        ]
        if len(lines) > 1:
            table_data.append([None, ' '.join(lines[1:])])
            ts_items.append(("SPAN", (1, 1), (-1, 1)), )
        elems.append(
            Table(
                table_data,
                style=extend_table_style(styles["main-table"], ts_items),
                colWidths=col_widths,
                spaceBefore=0.75 * mm,
            ))
        elems.append(
            Table([[
                CustomXBox(2.7 * mm, value=self.data["field-009"]),
                Paragraph(_("text-010"), ps),
            ]],
                  style=extend_table_style(styles["main-table"], [
                      ("VALIGN", (0, 0), (0, -1), "TOP"),
                      ("TOPPADDING", (0, 0), (0, -1), 0.7 * mm),
                  ]),
                  colWidths=(4 * mm, None),
                  spaceBefore=0.75 * mm,
                  spaceAfter=6.25 * mm))
        elems.append(
            Paragraph("<b>%s</b>" % _("text-011"), style=styles["main"]))
        elems.extend([
            Spacer(0, 6 * mm),
            self._create_section_spacer(),
            Spacer(0, 1 * mm),
        ])
        return elems
예제 #13
0
 def _section_2(self):
     ps_label = styles["field-label"]
     ps_value = styles["field-value"]
     ps_label_right = extend_style(ps_label, alignment=TA_RIGHT)
     ps_value_right = extend_style(ps_value, alignment=TA_RIGHT)
     elems = list()
     table_data = [[
         Paragraph("Description", ps_label),
         Paragraph("Fees", ps_label_right),
         Paragraph("Payments", ps_label_right), None
     ]]
     row_heights = [6 * mm]
     if self.data["line_items"]:
         for item in self.data["line_items"]:
             table_data.append([
                 Paragraph("%s" % item["description"], ps_value),
                 Paragraph("%s" % item["fee"], ps_value_right),
                 Paragraph("%s" % item["payment"], ps_value_right), None
             ])
             row_heights.append(6.35 * mm)
     else:
         table_data.append([
             Paragraph("", ps_value),
             Paragraph("", ps_value),
             Paragraph("", ps_value), None
         ])
         row_heights.append(6.35 * mm)
     table_data.append([None, None, None, None])
     row_heights.append(1 * mm)
     elems.append(
         Table(table_data,
               style=extend_table_style(styles["main-table"], [
                   ("VALIGN", (0, 0), (-1, 0), "TOP"),
                   ("LINEBELOW", (0, 0), (-1, 0), 0.5 * mm, "black"),
                   ("LINEBELOW", (0, -1), (-1, -1), 0.5 * mm, "black"),
                   ("RIGHTPADDING", (0, 0), (-1, -1), 1.5 * mm),
               ]),
               rowHeights=row_heights,
               colWidths=(67 * mm, 18 * mm, 25.5 * mm, None)))
     elems.append(Spacer(0, 0.7 * mm))
     elems.append(
         Table([
             [
                 Paragraph("Case Beginning Balance:", ps_label_right),
                 Paragraph("%s" % self.data["beginning_balance"],
                           ps_value_right),
             ],
             [
                 Paragraph("Total Charges:", ps_label_right),
                 Paragraph("%s" % self.data["total_charges"],
                           ps_value_right),
             ],
             [
                 Paragraph("Total Payments:", ps_label_right),
                 Paragraph("%s" % self.data["total_payments"],
                           ps_value_right),
             ],
             [
                 Paragraph("Change:", ps_label_right),
                 Paragraph("%s" % self.data["change"], ps_value_right),
             ],
             [
                 Paragraph("Case Ending Balance:", ps_label_right),
                 Paragraph("%s" % self.data["ending_balance"],
                           ps_value_right),
             ],
         ],
               style=extend_table_style(styles["main-table"],
                                        [("RIGHTPADDING", (0, 0),
                                          (-1, -1), 1.5 * mm)]),
               rowHeights=5.9 * mm,
               colWidths=(67 * mm, 18 * mm)))
     elems.append(Spacer(0, 0.5 * mm))
     elems.append(
         RoundRectTable([[
             Paragraph("Balance All Cases:", ps_label_right),
             Paragraph("%s" % self.data["all_balance"], ps_label_right),
         ],
                         [
                             Paragraph("Next Payment Due:", ps_label_right),
                             Paragraph("%s" % self.data["next_payment_due"],
                                       ps_label_right),
                         ], [None]],
                        style=extend_table_style(styles["main-table"],
                                                 [("RIGHTPADDING", (0, 0),
                                                   (-1, -1), 1.5 * mm),
                                                  ("LEFTPADDING", (0, 0),
                                                   (0, -1), 29 * mm)]),
                        rowHeights=(6.75 * mm, 5.75 * mm, 1 * mm),
                        colWidths=(67 * mm, 18 * mm),
                        leftIndent=29 * mm,
                        cornerRadius=1 * mm,
                        backColor="lightgrey"))
     return [self._create_section_table(elems)]
 def _section_3(self):
     elems = [
         Paragraph(
             "<i>For the above listed case only, please correct the charge(including the new O.C.G.A. Code Section) and/or disposition (if Rule Nisi, include new disposition date) to indicate:</i>",
             styles["main"]),
     ]
     width = 188 * mm
     ps = styles["field-label"]
     if self.data["change_text"]:
         text_width = stringWidth(self.data["change_text"], ps.fontName,
                                  ps.fontSize)
         lines = textwrap.wrap(
             self.data["change_text"],
             int(
                 len(self.data["change_text"]) /
                 (text_width / int((width) + 1))))
         if len(lines) < 2:
             lines.append("")
     else:
         lines = ["", ""]
     table_data = list()
     for line in lines:
         table_data.append([Paragraph(line, ps)])
     elems.append(
         Table(table_data,
               style=extend_table_style(styles["main-table"], [
                   ("LINEBELOW", (0, 0),
                    (-1, -1), 0.25 * mm, "black", "butt"),
               ]),
               rowHeights=9.7 * mm))
     ts = extend_table_style(styles["main-table"],
                             [("ALIGN", (0, 0), (-1, -1), "CENTER"),
                              ("VALIGN", (0, 0), (-1, -1), "TOP")])
     elems.append(
         Table(
             [
                 [
                     Paragraph(
                         "This change is being made pursuant to O.C.G.A. §§ 40-13-32 and 40-13-33 as follows:",
                         style=styles["main"])
                 ],
                 [
                     self._create_radio_option(
                         "within  90 days of disposition at the court’s discretion",
                         4.42 * mm,
                         checked=self.data["change_reason_within90"],
                         style=ts)
                 ],
                 [
                     self._create_radio_option(
                         "more than 90 days but not more than 180 days after disposition pursuant to the notification and hearing requirements of O.C.G.A. §40-13-32",
                         4.42 * mm,
                         checked=self.data["change_reason_within180"],
                         style=ts)
                 ],
                 [
                     self._create_radio_option(
                         "to correct a clerical error (at any time) ",
                         4.42 * mm,
                         checked=self.data["change_reason_clerical"],
                         style=ts)
                 ],
             ],
             style=extend_table_style(styles["main-table"], [
                 ("TOPPADDING", (0, 0), (-1, -1), 5 * mm),
             ]),
         ))
     elems.extend([
         Spacer(0, 5 * mm),
         self._create_field(
             "Court Official Requesting Change (please print):", 91 * mm,
             "%s" % self.data["change_court_official"], 96.5 * mm),
         self._create_field(
             "Title of Official Requesting Change (please print):", 94 * mm,
             "%s" % self.data["change_title_official"], 93.5 * mm),
         Spacer(0, 5 * mm),
     ])
     elems.append(
         Table(
             [[
                 Paragraph("Signature of Requesting Official:",
                           styles["field-label"]),
                 SignatureRect(124 * mm,
                               9.5 * mm,
                               label="Requesting Official",
                               sig_id="RS-01"),
             ]],
             style=extend_table_style(styles["main-table"], [
                 ("LEFTPADDING", (1, 0), (1, -1), 0.5 * mm),
                 ("LINEBELOW", (1, 0), (1, -1), 0.25 * mm, "black", "butt"),
             ]),
             colWidths=(61.5 * mm, 126 * mm),
             rowHeights=9.7 * mm,
         ))
     elems.append(Spacer(0, 5 * mm))
     table_data = [
         [
             Table(
                 [[
                     Paragraph("Date of Request:", styles["field-label"]),
                     SignatureDatetimeRect(
                         59 * mm, 9.5 * mm, sig_id="RS-01"),
                 ]],
                 style=extend_table_style(styles["main-table"], [
                     ("LEFTPADDING", (1, 0), (1, -1), 0.5 * mm),
                     ("LINEBELOW", (1, 0),
                      (1, -1), 0.25 * mm, "black", "butt"),
                 ]),
                 colWidths=(32.5 * mm, 61 * mm),
                 rowHeights=9.7 * mm,
             ),
             # Image("dds_seal.jpg", width=30 * mm, height=15 * mm, kind='proportional'),
             Paragraph(
                 "<b>Court Seal Here</b>",
                 extend_style(styles["main"],
                              textColor=colors.HexColor(0xC1C1C1),
                              alignment=TA_CENTER)),
         ],
         [
             Paragraph("<i>DS-1195&nbsp;&nbsp;01/07</i>",
                       extend_style(styles["main"], fontSize=6,
                                    leading=10)), None
         ]
     ]
     elems.append(
         Table(table_data,
               style=extend_table_style(styles["main-table"], [
                   ("SPAN", (1, 0), (1, 1)),
                   ("LEFTPADDING", (0, 1), (0, 1), 0.5 * mm),
                   ("TOPPADDING", (1, 0), (1, -1), 4.5 * mm),
                   ("LEFTPADDING", (1, 0), (1, -1), 28 * mm),
                   ("VALIGN", (1, 0), (1, -1), "MIDDLE"),
                   ("ALIGN", (1, 0), (1, -1), "CENTER"),
               ]),
               rowHeights=(9.7 * mm, 9.0 * mm)))
     elems.append(Spacer(0, 0.9 * mm))
     return [self._create_section_table(elems)]
 def _section_2(self):
     elems = list()
     table_data = list()
     table_data.append([
         Table([[
             self._create_field("Court", 11.5 * mm,
                                "%s" % self.data["court_name"], 101.1 * mm),
             self._create_field("Telephone #", 24.5 * mm,
                                "%s" % self.data["court_phone"], 49.5 * mm),
         ]],
               style=styles["main-table"],
               colWidths=(113.8 * mm, None))
     ])
     ps = extend_style(style=styles["main"], fontSize=10, leading=12)
     table_data.append([
         Table(
             [[
                 self._create_field("Citation Number", 31.6 * mm,
                                    "%s" % self.data["court_citation"],
                                    103.5 * mm),
                 Paragraph("&nbsp;(if no citation, use case number)",
                           style=ps)
             ]],
             style=styles["main-table"],
         )
     ])
     table_data.append([
         Table(
             [[
                 self._create_field("Original Charge", 30.5 * mm, "%s" %
                                    self.data["court_charge"], 89.5 * mm),
                 self._create_field("O.C.G.A. §", 21 * mm, "%s" %
                                    self.data["court_ocga"], 47 * mm),
             ]],
             style=styles["main-table"],
         )
     ])
     table_data.append([
         Table([[
             self._create_field("Disposition Date", 31.8 * mm,
                                "%s" % self.data["court_disposition_date"],
                                58.8 * mm),
             self._create_field("Violation Date", 27.6 * mm,
                                "%s" % self.data["court_violation_date"],
                                61.2 * mm),
         ]],
               style=styles["main-table"],
               colWidths=(97.7 * mm, None))
     ])
     option_list = [
         "Guilty", "Nolo Contendere", "Bond Forfeiture", "First Offender"
     ]
     idx = option_list.index(self.data["court_disposition"])
     option_elems = list()
     for i in range(0, len(option_list)):
         checked = True if idx == i else False
         label = "<i>%s</i>" % option_list[i] if option_list[
             i] == "Nolo Contendere" else option_list[i]
         option_elems.append(
             self._create_radio_option(label, 4.42 * mm, checked=checked))
     option_elems.insert(
         0, Paragraph("Original Disposition:", styles["field-label"]))
     table_data.append([
         Table(
             [option_elems],
             style=styles["main-table"],
             colWidths=(40.5 * mm, 25.5 * mm, 45 * mm, 38 * mm, None),
         )
     ])
     elems.append(
         Table(
             table_data,
             style=styles["main-table"],
             rowHeights=9.7 * mm,
         ))
     return [self._create_section_table(elems)]