/// <summary> /// Only for the exporting of Receipt Printouts (GRV, iGRV, SRM, Delivery Note) /// </summary> /// <param name="receiptConfirmationPrintoutID"></param> /// <returns></returns> public static XtraReport CreateReceiptPrintout(string printedBy, int receiptConfirmationPrintoutID) { BLL.ReceiptConfirmationPrintout rcp = new BLL.ReceiptConfirmationPrintout(); rcp.LoadByPrimaryKey(receiptConfirmationPrintoutID); FiscalYear fiscalYear = new FiscalYear(); fiscalYear.LoadByPrimaryKey(rcp.FiscalYearID); if (rcp.RowCount > 0 && !rcp.IsColumnNull("ReceiptID")) { return(PrintReceiptConfirmation(printedBy, rcp.ReceiptID, rcp.ID, true, fiscalYear)); } return(null); }
//TODO: Definitly going to BLL but i don't have time to do a clean job here. #region Void Process private void btnVoid_Click(object sender, EventArgs e) { int receiptID = Convert.ToInt32(gridReceiveView.GetFocusedDataRow()["ReceiptID"].ToString()); if (BLL.Receipt.AreThereIssues(receiptID)) { XtraMessageBox.Show("There are issues with this GRV. You can't void it."); return; } var grv = new ReceiptConfirmationPrintout(); grv.Where.ReceiptID.Value = receiptID; grv.Query.Load(); if (grv.IsColumnNull("VoidRequest") || !grv.VoidRequest) { XtraMessageBox.Show("Void needs to be first requested.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if ( XtraMessageBox.Show(UserLookAndFeel.Default, "Are you sure, you want to Void the Document?", "Are you sure:", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes) { while (!grv.EOF) { grv.IsVoided = true; grv.VoidApprovedByUserID = CurrentContext.UserId; grv.VoidApprovalDateTime = DateTimeHelper.ServerDateTime; grv.MoveNext(); } grv.Save(); ReturnToStoreForQuantityEdit(); BLL.Receipt receiptStatus = new BLL.Receipt(); receiptStatus.LoadByPrimaryKey(ReceiptID); receiptStatus.ChangeStatus(ReceiptConfirmationStatus.Constants.DRAFT_RECEIPT, null, this.GetFormIdentifier(), CurrentContext.UserId, "GRV Voided"); this.LogActivity("Approve-Receipt-Void", ReceiptID); } }
private void btnVoid_Click(object sender, EventArgs e) { int receiptID = Convert.ToInt32(gridReceiveView.GetFocusedDataRow()["ReceiptID"].ToString()); if (BLL.Receipt.AreThereIssues(receiptID)) { XtraMessageBox.Show("There are issues with this GRV. You can't void it."); return; } var grv = new ReceiptConfirmationPrintout(); grv.Where.ReceiptID.Value = receiptID; grv.Query.Load(); if (grv.IsColumnNull("VoidRequest") || !grv.VoidRequest) { XtraMessageBox.Show("Void needs to be first requested.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if ( XtraMessageBox.Show(UserLookAndFeel.Default, "Are you sure, you want to Void the Document?", "Are you sure:", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes) { while (!grv.EOF) { grv.IsVoided = true; grv.VoidApprovedByUserID = CurrentContext.UserId; grv.VoidApprovalDateTime = DateTimeHelper.ServerDateTime; grv.MoveNext(); } grv.Save(); ReturnToStoreForQuantityEdit(); BLL.Receipt receiptStatus = new BLL.Receipt(); receiptStatus.LoadByPrimaryKey(ReceiptID); receiptStatus.ChangeStatus(ReceiptConfirmationStatus.Constants.DRAFT_RECEIPT, null, this.GetFormIdentifier(), CurrentContext.UserId, "GRV Voided"); this.LogActivity("Approve-Receipt-Void", ReceiptID); } }