szollosil 1 рік тому
батько
коміт
8f397b3dbd

+ 25 - 23
custom/bbus/class/api_bbus.class.php

@@ -2441,33 +2441,35 @@ class BBus extends DolibarrApi
 			//exit;
 		}
 		foreach ($productsArray as $key => $value) {
-			$content = "-- product rowid: {$key}
-				INSERT INTO llx_product (";
-			$valueContent = "";
-			$keyNumber = count((array)$value['product']);
-			$counter = 1;
-			foreach ($value['product'] as $vkey => $vvalue) {
-				$content .= "{$vkey}";
-				if ($vkey == 'fk_user_author') {
-					$valueContent .= intval(1);
-				} elseif ($vkey == 'fk_user_modif') {
-					$valueContent .= intval(1);
-				} else {
-					$valueContent .= "{$this->getvvalue($vvalue)}";
-				}
-				if ($counter <= $keyNumber - 1) {
-					$content .= ", ";
-					$valueContent .= ", ";
-				} else {
-					$content .= ") VALUES (";
-					$valueContent .= ") ON CONFLICT (rowid) DO NOTHING;";
+			if($key > 4999){
+				$content = "-- product rowid: {$key}
+				INSERT INTO llx_product_temp (";
+				$valueContent = "";
+				$keyNumber = count((array)$value['product']);
+				$counter = 1;
+				foreach ($value['product'] as $vkey => $vvalue) {
+					$content .= "{$vkey}";
+					if ($vkey == 'fk_user_author') {
+						$valueContent .= intval(1);
+					} elseif ($vkey == 'fk_user_modif') {
+						$valueContent .= intval(1);
+					} else {
+						$valueContent .= "{$this->getvvalue($vvalue)}";
+					}
+					if ($counter <= $keyNumber - 1) {
+						$content .= ", ";
+						$valueContent .= ", ";
+					} else {
+						$content .= ") VALUES (";
+						$valueContent .= ") ON CONFLICT (rowid) DO NOTHING;";
+					}
+					$counter++;
 				}
-				$counter++;
 			}
 			$asd = $content . $valueContent;
 			print $asd . "\r\n";
-			print $value['extrafields'] . "\r\n";
-			print $value['prices'] . "\r\n";
+			//print $value['extrafields'] . "\r\n";
+			//print $value['prices'] . "\r\n";
 		}
 		exit;
 	}

+ 3 - 6
custom/bbus/class/commissionhandler.class.php

@@ -232,20 +232,17 @@ class CommissionHandler
         $commissions = 0;
         $result = $this->db->query($sql);
         while ($factureRow = pg_fetch_assoc($result)) {
-            //if (is_null($factureRow['bbt_rowid']) || !is_null($factureRow['bbtip_rowid'])) {
             $commissions += $factureRow['multicurrency_total_ttc'];
-            //}
         }
         return $commissions;
     }
 
     function createSQL($from, $to, $currency, $code, $entity, $user_id, $allComissionInvoicesOfUserInTheGroupFromUserInvoice, $crossShoppingFactures, $crossShopping = false)
     {
-        $sql = "SELECT f.rowid, f.multicurrency_total_ttc, fe.commission, f.ref, bbt.rowid as bbt_rowid, bbtip.rowid as bbtip_rowid
+        $sql = "SELECT f.rowid, f.multicurrency_total_ttc, fe.commission, f.ref
         FROM llx_facture as f 
-        INNER JOIN llx_facture_extrafields as fe ON fe.fk_object = f.rowid
-        LEFT JOIN llx_bbus_bbticket as bbt ON bbt.fk_facture = f.rowid
-        LEFT JOIN llx_bbus_bbticketinvoiceprinting as bbtip ON bbtip.invoice_number = f.ref WHERE";
+        INNER JOIN llx_facture_extrafields as fe ON fe.fk_object = f.rowid WHERE ";
+        
         if ($crossShopping && $crossShoppingFactures != "") {
             $sql .= " f.ref in ({$crossShoppingFactures}) AND";
         } else {

+ 2 - 0
custom/bbus/class/roller_handling_helper.class.php

@@ -7,6 +7,7 @@ trait RollerHandligHelper
     public function getAllScooterDataByCode($code)
     {
         $deviceTypes = ['5' => 'Seev Citycoco', '6' => 'WIZTEM'];
+        $rentableStatuses = [110, 115];
         $sql = "SELECT 
             i.rowid, i.entity, i.ref, i.fk_warehouse, i.status, i.title
             , ent.ref, ent.lieu
@@ -19,6 +20,7 @@ trait RollerHandligHelper
         if ($this->db->num_rows($result) > 0) {
             while ($row = $this->db->fetch_object($result)) {
                 $row->device_type = $deviceTypes[$row->device_type];
+                $row->isRentable = in_array($row->status, $rentableStatuses);
                 return $row;
             }
         }

+ 6 - 4
custom/settlements/class/daily_closing.class.php

@@ -358,10 +358,12 @@ class DailyClosing
         //print $crossShoppingFacturesString;
         $postFields = json_encode($params);
         $crossShoppingFactures = $this->curlRunner('bookingapi/getPrintedFacturesRefsArray', $postFields, 'POST', true);
-        $data = $db->query($sql);
-        while ($row2 = pg_fetch_assoc($data)) {
-            if (in_array($row2['ref'], $crossShoppingFactures)) {
-                $array[] = $row2['rowid'];
+        if(!is_null($crossShoppingFactures)){
+            $data = $db->query($sql);
+            while ($row2 = pg_fetch_assoc($data)) {
+                if (in_array($row2['ref'], $crossShoppingFactures)) {
+                    $array[] = $row2['rowid'];
+                }
             }
         }
         return $array;

+ 12 - 12
langs/hu_HU/main.lang

@@ -14,21 +14,21 @@ FONTFORPDF=helvetica
 FONTSIZEFORPDF=10
 SeparatorDecimal=,
 SeparatorThousand=Space
-FormatDateShort=%m/%d/%Y
-FormatDateShortInput=%m/%d/%Y
-FormatDateShortJava=MM/dd/yyyy
-FormatDateShortJavaInput=MM/dd/yyyy
-FormatDateShortJQuery=mm/dd/yy
-FormatDateShortJQueryInput=mm/dd/yy
+FormatDateShort=%Y/%m/%d
+FormatDateShortInput=%Y/%m/%d
+FormatDateShortJava=yyyy/MM/dd
+FormatDateShortJavaInput=yyyy/MM/dd
+FormatDateShortJQuery=yy/mm/dd
+FormatDateShortJQueryInput=yy/mm/dd
 FormatHourShortJQuery=ÓÓ:PP
 FormatHourShort=%I:%M %p
 FormatHourShortDuration=%H:%M
-FormatDateTextShort=%b %d, %Y
-FormatDateText=%B %d, %Y
-FormatDateHourShort=%d/%m/%Y %I:%M %p
-FormatDateHourSecShort=%m/%d/%Y %I:%M:%S %p
-FormatDateHourTextShort=%b %d, %Y, %I:%M %p
-FormatDateHourText=%B %d, %Y, %I:%M %p
+FormatDateTextShort=%Y,%b,%d
+FormatDateText=%Y,%B,%d
+FormatDateHourShort=%Y/%m/%d %I:%M %p
+FormatDateHourSecShort=%Y/%m/%d %I:%M:%S %p
+FormatDateHourTextShort=%Y,%b,%d, %I:%M %p
+FormatDateHourText=%Y,%B,%d, %I:%M %p
 DatabaseConnection=Adatbási Kapcsolat
 NoTemplateDefined=Nem érhető el sablon ehhez az e-mail típushoz
 AvailableVariables=Elérhető helyettesítő változók