Skip to content

Instantly share code, notes, and snippets.

View worstn8mare's full-sized avatar

Ariel Pepito worstn8mare

View GitHub Profile
Tuesday, September 18, 2018 FacebookTwitterRSS
The Manila Times Online
HOME NEWS OPINION BUSINESS BOARDROOM WATCH REGIONS WORLD SPORTS LIFESTYLE ENTERTAINMENT
SEARCH The Sunday Times Special Reports
Special Features Fast Times The Lookbook
YOU ARE AT:Home»Opinion»Op-Ed Columns»Opinion on Page One»Trillanes chapter has made the Yellows’ blood run cold
Trillanes chapter has made the Yellows’ blood run cold 0
BY RIGOBERTO D. TIGLAO ON SEPTEMBER 17, 2018 OPINION ON PAGE ONE
$posted = DB::select("
SELECT
a.id,
(
SELECT COUNT(*) FROM
pc_attachment_files as c
WHERE c.detail_id = b.id
) as attachment_file_count
FROM
pc_headers as a
[PHP]
;;;;;;;;;;;;;;;;;;;
; About php.ini ;
;;;;;;;;;;;;;;;;;;;
; PHP's initialization file, generally called php.ini, is responsible for
; configuring many of the aspects of PHP's behavior.
; PHP attempts to find and load this configuration from a number of locations.
; The following is a summary of its search order:
select
CONCAT(SUM(b.amount),'|',c.cb) as detail
from gl_accounts as a
LEFT JOIN posting_gls as b on b.gl_account_id = a.id
LEFT JOIN postings as c on c.id = b.posting_id
LEFT JOIN cv_post_details as d on d.id = IF(c.doc_type = 'CV',c.attachment_no,1)
where d.type = 'Posting'
and c.status = 'Posted'
-- -----------------------------------
and (
SELECT
a.id as rr_id, b.id as attachment_id,a.status, a.rr_date, a.posted, c.status as status_posted, c.post_date
from receive_headers as a
INNER JOIN receive_post_details as b on a.id = b.rr_id
LEFT JOIN postings as c on c.attachment_no = b.id
where c.doc_type = "RR"
and DATE(a.rr_date) >= "2017-01-01"
and a.posted = "Y" and c.status !="Posted"
SELECT * from posting_gls WHERE posting_id in (
SELECT id from postings where DATE(post_date) < "2017-01-01"
)
INSERT INTO posting_gls (posting_id,entry_type,gl_account_id,amount)
(
select
posting_id,
entry_type, gl_account_id, amount
from gl_entries where doc_no = 20283 and doc_type = "RR" and status != "Void"
)
INSERT INTO postings (id,cb,partner_id,post_date,posting_type,status,doc_type,doc_no,attachment_no)
(
SELECT
a.posting_id as id,
a.cb as cb,
a.partner_id as partner_id,
c.date as date,
"Purchases" as posting_type,
"Posted" as status,
select
a.id, a.posting_id, a.entry_type, a.gl_account_id,
b.doc_type, b.ref_doc_id,sum(amount) as amount
from posting_gls as a
INNER JOIN (
SELECT
a1.cv_header_id as ref_doc_id, c1.doc_type as doc_type, c1.id as posting_id
from cv_post_details as a1
LEFT JOIN cv_headers b1 on a1.cv_header_id = b1.id
select
t1.id, t1.title, IF(t2.amount is not null,SUM(t2.amount),0) as amount, t1.f1,t1.f2,t1.f3,t1.f4,
CASE
WHEN (t1.f1>0 and t1.f2 = 0 and t1.f3 = 0 and t1.f4 = 0) THEN
(SELECT count(*) from gl_accounts as g where g.f1 = t1.f1 )
WHEN (t1.f1>0 and t1.f2 > 0 and t1.f3 = 0 and t1.f4 = 0) THEN
(SELECT count(*) from gl_accounts as g where g.f1 = t1.f1 and g.f2 = t1.f2 )
WHEN (t1.f1>0 and t1.f2 > 0 and t1.f3 > 0 and t1.f4 = 0) THEN
(SELECT count(*) from gl_accounts as g where g.f1 = t1.f1 and g.f2 = t1.f2 and g.f3 = t1.f3)
WHEN (t1.f1>0 and t1.f2 > 0 and t1.f3 > 0 and t1.f4 > 0) THEN