Browse Source

report fix

main
Madiwka3 1 year ago
parent
commit
4df7e79b89
2 changed files with 34 additions and 24 deletions
  1. +10
    -0
      app/db/repository/report.py
  2. +24
    -24
      app/report1.pdf

+ 10
- 0
app/db/repository/report.py View File

@@ -153,6 +153,13 @@ def get_pdf(driver_id: int, db: Session):

vehicle = report_data["Driver"]["AssignedVehicle"].__dict__
print(vehicle)
if (
vehicle["CurrentLocation"] is None
or vehicle["CurrentLocation"] == ""
or vehicle["CurrentLocation"] == False
or len(vehicle["CurrentLocation"]) == 0
):
vehicle["CurrentLocation"] = ["Unknown", "Unknown"]
loc = vehicle["CurrentLocation"][0]
if len(vehicle["CurrentLocation"]) > 1:
loc += ", " + vehicle["CurrentLocation"][1]
@@ -211,7 +218,10 @@ def get_pdf(driver_id: int, db: Session):
else:
task_values = [entry["DistanceAtTime"] for entry in tasks_data]
task_dates = [
# if type(entry["EndDateTime"]) == str parse, else just use
parser.parse(entry["EndDateTime"]).strftime("%m/%d/%Y, %H:%M:%S")
if type(entry["EndDateTime"]) == str
else entry["EndDateTime"].strftime("%m/%d/%Y, %H:%M:%S")
for entry in tasks_data
]



+ 24
- 24
app/report1.pdf View File

@@ -2,7 +2,7 @@
%“Œ‹ž ReportLab Generated PDF document http://www.reportlab.com
1 0 obj
<<
/F1 2 0 R /F2 3 0 R /F3 5 0 R
/F1 2 0 R /F2 3 0 R /F3 7 0 R
>>
endobj
2 0 obj
@@ -27,11 +27,6 @@ endobj
endobj
5 0 obj
<<
/BaseFont /Times-Roman /Encoding /WinAnsiEncoding /Name /F3 /Subtype /Type1 /Type /Font
>>
endobj
6 0 obj
<<
/Contents 13 0 R /MediaBox [ 0 0 612 792 ] /Parent 11 0 R /Resources <<
/Font 1 0 R /ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ]
>> /Rotate 0 /Trans <<
@@ -40,7 +35,7 @@ endobj
/Type /Page
>>
endobj
7 0 obj
6 0 obj
<<
/Contents 14 0 R /MediaBox [ 0 0 612 792 ] /Parent 11 0 R /Resources <<
/Font 1 0 R /ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ]
@@ -50,6 +45,11 @@ endobj
/Type /Page
>>
endobj
7 0 obj
<<
/BaseFont /Times-Roman /Encoding /WinAnsiEncoding /Name /F3 /Subtype /Type1 /Type /Font
>>
endobj
8 0 obj
<<
/Contents 15 0 R /MediaBox [ 0 0 612 792 ] /Parent 11 0 R /Resources <<
@@ -67,42 +67,42 @@ endobj
endobj
10 0 obj
<<
/Author (\(anonymous\)) /CreationDate (D:20231118192517-06'00') /Creator (\(unspecified\)) /Keywords () /ModDate (D:20231118192517-06'00') /Producer (ReportLab PDF Library - www.reportlab.com)
/Author (\(anonymous\)) /CreationDate (D:20231120183332-06'00') /Creator (\(unspecified\)) /Keywords () /ModDate (D:20231120183332-06'00') /Producer (ReportLab PDF Library - www.reportlab.com)
/Subject (\(unspecified\)) /Title (\(anonymous\)) /Trapped /False
>>
endobj
11 0 obj
<<
/Count 4 /Kids [ 4 0 R 6 0 R 7 0 R 8 0 R ] /Type /Pages
/Count 4 /Kids [ 4 0 R 5 0 R 6 0 R 8 0 R ] /Type /Pages
>>
endobj
12 0 obj
<<
/Filter [ /ASCII85Decode /FlateDecode ] /Length 880
/Filter [ /ASCII85Decode /FlateDecode ] /Length 837
>>
stream
GauHI?#u2p'Re<2\<#o'mKX;J;j4YbVJ9>41\PZ3CJ"ag!i_B5mq#X86F%0CdFehWbIM9SSiq:k5]BPJNAH*/&\L<*5T)uIJ\$jLd/qUfaj18NaCtX'a:O:bU1;/WJn_T%_OM$;(snpf@BAUa;rY;1^5\HJCgJBJZ@H`$<^l[$U'HK\^oL`H:3hP'J(h]AVsR!bh\<Cu"7th&(^h7nVM;";g;9PTQo#Xc6^Mf"!),R-^^^3/27/0-MoZARoRWX!Z*PVr.-:,b>4"M19X`+26UTi94nN`e&##me$W0r7KEg0"WCIofFK/ac$;l'qo*X@##?VG*0ZNEED7!WJEG(\1dK)B2>O!Ei1k/9%1)m>g21DFn9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&Mdoas)@V(i303eIt(l$-F@qrG=JC[jHE].O%Q4M5PeL[3%'n$"o>!qsZY?jNf#h=W=pqjcU95/NV_2aS=o]?8!s7"3%r]b"%^Tm-Pa.`<o";F$0MGY@ZmP14X(il\9V\2ht_bZl^p-lWlRGf-dB]L"^<5c;gBN4U[31Nf.%O:'&*D&7k00CQZLPdKM1^+[jmV?N+Jg?7piihKBQ'Z"hdL.5:?3)?rV"t&YoVCj/77VE0,t;"Ye[>I=6^Z4fbh0d@LI@qXPL1M16uFaue-:RR7"fDJ8!9:+hWJ[C.T1*am?d4#NgZn\'-.P0\Rh4sY8lVualCj&I+'a@*TW]+rE(E[ilH`u]Q3O@/:QA+I[>>pA_b\s[S1k6N9tiHP#<-$*n&?+d*]<C^@`P;LOJPp)Arr!9&N#\]GrqX[m@F_@p;;q#1b<7^W;:d(<2Z%7]XZ#aWC,O%f/<]kf9sA(!qLXC&QP]5jacqdf+-pftF*Gkb1u[@8bmogUqt6[5eYY,R\Bl9_H&$5/@6)H^DSJ>Di^&U&,[\qcMIe$uo$OmTS<0eAZb")O3ID7)3rK:!&i&gXIAG5pjn830oBB9SP^fl%3nVeUF.[`-&c5.g2!u8AnOTI,)X0:(&hKZnafNJrD'CL5J+GN<q.)l%O#6_Jo36p(qm>O?N~>endstream
endobj
xref
0 16
@@ -112,20 +112,20 @@ xref
0000000231 00000 n
0000000343 00000 n
0000000538 00000 n
0000000647 00000 n
0000000842 00000 n
0000000733 00000 n
0000000928 00000 n
0000001037 00000 n
0000001232 00000 n
0000001301 00000 n
0000001585 00000 n
0000001663 00000 n
0000002634 00000 n
0000003870 00000 n
0000005116 00000 n
0000002591 00000 n
0000002884 00000 n
0000003147 00000 n
trailer
<<
/ID
[<ee664bded2e591a430d712699aba8e65><ee664bded2e591a430d712699aba8e65>]
[<a5b8fe316664d3b232625c7797fb5385><a5b8fe316664d3b232625c7797fb5385>]
% ReportLab generated PDF document -- digest (http://www.reportlab.com)

/Info 10 0 R
@@ -133,5 +133,5 @@ trailer
/Size 16
>>
startxref
5949
4013
%%EOF

Loading…
Cancel
Save