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_doc_header(self):
     max_height = 16.2 * mm
     elems = [
         Spacer(0, 6.3 * mm),
         Table(
             [[
                 Image("dds_logo.jpg",
                       width=61 * mm,
                       height=max_height,
                       kind='proportional'), None,
                 Paragraph(
                     "<b>Court Correction Request<br />Fax to %s</b>" %
                     self.data["header_fax"], styles["doc-header"]), None
             ]],
             style=extend_table_style(
                 styles["main-table"],
                 [
                     ("ALIGN", (0, 0), (0, 0), "CENTER"),
                     ("BACKGROUND", (2, 0), (2, 0), "black"),
                     ("LEFTPADDING", (2, 0), (2, 0), 2.8 * mm),
                     ("BOTTOMPADDING", (2, 0), (2, 0), 2 * mm),
                     # ("HALIGN", (2, 0), (2, 0), "CENTER"),
                 ]),
             colWidths=[66 * mm, 24.8 * mm, 82.8 * mm],
             rowHeights=max_height),
         Spacer(0, 2.7 * mm),
     ]
     return [self._create_section_table(elems, styles["main-table"])]
Пример #3
0
 def _section_doc_header(self):
     elems = list()
     elems.extend([
         Spacer(0, 2.5 * mm),
         Paragraph("<b>%s</b>" % _("text-001"), styles["doc-header"]),
         Spacer(0, 5.5 * mm),
     ])
     t1 = Table([[
         Paragraph(_("text-002"), styles["main-narrow"]),
     ], [
         Paragraph("VS.", styles["main-narrow"]),
     ], [
         Paragraph(self.data["field-001"], styles["field-value"]),
     ],
                 [
                     HRFlowable(width=66 * mm,
                                thickness=0.2 * mm,
                                lineCap='round',
                                color="black")
                 ]],
                style=extend_table_style(styles["main-table"], [
                    ("LEFTPADDING", (0, 1), (-1, 1), 16.5 * mm),
                    ("VALIGN", (0, 2), (-1, 2), "MIDDLE"),
                ]),
                rowHeights=[5 * mm, 5 * mm, 9.75 * mm, 0.5 * mm])
     t2 = Table(
         [[
             Paragraph(_("text-003"), styles["main-narrow-right"]),
             Paragraph(self.data["field-002"], styles["field-value"]),
         ],
          [
              Paragraph(_("text-004"), styles["main-right"]),
              Paragraph(self.data["field-003"], styles["field-value"]),
          ]],
         style=extend_table_style(styles["main-table"], [
             ("LINEBELOW", (1, 0), (1, -1), 0.2 * mm, "black"),
             ("RIGHTPADDING", (0, 0), (0, -1), 2 * mm),
         ]),
         rowHeights=5 * mm)
     elems.append(
         Table(
             [[t1, t2]],
             style=extend_table_style(styles["main-table"], [
                 ("VALIGN", (0, 0), (-1, -1), "TOP"),
             ]),
         ))
     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)]
 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 row_helper(data, col_widths=None, height=14.6 * mm):
     t = Table([data],
               style=extend_table_style(styles["main-table"], [
                   ("GRID", (0, 0), (-1, -1), 0.3 * mm, "black"),
                   ("VALIGN", (0, 0), (-1, -1), "TOP"),
                   ("TOPPADDING", (0, 0), (-1, -1), 1.8 * mm),
                   ("LEFTPADDING", (0, 0), (-1, -1), 1.9 * mm),
               ]),
               colWidths=col_widths,
               rowHeights=height)
     return t
 def _create_radio_option(label, size, checked=None, style=None):
     ts = style if style else extend_table_style(styles["main-table"], [
         ("ALIGN", (0, 0), (-1, -1), "CENTER"),
     ])
     t = Table([[
         RadioButton(size, checked),
         Paragraph("%s" % label, style=styles["main"])
     ]],
               style=ts,
               colWidths=(size * 1.25, None))
     return t
 def _create_field(label, label_width, value, value_width):
     t = Table(
         [[
             Paragraph(label, styles["field-label"]),
             Paragraph(value, styles["field-value"]),
         ]],
         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=(label_width, value_width),
         rowHeights=9.7 * mm,
     )
     return t
 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
