<div dir="ltr">Hello Guys,<div><br></div><div>We are developing some Customization programming for KOHA 3.12 to meet our requirements, I have trouble in creation of basket in <a href="http://neworderempty.pl">neworderempty.pl</a> i have added the form in template of neworderempty.tmpl </div>
<div><br></div><div><div> my $op = $input ->param('op');</div><div> my $booksellerid = $input->param('booksellerid');</div><div> my $branches = GetBranches;</div><div><br></div><div> if ( $op eq 'add_form' ) {</div>
<div> my @contractloop;</div><div> my $basket;</div><div><br></div><div> my $bookseller = GetBookSellerFromId($booksellerid);</div><div> my $count = scalar @contractloop;</div><div> if ( $count > 0) {</div>
<div> $template->param(contractloop => \@contractloop,</div><div> basketcontractnumber => $basket->{'contractnumber'});</div><div> }</div><div> my @booksellers = C4::Bookseller::GetBookSeller();</div>
<div> $template->param( add_form => 1,</div><div> basketname => $basket->{'basketname'},</div><div> basketnote => $basket->{'note'},</div><div> basketbooksellernote => $basket->{'booksellernote'},</div>
<div> booksellername => $bookseller->{'name'},</div><div> booksellerid => $booksellerid,</div><div> basketno => $basketno,</div><div> booksellers => \@booksellers,</div>
<div> deliveryplace => $basket->{deliveryplace},</div><div> billingplace => $basket->{billingplace},</div><div> );</div><div><br></div><div> my $billingplace = $basket->{'billingplace'} || C4::Context->userenv->{"branch"};</div>
<div> my $deliveryplace = $basket->{'deliveryplace'} || C4::Context->userenv->{"branch"};</div><div> # Build the combobox to select the billing place</div><div> my @billingplaceloop;</div>
<div><br></div><div> my $branches = C4::Branch::GetBranchesLoop( $billingplace );</div><div> $template->param( billingplaceloop => $branches );</div><div> $branches = C4::Branch::GetBranchesLoop( $deliveryplace );</div>
<div> $template->param( deliveryplaceloop => $branches );</div><div><br></div><div>#End Edit</div><div><br></div><div>} elsif ( $op eq 'add_validate' ) {</div><div> #New basket<br></div><div> # creation of basket per day basis for every vendor and all the orders for that day</div>
<div> # will be added to the same basket of creation</div><div> my $today = C4::Dates->today;</div><div> print $today;</div><div> my $dt = DateTime->now; # Stores current date and time as datetime object</div>
<div> my $todaysdate = $dt->ymd;</div><div> my $dbh = C4::Context->dbh;</div><div> my $sql = q{ SELECT basketno, booksellerid, creationdate FROM aqbasket WHERE creationdate = ? AND booksellerid=?};</div>
<div> my $sth = $dbh->prepare($sql);</div><div> $sth->execute($todaysdate, $booksellerid);</div><div> if (my @basketdetails = $sth->fetchrow_array ){</div><div> my @data = @basketdetails;</div>
<div> $basketno = splice(@data,0,1);</div><div> $template->param(basketno => $basketno);</div><div> }else{</div><div> $basketno = NewBasket(</div><div> $booksellerid,</div>
<div> $loggedinuser,</div><div> $input->param('basketname'),</div><div> $input->param('basketnote'),</div><div> $input->param('basketbooksellernote'),</div>
<div> $input->param('basketcontractnumber') || undef,</div><div> $input->param('deliveryplace'),</div><div> $input->param('billingplace'),</div><div> );</div>
<div> $template->param(basketno => $basketno);</div><div> }</div></div><div>at the template end i have set it with </div><div><br></div><div><input type="hidden" name="op" value="add_validate" /><br>
</div><div><br></div><div>to activate the new basket function when i save but doesn't seem inserting values for basket details in aqbasket table </div><div><br></div><div>can any one help me please, thanks in advance</div>
<div><br></div><div>Regards</div><div><br></div><div>Arunkumar</div><div><br></div></div>