本文整理汇总了C#中BusinessObjects.MasterDataBLL.GetExpenseItemById方法的典型用法代码示例。如果您正苦于以下问题:C# MasterDataBLL.GetExpenseItemById方法的具体用法?C# MasterDataBLL.GetExpenseItemById怎么用?C# MasterDataBLL.GetExpenseItemById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BusinessObjects.MasterDataBLL
的用法示例。
在下文中一共展示了MasterDataBLL.GetExpenseItemById方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExportSaleDataByFormID
/// <summary>
/// 销售
/// </summary>
/// <param name="FormID"></param>
/// <returns></returns>
private bool ExportSaleDataByFormID(int FormID, int logId)
{
ExportDataDS.ExportDataDataTable l_dtExportData = new ExportDataDS.ExportDataDataTable();
FormDS.FormSalePaymentRow l_drFormSalePayment = new FormDS.FormSalePaymentDataTable().NewFormSalePaymentRow();
FormMarketingBLL formmarkbll = new FormMarketingBLL();
FormTEBLL formtebll = new FormTEBLL();
FormSaleBLL formsalebll = new FormSaleBLL();
MasterDataBLL masterdatabll = new MasterDataBLL();
FormPurchaseBLL formPurchaseBLL = new FormPurchaseBLL();
int Count = 0;
FormDS.FormDataTable l_dtform = formmarkbll.GetFormByID(FormID);
FormDS.FormRow l_drform = l_dtform.NewFormRow();
try {
if (l_dtform.Rows.Count > 0) {
l_drform = l_dtform[0];
if (l_drform.IsFinanceRemarkNull()) {
logbll.InsertExportLogDetail(logId, "单据编号:" + l_drform.FormNo + ",提交人:" + new StuffUserBLL().GetStuffUserById(l_drform.UserID)[0].StuffName + ",错误信息:财务摘要为空,导出失败!");
return false;
}
l_drFormSalePayment = formsalebll.GetFormSalePaymentByID(l_drform.FormID);
//if (l_drFormSalePayment.PaymentTypeID == (int)SystemEnums.PaymentType.FreeGoods)
//{
// logbll.InsertExportLogDetail(logId, "单据编号:" + l_drform.FormNo + ",提交人:" + new StuffUserBLL().GetStuffUserById(l_drform.UserID)[0].StuffName + ",错误信息:货补的数据不导出!");
// return false;
//}
//if (l_drFormSalePayment.PaymentTypeID == (int)SystemEnums.PaymentType.Transfer)
//{
// logbll.InsertExportLogDetail(logId, "单据编号:" + l_drform.FormNo + ",提交人:" + new StuffUserBLL().GetStuffUserById(l_drform.UserID)[0].StuffName + ",错误信息:帐扣的数据不导入!");
// return false;
//}
//if (l_drFormSalePayment.PaymentTypeID == (int)SystemEnums.PaymentType.PiaoKou)
//{
// logbll.InsertExportLogDetail(logId, "单据编号:" + l_drform.FormNo + ",提交人:" + new StuffUserBLL().GetStuffUserById(l_drform.UserID)[0].StuffName + ",错误信息:票扣的数据不导入!");
// return false;
//}
//if (l_drFormSalePayment.PaymentTypeID == 5)
//{
// logbll.InsertExportLogDetail(logId, "单据编号:" + l_drform.FormNo + ",提交人:" + new StuffUserBLL().GetStuffUserById(l_drform.UserID)[0].StuffName + ",错误信息:调整因子的数据不导入!");
// return false;
//}
FormDS.FormSalePaymentDetailDataTable l_dtFormSalePaymentDetail = formsalebll.GetFormSalePaymentDetailByPaymentID(FormID);
for (int i = 0; i < l_dtFormSalePaymentDetail.Rows.Count; i++) {
if (l_dtFormSalePaymentDetail[i].AmountRMB == Decimal.Zero) {
Count++;
continue;
}
//PurchaseDS.FormInvoiceDataTable l_dtFormInvoice = formPurchaseBLL.GetFormInvoiceByFormID(FormID);
ExportDataDS.ExportDataRow l_drExportData = l_dtExportData.NewExportDataRow();
l_drExportData.FormID = FormID;
l_drExportData.CompanyCode = l_drExportData.CompanyCode = masterdatabll.GetCompanyById(masterdatabll.GetVendorTypeById(masterdatabll.GetVendorByID(l_drFormSalePayment.VendorID).VendorTypeID).CompanyID).CompanyCode;
l_drExportData.VendorCode = masterdatabll.GetVendorByID(l_drFormSalePayment.VendorID).VendorCode;
if (l_drExportData.IsVendorCodeNull() || string.IsNullOrEmpty(l_drExportData.VendorCode)) {
logbll.InsertExportLogDetail(logId, "单据编号:" + l_drform.FormNo + ",提交人:" + new StuffUserBLL().GetStuffUserById(l_drform.UserID)[0].StuffName + ",错误信息:Vendor Code为空,无法导出!");
return false;
}
//发票号码改为单据编号,单据编号变为10位
l_drExportData.Invoice = l_drform.FormNo;
l_drExportData.Invoicedate = l_drform.SubmitDate.ToString("yyyyMMdd");
//if (l_dtFormInvoice.Rows.Count > 1)
// l_drExportData.Reference = l_dtFormInvoice[1].InvoiceNo;
//if (l_dtFormInvoice.Rows.Count > 0) {
// l_drExportData.Invoice = l_dtFormInvoice[0].InvoiceNo;
// l_drExportData.Invoicedate = l_dtFormInvoice[0].InvoiceDate.ToString("yyyyMMdd");
//} else {
// l_drExportData.Invoice = l_drform.FormNo;
// l_drExportData.Invoicedate = l_drform.SubmitDate.ToString("yyyyMMdd");
//}
l_drExportData.TotalMoney = l_drFormSalePayment.AmountBeforeTax;
//l_drExportData.Currency = masterdatabll.GetCurrencyByID(formsalebll.GetFormSaleApplyByID(l_dtFormSalePaymentDetail[i].FormSaleApplyID)[0].CurrencyID).CurrencyShortName;
//l_drExportData.ExchangeRate = formsalebll.GetFormSaleApplyByID(l_dtFormSalePaymentDetail[i].FormSaleApplyID)[0].ExchangeRate;
l_drExportData.ManageExpenseItem = masterdatabll.GetExpenseItemById(l_dtFormSalePaymentDetail[i].ExpenseItemID).ExpenseItemName;
//profit center取AccrualCode,如果没有报错
if (masterdatabll.GetCostCenterById(l_drform.CostCenterID).IsAccrualCodeNull()) {
logbll.InsertExportLogDetail(logId, "单据编号:" + l_drform.FormNo + ",提交人:" + new StuffUserBLL().GetStuffUserById(l_drform.UserID)[0].StuffName + ",错误信息:Profit Center Accrual Code为空,无法导出!");
return false;
} else {
l_drExportData.CostCenter = masterdatabll.GetCostCenterById(l_drform.CostCenterID).AccrualCode;
}
if (l_dtFormSalePaymentDetail[i].ApplyPeriod.AddMonths(5).Year == l_drform.SubmitDate.AddMonths(5).Year)
l_drExportData.AccountCode = masterdatabll.GetExpenseItemById(l_dtFormSalePaymentDetail[i].ExpenseItemID).AccrualAccountingCode;
else
l_drExportData.AccountCode = masterdatabll.GetExpenseItemById(l_dtFormSalePaymentDetail[i].ExpenseItemID).LastAccountingCode;
l_drExportData.DetailMoney = l_dtFormSalePaymentDetail[i].AmountBeforeTax;
//PO No 变为取报销单的PO的No
if (l_drFormSalePayment.IsFormPOIDNull()) {
//PurchaseDS.FormPODataTable formPO = formPurchaseBLL.GetFormPOByParentFormID(l_dtFormSalePaymentDetail[i].FormSaleApplyID);
//if (formPO.Rows.Count > 0) {
// l_drExportData.PONumber = formPO[0].BPCSPONo;
// PurchaseDS.FormPODetailDataTable formPODetail = formPurchaseBLL.GetPODetailByFormPOID(formPO[0].FormPOID);
// l_drExportData.POLineNumber = formPODetail.Rows.Count.ToString();
//} else {
//.........这里部分代码省略.........