<?php
/**********************************************************************
Copyright (C) FrontAccounting, LLC.
- Released under the terms of the GNU General Public License, GPL,
- as published by the Free Software Foundation, either version 3
+ Released under the terms of the GNU General Public License, GPL,
+ as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
$page_security = 'SA_CUSTBULKREP';
print_customer_details_listing();
-function get_customer_details_for_report($area=0, $salesid=0)
+function get_customer_details_for_report($area=0, $salesid=0)
{
$sql = "SELECT ".TB_PREF."debtors_master.debtor_no,
".TB_PREF."debtors_master.name,
".TB_PREF."cust_branch.br_name,
".TB_PREF."cust_branch.br_address,
".TB_PREF."cust_branch.contact_name,
- ".TB_PREF."cust_branch.phone,
- ".TB_PREF."cust_branch.fax,
- ".TB_PREF."cust_branch.email,
".TB_PREF."cust_branch.area,
".TB_PREF."cust_branch.salesman,
".TB_PREF."areas.description,
".TB_PREF."salesman.salesman_name
- FROM ".TB_PREF."debtors_master
+ FROM ".TB_PREF."debtors_master
INNER JOIN ".TB_PREF."cust_branch
ON ".TB_PREF."debtors_master.debtor_no=".TB_PREF."cust_branch.debtor_no
INNER JOIN ".TB_PREF."sales_types
if ($area != 0)
{
if ($salesid != 0)
- $sql .= " WHERE ".TB_PREF."salesman.salesman_code=".db_escape($salesid)."
+ $sql .= " WHERE ".TB_PREF."salesman.salesman_code=".db_escape($salesid)."
AND ".TB_PREF."areas.area_code=".db_escape($area);
- else
+ else
$sql .= " WHERE ".TB_PREF."areas.area_code=".db_escape($area);
}
elseif ($salesid != 0)
return db_query($sql,"No transactions were returned");
}
-
+
function getTransactions($debtorno, $branchcode, $date)
{
$date = date2sql($date);
include_once($path_to_root . "/reporting/includes/excel_report.inc");
else
include_once($path_to_root . "/reporting/includes/pdf_report.inc");
-
+
$dec = 0;
if ($area == ALL_NUMERIC)
$lessstr = _('Less than ') . number_format2($less, $dec);
else
$lessstr = '';
-
- $more = (double)$more;
+
+ $more = (double)$more;
$less = (double)$less;
$cols = array(0, 150, 300, 400, 550);
$rep->NewPage();
$result = get_customer_details_for_report($area, $folk);
-
+
$carea = '';
$sman = '';
- while ($myrow=db_fetch($result))
+ while ($myrow=db_fetch($result))
{
$printcustomer = true;
if ($more != '' || $less != '')
$printcustomer = false;
if ($less != 0.0 && $turnover >= (double)$less)
$printcustomer = false;
- }
+ }
if ($printcustomer)
{
if ($carea != $myrow['description'])
{
$rep->fontSize += 2;
$rep->NewLine(2, 7);
- $rep->Font('bold');
+ $rep->Font('bold');
$rep->TextCol(0, 3, _('Customers in') . " " . $myrow['description']);
$carea = $myrow['description'];
$rep->fontSize -= 2;
$rep->Font();
$rep->NewLine();
- }
+ }
if ($sman != $myrow['salesman_name'])
{
$rep->fontSize += 2;
$rep->NewLine(1, 7);
- $rep->Font('bold');
+ $rep->Font('bold');
$rep->TextCol(0, 3, $myrow['salesman_name']);
$sman = $myrow['salesman_name'];
$rep->fontSize -= 2;
$count1 = count($adr);
for ($i = 0; $i < $count1; $i++)
$rep->TextCol(0, 1, $adr[$i], 0, ($i + 1) * $rep->lineHeight);
- $count1++;
+ $count1++;
$rep->TextCol(1, 2, _('Price List') . ": " . $myrow['sales_type']);
if ($more != 0.0 || $less != 0.0)
$rep->TextCol(1, 2, _('Turnover') . ": " . number_format2($turnover, $dec), 0, $rep->lineHeight);
$rep->TextCol(2, 3, $myrow['br_name']);
- $rep->TextCol(2, 3, $myrow['contact_name'], 0, $rep->lineHeight);
- $rep->TextCol(2, 3, _('Ph') . ": " . $myrow['phone'], 0, 2 * $rep->lineHeight);
- $rep->TextCol(2, 3, _('Fax') . ": " . $myrow['fax'], 0, 3 * $rep->lineHeight);
+
+ $contacts = get_branch_contacts($myrow['branch_code']);
+ if (isset($contacts[0]))
+ {
+ $rep->TextCol(2, 3, $contacts[0]['name'], 0, $rep->lineHeight);
+ $rep->TextCol(2, 3, _('Ph') . ": " . $contacts[0]['phone'], 0, 2 * $rep->lineHeight);
+ $rep->TextCol(2, 3, _('Fax') . ": " . $contacts[0]['fax'], 0, 3 * $rep->lineHeight);
+ }
$adr = Explode("\n", $myrow['br_address']);
$count2 = count($adr);
for ($i = 0; $i < $count2; $i++)
$rep->TextCol(3, 4, $adr[$i], 0, ($i + 1) * $rep->lineHeight);
- $rep->TextCol(3, 4, $myrow['email'], 0, ($count2 + 1) * $rep->lineHeight);
+ //$rep->TextCol(3, 4, $myrow['email'], 0, ($count2 + 1) * $rep->lineHeight);
$count2++;
$count1 = Max($count1, $count2);
$count1 = Max($count1, 4);
- $rep->NewLine($count1);
+ $rep->NewLine($count1);
$rep->Line($rep->row + 8);
$rep->NewLine(0, 3);
}
<?php
/**********************************************************************
Copyright (C) FrontAccounting, LLC.
- Released under the terms of the GNU General Public License, GPL,
- as published by the Free Software Foundation, either version 3
+ Released under the terms of the GNU General Public License, GPL,
+ as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
$page_security = 'SA_PRICEREP';
{
$sql = "SELECT ".TB_PREF."stock_master.stock_id, ".TB_PREF."stock_master.description AS name,
".TB_PREF."stock_master.material_cost+".TB_PREF."stock_master.labour_cost+".TB_PREF."stock_master.overhead_cost AS Standardcost,
- ".TB_PREF."stock_master.category_id,
+ ".TB_PREF."stock_master.category_id,".TB_PREF."stock_master.units,
".TB_PREF."stock_category.description
FROM ".TB_PREF."stock_master,
".TB_PREF."stock_category
else
$GP = _('Yes');
- $cols = array(0, 100, 385, 450, 515);
+ $cols = array(0, 100, 360, 385, 450, 515);
- $headers = array(_('Category/Items'), _('Description'), _('Price'), _('GP %'));
+ $headers = array(_('Category/Items'), _('Description'), _('UOM'), _('Price'), _('GP %'));
- $aligns = array('left', 'left', 'right', 'right');
+ $aligns = array('left', 'left', 'left', 'right', 'right');
$params = array( 0 => $comments,
1 => array('text' => _('Currency'), 'from' => $curr_sel, 'to' => ''),
$rep->NewLine();
$rep->TextCol(0, 1, $myrow['stock_id']);
$rep->TextCol(1, 2, $myrow['name']);
+ $rep->TextCol(2, 3, $myrow['units']);
$price = get_price($myrow['stock_id'], $currency, $salestype);
- $rep->AmountCol(2, 3, $price, $dec);
+ $rep->AmountCol(3, 4, $price, $dec);
if ($showGP)
{
$price2 = get_price($myrow['stock_id'], $home_curr, $salestype);
$disp = ($price2 - $myrow['Standardcost']) * 100 / $price2;
else
$disp = 0.0;
- $rep->TextCol(3, 4, number_format2($disp, user_percent_dec()) . " %");
+ $rep->TextCol(4, 5, number_format2($disp, user_percent_dec()) . " %");
}
if ($pictures)
{
- $image = company_path(). "/images/"
+ $image = company_path(). "/images/"
. item_img_name($myrow['stock_id']) . ".jpg";
if (file_exists($image))
{
$rep->fontSize += 2;
$rep->TextCol(0, 3, _("Sales Kits"));
$rep->fontSize -= 2;
- }
+ }
$rep->Line($rep->row - $rep->lineHeight);
$rep->NewLine(2);
$rep->fontSize += 2;
}
$rep->NewLine();
$rep->TextCol(0, 1, $myrow['kit_code']);
- $rep->TextCol(1, 2, $myrow['kit_name']);
+ $rep->TextCol(1, 3, $myrow['kit_name']);
$price = get_kit_price($myrow['kit_code'], $currency, $salestype);
- $rep->AmountCol(2, 3, $price, $dec);
+ $rep->AmountCol(3, 4, $price, $dec);
$rep->NewLine(0, 1);
}
$rep->Line($rep->row - 4);
<?php
/**********************************************************************
Copyright (C) FrontAccounting, LLC.
- Released under the terms of the GNU General Public License, GPL,
- as published by the Free Software Foundation, either version 3
+ Released under the terms of the GNU General Public License, GPL,
+ as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
$page_security = 'SA_SUPPLIERANALYTIC';
$headers[2] = _('currency');
$rep = new FrontReport(_('Aged Supplier Analysis'), "AgedSupplierAnalysis", user_pagesize());
-<<<<<<< rep202.php
$rep->Font();
$rep->Info($params, $cols, $headers, $aligns);
$rep->NewPage();
-=======
- $rep->Font();
- $rep->Info($params, $cols, $headers, $aligns);
- $rep->Header();
->>>>>>> 1.7
$total = array();
$total[0] = $total[1] = $total[2] = $total[3] = $total[4] = 0.0;