flexbiz-server
Version:
Flexible Server
7 lines (6 loc) • 2.29 kB
JavaScript
'use strict';const dtbanletheosp=require("../../libs/dtbanletheospnpp"),controller=require("../../controllers/controllerRPT");
module.exports=function($router$$){new controller($router$$,"dtbanletheospnpp",async function($condition_req$$,$callback$$){$condition_req$$=$condition_req$$.query;try{let $report$$=await dtbanletheosp($condition_req$$);await $report$$.asyncJoinModel2($condition_req$$.id_app,"dmvt",{where:"ma_vt",fields:["ten_vt","ma_nvt","ma_nvt2","ma_nvt3","ma_nvt4"]});await $report$$.filter($r$$=>$r$$.ma_nvt).asyncJoinModel2($condition_req$$.id_app,"dmnvt",{where:{ma_nvt:"_id"},fields:["ten_nvt"]});await $report$$.filter($r$$=>
$r$$.ma_nvt2).asyncJoinModel2($condition_req$$.id_app,"dmnvt",{where:{ma_nvt2:"_id"},fields:[{ten_nvt2:"ten_nvt"}]});await $report$$.filter($r$$=>$r$$.ma_nvt3).asyncJoinModel2($condition_req$$.id_app,"dmnvt",{where:{ma_nvt3:"_id"},fields:[{ten_nvt3:"ten_nvt"}]});await $report$$.filter($r$$=>$r$$.ma_nvt4).asyncJoinModel2($condition_req$$.id_app,"dmnvt",{where:{ma_nvt4:"_id"},fields:[{ten_nvt4:"ten_nvt"}]});const $tong_cong$$={ten_vt:"T\u1ed5ng c\u1ed9ng",sl_xuat:$report$$.csum("sl_xuat"),sl_nhap:$report$$.csum("sl_nhap"),
sl_xuat_qd:$report$$.csum("sl_xuat_qd"),sl_nhap_qd:$report$$.csum("sl_nhap_qd"),tien_hang_nt:$report$$.csum("tien_hang_nt"),tien_hang_ct_nt:$report$$.csum("tien_hang_ct_nt"),tien_hang:$report$$.csum("tien_hang"),tien_hang_ct:$report$$.csum("tien_hang_ct"),tien_cp:$report$$.csum("tien_cp"),tien_cp_nt:$report$$.csum("tien_cp_nt"),tien_ck_nt:$report$$.csum("tien_ck_nt"),tien_ck:$report$$.csum("tien_ck"),tien_thue:$report$$.csum("tien_thue"),tien_thue_nt:$report$$.csum("tien_thue_nt"),tien:$report$$.csum("tien"),
tien_nt:$report$$.csum("tien_nt"),tt:$report$$.csum("tt"),tt_nt:$report$$.csum("tt_nt"),tien_xuat_tmp:$report$$.csum("tien_xuat_tmp"),tien_xuat:$report$$.csum("tien_xuat"),tien_nhap:$report$$.csum("tien_nhap"),loi_nhuan_tmp:$report$$.csum("loi_nhuan_tmp"),tien_hoa_hong:$report$$.csum("tien_hoa_hong"),tien_hoa_hong_gt:$report$$.csum("tien_hoa_hong_gt"),tien_hoa_hong_ctv:$report$$.csum("tien_hoa_hong_ctv"),tien_hoa_hong_ql:$report$$.csum("tien_hoa_hong_ql"),t_hoa_hong:$report$$.csum("t_hoa_hong"),bold:!0};
$report$$.push($tong_cong$$);$callback$$(null,$report$$)}catch($e$$){$callback$$($e$$)}})};