Skip to content

Commit

Permalink
Merge branch 'master' into TM-196-LTM-Tasks-Integration
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisfoster76 committed Jan 11, 2022
2 parents a4f880e + 358a929 commit 3069a43
Show file tree
Hide file tree
Showing 10 changed files with 1,648 additions and 17 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@
- Run src\DevInstall.ps1
- DO NOT COMMIT THE UPDATED CERTIFICATE TO GIT

##### Install Elastic Search

- Follow the readme at [SFA.DAS.Activities] to install [Elastic Search]

##### Open the solution

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@
<None Include="Scripts\Manual\CON-1493-ExpireLegalAgreements.sql" />
<None Include="Scripts\Manual\CON-2796 Migrate And Add v5 Legal Agreement.sql" />
<None Include="Scripts\Manual\CON-3367 Migrate And Add v6 Legal Agreement.sql" />
<None Include="Scripts\Manual\CON-3968 Migrate And Add v7 Legal Agreement.sql" />
</ItemGroup>
<ItemGroup>
<RefactorLog Include="SFA.DAS.EmployerApprenticeshipsService.Database.refactorlog" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
-- Replace all pending v3 / v4 / v5 / v6 agreements with pending v7 agreement
UPDATE [employer_account].[EmployerAgreement]
SET TemplateId = 8
WHERE TemplateId IN (4, 5, 6, 7) AND StatusId = 1

UPDATE [employer_account].[AccountLegalEntity]
SET PendingAgreementVersion = 7
WHERE PendingAgreementVersion IN (3, 4, 5, 6)

-- Create a pending v7 agreement for all account legal entities (except those that have them)
INSERT INTO [employer_account].[EmployerAgreement] (TemplateId, StatusId, AccountLegalEntityId)
SELECT 8, 1, Id
FROM [employer_account].[AccountLegalEntity]
WHERE PendingAgreementVersion IS NULL AND PendingAgreementId IS NULL AND Deleted IS NULL AND SignedAgreementVersion != 7

UPDATE ale
SET PendingAgreementVersion = 7, PendingAgreementId = ea.Id
FROM [employer_account].[AccountLegalEntity] ale
JOIN [employer_account].[EmployerAgreement] ea ON ea.AccountLegalEntityId = ale.Id AND ea.TemplateId = 8 AND ea.StatusId = 1
WHERE PendingAgreementVersion IS NULL AND PendingAgreementId IS NULL AND Deleted IS NULL
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,12 @@ BEGIN
INSERT INTO [employer_account].[EmployerAgreementTemplate] (Id, PartialViewName, VersionNumber, AgreementType, CreatedDate, PublishedDate)
VALUES (7, '_Agreement_V6', 6, 2, GETDATE(), Convert(DateTime,'2021-5-19'))
SET IDENTITY_INSERT [employer_account].[EmployerAgreementTemplate] OFF
END

IF (NOT EXISTS (SELECT 1 FROM [employer_account].[EmployerAgreementTemplate] WHERE PartialViewName = '_Agreement_V7'))
BEGIN
SET IDENTITY_INSERT [employer_account].[EmployerAgreementTemplate] ON
INSERT INTO [employer_account].[EmployerAgreementTemplate] (Id, PartialViewName, VersionNumber, AgreementType, CreatedDate, PublishedDate)
VALUES (8, '_Agreement_V7', 7, 2, GETDATE(), Convert(DateTime,'2022-01-11'))
SET IDENTITY_INSERT [employer_account].[EmployerAgreementTemplate] OFF
END
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ public static string InsetText(this AgreementTemplateViewModel agreementTemplate
return "This is a new agreement.";
case 4:
return HasSignedVariationOfv3Agreement(organisationAgreementViewModel) ? "This is a variation to the agreement we published 9 January 2020. You only need to accept it if you want to access incentive payments for hiring a new apprentice." : "This is a new agreement.";
case 5:
case 6:
case var _ when agreementTemplate.VersionNumber >= 5:
return HasSignedVariationOfv3Agreement(organisationAgreementViewModel) ? "This is a variation to the agreement we published 9 January 2020." : "This is a new agreement.";
default:
return string.Empty;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,7 @@
<Content Include="Views\Shared\_Agreement_v6.cshtml" />
<Content Include="Views\SearchOrganisation\ConfirmOrganisationDetails.cshtml" />
<Content Include="Views\Home\TermsAndConditions.cshtml" />
<Content Include="Views\Shared\_Agreement_v7.cshtml" />
<Content Include="Views\EmployerAgreement\_AwaitingAcceptance.cshtml" />
<Content Include="Views\EmployerAgreement\_AcceptedAgreement.cshtml" />
<Content Include="Views\Home\TermsAndConditionsOverview.cshtml" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<h1 class="govuk-heading-xl">Your organisations and agreements</h1>
<p class="govuk-body">You must add each organisation that will contract with your training providers.</p>
<p class="govuk-body">Add organisation(s) that employ apprentices.</p>
<div class="govuk-inset-text">
<p>To add apprentices you need to tell us which organisation (employer) they will be working for.</p>
<p>If you work with more than one organisation, you need to add them here; they will need their own agreement with the ESFA.</p>
</div>
<p class="govuk-body">You can add as many <a class="govuk-link" href="https://www.gov.uk/government/publications/employment-allowance-more-detailed-guidance" target="_blank">connected organisations</a> as you need to.</p>
<p class="govuk-body">Transfers status:&nbsp;
<span>
Expand Down Expand Up @@ -61,7 +65,9 @@
@foreach (var employerAgreement in Model.Data.EmployerAgreementsData.EmployerAgreements)
{
<tr class="govuk-table__row">
<td class="govuk-table__cell">@employerAgreement.LegalEntity.Name</td>
<td class="govuk-table__cell">@employerAgreement.LegalEntity.Name
<span class="govuk-caption-m">Agreement ID: @employerAgreement.LegalEntity.AccountLegalEntityPublicHashedId</span>
</td>
<td class="govuk-table__cell">
@if (employerAgreement.HasPendingAgreement)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ else
{
<div class="card">
<h3 class="heading-medium"><a href="@Url.EmployerIncentivesAction()">Your hire a new apprentice payments</a></h3>
<p>View applications and change your payment details.</p>
<p>Apply for the payment, view applications and change your payment details</p>
</div>
}

Expand Down Expand Up @@ -164,6 +164,8 @@ else
</div>
</section>

@Html.GetContentByType("covid_section")


<div class="panel panel-filled">
<h3 class="heading-medium">Help us improve this service</h3>
Expand Down Expand Up @@ -285,6 +287,8 @@ else
</section>
}



@*@if (Model.Data.RequiresAgreementSigning > 0)
{
<section>
Expand Down
Loading

0 comments on commit 3069a43

Please sign in to comment.