Commit 91d1ab1f authored by philippepary's avatar philippepary
Browse files

Providers in sales_report pasteque/pasteque-server#20

parent 285bbc82
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
"Taxes report": "TVA collectée", "Taxes report": "TVA collectée",
"Product name": "Produit", "Product name": "Produit",
"Category name": "Categorie", "Category name": "Categorie",
"Provider name": "Fournisseur",
"Units": "Quantité", "Units": "Quantité",
"Sell": "Prix HT", "Sell": "Prix HT",
"Tax name": "TVA", "Tax name": "TVA",
......
...@@ -23,6 +23,7 @@ namespace BaseSales; ...@@ -23,6 +23,7 @@ namespace BaseSales;
$sql = "SELECT CASHREGISTERS.NAME, CLOSEDCASH.DATESTART, " $sql = "SELECT CASHREGISTERS.NAME, CLOSEDCASH.DATESTART, "
. "CLOSEDCASH.DATEEND, TICKETS.TICKETID, RECEIPTS.DATENEW, " . "CLOSEDCASH.DATEEND, TICKETS.TICKETID, RECEIPTS.DATENEW, "
. "PRODUCTS.NAME AS PRD_NAME, CATEGORIES.NAME AS CAT_NAME, " . "PRODUCTS.NAME AS PRD_NAME, CATEGORIES.NAME AS CAT_NAME, "
. "PROVIDERS.NAME AS PROV_NAME, "
. "TICKETLINES.UNITS, (TICKETLINES.PRICE * TICKETLINES.UNITS * (1 - TICKETLINES.DISCOUNTRATE)) AS SELL " . "TICKETLINES.UNITS, (TICKETLINES.PRICE * TICKETLINES.UNITS * (1 - TICKETLINES.DISCOUNTRATE)) AS SELL "
. "FROM TICKETS " . "FROM TICKETS "
. "LEFT JOIN RECEIPTS ON TICKETS.ID = RECEIPTS.ID " . "LEFT JOIN RECEIPTS ON TICKETS.ID = RECEIPTS.ID "
...@@ -31,15 +32,17 @@ $sql = "SELECT CASHREGISTERS.NAME, CLOSEDCASH.DATESTART, " ...@@ -31,15 +32,17 @@ $sql = "SELECT CASHREGISTERS.NAME, CLOSEDCASH.DATESTART, "
. "LEFT JOIN TICKETLINES ON TICKETLINES.TICKET = TICKETS.ID " . "LEFT JOIN TICKETLINES ON TICKETLINES.TICKET = TICKETS.ID "
. "LEFT JOIN PRODUCTS ON TICKETLINES.PRODUCT = PRODUCTS.ID " . "LEFT JOIN PRODUCTS ON TICKETLINES.PRODUCT = PRODUCTS.ID "
. "LEFT JOIN CATEGORIES ON PRODUCTS.CATEGORY = CATEGORIES.ID " . "LEFT JOIN CATEGORIES ON PRODUCTS.CATEGORY = CATEGORIES.ID "
. "LEFT JOIN PROVIDERS ON PRODUCTS.PROVIDER = PROVIDERS.ID "
. "WHERE CLOSEDCASH.DATESTART > :start AND CLOSEDCASH.DATEEND < :stop " . "WHERE CLOSEDCASH.DATESTART > :start AND CLOSEDCASH.DATEEND < :stop "
. "ORDER BY CLOSEDCASH.DATESTART DESC, TICKETS.TICKETID DESC, " . "ORDER BY CLOSEDCASH.DATESTART DESC, TICKETS.TICKETID DESC, "
. "TICKETLINES.LINE DESC"; . "TICKETLINES.LINE DESC";
$fields = array("NAME", "DATESTART", "DATEEND", "TICKETID", "DATENEW", $fields = array("NAME", "DATESTART", "DATEEND", "TICKETID", "DATENEW",
"PRD_NAME", "CAT_NAME", "UNITS", "SELL"); "PRD_NAME", "CAT_NAME", "PROV_NAME", "UNITS", "SELL");
$headers = array(\i18n("CashRegister.label"), \i18n("Session.openDate"), $headers = array(\i18n("CashRegister.label"), \i18n("Session.openDate"),
\i18n("Session.closeDate"), \i18n("Ticket.number"), \i18n("Session.closeDate"), \i18n("Ticket.number"),
\i18n("Ticket.date"), \i18n("Product name", PLUGIN_NAME), \i18n("Ticket.date"), \i18n("Product name", PLUGIN_NAME),
\i18n("Category name", PLUGIN_NAME), \i18n("Category name", PLUGIN_NAME),
\i18n("Provider name", PLUGIN_NAME),
\i18n("Units", PLUGIN_NAME), \i18n("Sell", PLUGIN_NAME)); \i18n("Units", PLUGIN_NAME), \i18n("Sell", PLUGIN_NAME));
$report = new \Pasteque\Report(PLUGIN_NAME, "sales_report", $report = new \Pasteque\Report(PLUGIN_NAME, "sales_report",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment