Skip to content

Commit 968df78

Browse files
committed
Initial
1 parent 902dd59 commit 968df78

File tree

2 files changed

+177
-0
lines changed

2 files changed

+177
-0
lines changed

satdigitalinvoice/gui_functions.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,22 @@ def generate_pdf_template(template_name, fields, target=None, css_string=None):
454454
with open(target + ".sha1_" + hex_dig[-8:] + ".txt", "w") as f:
455455
f.write(md5_document)
456456

457+
def generate_pdf_template_basic(template_name, fields, target=None, css_string=None):
458+
template = facturacion_environment.get_template(template_name)
459+
md5_document = template.render(
460+
fields
461+
)
462+
463+
html = markdown(md5_document)
464+
pdf = HTML(string=html).write_pdf(
465+
target=target,
466+
stylesheets=[
467+
os.path.join(SOURCE_DIRECTORY, "markdown_styles", "markdown6.css"),
468+
CSS(
469+
string=css_string
470+
)
471+
]
472+
)
457473

458474

459475
def mf_pago_fmt(cfdi):
Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
@page {
2+
@bottom-center{
3+
content: counter(page) " / " counter(pages);
4+
font:13px Verdana,sans-serif;
5+
}
6+
}
7+
@page { width: Letter; margin: 1.6cm 1.6cm 1.6cm 1.6cm; }
8+
9+
/* Main CSS from the Markdown Viewer Extension */
10+
body,h1{
11+
color:#000
12+
}
13+
body{
14+
background-color:#fff;
15+
font:13px Verdana,sans-serif
16+
}
17+
a:link,a:visited{
18+
color:#00f;
19+
text-decoration:none
20+
}
21+
a:visited{
22+
color:#00a
23+
}
24+
a:active,a:hover{
25+
color:#f60;
26+
text-decoration:underline
27+
}
28+
* html code,* html pre{
29+
font-size:101%
30+
}
31+
code,pre{
32+
font-size:11px;
33+
font-family:monaco,courier,consolas,monospace
34+
}
35+
pre{
36+
border:1px solid #c7cfd5;
37+
background:#f1f5f9;
38+
margin:20px 0;
39+
padding:8px;
40+
text-align:left
41+
}
42+
hr,table{
43+
width:100%
44+
}
45+
hr{
46+
color:#919699;
47+
size:1;
48+
noshade:"noshade"
49+
}
50+
h1{
51+
margin-top:1em;
52+
margin-bottom:25px;
53+
font-size:30px
54+
}
55+
h1,h2,h3,h4,h5,h6{
56+
font-family:Verdana,sans-serif;
57+
font-weight:700
58+
}
59+
h2,table td,table th{
60+
border-bottom:1px solid #919699
61+
}
62+
h2{
63+
margin-top:2.5em;
64+
color:#000;
65+
padding-bottom:2px;
66+
font-size:24px
67+
}
68+
h3,h4,h5,h6{
69+
margin-top:2em;
70+
margin-bottom:.5em;
71+
font-size:17px;
72+
color:#000
73+
}
74+
h4,h5,h6{
75+
font-size:15px
76+
}
77+
h5,h6{
78+
margin-top:20px;
79+
padding:0;
80+
font-size:13px
81+
}
82+
h6{
83+
font-size:11px
84+
}
85+
p{
86+
margin-top:0;
87+
margin-bottom:10px
88+
}
89+
ol,ol ol,ul{
90+
margin:0 0 0 30px;
91+
padding:0 0 12px 6px
92+
}
93+
ul{
94+
list-style:square outside
95+
}
96+
li{
97+
margin-top:7px
98+
}
99+
ol,ol ol{
100+
list-style-type:decimal;
101+
list-style-position:outside
102+
}
103+
ol ol{
104+
list-style-type:lower-alpha;
105+
margin:7px 0 0 30px;
106+
padding:0 0 0 10px
107+
}
108+
ul ul{
109+
margin-left:40px;
110+
padding:0 0 0 6px
111+
}
112+
li>p{
113+
display:inline
114+
}
115+
li>a+p,li>p+p{
116+
display:block
117+
}
118+
table{
119+
border-top:1px solid #919699;
120+
border-left:1px solid #919699;
121+
border-spacing:0
122+
}
123+
table td,table th{
124+
font-size:12px;
125+
border-right:1px solid #919699
126+
}
127+
table th{
128+
background:#e2e2e2;
129+
padding:4px 8px
130+
}
131+
table th p{
132+
font-weight:700
133+
}
134+
table td{
135+
padding:8px;
136+
vertical-align:top
137+
}
138+
table td p,table th p{
139+
margin-bottom:0
140+
}
141+
table td p+p,table td p+p+p{
142+
margin-top:5px
143+
}
144+
form{
145+
margin:0
146+
}
147+
button{
148+
margin:3px 0 10px
149+
}
150+
input,select{
151+
vertical-align:middle;
152+
padding:0;
153+
margin:0 0 5px
154+
}
155+
select{
156+
margin:0 0 3px
157+
}
158+
textarea{
159+
margin:0 0 10px;
160+
width:100%
161+
}

0 commit comments

Comments
 (0)