Jump to content

jeffz

Members
  • Content count

    28
  • Joined

  • Last visited

About jeffz

  • Birthday 03/23/1967

Profile Information

  • Real Name
    Jeff
  • Gender
    Male
  • Location
    London
  • Website
  1. jeffz

    [CONTRIBUTION] CCGV (trad)

    function calculate_tax_deduction might malfunction. Please inspect my calculations below. If I do something incorrectly setting up this contribution, please post in here on this forum. -------------------------------------------------------------- see examples first (products, prices and VAT levels applied are fictitious, as eg. cameras are not sold with 0%VAT): sample 1: ----------- settings: all true, Re-calculate Tax: none, Class: none , coupon 20%, 2nd and 3rd items eligible No. Ordered Items Tax Rate Gross Totals 1 x Panasonic [DMCFS20EB] - 10.1 Megapixel... 0.00% £166.80 £166.80 1 x Panasonic [TH42PX80B] - Free Padestal... 17.50% £669.99 £669.99 2 x Atacama Audio [sL1000] - Atacama ... 5.00% £226.79 £453.58 Order Sub-Total : £1,290.37 Free delivery (weekdays only) : £0.00 Discount Coupons - #33333: £-224.72 VAT17.5%: £99.79 VAT5%: £21.60 Total: £1,065.65 sample 2: ----------- settings: all true, Re-calculate Tax: standard, Class: none, coupon 20%, 2nd and 3rd items eligible No. Ordered Items Tax Rate Gross Totals 1 x Panasonic [DMCFS20EB] - 10.1 Megapixel... 0.00% £166.80 £166.80 1 x Panasonic [TH42PX80B] - Free Padestal... 17.50% £669.99 £669.99 2 x Atacama Audio [sL1000] - Atacama ... 5.00% £226.79 £453.58 Array ( [unknown tax rate] => 0 [VAT17.5%:] => 79.8285976809 [VAT5%:] => 17.279247619 ) Order Sub-Total : £1,290.37 Free delivery (weekdays only): £0.00 Discount Coupons - #33333: £-224.72 Customer Surcharge: £0.00 Customer Discount: £0.00 VAT17.5%: £79.83 VAT5%: £17.28 Total: £1,041.37 explanation: sample1: tax stays unchanged, even though coupon was applied and Total was changed and tax as well is different as you cannot charge same tax of discounted amounts. In such case, I guess, tax should have been recalculated. In sample 2 tax was recalculated, but also - for some reason, changes were applied to Total. -------------------------------------------------------------------- Let's see info flow outside of this contribution logic. case 1 (tax out of scope of interest): ============================== eligible products for discount: 1 x Panasonic [TH42PX80B] - Free Padestal... 17.50% £669.99 £669.99 2 x Atacama Audio [sL1000] - Atacama ... 5.00% £226.79 £453.58 --------------- total_eligible: £1,123.57 coupon value: £224.72 total_eligible_after_coupon_substraction: £1,123.57 - £224.72 = £898.85 £898.85 - is how much you have left after you take away coupon from total of eligible products. NON-eligible products for discount: 1 x Panasonic [DMCFS20EB] - 10.1 Megapixel... 0.00% £166.80 £166.80 --------------- total_NON-eligible: £166.80 new order_total => £898.85 + £166.80 = £1065.65 In plain English: new order_total is a sum of what you have left after you applied coupon to eligible products plus sum of products non-eligible. case 2 (tax calculation): ============================== total_eligible: £1,123.57 What part in total of eligible products each eligible products constitutes : 1. Panasonic [TH42PX80B] - £669.99/£1,123.57 = 0.5963 2. Atacama Audio [sL1000] - £453.58/£1,123.57 = 0.4037 How does it translates into coupon value absorbed (coupon value - £224.72): 1. Panasonic [TH42PX80B] - 0.5963 x £224.72 = £134.00 2. Atacama Audio [sL1000] - 0.4037 x £224.72 = £90.72 Let's calculate coupon tax for both eligible products: 1. Panasonic [TH42PX80B] - £134.00 - (£134.00 / 1.175) = £19.96 2. Atacama Audio [sL1000] - £90.72 - (£90.72 / 1.05) = £4.32 Let's substract this coupon tax from original tax before coupon was applied (tax re-calculation, see sample 1): VAT17.5% : £99.79 - £19.96 = 79.83 VAT5% : £21.60 - £4.32 = £17.28 So logically, proper display in such case would be as below, which is a mix of both samples above. I wonder where £1,041.37 is coming from. In real life, business would loose money. ============================================ No. Ordered Items Tax Rate Gross Totals 1 x Panasonic [DMCFS20EB] - 10.1 Megapixel... 0.00% £166.80 £166.80 1 x Panasonic [TH42PX80B] - Free Padestal... 17.50% £669.99 £669.99 2 x Atacama Audio [sL1000] - Atacama ... 5.00% £226.79 £453.58 Order Sub-Total : £1,290.37 Free delivery (weekdays only) : £0.00 Discount Coupons - #33333: £-224.72 VAT17.5%: £79.83 VAT5%: £17.28 Total: £1,065.65
  2. Hello Skittles - regards from London How is ole'good Uncle Sam doing these days? I really enjoyed time I spent there. :rolleyes: My first thought on this is there may be a problem with your installation. My osCo installation seems to be fine (but I wouldn't stake my "tender parts" on it). Shows no problems besides this one. Which is not actually a major one. Is it safe to assume the "Problem Messages Received" (above) are from the Admin area? This is actually the only place where problem surfaces. Were you able to run the SQL Utility? SQL seems to be fine. I tested it. BTW: which utility you have in mind? Have you tested the product _info page? Product_info.php is fine'n'dandy. That's why I love your contribution - it is so scalable. The only problem is with dbase writing. I assume it is the base issue. But I must admit - I didn't do any code inspection or thorough testing to narrow down the problem. I intend to do it as soon I get some free time. What other contributions, if any, do you have installed? (Perhaps there is a conflict?) That came to me also. I've got a few contributions: 1. CCGV-trad, 2. totally rewritten by myself 1.8 step-by-step manual order entry 3. PayPal (I do not use it thou) ... and a few more ... plus some more stuff by "yours truly" - I have to post it one day - some people may find some of it handy - especially if they deal with osCo as primary sales and stock management system ( both on- and offline) in a multi-branch environment. Just question of wrapping it for people who do not necessarily think that coding could actually become a way of life ;) However I do not think there is a case of conflict. Why? Problem is with relating products in Admin section. Once products are related - all is displayed as it should. I'll try to help you figure this out and get it running correctly on you site. Thank you Skittles, I willl look into it as well and let you (and everybody else) know when I get these wheels on the road. Regards, Jeff
  3. I have just tried this contribution - it is really something. I have some problems thou - I wonder If there are more like me. I do not want to reinvent the wheel here so before I get into inspecting code, I wonder if solution is not out there. --------- DESCRIPTION: Fault is in MSIE (tested: 6.0 and 7.0), opera 8 and Netscape (when in MSIE mode). MSIE loads page but You can't add any additional relationships. Firefox works fine. Opera says nothing, but refuses to work etc. PROBLEM MESSAGES RECEIVED: 1. documents.forms.0.formview - is null or not an object 2. unterminated string constant (a few times) 3. object expected Anybody has come across this? Regards, jeffz
  4. Do not use CHANGE 1. Small bug. Will post right version soon.
  5. I might have missed post already which resolved this issue - but I didn't find it. I have noticed that system only adds attribute price, and refuses to substract any discounts (price_prefix minus). --------------- Example: product - size: normal; price: £100 attributes: product - size small: - £ 25 (attribute discount minus £25) product - size large: + £30 (attribute price increase plus £30) --------------- Anybody has any fix for that? ============================== here are a few minor things from me: ============================== Since My version of osCo is heavily customized I cannot dish out install-ready files. If you want to use these few changes - insert them by hand. Apply changes to: step_by_step_orders_v1.8 ============================================================================ CHANGE 1: reason: original code returns Special Price even if Special offer is disabled or expired, this change will let you store system to switch back to regular price, if special price is disabled or expired, IS:----------------------------- // risolviamo il bug delle offerte $rs_offerte = tep_db_query("select * from specials where products_id ='". $add_product_products_id."'"); $offerte = tep_db_fetch_array($rs_offerte); if ($offerte) { $p_products_price = $offerte['specials_new_products_price']; } SHOULD BE: ----------------------- /* */ // risolviamo il bug delle offerte // change by jp $rs_offerte = tep_db_query("select s.specials_new_products_price, s.status, p.products_price from " . TABLE_SPECIALS . " s, " . TABLE_PRODUCTS . " p where p.products_id = s.products_id and s.products_id ='". $add_product_products_id ."'"); $offerte = tep_db_fetch_array($rs_offerte); if (($offerte['specials_new_products_price'] >= 0) && ($offerte['status'] != 0)) { $p_products_price = $offerte['specials_new_products_price']; } else { $p_products_price = $offerte['products_price']; ================================== END======================== CHANGE 2: reason: when adding product with attributes, it is good to know what's the price change during operation itself - a purely informative accent for person taking order ... showing gross values step1: IS: ---------------------------- // Skip to Step 4 if no Options SHOULD BE: ----------------------- // Skip to Step 4 if no Options $options_tax_query = tep_db_query("select tr.tax_rate, p.products_tax_class_id, tr.tax_class_id from " . TABLE_TAX_RATES . " tr, ". TABLE_PRODUCTS ." p where products_tax_class_id = tax_class_id AND p.products_id = '" . $add_product_products_id . "'"); $options_tax = tep_db_fetch_array($options_tax_query); step 2: IS:----------------------------- extract($row,EXTR_PREFIX_ALL,"db"); $Options[$db_products_options_id] = $db_products_options_name; $ProductOptionValues[$db_products_options_id][$db_products_options_values_id] = $db_products_options_values_name; SHOULD BE: ----------------------- // change by jp ... extract($row,EXTR_PREFIX_ALL,"db"); $Options[$db_products_options_id] = $db_products_options_name; $ProductOptionValues[$db_products_options_id][$db_products_options_values_id] = $db_products_options_values_name; $ProductOptionValues[$db_products_options_id][$db_products_options_values_id] .= ' '; $ProductOptionValues[$db_products_options_id][$db_products_options_values_id] .= $db_price_prefix; $ProductOptionValues[$db_products_options_id][$db_products_options_values_id] .= number_format($db_options_values_price * (1 + ($options_tax['tax_rate'] / 100)),2); // to get nett values remove following: * (1 + ($options_tax['tax_rate'] / 100)) ================================================================================ = CHANGE 3: reason: adds discount and shipping as gross IS --------------------- $RunningTax += $ot_value * $products_details['tax'] / $order->info['currency_value'] / 100 ; // corrected tax by cb SHOULD BE: ----------------------- //// corrected by jp $RunningTax += ($ot_value /** $products_details['tax']*/ / $order->info['currency_value']) /1000000000000 ; // // *)tax commented out to change nett discount to gross // **) divided by 1000000000000 to avoid round-up discrepancy (mistake) up to a billion range ================================================================================ = CHANGE 4: reason: shows attribute price difference as gross (with tax) IS --------------------- // Has Attributes? if (sizeof($order->products[$i]['attributes']) > 0) { for ($j=0; $j<sizeof($order->products[$i]['attributes']); $j++) { $orders_products_attributes_id = $order->products[$i]['attributes'][$j]['orders_products_attributes_id']; echo '<br><nobr><small> <i> - ' . "<input name='update_products[$orders_products_id][attributes][$orders_products_attributes_id][option]' size='32' value='" . tep_parse_input_field_data($order->products[$i]['attributes'][$j]['option'], array("'"=>""")) . "'>" . ': ' . "<input name='update_products[$orders_products_id][attributes][$orders_products_attributes_id][value]' size='25' value='" . tep_parse_input_field_data($order->products[$i]['attributes'][$j]['value'], array("'"=>""")); if ($order->products[$i]['attributes'][$j]['price'] != '0') echo ' (' . $order->products[$i]['attributes'][$j]['prefix'] . $currencies->format($order->products[$i]['attributes'][$j]['price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . ')'; echo "'>"; echo '</i></small></nobr>'; } } SHOULD BE : ------------------------------- // Has Attributes? if (sizeof($order->products[$i]['attributes']) > 0) { for ($j=0; $j<sizeof($order->products[$i]['attributes']); $j++) { $orders_products_attributes_id = $order->products[$i]['attributes'][$j]['orders_products_attributes_id']; echo '<br><nobr><small> <i> ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value']; if ($order->products[$i]['attributes'][$j]['price'] != '0') echo ' (' . $order->products[$i]['attributes'][$j]['prefix'] . $currencies->format($order->products[$i]['attributes'][$j]['price'] * $order->products[$i]['qty'] * (1 + ( $order->products[$i]['tax'] / 100)) , true, $order->info['currency'], $order->info['currency_value']) . ')'; // delete * (1 + ( $order->products[$i]['tax'] / 100)) to put back net values -- fixed by jp echo '</i></small></nobr>'; } } ================================================================================ = CHANGE 5: reason: if you do not like disappearing elements in "Discount, Shipping and Total" section, find and comment out (or delete) as below /* elseif (($ot_total_id > 0) && ($ot_class != "ot_shipping")) { // Delete Total Piece $Query = "delete from " . TABLE_ORDERS_TOTAL . " where orders_total_id = '$ot_total_id'"; tep_db_query($Query); } */ ================================================================================ = CHANGE 6: reason: if you'd rather live without occasional mish-mash of order of elements in "Discount, Shipping and Total" due to sort order change in database add following code to continually realign it: // 1.5.2.2b - Let's take care of mixed-up sort order. // inserted by jp. $Query = 'UPDATE ' . TABLE_ORDERS_TOTAL . ' SET sort_order = "1" WHERE class = "ot_subtotal" AND orders_id = "' . (int)$oID . '"'; tep_db_query($Query); $Query = 'UPDATE ' . TABLE_ORDERS_TOTAL . ' SET sort_order = "2" WHERE class = "ot_customer_discount" AND orders_id = "' . (int)$oID . '"'; tep_db_query($Query); $Query = 'UPDATE ' . TABLE_ORDERS_TOTAL . ' SET sort_order = "3" WHERE class = "ot_shipping" AND orders_id = "' . (int)$oID . '"'; tep_db_query($Query); $Query = 'UPDATE ' . TABLE_ORDERS_TOTAL . ' SET sort_order = "4" WHERE class = "ot_tax" AND orders_id = "' . (int)$oID . '"'; tep_db_query($Query); $Query = 'UPDATE ' . TABLE_ORDERS_TOTAL . ' SET sort_order = "5" WHERE class = "ot_total" AND orders_id = "' . (int)$oID . '"'; tep_db_query($Query);
  6. jeffz

    OSC-Affiliate

    I noticed a disturbing problem I tested that on customized version, but also same problem appears on standard new installation. Here's description: 1. I created 2 separate acounts for 2 affiliates 2. prepared and placed two banners (one for each affiliates with approprate code - ....php?ref=1&affiliate_banner_id=2 ....php?ref=2&affiliate_banner_id=2) 3. banners were placed on defferent www sites for testing. ---problem bottom line: when I tried to test both banners I noticed, that always affiliate with higher ID number gets entire credit for all transactions and nothing gets credited to account of second affiliate. Have anybody experienced anything sililar? ---- and another thing automatic billing fails to take effect even when biling time (in admin/configuration/affiliate) is set to eg. one day. jeffz
  7. jeffz

    OSC-Affiliate

    Yupp, That was also my innitial recollection of this situation. But on the other hand Sales section works fine, so maybe it is just some not necesarily flawless coding? I will work on that, the only "harm" which may come out of that is that I get to know php better :) Jeffz
  8. jeffz

    OSC-Affiliate

    Hello Vger, Thank you for your reply... and yupp .. I haven't noticed that - since I do not use german ... but that has nothing to do with that little problem I noticed (at least I think so). to recreate this problem do as follows: 1. Login to osCAffiliates (I,m testing v. 2.5) 2. go to: affiliate reports -> payment report (use English and it would be good if you have any transactions there - otherwise the flaw will not show) 3. now switch to another language - any language really apart from default English and you see the difference - transactions will disappear - leaving only info: "No payments have been recorded yet." (even thou they are there), the number of transactions will be reduced to zero and total at the bottom will show amount of missing transactions. See: my previous post for example regarding mentioned differences regards, Jeffz
  9. jeffz

    OSC-Affiliate

    I came across a situation: ================ When I tested mod in default language (English) in affiliate payment (file: affiliate_payment.php) all was fine. But in other languages there was a problem. Here's description: 1. example - default language : Your Payments: 2 Payment-ID [?] Payment Date [?] Affiliate Earnings [?] Payment Status [?] 2-------------------06/01/2006-----------------GBP11.57----------------Paid 1-------------------05/31/2006-----------------GBP17.19----------------Paid Displaying 1 to 2 (of 2 payments) Result Pages: 1 Your current earnings amount to: GBP28.76 2. example - Other language exmaple (I leave it in English - untranslated, but that what it shows in another LangMod) Your Payments: 0 Payment-ID [?] Payment Date [?] Affiliate Earnings [?] Payment Status [?] No payments have been recorded yet. Your current earnings amount to: GBP28.76 ================ Please note: a. Your payments = 0, and no payments recorded. I still analize code, but at this point unsuccessfully (no wonder, my adventure with PHP, MYsql is pretty fresh). this not for a client, so no rush, but if anyone points me in the right direction and help me to understand - I appreaciate very much. jeffz jeffz
  10. jeffz

    OSC-Affiliate

    guys - a little problem I have - IPN doesn't want to work together with osCAfilliate -- simply transactions are not being registered in affiliate sales ---------- what I did - 1. created affiliate account 2. generated a link and placed it on outside site 3. used link to buy and nothing - no trace of transaction in affiliate sales record - other ways (cc, COD, check/money order) work fine. does it have anything to do with outside payment processing gateway? any thoughts to get me out of misery ? --- your HM tankman
  11. jeffz

    Official PayPal IPN Support Thread

    guys - a little problem I have - IPN doesn't want to work together with osCAfilliate -- simply transactions are not being registered in affiliate transactions/ sales any thoughts to get me out of misery ? --- HM tankman
  12. a few things in one post: 1. anybody tried Admin 3 addition to extension? can't make it work 2. PHP is not my lang by choice so before I start anything a Q: anybody knows how to extend this contrib by adding log register (who-did-what) 3. is this extension SQL injection resistant?
  13. jeffz

    [CONTRIBUTION] CCGV (trad)

    Geee ... you just beat me and my long post by a second ... -- so guys please forgive my longish post above ... - but it would be a nice thing to fix it ... I'll give it a whack once I collect myself a bit - who knows. And sorry for not reading everything in this thread - I live on borrowed time lately -- Anyway CCGV is awesome. Your HM Tank-man, jeffz
  14. jeffz

    [CONTRIBUTION] CCGV (trad)

    Just to follow up on my previous: --------- It seems that there is a problem - however I hope you prove me wrong (and tell me the remedy) , or maybe it is the way it should be - but I doubt it. ---------- Description: Whenever sorting order of Discount Coupon is greater than sorting order of Gift Voucher you cannot redeem funds you have on Gift Voucher account, because the tick box in Credits Available Section is missing. ----------- I noticed that irregularity in my heavily changed version - so I thought - it is probably one of contributions or my own additions which makes it out of sync. So I installed clean osCo (2.2ms2-051113), I uploaded set of files provided by CCGV, I uploaded ccgv.sql using phpMyAdmin into unmodified, osCo provided, sample dbase. And at this point I started testing. eg. I used configuration provided in CCGV Manual, given below: Sub-total - Sort order = 1 Shipping - Sort order = 2 Gift Voucher - Sort order = 740 Discount Coupons - Sort Order =760 Tax - Sort order = 800 Total - Sort Order = 900 I tried many other combinations. I tried to remedy that, but so far I failed. If I'm doing something wrong, I would love to find out the right way. I hope somebody came across that and already know-how ;) jeffz
  15. jeffz

    [CONTRIBUTION] CCGV (trad)

    when assigning lower sort code for gift voucher than coupon - voucher tick box in checkout_payment.php, Credits availabe section disappears - any idea why?
×