Skip to content

Commit

Permalink
Merge pull request #568 from PAWECOGmbH/development
Browse files Browse the repository at this point in the history
Dev to staging
  • Loading branch information
ptruessel authored Nov 21, 2024
2 parents 302918d + 9a71355 commit 3b158ba
Show file tree
Hide file tree
Showing 10 changed files with 481 additions and 175 deletions.
18 changes: 13 additions & 5 deletions www/backend/core/com/book.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -364,10 +364,10 @@ component displayname="book" output="false" {
}


} else {

// From yearly to monthly
} else if (local.currentProduct.recurring eq "yearly" and local.recurring eq "monthly") {

// Define the start date (a downgrade begins at the end of the current plan)
// Define the start date (it begins at the end of the current plan)
local.startDate = dateFormat(local.currentProduct.endDate, "yyyy-mm-dd");

// Define the end date
Expand All @@ -380,6 +380,13 @@ component displayname="book" output="false" {
local.messageStruct['button'] = local.getTrans('btnYesDowngrade');


// its the same plan they have clicked
} else {

local.startDate = session.currentPlan.startDate;
local.endDate = session.currentPlan.endDate;
local.status = session.currentPlan.status;

}


Expand Down Expand Up @@ -458,11 +465,13 @@ component displayname="book" output="false" {
local.endDate = dateFormat(dateAdd("m", 1, local.startDate), "yyyy-mm-dd");
} else if (local.recurring eq "yearly") {
local.endDate = dateFormat(dateAdd("yyyy", 1, local.startDate), "yyyy-mm-dd");
} else {
// Set the end time to a date that will probably never be reached
local.endDate = dateFormat(createDate(3000, 1, 1), "yyyy-mm-dd");
}

local.status = "waiting";


local.messageStruct['title'] = local.getTrans('titDowngrade');
local.messageStruct['message'] = local.getTrans('txtYouAreDowngrading') & " " & lsDateFormat(local.getTime.utc2local(utcDate=local.startDate));
local.messageStruct['button'] = local.getTrans('btnYesDowngrade');
Expand Down Expand Up @@ -523,7 +532,6 @@ component displayname="book" output="false" {
// Change the plan or module
} else {


// If the new status is waiting
if (local.status eq "waiting") {

Expand Down
42 changes: 42 additions & 0 deletions www/backend/core/com/cancel.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ component displayname="cancel" output="false" {
"
)



if (local.qCheck.recordCount or session.sysadmin) {
variables.isAllowed = true;
} else {
Expand Down Expand Up @@ -179,4 +181,44 @@ component displayname="cancel" output="false" {
}


// Cancel waiting plan
public struct function cancelWaitingPlan() {

local.argsReturnValue = structNew();
local.argsReturnValue['message'] = "";
local.argsReturnValue['success'] = false;

if (variables.isAllowed) {

queryExecute (
options = {datasource = application.datasource},
params = {
customerID: {type: "numeric", value: variables.customerID},
planID: {type: "numeric", value: variables.thisID}
},
sql = "
DELETE FROM bookings
WHERE intCustomerID = :customerID
AND intPlanID = :planID
AND strStatus = 'waiting'
"
)

local.argsReturnValue['message'] = "OK";
local.argsReturnValue['success'] = true;

} else {

local.argsReturnValue['message'] = application.objLanguage.getTrans('msgNoAccess');

}

return local.argsReturnValue;


}


}
4 changes: 2 additions & 2 deletions www/backend/core/com/invoices.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -1481,7 +1481,7 @@ component displayname="invoices" output="false" {
#getTrans('titHello', local.customerData.language)# #local.invoicePerson#<br><br>
#getTrans('msgThanksForPurchaseFindInvoice', local.customerData.language)#<br><br>
#getTrans('txtDownloadInvoice', local.customerData.language)#<br><br>
<a href='#local.dl_link#' style='border-bottom: 10px solid ##337ab7; border-top: 10px solid ##337ab7; border-left: 20px solid ##337ab7; border-right: 20px solid ##337ab7; background-color: ##337ab7; color: ##ffffff; text-decoration: none;' target='_blank'>#getTrans('btnDownloadInvoice', local.customerData.language)#</a>
<a class='mail-btn' href='#local.dl_link#' target='_blank'>#getTrans('btnDownloadInvoice', local.customerData.language)#</a>
<br><br>
#getTrans('txtRegards', local.customerData.language)#<br>
#getTrans('txtYourTeam', local.customerData.language)#<br>
Expand Down Expand Up @@ -1555,7 +1555,7 @@ component displayname="invoices" output="false" {
echo("
#getTrans('titHello', local.customerData.language)# #local.invoicePerson#<br><br>
#getTrans('txtPleasePayInvoice', local.customerData.language)#<br><br>
<a href='#local.dl_link#' style='border-bottom: 10px solid ##337ab7; border-top: 10px solid ##337ab7; border-left: 20px solid ##337ab7; border-right: 20px solid ##337ab7; background-color: ##337ab7; color: ##ffffff; text-decoration: none;' target='_blank'>#getTrans('txtViewInvoice', local.customerData.language)#</a>
<a class='mail-btn' href='#local.dl_link#' target='_blank'>#getTrans('txtViewInvoice', local.customerData.language)#</a>
<br><br>
#getTrans('txtRegards', local.customerData.language)#<br>
#getTrans('txtYourTeam', local.customerData.language)#<br>
Expand Down
Loading

0 comments on commit 3b158ba

Please sign in to comment.