setiadi

GetMonitoringOrderPembelianDetailGoodsReceiptList

May 19th, 2018
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. <?php
  2.  
  3. namespace Sts\WebToko\BO;
  4.  
  5. use Sts\PleafCore\BusinessFunction;
  6. use Sts\WebToko\Model\PuReceiveGoods;
  7. use Sts\WebToko\Model\PuReceiveGoodsItem;
  8. use Sts\WebToko\Model\PuPoItem;
  9. use Sts\WebToko\Model\PuPoBalanceInvoice;
  10. use Sts\WebToko\Model\Product;
  11. use DB;
  12. /**
  13. * @in
  14. * @In(["poId","numeric","true","ID PO"])
  15. */
  16. class GetMonitoringOrderPembelianDetailGoodsReceiptList implements BusinessFunction {
  17.  
  18. public function getDescription(){
  19. return "Get Monitoring Order Pembelian Detail Goods Receipt List";
  20. }
  21.  
  22. public function execute($dto){
  23.  
  24. $poId = $dto["poId"];
  25.  
  26. $result = DB::table(with(new PuReceiveGoods)->getTable()." as A")
  27. ->join(with(new PuReceiveGoodsItem)->getTable()." as B", "B.receive_goods_id", "A.receive_goods_id")
  28. ->join(with(new Product)->getTable()." as C", "C.product_id", "B.product_id")
  29. ->join(with(new PuPoItem)->getTable()." as D", "D.po_item_id", "B.ref_item_id")
  30. ->select([
  31. "A.doc_no", "A.doc_date", "A.remark", "A.status_doc", "A.status_doc",
  32. "C.product_name",
  33. "B.qty_receive", "D.unit_price",
  34. ])
  35. ->where("A.ref_id", $poId)
  36. ->get();
  37.  
  38. return $result;
  39. }
  40. }
Add Comment
Please, Sign In to add comment