/** * function generalTablePrint * * Initialization function * * @param object $db database object * @param string $reportUUID UUID of report record * @param string $tabledefUUID UUID of table definition intializing print */ function generalTablePrint($db, $reportUUID, $tabledefUUID) { parent::phpbmsReport($db, $reportUUID, $tabledefUUID); $therecord = $this->getTableDefInfo(); $this->maintable = $therecord["maintable"]; $this->displayname = $therecord["displayname"]; }
/** * function pdfLabels * * initialization function */ function pdfLabels($db, $reportUUID, $tabledefUUID) { parent::phpbmsReport($db, $reportUUID, $tabledefUUID); $therecord = $this->getTableDefInfo(); $this->maintable = $therecord["maintable"]; $this->checkForDefaultSettings(); }
function totalReport($db, $reportUUID, $tabledefUUID) { $this->db = $db; parent::phpbmsReport($db, $reportUUID, $tabledefUUID); // first we define the available groups $this->addGroup("Year", "YEAR(docdate)"); //0 $this->addGroup("Quarter", "QUARTER(docdate)"); //1 $this->addGroup("Month", "DATE_FORMAT(docdate, '%m - %b')"); //2 $this->addGroup("Week", "WEEK(docdate)"); //3 $this->addGroup("Payment Method", "paymentmethods.name"); //4 $this->addGroup("Document Type", "doctype"); //5 //next we do the columns $this->addColumn("Record Count", "COUNT(id)"); //0 $this->addColumn("Total", "SUM(doctotal)", "currency"); //1 $this->tableClause["invoices"] = "(invoices INNER JOIN paymentmethods ON invoices.paymentmethodid = paymentmethods.uuid)"; $this->tableClause["receipts"] = "(receipts INNER JOIN paymentmethods ON receipts.paymentmethodid = paymentmethods.uuid)"; }
function invoicePDF($db, $reportUUID, $tabledefUUID, $orientation = 'P', $unit = 'mm', $format = 'Letter') { parent::phpbmsReport($db, $reportUUID, $tabledefUUID); if (!class_exists("phpbmsPDFReport")) { include "report/pdfreport_class.php"; } $this->pdf = new phpbmsPDFReport($db, $orientation, $unit, $format); $this->checkForDefaultSettings(); $this->initialize(); }
function aritemsSummary($db, $reportUUID, $tabledefUUID, $statementDate = NULL, $showPayments = "new", $showClosed = false) { parent::phpbmsReport($db, $reportUUID, $tabledefUUID); if ($statementDate) { $this->statementDate = $statementDate; } else { $this->statementDate = mktime(0, 0, 0); } $this->showPayments = $showPayments; $this->showClosed = $showClosed; }
function MCReport($db, $reportUUID, $tabledefUUID, $variables = NULL) { parent::phpbmsReport($db, $reportUUID, $tabledefUUID); //next we do the columns $this->addColumn("Email", "`email`"); //0 $this->addColumn("First Name", "`firstname`"); //1 $this->addColumn("Last Name", "`lastname`"); //2 $this->addColumn("Company", "`company`"); //3 $this->addColumn("Uuid", "`uuid`"); //4 $this->addColumn("Type", "`type`"); //5 $this->addColumn("Id", "`id`"); //6 $this->selecttable = "`clients`"; }
function salesHistoryReport($db, $reportUUID, $tabledefUUID) { parent::phpbmsReport($db, $reportUUID, $tabledefUUID); //$this->checkForDefaultSettings(); }
function totalReport($db, $reportUUID, $tabledefUUID, $variables = NULL) { parent::phpbmsReport($db, $reportUUID, $tabledefUUID); // first we define the available groups $this->addGroup("Invoice Date - Year", "YEAR(invoices.invoicedate)"); //0 $this->addGroup("Invoice Date - Quarter", "QUARTER(invoices.invoicedate)"); //1 $this->addGroup("Invoice Date - Month", "MONTH(invoices.invoicedate)"); //2 $this->addGroup("Invoice Date", "invoices.invoicedate", "date"); //3 $this->addGroup("Order Date - Year", "YEAR(invoices.orderdate)"); //4 $this->addGroup("Order Date - Quarter", "QUARTER(invoices.orderdate)"); //5 $this->addGroup("Order Date - Month", "MONTH(invoices.orderdate)"); //6 $this->addGroup("Order Date", "invoices.orderdate", "date"); //7 $this->addGroup("Required Date - Year", "YEAR(invoices.requireddate)"); //8 $this->addGroup("Required Date - Quarter", "QUARTER(invoices.requireddate)"); //9 $this->addGroup("Required Date - Month", "MONTH(invoices.requireddate)"); //10 $this->addGroup("Required Date", "invoices.requireddate", "date"); //11 $this->addGroup("Client", "if(clients.lastname!='',concat(clients.lastname,', ',clients.firstname,if(clients.company!='',concat(' (',clients.company,')'),'')),clients.company)"); //12 $this->addGroup("Client Sales Person", "concat(salesPerson.firstname,' ',salesPerson.lastname)", NULL, "LEFT JOIN users AS salesPerson ON clients.salesmanagerid = salesPerson.uuid"); //13 $this->addGroup("Client Lead Source", "clients.leadsource"); //14 $this->addGroup("Invoice Lead Source", "invoices.leadsource"); //15 $this->addGroup("Payment Method", "paymentmethods.name"); //16 $this->addGroup("Shipping Method", "shippingmethods.name"); //17 $this->addGroup("Invoice Shipping Country", "invoices.shiptocountry"); //18 $this->addGroup("Invoice Shipping State / Province", "invoices.shiptostate"); //19 $this->addGroup("Invoice Shipping Postal Code", "invoices.shiptopostalcode"); //20 $this->addGroup("Invoice Shipping City", "invoices.shiptocity"); //21 $this->addGroup("Web Order", "invoices.weborder", "boolean"); //22 $this->addGroup("Invoice billing Country", "invoices.country"); //23 $this->addGroup("Invoice Billing State / Province", "invoices.state"); //24 $this->addGroup("Invoice Billing Postal Code", "invoices.postalcode"); //25 $this->addGroup("Invoice Billing City", "invoices.city"); //26 //next we do the columns $this->addColumn("Record Count", "count(invoices.id)"); //0 $this->addColumn("Invoice Total", "sum(invoices.totalti)", "currency"); //1 $this->addColumn("Average Invoice Total", "avg(invoices.totalti)", "currency"); //2 $this->addColumn("Subtotal", "sum(invoices.totaltni)", "currency"); //3 $this->addColumn("Average Subtotal", "avg(invoices.totaltni)", "currency"); //4 $this->addColumn("Tax", "sum(invoices.tax)", "currency"); //5 $this->addColumn("Average Tax", "avg(invoices.tax)", "currency"); //6 $this->addColumn("Shipping", "sum(invoices.shipping)", "currency"); //7 $this->addColumn("Average Shipping", "avg(invoices.shipping)", "currency"); //8 $this->addColumn("Amount Paid", "sum(invoices.amountpaid)", "currency"); //9 $this->addColumn("Average Amount Paid", "avg(invoices.amountpaid)", "currency"); //10 $this->addColumn("Amount Due", "sum(invoices.totalti - invoices.amountpaid)", "currency"); //11 $this->addColumn("Average Amount Due", "avg(invoices.totalti - invoices.amountpaid)", "currency"); //12 $this->addColumn("Cost", "sum(invoices.totalcost)", "currency"); //13 $this->addColumn("Average Cost", "avg(invoices.totalcost)", "currency"); //14 $this->addColumn("Total Weight", "sum(invoices.totalweight)", "real"); //15 $this->addColumn("Average Total Weight", "avg(invoices.totalweight)", "real"); //16 $this->selecttable = "((`invoices` INNER JOIN `clients` ON `invoices`.`clientid`=`clients`.`uuid`)\n LEFT JOIN `shippingmethods` ON `shippingmethods`.`uuid` = `invoices`.`shippingmethodid`)\n LEFT JOIN `paymentmethods` ON `paymentmethods`.`id`=`invoices`.`paymentmethodid`"; }
function totalReport($db, $reportUUID, $tabledefUUID, $variables = NULL) { parent::phpbmsReport($db, $reportUUID, $tabledefUUID); // first we define the available groups $this->addGroup("Invoice ID", "invoices.id"); //0 $this->addGroup("Product", "concat(products.partnumber,' - ',products.partname)"); //1 $this->addGroup("Product Category", "concat(productcategories.id,' - ',productcategories.name)", NULL, "INNER JOIN productcategories ON products.categoryid=productcategories.uuid"); //2 $this->addGroup("Invoice Date - Year", "YEAR(invoices.invoicedate)"); //3 $this->addGroup("Invoice Date - Quarter", "QUARTER(invoices.invoicedate)"); //4 $this->addGroup("Invoice Date - Month", "MONTH(invoices.invoicedate)"); //5 $this->addGroup("Invoice Date", "invoices.invoicedate", "date"); //6 $this->addGroup("Order Date - Year", "YEAR(invoices.orderdate)"); //7 $this->addGroup("Order Date - Quarter", "QUARTER(invoices.orderdate)"); //8 $this->addGroup("Order Date - Month", "MONTH(invoices.orderdate)"); //9 $this->addGroup("Order Date", "invoices.orderdate", "date"); //10 $this->addGroup("Client", "if(clients.lastname!='',concat(clients.lastname,', ',clients.firstname,if(clients.company!='',concat(' (',clients.company,')'),'')),clients.company)"); //11 $this->addGroup("Client Sales Person", "concat(salesPerson.firstname,' ',salesPerson.lastname)", NULL, "LEFT JOIN users AS salesPerson ON clients.salesmanagerid = salesPerson.id"); //12 $this->addGroup("Client Lead Source", "clients.leadsource"); //13 $this->addGroup("Invoice Lead Source", "invoices.leadsource"); //14 $this->addGroup("Payment Method", "paymentmethods.name"); //15 $this->addGroup("Shipping Method", "shippingmethods.name"); //16 $this->addGroup("Invoice Shipping Country", "invoices.shiptocountry"); //17 $this->addGroup("Invoice Shipping State / Province", "invoices.shiptostate"); //18 $this->addGroup("Invoice Shipping Postal Code", "invoices.shiptopostalcode"); //19 $this->addGroup("Invoice Shipping City", "invoices.shiptocity"); //20 $this->addGroup("Web Order", "invoices.weborder", "boolean"); //21 $this->addGroup("Invoice billing Country", "invoices.country"); //22 $this->addGroup("Invoice Billing State / Province", "invoices.state"); //23 $this->addGroup("Invoice Billing Postal Code", "invoices.postalcode"); //24 $this->addGroup("Invoice Billing City", "invoices.city"); //25 //next we do the columns $this->addColumn("Record Count", "count(lineitems.id)"); //0 $this->addColumn("Extended Price", "sum(lineitems.unitprice*lineitems.quantity)", "currency"); //1 $this->addColumn("Average Extended Price", "avg(lineitems.unitprice*lineitems.quantity)", "currency"); //2 $this->addColumn("Unit Price", "sum(lineitems.unitprice)", "currency"); //3 $this->addColumn("Average Unit Price", "avg(lineitems.unitprice)", "currency"); //4 $this->addColumn("Quantity", "sum(lineitems.quantity)", "real"); //5 $this->addColumn("Average Quantity", "avg(lineitems.quantity)", "real"); //6 $this->addColumn("Unit Cost", "sum(lineitems.unitcost)", "currency"); //7 $this->addColumn("Average Unit Cost", "avg(lineitems.unitcost)", "currency"); //8 $this->addColumn("Extended Cost", "sum(lineitems.unitcost*lineitems.quantity)", "currency"); //9 $this->addColumn("Average Extended Cost", "avg(lineitems.unitcost*lineitems.quantity)", "currency"); //10 $this->addColumn("Unit Weight", "sum(lineitems.unitweight)", "real"); //11 $this->addColumn("Average Unit Weight", "avg(lineitems.unitweight)", "real"); //12 $this->addColumn("Extended Unit Weight", "sum(lineitems.unitweight*lineitems.quantity)", "real"); //13 $this->addColumn("Extended Average Unit Weight", "avg(lineitems.unitweight*lineitems.quantity)", "real"); //14 //change $this->selecttable = "(((((lineitems LEFT JOIN products ON lineitems.productid=products.uuid)\n INNER JOIN invoices ON lineitems.invoiceid=invoices.id)\n INNER JOIN clients ON invoices.clientid=clients.uuid)\n LEFT JOIN shippingmethods ON shippingmethods.uuid=invoices.shippingmethodid)\n LEFT JOIN paymentmethods ON paymentmethods.uuid=invoices.paymentmethodid)\n "; }
function tabledefSQLExport($db, $reportUUID, $tabledefUUID) { parent::phpbmsReport($db, $reportUUID, $tabledefUUID); }
/** * function generalTablePrint * * Initialization function * * @param object $db database object * @param string $reportUUID UUID of report record * @param string $tabledefUUID UUID of table definition intializing print */ function sqlExport($db, $reportUUID, $tabledefUUID) { parent::phpbmsReport($db, $reportUUID, $tabledefUUID); $therecord = $this->getTableDefInfo(); $this->maintable = $therecord["maintable"]; }
function receiptsPTTotals($db, $reportUUID, $tabledefUUID) { parent::phpbmsReport($db, $reportUUID, $tabledefUUID); }