|
@@ -266,17 +266,17 @@ function report_sale(reporting){
|
|
|
var desde = self.$el.find('#from').val();
|
|
|
var hasta = self.$el.find('#to').val();
|
|
|
|
|
|
- var store_ids = _.flatten(_.map(self.ResStore, function (item) {
|
|
|
- return item.id;
|
|
|
- }));
|
|
|
-
|
|
|
- var company_ids = _.flatten(_.map(self.ResCompany, function (item) {
|
|
|
- return item.id;
|
|
|
- }));
|
|
|
-
|
|
|
- content = _.flatten(_.filter(content,function (item) {
|
|
|
- return _.contains(store_ids, item.store_id) && _.contains(company_ids, item.company_id);
|
|
|
- }));
|
|
|
+ if((store && store == 9999999)||(company && company == 9999999)){
|
|
|
+ var store_ids = _.flatten(_.map(self.ResStore, function (item) {
|
|
|
+ return item.id;
|
|
|
+ }));
|
|
|
+ var company_ids = _.flatten(_.map(self.ResCompany, function (item) {
|
|
|
+ return item.id;
|
|
|
+ }));
|
|
|
+ content = _.flatten(_.filter(content,function (item) {
|
|
|
+ return _.contains(store_ids, item.store_id) && _.contains(company_ids, item.company_id);
|
|
|
+ }));
|
|
|
+ }
|
|
|
|
|
|
if(company && company != 9999999){
|
|
|
content = _.flatten(_.filter(content,function (item) {
|
|
@@ -378,17 +378,17 @@ function report_sale(reporting){
|
|
|
var desde = self.$el.find('#from').val();
|
|
|
var hasta = self.$el.find('#to').val();
|
|
|
|
|
|
- var store_ids = _.flatten(_.map(self.ResStore, function (item) {
|
|
|
- return item.id;
|
|
|
- }));
|
|
|
-
|
|
|
- var company_ids = _.flatten(_.map(self.ResCompany, function (item) {
|
|
|
- return item.id;
|
|
|
- }));
|
|
|
-
|
|
|
- content = _.flatten(_.filter(content,function (item) {
|
|
|
- return _.contains(store_ids, item.store_id) && _.contains(company_ids, item.company_id);
|
|
|
- }));
|
|
|
+ if((store && store == 9999999)||(company && company == 9999999)){
|
|
|
+ var store_ids = _.flatten(_.map(self.ResStore, function (item) {
|
|
|
+ return item.id;
|
|
|
+ }));
|
|
|
+ var company_ids = _.flatten(_.map(self.ResCompany, function (item) {
|
|
|
+ return item.id;
|
|
|
+ }));
|
|
|
+ content = _.flatten(_.filter(content,function (item) {
|
|
|
+ return _.contains(store_ids, item.store_id) && _.contains(company_ids, item.company_id);
|
|
|
+ }));
|
|
|
+ }
|
|
|
|
|
|
if(company && company != 9999999){
|
|
|
content = _.flatten(_.filter(content,function (item) {
|
|
@@ -483,6 +483,7 @@ function report_sale(reporting){
|
|
|
POS ORDER
|
|
|
==========================================
|
|
|
*/
|
|
|
+ var discount_amount;
|
|
|
var PosOrder = self.getPosOrder();
|
|
|
_.each(PosOrder, function(item){
|
|
|
var utc = moment.utc(item.date,'YYYY-MM-DD h:mm:ss A');
|
|
@@ -554,6 +555,7 @@ function report_sale(reporting){
|
|
|
*/
|
|
|
date_no_format: moment(item.date).format('YYYY-MM-DD'),
|
|
|
residual_no_format:residual,
|
|
|
+ discount_amount_no_format:item.discount_rate,
|
|
|
untaxed_no_format:item.amount - item.amount_tax,
|
|
|
tax_no_format:item.amount_tax,
|
|
|
total_no_format:item.amount,
|