select f_id,
f_pid,
f_lineno,
f_corpid,
f_feeid,
f_warehouseid,
f_feeUnitid,
f_qty,
f_unitprice,
f_amount,
f_currency,
f_exrate,
f_taxrate,
f_dc,
f_billstatus,
f_review_date,
f_statement_no,
f_accamount,
f_stlamount,
f_accamount_date,
f_invnos,
f_invamount,
f_stlamount_no,
f_askamount,
f_status,
f_stlamount_date,
del_flag,
create_by,
create_time,
update_by,
update_time,
remark,
src_id,
src_bill_no,
f_mblno,
f_product_name,
f_marks,
f_chargedate,
f_billing_deadline,
f_inventory_days,
f_amt,
f_billing_days,
f_billing_qty,
f_billtype,
f_billingway,
f_bsdate,
f_originalbilldate,
f_stltypeid,
f_business_type,
f_src_type_id,
price_date_remarks
from t_warehousebillsfees
insert into t_warehousebillsfees
f_id,
f_pid,
f_lineno,
f_corpid,
f_feeid,
f_warehouseid,
f_feeUnitid,
f_qty,
f_unitprice,
f_amount,
f_currency,
f_exrate,
f_taxrate,
f_dc,
f_billstatus,
f_review_date,
f_statement_no,
f_accamount,
f_stlamount,
f_accamount_date,
f_invnos,
f_invamount,
f_stlamount_no,
f_askamount,
f_status,
f_stlamount_date,
del_flag,
create_by,
create_time,
update_by,
update_time,
remark,
src_id,
src_bill_no,
f_mblno,
f_product_name,
f_marks,
f_chargedate,
f_billing_deadline,
f_inventory_days,
f_amt,
f_billing_days,
f_billing_qty,
f_billtype,
f_billingway,
f_bsdate,
f_originalbilldate,
f_stltypeid,
f_business_type,
f_src_type_id,
price_date_remarks,
#{fId},
#{fPid},
#{fLineno},
#{fCorpid},
#{fFeeid},
#{fWarehouseid},
#{fFeeunitid},
#{fQty},
#{fUnitprice},
#{fAmount},
#{fCurrency},
#{fExrate},
#{fTaxrate},
#{fDc},
#{fBillstatus},
#{fReviewDate},
#{fStatementNo},
#{fAccamount},
#{fStlamount},
#{fAccamountDate},
#{fInvnos},
#{fInvamount},
#{fStlamountNo},
#{fAskamount},
#{fStatus},
#{fStlamountDate},
#{delFlag},
#{createBy},
#{createTime},
#{updateBy},
#{updateTime},
#{remark},
#{srcId},
#{srcBillNo},
#{fMblno},
#{fProductName},
#{fMarks},
#{fChargedate},
#{fBillingDeadline},
#{fInventoryDays},
#{fAmt},
#{fBillingDays},
#{fBillingQty},
#{fBilltype},
#{fBillingway},
#{fBsdate},
#{fOriginalbilldate},
#{fStltypeid},
#{fBusinessType},
#{fSrcTypeId},
#{priceDateRemarks},
update t_warehousebillsfees
f_pid = #{fPid},
f_lineno = #{fLineno},
f_corpid = #{fCorpid},
f_feeid = #{fFeeid},
f_feeUnitid = #{fFeeunitid},
f_qty = #{fQty},
f_warehouseid = #{fWarehouseid},
f_unitprice = #{fUnitprice},
f_amount = #{fAmount},
f_currency = #{fCurrency},
f_exrate = #{fExrate},
f_taxrate = #{fTaxrate},
f_dc = #{fDc},
f_billstatus = #{fBillstatus},
f_review_date = #{fReviewDate},
f_statement_no = #{fStatementNo},
f_accamount = #{fAccamount},
f_stlamount = #{fStlamount},
f_accamount_date = #{fAccamountDate},
f_invnos = #{fInvnos},
f_invamount = #{fInvamount},
f_stlamount_no = #{fStlamountNo},
f_askamount = #{fAskamount},
f_status = #{fStatus},
f_stlamount_date = #{fStlamountDate},
del_flag = #{delFlag},
create_by = #{createBy},
create_time = #{createTime},
update_by = #{updateBy},
update_time = #{updateTime},
remark = #{remark},
src_id = #{srcId},
src_bill_no = #{srcBillNo},
f_mblno = #{fMblno},
f_product_name = #{fProductName},
f_marks = #{fMarks},
f_chargedate = #{fChargedate},
f_billing_deadline = #{fBillingDeadline},
f_inventory_days = #{fInventoryDays},
f_amt = #{fAmt},
f_billing_days = #{fBillingDays},
f_billing_qty = #{fBillingQty},
f_billtype = #{fBilltype},
f_billingway = #{fBillingway},
f_bsdate = #{fBsdate},
f_originalbilldate = #{fOriginalbilldate},
f_stltypeid = #{fStltypeid},
price_date_remarks = #{priceDateRemarks},
f_src_type_id = #{fSrcTypeId},
where f_id = #{fId}
delete
from t_warehousebillsfees
where f_id = #{fId}
delete
from t_warehousebillsfees
where f_pid = #{fId}
delete from t_warehousebillsfees where f_id in
#{fId}
update
t_warehousebillsfees
f_billstatus = #{fettle},
f_review_date = #{auditItem},
f_review_date = null,
where f_pid = #{fPid} and f_accamount <= 0 and f_stlamount <= 0 and f_invamount <= 0
update
t_warehousebillsfees
f_billstatus = #{fettle},
f_review_date = #{auditItem},
f_review_date = null,
where f_id = #{fPid} and f_accamount <= 0 and f_stlamount <= 0 and f_invamount <= 0
update t_warehousebillsfees
/*判断确认对账*/
f_statement_no = #{map.tFee.fBillno},
f_accamount = f_accamount + #{map.tFeeDo.fAmt},
f_accamount_date = #{map.tFee.fAccbilldate}
/*判断撤销对账*/
f_statement_no = #{map.tFee.fBillno},
f_accamount = f_accamount - #{map.tFeeDo.fAmt},
f_accamount_date = #{map.tFee.fAccbilldate}
/*判断收付款*/
f_stlamount_no = #{map.tFee.fBillno},
f_stlamount = f_stlamount + #{map.tFeeDo.fAmt},
f_stlamount_date =#{map.tFee.fAccbilldate}
/*判断撤销收付款*/
f_stlamount_no = #{map.tFee.fBillno},
f_stlamount = f_stlamount - #{map.tFeeDo.fAmt},
f_stlamount_date =#{map.tFee.fAccbilldate}
/*判断开发票款*/
f_invamount = f_invamount + #{map.tFeeDo.fAmt},
f_stlamount_date =#{map.tFee.fAccbilldate}
f_invamount = f_invamount - #{map.tFeeDo.fAmt},
f_stlamount_date =#{map.tFee.fAccbilldate}
/*判断申请发票款*/
f_askamount = f_askamount + #{map.tFeeDo.fAmt},
f_stlamount_date =#{map.tFee.fAccbilldate}
f_askamount = f_askamount - #{map.tFeeDo.fAmt},
f_stlamount_date =#{map.tFee.fAccbilldate}
/*判断确认对账*/
f_statement_no = #{map.tFee.fBillno},
f_accamount = f_accamount + #{map.tFeeDo.fAmt},
f_accamount_date = #{map.tFee.fAccbilldate}
/*判断撤销对账*/
f_statement_no = #{map.tFee.fBillno},
f_accamount = f_accamount - #{map.tFeeDo.fAmt},
f_accamount_date = #{map.tFee.fAccbilldate}
/*判断确认仓库发票*/
f_invnos = #{map.tFee.fBillno},
f_invamount = f_invamount + #{map.tFeeDo.fAmt}
/*判断撤销仓库发票*/
f_invnos = #{map.tFee.fBillno},
f_invamount = f_invamount - #{map.tFeeDo.fAmt}
where f_id = #{map.tFeeDo.fSrcid}
delete
from t_warehousebillsfees
where f_pid = #{fPid}
and f_dc = #{fDc}