public ItemVariantAddPage(InvJournalLineClient line, InvJournal master) : base(null) { this.journalMaster = master; this.journalLine = line; this.invItem = journalLine.InvItem; IsInvJrnLine = true; InitPage(); }
void OpenImportDataPage(InvJournalClient selectedItem) { var invJournalLine = new InvJournalLineClient(); string header = selectedItem.Journal; UnicontaBaseEntity[] baseEntityArray = new UnicontaBaseEntity[2] { invJournalLine, selectedItem }; object[] param = new object[2]; param[0] = baseEntityArray; param[1] = header; AddDockItem(TabControls.ImportPage, param, string.Format("{0} : {1}", Localization.lookup("Import"), header)); }
public ErrorCodes Execute(UnicontaBaseEntity master, UnicontaBaseEntity currentRow, IEnumerable <UnicontaBaseEntity> source, string command, string args) { var journal = currentRow as InvJournalClient; var qty = GetQty(); var line = new InvJournalLineClient(); line.Qty = qty.Item1; line.Item = qty.Item2; line.SetMaster(journal); if (_crudApi.Insert(line).Result == ErrorCodes.Succes) { var postingResult = _postingAPI.PostJournal(journal, DateTime.Now, "", "", "", 0, false, new GLTransClient(), 0).Result; return(postingResult.Err); } return(ErrorCodes.NoSucces); }
async void PostJournal(InvJournalClient invJournal, DateTime date) { var mainList = (IList <InvStockStatusReportGridClient>)dgInvStockStatus.ItemsSource; var invJournalLineList = new List <InvJournalLineClient>(); foreach (var item in mainList) { var journalLine = new InvJournalLineClient(); journalLine._Date = date; journalLine._MovementType = 2; // counting journalLine._Item = item._Item; journalLine._Qty = item.Difference; journalLine.SetMaster(invJournal); invJournalLineList.Add(journalLine); } var result = await api.Insert(invJournalLineList); UtilDisplay.ShowErrorCode(result); }