** マイページからの請求書、納品書の印刷の作成日の変更 **
請求書=>注文日
納品書=>発送済みにした日
@@ -49,11 +49,26 @@ | ||
49 | 49 | $arrRet = $this->setTplData(intval($_POST['mode'])); |
50 | 50 | $arrRet['order_id'] = intval($_POST['order_id']); |
51 | 51 | |
52 | - // 今日の日付をセット | |
53 | - $arrRet['year'] = date("Y"); | |
54 | - $arrRet['month'] = date("m"); | |
55 | - $arrRet['day'] = date("d"); | |
52 | + $col = "create_date, commit_date"; | |
53 | + $from = "dtb_order"; | |
54 | + $where = "del_flg = 0 AND order_id = ?"; | |
55 | + $id = intval($_POST['order_id']); | |
56 | + $arr = $objQuery->select($col, $from, $where, array($id)); | |
56 | 57 | |
58 | + $arrDate = $arr[0]; | |
59 | + | |
60 | + // 帳票種別が納品書の場合は発送日 | |
61 | + if( intval($_POST['mode'] ) == 0 ) { | |
62 | + $setDateData = $arrDate['commit_date']; | |
63 | + } | |
64 | + else { | |
65 | + $setDateData = $arrDate['create_date']; | |
66 | + } | |
67 | + | |
68 | + $arrRet['year'] = idate("Y", strtotime($setDateData)); | |
69 | + $arrRet['month'] = idate("m", strtotime($setDateData)); | |
70 | + $arrRet['day'] = idate("d", strtotime($setDateData)); | |
71 | + | |
57 | 72 | $objFpdf = new SC_Fpdf($arrRet['download'], $arrRet['title']); |
58 | 73 | $arrPdfData = $arrRet; |
59 | 74 | $objFpdf->setData($arrPdfData); |