init
This commit is contained in:
29
modules/EcmInvoiceOuts/MMCost.php
Normal file
29
modules/EcmInvoiceOuts/MMCost.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
//Skrypt poprawia korekty kwartalne dla MSHP
|
||||
|
||||
$db = $GLOBALS['db'];
|
||||
|
||||
$query;
|
||||
|
||||
//---------------------------------------
|
||||
$query = "
|
||||
select i.document_no, i.id, i.total_netto from ecminvoiceouts as i
|
||||
inner join accounts as a
|
||||
on a.id = i.parent_id
|
||||
where
|
||||
i.register_date like '2014-10%'
|
||||
and a.parent_id = '1249'
|
||||
and i.purchase_price = 0
|
||||
and i.paid_val IS NULL
|
||||
order by i.date_entered desc;
|
||||
";
|
||||
|
||||
$inv = $db->query($query);
|
||||
$sum = 0;
|
||||
|
||||
while ($i = $db->fetchByAssoc($inv)) {
|
||||
$sum+=$i['total_netto'];
|
||||
}
|
||||
|
||||
echo $sum;
|
||||
?>
|
||||
Reference in New Issue
Block a user