forked from botswana-harvard/edc-pharmacy
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add watermarls to reports and labels during testing
- Loading branch information
Showing
20 changed files
with
410 additions
and
196 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from .draw_bulk_stock_label_code39 import draw_bulk_stock_label_code39 | ||
from .draw_bulk_stock_label_code128 import draw_bulk_stock_label_code128 | ||
from .draw_label_watermark import draw_label_watermark | ||
from .draw_patient_stock_label_code128 import draw_patient_stock_label_code128 | ||
from .draw_vertical_barcode_only_code128 import draw_vertical_barcode_only_code128 | ||
from .label_data import LabelData | ||
from .print_sheets import print_sheets |
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,20 @@ | ||
from django.conf import settings | ||
from reportlab.graphics.shapes import Group, String | ||
from reportlab.lib import colors | ||
|
||
|
||
def draw_label_watermark(label, width, height, **string_options): | ||
if word := getattr(settings, "EDC_PHARMACY_LABEL_WATERMARK_WORD", None): | ||
string_opts = dict( | ||
fontName="Helvetica", | ||
fontSize=28, | ||
textAnchor="middle", | ||
fillColor=colors.Color(0.5, 0.5, 0.5, alpha=0.7), | ||
) | ||
string_opts.update(string_options) | ||
text_group = Group() | ||
watermark = String(height / 2, 10, word, **string_opts) | ||
text_group.add(watermark) | ||
text_group.translate(width / 3, height - height * 0.95) | ||
text_group.rotate(45) | ||
label.add(text_group) |
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 was deleted.
Oops, something went wrong.
Empty file.
36 changes: 36 additions & 0 deletions
36
edc_pharmacy/migrations/0052_formulation_imp_formulation_imp_description_and_more.py
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,36 @@ | ||
# Generated by Django 5.1.2 on 2024-11-22 13:53 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
( | ||
"edc_pharmacy", | ||
"0051_alter_historicalstocktransferconfirmationitem_options_and_more", | ||
), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="formulation", | ||
name="imp", | ||
field=models.BooleanField(default=False), | ||
), | ||
migrations.AddField( | ||
model_name="formulation", | ||
name="imp_description", | ||
field=models.CharField(blank=True, max_length=250, null=True), | ||
), | ||
migrations.AddField( | ||
model_name="historicalformulation", | ||
name="imp", | ||
field=models.BooleanField(default=False), | ||
), | ||
migrations.AddField( | ||
model_name="historicalformulation", | ||
name="imp_description", | ||
field=models.CharField(blank=True, max_length=250, null=True), | ||
), | ||
] |
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
Oops, something went wrong.