门诊发票的生成 pOut_Chg_RecipeSettl3

1.--删除发票临时打印表

delete Out_TempPrintInvoice where ShouKuanYBM=@ShouKuanBM

2.更新处方主表

update Out_Recipe

3.生成单据号 并检查发票是否用完

exec @DanJuID=pSys_GetBill @ShouKuanBM,1
4.插入单据进入发票临时表
insert into Out_TempPrintInvoice (ShouKuanYBM,DanJuID) values (@ShouKuanBM,@DanJuID)
5.更新处方明细表Out_RecipeDetail
update Out_RecipeDetail

6.生成发票明细表insert into Out_InvoiceDetail
insert into Out_InvoiceDetail

7.生成发票主表insert into Out_Invoice
insert into Out_Invoice


8.生成发药状态表insert into Out_DistriMedicStatus

insert into Out_DistriMedicStatus

9.更新药库表update DR_Store

update DR_Store

 

 

   完整代码:

pOut_Chg_RecipeSettl3

你可能感兴趣的:(set)