cwbb.go 85 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794
  1. package TaxSb
  2. import (
  3. "context"
  4. "fmt"
  5. "git.listensoft.net/tool/jspkit/common"
  6. "git.listensoft.net/tool/jspkit/common/models"
  7. "git.listensoft.net/tool/jspkit/common/models/sb"
  8. "git.listensoft.net/tool/jspkit/common/variable"
  9. "git.listensoft.net/tool/jspkit/taxerr"
  10. "github.com/go-rod/rod"
  11. "github.com/go-rod/rod/lib/utils"
  12. "strings"
  13. )
  14. // SbXqyCwbb 小企业会计制度2013申报 标签页自动关闭
  15. func SbXqyCwbb(ctx context.Context, newp1 *rod.Page, info models.CompanyInfo, task *models.TaxTask) {
  16. defer newp1.MustClose()
  17. // 数据获取
  18. kjzcfz := []sb.KjZcfz{}
  19. if ok := common.GetData(variable.KjZcfz, task.Data, &kjzcfz); !ok {
  20. task.Result.BusinessLog = "<span>[错误]:资产负债表数据为空</span><br />[操作]:请重新取数后重试"
  21. task.Result.BusinessStatus = variable.TaxFail
  22. return
  23. }
  24. kjlrb := []sb.KjLrb{}
  25. if ok := common.GetData(variable.KjLrb, task.Data, &kjlrb); !ok {
  26. task.Result.BusinessLog = "<span>[错误]:利润表数据为空</span><br />[操作]:请重新取数后重试"
  27. task.Result.BusinessStatus = variable.TaxFail
  28. return
  29. }
  30. kjxjllb := []sb.KjXjllb{}
  31. common.GetData(variable.KjXjllbJb, task.Data, &kjxjllb)
  32. err := rod.Try(func() {
  33. utils.Sleep(5)
  34. if newp1.MustHasX(`//div[contains(text(),'请重新选择报送所属期间或者去备案')]`) {
  35. task.Result.BusinessStatus = variable.TaxNoNeed
  36. task.Result.BusinessLog = "当前报送所属期间没有有效的备案信息"
  37. task.Result.BusinessImg = SaveErrImg(newp1, info)
  38. return
  39. }
  40. //全部改为直接申报 不区分上期是否已申报
  41. if newp1.MustHasX(`//div[text()='您上一期的财务报表未报送,请核实是否修改报送所属期。']`) {
  42. newp1.Timeout(common.ClickTimeOut).MustElementX(`//div[text()='您上一期的财务报表未报送,请核实是否修改报送所属期。']/..//button`).MustClick()
  43. }
  44. if newp1.Timeout(common.ClickTimeOut).MustHasX(`//span[contains(text(), "继续办理")]`) {
  45. newp1.Timeout(common.ClickTimeOut).MustElementX(`//span[contains(text(), "继续办理")]`).MustClick()
  46. }
  47. if newp1.MustHasR(`body > section > section > section > main > div > div > div > div.gov-inspect > div.gov-inspect-header > div.gov-inspect-header__status-text`, "检测不通过") {
  48. errMsg := newp1.Timeout(common.ClickTimeOut).MustElement(`body > section > section > section > main > div > div > div > div.gov-inspect > div.gov-inspect-table > div > div > div > div > span.gov-inspect-item__text > span`).MustText()
  49. task.Result.BusinessStatus = variable.TaxFail
  50. task.Result.BusinessImg = SaveErrImg(newp1, info)
  51. panic(taxerr.NewUserV3(errMsg, "请核实后重试"))
  52. }
  53. //检测不通过 返回首页
  54. if newp1.Timeout(common.ClickTimeOut).MustHasX(`//span[contains(text(), "返回首页")]`) {
  55. newp1.MustClose()
  56. task.Result.BusinessStatus = variable.TaxFail
  57. task.Result.BusinessLog = "检测不通过"
  58. task.Result.BusinessImg = SaveErrImg(newp1, info)
  59. return
  60. }
  61. //提示
  62. if newp1.MustHasX(`//div[@class="t-dialog__body t-dialog__body--icon"]`) {
  63. newp1.Timeout(common.ClickTimeOut).MustElementX(`//span[text()="关闭"]`).MustClick()
  64. }
  65. utils.Sleep(3)
  66. if newp1.MustHasX(`//div[@class="t-dialog__body t-dialog__body__icon"]`) {
  67. text := newp1.MustElementX(`//div[@class="t-dialog__body t-dialog__body__icon"]`).MustText()
  68. if strings.Contains(text, "未报送") {
  69. panic(taxerr.NewUserV3(text, "如需申报请联系客服"))
  70. }
  71. }
  72. // 选择在线填写
  73. if newp1.Timeout(common.ClickTimeOut).MustHas(`#page-content > div > section > main > div > div > div > div.content-body > div > div:nth-child(3) > div`) {
  74. newp1.Timeout(common.ClickTimeOut).MustElement(`#page-content > div > section > main > div > div > div > div.content-body > div > div:nth-child(3) > div`).MustClick()
  75. }
  76. utils.Sleep(1)
  77. rr := newp1.MustWaitRequestIdle()
  78. newp1.Timeout(common.ClickTimeOut).MustSearch(`下一步`).MustClick()
  79. rr()
  80. utils.Sleep(3)
  81. //"该所属期已完成申报,是否要进行该所属期的申报错误更正"
  82. if newp1.MustHasX(`//div[@class="t-dialog__body t-dialog__body__icon"]`) {
  83. task.Result.BusinessStatus = variable.TaxSuccess
  84. return
  85. }
  86. xqycwbbDeclareDo(ctx, newp1, info, kjzcfz, kjlrb, kjxjllb, task)
  87. })
  88. if err != nil {
  89. task.Result.BusinessStatus = variable.TaxFail
  90. task.Result.BusinessLog = common.HandleError(ctx, err).Error()
  91. return
  92. }
  93. return
  94. }
  95. // 小企业会计制度2013填表
  96. func xqycwbbDeclareDo(ctx context.Context, newp1 *rod.Page, info models.CompanyInfo, kjzcfz []sb.KjZcfz, kjlrb []sb.KjLrb, kjxjllb []sb.KjXjllb, task *models.TaxTask) {
  97. err := rod.Try(func() {
  98. zz := WaitElementXZcFz(newp1, `//h1[contains(text(),'资产负债表')]`, 1).MustText()
  99. if len(zz) == 0 {
  100. panic(taxerr.NewUserV3(`网页卡顿`, "请稍后重试"))
  101. }
  102. if !strings.Contains(zz, "小企业") {
  103. path := SaveErrImg(newp1, info)
  104. task.Result.BusinessImg = path
  105. panic(taxerr.NewUserV3(`会计准则选择错误`, "请修改后重试"))
  106. }
  107. newp2 := newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame()
  108. //资产负债表
  109. newp2.Timeout(common.ClickTimeOut).MustElement(`#divSheetlist > li:nth-child(1) > a`).MustClick()
  110. utils.Sleep(2)
  111. //if newp.Timeout(common.ClickTimeOut).MustHasR(`#viewCtrlId > div.NewTableHead > h1`, "企业会计制度") {
  112. // panic(taxerr.NewUserV3(`会计准则选择错误,税局为(企业会计制度)`))
  113. //}
  114. //*** 校验
  115. // 年初余额
  116. ncFlag := false
  117. //newp := newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame()
  118. if kjzcfz[len(kjzcfz)-1].NcyeZc != 0 && kjzcfz[len(kjzcfz)-1].NcyeQy != 0 {
  119. ncFlag = true
  120. common.Input(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"货币资金")]/..//input)[2]`, common.FloatToStr(kjzcfz[0].NcyeZc))
  121. common.Input(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"短期投资")]/..//input)[2]`, common.FloatToStr(kjzcfz[1].NcyeZc))
  122. common.Input(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"应收票据")]/..//input)[2]`, common.FloatToStr(kjzcfz[2].NcyeZc))
  123. common.Input(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"应收账款")]/..//input)[2]`, common.FloatToStr(kjzcfz[3].NcyeZc))
  124. common.Input(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"预付账款")]/..//input)[2]`, common.FloatToStr(kjzcfz[4].NcyeZc))
  125. common.Input(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"应收股利")]/..//input)[2]`, common.FloatToStr(kjzcfz[5].NcyeZc))
  126. common.Input(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"应收利息")]/..//input)[2]`, common.FloatToStr(kjzcfz[6].NcyeZc))
  127. common.Input(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"其他应收款")]/..//input)[2]`, common.FloatToStr(kjzcfz[7].NcyeZc))
  128. common.Input(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"存货")]/..//input)[2]`, common.FloatToStr(kjzcfz[8].NcyeZc))
  129. common.Input(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"其中:原材料")]/..//input)[2]`, common.FloatToStr(kjzcfz[9].NcyeZc))
  130. common.Input(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"在产品")]/..//input)[2]`, common.FloatToStr(kjzcfz[10].NcyeZc))
  131. common.Input(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"库存商品")]/..//input)[2]`, common.FloatToStr(kjzcfz[11].NcyeZc))
  132. common.Input(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"周转材料")]/..//input)[2]`, common.FloatToStr(kjzcfz[12].NcyeZc))
  133. common.Input(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"其他流动资产")]/..//input)[2]`, common.FloatToStr(kjzcfz[13].NcyeZc))
  134. common.Input(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"长期债券投资")]/..//input)[2]`, common.FloatToStr(kjzcfz[16].NcyeZc))
  135. common.Input(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"长期股权投资")]/..//input)[2]`, common.FloatToStr(kjzcfz[17].NcyeZc))
  136. common.Input(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"固定资产原价")]/..//input)[2]`, common.FloatToStr(kjzcfz[18].NcyeZc))
  137. common.Input(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"减:累计折旧")]/..//input)[2]`, common.FloatToStr(kjzcfz[19].NcyeZc))
  138. common.Input(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"在建工程")]/..//input)[2]`, common.FloatToStr(kjzcfz[21].NcyeZc))
  139. common.Input(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"工程物资")]/..//input)[2]`, common.FloatToStr(kjzcfz[22].NcyeZc))
  140. common.Input(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"固定资产清理")]/..//input)[2]`, common.FloatToStr(kjzcfz[23].NcyeZc))
  141. common.Input(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"生产性生物资产")]/..//input)[2]`, common.FloatToStr(kjzcfz[24].NcyeZc))
  142. common.Input(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"无形资产")]/..//input)[2]`, common.FloatToStr(kjzcfz[25].NcyeZc))
  143. common.Input(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"开发支出")]/..//input)[2]`, common.FloatToStr(kjzcfz[26].NcyeZc))
  144. common.Input(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"长期待摊费用")]/..//input)[2]`, common.FloatToStr(kjzcfz[27].NcyeZc))
  145. common.Input(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"其他非流动资产")]/..//input)[2]`, common.FloatToStr(kjzcfz[28].NcyeZc))
  146. common.Input(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"短期借款")]/..//input)[4]`, common.FloatToStr(kjzcfz[0].NcyeQy))
  147. common.Input(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"应付票据")]/..//input)[4]`, common.FloatToStr(kjzcfz[1].NcyeQy))
  148. common.Input(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"应付账款")]/..//input)[4]`, common.FloatToStr(kjzcfz[2].NcyeQy))
  149. common.Input(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"预收账款")]/..//input)[4]`, common.FloatToStr(kjzcfz[3].NcyeQy))
  150. common.Input(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"应付职工薪酬")]/..//input)[4]`, common.FloatToStr(kjzcfz[4].NcyeQy))
  151. common.Input(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"应交税费")]/..//input)[4]`, common.FloatToStr(kjzcfz[5].NcyeQy))
  152. common.Input(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"应付利息")]/..//input)[4]`, common.FloatToStr(kjzcfz[6].NcyeQy))
  153. common.Input(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"应付利润")]/..//input)[4]`, common.FloatToStr(kjzcfz[7].NcyeQy))
  154. common.Input(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"其他应付款")]/..//input)[4]`, common.FloatToStr(kjzcfz[8].NcyeQy))
  155. common.Input(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"其他流动负债")]/..//input)[4]`, common.FloatToStr(kjzcfz[9].NcyeQy))
  156. common.Input(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"长期借款")]/..//input)[4]`, common.FloatToStr(kjzcfz[12].NcyeQy))
  157. common.Input(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"长期应付款")]/..//input)[4]`, common.FloatToStr(kjzcfz[13].NcyeQy))
  158. common.Input(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"递延收益")]/..//input)[4]`, common.FloatToStr(kjzcfz[14].NcyeQy))
  159. common.Input(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"其他非流动负债")]/..//input)[4]`, common.FloatToStr(kjzcfz[15].NcyeQy))
  160. common.Input(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"实收资本(或股本)")]/..//input)[4]`, common.FloatToStr(kjzcfz[25].NcyeQy))
  161. common.Input(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"资本公积")]/..//input)[4]`, common.FloatToStr(kjzcfz[26].NcyeQy))
  162. common.Input(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"盈余公积")]/..//input)[4]`, common.FloatToStr(kjzcfz[27].NcyeQy))
  163. common.Input(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"未分配利润")]/..//input)[4]`, common.FloatToStr(kjzcfz[28].NcyeQy))
  164. }
  165. // 流动资产合计校验//context.deadlineExceededError
  166. ncyeZc := newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame().MustEval(`()=>{return document.evaluate('//input[@ng-model="syxqyzcfzbGrid.xqyzcfzbGridlb[14].ncyeZc"]', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.value}`).Str()
  167. ncyeZc = strings.ReplaceAll(ncyeZc, ",", "")
  168. if ncFlag && kjzcfz[14].NcyeZc != common.StrToFloat(ncyeZc) {
  169. panic(taxerr.NewUserV3(`年初余额流动资产合计与系统不一致,系统为:`+common.FloatToStr(kjzcfz[14].NcyeZc)+`,税局为:`+ncyeZc, "请核实后重试"))
  170. }
  171. //货币资金
  172. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `//input[@ng-model="syxqyzcfzbGrid.xqyzcfzbGridlb[0].qmyeZc"]`, common.FloatToStr(kjzcfz[0].QmyeZc))
  173. //短期投资
  174. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `//input[@ng-model="syxqyzcfzbGrid.xqyzcfzbGridlb[1].qmyeZc"]`, common.FloatToStr(kjzcfz[1].QmyeZc))
  175. //应收票据
  176. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"应收票据")]/..//input)[1]`, common.FloatToStr(kjzcfz[2].QmyeZc))
  177. //应收账款
  178. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"应收账款")]/..//input)[1]`, common.FloatToStr(kjzcfz[3].QmyeZc))
  179. //预付账款
  180. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"预付账款")]/..//input)[1]`, common.FloatToStr(kjzcfz[4].QmyeZc))
  181. //应收股利
  182. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"应收股利")]/..//input)[1]`, common.FloatToStr(kjzcfz[5].QmyeZc))
  183. //应收利息
  184. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"应收利息")]/..//input)[1]`, common.FloatToStr(kjzcfz[6].QmyeZc))
  185. //其他应收款
  186. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"其他应收款")]/..//input)[1]`, common.FloatToStr(kjzcfz[7].QmyeZc))
  187. //存货
  188. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"存货")]/..//input)[1]`, common.FloatToStr(kjzcfz[8].QmyeZc))
  189. //其中 :原材料
  190. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"其中:原材料")]/..//input)[1]`, common.FloatToStr(kjzcfz[9].QmyeZc))
  191. //在产品
  192. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"在产品")]/..//input)[1]`, common.FloatToStr(kjzcfz[10].QmyeZc))
  193. //库存商品
  194. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"库存商品")]/..//input)[1]`, common.FloatToStr(kjzcfz[11].QmyeZc))
  195. //周转材料
  196. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"周转材料")]/..//input)[1]`, common.FloatToStr(kjzcfz[12].QmyeZc))
  197. //其他流动资产
  198. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"其他流动资产")]/..//input)[1]`, common.FloatToStr(kjzcfz[13].QmyeZc))
  199. //流动资产合计
  200. //common.Input(newp, `#\30 01C15`, common.FloatToStr(kjzcfz[14].QmyeZc))
  201. //common.Input(newp, `#\30 01D15`, common.FloatToStr(kjzcfz[14].NcyeZc))
  202. //非流动资产
  203. //长期债券投资
  204. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"长期债券投资")]/..//input)[1]`, common.FloatToStr(kjzcfz[16].QmyeZc))
  205. //长期股权投资
  206. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"长期股权投资")]/..//input)[1]`, common.FloatToStr(kjzcfz[17].QmyeZc))
  207. //固定资产原价
  208. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"固定资产原价")]/..//input)[1]`, common.FloatToStr(kjzcfz[18].QmyeZc))
  209. //减:累计折旧
  210. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"减:累计折旧")]/..//input)[1]`, common.FloatToStr(kjzcfz[19].QmyeZc))
  211. //固定资产账面价值
  212. //common.Input(newp, `#\30 01C20`, common.FloatToStr(kjzcfz[20].QmyeZc))
  213. //common.Input(newp, `#\30 01D20`, common.FloatToStr(kjzcfz[20].NcyeZc))
  214. //在建工程
  215. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"在建工程")]/..//input)[1]`, common.FloatToStr(kjzcfz[21].QmyeZc))
  216. //工程物资
  217. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"工程物资")]/..//input)[1]`, common.FloatToStr(kjzcfz[22].QmyeZc))
  218. //固定资产清理
  219. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"固定资产清理")]/..//input)[1]`, common.FloatToStr(kjzcfz[23].QmyeZc))
  220. //生物性生物资产
  221. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"生产性生物资产")]/..//input)[1]`, common.FloatToStr(kjzcfz[24].QmyeZc))
  222. //无形资产
  223. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"无形资产")]/..//input)[1]`, common.FloatToStr(kjzcfz[25].QmyeZc))
  224. //开发支出
  225. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"开发支出")]/..//input)[1]`, common.FloatToStr(kjzcfz[26].QmyeZc))
  226. //长期待摊费用
  227. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"长期待摊费用")]/..//input)[1]`, common.FloatToStr(kjzcfz[27].QmyeZc))
  228. //其他非流动资产
  229. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"其他非流动资产")]/..//input)[1]`, common.FloatToStr(kjzcfz[28].QmyeZc))
  230. //非流动资产合计
  231. //common.Input(newp, `#\30 01C29`, common.FloatToStr(kjzcfz[29].QmyeZc))
  232. //common.Input(newp, `#\30 01D29`, common.FloatToStr(kjzcfz[29].NcyeZc))
  233. ////资产合计
  234. //common.Input(newp, `#\30 01C30`, common.FloatToStr(kjzcfz[30].QmyeZc))
  235. //common.Input(newp, `#\30 01D30`, common.FloatToStr(kjzcfz[30].NcyeZc))
  236. //流动负债
  237. //短期借款
  238. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"短期借款")]/..//input)[3]`, common.FloatToStr(kjzcfz[0].QmyeQy))
  239. //应付票据
  240. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"应付票据")]/..//input)[3]`, common.FloatToStr(kjzcfz[1].QmyeQy))
  241. //应付账款
  242. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"应付账款")]/..//input)[3]`, common.FloatToStr(kjzcfz[2].QmyeQy))
  243. //预收账款
  244. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"预收账款")]/..//input)[3]`, common.FloatToStr(kjzcfz[3].QmyeQy))
  245. //应付职工薪酬
  246. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"应付职工薪酬")]/..//input)[3]`, common.FloatToStr(kjzcfz[4].QmyeQy))
  247. //应交税费
  248. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"应交税费")]/..//input)[3]`, common.FloatToStr(kjzcfz[5].QmyeQy))
  249. //应付利息
  250. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"应付利息")]/..//input)[3]`, common.FloatToStr(kjzcfz[6].QmyeQy))
  251. //应付利润
  252. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"应付利润")]/..//input)[3]`, common.FloatToStr(kjzcfz[7].QmyeQy))
  253. //其他应付款
  254. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"其他应付款")]/..//input)[3]`, common.FloatToStr(kjzcfz[8].QmyeQy))
  255. //其他流动负债
  256. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"其他流动负债")]/..//input)[3]`, common.FloatToStr(kjzcfz[9].QmyeQy))
  257. //非流动负债
  258. //长期借款
  259. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"长期借款")]/..//input)[3]`, common.FloatToStr(kjzcfz[12].QmyeQy))
  260. //长期应付款
  261. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"长期应付款")]/..//input)[3]`, common.FloatToStr(kjzcfz[13].QmyeQy))
  262. //递延收益
  263. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"递延收益")]/..//input)[3]`, common.FloatToStr(kjzcfz[14].QmyeQy))
  264. //其他非流动负债
  265. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"其他非流动负债")]/..//input)[3]`, common.FloatToStr(kjzcfz[15].QmyeQy))
  266. //实收资本(或股份)
  267. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"实收资本(或股本)")]/..//input)[3]`, common.FloatToStr(kjzcfz[25].QmyeQy))
  268. //资本公积
  269. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"资本公积")]/..//input)[3]`, common.FloatToStr(kjzcfz[26].QmyeQy))
  270. //盈余公积
  271. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"盈余公积")]/..//input)[3]`, common.FloatToStr(kjzcfz[27].QmyeQy))
  272. //未分配利润
  273. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"未分配利润")]/..//input)[3]`, common.FloatToStr(kjzcfz[28].QmyeQy))
  274. //这里需要失去焦距,不然不会计算
  275. newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame().MustElementX(`(//td[contains(text(),"盈余公积")]/..//input)[3]`).MustClick()
  276. utils.Sleep(0.5)
  277. //所有者权益(或股东权益)合计
  278. // 非流动资产合计校验
  279. ncyeZc2 := newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame().
  280. MustEval(`()=>{return document.evaluate('//input[@ng-model="syxqyzcfzbGrid.xqyzcfzbGridlb[29].ncyeZc"]', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.value}`).Str()
  281. ncyeZc2 = strings.ReplaceAll(ncyeZc2, ",", "")
  282. //ncyeZc2 := *newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame().MustElementX(`(//td[contains(text(),"非流动资产合计")]/..//input)[2]`).MustAttribute("value")
  283. if ncFlag && kjzcfz[29].NcyeZc != common.StrToFloat(ncyeZc2) {
  284. panic(taxerr.NewUserV3(`年初余额非流动资产合计与系统不一致,系统为:`+common.FloatToStr(kjzcfz[29].NcyeZc)+`,税局为:`+ncyeZc2, "请核实后重试"))
  285. }
  286. // 资产合计校验
  287. ncyeZc3 := newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame().
  288. MustEval(`()=>{return document.evaluate('//input[@ng-model="syxqyzcfzbGrid.xqyzcfzbGridlb[30].ncyeZc"]', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.value}`).Str()
  289. ncyeZc3 = strings.ReplaceAll(ncyeZc3, ",", "")
  290. //ncyeZc3 := *newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame().MustElementX(`(//td[contains(text(),"资产合计")]/..//input)[2]`).MustAttribute("value")
  291. if ncFlag && kjzcfz[30].NcyeZc != common.StrToFloat(ncyeZc3) {
  292. panic(taxerr.NewUserV3(`年初余额资产合计校验与系统不一致,系统为:`+common.FloatToStr(kjzcfz[30].NcyeZc)+`,税局为:`+ncyeZc3, "请核实后重试"))
  293. }
  294. ncyeZc4 := newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame().
  295. MustEval(`()=>{return document.evaluate('//input[@ng-model="syxqyzcfzbGrid.xqyzcfzbGridlb[10].ncyeQy"]', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.value}`).Str()
  296. ncyeZc4 = strings.ReplaceAll(ncyeZc4, ",", "")
  297. //ncyeZc4 := *newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame().MustElementX(`(//td[contains(text(),"流动负债合计")]/..//input)[4]`).MustAttribute("value")
  298. if ncFlag && kjzcfz[10].NcyeQy != common.StrToFloat(ncyeZc4) {
  299. panic(taxerr.NewUserV3(`年初余额流动负债合计与系统不一致,系统为:`+common.FloatToStr(kjzcfz[10].NcyeQy)+`,税局为:`+ncyeZc4, "请核实后重试"))
  300. }
  301. //非流动负债合计校验
  302. ncyeZc5 := newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame().
  303. MustEval(`()=>{return document.evaluate('//input[@ng-model="syxqyzcfzbGrid.xqyzcfzbGridlb[16].ncyeQy"]', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.value}`).Str()
  304. ncyeZc5 = strings.ReplaceAll(ncyeZc5, ",", "")
  305. //ncyeZc5 := *newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame().MustElementX(`(//td[contains(text(),"非流动负债合计")]/..//input)[4]`).MustAttribute("value")
  306. if ncFlag && kjzcfz[16].NcyeQy != common.StrToFloat(ncyeZc5) {
  307. panic(taxerr.NewUserV3(`年初余额非流动负债合计与系统不一致,系统为:`+common.FloatToStr(kjzcfz[16].NcyeQy)+`,税局为:`+ncyeZc5, "请核实后重试"))
  308. }
  309. //负债合计校验
  310. ncyeZc6 := newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame().
  311. MustEval(`()=>{return document.evaluate('//input[@ng-model="syxqyzcfzbGrid.xqyzcfzbGridlb[17].ncyeQy"]', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.value}`).Str()
  312. ncyeZc6 = strings.ReplaceAll(ncyeZc6, ",", "")
  313. //ncyeZc6 := *newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame().MustElementX(`(//td[contains(text(),"负债合计")]/..//input)[4]`).MustAttribute("value")
  314. if ncFlag && kjzcfz[17].NcyeQy != common.StrToFloat(ncyeZc6) {
  315. panic(taxerr.NewUserV3(`年初余额负债合计与系统不一致,系统为:`+common.FloatToStr(kjzcfz[17].NcyeQy)+`,税局为:`+ncyeZc6, "请核实后重试"))
  316. }
  317. //所有者权益(或股东权益)合计校验
  318. ncyeZc7 := newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame().
  319. MustEval(`()=>{return document.evaluate('//input[@ng-model="syxqyzcfzbGrid.xqyzcfzbGridlb[29].ncyeQy"]', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.value}`).Str()
  320. ncyeZc7 = strings.ReplaceAll(ncyeZc7, ",", "")
  321. //ncyeZc7 := *newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame().MustElementX(`(//td[contains(text(),"所有者权益(或股东权益)合计")]/..//input)[4]`).MustAttribute("value")
  322. if ncFlag && kjzcfz[29].NcyeQy != common.StrToFloat(ncyeZc7) {
  323. panic(taxerr.NewUserV3(`年初余额所有者权益(或股东权益)合计与系统不一致,系统为:`+common.FloatToStr(kjzcfz[29].NcyeQy)+`,税局为:`+ncyeZc7, "请核实后重试"))
  324. }
  325. ////负债和所有者权益(或股东权益)总计
  326. //common.Input(newp, `#\30 01G30`, common.FloatToStr(kjzcfz[30].QmyeQy))
  327. //common.Input(newp, `#\30 01H30`, common.FloatToStr(kjzcfz[30].NcyeQy))
  328. //负债和所有者权益(或股东权益)总计校验
  329. ncyeZc8 := newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame().
  330. MustEval(`()=>{return document.evaluate('//input[@ng-model="syxqyzcfzbGrid.xqyzcfzbGridlb[30].ncyeQy"]', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.value}`).Str()
  331. ncyeZc8 = strings.ReplaceAll(ncyeZc8, ",", "")
  332. //ncyeZc8 := *newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame().MustElementX(`(//td[contains(text(),"所有者权益(或股东权益)合计")]/..//input)[4]`).MustAttribute("value")
  333. if kjzcfz[30].NcyeQy != common.StrToFloat(ncyeZc8) {
  334. panic(taxerr.NewUserV3(`年初余额负债和所有者权益(或股东权益)总计校验与系统不一致,系统为:`+common.FloatToStr(kjzcfz[30].NcyeQy)+`,税局为:`+ncyeZc8, "请核实后重试"))
  335. }
  336. //利润表
  337. rr := newp1.MustWaitRequestIdle()
  338. newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#divSheetlist > li:nth-child(2) > a`).MustClick() //点击利润表
  339. rr()
  340. lrb := WaitElementXZcFz(newp1, "//h1[contains(text(),'利润表')]", 1).MustText()
  341. if len(lrb) == 0 {
  342. panic(taxerr.NewUserV3("税局卡顿资产负债表加载异常", "请稍后重试"))
  343. }
  344. utils.Sleep(3)
  345. //营业收入
  346. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"营业收入")]/..//input)[2]`, common.FloatToStr(kjlrb[0].PeriodTotal))
  347. utils.Sleep(0.5)
  348. //减:营业成本
  349. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"减:营业成本")]/..//input)[2]`, common.FloatToStr(kjlrb[1].PeriodTotal))
  350. utils.Sleep(0.5)
  351. //税金及附加
  352. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"税金及附加")]/..//input)[2]`, common.FloatToStr(kjlrb[2].PeriodTotal))
  353. utils.Sleep(0.5)
  354. //其中:消费税
  355. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"其中:消费税")]/..//input)[2]`, common.FloatToStr(kjlrb[3].PeriodTotal))
  356. utils.Sleep(0.5)
  357. //营业税
  358. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"营业税")]/..//input)[2]`, common.FloatToStr(kjlrb[4].PeriodTotal))
  359. utils.Sleep(0.5)
  360. //城市维护建设税
  361. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"城市维护建设税")]/..//input)[2]`, common.FloatToStr(kjlrb[5].PeriodTotal))
  362. utils.Sleep(0.5)
  363. //资源税
  364. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"资源税")]/..//input)[2]`, common.FloatToStr(kjlrb[6].PeriodTotal))
  365. utils.Sleep(0.5)
  366. //土地增值税
  367. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"土地增值税")]/..//input)[2]`, common.FloatToStr(kjlrb[7].PeriodTotal))
  368. utils.Sleep(0.5)
  369. // 城镇土地使用税、房产税、车船税、印花税
  370. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"城镇土地使用税、房产税、车船税、印花税")]/..//input)[2]`, common.FloatToStr(kjlrb[8].PeriodTotal))
  371. utils.Sleep(0.5)
  372. //教育费附加、矿产资源补偿费、排污费
  373. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"教育费附加、矿产资源补偿费、排污费")]/..//input)[2]`, common.FloatToStr(kjlrb[9].PeriodTotal))
  374. utils.Sleep(0.5)
  375. //销售费用
  376. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"销售费用")]/..//input)[2]`, common.FloatToStr(kjlrb[10].PeriodTotal))
  377. utils.Sleep(0.5)
  378. //其中:商品维修费
  379. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"其中:商品维修费")]/..//input)[2]`, common.FloatToStr(kjlrb[11].PeriodTotal))
  380. utils.Sleep(0.5)
  381. //广告费和业务宣传费
  382. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"广告费和业务宣传费")]/..//input)[2]`, common.FloatToStr(kjlrb[12].PeriodTotal))
  383. utils.Sleep(0.5)
  384. //管理费用
  385. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"管理费用")]/..//input)[2]`, common.FloatToStr(kjlrb[13].PeriodTotal))
  386. utils.Sleep(0.5)
  387. //其中:开办费
  388. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"其中:开办费")]/..//input)[2]`, common.FloatToStr(kjlrb[14].PeriodTotal))
  389. utils.Sleep(0.5)
  390. //业务招待费
  391. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"业务招待费")]/..//input)[2]`, common.FloatToStr(kjlrb[15].PeriodTotal))
  392. utils.Sleep(0.5)
  393. //研究费用
  394. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"研究费用")]/..//input)[2]`, common.FloatToStr(kjlrb[16].PeriodTotal))
  395. utils.Sleep(0.5)
  396. //财务费用
  397. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"财务费用")]/..//input)[2]`, common.FloatToStr(kjlrb[17].PeriodTotal))
  398. utils.Sleep(0.5)
  399. //其中:利息费用
  400. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"其中:利息费用(收入以-号填列)")]/..//input)[2]`, common.FloatToStr(kjlrb[18].PeriodTotal))
  401. utils.Sleep(0.5)
  402. //加:投资收益
  403. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"加:投资收益(损失以-号填列)")]/..//input)[2]`, common.FloatToStr(kjlrb[19].PeriodTotal))
  404. utils.Sleep(0.5)
  405. //加:营业外收入
  406. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"加:营业外收入")]/..//input)[2]`, common.FloatToStr(kjlrb[21].PeriodTotal))
  407. utils.Sleep(0.5)
  408. //其中:政府补助
  409. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"其中:政府补助")]/..//input)[2]`, common.FloatToStr(kjlrb[22].PeriodTotal))
  410. utils.Sleep(0.5)
  411. //减:营业外支出
  412. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"减:营业外支出")]/..//input)[2]`, common.FloatToStr(kjlrb[23].PeriodTotal))
  413. utils.Sleep(0.5)
  414. //其中:坏账损失//
  415. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"其中:坏账损失")]/..//input)[2]`, common.FloatToStr(kjlrb[24].PeriodTotal))
  416. utils.Sleep(0.5)
  417. //无法收回的长期债券投资损失
  418. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"无法收回的长期债券投资损失")]/..//input)[2]`, common.FloatToStr(kjlrb[25].PeriodTotal))
  419. utils.Sleep(0.5)
  420. //无法收回的长期股权投资损失
  421. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"无法收回的长期股权投资损失")]/..//input)[2]`, common.FloatToStr(kjlrb[26].PeriodTotal))
  422. utils.Sleep(0.5)
  423. //自然灾害等不可抗力因素造成的损失
  424. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"自然灾害等不可抗力因素造成的损失")]/..//input)[2]`, common.FloatToStr(kjlrb[27].PeriodTotal))
  425. utils.Sleep(0.5)
  426. //税收滞纳金
  427. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"税收滞纳金")]/..//input)[2]`, common.FloatToStr(kjlrb[28].PeriodTotal))
  428. utils.Sleep(0.5)
  429. // 减:所得税费用
  430. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"减:所得税费用")]/..//input)[2]`, common.FloatToStr(kjlrb[30].PeriodTotal))
  431. utils.Sleep(3)
  432. //本年数
  433. //营业收入
  434. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"营业收入")]/..//input)[1]`, common.FloatToStr(kjlrb[0].YearTotal))
  435. utils.Sleep(0.5)
  436. //减:营业成本
  437. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"减:营业成本")]/..//input)[1]`, common.FloatToStr(kjlrb[1].YearTotal))
  438. utils.Sleep(0.5)
  439. //税金及附加
  440. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"税金及附加")]/..//input)[1]`, common.FloatToStr(kjlrb[2].YearTotal))
  441. utils.Sleep(0.5)
  442. //其中:消费税
  443. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"其中:消费税")]/..//input)[1]`, common.FloatToStr(kjlrb[3].YearTotal))
  444. utils.Sleep(0.5)
  445. //营业税
  446. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"营业税")]/..//input)[1]`, common.FloatToStr(kjlrb[4].YearTotal))
  447. utils.Sleep(0.5)
  448. //城市维护建设税
  449. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"城市维护建设税")]/..//input)[1]`, common.FloatToStr(kjlrb[5].YearTotal))
  450. utils.Sleep(0.5)
  451. //资源税
  452. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"资源税")]/..//input)[1]`, common.FloatToStr(kjlrb[6].YearTotal))
  453. utils.Sleep(0.5)
  454. //土地增值税
  455. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"土地增值税")]/..//input)[1]`, common.FloatToStr(kjlrb[7].YearTotal))
  456. utils.Sleep(0.5)
  457. // 城镇土地使用税、房产税、车船税、印花税
  458. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"城镇土地使用税、房产税、车船税、印花税")]/..//input)[1]`, common.FloatToStr(kjlrb[8].YearTotal))
  459. utils.Sleep(0.5)
  460. //教育费附加、矿产资源补偿费、排污费
  461. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"教育费附加、矿产资源补偿费、排污费")]/..//input)[1]`, common.FloatToStr(kjlrb[9].YearTotal))
  462. utils.Sleep(0.5)
  463. //销售费用
  464. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"销售费用")]/..//input)[1]`, common.FloatToStr(kjlrb[10].YearTotal))
  465. utils.Sleep(0.5)
  466. //其中:商品维修费
  467. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"其中:商品维修费")]/..//input)[1]`, common.FloatToStr(kjlrb[11].YearTotal))
  468. utils.Sleep(0.5)
  469. //广告费和业务宣传费
  470. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"广告费和业务宣传费")]/..//input)[1]`, common.FloatToStr(kjlrb[12].YearTotal))
  471. utils.Sleep(0.5)
  472. //管理费用
  473. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"管理费用")]/..//input)[1]`, common.FloatToStr(kjlrb[13].YearTotal))
  474. utils.Sleep(0.5)
  475. //其中:开办费
  476. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"其中:开办费")]/..//input)[1]`, common.FloatToStr(kjlrb[14].YearTotal))
  477. utils.Sleep(0.5)
  478. //业务招待费
  479. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"业务招待费")]/..//input)[1]`, common.FloatToStr(kjlrb[15].YearTotal))
  480. utils.Sleep(0.5)
  481. //研究费用
  482. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"研究费用")]/..//input)[1]`, common.FloatToStr(kjlrb[16].YearTotal))
  483. utils.Sleep(0.5)
  484. //财务费用
  485. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"财务费用")]/..//input)[1]`, common.FloatToStr(kjlrb[17].YearTotal))
  486. utils.Sleep(0.5)
  487. //其中:利息费用
  488. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"其中:利息费用(收入以-号填列)")]/..//input)[1]`, common.FloatToStr(kjlrb[18].YearTotal))
  489. utils.Sleep(0.5)
  490. //加:投资收益
  491. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"加:投资收益(损失以-号填列)")]/..//input)[1]`, common.FloatToStr(kjlrb[19].YearTotal))
  492. utils.Sleep(0.5)
  493. //加:营业外收入
  494. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"加:营业外收入")]/..//input)[1]`, common.FloatToStr(kjlrb[21].YearTotal))
  495. utils.Sleep(0.5)
  496. //其中:政府补助
  497. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"其中:政府补助")]/..//input)[1]`, common.FloatToStr(kjlrb[22].YearTotal))
  498. utils.Sleep(0.5)
  499. //减:营业外支出
  500. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"减:营业外支出")]/..//input)[1]`, common.FloatToStr(kjlrb[23].YearTotal))
  501. utils.Sleep(0.5)
  502. //其中:坏账损失//
  503. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"其中:坏账损失")]/..//input)[1]`, common.FloatToStr(kjlrb[24].YearTotal))
  504. utils.Sleep(0.5)
  505. //无法收回的长期债券投资损失
  506. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"无法收回的长期债券投资损失")]/..//input)[1]`, common.FloatToStr(kjlrb[25].YearTotal))
  507. utils.Sleep(0.5)
  508. //无法收回的长期股权投资损失
  509. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"无法收回的长期股权投资损失")]/..//input)[1]`, common.FloatToStr(kjlrb[26].YearTotal))
  510. utils.Sleep(0.5)
  511. //自然灾害等不可抗力因素造成的损失
  512. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"自然灾害等不可抗力因素造成的损失")]/..//input)[1]`, common.FloatToStr(kjlrb[27].YearTotal))
  513. utils.Sleep(0.5)
  514. //税收滞纳金
  515. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"税收滞纳金")]/..//input)[1]`, common.FloatToStr(kjlrb[28].YearTotal))
  516. utils.Sleep(0.5)
  517. // 减:所得税费用
  518. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"减:所得税费用")]/..//input)[1]`, common.FloatToStr(kjlrb[30].YearTotal))
  519. utils.Sleep(3)
  520. v1 := strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"一、营业收入")]/..//input)[1]`).MustText(), ",", "")
  521. v2 := strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"一、营业收入")]/..//input)[2]`).MustText(), ",", "")
  522. if kjlrb[0].YearTotal != common.StrToFloat(v1) || kjlrb[0].PeriodTotal != common.StrToFloat(v2) {
  523. panic(taxerr.NewUserV3(fmt.Sprintf("营业收入校验与系统不一致,系统为:年:%s,本期:%s,税局为:年:%s,本期:%s", common.FloatToStr(kjlrb[0].YearTotal), common.FloatToStr(kjlrb[0].PeriodTotal), v1, v2), "请核实后重试"))
  524. }
  525. v1 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"减:营业成本")]/..//input)[1]`).MustText(), ",", "")
  526. v2 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"减:营业成本")]/..//input)[2]`).MustText(), ",", "")
  527. if kjlrb[1].YearTotal != common.StrToFloat(v1) || kjlrb[1].PeriodTotal != common.StrToFloat(v2) {
  528. panic(taxerr.NewUserV3(fmt.Sprintf("减:营业成本校验与系统不一致,系统为:年:%s,本期:%s,税局为:年:%s,本期:%s", common.FloatToStr(kjlrb[1].YearTotal), common.FloatToStr(kjlrb[1].PeriodTotal), v1, v2), "请核实后重试"))
  529. }
  530. v1 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"税金及附加")]/..//input)[1]`).MustText(), ",", "")
  531. v2 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"税金及附加")]/..//input)[2]`).MustText(), ",", "")
  532. if kjlrb[2].YearTotal != common.StrToFloat(v1) || kjlrb[2].PeriodTotal != common.StrToFloat(v2) {
  533. panic(taxerr.NewUserV3(fmt.Sprintf("税金及附加校验与系统不一致,系统为:年:%s,本期:%s,税局为:年:%s,本期:%s", common.FloatToStr(kjlrb[2].YearTotal), common.FloatToStr(kjlrb[2].PeriodTotal), v1, v2), "请核实后重试"))
  534. }
  535. v1 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"其中:消费税")]/..//input)[1]`).MustText(), ",", "")
  536. v2 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"其中:消费税")]/..//input)[2]`).MustText(), ",", "")
  537. if kjlrb[3].YearTotal != common.StrToFloat(v1) || kjlrb[3].PeriodTotal != common.StrToFloat(v2) {
  538. panic(taxerr.NewUserV3(fmt.Sprintf("其中:消费税校验与系统不一致,系统为:年:%s,本期:%s,税局为:年:%s,本期:%s", common.FloatToStr(kjlrb[3].YearTotal), common.FloatToStr(kjlrb[3].PeriodTotal), v1, v2), "请核实后重试"))
  539. }
  540. v1 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"营业税")]/..//input)[1]`).MustText(), ",", "")
  541. v2 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"营业税")]/..//input)[2]`).MustText(), ",", "")
  542. if kjlrb[4].YearTotal != common.StrToFloat(v1) || kjlrb[4].PeriodTotal != common.StrToFloat(v2) {
  543. panic(taxerr.NewUserV3(fmt.Sprintf("营业税校验与系统不一致,系统为:年:%s,本期:%s,税局为:年:%s,本期:%s", common.FloatToStr(kjlrb[4].YearTotal), common.FloatToStr(kjlrb[4].PeriodTotal), v1, v2), "请核实后重试"))
  544. }
  545. v1 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"城市维护建设税")]/..//input)[1]`).MustText(), ",", "")
  546. v2 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"城市维护建设税")]/..//input)[2]`).MustText(), ",", "")
  547. if kjlrb[5].YearTotal != common.StrToFloat(v1) || kjlrb[5].PeriodTotal != common.StrToFloat(v2) {
  548. panic(taxerr.NewUserV3(fmt.Sprintf("城市维护建设税校验与系统不一致,系统为:年:%s,本期:%s,税局为:年:%s,本期:%s", common.FloatToStr(kjlrb[5].YearTotal), common.FloatToStr(kjlrb[5].PeriodTotal), v1, v2), "请核实后重试"))
  549. }
  550. v1 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"资源税")]/..//input)[1]`).MustText(), ",", "")
  551. v2 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"资源税")]/..//input)[2]`).MustText(), ",", "")
  552. if kjlrb[6].YearTotal != common.StrToFloat(v1) || kjlrb[6].PeriodTotal != common.StrToFloat(v2) {
  553. panic(taxerr.NewUserV3(fmt.Sprintf("资源税校验与系统不一致,系统为:年:%s,本期:%s,税局为:年:%s,本期:%s", common.FloatToStr(kjlrb[6].YearTotal), common.FloatToStr(kjlrb[6].PeriodTotal), v1, v2), "请核实后重试"))
  554. }
  555. v1 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"土地增值税")]/..//input)[1]`).MustText(), ",", "")
  556. v2 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"土地增值税")]/..//input)[2]`).MustText(), ",", "")
  557. if kjlrb[7].YearTotal != common.StrToFloat(v1) || kjlrb[7].PeriodTotal != common.StrToFloat(v2) {
  558. panic(taxerr.NewUserV3(fmt.Sprintf("土地增值税校验与系统不一致,系统为:年:%s,本期:%s,税局为:年:%s,本期:%s", common.FloatToStr(kjlrb[7].YearTotal), common.FloatToStr(kjlrb[7].PeriodTotal), v1, v2), "请核实后重试"))
  559. }
  560. v1 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"城镇土地使用税、房产税、车船税、印花税")]/..//input)[1]`).MustText(), ",", "")
  561. v2 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"城镇土地使用税、房产税、车船税、印花税")]/..//input)[2]`).MustText(), ",", "")
  562. if kjlrb[8].YearTotal != common.StrToFloat(v1) || kjlrb[8].PeriodTotal != common.StrToFloat(v2) {
  563. panic(taxerr.NewUserV3(fmt.Sprintf("城镇土地使用税、房产税、车船税、印花税校验与系统不一致,系统为:年:%s,本期:%s,税局为:年:%s,本期:%s", common.FloatToStr(kjlrb[8].YearTotal), common.FloatToStr(kjlrb[8].PeriodTotal), v1, v2), "请核实后重试"))
  564. }
  565. v1 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"教育费附加、矿产资源补偿费、排污费")]/..//input)[1]`).MustText(), ",", "")
  566. v2 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"教育费附加、矿产资源补偿费、排污费")]/..//input)[2]`).MustText(), ",", "")
  567. if kjlrb[9].YearTotal != common.StrToFloat(v1) || kjlrb[9].PeriodTotal != common.StrToFloat(v2) {
  568. panic(taxerr.NewUserV3(fmt.Sprintf("城镇土地使用税、房产税、车船税、印花税校验与系统不一致,系统为:年:%s,本期:%s,税局为:年:%s,本期:%s", common.FloatToStr(kjlrb[9].YearTotal), common.FloatToStr(kjlrb[9].PeriodTotal), v1, v2), "请核实后重试"))
  569. }
  570. v1 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"销售费用")]/..//input)[1]`).MustText(), ",", "")
  571. v2 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"销售费用")]/..//input)[2]`).MustText(), ",", "")
  572. if kjlrb[10].YearTotal != common.StrToFloat(v1) || kjlrb[10].PeriodTotal != common.StrToFloat(v2) {
  573. panic(taxerr.NewUserV3(fmt.Sprintf("销售费用校验与系统不一致,系统为:年:%s,本期:%s,税局为:年:%s,本期:%s", common.FloatToStr(kjlrb[10].YearTotal), common.FloatToStr(kjlrb[10].PeriodTotal), v1, v2), "请核实后重试"))
  574. }
  575. v1 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"其中:商品维修费")]/..//input)[1]`).MustText(), ",", "")
  576. v2 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"其中:商品维修费")]/..//input)[2]`).MustText(), ",", "")
  577. if kjlrb[11].YearTotal != common.StrToFloat(v1) || kjlrb[11].PeriodTotal != common.StrToFloat(v2) {
  578. panic(taxerr.NewUserV3(fmt.Sprintf("其中:商品维修费校验与系统不一致,系统为:年:%s,本期:%s,税局为:年:%s,本期:%s", common.FloatToStr(kjlrb[11].YearTotal), common.FloatToStr(kjlrb[11].PeriodTotal), v1, v2), "请核实后重试"))
  579. }
  580. v1 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"广告费和业务宣传费")]/..//input)[1]`).MustText(), ",", "")
  581. v2 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"广告费和业务宣传费")]/..//input)[2]`).MustText(), ",", "")
  582. if kjlrb[12].YearTotal != common.StrToFloat(v1) || kjlrb[12].PeriodTotal != common.StrToFloat(v2) {
  583. panic(taxerr.NewUserV3(fmt.Sprintf("广告费和业务宣传费校验与系统不一致,系统为:年:%s,本期:%s,税局为:年:%s,本期:%s", common.FloatToStr(kjlrb[12].YearTotal), common.FloatToStr(kjlrb[12].PeriodTotal), v1, v2), "请核实后重试"))
  584. }
  585. v1 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"管理费用")]/..//input)[1]`).MustText(), ",", "")
  586. v2 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"管理费用")]/..//input)[2]`).MustText(), ",", "")
  587. if kjlrb[13].YearTotal != common.StrToFloat(v1) || kjlrb[13].PeriodTotal != common.StrToFloat(v2) {
  588. panic(taxerr.NewUserV3(fmt.Sprintf("管理费用校验与系统不一致,系统为:年:%s,本期:%s,税局为:年:%s,本期:%s", common.FloatToStr(kjlrb[13].YearTotal), common.FloatToStr(kjlrb[13].PeriodTotal), v1, v2), "请核实后重试"))
  589. }
  590. v1 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"其中:开办费")]/..//input)[1]`).MustText(), ",", "")
  591. v2 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"其中:开办费")]/..//input)[2]`).MustText(), ",", "")
  592. if kjlrb[14].YearTotal != common.StrToFloat(v1) || kjlrb[14].PeriodTotal != common.StrToFloat(v2) {
  593. panic(taxerr.NewUserV3(fmt.Sprintf("其中:开办费校验与系统不一致,系统为:年:%s,本期:%s,税局为:年:%s,本期:%s", common.FloatToStr(kjlrb[14].YearTotal), common.FloatToStr(kjlrb[14].PeriodTotal), v1, v2), "请核实后重试"))
  594. }
  595. v1 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"业务招待费")]/..//input)[1]`).MustText(), ",", "")
  596. v2 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"业务招待费")]/..//input)[2]`).MustText(), ",", "")
  597. if kjlrb[15].YearTotal != common.StrToFloat(v1) || kjlrb[15].PeriodTotal != common.StrToFloat(v2) {
  598. panic(taxerr.NewUserV3(fmt.Sprintf("业务招待费校验与系统不一致,系统为:年:%s,本期:%s,税局为:年:%s,本期:%s", common.FloatToStr(kjlrb[15].YearTotal), common.FloatToStr(kjlrb[15].PeriodTotal), v1, v2), "请核实后重试"))
  599. }
  600. v1 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"研究费用")]/..//input)[1]`).MustText(), ",", "")
  601. v2 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"研究费用")]/..//input)[2]`).MustText(), ",", "")
  602. if kjlrb[16].YearTotal != common.StrToFloat(v1) || kjlrb[16].PeriodTotal != common.StrToFloat(v2) {
  603. panic(taxerr.NewUserV3(fmt.Sprintf("研究费用校验与系统不一致,系统为:年:%s,本期:%s,税局为:年:%s,本期:%s", common.FloatToStr(kjlrb[16].YearTotal), common.FloatToStr(kjlrb[16].PeriodTotal), v1, v2), "请核实后重试"))
  604. }
  605. v1 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"财务费用")]/..//input)[1]`).MustText(), ",", "")
  606. v2 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"财务费用")]/..//input)[2]`).MustText(), ",", "")
  607. if kjlrb[17].YearTotal != common.StrToFloat(v1) || kjlrb[17].PeriodTotal != common.StrToFloat(v2) {
  608. panic(taxerr.NewUserV3(fmt.Sprintf("财务费用校验与系统不一致,系统为:年:%s,本期:%s,税局为:年:%s,本期:%s", common.FloatToStr(kjlrb[17].YearTotal), common.FloatToStr(kjlrb[17].PeriodTotal), v1, v2), "请核实后重试"))
  609. }
  610. v1 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"其中:利息费用(收入以-号填列)")]/..//input)[1]`).MustText(), ",", "")
  611. v2 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"其中:利息费用(收入以-号填列)")]/..//input)[2]`).MustText(), ",", "")
  612. if kjlrb[18].YearTotal != common.StrToFloat(v1) || kjlrb[18].PeriodTotal != common.StrToFloat(v2) {
  613. panic(taxerr.NewUserV3(fmt.Sprintf("其中:利息费用(收入以-号填列)校验与系统不一致,系统为:年:%s,本期:%s,税局为:年:%s,本期:%s", common.FloatToStr(kjlrb[18].YearTotal), common.FloatToStr(kjlrb[18].PeriodTotal), v1, v2), "请核实后重试"))
  614. }
  615. v1 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"加:投资收益(损失以-号填列)")]/..//input)[1]`).MustText(), ",", "")
  616. v2 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"加:投资收益(损失以-号填列)")]/..//input)[2]`).MustText(), ",", "")
  617. if kjlrb[19].YearTotal != common.StrToFloat(v1) || kjlrb[19].PeriodTotal != common.StrToFloat(v2) {
  618. panic(taxerr.NewUserV3(fmt.Sprintf("加:投资收益(损失以-号填列)校验与系统不一致,系统为:年:%s,本期:%s,税局为:年:%s,本期:%s", common.FloatToStr(kjlrb[19].YearTotal), common.FloatToStr(kjlrb[19].PeriodTotal), v1, v2), "请核实后重试"))
  619. }
  620. v1 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"二、营业利润(亏损以-号填列)")]/..//input)[1]`).MustText(), ",", "")
  621. v2 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"二、营业利润(亏损以-号填列)")]/..//input)[2]`).MustText(), ",", "")
  622. if kjlrb[20].YearTotal != common.StrToFloat(v1) || kjlrb[20].PeriodTotal != common.StrToFloat(v2) {
  623. panic(taxerr.NewUserV3(fmt.Sprintf(" 二、营业利润(亏损以-号填列)校验与系统不一致,系统为:年:%s,本期:%s,税局为:年:%s,本期:%s", common.FloatToStr(kjlrb[20].YearTotal), common.FloatToStr(kjlrb[20].PeriodTotal), v1, v2), "请核实后重试"))
  624. }
  625. v1 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"加:营业外收入")]/..//input)[1]`).MustText(), ",", "")
  626. v2 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"加:营业外收入")]/..//input)[2]`).MustText(), ",", "")
  627. if kjlrb[21].YearTotal != common.StrToFloat(v1) || kjlrb[21].PeriodTotal != common.StrToFloat(v2) {
  628. panic(taxerr.NewUserV3(fmt.Sprintf("加:营业外收入校验与系统不一致,系统为:年:%s,本期:%s,税局为:年:%s,本期:%s", common.FloatToStr(kjlrb[21].YearTotal), common.FloatToStr(kjlrb[21].PeriodTotal), v1, v2), "请核实后重试"))
  629. }
  630. v1 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"其中:政府补助")]/..//input)[1]`).MustText(), ",", "")
  631. v2 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"其中:政府补助")]/..//input)[2]`).MustText(), ",", "")
  632. if kjlrb[22].YearTotal != common.StrToFloat(v1) || kjlrb[22].PeriodTotal != common.StrToFloat(v2) {
  633. panic(taxerr.NewUserV3(fmt.Sprintf("其中:政府补助校验与系统不一致,系统为:年:%s,本期:%s,税局为:年:%s,本期:%s", common.FloatToStr(kjlrb[22].YearTotal), common.FloatToStr(kjlrb[22].PeriodTotal), v1, v2), "请核实后重试"))
  634. }
  635. v1 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"减:营业外支出")]/..//input)[1]`).MustText(), ",", "")
  636. v2 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"减:营业外支出")]/..//input)[2]`).MustText(), ",", "")
  637. if kjlrb[23].YearTotal != common.StrToFloat(v1) || kjlrb[23].PeriodTotal != common.StrToFloat(v2) {
  638. panic(taxerr.NewUserV3(fmt.Sprintf("减:营业外支出校验与系统不一致,系统为:年:%s,本期:%s,税局为:年:%s,本期:%s", common.FloatToStr(kjlrb[23].YearTotal), common.FloatToStr(kjlrb[23].PeriodTotal), v1, v2), "请核实后重试"))
  639. }
  640. v1 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"其中:坏账损失")]/..//input)[1]`).MustText(), ",", "")
  641. v2 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"其中:坏账损失")]/..//input)[2]`).MustText(), ",", "")
  642. if kjlrb[24].YearTotal != common.StrToFloat(v1) || kjlrb[24].PeriodTotal != common.StrToFloat(v2) {
  643. panic(taxerr.NewUserV3(fmt.Sprintf("其中:坏账损失校验与系统不一致,系统为:年:%s,本期:%s,税局为:年:%s,本期:%s", common.FloatToStr(kjlrb[24].YearTotal), common.FloatToStr(kjlrb[24].PeriodTotal), v1, v2), "请核实后重试"))
  644. }
  645. v1 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"无法收回的长期债券投资损失")]/..//input)[1]`).MustText(), ",", "")
  646. v2 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"无法收回的长期债券投资损失")]/..//input)[2]`).MustText(), ",", "")
  647. if kjlrb[25].YearTotal != common.StrToFloat(v1) || kjlrb[25].PeriodTotal != common.StrToFloat(v2) {
  648. panic(taxerr.NewUserV3(fmt.Sprintf("无法收回的长期债券投资损失校验与系统不一致,系统为:年:%s,本期:%s,税局为:年:%s,本期:%s", common.FloatToStr(kjlrb[25].YearTotal), common.FloatToStr(kjlrb[25].PeriodTotal), v1, v2), "请核实后重试"))
  649. }
  650. v1 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"无法收回的长期股权投资损失")]/..//input)[1]`).MustText(), ",", "")
  651. v2 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"无法收回的长期股权投资损失")]/..//input)[2]`).MustText(), ",", "")
  652. if kjlrb[26].YearTotal != common.StrToFloat(v1) || kjlrb[26].PeriodTotal != common.StrToFloat(v2) {
  653. panic(taxerr.NewUserV3(fmt.Sprintf("无法收回的长期股权投资损失校验与系统不一致,系统为:年:%s,本期:%s,税局为:年:%s,本期:%s", common.FloatToStr(kjlrb[26].YearTotal), common.FloatToStr(kjlrb[26].PeriodTotal), v1, v2), "请核实后重试"))
  654. }
  655. v1 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"自然灾害等不可抗力因素造成的损失")]/..//input)[1]`).MustText(), ",", "")
  656. v2 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"自然灾害等不可抗力因素造成的损失")]/..//input)[2]`).MustText(), ",", "")
  657. if kjlrb[27].YearTotal != common.StrToFloat(v1) || kjlrb[27].PeriodTotal != common.StrToFloat(v2) {
  658. panic(taxerr.NewUserV3(fmt.Sprintf("自然灾害等不可抗力因素造成的损失校验与系统不一致,系统为:年:%s,本期:%s,税局为:年:%s,本期:%s", common.FloatToStr(kjlrb[27].YearTotal), common.FloatToStr(kjlrb[27].PeriodTotal), v1, v2), "请核实后重试"))
  659. }
  660. v1 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"税收滞纳金")]/..//input)[1]`).MustText(), ",", "")
  661. v2 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"税收滞纳金")]/..//input)[2]`).MustText(), ",", "")
  662. if kjlrb[28].YearTotal != common.StrToFloat(v1) || kjlrb[28].PeriodTotal != common.StrToFloat(v2) {
  663. panic(taxerr.NewUserV3(fmt.Sprintf("税收滞纳金校验与系统不一致,系统为:年:%s,本期:%s,税局为:年:%s,本期:%s", common.FloatToStr(kjlrb[28].YearTotal), common.FloatToStr(kjlrb[28].PeriodTotal), v1, v2), "请核实后重试"))
  664. }
  665. v1 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"三、利润总额(亏损总额以-号填列)")]/..//input)[1]`).MustText(), ",", "")
  666. v2 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"三、利润总额(亏损总额以-号填列)")]/..//input)[2]`).MustText(), ",", "")
  667. if kjlrb[29].YearTotal != common.StrToFloat(v1) || kjlrb[29].PeriodTotal != common.StrToFloat(v2) {
  668. panic(taxerr.NewUserV3(fmt.Sprintf("三、利润总额(亏损总额以-号填列)校验与系统不一致,系统为:年:%s,本期:%s,税局为:年:%s,本期:%s", common.FloatToStr(kjlrb[29].YearTotal), common.FloatToStr(kjlrb[29].PeriodTotal), v1, v2), "请核实后重试"))
  669. }
  670. v1 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"减:所得税费用")]/..//input)[1]`).MustText(), ",", "")
  671. v2 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"减:所得税费用")]/..//input)[2]`).MustText(), ",", "")
  672. if kjlrb[30].YearTotal != common.StrToFloat(v1) || kjlrb[30].PeriodTotal != common.StrToFloat(v2) {
  673. panic(taxerr.NewUserV3(fmt.Sprintf("减:所得税费用校验与系统不一致,系统为:年:%s,本期:%s,税局为:年:%s,本期:%s", common.FloatToStr(kjlrb[30].YearTotal), common.FloatToStr(kjlrb[30].PeriodTotal), v1, v2), "请核实后重试"))
  674. }
  675. v1 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"四、净利润(净亏损以-号填列)")]/..//input)[1]`).MustText(), ",", "")
  676. v2 = strings.ReplaceAll(MustElementX(newp1, `(//td[contains(text(),"四、净利润(净亏损以-号填列)")]/..//input)[2]`).MustText(), ",", "")
  677. if kjlrb[31].YearTotal != common.StrToFloat(v1) || kjlrb[31].PeriodTotal != common.StrToFloat(v2) {
  678. panic(taxerr.NewUserV3(fmt.Sprintf(" 四、净利润(净亏损以-号填列)校验与系统不一致,系统为:年:%s,本期:%s,税局为:年:%s,本期:%s", common.FloatToStr(kjlrb[31].YearTotal), common.FloatToStr(kjlrb[31].PeriodTotal), v1, v2), "请核实后重试"))
  679. }
  680. //点击现金流量表
  681. if info.XjllbSb {
  682. if len(kjxjllb) != 1 {
  683. panic(taxerr.NewUserV3("现金流量表未取数", "请取数后重试"))
  684. }
  685. utils.Sleep(3)
  686. if newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustHas(`#divSheetlist > li:nth-child(3) > a`) {
  687. newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#divSheetlist > li:nth-child(3) > a`).MustClick() //点击现金流量表
  688. //var kjxjllb []models.KjXjllb销售产成品、商品、提供劳务收到的现金
  689. //销售产成品、商品、提供劳务收到的现金
  690. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"销售产成品、商品、提供劳务收到的现金")]/..//input)[2]`, common.FloatToStr(kjxjllb[0].PeriodTotal))
  691. utils.Sleep(0.5)
  692. //收到其他与经营活动有关的现金
  693. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"收到其他与经营活动有关的现金")]/..//input)[2]`, common.FloatToStr(kjxjllb[1].PeriodTotal))
  694. utils.Sleep(0.5)
  695. //购买原材料、商品、接受劳务支付的现金
  696. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"购买原材料、商品、接受劳务支付的现金")]/..//input)[2]`, common.FloatToStr(kjxjllb[2].PeriodTotal))
  697. utils.Sleep(0.5)
  698. //支付的职工薪酬
  699. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"支付的职工薪酬")]/..//input)[2]`, common.FloatToStr(kjxjllb[3].PeriodTotal))
  700. utils.Sleep(0.5)
  701. //支付的税费
  702. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"支付的税费")]/..//input)[2]`, common.FloatToStr(kjxjllb[4].PeriodTotal))
  703. utils.Sleep(0.5)
  704. //支付其他与经营活动有关的现金
  705. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"支付其他与经营活动有关的现金")]/..//input)[2]`, common.FloatToStr(kjxjllb[5].PeriodTotal))
  706. utils.Sleep(0.5)
  707. //收回短期投资、长期债券投资和长期股权投资收到的现金
  708. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"收回短期投资、长期债券投资和长期股权投资收到的现金")]/..//input)[2]`, common.FloatToStr(kjxjllb[7].PeriodTotal))
  709. utils.Sleep(0.5)
  710. //取得投资收益收到的现金
  711. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"取得投资收益收到的现金")]/..//input)[2]`, common.FloatToStr(kjxjllb[8].PeriodTotal))
  712. utils.Sleep(0.5)
  713. //处置固定资产、无形资产和其他非流动资产收回的现金净额
  714. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"处置固定资产、无形资产和其他非流动资产收回的现金净额")]/..//input)[2]`, common.FloatToStr(kjxjllb[9].PeriodTotal))
  715. utils.Sleep(0.5)
  716. //短期投资、长期债券投资和长期股权投资支付的现金
  717. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"短期投资、长期债券投资和长期股权投资支付的现金")]/..//input)[2]`, common.FloatToStr(kjxjllb[10].PeriodTotal))
  718. utils.Sleep(0.5)
  719. //购建固定资产、无形资产和其他非流动资产支付的现金
  720. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"购建固定资产、无形资产和其他非流动资产支付的现金")]/..//input)[2]`, common.FloatToStr(kjxjllb[11].PeriodTotal))
  721. utils.Sleep(0.5)
  722. //取得借款收到的现金
  723. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"取得借款收到的现金")]/..//input)[2]`, common.FloatToStr(kjxjllb[13].PeriodTotal))
  724. utils.Sleep(0.5)
  725. //吸收投资者投资收到的现金
  726. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"吸收投资者投资收到的现金")]/..//input)[2]`, common.FloatToStr(kjxjllb[14].PeriodTotal))
  727. utils.Sleep(0.5)
  728. //偿还借款本金支付的现金
  729. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"偿还借款本金支付的现金")]/..//input)[2]`, common.FloatToStr(kjxjllb[15].PeriodTotal))
  730. utils.Sleep(0.5)
  731. //偿还借款利息支付的现金
  732. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"偿还借款利息支付的现金")]/..//input)[2]`, common.FloatToStr(kjxjllb[16].PeriodTotal))
  733. utils.Sleep(0.5)
  734. //分配利润支付的现金
  735. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"分配利润支付的现金")]/..//input)[2]`, common.FloatToStr(kjxjllb[17].PeriodTotal))
  736. utils.Sleep(0.5)
  737. //加:期初现金余额
  738. common.InputX(newp1.Timeout(common.ClickTimeOut).MustElement("#frmFrame").MustFrame().MustElement(`#frmMain`).MustFrame().MustElement(`#frmSheet`).MustFrame(), `(//td[contains(text(),"加:期初现金余额")]/..//input)[2]`, common.FloatToStr(kjxjllb[20].PeriodTotal))
  739. } else {
  740. panic("未生成现金流量表!")
  741. }
  742. }
  743. //点击申报
  744. utils.Sleep(3)
  745. rr = newp1.MustWaitRequestIdle()
  746. newp1.Timeout(common.ClickTimeOut).MustSearch(`提交申报`).MustClick()
  747. rr()
  748. utils.Sleep(3)
  749. if newp1.MustHasX(`//div[@class="t-dialog__body t-dialog__body__icon"]`) {
  750. text := newp1.MustElementX(`//div[@class="t-dialog__body t-dialog__body__icon"]`).MustText()
  751. if strings.Contains(text, "不符") {
  752. panic(taxerr.NewUserV3(text, "请核实后重试"))
  753. }
  754. }
  755. if newp1.MustHasX(`//div[@class="drawer-body"]//p`) && newp1.MustElementX(`//div[@class="drawer-body"]//p`).MustVisible() {
  756. text := newp1.MustElementX(`//div[@class="drawer-body"]//p`).MustText()
  757. panic(taxerr.NewUserV3(text, "请核实后重试"))
  758. }
  759. newp1.Timeout(common.ClickTimeOut).MustElementX(`//input[@placeholder='真']`).MustClick()
  760. newp1.Timeout(common.ClickTimeOut).MustElementX(`//input[@placeholder='真']`).MustInput("真")
  761. newp1.Timeout(common.ClickTimeOut).MustElementX(`//input[@placeholder='实']`).MustClick()
  762. newp1.Timeout(common.ClickTimeOut).MustElementX(`//input[@placeholder='实']`).MustInput("实")
  763. newp1.Timeout(common.ClickTimeOut).MustElementX(`//input[@placeholder='责']`).MustClick()
  764. newp1.Timeout(common.ClickTimeOut).MustElementX(`//input[@placeholder='责']`).MustInput("责")
  765. newp1.Timeout(common.ClickTimeOut).MustElementX(`//input[@placeholder='任']`).MustClick()
  766. newp1.Timeout(common.ClickTimeOut).MustElementX(`//input[@placeholder='任']`).MustInput("任")
  767. utils.Sleep(3)
  768. rr = newp1.MustWaitRequestIdle()
  769. newp1.Timeout(common.ClickTimeOut).MustElementX(`//span[contains(text(),"确定")]`).MustClick()
  770. rr()
  771. //utils.Sleep(40)
  772. text := newp1.Timeout(10 * common.ClickTimeOut).MustElementX(`//div[@class="gt-result-title"]`).MustText()
  773. utils.Sleep(5)
  774. path := SaveErrImg(newp1, info)
  775. task.Result.BusinessImg = path
  776. //task.Result.BusinessStatus = variable.TaxSuccess
  777. task.Result.BusinessLog = text
  778. })
  779. if err != nil {
  780. task.Result.BusinessStatus = variable.TaxFail
  781. task.Result.BusinessLog = common.HandleError(ctx, err).Error()
  782. return
  783. }
  784. return
  785. }