public Task <int> CancellationDocuments(CancellationFormDto form)
        {
            var vbDocuments = _dbContext.VBRequestDocuments.Where(s => form.Ids.Contains(s.Id));

            foreach (var item in vbDocuments)
            {
                item.SetCancellation(form.Reason, _identityService.Username, UserAgent);

                //if (item.Type == VBType.WithPO)
                //{
                //    var epoIds = _dbContext.VBRequestDocumentEPODetails.Where(entity => entity.VBRequestDocumentId == item.Id).Select(entity => (long)entity.EPOId).ToList();
                //    var autoJournalEPOUri = "vb-request-po-external/auto-journal-epo";

                //    var body = new VBAutoJournalFormDto()
                //    {
                //        Date = DateTimeOffset.UtcNow,
                //        DocumentNo = item.DocumentNo,
                //        EPOIds = epoIds
                //    };

                //    var httpClient = _serviceProvider.GetService<IHttpClientService>();
                //    var response = httpClient.PostAsync($"{APIEndpoint.Purchasing}{autoJournalEPOUri}", new StringContent(JsonConvert.SerializeObject(body).ToString(), Encoding.UTF8, General.JsonMediaType)).Result;
                //}
                if (item.IsInklaring)
                {
                    _journalTransactionService.ReverseJournalTransactionByReferenceNo(item.DocumentNo);
                }
            }

            return(_dbContext.SaveChangesAsync());
        }
예제 #2
0
 public Task <int> AutoJournalReverseFromOthersExpenditureProof(string documentNo)
 {
     return(_journalTransactionService.ReverseJournalTransactionByReferenceNo(documentNo));
 }