Ejemplo n.º 1
0
 if ('Y' == $useStore || 'D' == $useStore && 'Y' == $availCanBuyZero) {
     $negativeAmount = $useStore;
 } else {
     $negativeAmount = $_POST['NEGATIVE_AMOUNT'];
     if (!$negativeAmount || $negativeAmount == '') {
         $negativeAmount = 'D';
     }
 }
 $barcodeMultiply = $_POST["CAT_BARCODE_MULTIPLY"];
 if (!$barcodeMultiply || $barcodeMultiply == '') {
     $barcodeMultiply = 'N';
 }
 if (isset($_REQUEST["AR_BARCODE_ID"]) && $barcodeMultiply == 'Y') {
     $countBarCode = 0;
     $arBarCodeResult = array();
     $dbAmount = CCatalogStoreControlUtil::getQuantityInformation($PRODUCT_ID);
     if (is_object($dbAmount) && ($arAmount = $dbAmount->Fetch())) {
         $dbBarCode = CCatalogStoreBarCode::GetList(array(), array("PRODUCT_ID" => $PRODUCT_ID), false, false, array("ID", "BARCODE", "PRODUCT_ID", "STORE_ID"));
         while ($arBarCode = $dbBarCode->Fetch()) {
             $arBarCodeResult[] = $arBarCode;
             if ($arBarCode["STORE_ID"] != 0) {
                 $countBarCode++;
             }
         }
         if ($arAmount["SUM"] + $arAmount["RESERVED"] != 0 || $countBarCode > 0) {
             $strWarning .= GetMessage("C2IT_ERROR_USE_MULTIBARCODE", array("#COUNT#" => $arAmount["SUM"] - $countBarCode));
             $barcodeMultiply = 'N';
             unset($_REQUEST["AR_BARCODE_ID"]);
         } else {
             foreach ($arBarCodeResult as $barCode) {
                 CCatalogStoreBarCode::Delete($barCode["ID"]);