Announcements
public static void main(Args _args)
{
BusinessDocumentSubmission submission;
BusinessDocumentExecutionActionTmp executionActionTmp;
BusinessDocumentActionOutputFileTmp actionOutputFileTmp;
Projinvoicejour projinvoicejour,projinvoicejourLoc;
BusinessDocumentSubmissionExternal submissionExternal;
BusinessDocumentInfo documentInfo;
ProjType projectType;
PSAProjProposalProj projProposalProj;
PrintMgmtDocInstance printMgmtDocInstance;
PrintMgmtReportFormat printMgmtReportFormat;
PrintMgmtSettings printMgmtSetting;
PrintMgmtReportFormatName reportFormatName;
SRSPrintDestinationSettings settings;
select * from submission
join projinvoicejour
where projinvoicejour.RecId == submission.REFRECID
&& projinvoicejour.TableId == submission.REFTABLEID
&& projinvoicejour.ProjInvoiceId == 'PINV-003773';
select firstonly ProjId from projProposalProj
exists join projinvoicejourLoc
where projinvoicejourLoc.ProposalId == projProposalProj.ProjProposalId
&& projinvoicejourLoc.RecId == projinvoicejour.RecId;
projectType = projProposalProj.projTable().Type;
ALSProjInvoicePrintController controller = new ALSProjInvoicePrintController();
if (projectType == ProjType::FixedPrice)
{
select printMgmtDocInstance where printMgmtDocInstance.DocumentType == PrintMgmtDocumentType::ISLProjectInvoiceFP
join printMgmtSetting where printMgmtSetting.ParentId == printMgmtDocInstance.RecId
join printMgmtReportFormat where printMgmtReportFormat.RecId == printMgmtSetting.ReportFormat &&
printMgmtReportFormat.DocumentType == PrintMgmtDocumentType::ISLProjectInvoiceFP;
controller.parmReportName(printMgmtReportFormat.Name);
// Change print settings as needed
settings = controller.parmReportContract().parmPrintSettings();
settings.printMediumType(SRSPrintMediumType::File);
settings.fileFormat(SRSReportFileFormat::PDF);
settings.fileName('UserLicenseCount.pdf');
}
else
{
select printMgmtDocInstance where printMgmtDocInstance.DocumentType == PrintMgmtDocumentType::ISLProjectInvoiceTM
join printMgmtSetting where printMgmtSetting.ParentId == printMgmtDocInstance.RecId
join printMgmtReportFormat where printMgmtReportFormat.RecId == printMgmtSetting.ReportFormat &&
printMgmtReportFormat.DocumentType == PrintMgmtDocumentType::ISLProjectInvoiceTM;
controller.parmReportName(printMgmtReportFormat.Name);
// Change print settings as needed
settings = controller.parmReportContract().parmPrintSettings();
settings.printMediumType(SRSPrintMediumType::File);
settings.fileFormat(SRSReportFileFormat::PDF);
settings.fileName('UserLicenseCount.pdf');
}
controller.parmArgs(_args);
controller.parmShowDialog(false);
controller.startOperation();
}
internal final class DTSubmissionXml
{
/// <summary>
/// Class entry point. The system will call this method when a designated menu
/// is selected or when execution starts and this class is set as the startup class.
/// </summary>
/// <param name = "_args">The specified arguments.</param>
public static void main(Args _args)
{
BusinessDocumentSubmission submission;
BusinessDocumentExecutionActionTmp executionActionTmp;
BusinessDocumentActionOutputFileTmp actionOutputFileTmp;
Projinvoicejour projinvoicejour,projinvoicejourLoc;
BusinessDocumentSubmissionExternal submissionExternal;
BusinessDocumentInfo documentInfo;
ProjType projectType;
PSAProjProposalProj projProposalProj;
PrintMgmtDocInstance printMgmtDocInstance;
PrintMgmtReportFormat printMgmtReportFormat;
PrintMgmtSettings printMgmtSetting;
PrintMgmtReportFormatName reportFormatName;
select * from submission
join projinvoicejour
where projinvoicejour.RecId == submission.REFRECID
&& projinvoicejour.TableId == submission.REFTABLEID
&& projinvoicejour.ProjInvoiceId == 'PINV-003773';
select firstonly ProjId from projProposalProj
exists join projinvoicejourLoc
where projinvoicejourLoc.ProposalId == projProposalProj.ProjProposalId&&
projinvoicejourLoc.RecId == projinvoicejour.RecId;
projectType = projProposalProj.projTable().Type;
ALSProjInvoicePrintController controller = new ALSProjInvoicePrintController();
if (projectType == ProjType::FixedPrice)
{
select printMgmtDocInstance where printMgmtDocInstance.DocumentType == PrintMgmtDocumentType::ISLProjectInvoiceFP
join printMgmtSetting where printMgmtSetting.ParentId == printMgmtDocInstance.RecId
join printMgmtReportFormat where printMgmtReportFormat.RecId == printMgmtSetting.ReportFormat &&
printMgmtReportFormat.DocumentType == PrintMgmtDocumentType::ISLProjectInvoiceFP;
controller.parmReportName(printMgmtReportFormat.Name);
}
else
{
select printMgmtDocInstance where printMgmtDocInstance.DocumentType == PrintMgmtDocumentType::ISLProjectInvoiceTM
join printMgmtSetting where printMgmtSetting.ParentId == printMgmtDocInstance.RecId
join printMgmtReportFormat where printMgmtReportFormat.RecId == printMgmtSetting.ReportFormat &&
printMgmtReportFormat.DocumentType == PrintMgmtDocumentType::ISLProjectInvoiceTM;
controller.parmReportName(printMgmtReportFormat.Name);
}
controller.parmArgs(_args);
controller.parmShowDialog(false);
controller.startOperation();
submission = BusinessDocumentSubmission::find(submission.RefTableId,submission.RefRecId);
submissionExternal = BusinessDocumentSubmissionExternal::find(submission.RefTableId,submission.RefRecId);
if(submission)
{
documentInfo = BusinessDocumentServiceController::newSubmission(submission).lookupDocumentInfo();
if(documentInfo)
{
executionActionTmp = documentInfo.getExecutionActions();
if(executionActionTmp)
{
if(executionActionTmp.Status == 'Completed' && executionActionTmp.Name == 'Prepare document for submit for Saudi Arabia Zatca service')
{
actionOutputFileTmp = documentInfo.getOutputFiles();
if (actionOutputFileTmp)
{
guid UID = submission
? submission.UID
: submissionExternal.UID;
if (UID)
{
str fileContents = BusinessDocumentServiceController::getOutputFileById(
UID,
actionOutputFileTmp.ExecutionID,
actionOutputFileTmp.ActionID,
actionOutputFileTmp.IDName);
}
}
}
}
}
}
}
}
class ISLALSProjInvoicePrintControllerExt extends ALSProjInvoicePrintController
{
public static void main(Args _args)
{
ProjType projectType;
projInvoiceJour projInvoiceJour;
PSAProjProposalProj projProposalProj;
PrintMgmtDocInstance printMgmtDocInstance;
PrintMgmtReportFormat printMgmtReportFormat;
PrintMgmtSettings printMgmtSetting;
PrintMgmtReportFormatName reportFormatName;
select firstonly ProjId from projProposalProj
exists join projInvoiceJour
where projInvoiceJour.ProposalId == projProposalProj.ProjProposalId&&
projInvoiceJour.RecId == _args.record().RecId;
projectType = projProposalProj.projTable().Type;
ALSProjInvoicePrintController controller = new ALSProjInvoicePrintController();
if (projectType == ProjType::FixedPrice)
{
select printMgmtDocInstance where printMgmtDocInstance.DocumentType == PrintMgmtDocumentType::ISLProjectInvoiceFP
join printMgmtSetting where printMgmtSetting.ParentId == printMgmtDocInstance.RecId
join printMgmtReportFormat where printMgmtReportFormat.RecId == printMgmtSetting.ReportFormat &&
printMgmtReportFormat.DocumentType == PrintMgmtDocumentType::ISLProjectInvoiceFP;
controller.parmReportName(printMgmtReportFormat.Name);
}
else
{
select printMgmtDocInstance where printMgmtDocInstance.DocumentType == PrintMgmtDocumentType::ISLProjectInvoiceTM
join printMgmtSetting where printMgmtSetting.ParentId == printMgmtDocInstance.RecId
join printMgmtReportFormat where printMgmtReportFormat.RecId == printMgmtSetting.ReportFormat &&
printMgmtReportFormat.DocumentType == PrintMgmtDocumentType::ISLProjectInvoiceTM;
controller.parmReportName(printMgmtReportFormat.Name);
}
controller.parmArgs(_args);
controller.parmShowDialog(false);
controller.startOperation();
}
}
/// <summary>
/// ALSSalesInvoicePrintController
/// </summary>
class ALSProjInvoicePrintController extends SrsReportRunController
{
ProjInvoiceJour projInvoicejour;
/// <summary>
/// prePromptModifyContract
/// </summary>
protected void prePromptModifyContract()
{
Query query;
QueryBuildDataSource qbds;
FormDataSource fds;
query = this.getFirstQuery();
qbds = query.dataSourceTable(tableNum(ProjInvoiceJour));
qbds.clearRanges();
fds = this.parmArgs().record().dataSource();
for(projInvoicejour = getFirstSelection(fds); projInvoicejour != null; projInvoicejour = fds.getNext())
{
qbds.addRange(fieldNum(ProjInvoiceJour, RecId)).value(queryValue(projInvoicejour.RecId));
}
}
/// <summary>
/// main
/// </summary>
/// <param name = "_args">_args</param>
public static void main(Args _args)
{
ProjType projectType;
projInvoiceJour projInvoiceJour;
PSAProjProposalProj projProposalProj;
select firstonly ProjId from projProposalProj
exists join projInvoiceJour
where projInvoiceJour.ProposalId == projProposalProj.ProjProposalId&&
projInvoiceJour.RecId == _args.record().RecId;
projectType = projProposalProj.projTable().Type;
ALSProjInvoicePrintController controller = new ALSProjInvoicePrintController();
if(curExt() == 'ATKW' || curExt() == 'ATOM' || curExt() == 'AAKW')
{
if(projectType == ProjType::FixedPrice)
{
controller.parmReportName(ssrsReportStr(ALSProjInvoicePrint, Report_KD_MileStone));
}
else
{
controller.parmReportName(ssrsReportStr(ALSProjInvoicePrint, Report_KD_TM));
}
}
else if(curExt() == 'ATAE')
{
if(projectType == ProjType::FixedPrice)
{
controller.parmReportName(ssrsReportStr(ALSProjInvoicePrint, Report_UAE_MileStone));
}
else
{
controller.parmReportName(ssrsReportStr(ALSProjInvoicePrint, Report_UAE_TM));
}
}
else
{
controller.parmReportName(ssrsReportStr(ALSProjInvoicePrint, Report));
}
controller.parmArgs(_args);
controller.parmShowDialog(false);
controller.startOperation();
}
}
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,246 Super User 2024 Season 2
Martin Dráb 228,041 Super User 2024 Season 2
nmaenpaa 101,148