Vendor paid directly wrong Invoice for customer

  • Posts: 134
  • Thank you received: 6
8 years 9 months ago #228753

-- HikaShop version -- : 2.6.1
-- HikaMarket version -- : 1.6.7

This is the threat about the invoice that should not be generated if Vendor paid directly is set.

First shortly what happens now when vendor sells is that three (3) Invoices are generated:
1. Invoice from shop to Customer (that should not be present)
2. Invoice from Vendor to Customer - OK
3. Invoice from shop to Vendor (when generated) - Wrong Number


Here in details:

I've set Numbering format in HS according to our legislation rule (and as I know not only ours).
It says that Invoice number should be formated as consecutive numbers without gaps.

When shop sells everithing is OK and our (looking in HS->Orders) Invoice format is correct ... until vendor sells something and p.1 happens.


I think that two things should be changed:
1. No Invoice should be generated in HS when vendors sells (as shop don't sell here and this breaks the no gap consecutive number rule)
2. Invoice from shop to vendor should take the next number according to rule format (again this rule). And now totaly different number is assigned (C2)

I've put some configuration screenshots also.
There is a link to the other threat which became too big , but I think deltafidesign explains the same issue

Regards!

Last edit: 8 years 9 months ago by filiar.

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
8 years 9 months ago #228765

Hi,

Vendor invoice number format
There is an issue for that specific point : the format.
If you take a look at the view "backend | vendormarket | options" you will see that the part for the invoice number format will set the value " {automatic_code} " if the setting is empty.
That is a mistake because each time that you will save a vendor in the backend, he will use the automatic format for the invoice and it won't use your HikaShop default configuration.
You can remove the two lines in the view and then empty that setting for your vendors.
And that issue will be fix in the next release.

Otherwise, HikaMarket respect the consecutive number without gap ; because the generated invoice id (and so, number) are consecutive value for each vendor.
That's why the "main order" is related to the shop (and customer) and why the "sub orders" are only related to vendors.
The first invoice that the vendor will create will be the invoice " 1 " because it is really his first invoice in that store.

The order number have the same logic but there is a setting to use the same main order number in the sub orders.
That setting exist to help the communication between the store, the customers and the vendor.

No Invoice should be generated in HS
Unfortunately, that's not true for every one, like you said, you're using the mode "vendor paid directly".
As you know, HikaMarket handle various modes ; in some of them the store is selling to the customer.
Like the mode where the vendor are paid directly but with a "collect on delivery" payment method and no vendor limitation in the cart. Even if that mode is strange, it is something which can be used (and that I saw).

If you want me to change the HikaMarket behavior, I need to be sure that it won't impact negatively existing store.
If you want a new setting for a specific purpose which will be benefit for you and other users ; I need to know the exact rules and conditions.

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: 134
  • Thank you received: 6
8 years 9 months ago #228794

Ok.

Let programing away. Get real life.

1. If we sell as a shop. We need to supply invoce to customer.
2. If vendor sales he needs to do that to customer
3. When we tax vendor we need to supply him with invoice

I think this is the basics of accounting and must be implemented in your logic one way or another.

If vendor is payed directly in real life why should someone else generate invoice to customer?

Regards!

Last edit: 8 years 9 months ago by filiar.

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
8 years 9 months ago #228880

Hi,

I wasn't talking programming...

1. You are selling as a shop ; you are "alone", you are not in a marketplace.
The transaction is between your customer and your shop and involve only the products in your shop.

2. If the vendor perform the transaction and all that the customer want to buy is sold by the vendor.
In the real life, you do not have the right to sell something which does not belong to you.

3. I do not understand the meaning of "tax".

Even in the real life ; the payment is regarding the customer and the content he wants to buy.
I already got your point of view but the problem is that is still do not understand mine.

The market mode (commission mode) "Vendor paid directly" is a mode of processing the commission, the fees.
You indicate in which way the fees should be process between your marketplace and your vendors.
Everything else in your HikaMarket configuration will really define if the vendor is paid directly or not.
I had to rename the market mode setting choices because users were doing all wrong and did not read the documentation to understand how they should configure their marketplace.

So, if you think that just the fact that the setting "vendor paid directly" is on should let the vendor provide an invoice directly to the customer. I'm sorry but you are currently wrong.

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: 26158
  • Thank you received: 4028
  • MODERATOR
8 years 9 months ago #228901

But for now, if you want to display the "invoice id" from the subsale to the customer order ; you need to perform a view override.

In the view "front / order / show", you will see the code which display the invoice number

echo JText::_('INVOICE').':'.$this->element->order_invoice_number;
In your case, you want to load the "order_invoice_number" from the sub sale.
$order_invoice_number = $this->element->order_invoice_number;
$db = JFactory::getDBO();
$db->setQuery('SELECT order_invoice_number FROM '.hikashop_table('order').' WHERE order_type = '.$db->Quote('subsale').' AND order_parent_id = ' . $this->element->order_id . ' AND order_invoice_id > 0');
if(!HIKASHOP_J25)
	$invoice_numbers = $db->loadResultArray();
else
	$invoice_numbers = $db->loadColumn();
if( count($invoice_numbers) == 1)
	$order_invoice_number = reset($invoice_numbers);

echo JText::_('INVOICE').':'.$order_invoice_number;

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: 134
  • Thank you received: 6
8 years 9 months ago #228902

Jerome wrote: The market mode (commission mode) "Vendor paid directly" is a mode of processing the commission, the fees.
You indicate in which way the fees should be process between your marketplace and your vendors.


I really thought this means that money are directly transferred from customer to vendor. This should be the main reason of my misunderstanding.

Then is there a way and how to configure the system so that:
1. Vendors can sell directly (we get no money from customer for this deals and no Invoices should exist for that in HS)
2. We can sell directly (as we have our own goods or services). Invoice in HS
3. When we charge vendors commission/fee the Invoice to be generated in HS

And our HS invoices to vendor and to customer (2 and 3) should follow the consecutive numbering rule.

If there is no way please would you think of some more options so that could be done.

Sorry for the misunderstanding :)

