private bool BelongToSameParty(Collection <int> values) { bool belongToSameParty = NonGlStockTransaction.TransactionIdsBelongToSameParty(values); if (!belongToSameParty) { this.ErrorLabel.Text = Warnings.CannotMergeTransactionsOfDifferentParties; return(false); } return(true); }
private bool BelongToSameParty(string catalog, Collection <long> values) { bool belongToSameParty = NonGlStockTransaction.TransactionIdsBelongToSameParty(catalog, values); if (!belongToSameParty) { this.errorLabel.InnerText = Warnings.CannotMergeDifferentPartyTransaction; return(false); } return(true); }
private bool BelongToSameParty(Collection <int> values) { bool belongToSameParty = NonGlStockTransaction.TransactionIdsBelongToSameParty(values); if (!belongToSameParty) { this.ErrorLabel.Text = "Cannot merge transactions of different parties into a single batch. Please try again."; return(false); } return(true); }
private bool AreSalesOrdersAlreadyMerged(Collection <int> values) { if (this.Book == TranBook.Sales && this.SubBook == SubTranBook.Order) { if (NonGlStockTransaction.AreSalesOrdersAlreadyMerged(values)) { this.ErrorLabel.Text = "The selected transaction(s) contains item(s) which have already been merged. Please try again."; return(true); } } return(false); }
private bool AreSalesQuotationsAlreadyMerged(Collection <long> values) { if (this.Book == TranBook.Sales && this.SubBook == SubTranBook.Quotation) { if (NonGlStockTransaction.AreSalesQuotationsAlreadyMerged(values)) { this.errorLabel.InnerText = Warnings.CannotMergeAlreadyMerged; return(true); } } return(false); }
private bool ContainsIncompatibleTaxes(Collection <long> values) { if (this.Book == TranBook.Sales) { if (NonGlStockTransaction.ContainsIncompatibleTaxes(values)) { this.errorLabel.InnerText = Warnings.CannotMergeIncompatibleTax; return(true); } } return(false); }
private bool AreSalesOrdersAlreadyMerged(Collection <int> values) { if (this.Book == TranBook.Sales && this.SubBook == SubTranBook.Order) { if (NonGlStockTransaction.AreSalesOrdersAlreadyMerged(values)) { this.ErrorLabel.Text = Labels.TransactionAlreadyMerged; return(true); } } return(false); }
private bool AreSalesOrdersAlreadyMerged(string catalog, Collection <long> values) { if (this.Book == TranBook.Sales && this.SubBook == SubTranBook.Order) { if (NonGlStockTransaction.AreSalesOrdersAlreadyMerged(catalog, values)) { this.errorLabel.InnerText = Warnings.CannotMergeAlreadyMerged; return(true); } } return(false); }
private void LoadGridView() { DateTime dateFrom = Conversion.TryCastDate(this.dateFromDateTextBox.Text); DateTime dateTo = Conversion.TryCastDate(this.dateToDateTextBox.Text); string office = this.officeInputText.Value; string party = this.partyInputText.Value; string priceType = string.Empty; string user = this.userInputText.Value; string referenceNumber = this.referenceNumberInputText.Value; string statementReference = this.statementReferenceInputText.Value; string bookName = TransactionBookHelper.GetInvariantTransactionBookName(this.Book, this.SubBook); if (this.priceTypeInputText != null) { priceType = this.priceTypeInputText.Value; } int userId = this.UserId; int officeId = this.OfficeId; GridViewColumnHelper.AddColumns(this.productViewGridView, this.SubBook); if (this.IsNonGlTransaction) { this.productViewGridView.DataSource = NonGlStockTransaction.GetView(this.Catalog, userId, bookName, officeId, dateFrom, dateTo, office, party, priceType, user, referenceNumber, statementReference); this.productViewGridView.DataBind(); return; } if (this.Book == TranBook.Sales && this.SubBook == SubTranBook.Receipt) { this.productViewGridView.DataSource = CustomerReceipts.GetView(this.Catalog, userId, officeId, dateFrom, dateTo, office, party, user, referenceNumber, statementReference); this.productViewGridView.DataBind(); return; } this.productViewGridView.DataSource = GLStockTransaction.GetView(this.Catalog, userId, bookName, officeId, dateFrom, dateTo, office, party, priceType, user, referenceNumber, statementReference); this.productViewGridView.DataBind(); }
public long Save(DateTime valueDate, int storeId, string partyCode, int priceTypeId, string referenceNumber, string data, string statementReference, string transactionIds, string attachmentsJSON) { Collection <StockMasterDetailModel> details = this.GetDetails(data, storeId); Collection <int> tranIds = new Collection <int>(); JavaScriptSerializer js = new JavaScriptSerializer(); Collection <Attachment> attachments = js.Deserialize <Collection <Attachment> >(attachmentsJSON); if (!string.IsNullOrWhiteSpace(transactionIds)) { foreach (var transactionId in transactionIds.Split(',')) { tranIds.Add(Conversion.TryCastInteger(transactionId)); } } return(NonGlStockTransaction.Add("Sales.Quotation", valueDate, partyCode, priceTypeId, details, referenceNumber, statementReference, tranIds, attachments)); }
private void LoadGridView() { DateTime dateFrom = Conversion.TryCastDate(this.DateFromDateTextBox.Text); DateTime dateTo = Conversion.TryCastDate(this.DateToDateTextBox.Text); string office = this.OfficeTextBox.Text; string party = this.PartyTextBox.Text; string priceType = this.PriceTypeTextBox.Text; string user = this.UserTextBox.Text; string referenceNumber = this.ReferenceNumberTextBox.Text; string statementReference = this.StatementReferenceTextBox.Text; string bookName = TransactionBookHelper.GetTransactionBookName(this.Book, this.SubBook); int userId = SessionHelper.GetUserId(); int officeId = SessionHelper.GetOfficeId(); WebControls.StockTransactionView.Helpers.GridViewColumnHelper.AddColumns(this.ProductViewGridView, this.SubBook); if (this.IsNonGlTransaction()) { if (this.SubBook == SubTranBook.Receipt) { using (DataTable table = CustomerReceipts.GetView(userId, officeId, dateFrom, dateTo, office, party, user, referenceNumber, statementReference)) { this.ProductViewGridView.DataSource = table; this.ProductViewGridView.DataBind(); return; } } using (DataTable table = NonGlStockTransaction.GetView(bookName, dateFrom, dateTo, office, party, priceType, user, referenceNumber, statementReference)) { this.ProductViewGridView.DataSource = table; this.ProductViewGridView.DataBind(); return; } } using (DataTable table = GLStockTransaction.GetView(bookName, dateFrom, dateTo, office, party, priceType, user, referenceNumber, statementReference)) { this.ProductViewGridView.DataSource = table; this.ProductViewGridView.DataBind(); } }
private void LoadGridView() { DateTime dateFrom = Conversion.TryCastDate(this.DateFromDateTextBox.Text); DateTime dateTo = Conversion.TryCastDate(this.DateToDateTextBox.Text); string office = this.OfficeTextBox.Text; string party = this.PartyTextBox.Text; string priceType = this.PriceTypeTextBox.Text; string user = this.UserTextBox.Text; string referenceNumber = this.ReferenceNumberTextBox.Text; string statementReference = this.StatementReferenceTextBox.Text; string bookName = this.GetTransactionBookName(); if (this.IsNonGlTransaction()) { using (DataTable table = NonGlStockTransaction.GetView(bookName, dateFrom, dateTo, office, party, priceType, user, referenceNumber, statementReference)) { this.ProductViewGridView.DataSource = table; this.ProductViewGridView.DataBind(); } } }
private bool AreOrdersAlreadyMerged(string catalog, Collection <long> values) { bool merged = false; if (this.SubBook == SubTranBook.Order) { if (this.Book == TranBook.Sales) { merged = NonGlStockTransaction.AreSalesOrdersAlreadyMerged(catalog, values); } if (this.Book == TranBook.Purchase) { merged = NonGlStockTransaction.ArePurchaseOrdersAlreadyMerged(catalog, values); } } if (merged) { this.errorLabel.InnerText = Warnings.CannotMergeAlreadyMerged; } return(merged); }