-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from CristianoMafraJunior/damdfe
Geração DAMDFE
- Loading branch information
Showing
16 changed files
with
1,399 additions
and
9 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
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
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
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,10 @@ | ||
from .config import DamdfeConfig, DecimalConfig, FontType, Margins | ||
from .damdfe import Damdfe | ||
|
||
__all__ = [ | ||
"Damdfe", | ||
"DamdfeConfig", | ||
"DecimalConfig", | ||
"FontType", | ||
"Margins", | ||
] |
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,32 @@ | ||
from dataclasses import dataclass, field | ||
from enum import Enum | ||
from io import BytesIO | ||
from numbers import Number | ||
from typing import Union | ||
|
||
|
||
class FontType(Enum): | ||
COURIER = "Courier" | ||
TIMES = "Times" | ||
|
||
|
||
@dataclass | ||
class Margins: | ||
top: Number = 5 | ||
right: Number = 5 | ||
bottom: Number = 5 | ||
left: Number = 5 | ||
|
||
|
||
@dataclass | ||
class DecimalConfig: | ||
price_precision: int = 4 | ||
quantity_precision: int = 4 | ||
|
||
|
||
@dataclass | ||
class DamdfeConfig: | ||
logo: Union[str, BytesIO, bytes] = None | ||
margins: Margins = field(default_factory=Margins) | ||
decimal_config: DecimalConfig = field(default_factory=DecimalConfig) | ||
font_type: FontType = FontType.TIMES |
Oops, something went wrong.