⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jhtj.prg

📁 vfp的进销存系统
💻 PRG
字号:
*进货统计模块
*程序名:jhtj
*程序员:
*开发日期:
*最后修改日期:
*修改记录

*变量说明
*ghs:是否以供货商为主进行统计
*qd:确定是否进入

parameters ghs
private all except p_*

qd=.t.
qsrq=date()
jzrq=date()
do form qzrq name qzrq linked

if qd
  do jrz with p_gzrrxm,'进入进货单统计'
  dhxx1='正在统计数据,请稍候...'
  do form xxts name xxts
  
  do gbsjk with 'jhtjj'
  do gbsjk with 'jhtjt'
  do gbsjk with 'jhtjb'
  do gbsjk with 'jhtjf'
  do gbsjk with '_jhtj'
  if file('_jhtj.cdx')
    erase _jhtj.cdx
  endif

  if ghs
    do dksjk with 'jhd','jhd'
    set order to tag ghs
    total on 供货商 to _jhtjj for 日期>=qsrq .and. 日期<=jzrq
    do dksjk with 'thtc','thtc'
    set order to tag ghs
    total on 供货商 to _jhtjt for 日期>=qsrq .and. 日期<=jzrq
    do dksjk with 'bxtc','bxtc'
    set order to tag ghs
    total on 供货商 to _jhtjb for 日期>=qsrq .and. 日期<=jzrq
    total on 供货商 to _jhtjf for 返回='否'

    do dksjk with '_jhtjj','jhtjj'
    do dksjk with '_jhtjt','jhtjt'
    do dksjk with '_jhtjb','jhtjb'
    do dksjk with '_jhtjf','jhtjf'

    select 0
    create cursor _jhtj;
      (供货商 c(40),;
      进货金额 n(12,2),;
      退货金额 n(12,2),;
      保修金额 n(12,2),;
      未返回金额 n(12,2))

    select jhtjj
    scan
      select _jhtj
      append blank
      replace 供货商 with jhtjj.供货商,进货金额 with jhtjj.金额
      select jhtjj
    endscan

    select jhtjt
    scan
      select _jhtj
      locate for alltrim(供货商)==alltrim(jhtjt.供货商)
      if .not. found()
        append blank
        replace 供货商 with jhtjt.供货商,退货金额 with jhtjt.金额
       else
        replace 退货金额 with jhtjt.金额
      endif
      select jhtjt
    endscan

    select jhtjb
    scan
      select _jhtj
      locate for alltrim(供货商)==alltrim(jhtjb.供货商)
      if .not. found()
        append blank
        replace 供货商 with jhtjb.供货商,保修金额 with jhtjb.金额
       else
        replace 保修金额 with jhtjb.金额
      endif
      select jhtjb
    endscan

    select jhtjf
    scan
      select _jhtj
      locate for alltrim(供货商)==alltrim(jhtjf.供货商)
      if .not. found()
        append blank
        replace 供货商 with jhtjf.供货商,未返回金额 with jhtjf.金额
       else
        replace 未返回金额 with jhtjf.金额
      endif
      select jhtjf
    endscan
    
    select _jhtj
    sum 进货金额,退货金额,保修金额,未返回金额 to jhhj,thhj,bxhj,wfhhj
    append blank
    replace 供货商 with '                   合       计',进货金额 with jhhj,退货金额 with thhj,保修金额 with bxhj,未返回金额 with wfhhj
    index on 进货金额 tag jhje of _jhtj
    
    xxts.release
    dhxx='查看后是否打印?'
    qd=.t.
    do form sfdhk
    
    report form jhtj preview
    if qd
      report form jhtj to printer noconsole
    endif
    
   else
   
    do gbsjk with '_jhtjj1'
    do dksjk with 'jhd','jhd'
    sort to _jhtjj1 on 品名,规格,颜色
    do dksjk with '_jhtjj1','_jhtjj1'
    total on 品名+规格+颜色 to _jhtjj for 日期>=qsrq .and. 日期<=jzrq
    
    do gbsjk with '_jhtjt1'
    do dksjk with 'thtc','thtc'
    sort to _jhtjt1 on 品名,规格,颜色
    do dksjk with '_jhtjt1','_jhtjt1'
    total on 品名+规格+颜色 to _jhtjt for 日期>=qsrq .and. 日期<=jzrq
    
    do gbsjk with '_jhtjb1'
    do dksjk with 'bxtc','bxtc'
    sort to _jhtjb1 on 品名,规格,颜色
    do dksjk with '_jhtjb1','_jhtjb1'
    total on 品名+规格+颜色 to _jhtjb for 日期>=qsrq .and. 日期<=jzrq
    total on 品名+规格+颜色 to _jhtjf for 返回='否'

    do dksjk with '_jhtjj','jhtjj'
    do dksjk with '_jhtjt','jhtjt'
    do dksjk with '_jhtjb','jhtjb'
    do dksjk with '_jhtjf','jhtjf'

    select 0
    create cursor _jhtj;
      (品名 c(40),;
      规格 c(20),;
      颜色 c(14),;
      进货数量 n(5,0),;
      进货金额 n(12,2),;
      退货金额 n(12,2),;
      保修金额 n(12,2),;
      未返回金额 n(12,2))

    select jhtjj
    scan
      select _jhtj
      append blank
      replace 品名 with jhtjj.品名,规格 with jhtjj.规格,颜色 with jhtjj.颜色,进货数量 with jhtjj.数量,进货金额 with jhtjj.金额
      select jhtjj
    endscan

    select jhtjt
    scan
      select _jhtj
      locate for alltrim(规格)==alltrim(jhtjt.规格)
      if .not. found()
        append blank
        replace 品名 with jhtjt.品名,规格 with jhtjt.规格,退货金额 with jhtjt.金额
       else
        replace 退货金额 with jhtjt.金额
      endif
      select jhtjt
    endscan

    select jhtjb
    scan
      select _jhtj
      locate for alltrim(规格)==alltrim(jhtjb.规格)
      if .not. found()
        append blank
        replace 品名 with jhtjb.品名,规格 with jhtjb.规格,保修金额 with jhtjb.金额
       else
        replace 保修金额 with jhtjb.金额
      endif
      select jhtjb
    endscan

    select jhtjf
    scan
      select _jhtj
      locate for alltrim(规格)==alltrim(jhtjf.规格)
      if .not. found()
        append blank
        replace 品名 with jhtjf.品名,规格 with jhtjf.规格,未返回金额 with jhtjf.金额
       else
        replace 未返回金额 with jhtjf.金额
      endif
      select jhtjf
    endscan
    
    select _jhtj
    sum 进货金额,退货金额,保修金额,未返回金额 to jhhj,thhj,bxhj,wfhhj
    append blank
    replace 品名 with '     合       计',进货金额 with jhhj,退货金额 with thhj,保修金额 with bxhj,未返回金额 with wfhhj
    index on 进货金额 tag jhje of _jhtj

    xxts.release
    dhxx='查看后是否打印?'
    qd=.t.
    do form sfdhk
    
    report form jhtj2 preview
    if qd
      report form jhtj2 to printer noconsole
    endif

  endif
  do jrz with p_gzrrxm,'退出进货单统计'
endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -