Invoice for vendor and customer

  • Posts: 25997
  • Thank you received: 4004
  • MODERATOR
11 years 1 month ago #91212

Hi,

I will test the code on my side and make some modifications.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 272
  • Thank you received: 13
11 years 1 month ago #91227

Really thank you. I appreciate so much your grat support!

Please Log in or Create an account to join the conversation.

  • Posts: 25997
  • Thank you received: 4004
  • MODERATOR
11 years 1 month ago #92135

Hi,

I finished my tests and validate the new option.
I think the best is that I publish a new version or that I send you the preview package by email.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 272
  • Thank you received: 13
11 years 1 month ago #92138

Hi Jerome,

first thank you so much for your great support. Sure this will be a very very good review on JED.

Now, let's do what you think is better. If you wanna let me test it before you officially release it, I'm available for testing it.

Thanks so much!

Please Log in or Create an account to join the conversation.

  • Posts: 25997
  • Thank you received: 4004
  • MODERATOR
11 years 1 month ago #92147

Hi,

Mail sent !

Best regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 272
  • Thank you received: 13
11 years 1 month ago #94246

Hi Jerome,

Did you receive my last email about 2 weeks ago?

Any news?

Thanks so much.

Please Log in or Create an account to join the conversation.

  • Posts: 25997
  • Thank you received: 4004
  • MODERATOR
11 years 1 month ago #94299

Hi,

I still have your request in my TODO list.
But the problem is that, I do not need number, I need variables in order to implement the modifications.

I read your email several times and I don't understand what I have to modify, I tried to convert your numbers with variables with any success.
I still don't understand which values are incorrect, if it's the invoice value or not.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 272
  • Thank you received: 13
11 years 1 month ago #94305

Hi Jerome, thanks for answer.

I try to explain better.


This is the correct way the invoice system should work when I "send" money to vendor when I "pay" him (send him total money minus my fee, VAT and PayPal commission.)

My VAT is 21%. Paypal fee is 0,77€ in this example.

If the buyer buy something that cost 10€ + VAT + PayPal Fee, he spends 10€ + 2,10€ + 0,77€ = 12,87€

I earn 30% of 10€ and vendor earn 70% of 10€. Now, is the vendor that sell, so he will provide to buyer an invoice for 12,87€, but this doesn't matter to me. Vendor can generate manually his invoices.

Now, I must send to vendor 7€ + VAT (21% of 7€ = 1,47€) = 8,47€. This is the real amount of money I must send to him when I "pay" him.

Then I take 12,87€-8,47€=4,4€

This is divided into 3 parts and I must generate an invoice with this items for the vendor:

- my fee = 3€ (30% of 10€)
- paypal fee = 0,77€
- VAT = 0,63€ (21% of my fee: 3€)

Total = 4,4€


Thats the right way I should pay the vendor and also the right way I need to generate the invoice with those 3 items.

Please Log in or Create an account to join the conversation.

  • Posts: 25997
  • Thank you received: 4004
  • MODERATOR
11 years 1 month ago #94323

Hi,

Some variables are missing. So for me your process is "wrong".

We have the values for:
- Order full price (with tax)
- Products price (with tax)
- Products tax

- Shipping price (without tax)
- Shipping tax price

- Payment price (without tax)
- Payment tax price

- Discount price (without tax)
- Discount tax price

- Vendor total

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 272
  • Thank you received: 13
11 years 1 month ago #94332

- Order full price (with tax) => 10€ + VAT + PayPal Fee: 10€ + 2,10€ + 0,77€ = 12,87€
- Products price (with tax)=> 10€ + VAT = 12,10€
- Products tax => VAT (21%) = 2,10€

- Shipping price (without tax) = 0€
- Shipping tax price => VAT (21%) = 0€

- Payment price (without tax) => I mean with this the amount that I have to "pay" (send money) to vendor = 7€
- Payment tax price = VAT (21% of 7€) = 1,47€

- Discount price (without tax) = 0€
- Discount tax price => VAT (21%) = 0€

- Vendor total = 7€ + VAT (21% of 7€ = 1,47€) = 8,47€

Please Log in or Create an account to join the conversation.

  • Posts: 25997
  • Thank you received: 4004
  • MODERATOR
11 years 1 month ago #94335

Hi,

I don't want values, I already have them.
You want to process a price for the invoice. I want the algorithm to process it and I gave you, the variable, that you can use for it.

I want a complete algorithm, which would work for every once. If not, it would not be included in HikaMarket and should be done as custom development.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 272
  • Thank you received: 13
11 years 1 month ago #94347

X = Product price without VAT
Y = Reverse of the fee that I take over the vendor without VAT. In my case I set a fee of 30% (ALFA = 0.3) on the Vendor so Y = 1-0.3 = 0.7
Z = Total amount I want to "pay" to Vendor with VAT
TAX = 21% = 0.21 according to Taxes rules (in my case is 21%)
ALFA = my fee over vendor = 30% = 0.3
BETA = PayPal fee = in my case is 0.77€ as setted in payments methods (this is automatically calculated by hikashop when I set paypal plugin)
GAMMA1 = Shipping price = 0€ in my case
GAMMA2 = Shipping tax price = 0€ in my case
TETA1 = Discount price = 0€ in my case
TETA2 = Discount tax price = 0€ in my case

