Skip to content

Instantly share code, notes, and snippets.

View worstn8mare's full-sized avatar

Ariel Pepito worstn8mare

View GitHub Profile
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
from gl_accounts as t1
left join (
select
a.id as title_id,
a.f1,a.f2,a.f3,a.f4,
b.amount as amount
from gl_accounts as a
LEFT JOIN posting_gls as b on b.gl_account_id = a.id
<?php
$param = [];
if(Input::get('doc_type') == 1 || Input::get('doc_type') == 2 || Input::get('doc_type') == 3 || Input::get('doc_type') == 4){
$type = Input::get('doc_type');
$q = "and doc_type_id = ?";
$param[] = $type;
}
else{
$type = '';
$q = "";
SELECT * from
(
select a.doc_no from bill_attachments as a JOIN bill_headers as b on a.ref_header_id = b.id where b.status in ("Approved","Printed")
UNION ALL
select a.doc_no from receipt_app_attachments as a JOIN bill_headers as b on a.ref_header_id = b.id where b.status in ("Approved","Printed")
) as tbl
LEFT JOIN
(
SELECT j.doc_type_id, j.doc_type, partners.name,CAST(j.doc_no as UNSIGNED) as doc_no, j.date, j.partner_id, j.amount, j.gov, j.vat, j.nv, j.zr, j.nt, j.ewt
FROM (
@foreach (['danger', 'warning', 'success', 'info'] as $message)
@if(Session::has('alert-' . $message))
<p class="alert alert-{{$message}}" style="padding:5px;height:24px;position: fixed;z-index:100;left:0px;right:0px;margin: 0px;top:112px;">
{{ Session::get('alert-' . $message) }}
</p>
<br>
@endif
@endforeach
select
x.id, x.title, x.f1, x.f2, x.f3, x.f4, x.account_type,
CASE
WHEN (x.f1>0 and x.f2 = 0 and x.f3 = 0 and f4 = 0) THEN
(
select
SUM(b.amount) as amount
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
select
t1.id, t1.title, IF(t2.amount > 0,SUM(t2.amount),0) as amount
from gl_accounts as t1
left join (
select
a.id as title_id,
a.f1,a.f2,a.f3,a.f4,
b.amount as amount
from gl_accounts as a
LEFT JOIN posting_gls as b on b.gl_account_id = a.id
if($divcounter <= 29){
$counter = 29 - $divcounter;
for ($i=0; $i < $counter; $i++) {
$printcommanddetail1 .="\n";
}
$printCommand .= $printcommandhead1."1".$printcommandhead2.$printcommanddetail1.$printcommandfooter1."\n";
}
else{
if($divcounter > 29 && $divcounter <= 47){
$addSpace = '';
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Blade;
use DB;
class AppServiceProvider extends ServiceProvider
{
@global('accounting_memo_credit_memo')
<footer class="footer">
<nav class="navbar navbar-inverse navbar-fixed-bottom" style="background: #3A3A3A;">
@if(isset($detail,$header))
@if($header->status == 'New')
@has('update')
<button class="update btn btn-lg btn-sm space forbuttons" form="creditmemo" type="submit" id="save-button" name="update" value="Update"><img src="\images\update1.png">&nbsp;<font color="white">Update</font>
</button>
@endhas
@has('finalize')
function getTotal(){
var gtotal = 0;
var tr = 0, h = [], a = 0;
$('.table-units tbody.display-units').find('.ratetotal').each(function(){
var gholder = $(this).val();
gtotal += parseFloat(gholder);
tr++;
var elem = $(this).closest('body').find('.partner-tr'+tr);
var gtotal_and_escale = 0;