Example #1
0
     $upc = $_GET['upc'];
     $saleprice = $_GET['saleprice'];
     $method = 0;
     $qty = $_GET['saleqty'];
     if (is_numeric($qty)) {
         $method = 2;
     } else {
         $qty = 0;
     }
     $upQ = $sql->prepare("update batchList set saleprice=?,pricemethod=?,quantity=? where batchID=? and upc=?");
     $upR = $sql->execute($upQ, array($saleprice, $method, $qty, $id, $upc));
     $upQ = $sql->prepare("update batchBarcodes set normal_price=? where upc=? and batchID=?");
     $upR = $sql->execute($upQ, array($saleprice, $upc, $id));
     $audited = $_GET["audited"];
     if ($audited == "1") {
         \COREPOS\Fannie\API\lib\AuditLib::batchNotification($this->id, $this->upc, \COREPOS\Fannie\API\lib\AuditLib::BATCH_EDIT, substr($this->upc, 0, 2) == 'LC' ? true : false);
     }
     break;
 case 'newTag':
     $id = $_GET['id'];
     $upc = $_GET['upc'];
     $price = $_GET['price'];
     $out .= newTagInput($upc, $price, $id);
     break;
 case 'addTag':
     $id = $_GET['id'];
     $upc = $_GET['upc'];
     $price = $_GET['price'];
     $desc = $_GET['desc'];
     $brand = $_GET['brand'];
     $units = $_GET['units'];
Example #2
0
 protected function delete_id_upc_handler()
 {
     global $FANNIE_OP_DB;
     $dbc = FannieDB::get($FANNIE_OP_DB);
     $id = $this->id;
     $upc = $this->upc;
     $json = array('error' => 0, 'msg' => 'Item ' . $upc . ' removed from batch');
     if (substr($upc, 0, 2) != 'LC') {
         // take the item off sale if this batch is currently on sale
         if ($this->unsaleUPC($this->upc) === false) {
             $json['error'] = 1;
             $json['msg'] = 'Error taking item ' . $upc . ' off sale';
         }
         updateProductAllLanes($upc);
     } else {
         $likecode = substr($upc, 2);
         if ($this->unsaleLikeCode($likecode) === false) {
             $json['error'] = 1;
             $json['msg'] = 'Error taking like code ' . $likecode . ' off sale';
         }
     }
     $delQ = $dbc->prepare_statement("delete from batchList where batchID=? and upc=?");
     $delR = $dbc->exec_statement($delQ, array($id, $upc));
     if ($delR === false) {
         if ($json['error']) {
             $json['msg'] .= '<br />Error deleting item ' . $upc . ' from batch';
         } else {
             $json['error'] = 1;
             $json['msg'] = 'Error deleting item ' . $upc . ' from batch';
         }
     }
     $delQ = $dbc->prepare_statement("delete from batchBarcodes where upc=? and batchID=?");
     $delR = $dbc->exec_statement($delQ, array($upc, $id));
     if (FormLib::get_form_value('audited') == '1') {
         \COREPOS\Fannie\API\lib\AuditLib::batchNotification($id, $upc, \COREPOS\Fannie\API\lib\AuditLib::BATCH_DELETE, substr($upc, 0, 2) == 'LC' ? true : false);
     }
     echo json_encode($json);
     return false;
 }