PrintMgmtSettings printMgmtSettings;
PrintMgmtDocInstance printMgmtDocInstance;
CustTable custtable = CustTable::find("C005751");
container printerSetting;
SRSPrintDestinationSettings printDestinationSetting;
printMgmtDocInstance = printMgmtDocInstance::find(custtable.RecId,77,printMgmtNodeType::CustTable,printMgmtDocumentType::CustAccountStatement,1);
if(printMgmtDocInstance.RecId == 0 && custtable.email() != strMin())
{
printerSetting = conNull();
printDestinationSetting = new SRSPrintDestinationSettings();
ttsBegin;
printMgmtDocInstance.DocumentType = printMgmtDocumentType::CustAccountStatement;
//printMgmtDocInstance.Name = strFmt("Email 'Account Statements' to %1", custtable.AccountNum);
printMgmtDocInstance.NodeType = printMgmtNodeType::CustTable;
printMgmtDocInstance.PrintType = PrintMgmtDocInstancetype::Original;
printMgmtDocInstance.PriorityId = 1;
printMgmtDocInstance.ReferencedRecId = custtable.recId;
printMgmtDocInstance.ReferencedTableId = 77;// CustTable;
printMgmtDocInstance.insert();
// just use a new instance of SRSPrintDestinationSettings to serialize an empty container
printDestinationSetting.unpack(printerSetting);
printDestinationSetting.printMediumType(srsPrintMediumType::Email);
printDestinationSetting.emailTo(custtable.email());
//printDestinationSetting.emailCc(ccEmailString);
printDestinationSetting.emailSubject("Proserv statements");
printDestinationSetting.emailAttachmentFileFormat(SRSReportFileFormat::PDF);
printerSetting = printDestinationSetting.pack();
printMgmtSettings.clear();
printMgmtSettings.Description = printmgmtdocInstance.Name;
printMgmtSettings.NumberOfCopies = 1;
printMgmtSettings.ParentId = printmgmtdocInstance.RecId;
printMgmtSettings.PrintJobSettings = printerSetting;
printMgmtSettings.PriorityId = printMgmtDocInstance.PriorityId;
printMgmtSettings.insert();
ttsCommit;
}
PrintMgmtDocInstance printMgmtDocInstance;
CustTable custtable = CustTable::find("C005751");
container printerSetting;
SRSPrintDestinationSettings printDestinationSetting;
printMgmtDocInstance = printMgmtDocInstance::find(custtable.RecId,77,printMgmtNodeType::CustTable,printMgmtDocumentType::CustAccountStatement,1);
if(printMgmtDocInstance.RecId == 0 && custtable.email() != strMin())
{
printerSetting = conNull();
printDestinationSetting = new SRSPrintDestinationSettings();
ttsBegin;
printMgmtDocInstance.DocumentType = printMgmtDocumentType::CustAccountStatement;
//printMgmtDocInstance.Name = strFmt("Email 'Account Statements' to %1", custtable.AccountNum);
printMgmtDocInstance.NodeType = printMgmtNodeType::CustTable;
printMgmtDocInstance.PrintType = PrintMgmtDocInstancetype::Original;
printMgmtDocInstance.PriorityId = 1;
printMgmtDocInstance.ReferencedRecId = custtable.recId;
printMgmtDocInstance.ReferencedTableId = 77;// CustTable;
printMgmtDocInstance.insert();
// just use a new instance of SRSPrintDestinationSettings to serialize an empty container
printDestinationSetting.unpack(printerSetting);
printDestinationSetting.printMediumType(srsPrintMediumType::Email);
printDestinationSetting.emailTo(custtable.email());
//printDestinationSetting.emailCc(ccEmailString);
printDestinationSetting.emailSubject("Proserv statements");
printDestinationSetting.emailAttachmentFileFormat(SRSReportFileFormat::PDF);
printerSetting = printDestinationSetting.pack();
printMgmtSettings.clear();
printMgmtSettings.Description = printmgmtdocInstance.Name;
printMgmtSettings.NumberOfCopies = 1;
printMgmtSettings.ParentId = printmgmtdocInstance.RecId;
printMgmtSettings.PrintJobSettings = printerSetting;
printMgmtSettings.PriorityId = printMgmtDocInstance.PriorityId;
printMgmtSettings.insert();
ttsCommit;
}
No comments:
Post a Comment