private void documentHeader_XBrowseClick_MainStore(object sender, RoutedEventArgs e) { var saveStoreId = selectedRecord.inv_goods_receive_inv_store_id; inv_store = BrowseClick(new WindowSelectGrid <stp_inv_store_selResult>(), "انبار", typeof(frm_inv_store), sender); if (selectedRecord.inv_goods_receive_inv_store_id != saveStoreId) { GlobalFunctions.Copy_PK_To_FK(selectedRecord, new stp_inv_buy_request_selResult()); GlobalFunctions.Copy_PK_To_FK(selectedRecord, new stp_inv_goods_send_selResult()); MoveCollectionView(); } }
private void SelectStore_Click(object sender, System.Windows.RoutedEventArgs e) { var saveStoreId = selectedRecord.inv_goods_send_inv_store_id; inv_store = BrowseClick(new WindowSelectGrid <stp_inv_store_selResult>(), "انبار", typeof(frm_inv_store), sender); if (selectedRecord.inv_goods_send_inv_store_id != saveStoreId) { GlobalFunctions.Copy_PK_To_FK(selectedRecord, new stp_inv_goods_request_selResult()); GlobalFunctions.Copy_PK_To_FK(selectedRecord, new stp_inv_goods_receive_selResult()); GlobalFunctions.Copy_PK_To_FK(selectedArticle, new stp_inv_group_goods_selResult()); MoveCollectionView(); MoveCollectionView(collectionViewArticle); } }
private void APMToolbarButton_Click(object sender, RoutedEventArgs e) { string DescriptionSend, DescriptionReceive; MessageBoxResult result = new MessageBoxResult(); ////در صورتی که این سند انبار گردانی تعدیل شده باشد پیغام می دهد if (selectedRecord.inv_physical_counting_have_adjustment == true) { result = Messages.QuestionMessage_YesNo(" این سند انبار گردانی دارای سند تعدیل می باشد آیا می خواهید مجدداً سند تعدیل صادر شود"); } if (result == MessageBoxResult.No || result == MessageBoxResult.Cancel) { return; } ///// List <stp_inv_goods_send_article_selResult> ArticleListForSendForm = new List <stp_inv_goods_send_article_selResult>(); List <stp_inv_goods_receive_article_selResult> ArticleListForReceiveForm = new List <stp_inv_goods_receive_article_selResult>(); ///// stp_inv_goods_send_selResult SendRecord = new stp_inv_goods_send_selResult(); stp_inv_goods_receive_selResult ReceiveRecord = new stp_inv_goods_receive_selResult(); /////جهت به دست آوردن طرف سند انبار stp_inv_store_selResult store = new stp_inv_store_selResult(); store.inv_store_id = selectedRecord.inv_physical_counting_inv_store_id; store = new BLL <stp_inv_store_selResult>().GetOneRecord(store); DescriptionSend = "سند تعدیل کاهشی مربوط به سند انبار گردانی" + " " + selectedRecord.inv_physical_counting_code; SendRecord.inv_goods_send_inv_store_id = selectedRecord.inv_physical_counting_inv_store_id; SendRecord.inv_goods_send_type_glb_coding_name = SendType.Adjustment.ToString(); SendRecord.inv_goods_send_send_type_glb_coding_id = (long)SendType.Adjustment; SendRecord.inv_goods_send_date = APMDateTime.Today; SendRecord.inv_goods_send_inv_store_id = selectedRecord.inv_physical_counting_inv_store_id; SendRecord.inv_goods_send_inv_store_name = selectedRecord.inv_physical_counting_inv_store_name; SendRecord.inv_goods_send_inv_store_code = selectedRecord.inv_physical_counting_inv_store_code; SendRecord.inv_goods_send_description = DescriptionSend; SendRecord.inv_goods_send_destination_acc_detail_id = (long)store.inv_store_glb_personel_acc_detail_id; SendRecord.inv_goods_send_destination_acc_detail_code = store.inv_store_glb_personel_code; SendRecord.inv_goods_send_destination_acc_detail_name = store.inv_store_glb_personel_name; //// //// DescriptionReceive = "سند تعدیل افزایشی مربوط به سند انبار گردانی" + " " + selectedRecord.inv_physical_counting_code; ReceiveRecord.inv_goods_receive_inv_store_id = selectedRecord.inv_physical_counting_inv_store_id; ReceiveRecord.inv_goods_receive_type_glb_coding_name = ReceiveType.Adjustment.ToString(); ReceiveRecord.inv_goods_receive_receive_type_glb_coding_id = (long)ReceiveType.Adjustment; ReceiveRecord.inv_goods_receive_date = APMDateTime.Today; ReceiveRecord.inv_goods_receive_inv_store_id = selectedRecord.inv_physical_counting_inv_store_id; ReceiveRecord.inv_goods_receive_inv_store_name = selectedRecord.inv_physical_counting_inv_store_name; ReceiveRecord.inv_goods_receive_inv_store_code = selectedRecord.inv_physical_counting_inv_store_code; ReceiveRecord.inv_goods_receive_description = DescriptionReceive; ReceiveRecord.inv_goods_receive_destination_acc_detail_id = (long)store.inv_store_glb_personel_acc_detail_id;; ReceiveRecord.inv_goods_receive_destination_acc_detail_code = store.inv_store_glb_personel_code; ReceiveRecord.inv_goods_receive_destination_acc_detail_name = store.inv_store_glb_personel_name; //// foreach (stp_inv_physical_counting_article_selResult article in bindingListArticle) { if (article.inv_physical_counting_article_shortage != 0 && article.inv_physical_counting_article_shortage != null) { stp_inv_goods_send_article_selResult Senditem = new stp_inv_goods_send_article_selResult(); Senditem.inv_goods_send_article_inv_group_goods_id = article.inv_physical_counting_article_inv_group_goods_id; Senditem.inv_goods_send_article_inv_group_goods_name = article.inv_physical_counting_article_inv_group_goods_name; Senditem.inv_goods_send_article_inv_group_goods_code = article.inv_physical_counting_article_inv_group_goods_code; Senditem.inv_goods_send_article_count = System.Convert.ToDouble(article.inv_physical_counting_article_shortage); Senditem.inv_goods_send_article_glb_measure_id = article.inv_physical_counting_article_glb_measure_id; Senditem.inv_goods_send_article_count_measure = Senditem.inv_goods_send_article_count + article.inv_physical_counting_article_glb_measure_name; Senditem.inv_goods_send_article_description = DescriptionSend; ArticleListForSendForm.Add(Senditem); } else if (article.inv_physical_counting_article_surplus != 0 && article.inv_physical_counting_article_surplus != null) { stp_inv_goods_receive_article_selResult Receiveitem = new stp_inv_goods_receive_article_selResult(); Receiveitem.inv_goods_receive_article_inv_group_goods_id = article.inv_physical_counting_article_inv_group_goods_id; Receiveitem.inv_goods_receive_article_inv_group_goods_name = article.inv_physical_counting_article_inv_group_goods_name; Receiveitem.inv_goods_receive_article_inv_group_goods_code = article.inv_physical_counting_article_inv_group_goods_code; Receiveitem.inv_goods_receive_article_glb_measure_id = article.inv_physical_counting_article_glb_measure_id; Receiveitem.inv_goods_receive_article_count = System.Convert.ToDouble(article.inv_physical_counting_article_surplus); Receiveitem.inv_goods_receive_article_count_measure = Receiveitem.inv_goods_receive_article_count + article.inv_physical_counting_article_glb_measure_name; Receiveitem.inv_goods_receive_article_description = DescriptionReceive; ArticleListForReceiveForm.Add(Receiveitem); } } if (ArticleListForSendForm.Count != 0) { frm_inv_goods_send AdjustmentSendForm = new frm_inv_goods_send(); AdjustmentSendForm.CreateDocument(SendRecord, ArticleListForSendForm); } if (ArticleListForReceiveForm.Count != 0) { frm_inv_goods_receive AdjustmentReceiveForm = new frm_inv_goods_receive(); AdjustmentReceiveForm.CreateDocument(ReceiveRecord, ArticleListForReceiveForm); } RefreshClick(); }
private void Acc_Document_Show() { //جهت صدور سند حسابداری برای انبار stp_acc_document_selResult DocumentRecord = new stp_acc_document_selResult(); stp_acc_document_article_selResult acc_document_article_inv_store = new stp_acc_document_article_selResult(); stp_acc_document_article_selResult acc_document_article_inv_destination = new stp_acc_document_article_selResult(); List <stp_acc_document_article_selResult> LstDocumentArticle = new List <stp_acc_document_article_selResult>(); DocumentRecord.acc_document_description = " سند حسابداری اسناد انبار تا تاریخ " + selectedRecord.acc_document_date; DocumentRecord.acc_document_from_inventory = true; List <stp_inv_store_selResult> lstStore = new List <stp_inv_store_selResult>(); stp_inv_store_selResult invStore = new stp_inv_store_selResult(); lstStore = new BLL <stp_inv_store_selResult>().GetAllRecords_DB(); stp_acc_chart_account_selResult accChartAccountInvStore = new stp_acc_chart_account_selResult(); stp_acc_chart_account_treResult accChartAccount = new stp_acc_chart_account_treResult(); stp_acc_chart_account_selResult accChartAccountInvDestination = new stp_acc_chart_account_selResult(); List <stp_acc_chart_account_treResult> lstAccChartAccount = new List <stp_acc_chart_account_treResult>(); lstAccChartAccount = new BLL <stp_acc_chart_account_treResult>().GetAllRecords_DB(); long inv_destination_id; foreach (stp_inv_goods_receive_inv_goods_send_selResult record in ref_receive_send.ListBeforeChange) { invStore = lstStore.Find(inv_store => inv_store.inv_store_id == record.inv_goods_receive_inv_goods_send_inv_store_id); inv_destination_id = record.inv_goods_receive_inv_goods_send_destination_acc_detail_id; accChartAccountInvStore.acc_chart_account_acc_detail_id = invStore != null ? invStore.inv_store_acc_detail_id : 0; accChartAccount = lstAccChartAccount.FindLast(acc_detail_id => acc_detail_id.acc_chart_account_acc_detail_id == accChartAccountInvStore.acc_chart_account_acc_detail_id); acc_document_article_inv_store = new stp_acc_document_article_selResult(); acc_document_article_inv_store.acc_document_article_acc_chart_account_id = accChartAccount != null ? accChartAccount.acc_chart_account_id : 0; acc_document_article_inv_store.acc_document_article_acc_chart_account_name = accChartAccount != null ? accChartAccount.acc_chart_account_name : ""; acc_document_article_inv_store.acc_document_article_acc_chart_account_code = accChartAccount != null ? accChartAccount.acc_chart_account_code : ""; acc_document_article_inv_store.acc_document_article_acc_chart_account_glb_entity_type_name = accChartAccount != null ? accChartAccount.acc_chart_account_glb_entity_type_name : ""; acc_document_article_inv_store.acc_document_article_acc_detail_id = accChartAccount != null ? accChartAccount.acc_chart_account_acc_detail_id : null; acc_document_article_inv_store.acc_document_article_acc_chart_account_parent_names = accChartAccount.acc_chart_account_parent_names; //acc_document_article_inv_store.acc_document_article_acc_chart_account_group_name = accChartAccount.acc_chart_account_group_name; //acc_document_article_inv_store.acc_document_article_acc_chart_account_kol_name = accChartAccount.acc_chart_account_kol_name; //acc_document_article_inv_store.acc_document_article_acc_chart_account_moein_name = accChartAccount.acc_chart_account_moein_name; //acc_document_article_inv_store.acc_document_article_acc_chart_account_detail_name = accChartAccount.acc_chart_account_detail_name; acc_document_article_inv_store.acc_document_article_description = "جهت صدور سند مربوط به انبار"; LstDocumentArticle.Add(acc_document_article_inv_store); accChartAccountInvDestination.acc_chart_account_acc_detail_id = inv_destination_id; accChartAccount = lstAccChartAccount.FindLast(acc_detail_id => acc_detail_id.acc_chart_account_acc_detail_id == accChartAccountInvDestination.acc_chart_account_acc_detail_id); acc_document_article_inv_destination = new stp_acc_document_article_selResult(); acc_document_article_inv_destination.acc_document_article_acc_chart_account_id = accChartAccount != null ? accChartAccount.acc_chart_account_id : 0; acc_document_article_inv_destination.acc_document_article_acc_chart_account_name = accChartAccount != null ? accChartAccount.acc_chart_account_name : ""; acc_document_article_inv_destination.acc_document_article_acc_chart_account_code = accChartAccount != null ? accChartAccount.acc_chart_account_code : ""; acc_document_article_inv_destination.acc_document_article_acc_chart_account_glb_entity_type_name = accChartAccount != null ? accChartAccount.acc_chart_account_glb_entity_type_name : ""; acc_document_article_inv_destination.acc_document_article_description = "جهت صدور سند مربوط به انبار"; acc_document_article_inv_destination.acc_document_article_acc_detail_id = accChartAccount != null ? accChartAccount.acc_chart_account_acc_detail_id : null; acc_document_article_inv_destination.acc_document_article_acc_chart_account_parent_names = accChartAccount.acc_chart_account_parent_names; //acc_document_article_inv_destination.acc_document_article_acc_chart_account_group_name = accChartAccount.acc_chart_account_group_name; //acc_document_article_inv_destination.acc_document_article_acc_chart_account_kol_name = accChartAccount.acc_chart_account_kol_name; //acc_document_article_inv_destination.acc_document_article_acc_chart_account_moein_name = accChartAccount.acc_chart_account_moein_name; //acc_document_article_inv_destination.acc_document_article_acc_chart_account_detail_name = accChartAccount.acc_chart_account_detail_name; if (record.inv_goods_receive_inv_goods_send_is_receive == true) { acc_document_article_inv_destination.acc_document_article_credit = (double)(Convert.ToInt64(record.inv_goods_receive_inv_goods_send_sum_price)); acc_document_article_inv_store.acc_document_article_debt = (double)(Convert.ToInt64(record.inv_goods_receive_inv_goods_send_sum_price)); acc_document_article_inv_store.acc_document_article_inv_goods_receive_id = record.inv_goods_receive_inv_goods_send_id; acc_document_article_inv_destination.acc_document_article_inv_goods_receive_id = record.inv_goods_receive_inv_goods_send_id; acc_document_article_inv_store.acc_document_article_inventory_information = "رسید شماره " + record.inv_goods_receive_inv_goods_send_no + " از " + acc_document_article_inv_store.acc_document_article_acc_chart_account_name; acc_document_article_inv_destination.acc_document_article_inventory_information = "رسید شماره " + record.inv_goods_receive_inv_goods_send_no + " از " + acc_document_article_inv_store.acc_document_article_acc_chart_account_name; } else { acc_document_article_inv_destination.acc_document_article_debt = (double)((long)record.inv_goods_receive_inv_goods_send_sum_price); acc_document_article_inv_store.acc_document_article_credit = (double)((long)record.inv_goods_receive_inv_goods_send_sum_price); acc_document_article_inv_store.acc_document_article_inv_goods_send_id = record.inv_goods_receive_inv_goods_send_id; acc_document_article_inv_destination.acc_document_article_inv_goods_send_id = record.inv_goods_receive_inv_goods_send_id; acc_document_article_inv_store.acc_document_article_inventory_information = "حواله شماره " + record.inv_goods_receive_inv_goods_send_no + " از " + acc_document_article_inv_store.acc_document_article_acc_chart_account_name; acc_document_article_inv_destination.acc_document_article_inventory_information = "حواله شماره " + record.inv_goods_receive_inv_goods_send_no + " از " + acc_document_article_inv_store.acc_document_article_acc_chart_account_name; } LstDocumentArticle.Add(acc_document_article_inv_destination); } if (LstDocumentArticle.Count != 0) { Form_Acc_Document = new frm_acc_document(); if (Form_Acc_Document.CreateDocument(DocumentRecord, LstDocumentArticle)) { ref_receive_send.ListAfterChange.Clear(); } } }