Пример #10
0
 def _section_3(self):
     elems = list()
     elems.append(
         Table([[
             SignatureRect(
                 99 * mm, 14 * mm, leftIndent=1 * mm, sig_id="SURETY-01"),
             None,
             SignatureDatetimeRect(
                 48 * mm, 14 * mm, leftIndent=1 * mm, sig_id="SURETY-01"),
         ],
                [
                    Paragraph(_("text-022"), styles["main"]),
                    None,
                    Paragraph(_("text-023"), styles["main"]),
                ]],
               style=extend_table_style(styles["main-table"], [
                   ("LINEBELOW", (0, 0), (0, 0), 0.2 * mm, "black"),
                   ("LINEBELOW", (2, 0), (2, 0), 0.2 * mm, "black"),
               ]),
               colWidths=(101.7 * mm, 24.7 * mm, 50 * mm),
               rowHeights=[None, 6 * mm],
               hAlign="LEFT"))
     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 _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_3(self):
        def row_helper(data, col_widths=None, height=14.6 * mm):
            t = Table([data],
                      style=extend_table_style(styles["main-table"], [
                          ("GRID", (0, 0), (-1, -1), 0.3 * mm, "black"),
                          ("VALIGN", (0, 0), (-1, -1), "TOP"),
                          ("TOPPADDING", (0, 0), (-1, -1), 1.8 * mm),
                          ("LEFTPADDING", (0, 0), (-1, -1), 1.9 * mm),
                      ]),
                      colWidths=col_widths,
                      rowHeights=height)
            return t

        t1_rows = list()
        t1_rows.append(
            row_helper(
                [[
                    Paragraph("<u>DLN</u>", styles["field-label"]),
                    Paragraph("%s" % self.data["field-024"],
                              styles["field-value"]),
                ],
                 [
                     Paragraph("<u>STATE</u>", styles["field-label"]),
                     Paragraph("%s" % self.data["field-025"],
                               styles["field-value"]),
                 ],
                 [
                     Paragraph("<u>DATE OF BIRTH</u>", styles["field-label"]),
                     Paragraph("%s" % self.data["field-026"],
                               styles["field-value"]),
                 ]], [35.7 * mm, 16.9 * mm, None]))
        t1_rows.append(
            row_helper([[
                Paragraph("<u>DEFENDANT FULLNAME</u>", styles["field-label"]),
                Paragraph("%s" % self.data["field-027"],
                          styles["field-value"]),
            ],
                        [
                            Paragraph("<u>SEX</u>", styles["field-label"]),
                            Paragraph("%s" % self.data["field-028"],
                                      styles["field-value"]),
                        ]], [86.3 * mm, None]))
        t1_rows.append(
            row_helper([[
                Paragraph("<u>STREET ADDRESS</u>", styles["field-label"]),
                Paragraph("%s" % self.data["field-029"],
                          styles["field-value"]),
            ]]))
        t1_rows.append(
            row_helper(
                [[
                    Paragraph("<u>CITY</u>", styles["field-label"]),
                    Paragraph("%s" % self.data["field-030"],
                              styles["field-value"]),
                ],
                 [
                     Paragraph("<u>STATE</u>", styles["field-label"]),
                     Paragraph("%s" % self.data["field-031"],
                               styles["field-value"]),
                 ],
                 [
                     Paragraph("<u>ZIP CODE</u>", styles["field-label"]),
                     Paragraph("%s" % self.data["field-032"],
                               styles["field-value"]),
                 ]], [50 * mm, 15 * mm, None]))
        t1_rows.append(
            row_helper([[
                Paragraph("<u>TAG NO</u>", styles["field-label"]),
                Paragraph("%s" % self.data["field-033"],
                          styles["field-value"]),
            ],
                        [
                            Paragraph("<u>STATE</u>", styles["field-label"]),
                            Paragraph("%s" % self.data["field-034"],
                                      styles["field-value"]),
                        ],
                        [
                            Paragraph("<u>YEAR</u>", styles["field-label"]),
                            Paragraph("%s" % self.data["field-035"],
                                      styles["field-value"]),
                        ],
                        [
                            Paragraph("<u>VEHICLE DESCRIPTION</u>",
                                      styles["field-label"]),
                            Paragraph("%s" % self.data["field-036"],
                                      styles["field-value"]),
                        ]], [23 * mm, 14.5 * mm, 15 * mm, None]))
        t2_rows = list()
        t2_rows.append(
            row_helper(
                [[
                    Paragraph("<u>NAME OF COURT</u>", styles["field-label"]),
                    Paragraph("%s" % self.data["field-037"],
                              styles["field-value"]),
                ],
                 [
                     Paragraph("<u>COURT CODE #</u>", styles["field-label"]),
                     Paragraph("%s" % self.data["field-038"],
                               styles["field-value"]),
                 ]], [57 * mm, None]))
        t2_rows.extend([
            row_helper([[
                Paragraph("<u>MAILING ADDRESS</u>", styles["field-label"]),
                Paragraph("%s" % self.data["field-039"],
                          styles["field-value"]),
            ]]),
            row_helper([[
                Paragraph("<u>CITY, STATE, ZIP CODE</u>",
                          styles["field-label"]),
                Paragraph("%s" % self.data["field-040"],
                          styles["field-value"]),
            ]]),
            row_helper([[
                Paragraph("<u>TELEPHONE NUMBER</u>", styles["field-label"]),
                Paragraph("%s" % self.data["field-041"],
                          styles["field-value"]),  # field
            ]])
        ])
        t2_rows.append(
            row_helper(
                [
                    [
                        Paragraph("<u>CERTIFIED BY:</u>",
                                  styles["field-label"]),
                        Paragraph("%s" % self.data["field-042"],
                                  styles["field-value"]),  # field
                    ],
                    [
                        Paragraph("<u>DATE</u>", styles["field-label"]),
                        Paragraph("%s" % self.data["field-043"],
                                  styles["field-value"]),  # field
                    ]
                ],
                [61 * mm, None]))
        t3 = Table(
            [[t1_rows, None, t2_rows]],
            style=extend_table_style(styles["main-table"], [
                ("VALIGN", (0, 0), (-1, -1), "TOP"),
            ]),
            colWidths=(98.75 * mm, None, 89.7 * mm),
        )
        return [t3, Spacer(0, 6.5 * mm)]
 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_4(self):
     ps = styles["section-main"]
     elems = [
         Paragraph(
             "<b>SPECIAL CONDITIONS OF PROBATION (conditions are only applicable if checked and will be completed at the defendant's expense):</b>",
             ps),
     ]
     field_values = [
         (self.underline_pad(22 * mm, self.data["11_amount"], ps),
          self.underline_pad(50 * mm, self.data["11_party"], ps)),
         (
             self.underline_pad(15 * mm, self.data["16_meetings"], ps),
             self.underline_pad(15 * mm, self.data["16_sessions"], ps),
         ),
         self.underline_pad(
             22 * mm,
             "%s %s" % (self.data["17_length"], self.data["17_period"]),
             ps),
         self.underline_pad(15 * mm, self.data["18_hours"], ps),
         self.underline_pad(15 * mm, self.data["19_days"], ps),
         self.underline_pad(15 * mm, self.data["20_months"], ps),
         self.underline_pad(15 * mm, self.data["21_months"], ps),
         (self.underline_pad(15 * mm, self.data["22_months"], ps),
          self.underline_pad(20 * mm, self.data["22_amount"], ps)),
         self.underline_pad(15 * mm, self.data["23_months"], ps),
     ]
     line_data = [
         [
             XBoxParagraph(
                 "<seq id=\"s3s4_l0\">. Pay restitution in the amount of $ %s to %s"
                 % field_values[0], ps, 6.5,
                 True if self.data["11"] else False)
         ],
         [
             XBoxParagraph(
                 "<seq id=\"s3s4_l0\">. Abstain from the use of alcohol and drugs, and be subjected to random alcohol / drug testing of defendant's blood, breath, urine and hair as requested by court, probation, or law enforcement.",
                 ps, 6.5, True if self.data["12"] else False)
         ],
         [
             XBoxParagraph(
                 "<seq id=\"s3s4_l0\">. Obtain an alcohol and drug use evaluation or anger management evaluation as directed, and follow all further directives for treatment or counseling.",
                 ps, 6.5, True if self.data["13"] else False)
         ],
         [
             XBoxParagraph(
                 "<seq id=\"s3s4_l0\">. Complete a Risk Reduction course conducted by an agency licensed by the State of Georgia and submit proof to the Georgia Department of Driver Services within 120 days of this plea.",
                 ps, 6.5, True if self.data["14"] else False)
         ],
         [
             XBoxParagraph(
                 "<seq id=\"s3s4_l0\">. Complete the Interlock Ignition device requirements pursuant to the Official Code of Georgia Annotated.",
                 ps, 6.5, True if self.data["15"] else False)
         ],
         [
             XBoxParagraph(
                 "<seq id=\"s3s4_l0\">. Attend %s Alcoholics / Narcotics Anonymous meetings; and %s counseling sessions per week."
                 % field_values[1], ps, 6.5,
                 True if self.data["16"] else False)
         ],
         [
             XBoxParagraph(
                 "<seq id=\"s3s4_l0\">. Successfully complete %s of community service as directed by the probation supervisor or the City."
                 % field_values[2], ps, 6.5,
                 True if self.data["17"] else False)
         ],
         [
             XBoxParagraph(
                 "<seq id=\"s3s4_l0\">. %s hours of community service may be completed in lieu of fine at a rate of $10.00 per hour"
                 % field_values[3], ps, 6.5,
                 True if self.data["18"] else False)
         ],
         [
             XBoxParagraph(
                 "<seq id=\"s3s4_l0\">. Defendant shall complete defensive driving school and submit proof of completion to the clerk of Court within %s days of plea"
                 % field_values[4],
                 ps,
                 6.5,
                 True if self.data["19"] else False,
             )
         ],
         [
             XBoxParagraph(
                 "<seq id=\"s3s4_l0\">. Probation supervisor fee to be suspended after %s months if defendant has paid all of the fine and completed all special conditions of probation, with general conditions of probation to remain in effect throughout the term."
                 % field_values[5],
                 ps,
                 6.5,
                 True if self.data["20"] else False,
             )
         ],
         [
             XBoxParagraph(
                 "<seq id=\"s3s4_l0\">. Probation can be terminated after %s months if defendant has paid all of the fine and completed all special conditions of probation."
                 % field_values[6],
                 ps,
                 6.5,
                 True if self.data["21"] else False,
             )
         ],
         [
             XBoxParagraph(
                 "<seq id=\"s3s4_l0\">. Pay all fines and surcharges within %s months at a rate of $ %s per month. (to be filled out by probation offcer after disposition.)"
                 % field_values[7],
                 ps,
                 6.5,
                 True if self.data["22"] else False,
             )
         ],
         [
             XBoxParagraph(
                 "<seq id=\"s3s4_l0\">. Complete all special conditions within %s months."
                 % field_values[8],
                 ps,
                 6.5,
                 True if self.data["23"] else False,
             )
         ],
         [
             XBoxParagraph(
                 "<seq id=\"s3s4_l0\">. Defendant shall attend all classes and work successfully toward obtaining a high school diploma or GED during period of probation.",
                 ps,
                 6.5,
                 True if self.data["24"] else False,
             )
         ],
         [
             XBoxParagraph(
                 "<seq id=\"s3s4_l0\">. Other: %s" %
                 self.data["25_description"], ps, 6.5,
                 True if self.data["25"] else False)
         ],
         [HRFlowable(color="black", width="90%")],
     ]
     elems.append(
         Table(
             line_data,
             style=extend_table_style(styles["main-table"], [
                 ("LEFTPADDING", (0, 0), (-1, -1), 10.5 * mm),
                 ("ALIGN", (0, -1), (-1, -1), "RIGHT"),
                 ("BOTTOMPADDING", (0, 0), (-1, -3), 1 * mm),
             ]),
         ))
     elems.append(Spacer(0, 2 * mm))
     return elems
