private XtraReport FormatCashRePrintInvoice_Larger(Order ord, DataTable dvPriced, BLL.Institution rus, PickList pl, bool deliveryNote, string printerName, HCMIS.Core.Distribution.Services.PrintLogService pLogService, int?stvLogID) { string activityName = ""; bool hasInsurnance = includeInsurance; return(WorkflowReportFactory.CreateCashRePrintInvoiceLarger(ord, dvPriced, rus, pl, deliveryNote, hasInsurnance, activityName, true, _stvLogIdChosen)); }
private XtraReport FormatCreditRePrintInvoice_Smaller(DataTable dvPriced, Order ord, PickList pl, Institution rus, bool deliveryNote, string printerName, HCMIS.Core.Distribution.Services.PrintLogService pLogService, int?stvLogID) { string activityName = ""; bool hasInsurnance = includeInsurance; return(WorkflowReportFactory.CreateCreditRePrintInvoiceSmaller(dvPriced, ord, pl, rus, deliveryNote, hasInsurnance, activityName, _stvLogIdChosen)); }
/// <summary> /// Formats the cash invoice. /// </summary> /// <param name="ord">The ord.</param> /// <param name="dvPriced">The dv priced.</param> /// <param name="rus">The rus.</param> /// <param name="pl">The pl.</param> /// <param name="deliveryNote">if set to <c>true</c> [delivery note].</param> /// <param name="allowCancelByUser">if set to <c>true</c> [allow cancel by user].</param> /// <exception cref="System.Exception"></exception> private XtraReport FormatCashInvoice_Smaller(Order ord, DataTable dvPriced, BLL.Institution rus, PickList pl, bool deliveryNote, string printerName, HCMIS.Core.Distribution.Services.PrintLogService pLogService) { string activityName = txtConfirmFromStore.Text; bool hasInsurnance = chkIncludeInsurance.Checked; return(WorkflowReportFactory.CreateCashInvoiceSmaller(ord, dvPriced, rus, pl, deliveryNote, hasInsurnance, activityName)); }
/// <summary> /// Prints GRV, SRM or Delivery Note /// </summary> private void PrintConfirmation(int?reprintOfReceiptConfirmationPrintoutID) { String reference = gridReceiveView.GetFocusedDataRow()["RefNo"].ToString(); int receiptID = Convert.ToInt32(gridReceiveView.GetFocusedDataRow()["ReceiptID"].ToString()); XtraReport report = WorkflowReportFactory.PrintReceiptConfirmation(CurrentContext.LoggedInUserName, receiptID, reprintOfReceiptConfirmationPrintoutID, false, FiscalYear.Current); BindFormContents(); }
private XtraReport FormatCreditInvoice_Larger(DataTable dvPriced, Order ord, PickList pl, Institution rus, bool deliveryNote, string printerName, HCMIS.Core.Distribution.Services.PrintLogService pLogService) { bool hasInsurance = chkIncludeInsurance.Checked; string activityName = txtConfirmFromStore.Text; return(WorkflowReportFactory.CreateCreditInvoice(dvPriced, ord, pl, rus, deliveryNote, hasInsurance, activityName, true, null)); }
/// <summary> /// /// </summary> /// <param name="receiptID"></param> /// <param name="referenceNumber"></param> /// <param name="preGRVorGRV">1-Pre-GRV, 2-GRV</param> private void PrintReceiptConfirmation(int receiptID) { var printout = WorkflowReportFactory.CreateGRNFPrintout(receiptID, null, false, FiscalYear.Current); if (printout.PrintDialog() != System.Windows.Forms.DialogResult.OK) { throw new Exception("Print cancelled by user!"); } }
private void PrintPickList(Order ord, Institution rus) { var pickList = WorkflowReportFactory.CreatePicklistReport(ord, rus.Name, _dvPickListMakeup); if (pickList != null) { pickList.PrintDialog(); // Log the pick list } }
private void PrintPicklistItems(object sender, EventArgs e) { BLL.Order ord = new BLL.Order(); ord.LoadByPrimaryKey(_orderID); BLL.Institution rus = new Institution(); rus.LoadByPrimaryKey(ord.RequestedBy); XtraReport pickList; pickList = WorkflowReportFactory.CreatePicklistReport(ord, rus.Name, _dvPickListMakeup); pickList.ShowPreviewDialog(); }
private XtraReport GetReport() { DataRow dr = viewChoices.GetFocusedDataRow(); XtraReport report = null; if (dr != null) { int id = Convert.ToInt32(dr["ID"]); switch (documentType.EditValue.ToString()) { case "GRNF": report = WorkflowReportFactory.CreateGRNFPrintout(id); break; case "GRV": case "SRM": case "iGRV": report = WorkflowReportFactory.CreateReceiptPrintout(CurrentContext.LoggedInUserName, id); break; case "Cost": report = WorkflowReportFactory.CreateCostAnalysis(id); break; case "STV": case "Cash": case "Credit": { report = WorkflowReportFactory.CreateInvoice(id); } break; } printControl1.PrintingSystem = report.PrintingSystem; SetTextWatermark(report); } return(report); }
/// <summary> /// Formats the STV. /// </summary> /// <param name="ord">The ord.</param> /// <param name="dvPriced">The dv priced.</param> /// <param name="stvSentTo">The STV sent to.</param> /// <param name="pl">The pl.</param> /// <param name="deliveryNote">if set to <c>true</c> [delivery note].</param> /// <param name="allowCancelByUser">if set to <c>true</c> [allow cancel by user].</param> /// <exception cref="System.Exception"></exception> private XtraReport FormatSTV(Order ord, DataTable dvPriced, string stvSentTo, PickList pl, bool deliveryNote, string printerName, HCMIS.Core.Distribution.Services.PrintLogService pLogService, int orderID) { bool hasInsurance = chkIncludeInsurance.Checked; string accountName = txtConfirmFromStore.Text; string transferType = null; int?orderTypeID = null; BLL.Order order = new Order(); order.LoadByPrimaryKey(orderID); if (!order.IsColumnNull("OrderTypeID")) { orderTypeID = Convert.ToInt32(ord.GetColumn("OrderTypeID")); } string transferDetail = ""; if (orderTypeID.HasValue) { BLL.Transfer transfer = new Transfer(); if (orderTypeID == OrderType.CONSTANTS.STORE_TO_STORE_TRANSFER) { transfer.LoadByOrderID(orderID); PhysicalStore toStore = new PhysicalStore(); toStore.LoadByPrimaryKey(transfer.ToPhysicalStoreID); BLL.Warehouse toWarehouse = new BLL.Warehouse(); toWarehouse.LoadByPrimaryKey(toStore.PhysicalStoreTypeID); transferType = "Store to Store Transfer"; stvSentTo = toWarehouse.Name; } if (orderTypeID == OrderType.CONSTANTS.ACCOUNT_TO_ACCOUNT_TRANSFER) { transfer.LoadByOrderID(orderID); Activity fromActivity = new Activity(); fromActivity.LoadByPrimaryKey(transfer.FromStoreID); Activity toActivity = new Activity(); toActivity.LoadByPrimaryKey(transfer.ToStoreID); transferType = "Account to Account Transfer"; transferDetail = string.Format("From: {0} To: {1}", fromActivity.FullActivityName, toActivity.FullActivityName); } } if (!deliveryNote) { if (InstitutionIType.IsVaccine(GeneralInfo.Current)) { return(WorkflowReportFactory.CreateModel22(ord, dvPriced, stvSentTo, pl.ID, null, false, true, hasInsurance, transferType)); } var stvReport = WorkflowReportFactory.CreateSTVonHeadedPaper(ord, dvPriced, stvSentTo, pl.ID, null, false, true, hasInsurance, transferType); if (transferDetail != "") { stvReport.TransferDetails.Text = transferDetail; stvReport.TransferDetails.Visible = true; } else { stvReport.TransferDetails.Visible = false; } return(stvReport); } else { return(WorkflowReportFactory.CreateDeliveryNote(ord, dvPriced, stvSentTo, pl.ID, null, false, true, hasInsurance, transferType)); } }
private void btnPrint_Click(object sender, EventArgs e) { DataRow dataRow = gridReceiveView.GetFocusedDataRow(); if (dataRow != null) { if (Convert.ToInt32(dataRow["ReceiptConfirmationStatusID"]) == ReceiptConfirmationStatus.Constants.RECEIVE_QUANTITY_CONFIRMED) { ReceiptID = Convert.ToInt32(dataRow["ReceiptID"]); PrintDialog printDialog = new PrintDialog(); printDialog.PrinterSettings.Copies = BLL.Settings.GRNFCopies; DialogResult dialogResult = printDialog.ShowDialog(); if (dialogResult != DialogResult.OK) { MessageBox.Show("Printing Canceled by user", "Cancel Printint...", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); return; } TransactionMgr transaction = TransactionMgr.ThreadTransactionMgr(); XtraReport printout; try { transaction.BeginTransaction(); printout = WorkflowReportFactory.CreateGRNFPrintout(ReceiptID, null, false, FiscalYear.Current); var receipt = new BLL.Receipt(ReceiptID); var recDoc = new ReceiveDoc(); recDoc.LoadByReceiptID(ReceiptID); if (receipt.ReceiptInvoice.PO.PurchaseType == BLL.POType.STORE_TO_STORE_TRANSFER || !BLL.Settings.HandleGRV) { recDoc.ConfirmGRVPrinted(CurrentContext.UserId); BLL.Receipt receiptStatus = new BLL.Receipt(); receiptStatus.LoadByPrimaryKey(ReceiptID); receiptStatus.ChangeStatus(ReceiptConfirmationStatus.Constants.GRV_PRINTED, null, this.GetFormIdentifier(), CurrentContext.UserId, "Transfer Confirmed"); } else { recDoc.ConfirmGRNFPrinted(CurrentContext.UserId); BLL.Receipt receiptStatus = new BLL.Receipt(); receiptStatus.LoadByPrimaryKey(ReceiptID); receiptStatus.ChangeStatus(ReceiptConfirmationStatus.Constants.GRNF_PRINTED, null, this.GetFormIdentifier(), CurrentContext.UserId, "GRNF Printed"); } transaction.CommitTransaction(); } catch (Exception exception) { transaction.RollbackTransaction(); XtraMessageBox.Show(exception.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); throw; } for (int i = 0; i < printDialog.PrinterSettings.Copies; i++) { printout.Print(printDialog.PrinterSettings.PrinterName); } ReceiptConfirmation_Load(null, null); } else { XtraMessageBox.Show("The selected receipt has to be confirmed before GRNF is printed!", "ERROR", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error); } } }