{"body":"sub renderOLD(Invoice $inv --> Str) is export {\n    use FStrings;\n    qq:to/RENDER/;\n    Invoice: $inv.id()\n    Date:    $inv.date()\n    Client:  $inv.client()\n\n    {f('Description' -f 30, 'Hours' +f 6, 'Rate' +f 8, 'Subtotal' +f 10)}\n    { \"-\" x 58 }\n    $inv.items.map({\n        f(.description -f 30, .hours +f 6.1, .rate +f 8.2, .subtotal +f 10.2)\n    }).join(\"\\n\")\n    { \"-\" x 58 }\n    {f('Subtotal'  +f 46, $inv.subtotal +f 10.2)},\n    {f($inv.label      +f 46, $inv.tax      +f 10.2)},\n    {f('Total'     +f 46, $inv.total    +f 10.2)};\n    RENDER\n}\n\nsub renderOLD2(Invoice $inv --> Str) is export {\n    use FStrings;\n    qq:to/RENDER/;\n    Invoice: $inv.id()\n    Date:    $inv.date()\n    Client:  $inv.client()\n\n    &sprintf(\"%-30s %6s %8s %10s\", \"Description\", \"Hours\", \"Rate\", \"Subtotal\")\n    { \"-\" x 58 }\n    $inv.items.map({\n        sprintf(\"%-30s %6.1f %8.2f %10.2f\",\n            .description, .hours, .rate, .subtotal\n                )\n    }).join(\"\\n\")\n    { \"-\" x 58 }\n    &sprintf(\"%46s %10.2f\", \"Subtotal\",  $inv.subtotal)\n    &sprintf(\"%46s %10.2f\", $inv.label,  $inv.tax)\n    &sprintf(\"%46s %10.2f\", \"Total\",     $inv.total)\n    RENDER\n}\n\nsub render(Invoice $inv --> Str) is export {\n    use FStrings;\n    do given $inv {\n        \"Invoice: {.id}\",\n        \"Date:    {.date}\",\n        \"Client:  {.client}\",\n        \"\",\n        f( 'Description' -f 30, 'Hours' +f 6, 'Rate' +f 8, 'Subtotal' +f 10 ),\n        \"-\" x 58,\n        |.items.map({ f( .description -f 30, .hours +f 6.1, .rate +f 8.2, .subtotal +f 10.2) }),\n        \"-\" x 58,\n        f('Subtotal'  +f 46, .subtotal +f 10.2),\n        f(.label      +f 46, .tax      +f 10.2),\n        f( 'Total'    +f 46, .total    +f 10.2);\n    } .join(\"\\n\");\n}","name":"","extension":"txt","url":"https://www.irccloud.com/pastebin/znMpj81v","modified":1778427691,"id":"znMpj81v","size":1716,"lines":56,"own_paste":false,"theme":"","date":1778427691}