Пример #18
0
 def _section_1(self):
     elems = list()
     elems.append(
         Table(
             [[
                 Paragraph("Clerk:", styles["field-label"]),
                 Paragraph("%s" % self.data["clerk"],
                           styles["field-value"]),
             ],
              [
                  Paragraph("Inst Type:", styles["field-label"]),
                  Paragraph("%s" % self.data["inst_type"],
                            styles["field-value"])
              ],
              [
                  Paragraph("Paid By:", styles["field-label"]),
                  Paragraph("%s" % self.data["paid_by"],
                            styles["field-value"])
              ],
              [
                  Paragraph("Trans ID:", styles["field-label"]),
                  Paragraph("%s" % self.data["trans_id"],
                            styles["field-value"])
              ]],
             style=styles["main-table"],
             colWidths=(17.5 * mm, None),
             rowHeights=6.1 * mm,
         ))
     t1 = Table(
         [
             [
                 Paragraph("Posting Date:", styles["field-label"]),
                 Paragraph("%s" % self.data["posting_date"],
                           styles["field-value"]),
             ],
             [
                 Paragraph("Report Date:", styles["field-label"]),
                 Paragraph("%s" % self.data["report_date"],
                           styles["field-value"])
             ],
         ],
         style=styles["main-table"],
         colWidths=(24 * mm, 45 * mm),
         rowHeights=5.6 * mm,
     )
     t2 = Table(
         [[
             Table([[
                 Paragraph("Type:", styles["field-label"]),
                 Paragraph("%s" % self.data["type"], styles["field-value"]),
             ]],
                   style=styles["main-table"],
                   colWidths=(11.5 * mm, None))
         ],
          [
              Table([[
                  Paragraph("Case Number:", styles["field-label"]),
                  Paragraph("%s" % self.data["case_number"],
                            styles["field-value"]),
              ]],
                    style=styles["main-table"],
                    colWidths=(27 * mm, None))
          ]],
         style=styles["main-table"],
         rowHeights=5.6 * mm,
     )
     elems.append(Table([[t1, t2]], style=styles["main-table"]))
     elems.append(
         Table([[
             Paragraph("Comment:", styles["field-label"]),
             Paragraph("%s" % self.data["comment"], styles["field-value"]),
             Paragraph("%s" % self.data["name"], styles["field-value"]),
         ]],
               style=extend_table_style(styles["main-table"], [
                   ("VALIGN", (0, -1), (-1, -1), "TOP"),
                   ("TOPPADDING", (0, -1), (-1, -1), 0.6 * mm),
               ]),
               colWidths=(18 * mm, 51 * mm, None),
               rowHeights=25.5 * mm))
     return [self._create_section_table(elems)]
