Skip to content

Commit

Permalink
Merge pull request #917 from uktrade/LTD-1429-licence-reference-numbe…
Browse files Browse the repository at this point in the history
…r-on-pdf

Update siel pdf to display correct licence reference number
  • Loading branch information
kevincarrogan authored Feb 9, 2022
2 parents 0f5ce86 + 7bfb3df commit 41ce7bf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion api/letter_templates/context_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class Meta:
class LicenceSerializer(serializers.ModelSerializer):
class Meta:
model = Licence
fields = ["duration", "start_date", "end_date"]
fields = ["duration", "start_date", "end_date", "reference_code"]

start_date = serializers.DateField(format=DATE_FORMAT, input_formats=None)
end_date = serializers.SerializerMethodField()
Expand Down
8 changes: 4 additions & 4 deletions api/letter_templates/templates/letter_templates/siel.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ <h1>Standard Individual Export Licence</h1>
</td>
<td class="border-black" colspan="3">
<span class="cell__heading">2. Licence number</span>
<span class="cell__uppercase">{{ case_reference }}</span>
<span class="cell__uppercase">{{ licence.reference_code }}</span>
</td>
<td class="border-black" colspan="3">
<span class="cell__heading">3a. Commencement date</span>
Expand Down Expand Up @@ -242,7 +242,7 @@ <h1>Standard Individual Export Licence</h1>
</td>
<td class="border-black" colspan="3">
<span class="cell__heading">2. Licence number</span>
<span class="cell__uppercase">{{ case_reference }}</span>
<span class="cell__uppercase">{{ licence.reference_code }}</span>
</td>
<td class="border-black" colspan="3">
<span class="cell__heading">3a. Commencement date</span>
Expand Down Expand Up @@ -349,7 +349,7 @@ <h1>Standard Individual Export Licence</h1>
</td>
<td class="border-black" colspan="3">
<span class="cell__heading">2. Licence number</span>
<span class="cell__uppercase">{{ case_reference }}</span>
<span class="cell__uppercase">{{ licence.reference_code }}</span>
</td>
<td class="border-black" colspan="3">
<span class="cell__heading">3a. Commencement date</span>
Expand Down Expand Up @@ -541,7 +541,7 @@ <h1>Standard Individual Export Licence</h1>
</td>
<td class="border-black" colspan="3">
<span class="cell__heading">2. Licence number</span>
<span class="cell__uppercase">{{ case_reference }}</span>
<span class="cell__uppercase">{{ licence.reference_code }}</span>
</td>
<td class="border-black" colspan="3">
<span class="cell__heading">3a. Commencement date</span>
Expand Down
1 change: 1 addition & 0 deletions api/letter_templates/tests/test_context_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def _assert_licence(self, context, licence):
self.assertEqual(context["start_date"], licence.start_date.strftime(DATE_FORMAT))
self.assertEqual(context["duration"], licence.duration)
self.assertEqual(context["end_date"], add_months(licence.start_date, licence.duration))
self.assertEqual(context["reference_code"], licence.reference_code)

def _assert_party(self, context, party):
self.assertEqual(context["name"], party.name)
Expand Down

0 comments on commit 41ce7bf

Please sign in to comment.