Jump to content

JaivyDaam

Members
  • Posts

    35
  • Joined

  • Last visited

About JaivyDaam

  • Birthday 08/20/1989

Contact Methods

Profile Information

  • Location
    Netherlands
  • Activity
    Project Owner

Recent Profile Visitors

3,854,124 profile views

JaivyDaam's Achievements

Newbie

Newbie (1/14)

5

Reputation

2

Community Answers

  1. I forgot to mention that for now the webshop it self is not being used yet. We are using Prestashop right now as an automated invoice system and the customers will be able to login at a later stadium.
  2. Hello El Patron, Thanks for the quick reply! But this won't help me. It is psycological that they see how much discount they are getting for each product and that summed up. Since i am not working with private persons but with businesses this is necessary and better for our relations.
  3. Hello Community! Onze again i call upon your help, i will tell you my scenario: I'm using PS 1.6 I'm a wholesaler and so the products i sell are not per 1 but per 1000, I also sell to other wholesalers and give them a special price. Let me give you the format i want on my invoice it will be easier that way: Qty: | Discription | Unit Price | Total: 1000 | Product 1 | 4.00 | 4000 1000 | Discount wholesaler for France | -1.50 | 1500 TOTAL: 2500 The "Discount wholesaler for France" should only be accessable from the BO, but for some reason i can't create a product with a negative value. Anybody knows a workaround with this? Thank again for helping me!
  4. Wauw, this is awesome thanks for sharing! How can they hard code such an easy thing, they got a define statement... oh well, lets get to business! Thank you!!!
  5. Ok so here so this is the problem. When you delete orders the generate invoices stays. Using the outstanding page, it tries to collect orders from invoice that doesn't excist anymore. Click on the [2 Arguments] on this lines, told me about which invoice it was. AdminOutstandingControllerCore->printOutstandingCalculation - [line - ] - [2 Arguments] So i deleted all of the ghost invoices and it working (Better keep my hands off the database )
  6. Hello, sorry to bump this 1 year old post, but i also want this. just as you stated vekia. search orders by tracking number. I am on 1.6.0.5
  7. Change: /index.php?controller=AdminOrders&id_order=83&vieworder To /index.php?controller=AdminOrders&id_order=83&deleteorder Edit Forge: PSCFV-12179
  8. No i used the &deleteorder url parameter to do so why? Can i fix it?
  9. Hello every one, I use Prestashop 1.6 with the B2B Features. When I want to use the Outstanding page, I get a PrestashopException page: [PrestaShopException] object Order can't be loaded at line 139 in file controllers/admin/AdminOutstandingController.php 133. $order_invoice = new OrderInvoice($id_invoice); 134. if (!Validate::isLoadedObject($order_invoice)) 135. throw new PrestaShopException('object OrderInvoice can\'t be loaded'); 136. $order = new Order($order_invoice->id_order); 137. if (!Validate::isLoadedObject($order)) 138. throw new PrestaShopException('object Order can\'t be loaded'); 139. $customer = new Customer((int)$order->id_customer); 140. if (!Validate::isLoadedObject($order_invoice)) 141. throw new PrestaShopException('object Customer can\'t be loaded'); 142. 143. return '<b>'.Tools::displayPrice($customer->getOutstanding(), Context::getContext()->currency).'</b>'; AdminOutstandingControllerCore->printOutstandingCalculation - [line - ] - [2 Arguments] call_user_func_array - [line 307 - classes/helper/HelperList.php] - [2 Arguments] HelperListCore->displayListContent - [line 150 - classes/helper/HelperList.php] HelperListCore->generateList - [line 1967 - classes/controller/AdminController.php] - [2 Arguments] AdminControllerCore->renderList - [line 1755 - classes/controller/AdminController.php] AdminControllerCore->initContent - [line 180 - classes/controller/Controller.php] ControllerCore->run - [line 373 - classes/Dispatcher.php] DispatcherCore->dispatch - [line 54 - admin/index.php] Anyone knows a solution? Thank You, Jaivy Edit: Forge PSCFV-12179
  10. Xavier and Vladimir, I'm having a really, really, really bad day! I have found the new module on presta-addons.com in my order history (while i was searching for somekind of an upgrade button) I apologize for my foolishness and my inability to think! Thank you both for your time and effort to help a dork like me! Jaivy
  11. Does this also include the modules i bought from presta-addons.com and not from addons.prestashop.com? Because this is what my question was about...
  12. Hello All! First, sorry for my slubby english and louzy explanation any questions about my problem will be awnsered the best i can! So let me explain what i am trying to do here: For my own administration i need order numbers to be like '2140001' 214(is year) 0001(following number) when a customer orders, the order number needs to be created and added to a different table 'order_number' with only id_order and order_number... But when administrators add an order in the BO, there is not always an order, when we use products to repay a dept to a b2b customer there should be no order number. This way Reference is not capable of such thing since it's mandatory. So now, i want to add some kind of jquery box to the top of my detailed order page, so i created a module and hooked it to displayBackOfficeHeader, useing regexp to determine the page i am in and using strpos to determine if 'vieworder' is in the url. public function hookBackofficeHeader($params) { $page = preg_replace('/(.*)(tab=Admin|controller=Admin)([^&]+)(&.*)/','${3}',$_SERVER['REQUEST_URI']); $url = $_SERVER['REQUEST_URI']; $str = 'vieworder'; $version = explode('.',_PS_VERSION_); $script = ''; switch(strtolower($page)) { case 'orders': if ($version[1] == 5 || $version[1] == 6 && strpos($url, $str)) $script.= self::regenHtaccess(); break; case 'preferences': if ($version[1] == 3 || $version[1] == 4) $script.= self::clearCache(); break; case 'performance': if ($version[1] == 4 || ($version[1] == 5 && $version[2] < 6)) $script.= self::clearCache(); break; case 'meta': if ($version[1] == 5 || $version[1] == 6) $script.= self::regenHtaccess(); break; case 'shipping': if ($version[1] == 5 && $version[2] >= 6) $script.= self::psShippingMethod(); //if ($version[1] == 5 && $version[2] >= 4) $script.= self::psCarrierDefault(); break; } if ($version[1] >= 4) $script .= self::langSelect(); return $script; } regenHtaccess function: private function regenHtaccess($mode = null) { if ($mode == 'run') { $ht_file = _PS_ROOT_DIR_.'/.htaccess'; if (Tools::generateHtaccess($ht_file, null, null, '', Tools::getValue('PS_HTACCESS_DISABLE_MULTIVIEWS'), false, Tools::getValue('PS_HTACCESS_DISABLE_MODSEC'))) { Tools::enableCache(); Tools::clearCache($this->context->smarty); Tools::restoreCacheSettings(); die(0); } die('Failed in '.__METHOD__); } return <<< EOF <script> function esaPost(request){ $.ajax( { url: "{$this->getPostUrl()}&q="+request, cache: false, success: function(ret) { var probe = ret; } } ); return false; } $(document).ready(function() { if ($.last == undefined) { $.fn.eq = function( i ) { var len = this.length, j = +i + ( i < 0 ? len : 0 ); return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] ); }; } var lf = $('#content form,#content fieldset').eq(0); $('<fieldset class="panel"><legend>{$this->l('Force regenerate .htaccess')}</legend><div class="margin-form" style="padding-top:5px;"><a class="button" onclick="return esaPost(\'regenHtaccess\')" href="#">{$this->l('Force regenerate .htaccess')}</a><span id="esaRegenHT"></span></div></fieldset><br />') .insertBefore(lf); $('#esaRegenHT').html(" {$this->l('Regenerate this shop .htaccess with current setting')}"); }); </script> EOF; } Ok so, when i go to Preferences->SEO & URLS, the regenHtaccess box shows up like it should, but for some reasong i am unable to add a box to detailed order page. i am stuck, and i need some professional help! Thank you in advance! Jaivy Daam
  13. for administration reasons i use the invoice year as start of my invoice numbers, this gives me the perfect opportunity to reset the counter, simpel find the current year in the latest invoice number if not found make a new invoice number starting the current year. i copied /classes/order/Order.php to override/classes/order/Order.php and i editted 2 functions: Line 1085: public static function getLastInvoiceNumber() { return Db::getInstance()->getValue(' SELECT MAX(`number`) FROM `'._DB_PREFIX_.'order_invoice` WHERE `date_add` > MAKEDATE( EXTRACT( YEAR FROM CURDATE() ) , 1 ) '); } public function setInvoice($use_existing_payment = false) { if (!$this->hasInvoice()) { $order_invoice = new OrderInvoice(); $order_invoice->id_order = $this->id; $order_invoice->number = Configuration::get('PS_INVOICE_START_NUMBER', null, null, $this->id_shop); // If invoice start number has been set, you clean the value of this configuration if ($order_invoice->number) { Configuration::updateValue('PS_INVOICE_START_NUMBER', false, false, null, $this->id_shop); } else { /* get invoice number */ $n = Order::getLastInvoiceNumber(); /* get current year */ $dateYear = date('Y'); /* find year in string */ $findDate = strpos($n, $dateYear); if ($findDate !== false) { $order_invoice->number = Order::getLastInvoiceNumber() + 1; } else { $order_invoice->number = date('Y'); $order_invoice->number .= "0001"; } } $invoice_address = new Address((int)$this->id_address_invoice); $carrier = new Carrier((int)$this->id_carrier); $tax_calculator = $carrier->getTaxCalculator($invoice_address); $order_invoice->total_discount_tax_excl = $this->total_discounts_tax_excl; $order_invoice->total_discount_tax_incl = $this->total_discounts_tax_incl; $order_invoice->total_paid_tax_excl = $this->total_paid_tax_excl; $order_invoice->total_paid_tax_incl = $this->total_paid_tax_incl; $order_invoice->total_products = $this->total_products; $order_invoice->total_products_wt = $this->total_products_wt; $order_invoice->total_shipping_tax_excl = $this->total_shipping_tax_excl; $order_invoice->total_shipping_tax_incl = $this->total_shipping_tax_incl; $order_invoice->shipping_tax_computation_method = $tax_calculator->computation_method; $order_invoice->total_wrapping_tax_excl = $this->total_wrapping_tax_excl; $order_invoice->total_wrapping_tax_incl = $this->total_wrapping_tax_incl; // Save Order invoice $order_invoice->add(); $order_invoice->saveCarrierTaxCalculator($tax_calculator->getTaxesAmount($order_invoice->total_shipping_tax_excl)); // Update order_carrier $id_order_carrier = Db::getInstance()->getValue(' SELECT `id_order_carrier` FROM `'._DB_PREFIX_.'order_carrier` WHERE `id_order` = '.(int)$order_invoice->id_order.' AND (`id_order_invoice` IS NULL OR `id_order_invoice` = 0)'); if ($id_order_carrier) { $order_carrier = new OrderCarrier($id_order_carrier); $order_carrier->id_order_invoice = (int)$order_invoice->id; $order_carrier->update(); } // Update order detail Db::getInstance()->execute(' UPDATE `'._DB_PREFIX_.'order_detail` SET `id_order_invoice` = '.(int)$order_invoice->id.' WHERE `id_order` = '.(int)$order_invoice->id_order); // Update order payment if ($use_existing_payment) { $id_order_payments = Db::getInstance()->executeS(' SELECT DISTINCT op.id_order_payment FROM `'._DB_PREFIX_.'order_payment` op INNER JOIN `'._DB_PREFIX_.'orders` o ON (o.reference = op.order_reference) LEFT JOIN `'._DB_PREFIX_.'order_invoice_payment` oip ON (oip.id_order_payment = op.id_order_payment) WHERE (oip.id_order != '.(int)$order_invoice->id_order.' OR oip.id_order IS NULL) AND o.id_order = '.(int)$order_invoice->id_order); if (count($id_order_payments)) { foreach ($id_order_payments as $order_payment) Db::getInstance()->execute(' INSERT INTO `'._DB_PREFIX_.'order_invoice_payment` SET `id_order_invoice` = '.(int)$order_invoice->id.', `id_order_payment` = '.(int)$order_payment['id_order_payment'].', `id_order` = '.(int)$order_invoice->id_order); // Clear cache Cache::clean('order_invoice_paid_*'); } } // Update order cart rule Db::getInstance()->execute(' UPDATE `'._DB_PREFIX_.'order_cart_rule` SET `id_order_invoice` = '.(int)$order_invoice->id.' WHERE `id_order` = '.(int)$order_invoice->id_order); // Keep it for backward compatibility, to remove on 1.6 version $this->invoice_date = $order_invoice->date_add; $this->invoice_number = $order_invoice->number; $this->update(); } } This changes 20141234 to 20150001 if 2014 is not the current year. it might be dirty as hell, but hey! IT WORKS
  14. When b2b is enabled we are able to add a company name to a single customer i want that to be added to the list
×
×
  • Create New...