Пример #19
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_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
Пример #21
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
Пример #22
0
    def _section_2(self):
        elems = list()
        ps = styles["section-main"]
        ps_value = styles["field-value"]
        elems.extend([
            Spacer(0, 0.5 * mm),
            Paragraph(_("text-012"), ps),
            Spacer(0, 1 * mm),
        ])
        elems.append(
            Table([
                [
                    CustomXBox(2.7 * mm, value=self.data["field-010"]),
                    Paragraph("1.", ps),
                    Paragraph(_("text-013"), ps),
                ],
                [
                    None, None,
                    Table(
                        [[None, None, None],
                         [
                             Paragraph(self.data["field-011"], ps_value), None,
                             None
                         ], [
                             Paragraph(_("text-014"), ps),
                         ],
                         [
                             Paragraph(self.data["field-012"], ps_value),
                             Paragraph(self.data["field-013"], ps_value),
                             Paragraph(self.data["field-014"], ps_value),
                         ],
                         [
                             Paragraph(_("text-015"), ps),
                             Paragraph(_("text-016"), ps),
                             Paragraph(_("text-017"), ps),
                         ]],
                        style=extend_table_style(styles["main-table"], [
                            ("LINEBELOW", (0, 1), (-1, 1), 0.2 * mm, "black"),
                            ("LINEBELOW", (0, 3), (-1, 3), 0.2 * mm, "black"),
                        ]),
                        colWidths=[37 * mm, 26 * mm, 31 * mm],
                        rowHeights=[
                            1 * mm, 9 * mm, 6.5 * mm, 9 * mm, 6.5 * mm
                        ],
                    )
                ],
            ],
                  style=extend_table_style(styles["main-table"], [
                      ("LEFTPADDING", (2, 1), (2, 1), 2.5 * mm),
                  ]),
                  colWidths=[4 * mm, 6 * mm, None],
                  spaceAfter=9.5 * mm))
        col_text = _("text-018")
        col_width = stringWidth(col_text, ps.fontName, ps.fontSize) + 1 * mm
        elems.append(
            Table([
                [
                    CustomXBox(2.7 * mm, value=self.data["field-015"]),
                    Paragraph("2.", ps),
                    Paragraph(col_text, ps),
                    Paragraph(self.data["field-016"], ps_value), None
                ],
                [
                    Paragraph(_("text-019"), ps),
                ],
                [None],
                [
                    CustomXBox(2.7 * mm, value=self.data["field-017"]),
                    Paragraph("3.", ps),
                    Paragraph(_("text-020"), ps),
                ],
                [Paragraph(self.data["field-018"], ps_value)],
                [
                    Paragraph(_("text-021"), ps),
                ],
            ],
                  style=extend_table_style(styles["main-table"], [
                      ("LINEBELOW", (3, 0), (3, 0), 0.2 * mm, "black"),
                      ("SPAN", (0, 1), (-1, 1)),
                      ("SPAN", (2, 3), (3, 3)),
                      ("LINEBELOW", (0, 4), (-1, 4), 0.2 * mm, "black"),
                      ("SPAN", (0, 4), (-1, 4)),
                      ("SPAN", (0, 5), (-1, 5)),
                  ]),
                  colWidths=[4 * mm, 4.5 * mm, col_width, 31.5 * mm, None],
                  rowHeights=5 * mm))
        elems.extend([
            Spacer(0, 5 * mm),
            self._create_section_spacer(),
            Spacer(0, 2 * mm),
        ])

        return elems