-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix typo in MX extension * Complete and set proper ISO code to Greek's locale * Add IAPR template for Greek invoices
- Loading branch information
Showing
16 changed files
with
870 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// Package gr provides additional templates and helper methods | ||
// for the Greek tax regime. | ||
package gr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
package gr | ||
|
||
import ( | ||
"github.com/invopop/gobl" | ||
"github.com/invopop/gobl/regimes/gr" | ||
"github.com/invopop/gobl.html/components/images" | ||
) | ||
|
||
templ IAPR(env *gobl.Envelope) { | ||
if hasStamps(env) { | ||
<style type="text/css"> | ||
.iapr { | ||
break-inside: avoid; | ||
font-size: 7pt; | ||
line-height: 1.6em; | ||
display: flex; | ||
align-items: top; | ||
} | ||
.iapr .image { | ||
margin-right: 6mm; | ||
} | ||
.iapr img { | ||
width: 30mm; | ||
height: 30mm; | ||
} | ||
.iapr .value { | ||
font-family: monospace; | ||
} | ||
</style> | ||
<section class="iapr"> | ||
if st := env.Head.GetStamp(gr.StampIAPRQR); st != nil { | ||
<div class="image"> | ||
<a href={ templ.URL(st.Value) }> | ||
@images.QR(st.Value) | ||
</a> | ||
</div> | ||
} | ||
<div class="text"> | ||
if st := env.Head.GetStamp(gr.StampIAPRHash); st != nil { | ||
<div> | ||
<b>Σήμανση:</b> | ||
<span class="value">{ st.Value }</span> | ||
</div> | ||
} | ||
if st := env.Head.GetStamp(gr.StampIAPRUID); st != nil { | ||
<div> | ||
<b>UNIQUE ID:</b> | ||
<span class="value">{ st.Value }</span> | ||
</div> | ||
} | ||
if st := env.Head.GetStamp(gr.StampIAPRMark); st != nil { | ||
<div> | ||
<b>ΜΑΡΚ:</b> | ||
<span class="value">{ st.Value }</span> | ||
</div> | ||
} | ||
if st := env.Head.GetStamp(gr.StampIAPRProvider); st != nil { | ||
<div> | ||
<b>Υ.ΠΑ.Η.Ε.Σ:</b> | ||
<span>{ st.Value }</span> | ||
</div> | ||
} | ||
</div> | ||
</section> | ||
} | ||
} | ||
|
||
func hasStamps(env *gobl.Envelope) bool { | ||
return env.Head.GetStamp(gr.StampIAPRQR) != nil | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.