Regards!

Last edit: 8 years 9 months ago by filiar.

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
8 years 9 months ago #228916

Hi,

If you want the money be directly transferred from the customer to the vendor ; you have to use a payment method which do that.
Because the payment method (plugin) will be the element which will transfert the money to the final destination.

You can tell HikaMarket that your vendor are paid directly (so it will calculate the fee/commission), but if you're using a payment method which transfert the money directly into your bank account.. You will generate the issue.
That setting can't be magical ; that's why his original spelling was not that (but nobody understood it with correct accounting names...)

That is why you need :
1 - To limit your vendors in the cart ; so the transaction will be only between the customer and one single and unique vendor.
2.1 - To display only the vendor payment methods.
2.2 - OR to use "paypal adaptive" in "classical" mode so the plugin will use dynamically the vendor paypal email.

If you have several vendors in the cart ; The real life rule is that you can only pay one personne with one payment transaction.
Having X vendors to pay in the same time with one transaction, is not possible.
Like you cannot pay 2 people with one single coin. You'll give it to one of the two person and he will deal with the other one himself.

Vendors can sell directly (we get no money from customer for this deals and no Invoices should exist for that in HS)
Okay. So we assume that your market is right configure to let the customers pay directly the vendors.

You have to modify HikaShop to not generate the invoice id when it already have an invoice number.
Replacing

