请帮我用.net写一个计算方法,存在以下变量:下单模式、数量、结算价、结算金额、开票价、开票金额、管理费率、管理费、客户结算金额、省代价格、省代费率、省代附件费率、省代管理费、省代金额、中标价、费用比率、费用金额;当下单模式为普通模式时:结算金额=数量*结算价,开票金额=数量*开票价,管理费=(开票金额-结算金额)*(管理费率+附件费率),客户结算金额=开票金额-结算金额-管理费;当下单模式为佣金模式时:结算金额=数量*结算价,开票金额=数量*开票价,管理费=(开票金额-结算金额)*(管理费率+附件费率),客户结算金额=开票金额-结算金额-管理费,费用金额=中标价*数量*费用比率*(1-附件费率);当下单模式为省代模式时:结算金额=数量*结算价,开票金额=数量*开票价,管理费=(开票价-省代价格)*数量*(附件费率+管理费率),客户结算金额=开票金额-(数量*省代价格)-管理费,省代管理费=(省代价格-结算价)*数量*(省代费率+省代附件费率),省代金额=省代价格*数量-结算金额-省代管理费
时间: 2023-03-10 21:25:24 浏览: 115
根据您提供的变量,可以编写如下.NET代码用于计算: // 下单模式
if (orderMode == "普通模式")
{
// 结算金额
settlementAmount = quantity * settlementPrice;
// 开票金额
invoiceAmount = quantity * invoicePrice;
// 管理费
managementFee = (invoiceAmount - settlementAmount) * (managementFeeRate + annexFeeRate);
// 客户结算金额
customerSettlementAmount = invoiceAmount - settlementAmount - managementFee;
}
else if (orderMode == "佣金模式")
{
// 结算金额
settlementAmount = quantity * settlementPrice;
// 开票金额
invoiceAmount = quantity * invoicePrice;
// 管理费
managementFee = (invoiceAmount - settlementAmount) * (managementFeeRate + annexFeeRate);
// 客户结算金额
customerSettlementAmount = invoiceAmount - settlementAmount - managementFee;
// 费用金额
feeAmount = winningPrice * quantity * feeRate * (1 - annexFeeRate);
}
else if (orderMode == "省代模式")
{
// 结算金额
settlementAmount = quantity * settlementPrice;
// 开票金额
invoiceAmount = quantity * invoicePrice;
// 管理费
managementFee = (invoicePrice - provincialPrice) * quantity * (annexFeeRate + managementFeeRate);
// 客户结算金额
customerSettlementAmount = invoiceAmount - (quantity * provincialPrice) - managementFee;
// 省代管理费
provincialManagementFee = (provincialPrice - settlementPrice) * quantity * (provincialFeeRate + provincialAnnexFeeRate);
// 省代金额
provincialAmount = provincialPrice * quantity - settlementAmount - provincialManagementFee;
}
阅读全文