trainings: modify

dev_trainings
p31729568 6 years ago
parent c69ed1c1f4
commit a893358e29

@ -63,10 +63,9 @@ class TrainingsController < ApplicationController
return
end
@training.training_payinfo ||= begin
payinfo = TrainingPayinfo.new
payinfo.fee = @training.registration_fee # 默认值价格不对
payinfo
if @training.training_payinfo.blank?
@training.build_training_payinfo
@training.training_payinfo.fee = @training.registration_fee
end
end

@ -142,10 +142,11 @@
// 2 支付宝支付
// 3 银行卡支付
// payType: <%#= @training.training_payinfo.pay_type.to_i %>,
newPayinfo: <%= @training.training_payinfo.new_record? %>,
payType: 3,
//发票抬头
//为空则代表不需要发票
invoiceTitle: '<%= @training.training_payinfo.invoice_title %>',
invoiceTitle: '<%= @training.training_payinfo.invoice_title || @training.school %>',
//税号
invoiceNo: '<%= @training.training_payinfo.invoice_no %>'
};
@ -305,13 +306,15 @@
function InitBill(userInfo){
var index=0;
$("#billDemand").html("单位").attr("status",0);
if(userInfo.invoiceTitle == "" && userInfo.invoiceNo == ""){
if (!userInfo.newPayinfo) {
if(userInfo.invoiceTitle == "" && userInfo.invoiceNo == ""){
index=2;
$("#billDemand").html("不需要").attr("status",2);
}
if(userInfo.invoiceTitle != "" && userInfo.invoiceNo == ""){
}
if(userInfo.invoiceTitle != "" && userInfo.invoiceNo == ""){
index=1;
$("#billDemand").html("个人").attr("status",1);
}
}
$(".billType li").removeClass("active");
$(".billType li").eq(index).addClass("active");

Loading…
Cancel
Save