if(!empty($order->order_status) && empty($order->order_invoice_id) && empty($order->old->order_invoice_id) && $order_type == 'sale') {
By
$already_invoice_number = ((!empty($order->order_invoice_number) && !empty($order->order_invoice_created)) || (!empty($order->old->order_invoice_number) && !empty($order->old->order_invoice_created)));
if(!empty($order->order_status) && empty($order->order_invoice_id) && empty($order->old->order_invoice_id) && $order_type == 'sale' && !$already_invoice_number) {
Then, you can see to copy the "order_invoice_number" and "order_invoice_created" from the HikaMarket subsale into the HikaShop sale (I don't have yet the code for HikaMarket ; I'll need more time for that).
Only in that case, you can stop HikaShop to generate invoice number for all "sales".

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.
The following user(s) said Thank You: filiar

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

  • Posts: 134
  • Thank you received: 6
8 years 9 months ago #228921

Hi, Jerome.

Thank you again.
I see that this code fixes the "extra" Invoice issue, and you are working on redirecting HM to HS Commission Invoice number. I hope you are considering that valuable for other users too and you are going to add some settings in backend to control the Invoicing process in future releases.

Respect for your efforts.

Last edit: 8 years 9 months ago by filiar.

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

  • Posts: 134
  • Thank you received: 6
8 years 9 months ago #228967

Hi, Jerome.

We had a discussion with the accountant about this topic. And it will be easier. The no gap consecutive number rule aloows adding groups (which I did not now). So we could have several groups of cunsecutive numbers. In this case they could be:

HS - Customer Group (starting with zero)
First Invoice to customer - 000000001
Second Invoice to customer - 000000002
....... and so on

HM - Vendor Group (starting with one)
First Invoice to vendor - 100000001
Second Invoice to customer - 100000002
....... and so on


Other group somewhere (starting with two or other number)

So good news is that HM - invoices to Vendors don't have to be from the same group as HS and no modification is needed about that.
I hope the code that you sent me yesterday would be enought for the "extra" Invoice issue but I haven't tested it yet.

Regards

Last edit: 8 years 9 months ago by filiar.
The following user(s) said Thank You: Jerome

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
8 years 9 months ago #229007

Hi,

That's great but unfortunately that's not possible in HikaShop.
HikaShop is creating consecutive numbers ; which means that it looks for the higher current number in order to get the next one.
So you cannot have "groups" in HikaShop.

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: 134
  • Thank you received: 6
8 years 9 months ago #229017

Jerome wrote: HikaShop is creating consecutive numbers ; which means that it looks for the higher current number in order to get the next one.


Yes this is the best way as I expect that too.

filiar wrote: 2. Invoice from shop to vendor should take the next number according to rule format


I was thinking of easier way for you to fix this automatic number (C2 from the example), that breaks the consecutive rule now.

Regards!

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
8 years 9 months ago #229032

Hi,

The idea behind the "invoice number format" per vendor is to allow a special formatting for your vendors.
So they can have a prefix number in they format.. But you can also use elements from the order object, like the "order_vendor_id" so it becomes generic (and dynamic).
That affect only the "invoice number" but it won't affect the invoice id ; which must start with "1" and follow a consecutive order without gap.

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: 134
  • Thank you received: 6
8 years 9 months ago #229057

Yes, and this is very useful, but this "C2" number is generated in HS, when you select some vendor orders and generate commission/fee invoice. This Invoice number should follow the shop format, not vendors, but it breaks it

Regards.

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
8 years 9 months ago #229058

Hi,

I'm sorry but I'm not following you anymore.

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: 134
  • Thank you received: 6
8 years 9 months ago #229083

Hi Jerome,

filiar wrote: First shortly what happens now when vendor sells is that three (3) Invoices are generated:
1. Invoice from shop to Customer (that should not be present)
2. Invoice from Vendor to Customer - OK
3. Invoice from shop to Vendor (when generated) - Wrong Number


Ok, from the top
1. You fixed that
2. Ok (I never said it has not been)
3. This is when you press "Generate Invoice" for the vendor fee/commision. Invoice is being generated in HS. This is absolutely correct, because we charge vendor commission fee. The only thing is that the number here does not follow the consecutive rule.

In other words. How to set numbering format for Vendor fee invoices?

Regards!

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
8 years 9 months ago #229139

Hi,

When you process the "vendor payment", it generates an entry in the HikaShop order table.
The order_type can be a "vendorpayment" or a "sale" depending the fee mode you're using (store paid directly / vendor paid directly).
To be more precise, when the store should send money to the vendor, the "order_type" is "vendorpayment".
But when the vendor need to pay the store, HikaMarket then use a "sale".

We use "sale" because it is easier for a lot of things. The vendor administrator can see the order in is listing and can pay it using a regular payment method available in the store.
It simplify a lot of things and if we use another order_type ; the order won't be visible in the customer side.

With HikaShop 3 and the new checkout system ; we can imagine that this payment part could be handle fully by HikaMarket which could use a special checkout workflow to let the vendors pay the store commission.
But for the moment ; it is clearly not something I will change or I'll recommend to change. It will break more thing that it could potentially solve.

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: 134
  • Thank you received: 6
8 years 9 months ago #229161

Hi, Jerome.

Thank you for the detailed responce.
We really don't need you to redesign the process. It i just it should be exept the number format.

filiar wrote: Hi Jerome,
How to set numbering format for Vendor fee invoices?


We would like to change "C2" to 1000000001 format. As here vendor pays us and the invoice number should follow our numbering rules.

What numbering rule does now the commission invoice follow (where from this C2 comes) and where are the number format settings to change C2 to 1000000001?

Regards!

Last edit: 8 years 9 months ago by filiar.

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
8 years 9 months ago #229175

Hi,

1 - Already explained in the HikaShop configuration documentation.
www.hikashop.com/support/documentation/5...nfig.html#main_order

2 - I don't understand that question.

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: 134
  • Thank you received: 6
8 years 9 months ago #229208

Hi, Jerome.

I really am starting to think there should be some problem in my explanations.
If there is such please tell me.

As I said I've set the format. I also applied screenshot of the settings!

filiar wrote: I've set Numbering format in HS according to our legislation rule (and as I know not only ours).
It says that Invoice number should be formated as consecutive numbers without gaps.

filiar wrote: I've put some configuration screenshots also.

There is a screenshot from the first post:



If customer buy something from the shop (not from vendor) the right Invoice number is generated!

filiar wrote: When shop sells everithing is OK and our (looking in HS->Orders) Invoice format is correct




When we generate commission invoice this format is broken.

filiar wrote: 2. Invoice from shop to vendor should take the next number according to rule format (again this rule). And now totaly different number is assigned (C2)


Shop - To - Vendor WRONG NUMBER

This screenshot is from HS. This is the invoice that we give vendor about the commission. The invoice should follow our format because we are the biller and vendor is the recipient. But that format is broken.

If I don't explain something or if you need additional screenshots, or if you need acces, please tell me. Because there should be some reason that you can not get the issue.


Regards!

Attachments:
Last edit: 8 years 9 months ago by filiar.

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
8 years 9 months ago #229247

Hi,

You (users) are lucky because you have to handle just one configuration of HikaMarket.
I got to handle several dozen of them in the same time ; dealing with modes which are totally opposite.
Please understand that I reply to a lot of messages every day (in the forum but also by email) and each message have a different context, a different configuration.

If you do not provide me your context clearly, it makes my task more difficult.
And more message there is in the thread ; more complicated it is to extract the current configuration (specially when that configuration can change and old message does not give the right information).

You just need to provide essential information.
1 - Market mode
2 - What you are doing

And then explain the issue.

Text in red or in bold does not help me much.
Explanation on the "why" could be useful sometimes but there is no need to concentrate on it.

To summarize your message in something I can understand in few seconds.

Market mode : vendors paid directly.
In the backend, we generate the vendor invoice for our commissions.

While HikaShop is configured with the invoice format " 1{id size="9"} ", the invoice number of that invoice is " C2 ".


And I already made some patchs for next HikaMarket release and one of them might be related to your question.
In the HikaMarket order class ; you can replace
if($vendor_id > 0) {
	if(!empty($order->order_status) && empty($order->order_invoice_id) && empty($order->old->order_invoice_id)) {
By
if($vendor_id > 0 && $order_type == 'subsale') {
	if(!empty($order->order_status) && empty($order->order_invoice_id) && empty($order->old->order_invoice_id)) {
to avoid the fact HikaMarket can interact with the invoice number on other type of orders.

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.118 seconds
Powered by Kunena Forum