Amount of money I "pay" to vendor is Z = (X + TAX*X)*Y + GAMMA1+GAMMA2-TETA1-TETA2 = (10 + 0.21*10)*0.7 + 0+0-0-0 = 8,47€


Invoice for vendor should report those items=>

ALFA (my fee) = X*ALFA = 10€*0.3 = 3€
PayPal fee = 0,77€
VAT = ALFA*TAX = 3€*0.21 = 0,63€ (21% of my fee: 3€)

SubTotal = ALFA + PayPal fee = 3€ + 0,77€
Total = ALFA + PayPal fee + VAT = 3€ + 0,77€ + 0,63€ = 4,40€




In this alghoritm I consider that Hikashop already calculates some variables as Shipping, Discount etc...
If something is missing, please tell me.

The following user(s) said Thank You: Jerome

Please Log in or Create an account to join the conversation.

  • Posts: 25997
  • Thank you received: 4004
  • MODERATOR
11 years 1 month ago #94561

Hi

I am sorry by your algorithm for me is "wrong", it could not fit to all users needs.
The fees are not just a percentage, it is quite more complicated.
You do not use the "vendor total" which is the most important value. The value already contains the discount impact in order to process the exact price that the vendor gains.
Shipping fees and payment fees are stored in the order and does not impact the vendor total. Maybe some options could be added in order to say if the shipping or payment fees should be pay to the vendor.

The VAT is not in my variable list, I could not know what it is, where it came from.
I will remove the feature from HikaMarket and let the possibility the create some these invoices thanks to plugins.
It is not generic, too much custom, to be integrated in HikaMarket.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 272
  • Thank you received: 13
11 years 1 month ago #94599

Jerome wrote: The VAT is not in my variable list, I could not know what it is, where it came from.


VAT = ALFA*TAX

TAX = according to Taxes rules specified in Hikashop Taxes (in my case is 21% it's called IVA in Italy)
ALFA = the fee I apply to vendor or products (can be a percentage or a fixed value)



Anyway I understand that this feature request is going into a "cul-de-sac"...

I cannot use Hikamarket at this point, but I'm not the only one who cannot use a software that work this way unless they want to use it NOT respecting laws or the correct way of payments, etc.., really sorry. Hikamarket could be a fantastic software, but really can't work at the moment.

I could just forget about the invoice feature, ok, I could manually generate every invoice when the vendor "pay" me, but the main problem is the amount of money I send him (or he pays me...): I cannot send 5,10€ to the vendor (as it do now with one example) when I must send him 8,47€ real!

Thanks so much anyway for trying to build a solution. Hope you'll find a solution in future.

Please Log in or Create an account to join the conversation.

  • Posts: 25997
  • Thank you received: 4004
  • MODERATOR
11 years 1 month ago #94604

Hi,

In HikaMarket 1.1.2, I created a trigger in order to move the invoice generation invoice into a plugin.
So, you can adjust your specific rules into the plugin.

I can't find a right generic process which would work with everybody, so the best way is that move this specific part into a plugin.

You have to adjust

$product->order_product_price = $currencyClass->convertUniquePrice($o->order_full_price - $o->order_shipping_price - $o->order_payment_price - $o->order_vendor_price, $o->order_currency_id, $vendor->vendor_currency_id);
In order to process the right price value for the vendor invoice.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 272
  • Thank you received: 13
11 years 1 month ago #94607

Thanks so much, I'll try to look at it to let it work for my needs.

Please Log in or Create an account to join the conversation.

  • Posts: 272
  • Thank you received: 13
11 years 1 month ago #94620

"order_full_price" already includes the PayPal cost? A moment it seems not including it. if not including it which is the variable for PayPal cost?

Please Log in or Create an account to join the conversation.

  • Posts: 25997
  • Thank you received: 4004
  • MODERATOR
11 years 1 month ago #94626

Hi

Paypal cost is stored into "order_payment_price".

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 272
  • Thank you received: 13
11 years 1 month ago #94628

Got this error when I try to pay the vendor with the plugin:

Fatal error: Call to a member function get() on a non-object in /home/account/public_html/plugins/hikamarket/vendorpayinvoice/vendorpayinvoice.php on line 35

Please Log in or Create an account to join the conversation.

  • Posts: 25997
  • Thank you received: 4004
  • MODERATOR
11 years 1 month ago #94644

Right,

The $shopConfig initilization was missing:

		$shopConfig = hikamarket::config(false);
		$confirmedStatus = $shopConfig->get('order_confirmed_status', 'confirmed');
You can add the line in your php file or re-download the zip, I updated it.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

Moderators: Obsidev
Time to create page: 0.093 seconds
Powered by Kunena Forum